diff options
author | Warner Losh <imp@FreeBSD.org> | 2020-02-03 17:35:11 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2020-02-03 17:35:11 +0000 |
commit | 58aa35d42975c298ca0adba705c042596303c9f5 (patch) | |
tree | 2558d2b720cda9c2799970cabc266e2ce4e3a8d3 | |
parent | eb24e1491f9900e922c78e53af588f22a3e9535f (diff) | |
download | src-58aa35d42975.tar.gz src-58aa35d42975.zip |
Remove sparc64 kernel support
Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs
Notes
Notes:
svn path=/head/; revision=357455
294 files changed, 52 insertions, 61270 deletions
diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile index 11c095a2255d..9fce7b9d467d 100644 --- a/lib/libkvm/Makefile +++ b/lib/libkvm/Makefile @@ -19,8 +19,7 @@ SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_minidump_mips.c \ kvm_powerpc.c kvm_powerpc64.c \ kvm_minidump_riscv.c \ - kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c \ - kvm_sparc64.c + kvm_minidump_powerpc64.c kvm_minidump_powerpc64_hpt.c INCS= kvm.h LIBADD= elf diff --git a/sys/Makefile b/sys/Makefile index 760c2073e5ee..688a00453b2d 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -8,7 +8,7 @@ CSCOPEDIRS= bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) -CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv sparc64 x86 +CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv x86 .else CSCOPE_ARCHDIR = ${MACHINE} .if ${MACHINE} != ${MACHINE_CPUARCH} diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index e58209300088..6ab6e94e8e38 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2716,17 +2716,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } -#if defined(__sparc64__) - /* - * For sparc64, we may need adjust the geometry of large - * disks in order to fit the limitations of the 16-bit - * fields of the VTOC8 disk label. - */ - if (scsi_da_bios_params(&start_ccb->ccg) != 0) { - start_ccb->ccb_h.status = CAM_REQ_CMP; - break; - } -#endif goto call_sim; case XPT_ABORT: { diff --git a/sys/cddl/compat/opensolaris/sys/atomic.h b/sys/cddl/compat/opensolaris/sys/atomic.h index b3a2f393afa4..674ca5b1ff24 100644 --- a/sys/cddl/compat/opensolaris/sys/atomic.h +++ b/sys/cddl/compat/opensolaris/sys/atomic.h @@ -91,7 +91,6 @@ atomic_dec_32_nv(volatile uint32_t *target) return (atomic_add_32_nv(target, -1)); } -#ifndef __sparc64__ static inline uint32_t atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval) { @@ -107,7 +106,6 @@ atomic_cas_32(volatile uint32_t *target, uint32_t cmp, uint32_t newval) #endif return (cmp); } -#endif #if defined(__LP64__) || defined(__mips_n32) || \ defined(ARM_HAVE_ATOMIC64) || defined(I386_HAVE_ATOMIC64) || \ @@ -124,7 +122,6 @@ atomic_add_64_nv(volatile uint64_t *target, int64_t delta) return (atomic_fetchadd_64(target, delta) + delta); } -#ifndef __sparc64__ static inline uint64_t atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval) { @@ -141,7 +138,6 @@ atomic_cas_64(volatile uint64_t *target, uint64_t cmp, uint64_t newval) return (cmp); } #endif -#endif static __inline void atomic_inc_64(volatile uint64_t *target) diff --git a/sys/cddl/contrib/opensolaris/common/lz4/lz4.c b/sys/cddl/contrib/opensolaris/common/lz4/lz4.c index 3a875565f4b4..ee7f1fbe99e2 100644 --- a/sys/cddl/contrib/opensolaris/common/lz4/lz4.c +++ b/sys/cddl/contrib/opensolaris/common/lz4/lz4.c @@ -246,16 +246,6 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, #endif /* - * FreeBSD: can't use GCC's __builtin_ctz when using sparc64 because - * gcc currently rely on libcompiler_rt. - * - * TODO: revisit this when situation changes. - */ -#if defined(__sparc64__) -#define LZ4_FORCE_SW_BITCOUNT -#endif - -/* * Compiler Options */ #if __STDC_VERSION__ >= 199901L /* C99 */ diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h b/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h index d694ea4844c3..f10bcec40a7b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/asm_linkage.h @@ -41,11 +41,6 @@ extern "C" { #define ASM_ENTRY_ALIGN 16 -#elif defined(__sparc64__) - -/* GCC uses 32-byte function alignment for UltraSPARC CPUs. */ -#define ASM_ENTRY_ALIGN 32 - #else #error Unsupported architecture. diff --git a/sys/conf/Makefile.sparc64 b/sys/conf/Makefile.sparc64 deleted file mode 100644 index 736f9cba3638..000000000000 --- a/sys/conf/Makefile.sparc64 +++ /dev/null @@ -1,49 +0,0 @@ -# Makefile.sparc64 -- with config changes. -# Copyright 1990 W. Jolitz -# from: @(#)Makefile.i386 7.1 5/10/91 -# $FreeBSD$ -# -# Makefile for FreeBSD -# -# This makefile is constructed from a machine description: -# config machineid -# Most changes should be made in the machine description -# /sys/sparc64/conf/``machineid'' -# after which you should do -# config machineid -# Generic makefile changes should be made in -# /sys/conf/Makefile.sparc64 -# after which config should be rerun for all machines. -# - -# Which version of config(8) is required. -%VERSREQ= 600012 - -STD8X16FONT?= iso - -.if !defined(S) -.if exists(./@/.) -S= ./@ -.else -S= ../../.. -.endif -.endif -.include "$S/conf/kern.pre.mk" - -MDOBJS= exception.o interrupt.o - -%BEFORE_DEPEND - -%OBJS - -%FILES.c - -%FILES.s - -%FILES.m - -%CLEAN - -%RULES - -.include "$S/conf/kern.post.mk" diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 0f570e89b781..2b67f4960eec 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2045,8 +2045,6 @@ device sound # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. -# snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only -# for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. # snd_cs4281: Crystal Semiconductor CS4281 PCI. # snd_csa: Crystal Semiconductor CS461x/428x PCI. (except @@ -2089,7 +2087,6 @@ device sound device snd_ad1816 device snd_als4000 device snd_atiixp -#device snd_audiocs device snd_cmi device snd_cs4281 device snd_csa diff --git a/sys/conf/files b/sys/conf/files index f09ffe13bc5f..32443799dc01 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1743,7 +1743,6 @@ dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci -dev/gem/if_gem_sbus.c optional gem sbus dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt @@ -1769,7 +1768,6 @@ dev/gpio/ofw_gpiobus.c optional fdt gpio dev/hifn/hifn7751.c optional hifn dev/hme/if_hme.c optional hme dev/hme/if_hme_pci.c optional hme pci -dev/hme/if_hme_sbus.c optional hme sbus dev/hptiop/hptiop.c optional hptiop scbus dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc @@ -1885,7 +1883,6 @@ dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp dev/isp/isp_pci.c optional isp pci -dev/isp/isp_sbus.c optional isp sbus dev/isp/isp_target.c optional isp dev/ispfw/ispfw.c optional ispfw dev/iwi/if_iwi.c optional iwi @@ -3009,9 +3006,7 @@ rtwn-rtl8821aufw.fw optional rtwn-rtl8821aufw | rtwnfw \ clean "rtwn-rtl8821aufw.fw" dev/safe/safe.c optional safe dev/scc/scc_if.m optional scc -dev/scc/scc_bfe_ebus.c optional scc ebus dev/scc/scc_bfe_quicc.c optional scc quicc -dev/scc/scc_bfe_sbus.c optional scc fhc | scc sbus dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc dev/scc/scc_dev_sab82532.c optional scc @@ -3171,7 +3166,6 @@ dev/tws/tws_hdm.c optional tws dev/tws/tws_services.c optional tws dev/tws/tws_user.c optional tws dev/uart/uart_bus_acpi.c optional uart acpi -dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_fdt.c optional uart fdt dev/uart/uart_bus_isa.c optional uart isa dev/uart/uart_bus_pccard.c optional uart pccard diff --git a/sys/conf/files.sparc64 b/sys/conf/files.sparc64 deleted file mode 100644 index 66d039934f98..000000000000 --- a/sys/conf/files.sparc64 +++ /dev/null @@ -1,146 +0,0 @@ -# This file tells config what files go into building a kernel, -# files marked standard are always included. -# -# $FreeBSD$ -# -# The long compile-with and dependency lines are required because of -# limitations in config: backslash-newline doesn't work in strings, and -# dependency lines other than the first are silently ignored. -# -atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ - no-obj no-implicit-rule before-depend \ - clean "atkbdmap.h" -# -sunkbdmap.h optional sunkbd_dflt_keymap \ - compile-with "kbdcontrol -P ${S:S/sys$/share/}/vt/keymaps -P ${S:S/sys$/share/}/syscons/keymaps -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h" \ - no-obj no-implicit-rule before-depend \ - clean "sunkbdmap.h" -# -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb -dev/atkbdc/atkbd.c optional atkbd atkbdc -dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc -dev/atkbdc/atkbdc.c optional atkbdc -dev/atkbdc/atkbdc_ebus.c optional atkbdc ebus -dev/atkbdc/atkbdc_isa.c optional atkbdc isa -dev/atkbdc/atkbdc_subr.c optional atkbdc -dev/atkbdc/psm.c optional psm atkbdc -dev/auxio/auxio.c optional auxio sbus | auxio ebus -dev/esp/esp_sbus.c optional esp sbus -dev/fb/creator.c optional creator sc -dev/fb/creator_vt.c optional creator vt -dev/fb/fb.c optional sc -dev/fb/gallant12x22.c optional sc -dev/fb/machfb.c optional machfb sc -dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/le/if_le_lebuffer.c optional le sbus -dev/le/if_le_ledma.c optional le sbus -dev/le/lebuffer_sbus.c optional le sbus -dev/ofw/ofw_bus_if.m standard -dev/ofw/ofw_bus_subr.c standard -dev/ofw/ofw_console.c optional ofw_console -dev/ofw/ofw_if.m standard -dev/ofw/ofw_standard.c standard -dev/ofw/openfirm.c standard -dev/ofw/openfirmio.c standard -dev/ofw/openpromio.c standard -dev/pcf/envctrl.c optional pcf ebus -dev/pcf/pcf_ebus.c optional pcf ebus -dev/sound/sbus/cs4231.c optional snd_audiocs ebus | \ - snd_audiocs sbus -dev/syscons/scgfbrndr.c optional sc -dev/uart/uart_cpu_sparc64.c optional uart -dev/uart/uart_kbd_sun.c optional uart sc | vt -dev/vt/hw/ofwfb/ofwfb.c optional vt -kern/kern_clocksource.c standard -kern/subr_dummy_vdso_tc.c standard -kern/syscalls.c optional ktr -kern/subr_sfbuf.c standard -libkern/ffs.c standard -libkern/ffsl.c standard -libkern/ffsll.c standard -libkern/fls.c standard -libkern/flsl.c standard -libkern/flsll.c standard -libkern/memcmp.c standard -sparc64/central/central.c optional central -sparc64/ebus/ebus.c optional ebus -sparc64/ebus/epic.c optional epic ebus -sparc64/fhc/clkbrd.c optional fhc -sparc64/fhc/fhc.c optional fhc -sparc64/isa/isa.c optional isa -sparc64/isa/isa_dma.c optional isa -sparc64/isa/ofw_isa.c optional ebus | isa -sparc64/pci/apb.c optional pci -sparc64/pci/fire.c optional pci -sparc64/pci/ofw_pci.c optional pci -sparc64/pci/ofw_pcib.c optional pci -sparc64/pci/ofw_pcib_subr.c optional pci -sparc64/pci/ofw_pcibus.c optional pci -sparc64/pci/ofw_pci_if.m optional pci -sparc64/pci/psycho.c optional pci -sparc64/pci/sbbc.c optional sbbc uart -sparc64/pci/schizo.c optional pci -sparc64/sbus/dma_sbus.c optional sbus -sparc64/sbus/sbus.c optional sbus -sparc64/sbus/lsi64854.c optional sbus -sparc64/sparc64/ata_machdep.c optional ada | da -sparc64/sparc64/autoconf.c standard -sparc64/sparc64/bus_machdep.c standard -sparc64/sparc64/cache.c standard -sparc64/sparc64/cam_machdep.c optional scbus -sparc64/sparc64/cheetah.c standard -sparc64/sparc64/clock.c standard -sparc64/sparc64/counter.c standard -sparc64/sparc64/db_disasm.c optional ddb -sparc64/sparc64/db_interface.c optional ddb -sparc64/sparc64/db_trace.c optional ddb -sparc64/sparc64/db_hwwatch.c optional ddb -sparc64/sparc64/dump_machdep.c standard -sparc64/sparc64/elf_machdep.c standard -sparc64/sparc64/exception.S standard no-obj \ - compile-with "${NORMAL_S} -mcpu=ultrasparc" -sparc64/sparc64/eeprom.c optional eeprom ebus | eeprom fhc | \ - eeprom sbus -sparc64/sparc64/gdb_machdep.c optional gdb -sparc64/sparc64/identcpu.c standard -sparc64/sparc64/in_cksum.c optional inet | inet6 -sparc64/sparc64/interrupt.S standard no-obj \ - compile-with "${NORMAL_S} -mcpu=ultrasparc" -sparc64/sparc64/intr_machdep.c standard -sparc64/sparc64/iommu.c standard -sparc64/sparc64/jbusppm.c standard -sparc64/sparc64/locore.S standard no-obj -sparc64/sparc64/machdep.c standard -sparc64/sparc64/mem.c optional mem -sparc64/sparc64/mp_exception.S optional smp \ - compile-with "${NORMAL_S} -mcpu=ultrasparc" -sparc64/sparc64/mp_locore.S optional smp -sparc64/sparc64/mp_machdep.c optional smp -sparc64/sparc64/nexus.c standard -sparc64/sparc64/ofw_machdep.c standard -sparc64/sparc64/pmap.c standard -sparc64/sparc64/prof_machdep.c optional profiling-routine -sparc64/sparc64/rtc.c optional rtc ebus | rtc isa -sparc64/sparc64/rwindow.c standard -sparc64/sparc64/sc_machdep.c optional sc -sparc64/sparc64/schppm.c standard -sparc64/sparc64/spitfire.c standard -sparc64/sparc64/ssm.c standard -sparc64/sparc64/stack_machdep.c optional ddb | stack -sparc64/sparc64/support.S standard \ - compile-with "${NORMAL_S} -mcpu=ultrasparc" -sparc64/sparc64/sys_machdep.c standard -sparc64/sparc64/swtch.S standard -sparc64/sparc64/tick.c standard -sparc64/sparc64/tlb.c standard -sparc64/sparc64/trap.c standard -sparc64/sparc64/tsb.c standard -sparc64/sparc64/uio_machdep.c standard -sparc64/sparc64/upa.c optional creator -sparc64/sparc64/vm_machdep.c standard -sparc64/sparc64/zeus.c standard - -# Zstd -contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C} diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 1e29b58663d4..56c0e76c25f6 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -154,18 +154,6 @@ CFLAGS+= -mno-relax .endif # -# For sparc64 we want the medany code model so modules may be located -# anywhere in the 64-bit address space. We also tell GCC to use floating -# point emulation. This avoids using floating point registers for integer -# operations which it has a tendency to do. -# -.if ${MACHINE_CPUARCH} == "sparc64" -CFLAGS.clang+= -mcmodel=large -fno-dwarf2-cfi-asm -CFLAGS.gcc+= -mcmodel=medany -msoft-float -INLINE_LIMIT?= 15000 -.endif - -# # For AMD64, we explicitly prohibit the use of FPU, SSE and other SIMD # operations inside the kernel itself. These operations are exclusively # reserved for user applications. @@ -315,5 +303,4 @@ LD_EMULATION_powerpc= elf32ppc_fbsd LD_EMULATION_powerpcspe= elf32ppc_fbsd LD_EMULATION_powerpc64= elf64ppc_fbsd LD_EMULATION_riscv64= elf64lriscv -LD_EMULATION_sparc64= elf64_sparc_fbsd LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}} diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 3819acce8c1f..078d79913634 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -93,8 +93,8 @@ BROKEN_OPTIONS+= OFED BROKEN_OPTIONS+= KERNEL_RETPOLINE .endif -# EFI doesn't exist on mips, powerpc, sparc or riscv. -.if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Msparc64} || ${MACHINE:Mriscv} +# EFI doesn't exist on mips, powerpc, or riscv. +.if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Mriscv} BROKEN_OPTIONS+=EFI .endif diff --git a/sys/conf/ldscript.sparc64 b/sys/conf/ldscript.sparc64 deleted file mode 100644 index aec138ed295f..000000000000 --- a/sys/conf/ldscript.sparc64 +++ /dev/null @@ -1,269 +0,0 @@ -/* $FreeBSD$ */ -OUTPUT_FORMAT("elf64-sparc-freebsd", "elf64-sparc-freebsd", - "elf64-sparc-freebsd") -OUTPUT_ARCH(sparc:v9) -ENTRY(_start) -SEARCH_DIR(/usr/lib); -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = kernbase + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rel.init : { *(.rel.init) } - .rela.init : { *(.rela.init) } - .rel.text : - { - *(.rel.text) - *(.rel.text.*) - *(.rel.gnu.linkonce.t.*) - } - .rela.text : - { - *(.rela.text) - *(.rela.text.*) - *(.rela.gnu.linkonce.t.*) - } - .rel.fini : { *(.rel.fini) } - .rela.fini : { *(.rela.fini) } - .rel.rodata : - { - *(.rel.rodata) - *(.rel.rodata.*) - *(.rel.gnu.linkonce.r.*) - } - .rela.rodata : - { - *(.rela.rodata) - *(.rela.rodata.*) - *(.rela.gnu.linkonce.r.*) - } - .rel.data : - { - *(.rel.data) - *(.rel.data.*) - *(.rel.gnu.linkonce.d.*) - } - .rela.data : - { - *(.rela.data) - *(.rela.data.*) - *(.rela.gnu.linkonce.d.*) - } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.sdata : - { - *(.rel.sdata) - *(.rel.sdata.*) - *(.rel.gnu.linkonce.s.*) - } - .rela.sdata : - { - *(.rela.sdata) - *(.rela.sdata.*) - *(.rela.gnu.linkonce.s.*) - } - .rel.sbss : - { - *(.rel.sbss) - *(.rel.sbss.*) - *(.rel.gnu.linkonce.sb.*) - } - .rela.sbss : - { - *(.rela.sbss) - *(.rela.sbss.*) - *(.rel.gnu.linkonce.sb.*) - } - .rel.sdata2 : - { - *(.rel.sdata2) - *(.rel.sdata2.*) - *(.rel.gnu.linkonce.s2.*) - } - .rela.sdata2 : - { - *(.rela.sdata2) - *(.rela.sdata2.*) - *(.rela.gnu.linkonce.s2.*) - } - .rel.sbss2 : - { - *(.rel.sbss2) - *(.rel.sbss2.*) - *(.rel.gnu.linkonce.sb2.*) - } - .rela.sbss2 : - { - *(.rela.sbss2) - *(.rela.sbss2.*) - *(.rela.gnu.linkonce.sb2.*) - } - .rel.bss : - { - *(.rel.bss) - *(.rel.bss.*) - *(.rel.gnu.linkonce.b.*) - } - .rela.bss : - { - *(.rela.bss) - *(.rela.bss.*) - *(.rela.gnu.linkonce.b.*) - } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : - { - KEEP (*(.init)) - } =0x1000000 - .text : - { - *(.trap) - *(.text) - *(.text.*) - *(.stub) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t.*) - } =0x1000000 - .fini : - { - KEEP (*(.fini)) - } =0x1000000 - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - .note.gnu.build-id : { - PROVIDE (__build_id_start = .); - *(.note.gnu.build-id) - PROVIDE (__build_id_end = .); - } - .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } - .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } - . = ALIGN(0x2000) + (. & (0x2000 - 1)); - .data : - { - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - } - .data1 : { *(.data1) } - .eh_frame : { KEEP (*(.eh_frame)) } - .gcc_except_table : { *(.gcc_except_table) } - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } - .plt : { *(.plt) } - .got : { *(.got.plt) *(.got) } - .dynamic : { *(.dynamic) } - /* 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 : - { - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - } - _edata = .; - PROVIDE (edata = .); - __bss_start = .; - .sbss : - { - PROVIDE (__sbss_start = .); - PROVIDE (___sbss_start = .); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - PROVIDE (__sbss_end = .); - PROVIDE (___sbss_end = .); - } - .bss : - { - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. */ - . = ALIGN(64 / 8); - } - . = ALIGN(64 / 8); - _end = .; - PROVIDE (end = .); - /* 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) } - .comment 0 : { *(.comment) } - /* 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) *(.gnu.linkonce.wi.*) } - .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 . */ -} diff --git a/sys/conf/options.sparc64 b/sys/conf/options.sparc64 deleted file mode 100644 index 883db1669279..000000000000 --- a/sys/conf/options.sparc64 +++ /dev/null @@ -1,31 +0,0 @@ -# $FreeBSD$ - -GFB_DEBUG opt_gfb.h -GFB_NO_FONT_LOADING opt_gfb.h -GFB_NO_MODE_CHANGE opt_gfb.h - -SUN4U opt_global.h - -ATKBD_DFLT_KEYMAP opt_atkbd.h - -FIRE_DEBUG opt_fire.h - -# Debug IOMMU inserts/removes using diagnostic accesses. This is very loud. -IOMMU_DIAG opt_iommu.h - -OFWCONS_POLL_HZ opt_ofw.h - -OFW_PCI_DEBUG opt_ofw_pci.h - -PMAP_STATS opt_pmap.h - -PSM_DEBUG opt_psm.h -PSM_HOOKRESUME opt_psm.h -PSM_RESETAFTERSUSPEND opt_psm.h - -PSYCHO_DEBUG opt_psycho.h - -SCHIZO_DEBUG opt_schizo.h - -SUNKBD_DFLT_KEYMAP opt_sunkbd.h -SUNKBD_EMULATE_ATKBD opt_sunkbd.h diff --git a/sys/contrib/ck/include/ck_md.h b/sys/contrib/ck/include/ck_md.h index 8e452c7d35de..51649597b254 100644 --- a/sys/contrib/ck/include/ck_md.h +++ b/sys/contrib/ck/include/ck_md.h @@ -114,9 +114,6 @@ net $ #define CK_MD_SSE_DISABLE 1 #elif defined(__amd64__) #define CK_MD_TSO -#elif defined(__sparc64__) && !defined(__sparcv9__) -#define __sparcv9__ -#define CK_MD_TSO #elif defined(__powerpc64__) && !defined(__ppc64__) #define __ppc64__ #elif defined(__powerpc__) && !defined(__ppc__) diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 48a31e69883d..426c1ee36e0b 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -147,17 +147,9 @@ ata_pci_detach(device_t dev) if (ctlr->chipdeinit != NULL) ctlr->chipdeinit(dev); if (ctlr->r_res2) { -#ifdef __sparc64__ - bus_space_unmap(rman_get_bustag(ctlr->r_res2), - rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2)); -#endif bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); } if (ctlr->r_res1) { -#ifdef __sparc64__ - bus_space_unmap(rman_get_bustag(ctlr->r_res1), - rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1)); -#endif bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1); } diff --git a/sys/dev/ata/chipsets/ata-promise.c b/sys/dev/ata/chipsets/ata-promise.c index c189509201d8..c9518f18d3dd 100644 --- a/sys/dev/ata/chipsets/ata-promise.c +++ b/sys/dev/ata/chipsets/ata-promise.c @@ -250,14 +250,6 @@ ata_promise_chipinit(device_t dev) &ctlr->r_rid1, RF_ACTIVE))) goto failnfree; -#ifdef __sparc64__ - if (ctlr->chip->cfg2 == PR_SX4X && - !bus_space_map(rman_get_bustag(ctlr->r_res1), - rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1), - BUS_SPACE_MAP_LINEAR, NULL)) - goto failnfree; -#endif - ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(3); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index b74587635d9e..ddf266abf531 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -74,7 +74,6 @@ typedef struct atkbd_state { } atkbd_state_t; static void atkbd_timeout(void *arg); -static void atkbd_shutdown_final(void *v); static int atkbd_reset(KBDC kbdc, int flags, int c); #define HAS_QUIRK(p, q) (((atkbdc_softc_t *)(p))->quirks & q) @@ -151,9 +150,6 @@ atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) if (bootverbose) (*sw->diag)(*kbd, bootverbose); - EVENTHANDLER_REGISTER(shutdown_final, atkbd_shutdown_final, *kbd, - SHUTDOWN_PRI_DEFAULT); - return 0; } @@ -1148,30 +1144,6 @@ atkbd_poll(keyboard_t *kbd, int on) return 0; } -static void -atkbd_shutdown_final(void *v) -{ -#ifdef __sparc64__ - keyboard_t *kbd = v; - KBDC kbdc = ((atkbd_state_t *)kbd->kb_data)->kbdc; - - /* - * Turn off the translation in preparation for handing the keyboard - * over to the OFW as the OBP driver doesn't use translation and - * also doesn't disable it itself resulting in a broken keymap at - * the boot prompt. Also disable the aux port and the interrupts as - * the OBP driver doesn't use them, i.e. polls the keyboard. Not - * disabling the interrupts doesn't cause real problems but the - * responsiveness is a bit better when they are turned off. - */ - send_kbd_command(kbdc, KBDC_DISABLE_KBD); - set_controller_command_byte(kbdc, - KBD_AUX_CONTROL_BITS | KBD_KBD_CONTROL_BITS | KBD_TRANSLATION, - KBD_DISABLE_AUX_PORT | KBD_DISABLE_KBD_INT | KBD_ENABLE_KBD_PORT); - send_kbd_command(kbdc, KBDC_ENABLE_KBD); -#endif -} - static int atkbd_reset(KBDC kbdc, int flags, int c) { @@ -1468,14 +1440,6 @@ init_keyboard(KBDC kbdc, int *type, int flags) } } -#if defined(__sparc64__) - if (send_kbd_command_and_data( - kbdc, KBDC_SET_SCANCODE_SET, 2) != KBD_ACK) { - printf("atkbd: can't set translation.\n"); - } - c |= KBD_TRANSLATION; -#endif - /* * Some keyboards require a SETLEDS command to be sent after * the reset command before they will send keystrokes to us diff --git a/sys/dev/atkbdc/atkbdc.c b/sys/dev/atkbdc/atkbdc.c index bcb47e645177..23ccbab3142b 100644 --- a/sys/dev/atkbdc/atkbdc.c +++ b/sys/dev/atkbdc/atkbdc.c @@ -52,13 +52,7 @@ __FBSDID("$FreeBSD$"); #include <dev/atkbdc/atkbdcreg.h> -#ifdef __sparc64__ -#include <dev/ofw/openfirm.h> -#include <machine/bus_private.h> -#include <machine/ofw_machdep.h> -#else #include <isa/isareg.h> -#endif /* constants */ @@ -98,10 +92,6 @@ static atkbdc_softc_t *atkbdc_softc[MAXKBDC] = { &default_kbdc }; static int verbose = KBDIO_DEBUG; -#ifdef __sparc64__ -static struct bus_space_tag atkbdc_bst_store[MAXKBDC]; -#endif - /* function prototypes */ static int atkbdc_setup(atkbdc_softc_t *sc, bus_space_tag_t tag, @@ -197,55 +187,16 @@ atkbdc_configure(void) volatile int i; register_t flags; #endif -#ifdef __sparc64__ - char name[32]; - phandle_t chosen, node; - ihandle_t stdin; - bus_addr_t port0; - bus_addr_t port1; - int space; -#else int port0; int port1; -#endif /* XXX: tag should be passed from the caller */ #if defined(__amd64__) || defined(__i386__) tag = X86_BUS_SPACE_IO; -#elif defined(__sparc64__) - tag = &atkbdc_bst_store[0]; #else #error "define tag!" #endif -#ifdef __sparc64__ - if ((chosen = OF_finddevice("/chosen")) == -1) - return 0; - if (OF_getprop(chosen, "stdin", &stdin, sizeof(stdin)) == -1) - return 0; - if ((node = OF_instance_to_package(stdin)) == -1) - return 0; - if (OF_getprop(node, "name", name, sizeof(name)) == -1) - return 0; - name[sizeof(name) - 1] = '\0'; - if (strcmp(name, "kb_ps2") != 0) - return 0; - /* - * The stdin handle points to an instance of a PS/2 keyboard - * package but we want the 8042 controller, which is the parent - * of that keyboard node. - */ - if ((node = OF_parent(node)) == 0) - return 0; - if (OF_decode_addr(node, 0, &space, &port0) != 0) - return 0; - h0 = sparc64_fake_bustag(space, port0, tag); - bus_space_subregion(tag, h0, KBD_DATA_PORT, 1, &h0); - if (OF_decode_addr(node, 1, &space, &port1) != 0) - return 0; - h1 = sparc64_fake_bustag(space, port1, tag); - bus_space_subregion(tag, h1, KBD_STATUS_PORT, 1, &h1); -#else port0 = IO_KBD; resource_int_value("atkbdc", 0, "port", &port0); port1 = IO_KBD + KBD_STATUS_PORT; @@ -256,7 +207,6 @@ atkbdc_configure(void) h0 = (bus_space_handle_t)port0; h1 = (bus_space_handle_t)port1; #endif -#endif #if defined(__i386__) || defined(__amd64__) /* diff --git a/sys/dev/atkbdc/atkbdc_ebus.c b/sys/dev/atkbdc/atkbdc_ebus.c deleted file mode 100644 index 53c40433d6ba..000000000000 --- a/sys/dev/atkbdc/atkbdc_ebus.c +++ /dev/null @@ -1,307 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> - * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer as - * the first lines of this file unmodified. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. - * - * from: FreeBSD: src/sys/isa/atkbdc_isa.c,v 1.31 2005/05/29 04:42:28 nyan - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_kbd.h" - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/bus.h> -#include <sys/kbio.h> -#include <sys/malloc.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/resource.h> -#include <machine/ver.h> - -#include <sys/rman.h> - -#include <dev/kbd/kbdreg.h> -#include <dev/atkbdc/atkbdreg.h> -#include <dev/atkbdc/atkbdc_subr.h> -#include <dev/atkbdc/atkbdcreg.h> -#include <dev/atkbdc/psm.h> - -static device_probe_t atkbdc_ebus_probe; -static device_attach_t atkbdc_ebus_attach; - -static device_method_t atkbdc_ebus_methods[] = { - DEVMETHOD(device_probe, atkbdc_ebus_probe), - DEVMETHOD(device_attach, atkbdc_ebus_attach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - DEVMETHOD(bus_print_child, atkbdc_print_child), - DEVMETHOD(bus_read_ivar, atkbdc_read_ivar), - DEVMETHOD(bus_write_ivar, atkbdc_write_ivar), - DEVMETHOD(bus_get_resource_list,atkbdc_get_resource_list), - DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), - DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - { 0, 0 } -}; - -static driver_t atkbdc_ebus_driver = { - ATKBDC_DRIVER_NAME, - atkbdc_ebus_methods, - sizeof(atkbdc_softc_t *), -}; - -DRIVER_MODULE(atkbdc, ebus, atkbdc_ebus_driver, atkbdc_devclass, 0, 0); - -static int -atkbdc_ebus_probe(device_t dev) -{ - struct resource *port0, *port1; - rman_res_t count, start; - int error, rid; - - if (strcmp(ofw_bus_get_name(dev), "8042") != 0) - return (ENXIO); - - /* - * On AXi and AXmp boards the NS16550 (used to connect keyboard/ - * mouse) share their IRQ lines with the i8042. Any IRQ activity - * (typically during attach) of the NS16550 used to connect the - * keyboard when actually the PS/2 keyboard is selected in OFW - * causes interaction with the OBP i8042 driver resulting in a - * hang and vice versa. As RS232 keyboards and mice obviously - * aren't meant to be used in parallel with PS/2 ones on these - * boards don't attach to the i8042 in case the PS/2 keyboard - * isn't selected in order to prevent such hangs. - * Note that it's not sufficient here to rely on the '8042' node - * only showing up when a PS/2 keyboard is actually connected as - * the user still might have adjusted the 'keyboard' alias to - * point to the RS232 keyboard. - */ - if ((!strcmp(sparc64_model, "SUNW,UltraAX-MP") || - !strcmp(sparc64_model, "SUNW,UltraSPARC-IIi-Engine")) && - OF_finddevice("keyboard") != ofw_bus_get_node(dev)) { - device_disable(dev); - return (ENXIO); - } - - device_set_desc(dev, "Keyboard controller (i8042)"); - - /* - * The '8042' node has two identical 8 addresses wide resources - * which are apparently meant to be used one for the keyboard - * half and the other one for the mouse half. To simplify matters - * we use one for the command/data port resource and the other - * one for the status port resource as the atkbdc(4) back-end - * expects two struct resource rather than two bus space handles. - */ - rid = 0; - if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) { - device_printf(dev, - "cannot determine command/data port resource\n"); - return (ENXIO); - } - port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, 1, - RF_ACTIVE); - if (port0 == NULL) { - device_printf(dev, - "cannot allocate command/data port resource\n"); - return (ENXIO); - } - - rid = 1; - if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) { - device_printf(dev, "cannot determine status port resource\n"); - error = ENXIO; - goto fail_port0; - } - start += KBD_STATUS_PORT; - port1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, 1, - RF_ACTIVE); - if (port1 == NULL) { - device_printf(dev, "cannot allocate status port resource\n"); - error = ENXIO; - goto fail_port0; - } - - error = atkbdc_probe_unit(device_get_unit(dev), port0, port1); - if (error != 0) - device_printf(dev, "atkbdc_porbe_unit failed\n"); - - bus_release_resource(dev, SYS_RES_MEMORY, 1, port1); - fail_port0: - bus_release_resource(dev, SYS_RES_MEMORY, 0, port0); - - return (error); -} - -static int -atkbdc_ebus_attach(device_t dev) -{ - atkbdc_softc_t *sc; - atkbdc_device_t *adi; - device_t cdev; - phandle_t child; - rman_res_t count, intr, start; - int children, error, rid, unit; - char *cname, *dname; - - unit = device_get_unit(dev); - sc = *(atkbdc_softc_t **)device_get_softc(dev); - if (sc == NULL) { - /* - * We have to maintain two copies of the kbdc_softc struct, - * as the low-level console needs to have access to the - * keyboard controller before kbdc is probed and attached. - * kbdc_soft[] contains the default entry for that purpose. - * See atkbdc.c. XXX - */ - sc = atkbdc_get_softc(unit); - if (sc == NULL) - return (ENOMEM); - device_set_softc(dev, sc); - } - - rid = 0; - if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) { - device_printf(dev, - "cannot determine command/data port resource\n"); - return (ENXIO); - } - sc->retry = 5000; - sc->port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, - 1, RF_ACTIVE); - if (sc->port0 == NULL) { - device_printf(dev, - "cannot allocate command/data port resource\n"); - return (ENXIO); - } - - rid = 1; - if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count) != 0) { - device_printf(dev, "cannot determine status port resource\n"); - error = ENXIO; - goto fail_port0; - } - start += KBD_STATUS_PORT; - sc->port1 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start, - 1, RF_ACTIVE); - if (sc->port1 == NULL) { - device_printf(dev, "cannot allocate status port resource\n"); - error = ENXIO; - goto fail_port0; - } - - error = atkbdc_attach_unit(unit, sc, sc->port0, sc->port1); - if (error != 0) { - device_printf(dev, "atkbdc_attach_unit failed\n"); - goto fail_port1; - } - - /* Attach children. */ - children = 0; - for (child = OF_child(ofw_bus_get_node(dev)); child != 0; - child = OF_peer(child)) { - if ((OF_getprop_alloc(child, "name", (void **)&cname)) == -1) - continue; - if (children >= 2) { - device_printf(dev, - "<%s>: only two children per 8042 supported\n", - cname); - OF_prop_free(cname); - continue; - } - adi = malloc(sizeof(struct atkbdc_device), M_ATKBDDEV, - M_NOWAIT | M_ZERO); - if (adi == NULL) { - device_printf(dev, "<%s>: malloc failed\n", cname); - OF_prop_free(cname); - continue; - } - if (strcmp(cname, "kb_ps2") == 0) { - adi->rid = KBDC_RID_KBD; - dname = ATKBD_DRIVER_NAME; - } else if (strcmp(cname, "kdmouse") == 0) { - adi->rid = KBDC_RID_AUX; - dname = PSM_DRIVER_NAME; - } else { - device_printf(dev, "<%s>: unknown device\n", cname); - free(adi, M_ATKBDDEV); - OF_prop_free(cname); - continue; - } - intr = bus_get_resource_start(dev, SYS_RES_IRQ, adi->rid); - if (intr == 0) { - device_printf(dev, - "<%s>: cannot determine interrupt resource\n", - cname); - free(adi, M_ATKBDDEV); - OF_prop_free(cname); - continue; - } - resource_list_init(&adi->resources); - resource_list_add(&adi->resources, SYS_RES_IRQ, adi->rid, - intr, intr, 1); - if ((cdev = device_add_child(dev, dname, -1)) == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - cname); - resource_list_free(&adi->resources); - free(adi, M_ATKBDDEV); - OF_prop_free(cname); - continue; - } - device_set_ivars(cdev, adi); - children++; - } - - error = bus_generic_attach(dev); - if (error != 0) { - device_printf(dev, "bus_generic_attach failed\n"); - goto fail_port1; - } - - return (0); - - fail_port1: - bus_release_resource(dev, SYS_RES_MEMORY, 1, sc->port1); - fail_port0: - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->port0); - - return (error); -} diff --git a/sys/dev/auxio/auxio.c b/sys/dev/auxio/auxio.c deleted file mode 100644 index 8c5f28d50e8a..000000000000 --- a/sys/dev/auxio/auxio.c +++ /dev/null @@ -1,325 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-3-Clause - * - * Copyright (c) 2004 Pyun YongHyeon - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -/* $NetBSD: auxio.c,v 1.11 2003/07/15 03:36:04 lukem Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Matthew R. Green - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - */ - -/* - * AUXIO registers support on the SBus & EBus2, used for the floppy driver - * and to control the system LED, for the BLINK option. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/rman.h> - -#include <dev/led/led.h> -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <sparc64/sbus/sbusvar.h> -#include <dev/auxio/auxioreg.h> - -/* - * On sun4u, auxio exists with one register (LED) on the SBus, and 5 - * registers on the EBus2 (pci) (LED, PCIMODE, FREQUENCY, SCSI - * OSCILLATOR, and TEMP SENSE. - */ - -#define AUXIO_PCIO_LED 0 -#define AUXIO_PCIO_PCI 1 -#define AUXIO_PCIO_FREQ 2 -#define AUXIO_PCIO_OSC 3 -#define AUXIO_PCIO_TEMP 4 -#define AUXIO_PCIO_NREG 5 - -struct auxio_softc { - device_t sc_dev; - - int sc_nauxio; - struct resource *sc_res[AUXIO_PCIO_NREG]; - int sc_rid[AUXIO_PCIO_NREG]; - bus_space_tag_t sc_regt[AUXIO_PCIO_NREG]; - bus_space_handle_t sc_regh[AUXIO_PCIO_NREG]; - struct cdev *sc_led_dev; - u_int32_t sc_led_stat; - - int sc_flags; -#define AUXIO_LEDONLY 0x1 -#define AUXIO_EBUS 0x2 -#define AUXIO_SBUS 0x4 - - struct mtx sc_lock; -}; - -static void auxio_led_func(void *arg, int onoff); -static int auxio_attach_common(struct auxio_softc *); -static int auxio_bus_probe(device_t); -static int auxio_sbus_attach(device_t); -static int auxio_ebus_attach(device_t); -static int auxio_bus_detach(device_t); -static void auxio_free_resource(struct auxio_softc *); -static __inline u_int32_t auxio_led_read(struct auxio_softc *); -static __inline void auxio_led_write(struct auxio_softc *, u_int32_t); - -/* SBus */ -static device_method_t auxio_sbus_methods[] = { - DEVMETHOD(device_probe, auxio_bus_probe), - DEVMETHOD(device_attach, auxio_sbus_attach), - DEVMETHOD(device_detach, auxio_bus_detach), - - DEVMETHOD_END -}; - -static driver_t auxio_sbus_driver = { - "auxio", - auxio_sbus_methods, - sizeof(struct auxio_softc) -}; - -static devclass_t auxio_devclass; -/* The probe order is handled by sbus(4). */ -EARLY_DRIVER_MODULE(auxio, sbus, auxio_sbus_driver, auxio_devclass, 0, 0, - BUS_PASS_DEFAULT); -MODULE_DEPEND(auxio, sbus, 1, 1, 1); - -/* EBus */ -static device_method_t auxio_ebus_methods[] = { - DEVMETHOD(device_probe, auxio_bus_probe), - DEVMETHOD(device_attach, auxio_ebus_attach), - DEVMETHOD(device_detach, auxio_bus_detach), - - DEVMETHOD_END -}; - -static driver_t auxio_ebus_driver = { - "auxio", - auxio_ebus_methods, - sizeof(struct auxio_softc) -}; - -EARLY_DRIVER_MODULE(auxio, ebus, auxio_ebus_driver, auxio_devclass, 0, 0, - BUS_PASS_DEFAULT); -MODULE_DEPEND(auxio, ebus, 1, 1, 1); -MODULE_VERSION(auxio, 1); - -#define AUXIO_LOCK_INIT(sc) \ - mtx_init(&sc->sc_lock, "auxio mtx", NULL, MTX_DEF) -#define AUXIO_LOCK(sc) mtx_lock(&sc->sc_lock) -#define AUXIO_UNLOCK(sc) mtx_unlock(&sc->sc_lock) -#define AUXIO_LOCK_DESTROY(sc) mtx_destroy(&sc->sc_lock) - -static __inline void -auxio_led_write(struct auxio_softc *sc, u_int32_t v) -{ - if (sc->sc_flags & AUXIO_EBUS) - bus_space_write_4(sc->sc_regt[AUXIO_PCIO_LED], - sc->sc_regh[AUXIO_PCIO_LED], 0, v); - else - bus_space_write_1(sc->sc_regt[AUXIO_PCIO_LED], - sc->sc_regh[AUXIO_PCIO_LED], 0, v); -} - -static __inline u_int32_t -auxio_led_read(struct auxio_softc *sc) -{ - u_int32_t led; - - if (sc->sc_flags & AUXIO_EBUS) - led = bus_space_read_4(sc->sc_regt[AUXIO_PCIO_LED], - sc->sc_regh[AUXIO_PCIO_LED], 0); - else - led = bus_space_read_1(sc->sc_regt[AUXIO_PCIO_LED], - sc->sc_regh[AUXIO_PCIO_LED], 0); - - return (led); -} - -static void -auxio_led_func(void *arg, int onoff) -{ - struct auxio_softc *sc; - u_int32_t led; - - sc = (struct auxio_softc *)arg; - - AUXIO_LOCK(sc); - /* - * NB: We must not touch the other bits of the SBus AUXIO reg. - */ - led = auxio_led_read(sc); - if (onoff) - led |= AUXIO_LED_LED; - else - led &= ~AUXIO_LED_LED; - auxio_led_write(sc, led); - AUXIO_UNLOCK(sc); -} - -static int -auxio_bus_probe(device_t dev) -{ - const char *name; - - name = ofw_bus_get_name(dev); - if (strcmp("auxio", name) == 0) { - device_set_desc(dev, "Sun Auxiliary I/O"); - return (0); - } - - return (ENXIO); -} - -static int -auxio_ebus_attach(device_t dev) -{ - struct auxio_softc *sc; - - sc = device_get_softc(dev); - sc->sc_dev = dev; - - AUXIO_LOCK_INIT(sc); - sc->sc_nauxio = AUXIO_PCIO_NREG; - sc->sc_flags = AUXIO_LEDONLY | AUXIO_EBUS; - - return(auxio_attach_common(sc)); -} - -static int -auxio_attach_common(struct auxio_softc *sc) -{ - struct resource *res; - int i; - - for (i = 0; i < sc->sc_nauxio; i++) { - sc->sc_rid[i] = i; - res = bus_alloc_resource_any(sc->sc_dev, SYS_RES_MEMORY, - &sc->sc_rid[i], RF_ACTIVE); - if (res == NULL) { - device_printf(sc->sc_dev, - "could not allocate resources\n"); - goto attach_fail; - } - sc->sc_res[i] = res; - sc->sc_regt[i] = rman_get_bustag(res); - sc->sc_regh[i] = rman_get_bushandle(res); - } - - sc->sc_led_stat = auxio_led_read(sc) & AUXIO_LED_LED; - sc->sc_led_dev = led_create(auxio_led_func, sc, "auxioled"); - /* turn on the LED */ - auxio_led_func(sc, 1); - - return (0); - -attach_fail: - auxio_free_resource(sc); - - return (ENXIO); -} - -static int -auxio_bus_detach(device_t dev) -{ - struct auxio_softc *sc; - - sc = device_get_softc(dev); - led_destroy(sc->sc_led_dev); - auxio_led_func(sc, sc->sc_led_stat); - auxio_free_resource(sc); - - return (0); -} - -static void -auxio_free_resource(struct auxio_softc *sc) -{ - int i; - - for (i = 0; i < sc->sc_nauxio; i++) - if (sc->sc_res[i]) - bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, - sc->sc_rid[i], sc->sc_res[i]); - AUXIO_LOCK_DESTROY(sc); -} - -static int -auxio_sbus_attach(device_t dev) -{ - struct auxio_softc *sc; - - sc = device_get_softc(dev); - sc->sc_dev = dev; - - AUXIO_LOCK_INIT(sc); - sc->sc_nauxio = 1; - sc->sc_flags = AUXIO_LEDONLY | AUXIO_SBUS; - - return (auxio_attach_common(sc)); -} diff --git a/sys/dev/auxio/auxioreg.h b/sys/dev/auxio/auxioreg.h deleted file mode 100644 index 3f93cf40635e..000000000000 --- a/sys/dev/auxio/auxioreg.h +++ /dev/null @@ -1,75 +0,0 @@ -/* $FreeBSD$ */ -/* $NetBSD: auxioreg.h,v 1.4 2001/10/22 07:31:41 mrg Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 2000 Matthew R. Green - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - */ - -/* - * The AUXIO registers; their offset in the Ebus2 address space, plus the - * bits for each register. Note that the fdthree (FD), SUNW,CS4231 (AUDIO) - * and power (POWER) devices on the Ebus2 have their AUXIO regsiters mapped - * into their own "reg" properties, not the "auxio" device's "reg" properties. - */ -#define AUXIO_FD 0x00720000 -#define AUXIO_FD_DENSENSE_INPUT 0x0 -#define AUXIO_FD_DENSENSE_OUTPUT 0x1 - -#define AUXIO_AUDIO 0x00722000 -#define AUXIO_AUDIO_POWERDOWN 0x0 - -#define AUXIO_POWER 0x00724000 -#define AUXIO_POWER_SYSTEM_OFF 0x0 -#define AUXIO_POWER_COURTESY_OFF 0x1 - -#define AUXIO_LED 0x00726000 -#define AUXIO_LED_LED 1 - -#define AUXIO_PCI 0x00728000 -#define AUXIO_PCI_SLOT0 0x0 /* two bits each */ -#define AUXIO_PCI_SLOT1 0x2 -#define AUXIO_PCI_SLOT2 0x4 -#define AUXIO_PCI_SLOT3 0x6 -#define AUXIO_PCI_MODE 0x8 - -#define AUXIO_FREQ 0x0072a000 -#define AUXIO_FREQ_FREQ0 0x0 -#define AUXIO_FREQ_FREQ1 0x1 -#define AUXIO_FREQ_FREQ2 0x2 - -#define AUXIO_SCSI 0x0072c000 -#define AUXIO_SCSI_INT_OSC_EN 0x0 -#define AUXIO_SCSI_EXT_OSC_EN 0x1 - -#define AUXIO_TEMP 0x0072f000 -#define AUXIO_TEMP_SELECT 0x0 -#define AUXIO_TEMP_CLOCK 0x1 -#define AUXIO_TEMP_ENABLE 0x2 -#define AUXIO_TEMP_DATAOUT 0x3 -#define AUXIO_TEMP_DATAINT 0x4 diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index fab4c1bb4bb2..b91ee5de9649 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -112,13 +112,6 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include <dev/mii/brgphyreg.h> -#ifdef __sparc64__ -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> -#include <machine/ver.h> -#endif - #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> @@ -557,47 +550,9 @@ static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RDTUN, &bge_allow_asf, 0, "Allow ASF mode if available"); -#define SPARC64_BLADE_1500_MODEL "SUNW,Sun-Blade-1500" -#define SPARC64_BLADE_1500_PATH_BGE "/pci@1f,700000/network@2" -#define SPARC64_BLADE_2500_MODEL "SUNW,Sun-Blade-2500" -#define SPARC64_BLADE_2500_PATH_BGE "/pci@1c,600000/network@3" -#define SPARC64_OFW_SUBVENDOR "subsystem-vendor-id" - static int bge_has_eaddr(struct bge_softc *sc) { -#ifdef __sparc64__ - char buf[sizeof(SPARC64_BLADE_1500_PATH_BGE)]; - device_t dev; - uint32_t subvendor; - - dev = sc->bge_dev; - - /* - * The on-board BGEs found in sun4u machines aren't fitted with - * an EEPROM which means that we have to obtain the MAC address - * via OFW and that some tests will always fail. We distinguish - * such BGEs by the subvendor ID, which also has to be obtained - * from OFW instead of the PCI configuration space as the latter - * indicates Broadcom as the subvendor of the netboot interface. - * For early Blade 1500 and 2500 we even have to check the OFW - * device path as the subvendor ID always defaults to Broadcom - * there. - */ - if (OF_getprop(ofw_bus_get_node(dev), SPARC64_OFW_SUBVENDOR, - &subvendor, sizeof(subvendor)) == sizeof(subvendor) && - (subvendor == FJTSU_VENDORID || subvendor == SUN_VENDORID)) - return (0); - memset(buf, 0, sizeof(buf)); - if (OF_package_to_path(ofw_bus_get_node(dev), buf, sizeof(buf)) > 0) { - if (strcmp(sparc64_model, SPARC64_BLADE_1500_MODEL) == 0 && - strcmp(buf, SPARC64_BLADE_1500_PATH_BGE) == 0) - return (0); - if (strcmp(sparc64_model, SPARC64_BLADE_2500_MODEL) == 0 && - strcmp(buf, SPARC64_BLADE_2500_PATH_BGE) == 0) - return (0); - } -#endif return (1); } @@ -6744,15 +6699,7 @@ bge_sysctl_mem_read(SYSCTL_HANDLER_ARGS) static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]) { -#ifdef __sparc64__ - if (sc->bge_flags & BGE_FLAG_EADDR) - return (1); - - OF_getetheraddr(sc->bge_dev, ether_addr); - return (0); -#else return (1); -#endif } static int diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 88408e2f3bca..1a20596f2923 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/udp.h> #include <machine/bus.h> -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include <dev/ofw/ofw_bus.h> #include <dev/ofw/openfirm.h> #include <machine/ofw_machdep.h> @@ -1045,14 +1045,10 @@ cas_init_locked(struct cas_softc *sc) /* * Enable infinite bursts for revisions without PCI issues if - * applicable. Doing so greatly improves the TX performance on - * !__sparc64__ (on sparc64, setting CAS_INF_BURST improves TX - * performance only marginally but hurts RX throughput quite a bit). + * applicable. Doing so greatly improves the TX performance. */ CAS_WRITE_4(sc, CAS_INF_BURST, -#if !defined(__sparc64__) (sc->sc_flags & CAS_TABORT) == 0 ? CAS_INF_BURST_EN : -#endif 0); /* Set up interrupts. */ @@ -2652,7 +2648,7 @@ cas_pci_attach(device_t dev) char buf[sizeof(CAS_LOCAL_MAC_ADDRESS)]; struct cas_softc *sc; int i; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if !defined(__powerpc__) u_char enaddr[4][ETHER_ADDR_LEN]; u_int j, k, lma, pcs[4], phy; #endif @@ -2696,7 +2692,7 @@ cas_pci_attach(device_t dev) CAS_LOCK_INIT(sc, device_get_nameunit(dev)); -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); if (OF_getprop(ofw_bus_get_node(dev), CAS_PHY_INTERFACE, buf, sizeof(buf)) > 0 || OF_getprop(ofw_bus_get_node(dev), diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index b7504a7200c6..f471d1192dcb 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -135,11 +135,6 @@ __FBSDID("$FreeBSD$"); #include <dev/dc/if_dcreg.h> -#ifdef __sparc64__ -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> -#endif - MODULE_DEPEND(dc, pci, 1, 1, 1); MODULE_DEPEND(dc, ether, 1, 1, 1); MODULE_DEPEND(dc, miibus, 1, 1, 1); @@ -2293,14 +2288,6 @@ dc_attach(device_t dev) break; case DC_TYPE_DM9102: dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0); -#ifdef __sparc64__ - /* - * If this is an onboard dc(4) the station address read from - * the EEPROM is all zero and we have to get it from the FCode. - */ - if (eaddr[0] == 0 && (eaddr[1] & ~0xffff) == 0) - OF_getetheraddr(dev, (caddr_t)&eaddr); -#endif break; case DC_TYPE_21143: case DC_TYPE_ASIX: diff --git a/sys/dev/esp/esp_sbus.c b/sys/dev/esp/esp_sbus.c deleted file mode 100644 index c7f4cbbc9d29..000000000000 --- a/sys/dev/esp/esp_sbus.c +++ /dev/null @@ -1,846 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-2-Clause-NetBSD - * - * Copyright (c) 2004 Scott Long - * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -/* $NetBSD: esp_sbus.c,v 1.51 2009/09/17 16:28:12 tsutsui Exp $ */ - -/*- - * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum; Jason R. Thorpe of the Numerical Aerospace - * Simulation Facility, NASA Ames Research Center; Paul Kranenburg. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/rman.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <cam/cam.h> -#include <cam/cam_ccb.h> -#include <cam/scsi/scsi_all.h> -#include <cam/scsi/scsi_message.h> - -#include <sparc64/sbus/lsi64854reg.h> -#include <sparc64/sbus/lsi64854var.h> -#include <sparc64/sbus/sbusvar.h> - -#include <dev/esp/ncr53c9xreg.h> -#include <dev/esp/ncr53c9xvar.h> - -/* #define ESP_SBUS_DEBUG */ - -struct esp_softc { - struct ncr53c9x_softc sc_ncr53c9x; /* glue to MI code */ - device_t sc_dev; - - struct resource *sc_res; - - struct resource *sc_irqres; - void *sc_irq; - - struct lsi64854_softc *sc_dma; /* pointer to my DMA */ -}; - -static int esp_probe(device_t); -static int esp_dma_attach(device_t); -static int esp_dma_detach(device_t); -static int esp_sbus_attach(device_t); -static int esp_sbus_detach(device_t); -static int esp_suspend(device_t); -static int esp_resume(device_t); - -static device_method_t esp_dma_methods[] = { - DEVMETHOD(device_probe, esp_probe), - DEVMETHOD(device_attach, esp_dma_attach), - DEVMETHOD(device_detach, esp_dma_detach), - DEVMETHOD(device_suspend, esp_suspend), - DEVMETHOD(device_resume, esp_resume), - - DEVMETHOD_END -}; - -static driver_t esp_dma_driver = { - "esp", - esp_dma_methods, - sizeof(struct esp_softc) -}; - -DRIVER_MODULE(esp, dma, esp_dma_driver, esp_devclass, 0, 0); -MODULE_DEPEND(esp, dma, 1, 1, 1); - -static device_method_t esp_sbus_methods[] = { - DEVMETHOD(device_probe, esp_probe), - DEVMETHOD(device_attach, esp_sbus_attach), - DEVMETHOD(device_detach, esp_sbus_detach), - DEVMETHOD(device_suspend, esp_suspend), - DEVMETHOD(device_resume, esp_resume), - - DEVMETHOD_END -}; - -static driver_t esp_sbus_driver = { - "esp", - esp_sbus_methods, - sizeof(struct esp_softc) -}; - -DRIVER_MODULE(esp, sbus, esp_sbus_driver, esp_devclass, 0, 0); -MODULE_DEPEND(esp, sbus, 1, 1, 1); - -/* - * Functions and the switch for the MI code - */ -static uint8_t esp_read_reg(struct ncr53c9x_softc *sc, int reg); -static void esp_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v); -static int esp_dma_isintr(struct ncr53c9x_softc *sc); -static void esp_dma_reset(struct ncr53c9x_softc *sc); -static int esp_dma_intr(struct ncr53c9x_softc *sc); -static int esp_dma_setup(struct ncr53c9x_softc *sc, void **addr, - size_t *len, int datain, size_t *dmasize); -static void esp_dma_go(struct ncr53c9x_softc *sc); -static void esp_dma_stop(struct ncr53c9x_softc *sc); -static int esp_dma_isactive(struct ncr53c9x_softc *sc); -static int espattach(struct esp_softc *esc, - const struct ncr53c9x_glue *gluep); -static int espdetach(struct esp_softc *esc); - -static const struct ncr53c9x_glue esp_sbus_glue = { - esp_read_reg, - esp_write_reg, - esp_dma_isintr, - esp_dma_reset, - esp_dma_intr, - esp_dma_setup, - esp_dma_go, - esp_dma_stop, - esp_dma_isactive, -}; - -static int -esp_probe(device_t dev) -{ - const char *name; - - name = ofw_bus_get_name(dev); - if (strcmp("SUNW,fas", name) == 0) { - device_set_desc(dev, "Sun FAS366 Fast-Wide SCSI"); - return (BUS_PROBE_DEFAULT); - } else if (strcmp("esp", name) == 0) { - device_set_desc(dev, "Sun ESP SCSI/Sun FAS Fast-SCSI"); - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); -} - -static int -esp_sbus_attach(device_t dev) -{ - struct esp_softc *esc; - struct ncr53c9x_softc *sc; - struct lsi64854_softc *lsc; - device_t *children; - int error, i, nchildren; - - esc = device_get_softc(dev); - sc = &esc->sc_ncr53c9x; - - lsc = NULL; - esc->sc_dev = dev; - sc->sc_freq = sbus_get_clockfreq(dev); - - if (strcmp(ofw_bus_get_name(dev), "SUNW,fas") == 0) { - /* - * Allocate space for DMA, in SUNW,fas there are no - * separate DMA devices. - */ - lsc = malloc(sizeof (struct lsi64854_softc), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (lsc == NULL) { - device_printf(dev, "out of memory (lsi64854_softc)\n"); - return (ENOMEM); - } - esc->sc_dma = lsc; - - /* - * SUNW,fas have 2 register spaces: DMA (lsi64854) and - * SCSI core (ncr53c9x). - */ - - /* Allocate DMA registers. */ - i = 0; - if ((lsc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate DMA registers\n"); - error = ENXIO; - goto fail_sbus_lsc; - } - - /* Create a parent DMA tag based on this bus. */ - error = bus_dma_tag_create( - bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE, /* maxsize */ - BUS_SPACE_UNRESTRICTED, /* nsegments */ - BUS_SPACE_MAXSIZE, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* no locking */ - &lsc->sc_parent_dmat); - if (error != 0) { - device_printf(dev, "cannot allocate parent DMA tag\n"); - goto fail_sbus_lres; - } - - i = sbus_get_burstsz(dev); - -#ifdef ESP_SBUS_DEBUG - printf("%s: burst 0x%x\n", __func__, i); -#endif - - lsc->sc_burst = (i & SBUS_BURST_32) ? 32 : - (i & SBUS_BURST_16) ? 16 : 0; - - lsc->sc_channel = L64854_CHANNEL_SCSI; - lsc->sc_client = sc; - lsc->sc_dev = dev; - - /* - * Allocate SCSI core registers. - */ - i = 1; - if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE)) == NULL) { - device_printf(dev, - "cannot allocate SCSI core registers\n"); - error = ENXIO; - goto fail_sbus_lpdma; - } - } else { - /* - * Search accompanying DMA engine. It should have been - * already attached otherwise there isn't much we can do. - */ - if (device_get_children(device_get_parent(dev), &children, - &nchildren) != 0) { - device_printf(dev, "cannot determine siblings\n"); - return (ENXIO); - } - for (i = 0; i < nchildren; i++) { - if (device_is_attached(children[i]) && - sbus_get_slot(children[i]) == - sbus_get_slot(dev) && - strcmp(ofw_bus_get_name(children[i]), - "dma") == 0) { - /* XXX hackery */ - esc->sc_dma = (struct lsi64854_softc *) - device_get_softc(children[i]); - break; - } - } - free(children, M_TEMP); - if (esc->sc_dma == NULL) { - device_printf(dev, "cannot find DMA engine\n"); - return (ENXIO); - } - esc->sc_dma->sc_client = sc; - - /* - * Allocate SCSI core registers. - */ - i = 0; - if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE)) == NULL) { - device_printf(dev, - "cannot allocate SCSI core registers\n"); - return (ENXIO); - } - } - - error = espattach(esc, &esp_sbus_glue); - if (error != 0) { - device_printf(dev, "espattach failed\n"); - goto fail_sbus_eres; - } - - return (0); - - fail_sbus_eres: - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res), - esc->sc_res); - if (strcmp(ofw_bus_get_name(dev), "SUNW,fas") != 0) - return (error); - fail_sbus_lpdma: - bus_dma_tag_destroy(lsc->sc_parent_dmat); - fail_sbus_lres: - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(lsc->sc_res), - lsc->sc_res); - fail_sbus_lsc: - free(lsc, M_DEVBUF); - return (error); -} - -static int -esp_sbus_detach(device_t dev) -{ - struct esp_softc *esc; - struct lsi64854_softc *lsc; - int error; - - esc = device_get_softc(dev); - lsc = esc->sc_dma; - - error = espdetach(esc); - if (error != 0) - return (error); - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res), - esc->sc_res); - if (strcmp(ofw_bus_get_name(dev), "SUNW,fas") != 0) - return (0); - bus_dma_tag_destroy(lsc->sc_parent_dmat); - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(lsc->sc_res), - lsc->sc_res); - free(lsc, M_DEVBUF); - - return (0); -} - -static int -esp_dma_attach(device_t dev) -{ - struct esp_softc *esc; - struct ncr53c9x_softc *sc; - int error, i; - - esc = device_get_softc(dev); - sc = &esc->sc_ncr53c9x; - - esc->sc_dev = dev; - if (OF_getprop(ofw_bus_get_node(dev), "clock-frequency", - &sc->sc_freq, sizeof(sc->sc_freq)) == -1) { - printf("failed to query OFW for clock-frequency\n"); - return (ENXIO); - } - - /* XXX hackery */ - esc->sc_dma = (struct lsi64854_softc *) - device_get_softc(device_get_parent(dev)); - esc->sc_dma->sc_client = sc; - - /* - * Allocate SCSI core registers. - */ - i = 0; - if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate SCSI core registers\n"); - return (ENXIO); - } - - error = espattach(esc, &esp_sbus_glue); - if (error != 0) { - device_printf(dev, "espattach failed\n"); - goto fail_dma_eres; - } - - return (0); - - fail_dma_eres: - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res), - esc->sc_res); - return (error); -} - -static int -esp_dma_detach(device_t dev) -{ - struct esp_softc *esc; - int error; - - esc = device_get_softc(dev); - - error = espdetach(esc); - if (error != 0) - return (error); - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res), - esc->sc_res); - - return (0); -} - -static int -esp_suspend(device_t dev) -{ - - return (ENXIO); -} - -static int -esp_resume(device_t dev) -{ - - return (ENXIO); -} - -static int -espattach(struct esp_softc *esc, const struct ncr53c9x_glue *gluep) -{ - struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x; - unsigned int uid = 0; - int error, i; - - NCR_LOCK_INIT(sc); - - sc->sc_id = OF_getscsinitid(esc->sc_dev); - -#ifdef ESP_SBUS_DEBUG - device_printf(esc->sc_dev, "%s: sc_id %d, freq %d\n", - __func__, sc->sc_id, sc->sc_freq); -#endif - - /* - * The `ESC' DMA chip must be reset before we can access - * the ESP registers. - */ - if (esc->sc_dma->sc_rev == DMAREV_ESC) - DMA_RESET(esc->sc_dma); - - /* - * Set up glue for MI code early; we use some of it here. - */ - sc->sc_glue = gluep; - - /* gimme MHz */ - sc->sc_freq /= 1000000; - - /* - * XXX More of this should be in ncr53c9x_attach(), but - * XXX should we really poke around the chip that much in - * XXX the MI code? Think about this more... - */ - - /* - * Read the part-unique ID code of the SCSI chip. The contained - * value is only valid if all of the following conditions are met: - * - After power-up or chip reset. - * - Before any value is written to this register. - * - The NCRCFG2_FE bit is set. - * - A (NCRCMD_NOP | NCRCMD_DMA) command has been issued. - */ - NCRCMD(sc, NCRCMD_RSTCHIP); - NCRCMD(sc, NCRCMD_NOP); - sc->sc_cfg2 = NCRCFG2_FE; - NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); - NCRCMD(sc, NCRCMD_NOP | NCRCMD_DMA); - uid = NCR_READ_REG(sc, NCR_UID); - - /* - * It is necessary to try to load the 2nd config register here, - * to find out what rev the esp chip is, else the ncr53c9x_reset - * will not set up the defaults correctly. - */ - sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB; - NCR_WRITE_REG(sc, NCR_CFG1, sc->sc_cfg1); - sc->sc_cfg2 = 0; - NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); - sc->sc_cfg2 = NCRCFG2_SCSI2 | NCRCFG2_RPE; - NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); - - if ((NCR_READ_REG(sc, NCR_CFG2) & ~NCRCFG2_RSVD) != - (NCRCFG2_SCSI2 | NCRCFG2_RPE)) - sc->sc_rev = NCR_VARIANT_ESP100; - else { - sc->sc_cfg2 = NCRCFG2_SCSI2; - NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2); - sc->sc_cfg3 = 0; - NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); - sc->sc_cfg3 = (NCRCFG3_CDB | NCRCFG3_FCLK); - NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); - if (NCR_READ_REG(sc, NCR_CFG3) != - (NCRCFG3_CDB | NCRCFG3_FCLK)) - sc->sc_rev = NCR_VARIANT_ESP100A; - else { - /* NCRCFG2_FE enables > 64K transfers. */ - sc->sc_cfg2 |= NCRCFG2_FE; - sc->sc_cfg3 = 0; - NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3); - if (sc->sc_freq <= 25) - sc->sc_rev = NCR_VARIANT_ESP200; - else { - switch ((uid & 0xf8) >> 3) { - case 0x00: - sc->sc_rev = NCR_VARIANT_FAS100A; - break; - - case 0x02: - if ((uid & 0x07) == 0x02) - sc->sc_rev = - NCR_VARIANT_FAS216; - else - sc->sc_rev = - NCR_VARIANT_FAS236; - break; - - case 0x0a: - sc->sc_rev = NCR_VARIANT_FAS366; - break; - - default: - /* - * We could just treat unknown chips - * as ESP200 but then we would most - * likely drive them out of specs. - */ - device_printf(esc->sc_dev, - "Unknown chip\n"); - error = ENXIO; - goto fail_lock; - } - } - } - } - -#ifdef ESP_SBUS_DEBUG - printf("%s: revision %d, uid 0x%x\n", __func__, sc->sc_rev, uid); -#endif - - /* - * This is the value used to start sync negotiations - * Note that the NCR register "SYNCTP" is programmed - * in "clocks per byte", and has a minimum value of 4. - * The SCSI period used in negotiation is one-fourth - * of the time (in nanoseconds) needed to transfer one byte. - * Since the chip's clock is given in MHz, we have the following - * formula: 4 * period = (1000 / freq) * 4 - */ - sc->sc_minsync = 1000 / sc->sc_freq; - - /* - * Except for some variants the maximum transfer size is 64k. - */ - sc->sc_maxxfer = 64 * 1024; - sc->sc_maxoffset = 15; - sc->sc_extended_geom = 1; - - /* - * Alas, we must now modify the value a bit, because it's - * only valid when we can switch on FASTCLK and FASTSCSI bits - * in the config register 3... - */ - switch (sc->sc_rev) { - case NCR_VARIANT_ESP100: - sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - sc->sc_minsync = 0; /* No synch on old chip? */ - break; - - case NCR_VARIANT_ESP100A: - case NCR_VARIANT_ESP200: - sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - /* Min clocks/byte is 5 */ - sc->sc_minsync = ncr53c9x_cpb2stp(sc, 5); - break; - - case NCR_VARIANT_FAS100A: - case NCR_VARIANT_FAS216: - case NCR_VARIANT_FAS236: - /* - * The onboard SCSI chips in Sun Ultra 1 are actually - * documented to be NCR53C9X which use NCRCFG3_FCLK and - * NCRCFG3_FSCSI. BSD/OS however probes these chips as - * FAS100A and uses NCRF9XCFG3_FCLK and NCRF9XCFG3_FSCSI - * instead which seems to be correct as otherwise sync - * negotiation just doesn't work. Using NCRF9XCFG3_FCLK - * and NCRF9XCFG3_FSCSI with these chips in fact also - * yields Fast-SCSI speed. - */ - sc->sc_features = NCR_F_FASTSCSI; - sc->sc_cfg3 = NCRF9XCFG3_FCLK; - sc->sc_cfg3_fscsi = NCRF9XCFG3_FSCSI; - sc->sc_maxwidth = MSG_EXT_WDTR_BUS_8_BIT; - sc->sc_maxxfer = 16 * 1024 * 1024; - break; - - case NCR_VARIANT_FAS366: - sc->sc_maxwidth = MSG_EXT_WDTR_BUS_16_BIT; - sc->sc_maxxfer = 16 * 1024 * 1024; - break; - } - - /* - * Given that we allocate resources based on sc->sc_maxxfer it doesn't - * make sense to supply a value higher than the maximum actually used. - */ - sc->sc_maxxfer = min(sc->sc_maxxfer, MAXPHYS); - - /* Attach the DMA engine. */ - error = lsi64854_attach(esc->sc_dma); - if (error != 0) { - device_printf(esc->sc_dev, "lsi64854_attach failed\n"); - goto fail_lock; - } - - /* Establish interrupt channel. */ - i = 0; - if ((esc->sc_irqres = bus_alloc_resource_any(esc->sc_dev, SYS_RES_IRQ, - &i, RF_SHAREABLE|RF_ACTIVE)) == NULL) { - device_printf(esc->sc_dev, "cannot allocate interrupt\n"); - goto fail_lsi; - } - if (bus_setup_intr(esc->sc_dev, esc->sc_irqres, - INTR_MPSAFE | INTR_TYPE_CAM, NULL, ncr53c9x_intr, sc, - &esc->sc_irq)) { - device_printf(esc->sc_dev, "cannot set up interrupt\n"); - error = ENXIO; - goto fail_ires; - } - - /* Turn on target selection using the `DMA' method. */ - if (sc->sc_rev != NCR_VARIANT_FAS366) - sc->sc_features |= NCR_F_DMASELECT; - - /* Do the common parts of attachment. */ - sc->sc_dev = esc->sc_dev; - error = ncr53c9x_attach(sc); - if (error != 0) { - device_printf(esc->sc_dev, "ncr53c9x_attach failed\n"); - goto fail_intr; - } - - return (0); - - fail_intr: - bus_teardown_intr(esc->sc_dev, esc->sc_irqres, esc->sc_irq); - fail_ires: - bus_release_resource(esc->sc_dev, SYS_RES_IRQ, - rman_get_rid(esc->sc_irqres), esc->sc_irqres); - fail_lsi: - lsi64854_detach(esc->sc_dma); - fail_lock: - NCR_LOCK_DESTROY(sc); - return (error); -} - -static int -espdetach(struct esp_softc *esc) -{ - struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x; - int error; - - bus_teardown_intr(esc->sc_dev, esc->sc_irqres, esc->sc_irq); - error = ncr53c9x_detach(sc); - if (error != 0) - return (error); - error = lsi64854_detach(esc->sc_dma); - if (error != 0) - return (error); - NCR_LOCK_DESTROY(sc); - bus_release_resource(esc->sc_dev, SYS_RES_IRQ, - rman_get_rid(esc->sc_irqres), esc->sc_irqres); - - return (0); -} - -/* - * Glue functions - */ - -#ifdef ESP_SBUS_DEBUG -static int esp_sbus_debug = 0; - -static const struct { - const char *r_name; - int r_flag; -} const esp__read_regnames [] = { - { "TCL", 0}, /* 0/00 */ - { "TCM", 0}, /* 1/04 */ - { "FIFO", 0}, /* 2/08 */ - { "CMD", 0}, /* 3/0c */ - { "STAT", 0}, /* 4/10 */ - { "INTR", 0}, /* 5/14 */ - { "STEP", 0}, /* 6/18 */ - { "FFLAGS", 1}, /* 7/1c */ - { "CFG1", 1}, /* 8/20 */ - { "STAT2", 0}, /* 9/24 */ - { "CFG4", 1}, /* a/28 */ - { "CFG2", 1}, /* b/2c */ - { "CFG3", 1}, /* c/30 */ - { "-none", 1}, /* d/34 */ - { "TCH", 1}, /* e/38 */ - { "TCX", 1}, /* f/3c */ -}; - -static const const struct { - const char *r_name; - int r_flag; -} const esp__write_regnames[] = { - { "TCL", 1}, /* 0/00 */ - { "TCM", 1}, /* 1/04 */ - { "FIFO", 0}, /* 2/08 */ - { "CMD", 0}, /* 3/0c */ - { "SELID", 1}, /* 4/10 */ - { "TIMEOUT", 1}, /* 5/14 */ - { "SYNCTP", 1}, /* 6/18 */ - { "SYNCOFF", 1}, /* 7/1c */ - { "CFG1", 1}, /* 8/20 */ - { "CCF", 1}, /* 9/24 */ - { "TEST", 1}, /* a/28 */ - { "CFG2", 1}, /* b/2c */ - { "CFG3", 1}, /* c/30 */ - { "-none", 1}, /* d/34 */ - { "TCH", 1}, /* e/38 */ - { "TCX", 1}, /* f/3c */ -}; -#endif - -static uint8_t -esp_read_reg(struct ncr53c9x_softc *sc, int reg) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - uint8_t v; - - v = bus_read_1(esc->sc_res, reg * 4); - -#ifdef ESP_SBUS_DEBUG - if (esp_sbus_debug && (reg < 0x10) && esp__read_regnames[reg].r_flag) - printf("RD:%x <%s> %x\n", reg * 4, ((unsigned)reg < 0x10) ? - esp__read_regnames[reg].r_name : "<***>", v); -#endif - - return (v); -} - -static void -esp_write_reg(struct ncr53c9x_softc *sc, int reg, uint8_t v) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - -#ifdef ESP_SBUS_DEBUG - if (esp_sbus_debug && (reg < 0x10) && esp__write_regnames[reg].r_flag) - printf("WR:%x <%s> %x\n", reg * 4, ((unsigned)reg < 0x10) ? - esp__write_regnames[reg].r_name : "<***>", v); -#endif - - bus_write_1(esc->sc_res, reg * 4, v); -} - -static int -esp_dma_isintr(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - return (DMA_ISINTR(esc->sc_dma)); -} - -static void -esp_dma_reset(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - DMA_RESET(esc->sc_dma); -} - -static int -esp_dma_intr(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - return (DMA_INTR(esc->sc_dma)); -} - -static int -esp_dma_setup(struct ncr53c9x_softc *sc, void **addr, size_t *len, - int datain, size_t *dmasize) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - return (DMA_SETUP(esc->sc_dma, addr, len, datain, dmasize)); -} - -static void -esp_dma_go(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - DMA_GO(esc->sc_dma); -} - -static void -esp_dma_stop(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - L64854_SCSR(esc->sc_dma, L64854_GCSR(esc->sc_dma) & ~D_EN_DMA); -} - -static int -esp_dma_isactive(struct ncr53c9x_softc *sc) -{ - struct esp_softc *esc = (struct esp_softc *)sc; - - return (DMA_ISACTIVE(esc->sc_dma)); -} diff --git a/sys/dev/fb/creator.c b/sys/dev/fb/creator.c deleted file mode 100644 index 0c0f083aaaf7..000000000000 --- a/sys/dev/fb/creator.c +++ /dev/null @@ -1,1130 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005 - 2006 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/conf.h> -#include <sys/consio.h> -#include <sys/eventhandler.h> -#include <sys/fbio.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/resource.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/bus_private.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> -#include <machine/sc_machdep.h> - -#include <sys/rman.h> - -#include <dev/fb/fbreg.h> -#include <dev/fb/creatorreg.h> -#include <dev/fb/gfb.h> -#include <dev/syscons/syscons.h> - -#define CREATOR_DRIVER_NAME "creator" - -struct creator_softc { - video_adapter_t sc_va; /* XXX must be first */ - - phandle_t sc_node; - - struct cdev *sc_si; - - struct resource *sc_reg[FFB_NREG]; - bus_space_tag_t sc_bt[FFB_NREG]; - bus_space_handle_t sc_bh[FFB_NREG]; - u_long sc_reg_size; - - u_int sc_height; - u_int sc_width; - - u_int sc_xmargin; - u_int sc_ymargin; - - const u_char *sc_font; - - int sc_bg_cache; - int sc_fg_cache; - int sc_fifo_cache; - int sc_fontinc_cache; - int sc_fontw_cache; - int sc_pmask_cache; - - u_int sc_flags; -#define CREATOR_AFB (1 << 0) -#define CREATOR_CONSOLE (1 << 1) -#define CREATOR_CUREN (1 << 2) -#define CREATOR_CURINV (1 << 3) -#define CREATOR_PAC1 (1 << 4) -}; - -#define FFB_READ(sc, reg, off) \ - bus_space_read_4((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off)) -#define FFB_WRITE(sc, reg, off, val) \ - bus_space_write_4((sc)->sc_bt[(reg)], (sc)->sc_bh[(reg)], (off), (val)) - -#define C(r, g, b) ((b << 16) | (g << 8) | (r)) -static const uint32_t creator_cmap[] = { - C(0x00, 0x00, 0x00), /* black */ - C(0x00, 0x00, 0xff), /* blue */ - C(0x00, 0xff, 0x00), /* green */ - C(0x00, 0xc0, 0xc0), /* cyan */ - C(0xff, 0x00, 0x00), /* red */ - C(0xc0, 0x00, 0xc0), /* magenta */ - C(0xc0, 0xc0, 0x00), /* brown */ - C(0xc0, 0xc0, 0xc0), /* light grey */ - C(0x80, 0x80, 0x80), /* dark grey */ - C(0x80, 0x80, 0xff), /* light blue */ - C(0x80, 0xff, 0x80), /* light green */ - C(0x80, 0xff, 0xff), /* light cyan */ - C(0xff, 0x80, 0x80), /* light red */ - C(0xff, 0x80, 0xff), /* light magenta */ - C(0xff, 0xff, 0x80), /* yellow */ - C(0xff, 0xff, 0xff), /* white */ -}; -#undef C - -static const struct { - vm_offset_t virt; - vm_paddr_t phys; - vm_size_t size; -} creator_fb_map[] = { - { FFB_VIRT_SFB8R, FFB_PHYS_SFB8R, FFB_SIZE_SFB8R }, - { FFB_VIRT_SFB8G, FFB_PHYS_SFB8G, FFB_SIZE_SFB8G }, - { FFB_VIRT_SFB8B, FFB_PHYS_SFB8B, FFB_SIZE_SFB8B }, - { FFB_VIRT_SFB8X, FFB_PHYS_SFB8X, FFB_SIZE_SFB8X }, - { FFB_VIRT_SFB32, FFB_PHYS_SFB32, FFB_SIZE_SFB32 }, - { FFB_VIRT_SFB64, FFB_PHYS_SFB64, FFB_SIZE_SFB64 }, - { FFB_VIRT_FBC, FFB_PHYS_FBC, FFB_SIZE_FBC }, - { FFB_VIRT_FBC_BM, FFB_PHYS_FBC_BM, FFB_SIZE_FBC_BM }, - { FFB_VIRT_DFB8R, FFB_PHYS_DFB8R, FFB_SIZE_DFB8R }, - { FFB_VIRT_DFB8G, FFB_PHYS_DFB8G, FFB_SIZE_DFB8G }, - { FFB_VIRT_DFB8B, FFB_PHYS_DFB8B, FFB_SIZE_DFB8B }, - { FFB_VIRT_DFB8X, FFB_PHYS_DFB8X, FFB_SIZE_DFB8X }, - { FFB_VIRT_DFB24, FFB_PHYS_DFB24, FFB_SIZE_DFB24 }, - { FFB_VIRT_DFB32, FFB_PHYS_DFB32, FFB_SIZE_DFB32 }, - { FFB_VIRT_DFB422A, FFB_PHYS_DFB422A, FFB_SIZE_DFB422A }, - { FFB_VIRT_DFB422AD, FFB_PHYS_DFB422AD, FFB_SIZE_DFB422AD }, - { FFB_VIRT_DFB24B, FFB_PHYS_DFB24B, FFB_SIZE_DFB24B }, - { FFB_VIRT_DFB422B, FFB_PHYS_DFB422B, FFB_SIZE_DFB422B }, - { FFB_VIRT_DFB422BD, FFB_PHYS_DFB422BD, FFB_SIZE_DFB422BD }, - { FFB_VIRT_SFB16Z, FFB_PHYS_SFB16Z, FFB_SIZE_SFB16Z }, - { FFB_VIRT_SFB8Z, FFB_PHYS_SFB8Z, FFB_SIZE_SFB8Z }, - { FFB_VIRT_SFB422, FFB_PHYS_SFB422, FFB_SIZE_SFB422 }, - { FFB_VIRT_SFB422D, FFB_PHYS_SFB422D, FFB_SIZE_SFB422D }, - { FFB_VIRT_FBC_KREG, FFB_PHYS_FBC_KREG, FFB_SIZE_FBC_KREG }, - { FFB_VIRT_DAC, FFB_PHYS_DAC, FFB_SIZE_DAC }, - { FFB_VIRT_PROM, FFB_PHYS_PROM, FFB_SIZE_PROM }, - { FFB_VIRT_EXP, FFB_PHYS_EXP, FFB_SIZE_EXP }, -}; - -#define CREATOR_FB_MAP_SIZE nitems(creator_fb_map) - -extern const struct gfb_font gallant12x22; - -static struct creator_softc creator_softc; -static struct bus_space_tag creator_bst_store[FFB_FBC]; - -static device_probe_t creator_bus_probe; -static device_attach_t creator_bus_attach; - -static device_method_t creator_bus_methods[] = { - DEVMETHOD(device_probe, creator_bus_probe), - DEVMETHOD(device_attach, creator_bus_attach), - - { 0, 0 } -}; - -static devclass_t creator_devclass; - -DEFINE_CLASS_0(creator, creator_bus_driver, creator_bus_methods, - sizeof(struct creator_softc)); -DRIVER_MODULE(creator, nexus, creator_bus_driver, creator_devclass, 0, 0); -DRIVER_MODULE(creator, upa, creator_bus_driver, creator_devclass, 0, 0); - -static d_open_t creator_fb_open; -static d_close_t creator_fb_close; -static d_ioctl_t creator_fb_ioctl; -static d_mmap_t creator_fb_mmap; - -static struct cdevsw creator_fb_devsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, - .d_open = creator_fb_open, - .d_close = creator_fb_close, - .d_ioctl = creator_fb_ioctl, - .d_mmap = creator_fb_mmap, - .d_name = "fb", -}; - -static void creator_cursor_enable(struct creator_softc *sc, int onoff); -static void creator_cursor_install(struct creator_softc *sc); -static void creator_shutdown(void *xsc); - -static int creator_configure(int flags); - -static vi_probe_t creator_probe; -static vi_init_t creator_init; -static vi_get_info_t creator_get_info; -static vi_query_mode_t creator_query_mode; -static vi_set_mode_t creator_set_mode; -static vi_save_font_t creator_save_font; -static vi_load_font_t creator_load_font; -static vi_show_font_t creator_show_font; -static vi_save_palette_t creator_save_palette; -static vi_load_palette_t creator_load_palette; -static vi_set_border_t creator_set_border; -static vi_save_state_t creator_save_state; -static vi_load_state_t creator_load_state; -static vi_set_win_org_t creator_set_win_org; -static vi_read_hw_cursor_t creator_read_hw_cursor; -static vi_set_hw_cursor_t creator_set_hw_cursor; -static vi_set_hw_cursor_shape_t creator_set_hw_cursor_shape; -static vi_blank_display_t creator_blank_display; -static vi_mmap_t creator_mmap; -static vi_ioctl_t creator_ioctl; -static vi_clear_t creator_clear; -static vi_fill_rect_t creator_fill_rect; -static vi_bitblt_t creator_bitblt; -static vi_diag_t creator_diag; -static vi_save_cursor_palette_t creator_save_cursor_palette; -static vi_load_cursor_palette_t creator_load_cursor_palette; -static vi_copy_t creator_copy; -static vi_putp_t creator_putp; -static vi_putc_t creator_putc; -static vi_puts_t creator_puts; -static vi_putm_t creator_putm; - -static video_switch_t creatorvidsw = { - .probe = creator_probe, - .init = creator_init, - .get_info = creator_get_info, - .query_mode = creator_query_mode, - .set_mode = creator_set_mode, - .save_font = creator_save_font, - .load_font = creator_load_font, - .show_font = creator_show_font, - .save_palette = creator_save_palette, - .load_palette = creator_load_palette, - .set_border = creator_set_border, - .save_state = creator_save_state, - .load_state = creator_load_state, - .set_win_org = creator_set_win_org, - .read_hw_cursor = creator_read_hw_cursor, - .set_hw_cursor = creator_set_hw_cursor, - .set_hw_cursor_shape = creator_set_hw_cursor_shape, - .blank_display = creator_blank_display, - .mmap = creator_mmap, - .ioctl = creator_ioctl, - .clear = creator_clear, - .fill_rect = creator_fill_rect, - .bitblt = creator_bitblt, - .diag = creator_diag, - .save_cursor_palette = creator_save_cursor_palette, - .load_cursor_palette = creator_load_cursor_palette, - .copy = creator_copy, - .putp = creator_putp, - .putc = creator_putc, - .puts = creator_puts, - .putm = creator_putm -}; - -VIDEO_DRIVER(creator, creatorvidsw, creator_configure); - -extern sc_rndr_sw_t txtrndrsw; -RENDERER(creator, 0, txtrndrsw, gfb_set); - -RENDERER_MODULE(creator, gfb_set); - -static const u_char creator_mouse_pointer[64][8] __aligned(8) = { - { 0x00, 0x00, }, /* ............ */ - { 0x80, 0x00, }, /* *........... */ - { 0xc0, 0x00, }, /* **.......... */ - { 0xe0, 0x00, }, /* ***......... */ - { 0xf0, 0x00, }, /* ****........ */ - { 0xf8, 0x00, }, /* *****....... */ - { 0xfc, 0x00, }, /* ******...... */ - { 0xfe, 0x00, }, /* *******..... */ - { 0xff, 0x00, }, /* ********.... */ - { 0xff, 0x80, }, /* *********... */ - { 0xfc, 0xc0, }, /* ******..**.. */ - { 0xdc, 0x00, }, /* **.***...... */ - { 0x8e, 0x00, }, /* *...***..... */ - { 0x0e, 0x00, }, /* ....***..... */ - { 0x07, 0x00, }, /* .....***.... */ - { 0x04, 0x00, }, /* .....*...... */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ -}; - -static inline void creator_ras_fifo_wait(struct creator_softc *sc, int n); -static inline void creator_ras_setfontinc(struct creator_softc *sc, int fontinc); -static inline void creator_ras_setfontw(struct creator_softc *sc, int fontw); -static inline void creator_ras_setbg(struct creator_softc *sc, int bg); -static inline void creator_ras_setfg(struct creator_softc *sc, int fg); -static inline void creator_ras_setpmask(struct creator_softc *sc, int pmask); -static inline void creator_ras_wait(struct creator_softc *sc); - -static inline void -creator_ras_wait(struct creator_softc *sc) -{ - int ucsr; - int r; - - for (;;) { - ucsr = FFB_READ(sc, FFB_FBC, FFB_FBC_UCSR); - if ((ucsr & (FBC_UCSR_FB_BUSY | FBC_UCSR_RP_BUSY)) == 0) - break; - r = ucsr & (FBC_UCSR_READ_ERR | FBC_UCSR_FIFO_OVFL); - if (r != 0) - FFB_WRITE(sc, FFB_FBC, FFB_FBC_UCSR, r); - } -} - -static inline void -creator_ras_fifo_wait(struct creator_softc *sc, int n) -{ - int cache; - - cache = sc->sc_fifo_cache; - while (cache < n) - cache = (FFB_READ(sc, FFB_FBC, FFB_FBC_UCSR) & - FBC_UCSR_FIFO_MASK) - 8; - sc->sc_fifo_cache = cache - n; -} - -static inline void -creator_ras_setfontinc(struct creator_softc *sc, int fontinc) -{ - - if (fontinc == sc->sc_fontinc_cache) - return; - sc->sc_fontinc_cache = fontinc; - creator_ras_fifo_wait(sc, 1); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FONTINC, fontinc); - creator_ras_wait(sc); -} - -static inline void -creator_ras_setfontw(struct creator_softc *sc, int fontw) -{ - - if (fontw == sc->sc_fontw_cache) - return; - sc->sc_fontw_cache = fontw; - creator_ras_fifo_wait(sc, 1); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FONTW, fontw); - creator_ras_wait(sc); -} - -static inline void -creator_ras_setbg(struct creator_softc *sc, int bg) -{ - - if (bg == sc->sc_bg_cache) - return; - sc->sc_bg_cache = bg; - creator_ras_fifo_wait(sc, 1); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_BG, bg); - creator_ras_wait(sc); -} - -static inline void -creator_ras_setfg(struct creator_softc *sc, int fg) -{ - - if (fg == sc->sc_fg_cache) - return; - sc->sc_fg_cache = fg; - creator_ras_fifo_wait(sc, 1); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FG, fg); - creator_ras_wait(sc); -} - -static inline void -creator_ras_setpmask(struct creator_softc *sc, int pmask) -{ - - if (pmask == sc->sc_pmask_cache) - return; - sc->sc_pmask_cache = pmask; - creator_ras_fifo_wait(sc, 1); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_PMASK, pmask); - creator_ras_wait(sc); -} - -/* - * video driver interface - */ -static int -creator_configure(int flags) -{ - struct creator_softc *sc; - phandle_t chosen; - phandle_t output; - ihandle_t stdout; - bus_addr_t addr; - char buf[sizeof("SUNW,ffb")]; - int i; - int space; - - /* - * For the high-level console probing return the number of - * registered adapters. - */ - if (!(flags & VIO_PROBE_ONLY)) { - for (i = 0; vid_find_adapter(CREATOR_DRIVER_NAME, i) >= 0; i++) - ; - return (i); - } - - /* Low-level console probing and initialization. */ - - sc = &creator_softc; - if (sc->sc_va.va_flags & V_ADP_REGISTERED) - goto found; - - if ((chosen = OF_finddevice("/chosen")) == -1) - return (0); - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) - return (0); - if ((output = OF_instance_to_package(stdout)) == -1) - return (0); - if (OF_getprop(output, "name", buf, sizeof(buf)) == -1) - return (0); - if (strcmp(buf, "SUNW,ffb") == 0 || strcmp(buf, "SUNW,afb") == 0) { - sc->sc_flags = CREATOR_CONSOLE; - if (strcmp(buf, "SUNW,afb") == 0) - sc->sc_flags |= CREATOR_AFB; - sc->sc_node = output; - } else - return (0); - - for (i = FFB_DAC; i <= FFB_FBC; i++) { - if (OF_decode_addr(output, i, &space, &addr) != 0) - return (0); - sc->sc_bt[i] = &creator_bst_store[i - FFB_DAC]; - sc->sc_bh[i] = sparc64_fake_bustag(space, addr, sc->sc_bt[i]); - } - - if (creator_init(0, &sc->sc_va, 0) < 0) - return (0); - - found: - /* Return number of found adapters. */ - return (1); -} - -static int -creator_probe(int unit, video_adapter_t **adpp, void *arg, int flags) -{ - - return (0); -} - -static int -creator_init(int unit, video_adapter_t *adp, int flags) -{ - struct creator_softc *sc; - phandle_t options; - video_info_t *vi; - char buf[sizeof("screen-#columns")]; - - sc = (struct creator_softc *)adp; - vi = &adp->va_info; - - vid_init_struct(adp, CREATOR_DRIVER_NAME, -1, unit); - - if (OF_getprop(sc->sc_node, "height", &sc->sc_height, - sizeof(sc->sc_height)) == -1) - return (ENXIO); - if (OF_getprop(sc->sc_node, "width", &sc->sc_width, - sizeof(sc->sc_width)) == -1) - return (ENXIO); - if ((options = OF_finddevice("/options")) == -1) - return (ENXIO); - if (OF_getprop(options, "screen-#rows", buf, sizeof(buf)) == -1) - return (ENXIO); - vi->vi_height = strtol(buf, NULL, 10); - if (OF_getprop(options, "screen-#columns", buf, sizeof(buf)) == -1) - return (ENXIO); - vi->vi_width = strtol(buf, NULL, 10); - vi->vi_cwidth = gallant12x22.width; - vi->vi_cheight = gallant12x22.height; - vi->vi_flags = V_INFO_COLOR; - vi->vi_mem_model = V_INFO_MM_OTHER; - - sc->sc_font = gallant12x22.data; - sc->sc_xmargin = (sc->sc_width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->sc_ymargin = (sc->sc_height - (vi->vi_height * vi->vi_cheight)) / 2; - - creator_set_mode(adp, 0); - - if (!(sc->sc_flags & CREATOR_AFB)) { - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_DID); - if (((FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE) & - FFB_DAC_CFG_DID_PNUM) >> 12) != 0x236e) { - sc->sc_flags |= CREATOR_PAC1; - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_UCTRL); - if (((FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE) & - FFB_DAC_UCTRL_MANREV) >> 8) <= 2) - sc->sc_flags |= CREATOR_CURINV; - } - } - - creator_blank_display(adp, V_DISPLAY_ON); - creator_clear(adp); - - /* - * Setting V_ADP_MODECHANGE serves as hack so creator_set_mode() - * (which will invalidate our caches and restore our settings) is - * called when the X server shuts down. Otherwise screen corruption - * happens most of the time. - */ - adp->va_flags |= V_ADP_COLOR | V_ADP_MODECHANGE | V_ADP_BORDER | - V_ADP_INITIALIZED; - if (vid_register(adp) < 0) - return (ENXIO); - adp->va_flags |= V_ADP_REGISTERED; - - return (0); -} - -static int -creator_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - - bcopy(&adp->va_info, info, sizeof(*info)); - return (0); -} - -static int -creator_query_mode(video_adapter_t *adp, video_info_t *info) -{ - - return (ENODEV); -} - -static int -creator_set_mode(video_adapter_t *adp, int mode) -{ - struct creator_softc *sc; - - sc = (struct creator_softc *)adp; - sc->sc_bg_cache = -1; - sc->sc_fg_cache = -1; - sc->sc_fontinc_cache = -1; - sc->sc_fontw_cache = -1; - sc->sc_pmask_cache = -1; - - creator_ras_wait(sc); - sc->sc_fifo_cache = 0; - creator_ras_fifo_wait(sc, 2); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_PPC, FBC_PPC_VCE_DIS | - FBC_PPC_TBE_OPAQUE | FBC_PPC_APE_DIS | FBC_PPC_CS_CONST); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FBC, FFB_FBC_WB_A | FFB_FBC_RB_A | - FFB_FBC_SB_BOTH | FFB_FBC_XE_OFF | FFB_FBC_RGBE_MASK); - return (0); -} - -static int -creator_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - - return (ENODEV); -} - -static int -creator_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - - return (ENODEV); -} - -static int -creator_show_font(video_adapter_t *adp, int page) -{ - - return (ENODEV); -} - -static int -creator_save_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -creator_load_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -creator_set_border(video_adapter_t *adp, int border) -{ - struct creator_softc *sc; - - sc = (struct creator_softc *)adp; - creator_fill_rect(adp, border, 0, 0, sc->sc_width, sc->sc_ymargin); - creator_fill_rect(adp, border, 0, sc->sc_height - sc->sc_ymargin, - sc->sc_width, sc->sc_ymargin); - creator_fill_rect(adp, border, 0, 0, sc->sc_xmargin, sc->sc_height); - creator_fill_rect(adp, border, sc->sc_width - sc->sc_xmargin, 0, - sc->sc_xmargin, sc->sc_height); - return (0); -} - -static int -creator_save_state(video_adapter_t *adp, void *p, size_t size) -{ - - return (ENODEV); -} - -static int -creator_load_state(video_adapter_t *adp, void *p) -{ - - return (ENODEV); -} - -static int -creator_set_win_org(video_adapter_t *adp, off_t offset) -{ - - return (ENODEV); -} - -static int -creator_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - - *col = 0; - *row = 0; - return (0); -} - -static int -creator_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - - return (ENODEV); -} - -static int -creator_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - - return (ENODEV); -} - -static int -creator_blank_display(video_adapter_t *adp, int mode) -{ - struct creator_softc *sc; - uint32_t v; - int i; - - sc = (struct creator_softc *)adp; - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_TGEN); - v = FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE); - switch (mode) { - case V_DISPLAY_ON: - v |= FFB_DAC_CFG_TGEN_VIDE; - break; - case V_DISPLAY_BLANK: - case V_DISPLAY_STAND_BY: - case V_DISPLAY_SUSPEND: - v &= ~FFB_DAC_CFG_TGEN_VIDE; - break; - } - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_TGEN); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE, v); - for (i = 0; i < 10; i++) { - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_TGEN); - (void)FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE); - } - return (0); -} - -static int -creator_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - - return (EINVAL); -} - -static int -creator_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - struct creator_softc *sc; - struct fbcursor *fbc; - struct fbtype *fb; - - sc = (struct creator_softc *)adp; - switch (cmd) { - case FBIOGTYPE: - fb = (struct fbtype *)data; - fb->fb_type = FBTYPE_CREATOR; - fb->fb_height = sc->sc_height; - fb->fb_width = sc->sc_width; - fb->fb_depth = fb->fb_cmsize = fb->fb_size = 0; - break; - case FBIOSCURSOR: - fbc = (struct fbcursor *)data; - if (fbc->set & FB_CUR_SETCUR && fbc->enable == 0) { - creator_cursor_enable(sc, 0); - sc->sc_flags &= ~CREATOR_CUREN; - } else - return (ENODEV); - break; - break; - default: - return (fb_commonioctl(adp, cmd, data)); - } - return (0); -} - -static int -creator_clear(video_adapter_t *adp) -{ - struct creator_softc *sc; - - sc = (struct creator_softc *)adp; - creator_fill_rect(adp, (SC_NORM_ATTR >> 4) & 0xf, 0, 0, sc->sc_width, - sc->sc_height); - return (0); -} - -static int -creator_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - struct creator_softc *sc; - - sc = (struct creator_softc *)adp; - creator_ras_setpmask(sc, 0xffffffff); - creator_ras_fifo_wait(sc, 2); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_ROP, FBC_ROP_NEW); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_DRAWOP, FBC_DRAWOP_RECTANGLE); - creator_ras_setfg(sc, creator_cmap[val & 0xf]); - /* - * Note that at least the Elite3D cards are sensitive to the order - * of operations here. - */ - creator_ras_fifo_wait(sc, 4); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_BY, y); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_BX, x); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_BH, cy); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_BW, cx); - creator_ras_wait(sc); - return (0); -} - -static int -creator_bitblt(video_adapter_t *adp, ...) -{ - - return (ENODEV); -} - -static int -creator_diag(video_adapter_t *adp, int level) -{ - video_info_t info; - - fb_dump_adp_info(adp->va_name, adp, level); - creator_get_info(adp, 0, &info); - fb_dump_mode_info(adp->va_name, adp, &info, level); - return (0); -} - -static int -creator_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -creator_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -creator_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - - return (ENODEV); -} - -static int -creator_putp(video_adapter_t *adp, vm_offset_t off, u_int32_t p, u_int32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - - return (ENODEV); -} - -static int -creator_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) -{ - struct creator_softc *sc; - const uint16_t *p; - int row; - int col; - int i; - - sc = (struct creator_softc *)adp; - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - p = (const uint16_t *)sc->sc_font + (c * adp->va_info.vi_cheight); - creator_ras_setfg(sc, creator_cmap[a & 0xf]); - creator_ras_setbg(sc, creator_cmap[(a >> 4) & 0xf]); - creator_ras_fifo_wait(sc, 1 + adp->va_info.vi_cheight); - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FONTXY, - ((row + sc->sc_ymargin) << 16) | (col + sc->sc_xmargin)); - creator_ras_setfontw(sc, adp->va_info.vi_cwidth); - creator_ras_setfontinc(sc, 0x10000); - for (i = 0; i < adp->va_info.vi_cheight; i++) { - FFB_WRITE(sc, FFB_FBC, FFB_FBC_FONT, *p++ << 16); - } - return (0); -} - -static int -creator_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) -{ - int i; - - for (i = 0; i < len; i++) { - vidd_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); - } - - return (0); -} - -static int -creator_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image, - u_int32_t pixel_mask, int size, int width) -{ - struct creator_softc *sc; - - sc = (struct creator_softc *)adp; - if (!(sc->sc_flags & CREATOR_CUREN)) { - creator_cursor_install(sc); - creator_cursor_enable(sc, 1); - sc->sc_flags |= CREATOR_CUREN; - } - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE2, FFB_DAC_CUR_POS); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, - ((y + sc->sc_ymargin) << 16) | (x + sc->sc_xmargin)); - return (0); -} - -/* - * bus interface - */ -static int -creator_bus_probe(device_t dev) -{ - const char *name; - phandle_t node; - int type; - - name = ofw_bus_get_name(dev); - node = ofw_bus_get_node(dev); - if (strcmp(name, "SUNW,ffb") == 0) { - if (OF_getprop(node, "board_type", &type, sizeof(type)) == -1) - return (ENXIO); - switch (type & 7) { - case 0x0: - device_set_desc(dev, "Creator"); - break; - case 0x3: - device_set_desc(dev, "Creator3D"); - break; - default: - return (ENXIO); - } - } else if (strcmp(name, "SUNW,afb") == 0) - device_set_desc(dev, "Elite3D"); - else - return (ENXIO); - return (BUS_PROBE_DEFAULT); -} - -static int -creator_bus_attach(device_t dev) -{ - struct creator_softc *sc; - video_adapter_t *adp; - video_switch_t *sw; - phandle_t node; - int error; - int rid; - int unit; - int i; - - node = ofw_bus_get_node(dev); - if ((sc = (struct creator_softc *)vid_get_adapter(vid_find_adapter( - CREATOR_DRIVER_NAME, 0))) != NULL && sc->sc_node == node) { - device_printf(dev, "console\n"); - device_set_softc(dev, sc); - } else { - sc = device_get_softc(dev); - sc->sc_node = node; - } - adp = &sc->sc_va; - - /* - * Allocate resources regardless of whether we are the console - * and already obtained the bus tags and handles for the FFB_DAC - * and FFB_FBC register banks in creator_configure() or not so - * the resources are marked as taken in the respective RMAN. - * The supported cards use either 15 (Creator, Elite3D?) or 24 - * (Creator3D?) register banks. We make sure that we can also - * allocate the resources for at least the FFB_DAC and FFB_FBC - * banks here. We try but don't actually care whether we can - * allocate more than these two resources and just limit the - * range accessible via creator_fb_mmap() accordingly. - */ - for (i = 0; i < FFB_NREG; i++) { - rid = i; - sc->sc_reg[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, RF_ACTIVE); - if (sc->sc_reg[i] == NULL) { - if (i <= FFB_FBC) { - device_printf(dev, - "cannot allocate resources\n"); - error = ENXIO; - goto fail; - } - break; - } - sc->sc_bt[i] = rman_get_bustag(sc->sc_reg[i]); - sc->sc_bh[i] = rman_get_bushandle(sc->sc_reg[i]); - } - /* - * The XFree86/X.Org sunffb(4) expects to be able to access the - * memory spanned by the first and the last resource as one chunk - * via creator_fb_mmap(), using offsets from the first resource, - * even though the backing resources are actually non-continuous. - * So make sure that the memory we provide is at least backed by - * increasing resources. - */ - for (i = 1; i < FFB_NREG && sc->sc_reg[i] != NULL && - rman_get_start(sc->sc_reg[i]) > rman_get_start(sc->sc_reg[i - 1]); - i++) - ; - sc->sc_reg_size = rman_get_end(sc->sc_reg[i - 1]) - - rman_get_start(sc->sc_reg[0]) + 1; - - if (!(sc->sc_flags & CREATOR_CONSOLE)) { - if ((sw = vid_get_switch(CREATOR_DRIVER_NAME)) == NULL) { - device_printf(dev, "cannot get video switch\n"); - error = ENODEV; - goto fail; - } - /* - * During device configuration we don't necessarily probe - * the adapter which is the console first so we can't use - * the device unit number for the video adapter unit. The - * worst case would be that we use the video adapter unit - * 0 twice. As it doesn't really matter which unit number - * the corresponding video adapter has just use the next - * unused one. - */ - for (i = 0; i < devclass_get_maxunit(creator_devclass); i++) - if (vid_find_adapter(CREATOR_DRIVER_NAME, i) < 0) - break; - if (strcmp(ofw_bus_get_name(dev), "SUNW,afb") == 0) - sc->sc_flags |= CREATOR_AFB; - if ((error = sw->init(i, adp, 0)) != 0) { - device_printf(dev, "cannot initialize adapter\n"); - goto fail; - } - } - - if (bootverbose) { - if (sc->sc_flags & CREATOR_PAC1) - device_printf(dev, - "BT9068/PAC1 RAMDAC (%s cursor control)\n", - sc->sc_flags & CREATOR_CURINV ? "inverted" : - "normal"); - else - device_printf(dev, "BT498/PAC2 RAMDAC\n"); - } - device_printf(dev, "resolution %dx%d\n", sc->sc_width, sc->sc_height); - - unit = device_get_unit(dev); - sc->sc_si = make_dev(&creator_fb_devsw, unit, UID_ROOT, GID_WHEEL, - 0600, "fb%d", unit); - sc->sc_si->si_drv1 = sc; - - EVENTHANDLER_REGISTER(shutdown_final, creator_shutdown, sc, - SHUTDOWN_PRI_DEFAULT); - - return (0); - - fail: - for (i = 0; i < FFB_NREG && sc->sc_reg[i] != NULL; i++) - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(sc->sc_reg[i]), sc->sc_reg[i]); - return (error); -} - -/* - * /dev/fb interface - */ -static int -creator_fb_open(struct cdev *dev, int flags, int mode, struct thread *td) -{ - - return (0); -} - -static int -creator_fb_close(struct cdev *dev, int flags, int mode, struct thread *td) -{ - - return (0); -} - -static int -creator_fb_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, - struct thread *td) -{ - struct creator_softc *sc; - - sc = dev->si_drv1; - return (creator_ioctl(&sc->sc_va, cmd, data)); -} - -static int -creator_fb_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - struct creator_softc *sc; - int i; - - /* - * NB: This is a special implementation based on the /dev/fb - * requirements of the XFree86/X.Org sunffb(4). - */ - sc = dev->si_drv1; - for (i = 0; i < CREATOR_FB_MAP_SIZE; i++) { - if (offset >= creator_fb_map[i].virt && - offset < creator_fb_map[i].virt + creator_fb_map[i].size) { - offset += creator_fb_map[i].phys - - creator_fb_map[i].virt; - if (offset >= sc->sc_reg_size) - return (EINVAL); - *paddr = sc->sc_bh[0] + offset; - return (0); - } - } - return (EINVAL); -} - -/* - * internal functions - */ -static void -creator_cursor_enable(struct creator_softc *sc, int onoff) -{ - int v; - - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE2, FFB_DAC_CUR_CTRL); - if (sc->sc_flags & CREATOR_CURINV) - v = onoff ? FFB_DAC_CUR_CTRL_P0 | FFB_DAC_CUR_CTRL_P1 : 0; - else - v = onoff ? 0 : FFB_DAC_CUR_CTRL_P0 | FFB_DAC_CUR_CTRL_P1; - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, v); -} - -static void -creator_cursor_install(struct creator_softc *sc) -{ - int i, j; - - creator_cursor_enable(sc, 0); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE2, FFB_DAC_CUR_COLOR1); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, 0xffffff); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, 0x0); - for (i = 0; i < 2; i++) { - FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE2, - i ? FFB_DAC_CUR_BITMAP_P0 : FFB_DAC_CUR_BITMAP_P1); - for (j = 0; j < 64; j++) { - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, - *(const uint32_t *)(&creator_mouse_pointer[j][0])); - FFB_WRITE(sc, FFB_DAC, FFB_DAC_VALUE2, - *(const uint32_t *)(&creator_mouse_pointer[j][4])); - } - } -} - -static void -creator_shutdown(void *xsc) -{ - struct creator_softc *sc = xsc; - - creator_cursor_enable(sc, 0); - /* - * In case this is the console set the cursor of the stdout - * instance to the start of the last line so OFW output ends - * up beneath what FreeBSD left on the screen. - */ - if (sc->sc_flags & CREATOR_CONSOLE) { - OF_interpret("stdout @ is my-self 0 to column#", 0); - OF_interpret("stdout @ is my-self #lines 1 - to line#", 0); - } -} diff --git a/sys/dev/fb/creator_vt.c b/sys/dev/fb/creator_vt.c deleted file mode 100644 index f811f309b0fa..000000000000 --- a/sys/dev/fb/creator_vt.c +++ /dev/null @@ -1,274 +0,0 @@ -/*- - * Copyright (c) 2014 Nathan Whitehorn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/kernel.h> -#include <sys/systm.h> -#include <sys/fbio.h> - -#include <dev/vt/vt.h> -#include <dev/vt/hw/fb/vt_fb.h> -#include <dev/vt/colors/vt_termcolors.h> - -#include <machine/bus.h> -#include <machine/bus_private.h> - -#include <dev/ofw/openfirm.h> -#include "creatorreg.h" - -static vd_probe_t creatorfb_probe; -static vd_init_t creatorfb_init; -static vd_blank_t creatorfb_blank; -static vd_bitblt_text_t creatorfb_bitblt_text; -static vd_bitblt_bmp_t creatorfb_bitblt_bitmap; - -static const struct vt_driver vt_creatorfb_driver = { - .vd_name = "creatorfb", - .vd_probe = creatorfb_probe, - .vd_init = creatorfb_init, - .vd_blank = creatorfb_blank, - .vd_bitblt_text = creatorfb_bitblt_text, - .vd_bitblt_bmp = creatorfb_bitblt_bitmap, - .vd_fb_ioctl = vt_fb_ioctl, - .vd_fb_mmap = vt_fb_mmap, - .vd_priority = VD_PRIORITY_SPECIFIC -}; - -struct creatorfb_softc { - struct fb_info fb; - struct bus_space_tag memt[1]; - bus_space_handle_t memh; -}; - -static struct creatorfb_softc creatorfb_conssoftc; -VT_DRIVER_DECLARE(vt_creatorfb, vt_creatorfb_driver); - -static int -creatorfb_probe(struct vt_device *vd) -{ - phandle_t chosen, node; - ihandle_t stdout; - char type[64], name[64]; - - chosen = OF_finddevice("/chosen"); - OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); - node = OF_instance_to_package(stdout); - if (node == -1) { - /* - * The "/chosen/stdout" does not exist try - * using "screen" directly. - */ - node = OF_finddevice("screen"); - } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) - return (CN_DEAD); - - OF_getprop(node, "name", name, sizeof(name)); - if (strcmp(name, "SUNW,ffb") != 0 && strcmp(name, "SUNW,afb") != 0) - return (CN_DEAD); - - /* Looks OK... */ - return (CN_INTERNAL); -} - -static int -creatorfb_init(struct vt_device *vd) -{ - struct creatorfb_softc *sc; - phandle_t chosen; - phandle_t node; - ihandle_t handle; - uint32_t height, width; - char type[64], name[64]; - bus_addr_t phys; - int space; - - /* Initialize softc */ - vd->vd_softc = sc = &creatorfb_conssoftc; - - chosen = OF_finddevice("/chosen"); - OF_getprop(chosen, "stdout", &handle, sizeof(ihandle_t)); - node = OF_instance_to_package(handle); - if (node == -1) { - /* - * The "/chosen/stdout" does not exist try - * using "screen" directly. - */ - node = OF_finddevice("screen"); - handle = OF_open("screen"); - } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) - return (CN_DEAD); - - OF_getprop(node, "name", name, sizeof(name)); - if (strcmp(name, "SUNW,ffb") != 0 && strcmp(name, "SUNW,afb") != 0) - return (CN_DEAD); - - /* Make sure we have needed properties */ - if (OF_getproplen(node, "height") != sizeof(height) || - OF_getproplen(node, "width") != sizeof(width)) - return (CN_DEAD); - - OF_getprop(node, "height", &height, sizeof(height)); - OF_getprop(node, "width", &width, sizeof(width)); - - sc->fb.fb_height = height; - sc->fb.fb_width = width; - sc->fb.fb_bpp = sc->fb.fb_depth = 32; - sc->fb.fb_stride = 8192; /* Fixed */ - sc->fb.fb_size = sc->fb.fb_height * sc->fb.fb_stride; - - /* Map linear framebuffer */ - if (OF_decode_addr(node, FFB_DFB24, &space, &phys) != 0) - return (CN_DEAD); - sc->fb.fb_pbase = phys; - sc->memh = sparc64_fake_bustag(space, phys, &sc->memt[0]); - - /* 32-bit VGA palette */ - vt_generate_cons_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, - 255, 0, 255, 8, 255, 16); - sc->fb.fb_cmsize = 16; - - vt_fb_init(vd); - - return (CN_INTERNAL); -} - -static void -creatorfb_blank(struct vt_device *vd, term_color_t color) -{ - struct creatorfb_softc *sc; - uint32_t c; - int i; - - sc = vd->vd_softc; - c = sc->fb.fb_cmap[color]; - - for (i = 0; i < sc->fb.fb_height; i++) - bus_space_set_region_4(sc->memt, sc->memh, i*sc->fb.fb_stride, - c, sc->fb.fb_width); -} - -static void -creatorfb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, - const uint8_t *pattern, const uint8_t *mask, - unsigned int width, unsigned int height, - unsigned int x, unsigned int y, term_color_t fg, term_color_t bg) -{ - struct creatorfb_softc *sc = vd->vd_softc; - u_long line; - uint32_t fgc, bgc; - int c, l; - uint8_t b, m; - - fgc = sc->fb.fb_cmap[fg]; - bgc = sc->fb.fb_cmap[bg]; - b = m = 0; - - line = (sc->fb.fb_stride * y) + 4*x; - for (l = 0; - l < height && y + l < vw->vw_draw_area.tr_end.tp_row; - l++) { - for (c = 0; - c < width && x + c < vw->vw_draw_area.tr_end.tp_col; - c++) { - if (c % 8 == 0) - b = *pattern++; - else - b <<= 1; - if (mask != NULL) { - if (c % 8 == 0) - m = *mask++; - else - m <<= 1; - /* Skip pixel write if mask not set. */ - if ((m & 0x80) == 0) - continue; - } - bus_space_write_4(sc->memt, sc->memh, line + 4*c, - (b & 0x80) ? fgc : bgc); - } - line += sc->fb.fb_stride; - } -} - -void -creatorfb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, - const term_rect_t *area) -{ - unsigned int col, row, x, y; - struct vt_font *vf; - term_char_t c; - term_color_t fg, bg; - const uint8_t *pattern; - - vf = vw->vw_font; - - for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) { - for (col = area->tr_begin.tp_col; col < area->tr_end.tp_col; - ++col) { - x = col * vf->vf_width + - vw->vw_draw_area.tr_begin.tp_col; - y = row * vf->vf_height + - vw->vw_draw_area.tr_begin.tp_row; - - c = VTBUF_GET_FIELD(&vw->vw_buf, row, col); - pattern = vtfont_lookup(vf, c); - vt_determine_colors(c, - VTBUF_ISCURSOR(&vw->vw_buf, row, col), &fg, &bg); - - creatorfb_bitblt_bitmap(vd, vw, - pattern, NULL, vf->vf_width, vf->vf_height, - x, y, fg, bg); - } - } - -#ifndef SC_NO_CUTPASTE - if (!vd->vd_mshown) - return; - - term_rect_t drawn_area; - - drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width; - drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height; - drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width; - drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height; - - if (vt_is_cursor_in_area(vd, &drawn_area)) { - creatorfb_bitblt_bitmap(vd, vw, - vd->vd_mcursor->map, vd->vd_mcursor->mask, - vd->vd_mcursor->width, vd->vd_mcursor->height, - vd->vd_mx_drawn + vw->vw_draw_area.tr_begin.tp_col, - vd->vd_my_drawn + vw->vw_draw_area.tr_begin.tp_row, - vd->vd_mcursor_fg, vd->vd_mcursor_bg); - } -#endif -} diff --git a/sys/dev/fb/creatorreg.h b/sys/dev/fb/creatorreg.h deleted file mode 100644 index 2cdb2dff1b93..000000000000 --- a/sys/dev/fb/creatorreg.h +++ /dev/null @@ -1,249 +0,0 @@ -/*- - * Copyright (C) 2000 David S. Miller (davem@redhat.com) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * from: XFree86: ffb_dac.h,v 1.1 2000/05/23 04:47:44 dawes Exp - */ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * $FreeBSD$ - */ - -#ifndef _DEV_FB_CREATORREG_H_ -#define _DEV_FB_CREATORREG_H_ - -#define FFB_NREG 24 - -#define FFB_PROM 0 -#define FFB_DAC 1 -#define FFB_FBC 2 -#define FFB_DFB8R 3 -#define FFB_DFB8G 4 -#define FFB_DFB8B 5 -#define FFB_DFB8X 6 -#define FFB_DFB24 7 -#define FFB_DFB32 8 -#define FFB_SFB8R 9 -#define FFB_SFB8G 10 -#define FFB_SFB8B 11 -#define FFB_SFB8X 12 -#define FFB_SFB32 13 -#define FFB_SFB64 14 -#define FFB_DFB422A 15 - -#define FFB_DAC_TYPE 0x0 -#define FFB_DAC_VALUE 0x4 -#define FFB_DAC_TYPE2 0x8 -#define FFB_DAC_VALUE2 0xc - -/* FFB_DAC_TYPE configuration and palette register addresses */ -#define FFB_DAC_CFG_UCTRL 0x1001 /* User Control */ -#define FFB_DAC_CFG_TGEN 0x6000 /* Timing Generator Control */ -#define FFB_DAC_CFG_DID 0x8000 /* Device Identification */ - -/* FFB_DAC_CFG_UCTRL register */ -#define FFB_DAC_UCTRL_IPDISAB 0x0001 /* Input Pullup Resistor Dis. */ -#define FFB_DAC_UCTRL_ABLANK 0x0002 /* Asynchronous Blank */ -#define FFB_DAC_UCTRL_DBENAB 0x0004 /* Double-Buffer Enable */ -#define FFB_DAC_UCTRL_OVENAB 0x0008 /* Overlay Enable */ -#define FFB_DAC_UCTRL_WMODE 0x0030 /* Window Mode */ -#define FFB_DAC_UCTRL_WM_COMB 0x0000 /* Window Mode Combined */ -#define FFB_DAC_UCTRL_WM_S4 0x0010 /* Window Mode Separate 4 */ -#define FFB_DAC_UCTRL_WM_S8 0x0020 /* Window Mode Separate 8 */ -#define FFB_DAC_UCTRL_WM_RESV 0x0030 /* Window Mode Reserved */ -#define FFB_DAC_UCTRL_MANREV 0x0f00 /* Manufacturing Revision */ - -/* FFB_DAC_CFG_TGEN register */ -#define FFB_DAC_CFG_TGEN_VIDE 0x01 /* Video Enable */ -#define FFB_DAC_CFG_TGEN_TGE 0x02 /* Timing Generator Enable */ -#define FFB_DAC_CFG_TGEN_HSD 0x04 /* HSYNC* Disable */ -#define FFB_DAC_CFG_TGEN_VSD 0x08 /* VSYNC* Disable */ -#define FFB_DAC_CFG_TGEN_EQD 0x10 /* Equalization Disable */ -#define FFB_DAC_CFG_TGEN_MM 0x20 /* 0 = Slave, 1 = Master */ -#define FFB_DAC_CFG_TGEN_IM 0x40 /* 1 = Interlaced Mode */ - -/* FFB_DAC_CFG_DID register */ -#define FFB_DAC_CFG_DID_ONE 0x00000001 /* Always Set */ -#define FFB_DAC_CFG_DID_MANUF 0x00000ffe /* DAC Manufacturer ID */ -#define FFB_DAC_CFG_DID_PNUM 0x0ffff000 /* DAC Part Number */ -#define FFB_DAC_CFG_DID_REV 0xf0000000 /* DAC Revision */ - -/* FFB_DAC_TYPE2 cursor register addresses */ -#define FFB_DAC_CUR_BITMAP_P0 0x0 /* Plane 0 Cursor Bitmap */ -#define FFB_DAC_CUR_BITMAP_P1 0x80 /* Plane 1 Cursor Bitmap */ -#define FFB_DAC_CUR_CTRL 0x100 /* Cursor Control */ -#define FFB_DAC_CUR_COLOR0 0x101 /* Cursor Color 0 */ -#define FFB_DAC_CUR_COLOR1 0x102 /* Cursor Color 1 (bg) */ -#define FFB_DAC_CUR_COLOR2 0x103 /* Cursor Color 2 (fg) */ -#define FFB_DAC_CUR_POS 0x104 /* Active Cursor Position */ - -/* FFB_DAC_CUR_CTRL register (might be inverted on PAC1 DACs) */ -#define FFB_DAC_CUR_CTRL_P0 0x1 /* Plane0 Display Disable */ -#define FFB_DAC_CUR_CTRL_P1 0x2 /* Plane1 Display Disable */ - -#define FFB_FBC_BY 0x60 -#define FFB_FBC_BX 0x64 -#define FFB_FBC_DY 0x68 -#define FFB_FBC_DX 0x6c -#define FFB_FBC_BH 0x70 -#define FFB_FBC_BW 0x74 -#define FFB_FBC_PPC 0x200 /* Pixel Processor Control */ -#define FFB_FBC_FG 0x208 /* Foreground */ -#define FFB_FBC_BG 0x20c /* Background */ -#define FFB_FBC_FBC 0x254 /* Frame Buffer Control */ -#define FFB_FBC_ROP 0x258 /* Raster Operation */ -#define FFB_FBC_PMASK 0x290 /* Pixel Mask */ -#define FFB_FBC_DRAWOP 0x300 /* Draw Operation */ -#define FFB_FBC_FONTXY 0x314 /* Font X/Y */ -#define FFB_FBC_FONTW 0x318 /* Font Width */ -#define FFB_FBC_FONTINC 0x31c /* Font Increment */ -#define FFB_FBC_FONT 0x320 /* Font Data */ -#define FFB_FBC_UCSR 0x900 /* User Control & Status */ - -#define FBC_PPC_VCE_DIS 0x00001000 -#define FBC_PPC_APE_DIS 0x00000800 -#define FBC_PPC_TBE_OPAQUE 0x00000200 -#define FBC_PPC_CS_CONST 0x00000003 - -#define FFB_FBC_WB_A 0x20000000 -#define FFB_FBC_RB_A 0x00004000 -#define FFB_FBC_SB_BOTH 0x00003000 -#define FFB_FBC_XE_OFF 0x00000040 -#define FFB_FBC_RGBE_MASK 0x0000003f - -#define FBC_ROP_NEW 0x83 - -#define FBC_DRAWOP_RECTANGLE 0x08 - -#define FBC_UCSR_FIFO_OVFL 0x80000000 -#define FBC_UCSR_READ_ERR 0x40000000 -#define FBC_UCSR_RP_BUSY 0x02000000 -#define FBC_UCSR_FB_BUSY 0x01000000 -#define FBC_UCSR_FIFO_MASK 0x00000fff - -#define FFB_VIRT_SFB8R 0x00000000 -#define FFB_VIRT_SFB8G 0x00400000 -#define FFB_VIRT_SFB8B 0x00800000 -#define FFB_VIRT_SFB8X 0x00c00000 -#define FFB_VIRT_SFB32 0x01000000 -#define FFB_VIRT_SFB64 0x02000000 -#define FFB_VIRT_FBC 0x04000000 -#define FFB_VIRT_FBC_BM 0x04002000 -#define FFB_VIRT_DFB8R 0x04004000 -#define FFB_VIRT_DFB8G 0x04404000 -#define FFB_VIRT_DFB8B 0x04804000 -#define FFB_VIRT_DFB8X 0x04c04000 -#define FFB_VIRT_DFB24 0x05004000 -#define FFB_VIRT_DFB32 0x06004000 -#define FFB_VIRT_DFB422A 0x07004000 -#define FFB_VIRT_DFB422AD 0x07804000 -#define FFB_VIRT_DFB24B 0x08004000 -#define FFB_VIRT_DFB422B 0x09004000 -#define FFB_VIRT_DFB422BD 0x09804000 -#define FFB_VIRT_SFB16Z 0x0a004000 -#define FFB_VIRT_SFB8Z 0x0a404000 -#define FFB_VIRT_SFB422 0x0ac04000 -#define FFB_VIRT_SFB422D 0x0b404000 -#define FFB_VIRT_FBC_KREG 0x0bc04000 -#define FFB_VIRT_DAC 0x0bc06000 -#define FFB_VIRT_PROM 0x0bc08000 -#define FFB_VIRT_EXP 0x0bc18000 - -#define FFB_PHYS_SFB8R 0x04000000 -#define FFB_PHYS_SFB8G 0x04400000 -#define FFB_PHYS_SFB8B 0x04800000 -#define FFB_PHYS_SFB8X 0x04c00000 -#define FFB_PHYS_SFB32 0x05000000 -#define FFB_PHYS_SFB64 0x06000000 -#define FFB_PHYS_FBC 0x00600000 -#define FFB_PHYS_FBC_BM 0x00600000 -#define FFB_PHYS_DFB8R 0x01000000 -#define FFB_PHYS_DFB8G 0x01400000 -#define FFB_PHYS_DFB8B 0x01800000 -#define FFB_PHYS_DFB8X 0x01c00000 -#define FFB_PHYS_DFB24 0x02000000 -#define FFB_PHYS_DFB32 0x03000000 -#define FFB_PHYS_DFB422A 0x09000000 -#define FFB_PHYS_DFB422AD 0x09800000 -#define FFB_PHYS_DFB24B 0x0a000000 -#define FFB_PHYS_DFB422B 0x0b000000 -#define FFB_PHYS_DFB422BD 0x0b800000 -#define FFB_PHYS_SFB16Z 0x0c800000 -#define FFB_PHYS_SFB8Z 0x0c000000 -#define FFB_PHYS_SFB422 0x0d000000 -#define FFB_PHYS_SFB422D 0x0d800000 -#define FFB_PHYS_FBC_KREG 0x00610000 -#define FFB_PHYS_DAC 0x00400000 -#define FFB_PHYS_PROM 0x00000000 -#define FFB_PHYS_EXP 0x00200000 - -#define FFB_SIZE_SFB8R 0x00400000 -#define FFB_SIZE_SFB8G 0x00400000 -#define FFB_SIZE_SFB8B 0x00400000 -#define FFB_SIZE_SFB8X 0x00400000 -#define FFB_SIZE_SFB32 0x01000000 -#define FFB_SIZE_SFB64 0x02000000 -#define FFB_SIZE_FBC 0x00002000 -#define FFB_SIZE_FBC_BM 0x00002000 -#define FFB_SIZE_DFB8R 0x00400000 -#define FFB_SIZE_DFB8G 0x00400000 -#define FFB_SIZE_DFB8B 0x00400000 -#define FFB_SIZE_DFB8X 0x00400000 -#define FFB_SIZE_DFB24 0x01000000 -#define FFB_SIZE_DFB32 0x01000000 -#define FFB_SIZE_DFB422A 0x00800000 -#define FFB_SIZE_DFB422AD 0x00800000 -#define FFB_SIZE_DFB24B 0x01000000 -#define FFB_SIZE_DFB422B 0x00800000 -#define FFB_SIZE_DFB422BD 0x00800000 -#define FFB_SIZE_SFB16Z 0x00800000 -#define FFB_SIZE_SFB8Z 0x00800000 -#define FFB_SIZE_SFB422 0x00800000 -#define FFB_SIZE_SFB422D 0x00800000 -#define FFB_SIZE_FBC_KREG 0x00002000 -#define FFB_SIZE_DAC 0x00002000 -#define FFB_SIZE_PROM 0x00010000 -#define FFB_SIZE_EXP 0x00002000 - -#endif /* !_DEV_FB_CREATORREG_H_ */ diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index d5bfd0daa0cd..7637f06a86b4 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -51,13 +51,6 @@ copyw(uint16_t *src, uint16_t *dst, size_t size) #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) -#elif defined(__sparc64__) -static __inline void -fillw(int val, uint16_t *buf, size_t size) -{ - while (size--) - *buf++ = val; -} #elif defined(__powerpc__) #define bcopy_io(s, d, c) ofwfb_bcopy((void *)(s), (void *)(d), (c)) @@ -102,7 +95,7 @@ fillw(int val, uint16_t *buf, size_t size) #define writew(a, v) (*(uint16_t*)(a) = (v)) #endif -#else /* !__i386__ && !__amd64__ && !__sparc64__ && !__powerpc__ */ +#else /* !__i386__ && !__amd64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) diff --git a/sys/dev/fb/machfb.c b/sys/dev/fb/machfb.c deleted file mode 100644 index 7c719bbe1cd9..000000000000 --- a/sys/dev/fb/machfb.c +++ /dev/null @@ -1,1581 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 2002 Bang Jun-Young - * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * from: NetBSD: machfb.c,v 1.23 2005/03/07 21:45:24 martin Exp - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * Driver for ATI Mach64 graphics chips. Some code is derived from the - * ATI Rage Pro and Derivatives Programmer's Guide. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/consio.h> -#include <sys/endian.h> -#include <sys/eventhandler.h> -#include <sys/fbio.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/resource.h> - -#include <vm/vm.h> -#include <vm/pmap.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/bus_private.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> -#include <machine/sc_machdep.h> - -#include <sys/rman.h> - -#include <dev/fb/fbreg.h> -#include <dev/fb/gfb.h> -#include <dev/fb/machfbreg.h> -#include <dev/pci/pcivar.h> -#include <dev/pci/pcireg.h> -#include <dev/syscons/syscons.h> - -/* #define MACHFB_DEBUG */ - -#define MACHFB_DRIVER_NAME "machfb" - -#define MACH64_REG_OFF 0x7ffc00 -#define MACH64_REG_SIZE 1024 - -struct machfb_softc { - video_adapter_t sc_va; /* must be first */ - - phandle_t sc_node; - uint16_t sc_chip_id; - uint8_t sc_chip_rev; - - struct resource *sc_memres; - struct resource *sc_vmemres; - bus_space_tag_t sc_memt; - bus_space_tag_t sc_regt; - bus_space_tag_t sc_vmemt; - bus_space_handle_t sc_memh; - bus_space_handle_t sc_vmemh; - bus_space_handle_t sc_regh; - u_long sc_mem; - u_long sc_vmem; - - u_int sc_height; - u_int sc_width; - u_int sc_depth; - u_int sc_xmargin; - u_int sc_ymargin; - - size_t sc_memsize; - u_int sc_memtype; - u_int sc_mem_freq; - u_int sc_ramdac_freq; - u_int sc_ref_freq; - - u_int sc_ref_div; - u_int sc_mclk_post_div; - u_int sc_mclk_fb_div; - - const u_char *sc_font; - u_int sc_cbwidth; - vm_offset_t sc_curoff; - - int sc_bg_cache; - int sc_fg_cache; - u_int sc_draw_cache; -#define MACHFB_DRAW_CHAR (1 << 0) -#define MACHFB_DRAW_FILLRECT (1 << 1) - - u_int sc_flags; -#define MACHFB_CONSOLE (1 << 0) -#define MACHFB_CUREN (1 << 1) -#define MACHFB_DSP (1 << 2) -#define MACHFB_SWAP (1 << 3) -}; - -static const struct { - uint16_t chip_id; - const char *name; - uint32_t ramdac_freq; -} machfb_info[] = { - { ATI_MACH64_CT, "ATI Mach64 CT", 135000 }, - { ATI_RAGE_PRO_AGP, "ATI 3D Rage Pro (AGP)", 230000 }, - { ATI_RAGE_PRO_AGP1X, "ATI 3D Rage Pro (AGP 1x)", 230000 }, - { ATI_RAGE_PRO_PCI_B, "ATI 3D Rage Pro Turbo", 230000 }, - { ATI_RAGE_XC_PCI66, "ATI Rage XL (PCI66)", 230000 }, - { ATI_RAGE_XL_AGP, "ATI Rage XL (AGP)", 230000 }, - { ATI_RAGE_XC_AGP, "ATI Rage XC (AGP)", 230000 }, - { ATI_RAGE_XL_PCI66, "ATI Rage XL (PCI66)", 230000 }, - { ATI_RAGE_PRO_PCI_P, "ATI 3D Rage Pro", 230000 }, - { ATI_RAGE_PRO_PCI_L, "ATI 3D Rage Pro (limited 3D)", 230000 }, - { ATI_RAGE_XL_PCI, "ATI Rage XL", 230000 }, - { ATI_RAGE_XC_PCI, "ATI Rage XC", 230000 }, - { ATI_RAGE_II, "ATI 3D Rage I/II", 135000 }, - { ATI_RAGE_IIP, "ATI 3D Rage II+", 200000 }, - { ATI_RAGE_IIC_PCI, "ATI 3D Rage IIC", 230000 }, - { ATI_RAGE_IIC_AGP_B, "ATI 3D Rage IIC (AGP)", 230000 }, - { ATI_RAGE_IIC_AGP_P, "ATI 3D Rage IIC (AGP)", 230000 }, - { ATI_RAGE_LT_PRO_AGP, "ATI 3D Rage LT Pro (AGP 133MHz)", 230000 }, - { ATI_RAGE_MOB_M3_PCI, "ATI Rage Mobility M3", 230000 }, - { ATI_RAGE_MOB_M3_AGP, "ATI Rage Mobility M3 (AGP)", 230000 }, - { ATI_RAGE_LT, "ATI 3D Rage LT", 230000 }, - { ATI_RAGE_LT_PRO_PCI, "ATI 3D Rage LT Pro", 230000 }, - { ATI_RAGE_MOBILITY, "ATI Rage Mobility", 230000 }, - { ATI_RAGE_L_MOBILITY, "ATI Rage L Mobility", 230000 }, - { ATI_RAGE_LT_PRO, "ATI 3D Rage LT Pro", 230000 }, - { ATI_RAGE_LT_PRO2, "ATI 3D Rage LT Pro", 230000 }, - { ATI_RAGE_MOB_M1_PCI, "ATI Rage Mobility M1 (PCI)", 230000 }, - { ATI_RAGE_L_MOB_M1_PCI, "ATI Rage L Mobility (PCI)", 230000 }, - { ATI_MACH64_VT, "ATI Mach64 VT", 170000 }, - { ATI_MACH64_VTB, "ATI Mach64 VTB", 200000 }, - { ATI_MACH64_VT4, "ATI Mach64 VT4", 230000 } -}; - -static const struct machfb_cmap { - uint8_t red; - uint8_t green; - uint8_t blue; -} machfb_default_cmap[16] = { - {0x00, 0x00, 0x00}, /* black */ - {0x00, 0x00, 0xff}, /* blue */ - {0x00, 0xff, 0x00}, /* green */ - {0x00, 0xc0, 0xc0}, /* cyan */ - {0xff, 0x00, 0x00}, /* red */ - {0xc0, 0x00, 0xc0}, /* magenta */ - {0xc0, 0xc0, 0x00}, /* brown */ - {0xc0, 0xc0, 0xc0}, /* light grey */ - {0x80, 0x80, 0x80}, /* dark grey */ - {0x80, 0x80, 0xff}, /* light blue */ - {0x80, 0xff, 0x80}, /* light green */ - {0x80, 0xff, 0xff}, /* light cyan */ - {0xff, 0x80, 0x80}, /* light red */ - {0xff, 0x80, 0xff}, /* light magenta */ - {0xff, 0xff, 0x80}, /* yellow */ - {0xff, 0xff, 0xff} /* white */ -}; - -#define MACHFB_CMAP_OFF 16 - -static const u_char machfb_mouse_pointer_bits[64][8] = { - { 0x00, 0x00, }, /* ............ */ - { 0x80, 0x00, }, /* *........... */ - { 0xc0, 0x00, }, /* **.......... */ - { 0xe0, 0x00, }, /* ***......... */ - { 0xf0, 0x00, }, /* ****........ */ - { 0xf8, 0x00, }, /* *****....... */ - { 0xfc, 0x00, }, /* ******...... */ - { 0xfe, 0x00, }, /* *******..... */ - { 0xff, 0x00, }, /* ********.... */ - { 0xff, 0x80, }, /* *********... */ - { 0xfc, 0xc0, }, /* ******..**.. */ - { 0xdc, 0x00, }, /* **.***...... */ - { 0x8e, 0x00, }, /* *...***..... */ - { 0x0e, 0x00, }, /* ....***..... */ - { 0x07, 0x00, }, /* .....***.... */ - { 0x04, 0x00, }, /* .....*...... */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ - { 0x00, 0x00, }, /* ............ */ -}; - -/* - * Lookup table to perform a bit-swap of the mouse pointer bits, - * map set bits to CUR_CLR0 and unset bits to transparent. - */ -static const u_char machfb_mouse_pointer_lut[] = { - 0xaa, 0x2a, 0x8a, 0x0a, 0xa2, 0x22, 0x82, 0x02, - 0xa8, 0x28, 0x88, 0x08, 0xa0, 0x20, 0x80, 0x00 -}; - -static const char *const machfb_memtype_names[] = { - "(N/A)", "DRAM", "EDO DRAM", "EDO DRAM", "SDRAM", "SGRAM", "WRAM", - "(unknown type)" -}; - -extern const struct gfb_font gallant12x22; - -static struct machfb_softc machfb_softc; -static struct bus_space_tag machfb_bst_store[1]; - -static device_probe_t machfb_pci_probe; -static device_attach_t machfb_pci_attach; -static device_detach_t machfb_pci_detach; - -static device_method_t machfb_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, machfb_pci_probe), - DEVMETHOD(device_attach, machfb_pci_attach), - DEVMETHOD(device_detach, machfb_pci_detach), - - { 0, 0 } -}; - -static driver_t machfb_pci_driver = { - MACHFB_DRIVER_NAME, - machfb_methods, - sizeof(struct machfb_softc), -}; - -static devclass_t machfb_devclass; - -DRIVER_MODULE(machfb, pci, machfb_pci_driver, machfb_devclass, 0, 0); -MODULE_DEPEND(machfb, pci, 1, 1, 1); - -static void machfb_cursor_enable(struct machfb_softc *, int); -static int machfb_cursor_install(struct machfb_softc *); -static int machfb_get_memsize(struct machfb_softc *); -static void machfb_reset_engine(struct machfb_softc *); -static void machfb_init_engine(struct machfb_softc *); -#if 0 -static void machfb_adjust_frame(struct machfb_softc *, int, int); -#endif -static void machfb_shutdown_final(void *); -static void machfb_shutdown_reset(void *); - -static int machfb_configure(int); - -static vi_probe_t machfb_probe; -static vi_init_t machfb_init; -static vi_get_info_t machfb_get_info; -static vi_query_mode_t machfb_query_mode; -static vi_set_mode_t machfb_set_mode; -static vi_save_font_t machfb_save_font; -static vi_load_font_t machfb_load_font; -static vi_show_font_t machfb_show_font; -static vi_save_palette_t machfb_save_palette; -static vi_load_palette_t machfb_load_palette; -static vi_set_border_t machfb_set_border; -static vi_save_state_t machfb_save_state; -static vi_load_state_t machfb_load_state; -static vi_set_win_org_t machfb_set_win_org; -static vi_read_hw_cursor_t machfb_read_hw_cursor; -static vi_set_hw_cursor_t machfb_set_hw_cursor; -static vi_set_hw_cursor_shape_t machfb_set_hw_cursor_shape; -static vi_blank_display_t machfb_blank_display; -static vi_mmap_t machfb_mmap; -static vi_ioctl_t machfb_ioctl; -static vi_clear_t machfb_clear; -static vi_fill_rect_t machfb_fill_rect; -static vi_bitblt_t machfb_bitblt; -static vi_diag_t machfb_diag; -static vi_save_cursor_palette_t machfb_save_cursor_palette; -static vi_load_cursor_palette_t machfb_load_cursor_palette; -static vi_copy_t machfb_copy; -static vi_putp_t machfb_putp; -static vi_putc_t machfb_putc; -static vi_puts_t machfb_puts; -static vi_putm_t machfb_putm; - -static video_switch_t machfbvidsw = { - .probe = machfb_probe, - .init = machfb_init, - .get_info = machfb_get_info, - .query_mode = machfb_query_mode, - .set_mode = machfb_set_mode, - .save_font = machfb_save_font, - .load_font = machfb_load_font, - .show_font = machfb_show_font, - .save_palette = machfb_save_palette, - .load_palette = machfb_load_palette, - .set_border = machfb_set_border, - .save_state = machfb_save_state, - .load_state = machfb_load_state, - .set_win_org = machfb_set_win_org, - .read_hw_cursor = machfb_read_hw_cursor, - .set_hw_cursor = machfb_set_hw_cursor, - .set_hw_cursor_shape = machfb_set_hw_cursor_shape, - .blank_display = machfb_blank_display, - .mmap = machfb_mmap, - .ioctl = machfb_ioctl, - .clear = machfb_clear, - .fill_rect = machfb_fill_rect, - .bitblt = machfb_bitblt, - .diag = machfb_diag, - .save_cursor_palette = machfb_save_cursor_palette, - .load_cursor_palette = machfb_load_cursor_palette, - .copy = machfb_copy, - .putp = machfb_putp, - .putc = machfb_putc, - .puts = machfb_puts, - .putm = machfb_putm -}; - -VIDEO_DRIVER(machfb, machfbvidsw, machfb_configure); - -extern sc_rndr_sw_t txtrndrsw; -RENDERER(machfb, 0, txtrndrsw, gfb_set); - -RENDERER_MODULE(machfb, gfb_set); - -/* - * Inline functions for getting access to register aperture. - */ -static inline uint32_t regr(struct machfb_softc *, uint32_t); -static inline uint8_t regrb(struct machfb_softc *, uint32_t); -static inline void regw(struct machfb_softc *, uint32_t, uint32_t); -static inline void regwb(struct machfb_softc *, uint32_t, uint8_t); -static inline void regwb_pll(struct machfb_softc *, uint32_t, uint8_t); - -static inline uint32_t -regr(struct machfb_softc *sc, uint32_t index) -{ - - return bus_space_read_4(sc->sc_regt, sc->sc_regh, index); -} - -static inline uint8_t -regrb(struct machfb_softc *sc, uint32_t index) -{ - - return bus_space_read_1(sc->sc_regt, sc->sc_regh, index); -} - -static inline void -regw(struct machfb_softc *sc, uint32_t index, uint32_t data) -{ - - bus_space_write_4(sc->sc_regt, sc->sc_regh, index, data); - bus_space_barrier(sc->sc_regt, sc->sc_regh, index, 4, - BUS_SPACE_BARRIER_WRITE); -} - -static inline void -regwb(struct machfb_softc *sc, uint32_t index, uint8_t data) -{ - - bus_space_write_1(sc->sc_regt, sc->sc_regh, index, data); - bus_space_barrier(sc->sc_regt, sc->sc_regh, index, 1, - BUS_SPACE_BARRIER_WRITE); -} - -static inline void -regwb_pll(struct machfb_softc *sc, uint32_t index, uint8_t data) -{ - - regwb(sc, CLOCK_CNTL + 1, (index << 2) | PLL_WR_EN); - regwb(sc, CLOCK_CNTL + 2, data); - regwb(sc, CLOCK_CNTL + 1, (index << 2) & ~PLL_WR_EN); -} - -static inline void -wait_for_fifo(struct machfb_softc *sc, uint8_t v) -{ - - while ((regr(sc, FIFO_STAT) & 0xffff) > (0x8000 >> v)) - ; -} - -static inline void -wait_for_idle(struct machfb_softc *sc) -{ - - wait_for_fifo(sc, 16); - while ((regr(sc, GUI_STAT) & 1) != 0) - ; -} - -/* - * Inline functions for setting the background and foreground colors. - */ -static inline void machfb_setbg(struct machfb_softc *sc, int bg); -static inline void machfb_setfg(struct machfb_softc *sc, int fg); - -static inline void -machfb_setbg(struct machfb_softc *sc, int bg) -{ - - if (bg == sc->sc_bg_cache) - return; - sc->sc_bg_cache = bg; - wait_for_fifo(sc, 1); - regw(sc, DP_BKGD_CLR, bg + MACHFB_CMAP_OFF); -} - -static inline void -machfb_setfg(struct machfb_softc *sc, int fg) -{ - - if (fg == sc->sc_fg_cache) - return; - sc->sc_fg_cache = fg; - wait_for_fifo(sc, 1); - regw(sc, DP_FRGD_CLR, fg + MACHFB_CMAP_OFF); -} - -/* - * video driver interface - */ -static int -machfb_configure(int flags) -{ - struct machfb_softc *sc; - phandle_t chosen, output; - ihandle_t stdout; - bus_addr_t addr; - uint32_t id; - int i, space; - - /* - * For the high-level console probing return the number of - * registered adapters. - */ - if (!(flags & VIO_PROBE_ONLY)) { - for (i = 0; vid_find_adapter(MACHFB_DRIVER_NAME, i) >= 0; i++) - ; - return (i); - } - - /* Low-level console probing and initialization. */ - - sc = &machfb_softc; - if (sc->sc_va.va_flags & V_ADP_REGISTERED) - goto found; - - if ((chosen = OF_finddevice("/chosen")) == -1) /* Quis contra nos? */ - return (0); - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == -1) - return (0); - if ((output = OF_instance_to_package(stdout)) == -1) - return (0); - if ((OF_getprop(output, "vendor-id", &id, sizeof(id)) == -1) || - id != ATI_VENDOR) - return (0); - if (OF_getprop(output, "device-id", &id, sizeof(id)) == -1) - return (0); - for (i = 0; i < nitems(machfb_info); i++) { - if (id == machfb_info[i].chip_id) { - sc->sc_flags = MACHFB_CONSOLE; - sc->sc_node = output; - sc->sc_chip_id = id; - break; - } - } - if (!(sc->sc_flags & MACHFB_CONSOLE)) - return (0); - - if (OF_getprop(output, "revision-id", &sc->sc_chip_rev, - sizeof(sc->sc_chip_rev)) == -1) - return (0); - if (OF_decode_addr(output, 0, &space, &addr) != 0) - return (0); - sc->sc_memt = &machfb_bst_store[0]; - sc->sc_memh = sparc64_fake_bustag(space, addr, sc->sc_memt); - sc->sc_regt = sc->sc_memt; - bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, - MACH64_REG_SIZE, &sc->sc_regh); - - if (machfb_init(0, &sc->sc_va, 0) < 0) - return (0); - - found: - /* Return number of found adapters. */ - return (1); -} - -static int -machfb_probe(int unit, video_adapter_t **adpp, void *arg, int flags) -{ - - return (0); -} - -static int -machfb_init(int unit, video_adapter_t *adp, int flags) -{ - struct machfb_softc *sc; - phandle_t options; - video_info_t *vi; - char buf[32]; - int i; - uint8_t dac_mask, dac_rindex, dac_windex; - - sc = (struct machfb_softc *)adp; - vi = &adp->va_info; - - if ((regr(sc, CONFIG_CHIP_ID) & 0xffff) != sc->sc_chip_id) - return (ENXIO); - - sc->sc_ramdac_freq = 0; - for (i = 0; i < nitems(machfb_info); i++) { - if (sc->sc_chip_id == machfb_info[i].chip_id) { - sc->sc_ramdac_freq = machfb_info[i].ramdac_freq; - break; - } - } - if (sc->sc_ramdac_freq == 0) - return (ENXIO); - if (sc->sc_chip_id == ATI_RAGE_II && sc->sc_chip_rev & 0x07) - sc->sc_ramdac_freq = 170000; - - vid_init_struct(adp, MACHFB_DRIVER_NAME, -1, unit); - - if (OF_getprop(sc->sc_node, "height", &sc->sc_height, - sizeof(sc->sc_height)) == -1) - return (ENXIO); - if (OF_getprop(sc->sc_node, "width", &sc->sc_width, - sizeof(sc->sc_width)) == -1) - return (ENXIO); - if (OF_getprop(sc->sc_node, "depth", &sc->sc_depth, - sizeof(sc->sc_depth)) == -1) - return (ENXIO); - if ((options = OF_finddevice("/options")) == -1) - return (ENXIO); - if (OF_getprop(options, "screen-#rows", buf, sizeof(buf)) == -1) - return (ENXIO); - vi->vi_height = strtol(buf, NULL, 10); - if (OF_getprop(options, "screen-#columns", buf, sizeof(buf)) == -1) - return (ENXIO); - vi->vi_width = strtol(buf, NULL, 10); - vi->vi_cwidth = gallant12x22.width; - vi->vi_cheight = gallant12x22.height; - vi->vi_flags = V_INFO_COLOR; - vi->vi_mem_model = V_INFO_MM_OTHER; - - sc->sc_font = gallant12x22.data; - sc->sc_cbwidth = howmany(vi->vi_cwidth, NBBY); /* width in bytes */ - sc->sc_xmargin = (sc->sc_width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->sc_ymargin = (sc->sc_height - (vi->vi_height * vi->vi_cheight)) / 2; - - if (sc->sc_chip_id != ATI_MACH64_CT && - !((sc->sc_chip_id == ATI_MACH64_VT || - sc->sc_chip_id == ATI_RAGE_II) && - (sc->sc_chip_rev & 0x07) == 0)) - sc->sc_flags |= MACHFB_DSP; - - sc->sc_memsize = machfb_get_memsize(sc); - if (sc->sc_memsize == 8192) - /* The last page is used as register aperture. */ - sc->sc_memsize -= 4; - sc->sc_memtype = regr(sc, CONFIG_STAT0) & 0x07; - - if ((sc->sc_chip_id >= ATI_RAGE_XC_PCI66 && - sc->sc_chip_id <= ATI_RAGE_XL_PCI66) || - (sc->sc_chip_id >= ATI_RAGE_XL_PCI && - sc->sc_chip_id <= ATI_RAGE_XC_PCI)) - sc->sc_ref_freq = 29498; - else - sc->sc_ref_freq = 14318; - - regwb(sc, CLOCK_CNTL + 1, PLL_REF_DIV << 2); - sc->sc_ref_div = regrb(sc, CLOCK_CNTL + 2); - regwb(sc, CLOCK_CNTL + 1, MCLK_FB_DIV << 2); - sc->sc_mclk_fb_div = regrb(sc, CLOCK_CNTL + 2); - sc->sc_mem_freq = (2 * sc->sc_ref_freq * sc->sc_mclk_fb_div) / - (sc->sc_ref_div * 2); - sc->sc_mclk_post_div = (sc->sc_mclk_fb_div * 2 * sc->sc_ref_freq) / - (sc->sc_mem_freq * sc->sc_ref_div); - - machfb_init_engine(sc); -#if 0 - machfb_adjust_frame(0, 0); -#endif - machfb_set_mode(adp, 0); - - /* - * Install our 16-color color map. This is done only once and with - * an offset of 16 on sparc64 as there the OBP driver expects white - * to be at index 0 and black at 255 (some versions also use 1 - 8 - * for color text support or the full palette for the boot banner - * logo but no versions seems to use the ISO 6429-1983 color map). - * Otherwise the colors are inverted when back in the OFW. - */ - dac_rindex = regrb(sc, DAC_RINDEX); - dac_windex = regrb(sc, DAC_WINDEX); - dac_mask = regrb(sc, DAC_MASK); - regwb(sc, DAC_MASK, 0xff); - regwb(sc, DAC_WINDEX, MACHFB_CMAP_OFF); - for (i = 0; i < 16; i++) { - regwb(sc, DAC_DATA, machfb_default_cmap[i].red); - regwb(sc, DAC_DATA, machfb_default_cmap[i].green); - regwb(sc, DAC_DATA, machfb_default_cmap[i].blue); - } - regwb(sc, DAC_MASK, dac_mask); - regwb(sc, DAC_RINDEX, dac_rindex); - regwb(sc, DAC_WINDEX, dac_windex); - - machfb_blank_display(adp, V_DISPLAY_ON); - machfb_clear(adp); - - /* - * Setting V_ADP_MODECHANGE serves as hack so machfb_set_mode() - * (which will invalidate our caches) is called as a precaution - * when the X server shuts down. - */ - adp->va_flags |= V_ADP_COLOR | V_ADP_MODECHANGE | V_ADP_PALETTE | - V_ADP_BORDER | V_ADP_INITIALIZED; - if (vid_register(adp) < 0) - return (ENXIO); - adp->va_flags |= V_ADP_REGISTERED; - - return (0); -} - -static int -machfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - - bcopy(&adp->va_info, info, sizeof(*info)); - - return (0); -} - -static int -machfb_query_mode(video_adapter_t *adp, video_info_t *info) -{ - - return (ENODEV); -} - -static int -machfb_set_mode(video_adapter_t *adp, int mode) -{ - struct machfb_softc *sc; - - sc = (struct machfb_softc *)adp; - - sc->sc_bg_cache = -1; - sc->sc_fg_cache = -1; - sc->sc_draw_cache = 0; - - return (0); -} - -static int -machfb_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - - return (ENODEV); -} - -static int -machfb_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - - return (ENODEV); -} - -static int -machfb_show_font(video_adapter_t *adp, int page) -{ - - return (ENODEV); -} - -static int -machfb_save_palette(video_adapter_t *adp, u_char *palette) -{ - struct machfb_softc *sc; - int i; - uint8_t dac_mask, dac_rindex, dac_windex; - - sc = (struct machfb_softc *)adp; - - dac_rindex = regrb(sc, DAC_RINDEX); - dac_windex = regrb(sc, DAC_WINDEX); - dac_mask = regrb(sc, DAC_MASK); - regwb(sc, DAC_MASK, 0xff); - regwb(sc, DAC_RINDEX, 0x0); - for (i = 0; i < 256 * 3; i++) - palette[i] = regrb(sc, DAC_DATA); - regwb(sc, DAC_MASK, dac_mask); - regwb(sc, DAC_RINDEX, dac_rindex); - regwb(sc, DAC_WINDEX, dac_windex); - - return (0); -} - -static int -machfb_load_palette(video_adapter_t *adp, u_char *palette) -{ - struct machfb_softc *sc; - int i; - uint8_t dac_mask, dac_rindex, dac_windex; - - sc = (struct machfb_softc *)adp; - - dac_rindex = regrb(sc, DAC_RINDEX); - dac_windex = regrb(sc, DAC_WINDEX); - dac_mask = regrb(sc, DAC_MASK); - regwb(sc, DAC_MASK, 0xff); - regwb(sc, DAC_WINDEX, 0x0); - for (i = 0; i < 256 * 3; i++) - regwb(sc, DAC_DATA, palette[i]); - regwb(sc, DAC_MASK, dac_mask); - regwb(sc, DAC_RINDEX, dac_rindex); - regwb(sc, DAC_WINDEX, dac_windex); - - return (0); -} - -static int -machfb_set_border(video_adapter_t *adp, int border) -{ - struct machfb_softc *sc; - - sc = (struct machfb_softc *)adp; - - machfb_fill_rect(adp, border, 0, 0, sc->sc_width, sc->sc_ymargin); - machfb_fill_rect(adp, border, 0, sc->sc_height - sc->sc_ymargin, - sc->sc_width, sc->sc_ymargin); - machfb_fill_rect(adp, border, 0, 0, sc->sc_xmargin, sc->sc_height); - machfb_fill_rect(adp, border, sc->sc_width - sc->sc_xmargin, 0, - sc->sc_xmargin, sc->sc_height); - - return (0); -} - -static int -machfb_save_state(video_adapter_t *adp, void *p, size_t size) -{ - - return (ENODEV); -} - -static int -machfb_load_state(video_adapter_t *adp, void *p) -{ - - return (ENODEV); -} - -static int -machfb_set_win_org(video_adapter_t *adp, off_t offset) -{ - - return (ENODEV); -} - -static int -machfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - - *col = 0; - *row = 0; - - return (0); -} - -static int -machfb_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - - return (ENODEV); -} - -static int -machfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - - return (ENODEV); -} - -static int -machfb_blank_display(video_adapter_t *adp, int mode) -{ - struct machfb_softc *sc; - uint32_t crtc_gen_cntl; - - sc = (struct machfb_softc *)adp; - - crtc_gen_cntl = (regr(sc, CRTC_GEN_CNTL) | CRTC_EXT_DISP_EN | CRTC_EN) & - ~(CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | CRTC_DISPLAY_DIS); - switch (mode) { - case V_DISPLAY_ON: - break; - case V_DISPLAY_BLANK: - crtc_gen_cntl |= CRTC_HSYNC_DIS | CRTC_VSYNC_DIS | - CRTC_DISPLAY_DIS; - break; - case V_DISPLAY_STAND_BY: - crtc_gen_cntl |= CRTC_HSYNC_DIS | CRTC_DISPLAY_DIS; - break; - case V_DISPLAY_SUSPEND: - crtc_gen_cntl |= CRTC_VSYNC_DIS | CRTC_DISPLAY_DIS; - break; - } - regw(sc, CRTC_GEN_CNTL, crtc_gen_cntl); - - return (0); -} - -static int -machfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - struct machfb_softc *sc; - video_info_t *vi; - - sc = (struct machfb_softc *)adp; - vi = &adp->va_info; - - /* BAR 2 - VGA memory */ - if (sc->sc_vmem != 0 && offset >= sc->sc_vmem && - offset < sc->sc_vmem + vi->vi_registers_size) { - *paddr = vi->vi_registers + offset - sc->sc_vmem; - return (0); - } - - /* BAR 0 - framebuffer */ - if (offset >= sc->sc_mem && - offset < sc->sc_mem + vi->vi_buffer_size) { - *paddr = vi->vi_buffer + offset - sc->sc_mem; - return (0); - } - - /* 'regular' framebuffer mmap()ing */ - if (offset < adp->va_window_size) { - *paddr = vi->vi_window + offset; - return (0); - } - - return (EINVAL); -} - -static int -machfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - struct machfb_softc *sc; - struct fbcursor *fbc; - struct fbtype *fb; - - sc = (struct machfb_softc *)adp; - - switch (cmd) { - case FBIOGTYPE: - fb = (struct fbtype *)data; - fb->fb_type = FBTYPE_PCIMISC; - fb->fb_height = sc->sc_height; - fb->fb_width = sc->sc_width; - fb->fb_depth = sc->sc_depth; - if (sc->sc_depth <= 1 || sc->sc_depth > 8) - fb->fb_cmsize = 0; - else - fb->fb_cmsize = 1 << sc->sc_depth; - fb->fb_size = adp->va_buffer_size; - break; - case FBIOSCURSOR: - fbc = (struct fbcursor *)data; - if (fbc->set & FB_CUR_SETCUR && fbc->enable == 0) { - machfb_cursor_enable(sc, 0); - sc->sc_flags &= ~MACHFB_CUREN; - } else - return (ENODEV); - break; - default: - return (fb_commonioctl(adp, cmd, data)); - } - - return (0); -} - -static int -machfb_clear(video_adapter_t *adp) -{ - struct machfb_softc *sc; - - sc = (struct machfb_softc *)adp; - - machfb_fill_rect(adp, (SC_NORM_ATTR >> 4) & 0xf, 0, 0, sc->sc_width, - sc->sc_height); - - return (0); -} - -static int -machfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - struct machfb_softc *sc; - - sc = (struct machfb_softc *)adp; - - if (sc->sc_draw_cache != MACHFB_DRAW_FILLRECT) { - wait_for_fifo(sc, 7); - regw(sc, DP_WRITE_MASK, 0xff); - regw(sc, DP_PIX_WIDTH, DST_8BPP | SRC_8BPP | HOST_8BPP); - regw(sc, DP_SRC, FRGD_SRC_FRGD_CLR); - regw(sc, DP_MIX, MIX_SRC << 16); - regw(sc, CLR_CMP_CNTL, 0); /* no transparency */ - regw(sc, SRC_CNTL, SRC_LINE_X_LEFT_TO_RIGHT); - regw(sc, DST_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); - sc->sc_draw_cache = MACHFB_DRAW_FILLRECT; - } - machfb_setfg(sc, val); - wait_for_fifo(sc, 4); - regw(sc, SRC_Y_X, (x << 16) | y); - regw(sc, SRC_WIDTH1, cx); - regw(sc, DST_Y_X, (x << 16) | y); - regw(sc, DST_HEIGHT_WIDTH, (cx << 16) | cy); - - return (0); -} - -static int -machfb_bitblt(video_adapter_t *adp, ...) -{ - - return (ENODEV); -} - -static int -machfb_diag(video_adapter_t *adp, int level) -{ - video_info_t info; - - fb_dump_adp_info(adp->va_name, adp, level); - machfb_get_info(adp, 0, &info); - fb_dump_mode_info(adp->va_name, adp, &info, level); - - return (0); -} - -static int -machfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -machfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - - return (ENODEV); -} - -static int -machfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - - return (ENODEV); -} - -static int -machfb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - - return (ENODEV); -} - -static int -machfb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) -{ - struct machfb_softc *sc; - const uint8_t *p; - int i; - - sc = (struct machfb_softc *)adp; - - if (sc->sc_draw_cache != MACHFB_DRAW_CHAR) { - wait_for_fifo(sc, 8); - regw(sc, DP_WRITE_MASK, 0xff); /* XXX only good for 8 bit */ - regw(sc, DP_PIX_WIDTH, DST_8BPP | SRC_1BPP | HOST_1BPP); - regw(sc, DP_SRC, MONO_SRC_HOST | BKGD_SRC_BKGD_CLR | - FRGD_SRC_FRGD_CLR); - regw(sc, DP_MIX ,((MIX_SRC & 0xffff) << 16) | MIX_SRC); - regw(sc, CLR_CMP_CNTL, 0); /* no transparency */ - regw(sc, SRC_CNTL, SRC_LINE_X_LEFT_TO_RIGHT); - regw(sc, DST_CNTL, DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT); - regw(sc, HOST_CNTL, HOST_BYTE_ALIGN); - sc->sc_draw_cache = MACHFB_DRAW_CHAR; - } - machfb_setbg(sc, (a >> 4) & 0xf); - machfb_setfg(sc, a & 0xf); - wait_for_fifo(sc, 4 + (adp->va_info.vi_cheight / sc->sc_cbwidth)); - regw(sc, SRC_Y_X, 0); - regw(sc, SRC_WIDTH1, adp->va_info.vi_cwidth); - regw(sc, DST_Y_X, ((((off % adp->va_info.vi_width) * - adp->va_info.vi_cwidth) + sc->sc_xmargin) << 16) | - (((off / adp->va_info.vi_width) * adp->va_info.vi_cheight) + - sc->sc_ymargin)); - regw(sc, DST_HEIGHT_WIDTH, (adp->va_info.vi_cwidth << 16) | - adp->va_info.vi_cheight); - p = sc->sc_font + (c * adp->va_info.vi_cheight * sc->sc_cbwidth); - for (i = 0; i < adp->va_info.vi_cheight * sc->sc_cbwidth; i += 4) - regw(sc, HOST_DATA0 + i, (p[i + 3] << 24 | p[i + 2] << 16 | - p[i + 1] << 8 | p[i])); - - return (0); -} - -static int -machfb_puts(video_adapter_t *adp, vm_offset_t off, uint16_t *s, int len) -{ - struct machfb_softc *sc; - int blanks, i, x1, x2, y1, y2; - uint8_t a, c, color1, color2; - - sc = (struct machfb_softc *)adp; - -#define MACHFB_BLANK machfb_fill_rect(adp, color1, x1, y1, \ - blanks * adp->va_info.vi_cwidth, \ - adp->va_info.vi_cheight) - - blanks = color1 = x1 = y1 = 0; - for (i = 0; i < len; i++) { - /* - * Accelerate continuous blanks by drawing a respective - * rectangle instead. Drawing a rectangle of any size - * takes about the same number of operations as drawing - * a single character. - */ - c = s[i] & 0xff; - a = (s[i] & 0xff00) >> 8; - if (c == 0x00 || c == 0x20 || c == 0xdb || c == 0xff) { - color2 = (a >> (c == 0xdb ? 0 : 4) & 0xf); - x2 = (((off + i) % adp->va_info.vi_width) * - adp->va_info.vi_cwidth) + sc->sc_xmargin; - y2 = (((off + i) / adp->va_info.vi_width) * - adp->va_info.vi_cheight) + sc->sc_ymargin; - if (blanks == 0) { - color1 = color2; - x1 = x2; - y1 = y2; - blanks++; - } else if (color1 != color2 || y1 != y2) { - MACHFB_BLANK; - color1 = color2; - x1 = x2; - y1 = y2; - blanks = 1; - } else - blanks++; - } else { - if (blanks != 0) { - MACHFB_BLANK; - blanks = 0; - } - vidd_putc(adp, off + i, c, a); - } - } - if (blanks != 0) - MACHFB_BLANK; - -#undef MACHFB_BLANK - - return (0); -} - -static int -machfb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, - uint32_t pixel_mask, int size, int width) -{ - struct machfb_softc *sc; - int error; - - sc = (struct machfb_softc *)adp; - - if ((!(sc->sc_flags & MACHFB_CUREN)) && - (error = machfb_cursor_install(sc)) < 0) - return (error); - else { - /* - * The hardware cursor always must be disabled when - * fiddling with its bits otherwise some artifacts - * may appear on the screen. - */ - machfb_cursor_enable(sc, 0); - } - - regw(sc, CUR_HORZ_VERT_OFF, 0); - if ((regr(sc, GEN_TEST_CNTL) & CRTC_DBL_SCAN_EN) != 0) - y <<= 1; - regw(sc, CUR_HORZ_VERT_POSN, ((y + sc->sc_ymargin) << 16) | - (x + sc->sc_xmargin)); - machfb_cursor_enable(sc, 1); - sc->sc_flags |= MACHFB_CUREN; - - return (0); -} - -/* - * PCI bus interface - */ -static int -machfb_pci_probe(device_t dev) -{ - int i; - - if (pci_get_class(dev) != PCIC_DISPLAY || - pci_get_subclass(dev) != PCIS_DISPLAY_VGA) - return (ENXIO); - - for (i = 0; i < nitems(machfb_info); i++) { - if (pci_get_device(dev) == machfb_info[i].chip_id) { - device_set_desc(dev, machfb_info[i].name); - return (BUS_PROBE_DEFAULT); - } - } - - return (ENXIO); -} - -static int -machfb_pci_attach(device_t dev) -{ - struct machfb_softc *sc; - video_adapter_t *adp; - video_switch_t *sw; - video_info_t *vi; - phandle_t node; - int error, i, rid; - uint32_t *p32, u32; - uint8_t *p; - - node = ofw_bus_get_node(dev); - if ((sc = (struct machfb_softc *)vid_get_adapter(vid_find_adapter( - MACHFB_DRIVER_NAME, 0))) != NULL && sc->sc_node == node) { - device_printf(dev, "console\n"); - device_set_softc(dev, sc); - } else { - sc = device_get_softc(dev); - - sc->sc_node = node; - sc->sc_chip_id = pci_get_device(dev); - sc->sc_chip_rev = pci_get_revid(dev); - } - adp = &sc->sc_va; - vi = &adp->va_info; - - rid = PCIR_BAR(0); - if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate memory resources\n"); - return (ENXIO); - } - sc->sc_memt = rman_get_bustag(sc->sc_memres); - sc->sc_memh = rman_get_bushandle(sc->sc_memres); - sc->sc_mem = rman_get_start(sc->sc_memres); - vi->vi_buffer = sc->sc_memh; - vi->vi_buffer_size = rman_get_size(sc->sc_memres); - if (OF_getprop(sc->sc_node, "address", &u32, sizeof(u32)) > 0 && - vtophys(u32) == sc->sc_memh) - adp->va_mem_base = u32; - else { - if (bus_space_map(sc->sc_memt, vi->vi_buffer, - vi->vi_buffer_size, BUS_SPACE_MAP_LINEAR, - &sc->sc_memh) != 0) { - device_printf(dev, "cannot map memory resources\n"); - error = ENXIO; - goto fail_memres; - } - adp->va_mem_base = - (vm_offset_t)rman_get_virtual(sc->sc_memres); - } - adp->va_mem_size = vi->vi_buffer_size; - adp->va_buffer = adp->va_mem_base; - adp->va_buffer_size = adp->va_mem_size; - sc->sc_regt = sc->sc_memt; - if (bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, - MACH64_REG_SIZE, &sc->sc_regh) != 0) { - device_printf(dev, "cannot allocate register resources\n"); - error = ENXIO; - goto fail_memmap; - } - - /* - * Depending on the firmware version the VGA I/O and/or memory - * resources of the Mach64 chips come up disabled. These will be - * enabled by pci(4) when activating the resource in question but - * this doesn't necessarily mean that the resource is valid. - * Invalid resources seem to have in common that they start at - * address 0. We don't allocate the VGA memory in this case in - * order to avoid warnings in apb(4) and crashes when using this - * invalid resources. X.Org is aware of this and doesn't use the - * VGA memory resource in this case (but demands it if it's valid). - */ - rid = PCIR_BAR(2); - if (bus_get_resource_start(dev, SYS_RES_MEMORY, rid) != 0) { - if ((sc->sc_vmemres = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { - device_printf(dev, - "cannot allocate VGA memory resources\n"); - error = ENXIO; - goto fail_memmap; - } - sc->sc_vmemt = rman_get_bustag(sc->sc_vmemres); - sc->sc_vmemh = rman_get_bushandle(sc->sc_vmemres); - sc->sc_vmem = rman_get_start(sc->sc_vmemres); - vi->vi_registers = sc->sc_vmemh; - vi->vi_registers_size = rman_get_size(sc->sc_vmemres); - if (bus_space_map(sc->sc_vmemt, vi->vi_registers, - vi->vi_registers_size, BUS_SPACE_MAP_LINEAR, - &sc->sc_vmemh) != 0) { - device_printf(dev, - "cannot map VGA memory resources\n"); - error = ENXIO; - goto fail_vmemres; - } - adp->va_registers = - (vm_offset_t)rman_get_virtual(sc->sc_vmemres); - adp->va_registers_size = vi->vi_registers_size; - } - - if (!(sc->sc_flags & MACHFB_CONSOLE)) { - if ((sw = vid_get_switch(MACHFB_DRIVER_NAME)) == NULL) { - device_printf(dev, "cannot get video switch\n"); - error = ENODEV; - goto fail_vmemmap; - } - /* - * During device configuration we don't necessarily probe - * the adapter which is the console first so we can't use - * the device unit number for the video adapter unit. The - * worst case would be that we use the video adapter unit - * 0 twice. As it doesn't really matter which unit number - * the corresponding video adapter has just use the next - * unused one. - */ - for (i = 0; i < devclass_get_maxunit(machfb_devclass); i++) - if (vid_find_adapter(MACHFB_DRIVER_NAME, i) < 0) - break; - if ((error = sw->init(i, adp, 0)) != 0) { - device_printf(dev, "cannot initialize adapter\n"); - goto fail_vmemmap; - } - } - - /* - * Test whether the aperture is byte swapped or not, set - * va_window and va_window_size as appropriate. Note that - * the aperture could be mapped either big or little endian - * independently of the endianness of the host so this has - * to be a runtime test. - */ - p32 = (uint32_t *)adp->va_buffer; - u32 = *p32; - p = (uint8_t *)adp->va_buffer; - *p32 = 0x12345678; - if (!(p[0] == 0x12 && p[1] == 0x34 && p[2] == 0x56 && p[3] == 0x78)) { - adp->va_window = adp->va_buffer + 0x800000; - adp->va_window_size = adp->va_buffer_size - 0x800000; - vi->vi_window = vi->vi_buffer + 0x800000; - vi->vi_window_size = vi->vi_buffer_size - 0x800000; - sc->sc_flags |= MACHFB_SWAP; - } else { - adp->va_window = adp->va_buffer; - adp->va_window_size = adp->va_buffer_size; - vi->vi_window = vi->vi_buffer; - vi->vi_window_size = vi->vi_buffer_size; - } - *p32 = u32; - adp->va_window_gran = adp->va_window_size; - - device_printf(dev, - "%d MB aperture at %p %sswapped\n", - (u_int)(adp->va_window_size / (1024 * 1024)), - (void *)adp->va_window, (sc->sc_flags & MACHFB_SWAP) ? - "" : "not "); - device_printf(dev, - "%ld KB %s %d.%d MHz, maximum RAMDAC clock %d MHz, %sDSP\n", - (u_long)sc->sc_memsize, machfb_memtype_names[sc->sc_memtype], - sc->sc_mem_freq / 1000, sc->sc_mem_freq % 1000, - sc->sc_ramdac_freq / 1000, - (sc->sc_flags & MACHFB_DSP) ? "" : "no "); - device_printf(dev, "resolution %dx%d at %d bpp\n", - sc->sc_width, sc->sc_height, sc->sc_depth); - - /* - * Allocate one page for the mouse pointer image at the end of - * the little endian aperture, right before the memory mapped - * registers that might also reside there. Must be done after - * sc_memsize was set and possibly adjusted to account for the - * memory mapped registers. - */ - sc->sc_curoff = (sc->sc_memsize * 1024) - PAGE_SIZE; - sc->sc_memsize -= PAGE_SIZE / 1024; - machfb_cursor_enable(sc, 0); - /* Initialize with an all transparent image. */ - memset((void *)(adp->va_buffer + sc->sc_curoff), 0xaa, PAGE_SIZE); - - /* - * Register a handler that performs some cosmetic surgery like - * turning off the mouse pointer on halt in preparation for - * handing the screen over to the OFW. Register another handler - * that turns off the CRTC when resetting, otherwise the OFW - * boot command issued by cpu_reset() just doesn't work. - */ - EVENTHANDLER_REGISTER(shutdown_final, machfb_shutdown_final, sc, - SHUTDOWN_PRI_DEFAULT); - EVENTHANDLER_REGISTER(shutdown_reset, machfb_shutdown_reset, sc, - SHUTDOWN_PRI_DEFAULT); - - return (0); - - fail_vmemmap: - if (adp->va_registers != 0) - bus_space_unmap(sc->sc_vmemt, sc->sc_vmemh, - vi->vi_registers_size); - fail_vmemres: - if (sc->sc_vmemres != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(sc->sc_vmemres), sc->sc_vmemres); - fail_memmap: - bus_space_unmap(sc->sc_memt, sc->sc_memh, vi->vi_buffer_size); - fail_memres: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(sc->sc_memres), sc->sc_memres); - - return (error); -} - -static int -machfb_pci_detach(device_t dev) -{ - - return (EINVAL); -} - -/* - * internal functions - */ -static void -machfb_cursor_enable(struct machfb_softc *sc, int onoff) -{ - - if (onoff) - regw(sc, GEN_TEST_CNTL, - regr(sc, GEN_TEST_CNTL) | HWCURSOR_ENABLE); - else - regw(sc, GEN_TEST_CNTL, - regr(sc, GEN_TEST_CNTL) &~ HWCURSOR_ENABLE); -} - -static int -machfb_cursor_install(struct machfb_softc *sc) -{ - uint16_t *p, v; - uint8_t fg; - int i, j; - - if (sc->sc_curoff == 0) - return (ENODEV); - - machfb_cursor_enable(sc, 0); - regw(sc, CUR_OFFSET, sc->sc_curoff >> 3); - fg = SC_NORM_ATTR & 0xf; - regw(sc, CUR_CLR0, machfb_default_cmap[fg].red << 24 | - machfb_default_cmap[fg].green << 16 | - machfb_default_cmap[fg].blue << 8); - p = (uint16_t *)(sc->sc_va.va_buffer + sc->sc_curoff); - for (i = 0; i < 64; i++) { - for (j = 0; j < 8; j++) { - v = machfb_mouse_pointer_lut[ - machfb_mouse_pointer_bits[i][j] >> 4] << 8 | - machfb_mouse_pointer_lut[ - machfb_mouse_pointer_bits[i][j] & 0x0f]; - if (sc->sc_flags & MACHFB_SWAP) - *(p++) = bswap16(v); - else - *(p++) = v; - } - } - - return (0); -} - -static int -machfb_get_memsize(struct machfb_softc *sc) -{ - int tmp, memsize; - const int mem_tab[] = { - 512, 1024, 2048, 4096, 6144, 8192, 12288, 16384 - }; - - tmp = regr(sc, MEM_CNTL); -#ifdef MACHFB_DEBUG - printf("memcntl=0x%08x\n", tmp); -#endif - if (sc->sc_flags & MACHFB_DSP) { - tmp &= 0x0000000f; - if (tmp < 8) - memsize = (tmp + 1) * 512; - else if (tmp < 12) - memsize = (tmp - 3) * 1024; - else - memsize = (tmp - 7) * 2048; - } else - memsize = mem_tab[tmp & 0x07]; - - return (memsize); -} - -static void -machfb_reset_engine(struct machfb_softc *sc) -{ - - /* Reset engine.*/ - regw(sc, GEN_TEST_CNTL, regr(sc, GEN_TEST_CNTL) & ~GUI_ENGINE_ENABLE); - - /* Enable engine. */ - regw(sc, GEN_TEST_CNTL, regr(sc, GEN_TEST_CNTL) | GUI_ENGINE_ENABLE); - - /* - * Ensure engine is not locked up by clearing any FIFO or - * host errors. - */ - regw(sc, BUS_CNTL, regr(sc, BUS_CNTL) | BUS_HOST_ERR_ACK | - BUS_FIFO_ERR_ACK); -} - -static void -machfb_init_engine(struct machfb_softc *sc) -{ - uint32_t pitch_value; - - pitch_value = sc->sc_width; - - if (sc->sc_depth == 24) - pitch_value *= 3; - - machfb_reset_engine(sc); - - wait_for_fifo(sc, 14); - - regw(sc, CONTEXT_MASK, 0xffffffff); - - regw(sc, DST_OFF_PITCH, (pitch_value / 8) << 22); - - regw(sc, DST_Y_X, 0); - regw(sc, DST_HEIGHT, 0); - regw(sc, DST_BRES_ERR, 0); - regw(sc, DST_BRES_INC, 0); - regw(sc, DST_BRES_DEC, 0); - - regw(sc, DST_CNTL, DST_LAST_PEL | DST_X_LEFT_TO_RIGHT | - DST_Y_TOP_TO_BOTTOM); - - regw(sc, SRC_OFF_PITCH, (pitch_value / 8) << 22); - - regw(sc, SRC_Y_X, 0); - regw(sc, SRC_HEIGHT1_WIDTH1, 1); - regw(sc, SRC_Y_X_START, 0); - regw(sc, SRC_HEIGHT2_WIDTH2, 1); - - regw(sc, SRC_CNTL, SRC_LINE_X_LEFT_TO_RIGHT); - - wait_for_fifo(sc, 13); - regw(sc, HOST_CNTL, 0); - - regw(sc, PAT_REG0, 0); - regw(sc, PAT_REG1, 0); - regw(sc, PAT_CNTL, 0); - - regw(sc, SC_LEFT, 0); - regw(sc, SC_TOP, 0); - regw(sc, SC_BOTTOM, sc->sc_height - 1); - regw(sc, SC_RIGHT, pitch_value - 1); - - regw(sc, DP_BKGD_CLR, 0); - regw(sc, DP_FRGD_CLR, 0xffffffff); - regw(sc, DP_WRITE_MASK, 0xffffffff); - regw(sc, DP_MIX, (MIX_SRC << 16) | MIX_DST); - - regw(sc, DP_SRC, FRGD_SRC_FRGD_CLR); - - wait_for_fifo(sc, 3); - regw(sc, CLR_CMP_CLR, 0); - regw(sc, CLR_CMP_MASK, 0xffffffff); - regw(sc, CLR_CMP_CNTL, 0); - - wait_for_fifo(sc, 2); - switch (sc->sc_depth) { - case 8: - regw(sc, DP_PIX_WIDTH, HOST_8BPP | SRC_8BPP | DST_8BPP); - regw(sc, DP_CHAIN_MASK, DP_CHAIN_8BPP); - regw(sc, DAC_CNTL, regr(sc, DAC_CNTL) | DAC_8BIT_EN); - break; -#if 0 - case 32: - regw(sc, DP_PIX_WIDTH, HOST_32BPP | SRC_32BPP | DST_32BPP); - regw(sc, DP_CHAIN_MASK, DP_CHAIN_32BPP); - regw(sc, DAC_CNTL, regr(sc, DAC_CNTL) | DAC_8BIT_EN); - break; -#endif - } - - wait_for_fifo(sc, 2); - regw(sc, CRTC_INT_CNTL, regr(sc, CRTC_INT_CNTL) & ~0x20); - regw(sc, GUI_TRAJ_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); - - wait_for_idle(sc); -} - -#if 0 -static void -machfb_adjust_frame(struct machfb_softc *sc, int x, int y) -{ - int offset; - - offset = ((x + y * sc->sc_width) * (sc->sc_depth >> 3)) >> 3; - - regw(sc, CRTC_OFF_PITCH, (regr(sc, CRTC_OFF_PITCH) & 0xfff00000) | - offset); -} -#endif - -static void -machfb_shutdown_final(void *v) -{ - struct machfb_softc *sc = v; - - machfb_cursor_enable(sc, 0); - /* - * In case this is the console set the cursor of the stdout - * instance to the start of the last line so OFW output ends - * up beneath what FreeBSD left on the screen. - */ - if (sc->sc_flags & MACHFB_CONSOLE) { - OF_interpret("stdout @ is my-self 0 to column#", 0); - OF_interpret("stdout @ is my-self #lines 1 - to line#", 0); - } -} - -static void -machfb_shutdown_reset(void *v) -{ - struct machfb_softc *sc = v; - - machfb_blank_display(&sc->sc_va, V_DISPLAY_STAND_BY); -} diff --git a/sys/dev/fb/machfbreg.h b/sys/dev/fb/machfbreg.h deleted file mode 100644 index 8990a4e3993a..000000000000 --- a/sys/dev/fb/machfbreg.h +++ /dev/null @@ -1,458 +0,0 @@ -/*- - * Copyright 1992,1993,1994,1995,1996,1997 by Kevin E. Martin, Chapel Hill, North Carolina. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Kevin E. Martin not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. Kevin E. Martin - * makes no representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * KEVIN E. MARTIN, RICKARD E. FAITH, AND TIAGO GONS DISCLAIM ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE - * AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - * Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) - * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) - * Modified for the Mach64 by Kevin E. Martin (martin@cs.unc.edu) - * - * from: NetBSD: machfbreg.h,v 1.1 2002/10/24 18:15:57 junyoung Exp - * - * $FreeBSD$ - */ - -#ifndef _DEV_FB_MACHFB_H_ -#define _DEV_FB_MACHFB_H_ - -/* NON-GUI MEMORY MAPPED Registers - expressed in BYTE offsets */ - -#define CRTC_H_TOTAL_DISP 0x0000 /* Dword offset 00 */ -#define CRTC_H_SYNC_STRT_WID 0x0004 /* Dword offset 01 */ -#define CRTC_V_TOTAL_DISP 0x0008 /* Dword offset 02 */ -#define CRTC_V_SYNC_STRT_WID 0x000C /* Dword offset 03 */ -#define CRTC_VLINE_CRNT_VLINE 0x0010 /* Dword offset 04 */ -#define CRTC_OFF_PITCH 0x0014 /* Dword offset 05 */ -#define CRTC_INT_CNTL 0x0018 /* Dword offset 06 */ -#define CRTC_GEN_CNTL 0x001C /* Dword offset 07 */ - -#define DSP_CONFIG 0x0020 /* Dword offset 08 */ -#define DSP_ON_OFF 0x0024 /* Dword offset 09 */ - -#define SHARED_CNTL 0x0038 /* Dword offset 0E */ - -#define OVR_CLR 0x0040 /* Dword offset 10 */ -#define OVR_WID_LEFT_RIGHT 0x0044 /* Dword offset 11 */ -#define OVR_WID_TOP_BOTTOM 0x0048 /* Dword offset 12 */ - -#define CUR_CLR0 0x0060 /* Dword offset 18 */ -#define CUR_CLR1 0x0064 /* Dword offset 19 */ -#define CUR_OFFSET 0x0068 /* Dword offset 1A */ -#define CUR_HORZ_VERT_POSN 0x006C /* Dword offset 1B */ -#define CUR_HORZ_VERT_OFF 0x0070 /* Dword offset 1C */ - -#define HW_DEBUG 0x007C /* Dword offset 1F */ - -#define SCRATCH_REG0 0x0080 /* Dword offset 20 */ -#define SCRATCH_REG1 0x0084 /* Dword offset 21 */ - -#define CLOCK_CNTL 0x0090 /* Dword offset 24 */ - -#define BUS_CNTL 0x00A0 /* Dword offset 28 */ - -#define LCD_INDEX 0x00A4 /* Dword offset 29 (LTPro) */ -#define LCD_DATA 0x00A8 /* Dword offset 2A (LTPro) */ - -#define MEM_CNTL 0x00B0 /* Dword offset 2C */ - -#define MEM_VGA_WP_SEL 0x00B4 /* Dword offset 2D */ -#define MEM_VGA_RP_SEL 0x00B8 /* Dword offset 2E */ - -#define DAC_REGS 0x00C0 /* Dword offset 30 */ -#define DAC_WINDEX 0x00C0 /* Dword offset 30 */ -#define DAC_DATA 0x00C1 /* Dword offset 30 */ -#define DAC_MASK 0x00C2 /* Dword offset 30 */ -#define DAC_RINDEX 0x00C3 /* Dword offset 30 */ -#define DAC_CNTL 0x00C4 /* Dword offset 31 */ - -#define HORZ_STRETCHING 0x00C8 /* Dword offset 32 (LT) */ -#define VERT_STRETCHING 0x00CC /* Dword offset 33 (LT) */ - -#define GEN_TEST_CNTL 0x00D0 /* Dword offset 34 */ - -#define LCD_GEN_CNTL 0x00D4 /* Dword offset 35 (LT) */ -#define POWER_MANAGEMENT 0x00D8 /* Dword offset 36 (LT) */ - -#define CONFIG_CNTL 0x00DC /* Dword offset 37 (CT, ET, VT) */ -#define CONFIG_CHIP_ID 0x00E0 /* Dword offset 38 */ -#define CONFIG_STAT0 0x00E4 /* Dword offset 39 */ -#define CONFIG_STAT1 0x00E8 /* Dword offset 3A */ - - -/* GUI MEMORY MAPPED Registers */ - -#define DST_OFF_PITCH 0x0100 /* Dword offset 40 */ -#define DST_X 0x0104 /* Dword offset 41 */ -#define DST_Y 0x0108 /* Dword offset 42 */ -#define DST_Y_X 0x010C /* Dword offset 43 */ -#define DST_WIDTH 0x0110 /* Dword offset 44 */ -#define DST_HEIGHT 0x0114 /* Dword offset 45 */ -#define DST_HEIGHT_WIDTH 0x0118 /* Dword offset 46 */ -#define DST_X_WIDTH 0x011C /* Dword offset 47 */ -#define DST_BRES_LNTH 0x0120 /* Dword offset 48 */ -#define DST_BRES_ERR 0x0124 /* Dword offset 49 */ -#define DST_BRES_INC 0x0128 /* Dword offset 4A */ -#define DST_BRES_DEC 0x012C /* Dword offset 4B */ -#define DST_CNTL 0x0130 /* Dword offset 4C */ - -#define SRC_OFF_PITCH 0x0180 /* Dword offset 60 */ -#define SRC_X 0x0184 /* Dword offset 61 */ -#define SRC_Y 0x0188 /* Dword offset 62 */ -#define SRC_Y_X 0x018C /* Dword offset 63 */ -#define SRC_WIDTH1 0x0190 /* Dword offset 64 */ -#define SRC_HEIGHT1 0x0194 /* Dword offset 65 */ -#define SRC_HEIGHT1_WIDTH1 0x0198 /* Dword offset 66 */ -#define SRC_X_START 0x019C /* Dword offset 67 */ -#define SRC_Y_START 0x01A0 /* Dword offset 68 */ -#define SRC_Y_X_START 0x01A4 /* Dword offset 69 */ -#define SRC_WIDTH2 0x01A8 /* Dword offset 6A */ -#define SRC_HEIGHT2 0x01AC /* Dword offset 6B */ -#define SRC_HEIGHT2_WIDTH2 0x01B0 /* Dword offset 6C */ -#define SRC_CNTL 0x01B4 /* Dword offset 6D */ - -#define HOST_DATA0 0x0200 /* Dword offset 80 */ -#define HOST_DATA1 0x0204 /* Dword offset 81 */ -#define HOST_DATA2 0x0208 /* Dword offset 82 */ -#define HOST_DATA3 0x020C /* Dword offset 83 */ -#define HOST_DATA4 0x0210 /* Dword offset 84 */ -#define HOST_DATA5 0x0214 /* Dword offset 85 */ -#define HOST_DATA6 0x0218 /* Dword offset 86 */ -#define HOST_DATA7 0x021C /* Dword offset 87 */ -#define HOST_DATA8 0x0220 /* Dword offset 88 */ -#define HOST_DATA9 0x0224 /* Dword offset 89 */ -#define HOST_DATAA 0x0228 /* Dword offset 8A */ -#define HOST_DATAB 0x022C /* Dword offset 8B */ -#define HOST_DATAC 0x0230 /* Dword offset 8C */ -#define HOST_DATAD 0x0234 /* Dword offset 8D */ -#define HOST_DATAE 0x0238 /* Dword offset 8E */ -#define HOST_DATAF 0x023C /* Dword offset 8F */ -#define HOST_CNTL 0x0240 /* Dword offset 90 */ - -#define PAT_REG0 0x0280 /* Dword offset A0 */ -#define PAT_REG1 0x0284 /* Dword offset A1 */ -#define PAT_CNTL 0x0288 /* Dword offset A2 */ - -#define SC_LEFT 0x02A0 /* Dword offset A8 */ -#define SC_RIGHT 0x02A4 /* Dword offset A9 */ -#define SC_LEFT_RIGHT 0x02A8 /* Dword offset AA */ -#define SC_TOP 0x02AC /* Dword offset AB */ -#define SC_BOTTOM 0x02B0 /* Dword offset AC */ -#define SC_TOP_BOTTOM 0x02B4 /* Dword offset AD */ - -#define DP_BKGD_CLR 0x02C0 /* Dword offset B0 */ -#define DP_FRGD_CLR 0x02C4 /* Dword offset B1 */ -#define DP_WRITE_MASK 0x02C8 /* Dword offset B2 */ -#define DP_CHAIN_MASK 0x02CC /* Dword offset B3 */ -#define DP_PIX_WIDTH 0x02D0 /* Dword offset B4 */ -#define DP_MIX 0x02D4 /* Dword offset B5 */ -#define DP_SRC 0x02D8 /* Dword offset B6 */ - -#define CLR_CMP_CLR 0x0300 /* Dword offset C0 */ -#define CLR_CMP_MASK 0x0304 /* Dword offset C1 */ -#define CLR_CMP_CNTL 0x0308 /* Dword offset C2 */ - -#define FIFO_STAT 0x0310 /* Dword offset C4 */ - -#define CONTEXT_MASK 0x0320 /* Dword offset C8 */ -#define CONTEXT_LOAD_CNTL 0x032C /* Dword offset CB */ - -#define GUI_TRAJ_CNTL 0x0330 /* Dword offset CC */ -#define GUI_STAT 0x0338 /* Dword offset CE */ - - -/* CRTC control values */ - -#define CRTC_HSYNC_NEG 0x00200000 -#define CRTC_VSYNC_NEG 0x00200000 - -#define CRTC_DBL_SCAN_EN 0x00000001 -#define CRTC_INTERLACE_EN 0x00000002 -#define CRTC_HSYNC_DIS 0x00000004 -#define CRTC_VSYNC_DIS 0x00000008 -#define CRTC_CSYNC_EN 0x00000010 -#define CRTC_PIX_BY_2_EN 0x00000020 -#define CRTC_DISPLAY_DIS 0x00000040 -#define CRTC_VGA_XOVERSCAN 0x00000080 - -#define CRTC_PIX_WIDTH 0x00000700 -#define CRTC_PIX_WIDTH_4BPP 0x00000100 -#define CRTC_PIX_WIDTH_8BPP 0x00000200 -#define CRTC_PIX_WIDTH_15BPP 0x00000300 -#define CRTC_PIX_WIDTH_16BPP 0x00000400 -#define CRTC_PIX_WIDTH_24BPP 0x00000500 -#define CRTC_PIX_WIDTH_32BPP 0x00000600 - -#define CRTC_BYTE_PIX_ORDER 0x00000800 -#define CRTC_PIX_ORDER_MSN_LSN 0x00000000 -#define CRTC_PIX_ORDER_LSN_MSN 0x00000800 - -#define CRTC_FIFO_LWM 0x000f0000 -#define CRTC_LOCK_REGS 0x00400000 -#define CRTC_EXT_DISP_EN 0x01000000 -#define CRTC_EN 0x02000000 -#define CRTC_DISP_REQ_EN 0x04000000 -#define CRTC_VGA_LINEAR 0x08000000 -#define CRTC_VSYNC_FALL_EDGE 0x10000000 -#define CRTC_VGA_TEXT_132 0x20000000 -#define CRTC_CNT_EN 0x40000000 -#define CRTC_CUR_B_TEST 0x80000000 - -#define CRTC_CRNT_VLINE 0x07f00000 -#define CRTC_VBLANK 0x00000001 - -/* DAC control values */ - -#define DAC_EXT_SEL_RS2 0x01 -#define DAC_EXT_SEL_RS3 0x02 -#define DAC_8BIT_EN 0x00000100 -#define DAC_PIX_DLY_MASK 0x00000600 -#define DAC_PIX_DLY_0NS 0x00000000 -#define DAC_PIX_DLY_2NS 0x00000200 -#define DAC_PIX_DLY_4NS 0x00000400 -#define DAC_BLANK_ADJ_MASK 0x00001800 -#define DAC_BLANK_ADJ_0 0x00000000 -#define DAC_BLANK_ADJ_1 0x00000800 -#define DAC_BLANK_ADJ_2 0x00001000 - - -/* Mix control values */ - -#define MIX_NOT_DST 0x0000 -#define MIX_0 0x0001 -#define MIX_1 0x0002 -#define MIX_DST 0x0003 -#define MIX_NOT_SRC 0x0004 -#define MIX_XOR 0x0005 -#define MIX_XNOR 0x0006 -#define MIX_SRC 0x0007 -#define MIX_NAND 0x0008 -#define MIX_NOT_SRC_OR_DST 0x0009 -#define MIX_SRC_OR_NOT_DST 0x000a -#define MIX_OR 0x000b -#define MIX_AND 0x000c -#define MIX_SRC_AND_NOT_DST 0x000d -#define MIX_NOT_SRC_AND_DST 0x000e -#define MIX_NOR 0x000f - -/* Maximum engine dimensions */ -#define ENGINE_MIN_X 0 -#define ENGINE_MIN_Y 0 -#define ENGINE_MAX_X 4095 -#define ENGINE_MAX_Y 16383 - -/* Mach64 engine bit constants - these are typically ORed together */ - -/* HW_DEBUG register constants */ -/* For RagePro only... */ -#define AUTO_FF_DIS 0x000001000 -#define AUTO_BLKWRT_DIS 0x000002000 - -/* BUS_CNTL register constants */ -#define BUS_FIFO_ERR_ACK 0x00200000 -#define BUS_HOST_ERR_ACK 0x00800000 -#define BUS_APER_REG_DIS 0x00000010 - -/* GEN_TEST_CNTL register constants */ -#define GEN_OVR_OUTPUT_EN 0x20 -#define HWCURSOR_ENABLE 0x80 -#define GUI_ENGINE_ENABLE 0x100 -#define BLOCK_WRITE_ENABLE 0x200 - -/* DSP_CONFIG register constants */ -#define DSP_XCLKS_PER_QW 0x00003fff -#define DSP_LOOP_LATENCY 0x000f0000 -#define DSP_PRECISION 0x00700000 - -/* DSP_ON_OFF register constants */ -#define DSP_OFF 0x000007ff -#define DSP_ON 0x07ff0000 - -/* SHARED_CNTL register constants */ -#define CTD_FIFO5 0x01000000 - -/* CLOCK_CNTL register constants */ -#define CLOCK_SEL 0x0f -#define CLOCK_DIV 0x30 -#define CLOCK_DIV1 0x00 -#define CLOCK_DIV2 0x10 -#define CLOCK_DIV4 0x20 -#define CLOCK_STROBE 0x40 -#define PLL_WR_EN 0x02 - -/* PLL registers */ -#define PLL_MACRO_CNTL 0x01 -#define PLL_REF_DIV 0x02 -#define PLL_GEN_CNTL 0x03 -#define MCLK_FB_DIV 0x04 -#define PLL_VCLK_CNTL 0x05 -#define VCLK_POST_DIV 0x06 -#define VCLK0_FB_DIV 0x07 -#define VCLK1_FB_DIV 0x08 -#define VCLK2_FB_DIV 0x09 -#define VCLK3_FB_DIV 0x0A -#define PLL_XCLK_CNTL 0x0B -#define PLL_TEST_CTRL 0x0E -#define PLL_TEST_COUNT 0x0F - -/* Memory types for CT, ET, VT, GT */ -#define DRAM 1 -#define EDO_DRAM 2 -#define PSEUDO_EDO 3 -#define SDRAM 4 -#define SGRAM 5 -#define SGRAM32 6 - -#define DAC_INTERNAL 0x00 -#define DAC_IBMRGB514 0x01 -#define DAC_ATI68875 0x02 -#define DAC_TVP3026_A 0x72 -#define DAC_BT476 0x03 -#define DAC_BT481 0x04 -#define DAC_ATT20C491 0x14 -#define DAC_SC15026 0x24 -#define DAC_MU9C1880 0x34 -#define DAC_IMSG174 0x44 -#define DAC_ATI68860_B 0x05 -#define DAC_ATI68860_C 0x15 -#define DAC_TVP3026_B 0x75 -#define DAC_STG1700 0x06 -#define DAC_ATT498 0x16 -#define DAC_STG1702 0x07 -#define DAC_SC15021 0x17 -#define DAC_ATT21C498 0x27 -#define DAC_STG1703 0x37 -#define DAC_CH8398 0x47 -#define DAC_ATT20C408 0x57 - -#define CLK_ATI18818_0 0 -#define CLK_ATI18818_1 1 -#define CLK_STG1703 2 -#define CLK_CH8398 3 -#define CLK_INTERNAL 4 -#define CLK_ATT20C408 5 -#define CLK_IBMRGB514 6 - -/* DST_CNTL register constants */ -#define DST_X_RIGHT_TO_LEFT 0 -#define DST_X_LEFT_TO_RIGHT 1 -#define DST_Y_BOTTOM_TO_TOP 0 -#define DST_Y_TOP_TO_BOTTOM 2 -#define DST_X_MAJOR 0 -#define DST_Y_MAJOR 4 -#define DST_X_TILE 8 -#define DST_Y_TILE 0x10 -#define DST_LAST_PEL 0x20 -#define DST_POLYGON_ENABLE 0x40 -#define DST_24_ROTATION_ENABLE 0x80 - -/* SRC_CNTL register constants */ -#define SRC_PATTERN_ENABLE 1 -#define SRC_ROTATION_ENABLE 2 -#define SRC_LINEAR_ENABLE 4 -#define SRC_BYTE_ALIGN 8 -#define SRC_LINE_X_RIGHT_TO_LEFT 0 -#define SRC_LINE_X_LEFT_TO_RIGHT 0x10 - -/* HOST_CNTL register constants */ -#define HOST_BYTE_ALIGN 1 - -/* DP_CHAIN_MASK register constants */ -#define DP_CHAIN_4BPP 0x8888 -#define DP_CHAIN_7BPP 0xD2D2 -#define DP_CHAIN_8BPP 0x8080 -#define DP_CHAIN_8BPP_RGB 0x9292 -#define DP_CHAIN_15BPP 0x4210 -#define DP_CHAIN_16BPP 0x8410 -#define DP_CHAIN_24BPP 0x8080 -#define DP_CHAIN_32BPP 0x8080 - -/* DP_PIX_WIDTH register constants */ -#define DST_1BPP 0 -#define DST_4BPP 1 -#define DST_8BPP 2 -#define DST_15BPP 3 -#define DST_16BPP 4 -#define DST_32BPP 6 -#define SRC_1BPP 0 -#define SRC_4BPP 0x100 -#define SRC_8BPP 0x200 -#define SRC_15BPP 0x300 -#define SRC_16BPP 0x400 -#define SRC_32BPP 0x600 -#define HOST_1BPP 0 -#define HOST_4BPP 0x10000 -#define HOST_8BPP 0x20000 -#define HOST_15BPP 0x30000 -#define HOST_16BPP 0x40000 -#define HOST_32BPP 0x60000 -#define BYTE_ORDER_MSB_TO_LSB 0 -#define BYTE_ORDER_LSB_TO_MSB 0x1000000 - -/* DP_SRC register constants */ -#define BKGD_SRC_BKGD_CLR 0 -#define BKGD_SRC_FRGD_CLR 1 -#define BKGD_SRC_HOST 2 -#define BKGD_SRC_BLIT 3 -#define BKGD_SRC_PATTERN 4 -#define FRGD_SRC_BKGD_CLR 0 -#define FRGD_SRC_FRGD_CLR 0x100 -#define FRGD_SRC_HOST 0x200 -#define FRGD_SRC_BLIT 0x300 -#define FRGD_SRC_PATTERN 0x400 -#define MONO_SRC_ONE 0 -#define MONO_SRC_PATTERN 0x10000 -#define MONO_SRC_HOST 0x20000 -#define MONO_SRC_BLIT 0x30000 - -/* PCI IDs */ -#define ATI_VENDOR 0x1002 -#define ATI_MACH64_CT 0x4354 /* Mach64 CT */ -#define ATI_RAGE_PRO_AGP 0x4742 /* 3D Rage Pro (AGP) */ -#define ATI_RAGE_PRO_AGP1X 0x4744 /* 3D Rage Pro (AGP 1x) */ -#define ATI_RAGE_PRO_PCI_B 0x4749 /* 3D Rage Pro Turbo */ -#define ATI_RAGE_XC_PCI66 0x474c /* Rage XC (PCI66) */ -#define ATI_RAGE_XL_AGP 0x474d /* Rage XL (AGP) */ -#define ATI_RAGE_XC_AGP 0x474e /* Rage XC (AGP) */ -#define ATI_RAGE_XL_PCI66 0x474f /* Rage XL (PCI66) */ -#define ATI_RAGE_PRO_PCI_P 0x4750 /* 3D Rage Pro */ -#define ATI_RAGE_PRO_PCI_L 0x4751 /* 3D Rage Pro (limited 3D) */ -#define ATI_RAGE_XL_PCI 0x4752 /* Rage XL */ -#define ATI_RAGE_XC_PCI 0x4753 /* Rage XC */ -#define ATI_RAGE_II 0x4754 /* 3D Rage I/II */ -#define ATI_RAGE_IIP 0x4755 /* 3D Rage II+ */ -#define ATI_RAGE_IIC_PCI 0x4756 /* 3D Rage IIC */ -#define ATI_RAGE_IIC_AGP_B 0x4757 /* 3D Rage IIC (AGP) */ -#define ATI_RAGE_IIC_AGP_P 0x475a /* 3D Rage IIC (AGP) */ -#define ATI_RAGE_LT_PRO_AGP 0x4c42 /* 3D Rage LT Pro (AGP 133MHz) */ -#define ATI_RAGE_MOB_M3_PCI 0x4c45 /* Rage Mobility M3 */ -#define ATI_RAGE_MOB_M3_AGP 0x4c46 /* Rage Mobility M3 (AGP) */ -#define ATI_RAGE_LT 0x4c47 /* 3D Rage LT */ -#define ATI_RAGE_LT_PRO_PCI 0x4c49 /* 3D Rage LT Pro */ -#define ATI_RAGE_MOBILITY 0x4c4d /* Rage Mobility */ -#define ATI_RAGE_L_MOBILITY 0x4c4e /* Rage L Mobility */ -#define ATI_RAGE_LT_PRO 0x4c50 /* 3D Rage LT Pro */ -#define ATI_RAGE_LT_PRO2 0x4c51 /* 3D Rage LT Pro */ -#define ATI_RAGE_MOB_M1_PCI 0x4c52 /* Rage Mobility M1 (PCI) */ -#define ATI_RAGE_L_MOB_M1_PCI 0x4c53 /* Rage L Mobility (PCI) */ -#define ATI_MACH64_VT 0x5654 /* Mach64 VT */ -#define ATI_MACH64_VTB 0x5655 /* Mach64 VTB */ -#define ATI_MACH64_VT4 0x5656 /* Mach64 VT4 */ - -#endif /* !_DEV_FB_MACHFB_H_ */ diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 9daa9f001661..38e44193cf58 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -134,11 +134,7 @@ SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, tags, CTLFLAG_RWTUN, &sbp_tags, 0, #define NEED_RESPONSE 0 #define SBP_SEG_MAX rounddown(0xffff, PAGE_SIZE) -#ifdef __sparc64__ /* iommu */ -#define SBP_IND_MAX howmany(SBP_MAXPHYS, SBP_SEG_MAX) -#else #define SBP_IND_MAX howmany(SBP_MAXPHYS, PAGE_SIZE) -#endif struct sbp_ocb { STAILQ_ENTRY(sbp_ocb) ocb; union ccb *ccb; diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c index ce3027fb3441..1b20d9352a71 100644 --- a/sys/dev/gem/if_gem_pci.c +++ b/sys/dev/gem/if_gem_pci.c @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include <net/if.h> #include <machine/bus.h> -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include <dev/ofw/ofw_bus.h> #include <dev/ofw/openfirm.h> #include <machine/ofw_machdep.h> @@ -149,7 +149,7 @@ gem_pci_attach(device_t dev) { struct gem_softc *sc; int i; -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) char buf[sizeof(GEM_SHARED_PINS)]; #else int j; @@ -215,7 +215,7 @@ gem_pci_attach(device_t dev) GEM_PCI_BIF_CNF_M66EN) != 0) sc->sc_flags |= GEM_PCI66; -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); if (OF_getprop(ofw_bus_get_node(dev), GEM_SHARED_PINS, buf, sizeof(buf)) > 0) { diff --git a/sys/dev/gem/if_gem_sbus.c b/sys/dev/gem/if_gem_sbus.c deleted file mode 100644 index 59f79e216781..000000000000 --- a/sys/dev/gem/if_gem_sbus.c +++ /dev/null @@ -1,210 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD - * - * Copyright (C) 2001 Eduardo Horvath. - * Copyright (c) 2007 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - * - * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * SBus bindings for Sun GEM Ethernet controllers - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/rman.h> -#include <sys/socket.h> - -#include <net/ethernet.h> -#include <net/if.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <sparc64/sbus/sbusvar.h> - -#include <dev/gem/if_gemreg.h> -#include <dev/gem/if_gemvar.h> - -#include "miibus_if.h" - -static device_probe_t gem_sbus_probe; -static device_attach_t gem_sbus_attach; -static device_detach_t gem_sbus_detach; -static device_suspend_t gem_sbus_suspend; -static device_resume_t gem_sbus_resume; - -static device_method_t gem_sbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, gem_sbus_probe), - DEVMETHOD(device_attach, gem_sbus_attach), - DEVMETHOD(device_detach, gem_sbus_detach), - DEVMETHOD(device_suspend, gem_sbus_suspend), - DEVMETHOD(device_resume, gem_sbus_resume), - /* Use the suspend handler here, it is all that is required. */ - DEVMETHOD(device_shutdown, gem_sbus_suspend), - - /* MII interface */ - DEVMETHOD(miibus_readreg, gem_mii_readreg), - DEVMETHOD(miibus_writereg, gem_mii_writereg), - DEVMETHOD(miibus_statchg, gem_mii_statchg), - - DEVMETHOD_END -}; - -static driver_t gem_sbus_driver = { - "gem", - gem_sbus_methods, - sizeof(struct gem_softc) -}; - -DRIVER_MODULE(gem, sbus, gem_sbus_driver, gem_devclass, 0, 0); -MODULE_DEPEND(gem, sbus, 1, 1, 1); -MODULE_DEPEND(gem, ether, 1, 1, 1); - -static int -gem_sbus_probe(device_t dev) -{ - - if (strcmp(ofw_bus_get_name(dev), "network") == 0 && - ofw_bus_get_compat(dev) != NULL && - strcmp(ofw_bus_get_compat(dev), "SUNW,sbus-gem") == 0) { - device_set_desc(dev, "Sun GEM Gigabit Ethernet"); - return (0); - } - - return (ENXIO); -} - -static struct resource_spec gem_sbus_res_spec[] = { - { SYS_RES_IRQ, 0, RF_SHAREABLE | RF_ACTIVE }, /* GEM_RES_INTR */ - { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* GEM_RES_BANK1 */ - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* GEM_RES_BANK2 */ - { -1, 0 } -}; - -static int -gem_sbus_attach(device_t dev) -{ - struct gem_softc *sc; - int burst; - uint32_t val; - - sc = device_get_softc(dev); - sc->sc_variant = GEM_SUN_GEM; - sc->sc_dev = dev; - /* All known SBus models use a SERDES. */ - sc->sc_flags = GEM_SERDES; - - if (bus_alloc_resources(dev, gem_sbus_res_spec, sc->sc_res)) { - device_printf(dev, "failed to allocate resources\n"); - bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); - return (ENXIO); - } - - GEM_LOCK_INIT(sc, device_get_nameunit(dev)); - - OF_getetheraddr(dev, sc->sc_enaddr); - - burst = sbus_get_burstsz(dev); - val = GEM_SBUS_CFG_PARITY; - if ((burst & SBUS_BURST64_MASK) != 0) { - val |= GEM_SBUS_CFG_64BIT; - burst >>= SBUS_BURST64_SHIFT; - } - if ((burst & SBUS_BURST_64) != 0) - val |= GEM_SBUS_CFG_BURST_64; - else if ((burst & SBUS_BURST_32) != 0) - val |= GEM_SBUS_CFG_BURST_32; - else { - device_printf(dev, "unsupported burst size\n"); - goto fail; - } - /* Reset the SBus interface only. */ - (void)GEM_BANK2_READ_4(sc, GEM_SBUS_BIF_RESET); - DELAY(100); - GEM_BANK2_WRITE_4(sc, GEM_SBUS_CONFIG, val); - - if (gem_attach(sc) != 0) { - device_printf(dev, "could not be attached\n"); - goto fail; - } - - if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET | - INTR_MPSAFE, NULL, gem_intr, sc, &sc->sc_ih) != 0) { - device_printf(dev, "failed to set up interrupt\n"); - gem_detach(sc); - goto fail; - } - return (0); - - fail: - GEM_LOCK_DESTROY(sc); - bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); - return (ENXIO); -} - -static int -gem_sbus_detach(device_t dev) -{ - struct gem_softc *sc; - - sc = device_get_softc(dev); - bus_teardown_intr(dev, sc->sc_res[GEM_RES_INTR], sc->sc_ih); - gem_detach(sc); - GEM_LOCK_DESTROY(sc); - bus_release_resources(dev, gem_sbus_res_spec, sc->sc_res); - return (0); -} - -static int -gem_sbus_suspend(device_t dev) -{ - - gem_suspend(device_get_softc(dev)); - return (0); -} - -static int -gem_sbus_resume(device_t dev) -{ - - gem_resume(device_get_softc(dev)); - return (0); -} diff --git a/sys/dev/hme/if_hme_pci.c b/sys/dev/hme/if_hme_pci.c index a7ba6f24fdbc..35cf3f7f90de 100644 --- a/sys/dev/hme/if_hme_pci.c +++ b/sys/dev/hme/if_hme_pci.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <machine/bus.h> -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) #include <dev/ofw/openfirm.h> #include <machine/ofw_machdep.h> #endif @@ -140,7 +140,7 @@ hme_pci_attach(device_t dev) bus_space_tag_t memt; bus_space_handle_t memh; int i, error = 0; -#if !(defined(__powerpc__) || defined(__sparc64__)) +#if !defined(__powerpc__) device_t *children, ebus_dev; struct resource *ebus_rres; int j, slot; @@ -197,7 +197,7 @@ hme_pci_attach(device_t dev) bus_space_subregion(memt, memh, 0x6000, 0x1000, &sc->sc_mach); bus_space_subregion(memt, memh, 0x7000, 0x1000, &sc->sc_mifh); -#if defined(__powerpc__) || defined(__sparc64__) +#if defined(__powerpc__) OF_getetheraddr(dev, sc->sc_enaddr); #else /* diff --git a/sys/dev/hme/if_hme_sbus.c b/sys/dev/hme/if_hme_sbus.c deleted file mode 100644 index 0ea789adac71..000000000000 --- a/sys/dev/hme/if_hme_sbus.c +++ /dev/null @@ -1,338 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Paul Kranenburg. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - * - * from: NetBSD: if_hme_sbus.c,v 1.19 2004/03/17 17:04:58 pk Exp - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * SBus front-end device driver for the HME ethernet device. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/lock.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/socket.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <sys/rman.h> - -#include <net/if.h> -#include <net/if_media.h> -#include <net/ethernet.h> - -#include <dev/mii/mii.h> -#include <dev/mii/miivar.h> - -#include <sparc64/sbus/sbusvar.h> - -#include <dev/hme/if_hmereg.h> -#include <dev/hme/if_hmevar.h> - -#include "miibus_if.h" - -struct hme_sbus_softc { - struct hme_softc hsc_hme; /* HME device */ - struct resource *hsc_seb_res; - struct resource *hsc_etx_res; - struct resource *hsc_erx_res; - struct resource *hsc_mac_res; - struct resource *hsc_mif_res; - struct resource *hsc_ires; - void *hsc_ih; -}; - -static int hme_sbus_probe(device_t); -static int hme_sbus_attach(device_t); -static int hme_sbus_detach(device_t); -static int hme_sbus_suspend(device_t); -static int hme_sbus_resume(device_t); - -static device_method_t hme_sbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, hme_sbus_probe), - DEVMETHOD(device_attach, hme_sbus_attach), - DEVMETHOD(device_detach, hme_sbus_detach), - DEVMETHOD(device_suspend, hme_sbus_suspend), - DEVMETHOD(device_resume, hme_sbus_resume), - /* Can just use the suspend method here. */ - DEVMETHOD(device_shutdown, hme_sbus_suspend), - - /* MII interface */ - DEVMETHOD(miibus_readreg, hme_mii_readreg), - DEVMETHOD(miibus_writereg, hme_mii_writereg), - DEVMETHOD(miibus_statchg, hme_mii_statchg), - - DEVMETHOD_END -}; - -static driver_t hme_sbus_driver = { - "hme", - hme_sbus_methods, - sizeof(struct hme_sbus_softc) -}; - -DRIVER_MODULE(hme, sbus, hme_sbus_driver, hme_devclass, 0, 0); -MODULE_DEPEND(hme, sbus, 1, 1, 1); -MODULE_DEPEND(hme, ether, 1, 1, 1); - -static int -hme_sbus_probe(device_t dev) -{ - const char *name; - - name = ofw_bus_get_name(dev); - if (strcmp(name, "SUNW,qfe") == 0 || - strcmp(name, "SUNW,hme") == 0) { - device_set_desc(dev, "Sun HME 10/100 Ethernet"); - return (0); - } - return (ENXIO); -} - -static int -hme_sbus_attach(device_t dev) -{ - struct hme_sbus_softc *hsc; - struct hme_softc *sc; - u_long start, count; - uint32_t burst; - int i, error = 0; - - hsc = device_get_softc(dev); - sc = &hsc->hsc_hme; - mtx_init(&sc->sc_lock, device_get_nameunit(dev), MTX_NETWORK_LOCK, - MTX_DEF); - /* - * Map five register banks: - * - * bank 0: HME SEB registers - * bank 1: HME ETX registers - * bank 2: HME ERX registers - * bank 3: HME MAC registers - * bank 4: HME MIF registers - * - */ - i = 0; - hsc->hsc_seb_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (hsc->hsc_seb_res == NULL) { - device_printf(dev, "cannot map SEB registers\n"); - error = ENXIO; - goto fail_mtx_res; - } - sc->sc_sebt = rman_get_bustag(hsc->hsc_seb_res); - sc->sc_sebh = rman_get_bushandle(hsc->hsc_seb_res); - - i = 1; - hsc->hsc_etx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (hsc->hsc_etx_res == NULL) { - device_printf(dev, "cannot map ETX registers\n"); - error = ENXIO; - goto fail_seb_res; - } - sc->sc_etxt = rman_get_bustag(hsc->hsc_etx_res); - sc->sc_etxh = rman_get_bushandle(hsc->hsc_etx_res); - - i = 2; - hsc->hsc_erx_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (hsc->hsc_erx_res == NULL) { - device_printf(dev, "cannot map ERX registers\n"); - error = ENXIO; - goto fail_etx_res; - } - sc->sc_erxt = rman_get_bustag(hsc->hsc_erx_res); - sc->sc_erxh = rman_get_bushandle(hsc->hsc_erx_res); - - i = 3; - hsc->hsc_mac_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (hsc->hsc_mac_res == NULL) { - device_printf(dev, "cannot map MAC registers\n"); - error = ENXIO; - goto fail_erx_res; - } - sc->sc_mact = rman_get_bustag(hsc->hsc_mac_res); - sc->sc_mach = rman_get_bushandle(hsc->hsc_mac_res); - - /* - * At least on some HMEs, the MIF registers seem to be inside the MAC - * range, so try to kludge around it. - */ - i = 4; - hsc->hsc_mif_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (hsc->hsc_mif_res == NULL) { - if (bus_get_resource(dev, SYS_RES_MEMORY, i, - &start, &count) != 0) { - device_printf(dev, "cannot get MIF registers\n"); - error = ENXIO; - goto fail_mac_res; - } - if (start < rman_get_start(hsc->hsc_mac_res) || - start + count - 1 > rman_get_end(hsc->hsc_mac_res)) { - device_printf(dev, "cannot move MIF registers to MAC " - "bank\n"); - error = ENXIO; - goto fail_mac_res; - } - sc->sc_mift = sc->sc_mact; - bus_space_subregion(sc->sc_mact, sc->sc_mach, - start - rman_get_start(hsc->hsc_mac_res), count, - &sc->sc_mifh); - } else { - sc->sc_mift = rman_get_bustag(hsc->hsc_mif_res); - sc->sc_mifh = rman_get_bushandle(hsc->hsc_mif_res); - } - - i = 0; - hsc->hsc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &i, RF_SHAREABLE | RF_ACTIVE); - if (hsc->hsc_ires == NULL) { - device_printf(dev, "could not allocate interrupt\n"); - error = ENXIO; - goto fail_mif_res; - } - - OF_getetheraddr(dev, sc->sc_enaddr); - - burst = sbus_get_burstsz(dev); - /* Translate into plain numerical format */ - if ((burst & SBUS_BURST_64)) - sc->sc_burst = 64; - else if ((burst & SBUS_BURST_32)) - sc->sc_burst = 32; - else if ((burst & SBUS_BURST_16)) - sc->sc_burst = 16; - else - sc->sc_burst = 0; - - sc->sc_dev = dev; - sc->sc_flags = 0; - - if ((error = hme_config(sc)) != 0) { - device_printf(dev, "could not be configured\n"); - goto fail_ires; - } - - if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET | - INTR_MPSAFE, NULL, hme_intr, sc, &hsc->hsc_ih)) != 0) { - device_printf(dev, "couldn't establish interrupt\n"); - hme_detach(sc); - goto fail_ires; - } - return (0); - -fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(hsc->hsc_ires), hsc->hsc_ires); -fail_mif_res: - if (hsc->hsc_mif_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_mif_res), hsc->hsc_mif_res); - } -fail_mac_res: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_mac_res), hsc->hsc_mac_res); -fail_erx_res: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_erx_res), hsc->hsc_erx_res); -fail_etx_res: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_etx_res), hsc->hsc_etx_res); -fail_seb_res: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_seb_res), hsc->hsc_seb_res); -fail_mtx_res: - mtx_destroy(&sc->sc_lock); - return (error); -} - -static int -hme_sbus_detach(device_t dev) -{ - struct hme_sbus_softc *hsc; - struct hme_softc *sc; - - hsc = device_get_softc(dev); - sc = &hsc->hsc_hme; - bus_teardown_intr(dev, hsc->hsc_ires, hsc->hsc_ih); - hme_detach(sc); - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(hsc->hsc_ires), hsc->hsc_ires); - if (hsc->hsc_mif_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_mif_res), hsc->hsc_mif_res); - } - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_mac_res), hsc->hsc_mac_res); - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_erx_res), hsc->hsc_erx_res); - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_etx_res), hsc->hsc_etx_res); - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(hsc->hsc_seb_res), hsc->hsc_seb_res); - mtx_destroy(&sc->sc_lock); - return (0); -} - -static int -hme_sbus_suspend(device_t dev) -{ - struct hme_sbus_softc *hsc; - - hsc = device_get_softc(dev); - hme_suspend(&hsc->hsc_hme); - return (0); -} - -static int -hme_sbus_resume(device_t dev) -{ - struct hme_sbus_softc *hsc; - - hsc = device_get_softc(dev); - hme_resume(&hsc->hsc_hme); - return (0); -} diff --git a/sys/dev/hwpmc/hwpmc_sparc64.c b/sys/dev/hwpmc/hwpmc_sparc64.c deleted file mode 100644 index 3ded908e2529..000000000000 --- a/sys/dev/hwpmc/hwpmc_sparc64.c +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2005, Joseph Koshy - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/pmc.h> - -#include <machine/pmc_mdep.h> - -struct pmc_mdep * -pmc_md_initialize() -{ - return NULL; -} - -void -pmc_md_finalize(struct pmc_mdep *md) -{ - (void) md; -} - -int -pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples, - struct trapframe *tf) -{ - (void) cc; - (void) maxsamples; - (void) tf; - return (0); -} - -int -pmc_save_user_callchain(uintptr_t *cc, int maxsamples, - struct trapframe *tf) -{ - (void) cc; - (void) maxsamples; - (void) tf; - return (0); -} diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 6bd2a71b5f0f..971fc0b05d84 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -71,11 +71,7 @@ /* * Efficiency- get rid of SBus code && tests unless we need them. */ -#ifdef __sparc64__ -#define ISP_SBUS_SUPPORTED 1 -#else #define ISP_SBUS_SUPPORTED 0 -#endif #define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index 42415f5091b2..6cd7fa7ebd0a 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -48,12 +48,6 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/malloc.h> #include <sys/uio.h> - -#ifdef __sparc64__ -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> -#endif - #include <dev/isp/isp_freebsd.h> static uint32_t isp_pci_rd_reg(ispsoftc_t *, int); @@ -493,11 +487,7 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) if (IS_FC(isp)) { ISP_FC_PC(isp, chan)->default_id = 109 - chan; } else { -#ifdef __sparc64__ - ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev); -#else ISP_SPI_PC(isp, chan)->iid = 7; -#endif } } else { if (IS_FC(isp)) { diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c deleted file mode 100644 index 35e3e220b276..000000000000 --- a/sys/dev/isp/isp_sbus.c +++ /dev/null @@ -1,701 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1997-2006 by Matthew Jacob - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. - * 2. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ -/* - * SBus specific probe and attach routines for Qlogic ISP SCSI adapters. - * FreeBSD Version. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/linker.h> -#include <sys/firmware.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/resource.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> -#include <sys/rman.h> -#include <sparc64/sbus/sbusvar.h> - -#include <dev/isp/isp_freebsd.h> - -static uint32_t isp_sbus_rd_reg(ispsoftc_t *, int); -static void isp_sbus_wr_reg(ispsoftc_t *, int, uint32_t); -static void isp_sbus_run_isr(ispsoftc_t *); -static int isp_sbus_mbxdma(ispsoftc_t *); -static void isp_sbus_mbxdmafree(ispsoftc_t *); -static int isp_sbus_dmasetup(ispsoftc_t *, XS_T *, void *); -static void isp_sbus_dumpregs(ispsoftc_t *, const char *); - -static struct ispmdvec mdvec = { - isp_sbus_run_isr, - isp_sbus_rd_reg, - isp_sbus_wr_reg, - isp_sbus_mbxdma, - isp_sbus_dmasetup, - isp_common_dmateardown, - NULL, - isp_sbus_dumpregs, - NULL, - BIU_BURST_ENABLE|BIU_PCI_CONF1_FIFO_64 -}; - -static int isp_sbus_probe (device_t); -static int isp_sbus_attach (device_t); -static int isp_sbus_detach (device_t); - - -#define ISP_SBD(isp) ((struct isp_sbussoftc *)isp)->sbus_dev -struct isp_sbussoftc { - ispsoftc_t sbus_isp; - device_t sbus_dev; - struct resource * regs; - void * irq; - int iqd; - int rgd; - void * ih; - int16_t sbus_poff[_NREG_BLKS]; - sdparam sbus_param; - struct isp_spi sbus_spi; - struct ispmdvec sbus_mdvec; -}; - - -static device_method_t isp_sbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, isp_sbus_probe), - DEVMETHOD(device_attach, isp_sbus_attach), - DEVMETHOD(device_detach, isp_sbus_detach), - { 0, 0 } -}; - -static driver_t isp_sbus_driver = { - "isp", isp_sbus_methods, sizeof (struct isp_sbussoftc) -}; -static devclass_t isp_devclass; -DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); -MODULE_DEPEND(isp, cam, 1, 1, 1); -MODULE_DEPEND(isp, firmware, 1, 1, 1); - -static int -isp_sbus_probe(device_t dev) -{ - int found = 0; - const char *name = ofw_bus_get_name(dev); - if (strcmp(name, "SUNW,isp") == 0 || - strcmp(name, "QLGC,isp") == 0 || - strcmp(name, "ptisp") == 0 || - strcmp(name, "PTI,ptisp") == 0) { - found++; - } - if (!found) - return (ENXIO); - - if (isp_announced == 0 && bootverbose) { - printf("Qlogic ISP Driver, FreeBSD Version %d.%d, " - "Core Version %d.%d\n", - ISP_PLATFORM_VERSION_MAJOR, ISP_PLATFORM_VERSION_MINOR, - ISP_CORE_VERSION_MAJOR, ISP_CORE_VERSION_MINOR); - isp_announced++; - } - return (0); -} - -static int -isp_sbus_attach(device_t dev) -{ - struct isp_sbussoftc *sbs = device_get_softc(dev); - ispsoftc_t *isp = &sbs->sbus_isp; - int tval, isp_debug, role, ispburst, default_id; - - sbs->sbus_dev = dev; - sbs->sbus_mdvec = mdvec; - isp->isp_dev = dev; - mtx_init(&isp->isp_lock, "isp", NULL, MTX_DEF); - - role = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), - "role", &role) == 0 && - ((role & ~(ISP_ROLE_INITIATOR|ISP_ROLE_TARGET)) == 0)) { - device_printf(dev, "setting role to 0x%x\n", role); - } else { - role = ISP_DEFAULT_ROLES; - } - - sbs->irq = sbs->regs = NULL; - sbs->rgd = sbs->iqd = 0; - - sbs->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sbs->rgd, - RF_ACTIVE); - if (sbs->regs == NULL) { - device_printf(dev, "unable to map registers\n"); - goto bad; - } - - sbs->sbus_poff[BIU_BLOCK >> _BLK_REG_SHFT] = BIU_REGS_OFF; - sbs->sbus_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = SBUS_MBOX_REGS_OFF; - sbs->sbus_poff[SXP_BLOCK >> _BLK_REG_SHFT] = SBUS_SXP_REGS_OFF; - sbs->sbus_poff[RISC_BLOCK >> _BLK_REG_SHFT] = SBUS_RISC_REGS_OFF; - sbs->sbus_poff[DMA_BLOCK >> _BLK_REG_SHFT] = DMA_REGS_OFF; - isp->isp_regs = sbs->regs; - isp->isp_mdvec = &sbs->sbus_mdvec; - isp->isp_bustype = ISP_BT_SBUS; - isp->isp_type = ISP_HA_SCSI_UNKNOWN; - isp->isp_param = &sbs->sbus_param; - isp->isp_osinfo.pc.ptr = &sbs->sbus_spi; - isp->isp_revision = 0; /* XXX */ - isp->isp_nchan = 1; - if (IS_FC(isp)) - ISP_FC_PC(isp, 0)->def_role = role; - - /* - * Get the clock frequency and convert it from HZ to MHz, - * rounding up. This defaults to 25MHz if there isn't a - * device specific one in the OFW device tree. - */ - sbs->sbus_mdvec.dv_clock = (sbus_get_clockfreq(dev) + 500000)/1000000; - - /* - * Now figure out what the proper burst sizes, etc., to use. - * Unfortunately, there is no ddi_dma_burstsizes here which - * walks up the tree finding the limiting burst size node (if - * any). We just use what's here for isp. - */ - ispburst = sbus_get_burstsz(dev); - if (ispburst == 0) { - ispburst = SBUS_BURST_32 - 1; - } - sbs->sbus_mdvec.dv_conf1 = 0; - if (ispburst & (1 << 5)) { - sbs->sbus_mdvec.dv_conf1 = BIU_SBUS_CONF1_FIFO_32; - } else if (ispburst & (1 << 4)) { - sbs->sbus_mdvec.dv_conf1 = BIU_SBUS_CONF1_FIFO_16; - } else if (ispburst & (1 << 3)) { - sbs->sbus_mdvec.dv_conf1 = - BIU_SBUS_CONF1_BURST8 | BIU_SBUS_CONF1_FIFO_8; - } - if (sbs->sbus_mdvec.dv_conf1) { - sbs->sbus_mdvec.dv_conf1 |= BIU_BURST_ENABLE; - } - - /* - * We don't trust NVRAM on SBus cards - */ - isp->isp_confopts |= ISP_CFG_NONVRAM; - - /* - * Mark things if we're a PTI SBus adapter. - */ - if (strcmp("PTI,ptisp", ofw_bus_get_name(dev)) == 0 || - strcmp("ptisp", ofw_bus_get_name(dev)) == 0) { - SDPARAM(isp, 0)->isp_ptisp = 1; - } - - isp->isp_osinfo.fw = firmware_get("isp_1000"); - if (isp->isp_osinfo.fw) { - union { - const void *cp; - uint16_t *sp; - } stupid; - stupid.cp = isp->isp_osinfo.fw->data; - isp->isp_mdvec->dv_ispfw = stupid.sp; - } - - tval = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), - "fwload_disable", &tval) == 0 && tval != 0) { - isp->isp_confopts |= ISP_CFG_NORELOAD; - } - - default_id = -1; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), - "iid", &tval) == 0) { - default_id = tval; - isp->isp_confopts |= ISP_CFG_OWNLOOPID; - } - if (default_id == -1) { - default_id = OF_getscsinitid(dev); - } - ISP_SPI_PC(isp, 0)->iid = default_id; - - isp_debug = 0; - (void) resource_int_value(device_get_name(dev), device_get_unit(dev), - "debug", &isp_debug); - - sbs->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sbs->iqd, - RF_ACTIVE | RF_SHAREABLE); - if (sbs->irq == NULL) { - device_printf(dev, "could not allocate interrupt\n"); - goto bad; - } - - if (bus_setup_intr(dev, sbs->irq, ISP_IFLAGS, NULL, isp_platform_intr, - isp, &sbs->ih)) { - device_printf(dev, "could not setup interrupt\n"); - (void) bus_release_resource(dev, SYS_RES_IRQ, - sbs->iqd, sbs->irq); - goto bad; - } - isp->isp_nirq = 1; - - /* - * Set up logging levels. - */ - if (isp_debug) { - isp->isp_dblev = isp_debug; - } else { - isp->isp_dblev = ISP_LOGWARN|ISP_LOGERR; - } - if (bootverbose) { - isp->isp_dblev |= ISP_LOGCONFIG|ISP_LOGINFO; - } - - /* - * Make sure we're in reset state. - */ - ISP_LOCK(isp); - if (isp_reinit(isp, 1) != 0) { - ISP_UNLOCK(isp); - goto bad; - } - ISP_UNLOCK(isp); - if (isp_attach(isp)) { - ISP_LOCK(isp); - isp_shutdown(isp); - ISP_UNLOCK(isp); - goto bad; - } - return (0); - -bad: - if (isp->isp_nirq > 0) { - (void) bus_teardown_intr(dev, sbs->irq, sbs->ih); - (void) bus_release_resource(dev, SYS_RES_IRQ, sbs->iqd, - sbs->irq); - } - - if (sbs->regs) { - (void) bus_release_resource(dev, SYS_RES_MEMORY, sbs->rgd, - sbs->regs); - } - mtx_destroy(&isp->isp_lock); - return (ENXIO); -} - -static int -isp_sbus_detach(device_t dev) -{ - struct isp_sbussoftc *sbs = device_get_softc(dev); - ispsoftc_t *isp = &sbs->sbus_isp; - int status; - - status = isp_detach(isp); - if (status) - return (status); - ISP_LOCK(isp); - isp_shutdown(isp); - ISP_UNLOCK(isp); - if (isp->isp_nirq > 0) { - (void) bus_teardown_intr(dev, sbs->irq, sbs->ih); - (void) bus_release_resource(dev, SYS_RES_IRQ, sbs->iqd, - sbs->irq); - } - (void) bus_release_resource(dev, SYS_RES_MEMORY, sbs->rgd, sbs->regs); - isp_sbus_mbxdmafree(isp); - mtx_destroy(&isp->isp_lock); - return (0); -} - -#define IspVirt2Off(a, x) \ - (((struct isp_sbussoftc *)a)->sbus_poff[((x) & _BLK_REG_MASK) >> \ - _BLK_REG_SHFT] + ((x) & 0xff)) - -#define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off)) - -static void -isp_sbus_run_isr(ispsoftc_t *isp) -{ - uint16_t isr, sema, info; - - isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); - sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); - isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); - isr &= INT_PENDING_MASK(isp); - sema &= BIU_SEMA_LOCK; - if (isr == 0 && sema == 0) - return; - if (sema != 0) { - info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); - if (info & MBOX_COMMAND_COMPLETE) - isp_intr_mbox(isp, info); - else - isp_intr_async(isp, info); - if (isp->isp_state == ISP_RUNSTATE) - isp_intr_respq(isp); - } else - isp_intr_respq(isp); - ISP_WRITE(isp, HCCR, HCCR_CMD_CLEAR_RISC_INT); - if (sema) - ISP_WRITE(isp, BIU_SEMA, 0); -} - -static uint32_t -isp_sbus_rd_reg(ispsoftc_t *isp, int regoff) -{ - uint16_t rval; - struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; - int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT]; - offset += (regoff & 0xff); - rval = BXR2(isp, offset); - isp_prt(isp, ISP_LOGDEBUG3, - "isp_sbus_rd_reg(off %x) = %x", regoff, rval); - return (rval); -} - -static void -isp_sbus_wr_reg(ispsoftc_t *isp, int regoff, uint32_t val) -{ - struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; - int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT]; - offset += (regoff & 0xff); - isp_prt(isp, ISP_LOGDEBUG3, - "isp_sbus_wr_reg(off %x) = %x", regoff, val); - bus_write_2(isp->isp_regs, offset, val); - MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1); -} - -struct imush { - bus_addr_t maddr; - int error; -}; - -static void imc(void *, bus_dma_segment_t *, int, int); - -static void -imc(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct imush *imushp = (struct imush *) arg; - - if (!(imushp->error = error)) - imushp->maddr = segs[0].ds_addr; -} - -static int -isp_sbus_mbxdma(ispsoftc_t *isp) -{ - caddr_t base; - uint32_t len; - int i, error; - struct imush im; - - /* Already been here? If so, leave... */ - if (isp->isp_xflist != NULL) - return (0); - if (isp->isp_rquest != NULL && isp->isp_maxcmds == 0) - return (0); - ISP_UNLOCK(isp); - if (isp->isp_rquest != NULL) - goto gotmaxcmds; - - if (bus_dma_tag_create(bus_get_dma_tag(ISP_SBD(isp)), 1, - BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR_32BIT, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, - ISP_NSEG_MAX, BUS_SPACE_MAXADDR_24BIT, 0, - busdma_lock_mutex, &isp->isp_lock, &isp->isp_osinfo.dmat)) { - isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); - goto bad; - } - - /* - * Allocate and map the request queue. - */ - len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); - if (bus_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, BUS_SPACE_MAXADDR_24BIT+1, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - len, 1, len, 0, busdma_lock_mutex, &isp->isp_lock, - &isp->isp_osinfo.reqdmat)) { - isp_prt(isp, ISP_LOGERR, "cannot create request DMA tag"); - goto bad; - } - if (bus_dmamem_alloc(isp->isp_osinfo.reqdmat, (void **)&base, - BUS_DMA_COHERENT, &isp->isp_osinfo.reqmap) != 0) { - isp_prt(isp, ISP_LOGERR, "cannot allocate request DMA memory"); - bus_dma_tag_destroy(isp->isp_osinfo.reqdmat); - goto bad; - } - isp->isp_rquest = base; - im.error = 0; - if (bus_dmamap_load(isp->isp_osinfo.reqdmat, isp->isp_osinfo.reqmap, - base, len, imc, &im, 0) || im.error) { - isp_prt(isp, ISP_LOGERR, "error loading request DMA map %d", im.error); - goto bad; - } - isp_prt(isp, ISP_LOGDEBUG0, "request area @ 0x%jx/0x%jx", - (uintmax_t)im.maddr, (uintmax_t)len); - isp->isp_rquest_dma = im.maddr; - - /* - * Allocate and map the result queue. - */ - len = ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); - if (bus_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, BUS_SPACE_MAXADDR_24BIT+1, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - len, 1, len, 0, busdma_lock_mutex, &isp->isp_lock, - &isp->isp_osinfo.respdmat)) { - isp_prt(isp, ISP_LOGERR, "cannot create response DMA tag"); - goto bad; - } - if (bus_dmamem_alloc(isp->isp_osinfo.respdmat, (void **)&base, - BUS_DMA_COHERENT, &isp->isp_osinfo.respmap) != 0) { - isp_prt(isp, ISP_LOGERR, "cannot allocate response DMA memory"); - bus_dma_tag_destroy(isp->isp_osinfo.respdmat); - goto bad; - } - isp->isp_result = base; - im.error = 0; - if (bus_dmamap_load(isp->isp_osinfo.respdmat, isp->isp_osinfo.respmap, - base, len, imc, &im, 0) || im.error) { - isp_prt(isp, ISP_LOGERR, "error loading response DMA map %d", im.error); - goto bad; - } - isp_prt(isp, ISP_LOGDEBUG0, "response area @ 0x%jx/0x%jx", - (uintmax_t)im.maddr, (uintmax_t)len); - isp->isp_result_dma = im.maddr; - - if (isp->isp_maxcmds == 0) { - ISP_LOCK(isp); - return (0); - } - -gotmaxcmds: - len = sizeof (struct isp_pcmd) * isp->isp_maxcmds; - isp->isp_osinfo.pcmd_pool = (struct isp_pcmd *) - malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - for (i = 0; i < isp->isp_maxcmds; i++) { - struct isp_pcmd *pcmd = &isp->isp_osinfo.pcmd_pool[i]; - error = bus_dmamap_create(isp->isp_osinfo.dmat, 0, &pcmd->dmap); - if (error) { - isp_prt(isp, ISP_LOGERR, - "error %d creating per-cmd DMA maps", error); - while (--i >= 0) { - bus_dmamap_destroy(isp->isp_osinfo.dmat, - isp->isp_osinfo.pcmd_pool[i].dmap); - } - goto bad; - } - callout_init_mtx(&pcmd->wdog, &isp->isp_lock, 0); - if (i == isp->isp_maxcmds-1) { - pcmd->next = NULL; - } else { - pcmd->next = &isp->isp_osinfo.pcmd_pool[i+1]; - } - } - isp->isp_osinfo.pcmd_free = &isp->isp_osinfo.pcmd_pool[0]; - - len = sizeof (isp_hdl_t *) * isp->isp_maxcmds; - isp->isp_xflist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < isp->isp_maxcmds - 1; len++) - isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; - isp->isp_xffree = isp->isp_xflist; - - ISP_LOCK(isp); - return (0); - -bad: - isp_sbus_mbxdmafree(isp); - ISP_LOCK(isp); - return (1); -} - -static void -isp_sbus_mbxdmafree(ispsoftc_t *isp) -{ - int i; - - if (isp->isp_xflist != NULL) { - free(isp->isp_xflist, M_DEVBUF); - isp->isp_xflist = NULL; - } - if (isp->isp_osinfo.pcmd_pool != NULL) { - for (i = 0; i < isp->isp_maxcmds; i++) { - bus_dmamap_destroy(isp->isp_osinfo.dmat, - isp->isp_osinfo.pcmd_pool[i].dmap); - } - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); - isp->isp_osinfo.pcmd_pool = NULL; - } - if (isp->isp_result_dma != 0) { - bus_dmamap_unload(isp->isp_osinfo.respdmat, - isp->isp_osinfo.respmap); - isp->isp_result_dma = 0; - } - if (isp->isp_result != NULL) { - bus_dmamem_free(isp->isp_osinfo.respdmat, isp->isp_result, - isp->isp_osinfo.respmap); - bus_dma_tag_destroy(isp->isp_osinfo.respdmat); - isp->isp_result = NULL; - } - if (isp->isp_rquest_dma != 0) { - bus_dmamap_unload(isp->isp_osinfo.reqdmat, - isp->isp_osinfo.reqmap); - isp->isp_rquest_dma = 0; - } - if (isp->isp_rquest != NULL) { - bus_dmamem_free(isp->isp_osinfo.reqdmat, isp->isp_rquest, - isp->isp_osinfo.reqmap); - bus_dma_tag_destroy(isp->isp_osinfo.reqdmat); - isp->isp_rquest = NULL; - } -} - -typedef struct { - ispsoftc_t *isp; - void *cmd_token; - void *rq; /* original request */ - int error; -} mush_t; - -#define MUSHERR_NOQENTRIES -2 - -static void -dma2(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) -{ - mush_t *mp = (mush_t *) arg; - ispsoftc_t *isp = mp->isp; - struct ccb_scsiio *csio = mp->cmd_token; - isp_ddir_t ddir; - int sdir; - - if (error) { - mp->error = error; - return; - } - if (nseg == 0) { - ddir = ISP_NOXFR; - } else { - if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - ddir = ISP_FROM_DEVICE; - } else { - ddir = ISP_TO_DEVICE; - } - if ((csio->ccb_h.func_code == XPT_CONT_TARGET_IO) ^ - ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)) { - sdir = BUS_DMASYNC_PREREAD; - } else { - sdir = BUS_DMASYNC_PREWRITE; - } - bus_dmamap_sync(isp->isp_osinfo.dmat, PISP_PCMD(csio)->dmap, - sdir); - } - - if (isp_send_cmd(isp, mp->rq, dm_segs, nseg, XS_XFRLEN(csio), - ddir, NULL) != CMD_QUEUED) { - mp->error = MUSHERR_NOQENTRIES; - } -} - -static int -isp_sbus_dmasetup(ispsoftc_t *isp, struct ccb_scsiio *csio, void *ff) -{ - mush_t mush, *mp; - int error; - - mp = &mush; - mp->isp = isp; - mp->cmd_token = csio; - mp->rq = ff; - mp->error = 0; - - error = bus_dmamap_load_ccb(isp->isp_osinfo.dmat, - PISP_PCMD(csio)->dmap, (union ccb *)csio, dma2, mp, 0); - if (error == EINPROGRESS) { - bus_dmamap_unload(isp->isp_osinfo.dmat, PISP_PCMD(csio)->dmap); - mp->error = EINVAL; - isp_prt(isp, ISP_LOGERR, - "deferred dma allocation not supported"); - } else if (error && mp->error == 0) { -#ifdef DIAGNOSTIC - isp_prt(isp, ISP_LOGERR, "error %d in dma mapping code", error); -#endif - mp->error = error; - } - if (mp->error) { - int retval = CMD_COMPLETE; - if (mp->error == MUSHERR_NOQENTRIES) { - retval = CMD_EAGAIN; - } else if (mp->error == EFBIG) { - XS_SETERR(csio, CAM_REQ_TOO_BIG); - } else if (mp->error == EINVAL) { - XS_SETERR(csio, CAM_REQ_INVALID); - } else { - XS_SETERR(csio, CAM_UNREC_HBA_ERROR); - } - return (retval); - } - return (CMD_QUEUED); -} - -static void -isp_sbus_dumpregs(ispsoftc_t *isp, const char *msg) -{ - if (msg) - printf("%s: %s\n", device_get_nameunit(isp->isp_dev), msg); - else - printf("%s:\n", device_get_nameunit(isp->isp_dev)); - printf(" biu_conf1=%x", ISP_READ(isp, BIU_CONF1)); - printf(" biu_icr=%x biu_isr=%x biu_sema=%x ", ISP_READ(isp, BIU_ICR), - ISP_READ(isp, BIU_ISR), ISP_READ(isp, BIU_SEMA)); - printf("risc_hccr=%x\n", ISP_READ(isp, HCCR)); - - - ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE); - printf(" cdma_conf=%x cdma_sts=%x cdma_fifostat=%x\n", - ISP_READ(isp, CDMA_CONF), ISP_READ(isp, CDMA_STATUS), - ISP_READ(isp, CDMA_FIFO_STS)); - printf(" ddma_conf=%x ddma_sts=%x ddma_fifostat=%x\n", - ISP_READ(isp, DDMA_CONF), ISP_READ(isp, DDMA_STATUS), - ISP_READ(isp, DDMA_FIFO_STS)); - printf(" sxp_int=%x sxp_gross=%x sxp(scsi_ctrl)=%x\n", - ISP_READ(isp, SXP_INTERRUPT), - ISP_READ(isp, SXP_GROSS_ERR), - ISP_READ(isp, SXP_PINS_CTRL)); - ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE); - printf(" mbox regs: %x %x %x %x %x\n", - ISP_READ(isp, OUTMAILBOX0), ISP_READ(isp, OUTMAILBOX1), - ISP_READ(isp, OUTMAILBOX2), ISP_READ(isp, OUTMAILBOX3), - ISP_READ(isp, OUTMAILBOX4)); -} diff --git a/sys/dev/ispfw/asm_1000.h b/sys/dev/ispfw/asm_1000.h deleted file mode 100644 index 69193fac602d..000000000000 --- a/sys/dev/ispfw/asm_1000.h +++ /dev/null @@ -1,1293 +0,0 @@ -/* $FreeBSD$ */ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Qlogic, Inc. - * 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. 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 1.37.00 (11:28 Aug 28, 2000) - */ -static const u_int16_t isp_1000_risc_code[] = { - 0x0078, 0x1041, 0x0000, 0x2757, 0x0000, 0x12ff, 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, 0x3130, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, - 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, 0x312e, 0x3337, 0x2020, - 0x2043, 0x7573, 0x746f, 0x6d65, 0x7220, 0x4e6f, 0x2e20, 0x3135, - 0x2050, 0x726f, 0x6475, 0x6374, 0x204e, 0x6f2e, 0x2000, 0x3030, - 0x2024, 0x20b9, 0x1212, 0x20c1, 0x0008, 0x2071, 0x0010, 0x70c3, - 0x0004, 0x20c9, 0x5cff, 0x2089, 0x10ee, 0x70c7, 0x4953, 0x70cb, - 0x5020, 0x70cf, 0x2020, 0x70d3, 0x0001, 0x3f00, 0x70d6, 0x2031, - 0x0030, 0x2079, 0x3800, 0x7863, 0x0000, 0x2fa0, 0x2009, 0x031b, - 0x2011, 0x0000, 0x20a9, 0x0040, 0x42a4, 0x8109, 0x00c0, 0x1062, - 0x789b, 0x0101, 0x780b, 0x0002, 0x780f, 0x0002, 0x784f, 0x0bb8, - 0x2009, 0x3835, 0x200b, 0x0003, 0x78bb, 0x0000, 0x78bf, 0x0000, - 0x78c3, 0x0000, 0x2069, 0x3840, 0x00a8, 0x1085, 0x681b, 0x003c, - 0x2009, 0x1313, 0x21b8, 0x0078, 0x1087, 0x681b, 0x0028, 0x6807, - 0x0007, 0x680b, 0x00fa, 0x680f, 0x0008, 0x6813, 0x0005, 0x681f, - 0x0000, 0x6823, 0x0006, 0x6817, 0x0008, 0x6827, 0x0000, 0x2069, - 0x3a80, 0x2011, 0x0020, 0x2009, 0x0010, 0x680b, 0x0c19, 0x680f, - 0x0019, 0x6803, 0xdd00, 0x6807, 0x001a, 0x6a1a, 0x2d00, 0xa0e8, - 0x0008, 0xa290, 0x0004, 0x8109, 0x00c0, 0x109d, 0x2069, 0x3b00, - 0x2009, 0x0002, 0x20a9, 0x0100, 0x683f, 0x0000, 0x2001, 0x0008, - 0x8007, 0x6832, 0x6837, 0x000a, 0x680b, 0x0040, 0x6817, 0x0100, - 0x681f, 0x0064, 0xade8, 0x0010, 0x0070, 0x10c8, 0x0078, 0x10b4, - 0x8109, 0x00c0, 0x10b2, 0x1078, 0x1b64, 0x1078, 0x31c0, 0x1078, - 0x1747, 0x1078, 0x368b, 0x3200, 0xa085, 0x000d, 0x2090, 0x70c3, - 0x0000, 0x0090, 0x10e2, 0x70c0, 0xa086, 0x0002, 0x00c0, 0x10e2, - 0x1078, 0x11e0, 0x1078, 0x1112, 0x1078, 0x18f2, 0x1078, 0x1aaf, - 0x1078, 0x34fd, 0x1078, 0x184d, 0x0078, 0x10e2, 0x10f6, 0x10f8, - 0x1d05, 0x1d05, 0x321e, 0x321e, 0x1d05, 0x1d05, 0x0078, 0x10f6, - 0x0078, 0x10f8, 0x0078, 0x10fa, 0x0078, 0x10fc, 0x7008, 0x800c, - 0x00c8, 0x110d, 0x7007, 0x0002, 0xa08c, 0x000c, 0x00c0, 0x110e, - 0x8004, 0x8004, 0x00c8, 0x110d, 0x087a, 0x097a, 0x70c3, 0x4002, - 0x0078, 0x11e3, 0x7814, 0xa005, 0x00c0, 0x111a, 0x0010, 0x1156, - 0x0078, 0x1155, 0x2009, 0x3868, 0x2104, 0xa005, 0x00c0, 0x1155, - 0x7814, 0xa086, 0x0001, 0x00c0, 0x1127, 0x1078, 0x15ae, 0x7817, - 0x0000, 0x2009, 0x386f, 0x2104, 0xa065, 0x0040, 0x1143, 0x2009, - 0x386a, 0x211c, 0x8108, 0x2114, 0x8108, 0x2104, 0xa210, 0xa399, - 0x0000, 0x2009, 0x0018, 0x6083, 0x0103, 0x1078, 0x16d7, 0x00c0, - 0x114f, 0x1078, 0x173e, 0x2009, 0x386f, 0x200b, 0x0000, 0x2009, - 0x3869, 0x2104, 0x200b, 0x0000, 0xa005, 0x0040, 0x1153, 0x2001, - 0x4005, 0x0078, 0x11e2, 0x0078, 0x11e0, 0x007c, 0x2061, 0x0000, - 0x6018, 0xa084, 0x0001, 0x0040, 0x115e, 0x007c, 0x70c3, 0x0000, - 0x70c7, 0x0000, 0x70cb, 0x0000, 0x70cf, 0x0000, 0x70c0, 0xa0bc, - 0xffc0, 0x00c0, 0x11ae, 0x2038, 0x0079, 0x116e, 0x11e0, 0x122e, - 0x11fc, 0x122e, 0x127f, 0x127f, 0x11f3, 0x1608, 0x128a, 0x11ef, - 0x1200, 0x1202, 0x1204, 0x1206, 0x160d, 0x11ef, 0x1292, 0x12ba, - 0x15bc, 0x1602, 0x1208, 0x14e3, 0x1505, 0x151f, 0x1548, 0x149c, - 0x14aa, 0x14be, 0x14d2, 0x1357, 0x1332, 0x12e2, 0x12e9, 0x12ee, - 0x12f3, 0x12f9, 0x12fe, 0x1303, 0x1308, 0x130d, 0x1311, 0x1326, - 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x1363, 0x136c, 0x137b, - 0x13a1, 0x13ab, 0x13b2, 0x13d8, 0x13e7, 0x13f6, 0x1408, 0x147a, - 0x11ef, 0x148a, 0x11ef, 0x11ef, 0x11ef, 0x1491, 0xa0bc, 0xffa0, - 0x00c0, 0x11ef, 0x2038, 0xa084, 0x001f, 0x0079, 0x11b7, 0x11ef, - 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, - 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x1665, 0x1674, 0x11ef, - 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, 0x11ef, - 0x11ef, 0x16b3, 0x16bd, 0x16c1, 0x16cf, 0x167f, 0x169c, 0x72ca, - 0x71c6, 0x2001, 0x4006, 0x0078, 0x11e2, 0x73ce, 0x72ca, 0x71c6, - 0x2001, 0x4000, 0x70c2, 0x2061, 0x0000, 0x601b, 0x0001, 0x2091, - 0x5000, 0x2091, 0x4080, 0x007c, 0x71c6, 0x0078, 0x11e2, 0x70c3, - 0x4001, 0x0078, 0x11e3, 0x2099, 0x0041, 0x20a1, 0x0041, 0x20a9, - 0x0005, 0x53a3, 0x0078, 0x11e0, 0x70c4, 0x70c3, 0x0004, 0x007a, - 0x0078, 0x11e0, 0x0078, 0x11e0, 0x0078, 0x11e0, 0x0078, 0x11e0, - 0x2091, 0x8000, 0x70c3, 0x0000, 0x70c7, 0x4953, 0x70cb, 0x5020, - 0x70cf, 0x2020, 0x70d3, 0x0001, 0x3f00, 0x70d6, 0x2079, 0x0000, - 0x781b, 0x0001, 0x2031, 0x0030, 0x2059, 0x1000, 0x2029, 0x0457, - 0x2051, 0x0470, 0x2061, 0x0472, 0x20b9, 0xffff, 0x20c1, 0x0000, - 0x2091, 0x5000, 0x2091, 0x4080, 0x0078, 0x0455, 0x71d0, 0x72c8, - 0x73cc, 0x70c4, 0x20a0, 0x2098, 0x2031, 0x0030, 0x81ff, 0x0040, - 0x11e0, 0x7007, 0x0004, 0x731a, 0x721e, 0x2051, 0x0012, 0x2049, - 0x125d, 0x2041, 0x11e0, 0x7003, 0x0002, 0xa786, 0x0001, 0x00c0, - 0x124f, 0x2049, 0x126b, 0x2041, 0x1277, 0x7003, 0x0003, 0x7017, - 0x0000, 0x810b, 0x7112, 0x00c8, 0x1257, 0x7017, 0x0001, 0x7007, - 0x0001, 0xa786, 0x0001, 0x0040, 0x126b, 0x700c, 0xa084, 0x007f, - 0x8004, 0x2009, 0x0020, 0xa102, 0x0942, 0x094a, 0x20a8, 0x26a0, - 0x53a6, 0x0078, 0x10fe, 0x700c, 0xa084, 0x007f, 0x0040, 0x126b, - 0x80ac, 0x0048, 0x126b, 0x2698, 0x53a5, 0x0078, 0x10fe, 0x700c, - 0xa084, 0x007f, 0x80ac, 0x2698, 0x53a5, 0x0078, 0x11e0, 0x71c4, - 0x70c8, 0x2114, 0xa79e, 0x0004, 0x00c0, 0x1287, 0x200a, 0x72ca, - 0x0078, 0x11df, 0x70c7, 0x0125, 0x70cb, 0x0000, 0x70cf, 0x0f00, - 0x0078, 0x11e0, 0x70c4, 0x72c8, 0x73cc, 0x74d0, 0x70c6, 0x72ca, - 0x73ce, 0x74d2, 0xa005, 0x0040, 0x12b4, 0x8001, 0x7872, 0xa084, - 0xfc00, 0x0040, 0x12ab, 0x7898, 0xa085, 0x0001, 0x789a, 0x2001, - 0x4005, 0x0078, 0x11e2, 0x7a7a, 0x7b7e, 0x7c76, 0x7898, 0xa084, - 0xfffc, 0x789a, 0x0078, 0x12b8, 0x7898, 0xa085, 0x0001, 0x789a, - 0x0078, 0x11e0, 0x70c4, 0x72c8, 0x73cc, 0x74d4, 0x70c6, 0x72ca, - 0x73ce, 0x74d6, 0xa005, 0x0040, 0x12dc, 0x8001, 0x7886, 0xa084, - 0xfc00, 0x0040, 0x12d3, 0x7898, 0xa085, 0x0100, 0x789a, 0x2001, - 0x4005, 0x0078, 0x11e2, 0x7a8e, 0x7b92, 0x7c8a, 0x7898, 0xa084, - 0xfcff, 0x789a, 0x0078, 0x12e0, 0x7898, 0xa085, 0x0100, 0x789a, - 0x0078, 0x11e0, 0x2009, 0x3859, 0x210c, 0x2011, 0x0372, 0x0078, - 0x11de, 0x2009, 0x3841, 0x210c, 0x0078, 0x11df, 0x2009, 0x3842, - 0x210c, 0x0078, 0x11df, 0x2061, 0x3840, 0x610c, 0x6210, 0x0078, - 0x11de, 0x2009, 0x3845, 0x210c, 0x0078, 0x11df, 0x2009, 0x3846, - 0x210c, 0x0078, 0x11df, 0x2009, 0x3847, 0x210c, 0x0078, 0x11df, - 0x2009, 0x3848, 0x210c, 0x0078, 0x11df, 0x7908, 0x7a0c, 0x0078, - 0x11de, 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xa0e8, 0x3a80, 0x6a00, 0x6804, 0xa084, 0x0008, 0x0040, 0x1323, - 0x6b08, 0x0078, 0x1324, 0x6b0c, 0x0078, 0x11dd, 0x77c4, 0x1078, - 0x1758, 0x2091, 0x8000, 0x6b1c, 0x6a14, 0x2091, 0x8001, 0x2708, - 0x0078, 0x11dd, 0x2091, 0x8000, 0x7848, 0xa005, 0x00c0, 0x1346, - 0x2061, 0x3b00, 0x20a9, 0x0100, 0x603c, 0xa005, 0x00c0, 0x1346, - 0xace0, 0x0010, 0x00f0, 0x133c, 0x0078, 0x134e, 0x2019, 0x0000, - 0x2011, 0x0000, 0x2009, 0x0000, 0x0078, 0x1353, 0x7bb8, 0x7abc, - 0x79c0, 0x78c3, 0x0000, 0x2091, 0x8001, 0x0078, 0x11dd, 0x77c4, - 0x1078, 0x1758, 0x2091, 0x8000, 0x6908, 0x6a18, 0x6b10, 0x2091, - 0x8001, 0x0078, 0x11dd, 0x71c4, 0xa182, 0x0010, 0x00c8, 0x11d8, - 0x1078, 0x1be8, 0x0078, 0x11dd, 0x71c4, 0xa182, 0x0010, 0x00c8, - 0x11d8, 0x2011, 0x3841, 0x2204, 0x007e, 0x2112, 0x1078, 0x1ba1, - 0x017f, 0x0078, 0x11df, 0x71c4, 0x2011, 0x1399, 0x20a9, 0x0008, - 0x2204, 0xa106, 0x0040, 0x138b, 0x8210, 0x0070, 0x1389, 0x0078, - 0x1380, 0x0078, 0x11d8, 0xa292, 0x1399, 0x027e, 0x2011, 0x3842, - 0x2204, 0x2112, 0x017f, 0x007e, 0x1078, 0x1bad, 0x017f, 0x0078, - 0x11df, 0x03e8, 0x00fa, 0x01f4, 0x02ee, 0x0064, 0x0019, 0x0032, - 0x004b, 0x2061, 0x3840, 0x610c, 0x6210, 0x70c4, 0x600e, 0x70c8, - 0x6012, 0x0078, 0x11de, 0x2061, 0x3840, 0x6114, 0x70c4, 0x6016, - 0x0078, 0x11df, 0x71c4, 0x2011, 0x0004, 0x2019, 0x1212, 0xa186, - 0x0028, 0x0040, 0x13cb, 0x2011, 0x0005, 0x2019, 0x1212, 0xa186, - 0x0032, 0x0040, 0x13cb, 0x2011, 0x0006, 0x2019, 0x1313, 0xa186, - 0x003c, 0x00c0, 0x11d8, 0x2061, 0x3840, 0x6018, 0x007e, 0x611a, - 0x23b8, 0x1078, 0x1bbe, 0x1078, 0x368b, 0x017f, 0x0078, 0x11df, - 0x71c4, 0xa184, 0xffcf, 0x00c0, 0x11d8, 0x2011, 0x3847, 0x2204, - 0x2112, 0x007e, 0x1078, 0x1be0, 0x017f, 0x0078, 0x11df, 0x71c4, - 0xa182, 0x0010, 0x00c8, 0x11d8, 0x2011, 0x3848, 0x2204, 0x007e, - 0x2112, 0x1078, 0x1bcf, 0x017f, 0x0078, 0x11df, 0x71c4, 0x72c8, - 0xa184, 0xfffd, 0x00c0, 0x11d7, 0xa284, 0xfffd, 0x00c0, 0x11d7, - 0x2100, 0x7908, 0x780a, 0x2200, 0x7a0c, 0x780e, 0x0078, 0x11de, - 0x71c4, 0x8107, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e8, - 0x3a80, 0x2019, 0x0000, 0x72c8, 0x6800, 0x007e, 0xa226, 0x0040, - 0x1440, 0xa284, 0x0001, 0x0040, 0x1422, 0x2220, 0xa39d, 0x0002, - 0xa294, 0xfffe, 0x6a02, 0xa484, 0x2000, 0x0040, 0x1429, 0xa39d, - 0x0010, 0xa484, 0x1000, 0x0040, 0x142f, 0xa39d, 0x0008, 0xa484, - 0x4000, 0x0040, 0x1440, 0x810f, 0xa284, 0x4000, 0x0040, 0x143c, - 0x1078, 0x1c02, 0x0078, 0x1440, 0x1078, 0x1bf4, 0x0078, 0x1440, - 0x72cc, 0x82ff, 0x0040, 0x1472, 0x6808, 0xa206, 0x0040, 0x1472, - 0xa2a4, 0x00ff, 0x2061, 0x3840, 0x6118, 0xa186, 0x0028, 0x0040, - 0x1459, 0xa186, 0x0032, 0x0040, 0x145f, 0xa186, 0x003c, 0x0040, - 0x1465, 0xa482, 0x0064, 0x0048, 0x146f, 0x0078, 0x1469, 0xa482, - 0x0050, 0x0048, 0x146f, 0x0078, 0x1469, 0xa482, 0x0043, 0x0048, - 0x146f, 0x71c4, 0x71c6, 0x027f, 0x72ca, 0x0078, 0x11d9, 0x6a0a, - 0xa39d, 0x000a, 0x6804, 0xa305, 0x6806, 0x027f, 0x6b0c, 0x71c4, - 0x0078, 0x11dd, 0x77c4, 0x1078, 0x1758, 0x2091, 0x8000, 0x6a14, - 0x6b1c, 0x2091, 0x8001, 0x70c8, 0x6816, 0x70cc, 0x681e, 0x2708, - 0x0078, 0x11dd, 0x2011, 0x3835, 0x220c, 0x70c4, 0x2012, 0x0078, - 0x11df, 0x71c4, 0x72c8, 0x73cc, 0xa182, 0x0010, 0x00c8, 0x11d8, - 0x1078, 0x1c10, 0x0078, 0x11dd, 0x77c4, 0x1078, 0x1758, 0x2091, - 0x8000, 0x6a08, 0xa295, 0x0002, 0x6a0a, 0x2091, 0x8001, 0x2708, - 0x0078, 0x11de, 0x77c4, 0x1078, 0x1758, 0x2091, 0x8000, 0x6a08, - 0xa294, 0xfff9, 0x6a0a, 0x6804, 0xa005, 0x0040, 0x14b9, 0x1078, - 0x1b49, 0x2091, 0x8001, 0x2708, 0x0078, 0x11de, 0x77c4, 0x1078, - 0x1758, 0x2091, 0x8000, 0x6a08, 0xa295, 0x0004, 0x6a0a, 0x6804, - 0xa005, 0x0040, 0x14cd, 0x1078, 0x1b49, 0x2091, 0x8001, 0x2708, - 0x0078, 0x11de, 0x77c4, 0x2041, 0x0001, 0x2049, 0x0005, 0x2051, - 0x0020, 0x2091, 0x8000, 0x1078, 0x1765, 0x2091, 0x8001, 0x2708, - 0x6a08, 0x0078, 0x11de, 0x77c4, 0x72c8, 0x73cc, 0x77c6, 0x72ca, - 0x73ce, 0x1078, 0x17e6, 0x00c0, 0x1501, 0x6818, 0xa005, 0x0040, - 0x14fb, 0x2708, 0x1078, 0x1c20, 0x00c0, 0x14fb, 0x7817, 0xffff, - 0x2091, 0x8001, 0x007c, 0x2091, 0x8001, 0x2001, 0x4005, 0x0078, - 0x11e2, 0x2091, 0x8001, 0x0078, 0x11e0, 0x77c4, 0x77c6, 0x2041, - 0x0021, 0x2049, 0x0005, 0x2051, 0x0020, 0x2091, 0x8000, 0x1078, - 0x1765, 0x2061, 0x3840, 0x60a3, 0x0003, 0x67b6, 0x60a7, 0x0000, - 0x7817, 0xffff, 0x1078, 0x1b49, 0x2091, 0x8001, 0x007c, 0x77c8, - 0x77ca, 0x77c4, 0x77c6, 0xa7bc, 0xff00, 0x2091, 0x8000, 0x2061, - 0x3840, 0x60a3, 0x0002, 0x60a7, 0x0000, 0x67b6, 0x7817, 0xffff, - 0x1078, 0x1b49, 0x2091, 0x8001, 0x2041, 0x0021, 0x2049, 0x0004, - 0x2051, 0x0010, 0x2091, 0x8000, 0x1078, 0x1765, 0x70c8, 0x683e, - 0x8738, 0xa784, 0x001f, 0x00c0, 0x153c, 0x2091, 0x8001, 0x007c, - 0x7898, 0xa084, 0x0003, 0x00c0, 0x156c, 0x2039, 0x0000, 0x2041, - 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, 0x1078, 0x1758, 0x2091, - 0x8000, 0x6808, 0xa80d, 0x690a, 0x2091, 0x8001, 0x8738, 0xa784, - 0x001f, 0x00c0, 0x1555, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, - 0xa784, 0x0f00, 0x00c0, 0x1555, 0x2091, 0x8000, 0x2069, 0x0100, - 0x6830, 0xa084, 0x0040, 0x0040, 0x1595, 0x684b, 0x0004, 0x20a9, - 0x0014, 0x6848, 0xa084, 0x0004, 0x0040, 0x1582, 0x0070, 0x1582, - 0x0078, 0x1579, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, - 0x0001, 0x0040, 0x158f, 0x0070, 0x158f, 0x0078, 0x1586, 0x20a9, - 0x00fa, 0x0070, 0x1595, 0x0078, 0x1591, 0x2079, 0x3800, 0x7817, - 0x0001, 0x2061, 0x3840, 0x60a3, 0x0001, 0x60a7, 0x0000, 0x60c3, - 0x000f, 0x7898, 0xa085, 0x0002, 0x789a, 0x6808, 0xa084, 0xfffd, - 0x680a, 0x681b, 0x0046, 0x2091, 0x8001, 0x007c, 0x7898, 0xa084, - 0xfffd, 0x789a, 0xa084, 0x0001, 0x00c0, 0x15b8, 0x1078, 0x1830, - 0x71c4, 0x71c6, 0x794a, 0x007c, 0x74c4, 0x73c8, 0x72cc, 0x74c6, - 0x73ca, 0x72ce, 0x2079, 0x3800, 0x2009, 0x0040, 0x1078, 0x1735, - 0x0040, 0x15fe, 0x1078, 0x1705, 0x0040, 0x15d2, 0x1078, 0x173e, - 0x0078, 0x15fe, 0x6010, 0x2091, 0x8000, 0x7817, 0xffff, 0x2009, - 0x3868, 0x200b, 0x0005, 0x8108, 0x200b, 0x0000, 0x8108, 0x230a, - 0x8108, 0x220a, 0x8108, 0x240a, 0x8108, 0x200a, 0x8108, 0x200b, - 0x0000, 0x8108, 0x2c0a, 0xa02e, 0x2530, 0x0e7e, 0x1078, 0x3199, - 0x0e7f, 0x6592, 0x65a2, 0x6696, 0x66a6, 0x60ab, 0x0000, 0x60af, - 0x0000, 0x1078, 0x1b49, 0x2091, 0x8001, 0x007c, 0x70c3, 0x4005, - 0x0078, 0x11e3, 0x71c4, 0x70c7, 0x0000, 0x7906, 0x0078, 0x11e0, - 0x71c4, 0x71c6, 0x2168, 0x0078, 0x160f, 0x2069, 0x1000, 0x690c, - 0xa016, 0x2d04, 0xa210, 0x8d68, 0x8109, 0x00c0, 0x1611, 0xa285, - 0x0000, 0x00c0, 0x161f, 0x70c3, 0x4000, 0x0078, 0x1621, 0x70c3, - 0x4003, 0x70ca, 0x0078, 0x11e3, 0x71c4, 0x72c8, 0x73cc, 0x2100, - 0xa184, 0xfffc, 0x00c0, 0x11ef, 0x2100, 0x0079, 0x162f, 0x1646, - 0x165b, 0x165d, 0x165f, 0x70c3, 0x4003, 0x71ce, 0x72d2, 0x73d6, - 0x0078, 0x1642, 0x70c3, 0x4000, 0x70cf, 0x0000, 0x70d3, 0x0000, - 0x70d7, 0x0000, 0x77c6, 0x71ca, 0x0078, 0x11e0, 0x2031, 0x1661, - 0x2624, 0x8630, 0x2412, 0x2204, 0xa446, 0x00c0, 0x1633, 0xa484, - 0xffff, 0x00c0, 0x1648, 0x2031, 0x1661, 0x8210, 0x8319, 0xa384, - 0xffff, 0x00c0, 0x1648, 0x0078, 0x163a, 0x0078, 0x163a, 0x0078, - 0x163a, 0x5555, 0xaaaa, 0xffff, 0x0000, 0x77c4, 0x1078, 0x1758, - 0x2091, 0x8000, 0x6830, 0xa084, 0xff00, 0x8007, 0x2010, 0x2091, - 0x8001, 0x2708, 0x0078, 0x11de, 0x77c4, 0x1078, 0x1758, 0x2091, - 0x8000, 0x6a34, 0x2091, 0x8001, 0x2708, 0x0078, 0x11de, 0x77c4, - 0x077e, 0xa7bc, 0xff00, 0x20a9, 0x0020, 0x72c8, 0x8217, 0xa294, - 0xff00, 0x1078, 0x1758, 0x2091, 0x8000, 0x6c30, 0x6a32, 0x2091, - 0x8001, 0x8738, 0x00f0, 0x1689, 0x077f, 0x2708, 0x8427, 0xa4a4, - 0x00ff, 0x2410, 0x0078, 0x11de, 0x77c4, 0x077e, 0xa7bc, 0xff00, - 0x20a9, 0x0020, 0x72c8, 0x1078, 0x1758, 0x2091, 0x8000, 0x6c34, - 0x6a36, 0x2091, 0x8001, 0x8738, 0x00f0, 0x16a3, 0x077f, 0x2708, - 0x2410, 0x0078, 0x11de, 0x7960, 0x71c6, 0x71c4, 0xa182, 0x0003, - 0x00c8, 0x11d8, 0x7962, 0x0078, 0x11e0, 0x7960, 0x71c6, 0x0078, - 0x11e0, 0x7954, 0x71c6, 0x71c4, 0x7956, 0x7958, 0x71ca, 0x71c8, - 0x795a, 0x795c, 0x71ce, 0x71cc, 0x795e, 0x0078, 0x11e0, 0x7954, - 0x71c6, 0x7958, 0x71ca, 0x795c, 0x71ce, 0x0078, 0x11e0, 0x700c, - 0xa084, 0x007f, 0x0040, 0x16e3, 0x7007, 0x0004, 0x7004, 0xa084, - 0x0004, 0x00c0, 0x16de, 0x7017, 0x0000, 0x7112, 0x721a, 0x731e, - 0x8108, 0x810c, 0x81a9, 0x8c98, 0x20a1, 0x0030, 0x6080, 0x20a2, - 0x53a6, 0x780c, 0xa085, 0x0000, 0x7002, 0x7007, 0x0001, 0x7108, - 0x8104, 0x00c8, 0x16f7, 0x7007, 0x0002, 0xa184, 0x000c, 0x710c, - 0xa184, 0x0300, 0x7003, 0x0000, 0x007c, 0x700c, 0xa084, 0x007f, - 0x0040, 0x1711, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, - 0x170c, 0x7017, 0x0000, 0x7112, 0x721a, 0x731e, 0x2099, 0x0030, - 0x8108, 0x81ac, 0x780c, 0xa085, 0x0001, 0x7002, 0x7007, 0x0001, - 0x7008, 0x800c, 0x00c8, 0x1720, 0x7007, 0x0002, 0xa08c, 0x000c, - 0x00c0, 0x1732, 0x710c, 0xa184, 0x0300, 0x00c0, 0x1732, 0x2ca0, - 0x53a5, 0xa006, 0x7003, 0x0000, 0x007c, 0x7850, 0xa065, 0x0040, - 0x173d, 0x2c04, 0x7852, 0x2063, 0x0000, 0x007c, 0x0f7e, 0x2079, - 0x3800, 0x7850, 0x2062, 0x2c00, 0x7852, 0x0f7f, 0x007c, 0x2011, - 0x5d00, 0x7a52, 0x2019, 0x0372, 0x8319, 0x0040, 0x1755, 0xa280, - 0x002f, 0x2012, 0x2010, 0x0078, 0x174c, 0x2013, 0x0000, 0x007c, - 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, 0x8003, - 0x8003, 0xa105, 0xa0e8, 0x3b00, 0x007c, 0x1078, 0x1758, 0x2900, - 0x682a, 0x2a00, 0x682e, 0x6808, 0xa084, 0xffef, 0xa80d, 0x690a, - 0x2091, 0x8000, 0x2009, 0x384f, 0x210c, 0x6804, 0xa005, 0x0040, - 0x1784, 0xa116, 0x00c0, 0x1784, 0x2060, 0x6000, 0x6806, 0x017e, - 0x200b, 0x0000, 0x0078, 0x1787, 0x2009, 0x0000, 0x017e, 0x6804, - 0xa065, 0x0040, 0x1798, 0x6000, 0x6806, 0x1078, 0x17ad, 0x1078, - 0x18a4, 0x1078, 0x2b27, 0x6810, 0x8001, 0x6812, 0x00c0, 0x1787, - 0x1078, 0x2b27, 0x017f, 0x6902, 0x6906, 0x2091, 0x8001, 0x007c, - 0xa065, 0x0040, 0x17ac, 0x6098, 0x609b, 0x0000, 0x2008, 0x1078, - 0x173e, 0x2100, 0x0078, 0x17a0, 0x007c, 0x6003, 0x0103, 0x20a9, - 0x001c, 0xac80, 0x0004, 0x20a0, 0x2001, 0x0000, 0x40a4, 0x6828, - 0x6016, 0x682c, 0x601e, 0x007c, 0x0e7e, 0x2071, 0x3840, 0x7040, - 0xa08c, 0x0200, 0x00c0, 0x17ca, 0xa088, 0x3880, 0x2d0a, 0x8000, - 0x7042, 0xa006, 0x0e7f, 0x007c, 0x0e7e, 0x2071, 0x3840, 0x2009, - 0x3880, 0x7240, 0x8221, 0x8211, 0x0048, 0x17e4, 0x2104, 0x8108, - 0xad06, 0x00c0, 0x17d3, 0x8119, 0x211e, 0x8108, 0x8318, 0x8211, - 0x00c8, 0x17dc, 0x7442, 0xa006, 0x0e7f, 0x007c, 0x1078, 0x1758, - 0x2091, 0x8000, 0x6804, 0x781e, 0xa065, 0x0040, 0x182f, 0x0078, - 0x17f7, 0x2c00, 0x781e, 0x6000, 0xa065, 0x0040, 0x182f, 0x600c, - 0xa306, 0x00c0, 0x17f1, 0x6008, 0xa206, 0x00c0, 0x17f1, 0x2c28, - 0x2001, 0x384f, 0x2004, 0xac06, 0x0040, 0x182f, 0x6804, 0xac06, - 0x00c0, 0x1814, 0x6000, 0x2060, 0x6806, 0xa005, 0x00c0, 0x1814, - 0x6803, 0x0000, 0x0078, 0x181e, 0x6400, 0x781c, 0x2060, 0x6402, - 0xa486, 0x0000, 0x00c0, 0x181e, 0x2c00, 0x6802, 0x2560, 0x1078, - 0x17ad, 0x6017, 0x0005, 0x601f, 0x0020, 0x1078, 0x18a4, 0x1078, - 0x2b27, 0x6810, 0x8001, 0x6812, 0x2001, 0xffff, 0xa005, 0x007c, - 0x2039, 0x0000, 0x2041, 0x0021, 0x2049, 0x0004, 0x2051, 0x0008, - 0x2091, 0x8000, 0x1078, 0x1765, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x183a, 0xa7bc, 0xff00, 0x873f, 0x8738, 0x873f, 0xa784, 0x0f00, - 0x00c0, 0x183a, 0x2091, 0x8001, 0x007c, 0x0068, 0x185c, 0x2061, - 0x0000, 0x6018, 0xa084, 0x0001, 0x00c0, 0x185c, 0x78ac, 0x78af, - 0x0000, 0xa005, 0x00c0, 0x185d, 0x007c, 0xa08c, 0xfff0, 0x0040, - 0x1863, 0x1078, 0x1ce7, 0x0079, 0x1865, 0x1875, 0x1877, 0x187d, - 0x1881, 0x1875, 0x1885, 0x1875, 0x1875, 0x188b, 0x1875, 0x1892, - 0x1896, 0x1875, 0x1875, 0x1875, 0x1875, 0x1078, 0x1ce7, 0x1078, - 0x1830, 0x2001, 0x8001, 0x0078, 0x189c, 0x2001, 0x8003, 0x0078, - 0x189c, 0x2001, 0x8004, 0x0078, 0x189c, 0x1078, 0x1830, 0x2001, - 0x8006, 0x0078, 0x189c, 0x2001, 0x8009, 0x2011, 0x382c, 0x220c, - 0x0078, 0x11ec, 0x2001, 0x800c, 0x0078, 0x189c, 0x1078, 0x1830, - 0x2001, 0x800d, 0x0078, 0x189c, 0x70c2, 0x2061, 0x0000, 0x601b, - 0x0001, 0x2091, 0x4080, 0x007c, 0x2c04, 0x6082, 0x2c08, 0x2063, - 0x0000, 0x7864, 0x8000, 0x7866, 0x7868, 0xa005, 0x796a, 0x0040, - 0x18b4, 0x2c02, 0x0078, 0x18b5, 0x796e, 0x007c, 0x0c7e, 0x2061, - 0x3800, 0x6883, 0x0103, 0x2d08, 0x206b, 0x0000, 0x6064, 0x8000, - 0x6066, 0x6068, 0xa005, 0x616a, 0x0040, 0x18c9, 0x2d02, 0x0078, - 0x18cc, 0x616e, 0x1078, 0x2b41, 0x0c7f, 0x007c, 0x1078, 0x18df, - 0x0040, 0x18de, 0x0c7e, 0x6098, 0xa065, 0x0040, 0x18d9, 0x1078, - 0x17a0, 0x0c7f, 0x609b, 0x0000, 0x1078, 0x173e, 0x007c, 0x786c, - 0xa065, 0x0040, 0x18f1, 0x2091, 0x8000, 0x7864, 0x8001, 0x7866, - 0x2c04, 0x786e, 0xa005, 0x00c0, 0x18ef, 0x786a, 0x8000, 0x2091, - 0x8001, 0x007c, 0x7898, 0xa005, 0x00c0, 0x194d, 0x7974, 0x70d0, - 0x0005, 0x0005, 0x72d0, 0xa206, 0x00c0, 0x18f7, 0x2200, 0xa106, - 0x00c0, 0x190e, 0x7804, 0xa005, 0x0040, 0x194d, 0x7807, 0x0000, - 0x0068, 0x194d, 0x2091, 0x4080, 0x0078, 0x194d, 0x1078, 0x1735, - 0x0040, 0x194d, 0x7a7c, 0x7b78, 0xa184, 0xff00, 0x0040, 0x1921, - 0x810f, 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078, - 0x1924, 0x8107, 0x8004, 0x8004, 0xa210, 0xa399, 0x0000, 0x2009, - 0x0040, 0x1078, 0x1705, 0x0040, 0x1944, 0x1078, 0x173e, 0x7880, - 0x8000, 0x7882, 0xa086, 0x0002, 0x00c0, 0x194d, 0x2091, 0x8000, - 0x78af, 0x0002, 0x7883, 0x0000, 0x7898, 0xa085, 0x0003, 0x789a, - 0x2091, 0x8001, 0x0078, 0x194d, 0x7883, 0x0000, 0x1078, 0x1a99, - 0x6000, 0xa084, 0x0007, 0x0079, 0x194e, 0x007c, 0x1956, 0x1965, - 0x1985, 0x1956, 0x1997, 0x1956, 0x1956, 0x1956, 0x2039, 0x0400, - 0x78a8, 0xa705, 0x78aa, 0x6004, 0xa705, 0x6006, 0x1078, 0x19e2, - 0x6018, 0x78a6, 0x1078, 0x1a81, 0x007c, 0x78a8, 0xa084, 0x0100, - 0x0040, 0x196c, 0x0078, 0x1956, 0x78ab, 0x0000, 0x6000, 0x8007, - 0xa084, 0x00ff, 0x789e, 0x8001, 0x609b, 0x0000, 0x0040, 0x1982, - 0x1078, 0x19e2, 0x0040, 0x1982, 0x78a8, 0xa085, 0x0100, 0x78aa, - 0x0078, 0x1984, 0x1078, 0x1a06, 0x007c, 0x78a8, 0xa08c, 0x0e00, - 0x00c0, 0x198e, 0xa084, 0x0100, 0x00c0, 0x1990, 0x0078, 0x1956, - 0x1078, 0x19e2, 0x00c0, 0x1996, 0x1078, 0x1a06, 0x007c, 0x78a8, - 0xa084, 0x0100, 0x0040, 0x199e, 0x0078, 0x1956, 0x78ab, 0x0000, - 0x6710, 0x2011, 0x0001, 0x20a9, 0x0001, 0x6014, 0xa084, 0x00ff, - 0xa005, 0x0040, 0x19c1, 0x2011, 0x0001, 0xa7bc, 0xff00, 0x20a9, - 0x0020, 0xa08e, 0x0001, 0x0040, 0x19c1, 0x2039, 0x0000, 0x2011, - 0x0002, 0x20a9, 0x0100, 0xa08e, 0x0002, 0x0040, 0x19c1, 0x0078, - 0x19df, 0x1078, 0x1758, 0x2d00, 0x2091, 0x8000, 0x682b, 0x0000, - 0x682f, 0x0000, 0x6808, 0xa084, 0xffde, 0x680a, 0x2d00, 0xa080, - 0x0010, 0x2068, 0x2091, 0x8001, 0x0070, 0x19d8, 0x0078, 0x19c4, - 0x8211, 0x0040, 0x19df, 0x20a9, 0x0100, 0x0078, 0x19c4, 0x1078, - 0x173e, 0x007c, 0x78a0, 0xa06d, 0x00c0, 0x19ed, 0x2c00, 0x78a2, - 0x78a6, 0x609b, 0x0000, 0x0078, 0x19f9, 0x2c00, 0x689a, 0x609b, - 0x0000, 0x78a2, 0x2d00, 0x6002, 0x78a4, 0xad06, 0x00c0, 0x19f9, - 0x6002, 0x789c, 0x8001, 0x789e, 0x00c0, 0x1a05, 0x78a8, 0xa084, - 0x0000, 0x78aa, 0x78a4, 0x2060, 0xa006, 0x007c, 0xa02e, 0x2530, - 0x6118, 0xa184, 0x0060, 0x619e, 0x0040, 0x1a12, 0x0e7e, 0x1078, - 0x3199, 0x0e7f, 0x6592, 0x65a2, 0x6696, 0x66a6, 0x60ab, 0x0000, - 0x60af, 0x0000, 0x6710, 0x1078, 0x1758, 0x2091, 0x8000, 0x6808, - 0xa084, 0x0001, 0x0040, 0x1a34, 0x2091, 0x8001, 0x1078, 0x17ad, - 0x2091, 0x8000, 0x1078, 0x18a4, 0x2091, 0x8001, 0x78a3, 0x0000, - 0x78a7, 0x0000, 0x0078, 0x1a80, 0x6020, 0xa096, 0x0001, 0x00c0, - 0x1a3b, 0x8000, 0x6022, 0x6a10, 0x6814, 0x2091, 0x8001, 0xa202, - 0x0048, 0x1a4a, 0x0040, 0x1a4a, 0x2039, 0x0200, 0x1078, 0x1a81, - 0x0078, 0x1a80, 0x2c08, 0x2091, 0x8000, 0x6800, 0xa065, 0x0040, - 0x1a52, 0x6102, 0x6902, 0x00c0, 0x1a56, 0x6906, 0x2160, 0x6003, - 0x0000, 0x6810, 0x8000, 0x6812, 0x78b8, 0x8000, 0x78ba, 0x2091, - 0x8001, 0x6808, 0xa08c, 0x0040, 0x0040, 0x1a76, 0xa086, 0x0040, - 0x680a, 0x1078, 0x17bc, 0x017e, 0x007e, 0x6930, 0x2100, 0x810f, - 0xa105, 0x6832, 0x6934, 0x693a, 0x007f, 0x017f, 0x2091, 0x8000, - 0x1078, 0x1b49, 0x2091, 0x8001, 0x78a7, 0x0000, 0x78a3, 0x0000, - 0x007c, 0x6004, 0xa705, 0x6006, 0x2091, 0x8000, 0x1078, 0x18a4, - 0x2091, 0x8001, 0x78a4, 0xa065, 0x0040, 0x1a94, 0x6098, 0x78a6, - 0x609b, 0x0000, 0x0078, 0x1a84, 0x78a3, 0x0000, 0x78a7, 0x0000, - 0x007c, 0x7970, 0x7874, 0x8000, 0xa10a, 0x00c8, 0x1aa0, 0xa006, - 0x7876, 0x70d2, 0x7804, 0xa005, 0x0040, 0x1aae, 0x8001, 0x7806, - 0x00c0, 0x1aae, 0x0068, 0x1aae, 0x2091, 0x4080, 0x007c, 0x0068, - 0x1ac9, 0x2029, 0x0000, 0x786c, 0xa065, 0x0040, 0x1ac4, 0x1078, - 0x1aca, 0x0040, 0x1ac4, 0x057e, 0x1078, 0x1ae8, 0x057f, 0x00c0, - 0x1ac4, 0x8528, 0x0078, 0x1ab3, 0x85ff, 0x0040, 0x1ac9, 0x2091, - 0x4080, 0x007c, 0x2091, 0x8000, 0x7b84, 0x7988, 0x72d4, 0x0005, - 0x0005, 0x70d4, 0xa206, 0x00c0, 0x1ace, 0x2200, 0xa102, 0x00c0, - 0x1ade, 0x2300, 0x2091, 0x8001, 0xa005, 0x007c, 0x0048, 0x1ae4, - 0xa302, 0x2091, 0x8001, 0x007c, 0x8002, 0x2091, 0x8001, 0x007c, - 0x2091, 0x8000, 0x2071, 0x0020, 0x7004, 0xa005, 0x00c0, 0x1b3f, - 0x7008, 0x7208, 0xa206, 0x00c0, 0x1b3f, 0xa286, 0x0002, 0x00c0, - 0x1b3f, 0x2071, 0x0010, 0xa184, 0xff00, 0x0040, 0x1b08, 0x810f, - 0x810c, 0x810c, 0x8004, 0x8004, 0x8007, 0xa100, 0x0078, 0x1b0b, - 0x8107, 0x8004, 0x8004, 0x7a90, 0x7b8c, 0xa210, 0xa399, 0x0000, - 0x2009, 0x0018, 0x6024, 0xa005, 0x0040, 0x1b18, 0x2009, 0x0040, - 0x1078, 0x16d7, 0x0040, 0x1b31, 0x7894, 0x8000, 0x7896, 0xa086, - 0x0002, 0x00c0, 0x1b3f, 0x2091, 0x8000, 0x78af, 0x0003, 0x7897, - 0x0000, 0x7898, 0xa085, 0x0300, 0x789a, 0x2091, 0x8001, 0x0078, - 0x1b3f, 0x7897, 0x0000, 0x1078, 0x18ce, 0x7984, 0x7888, 0x8000, - 0xa10a, 0x00c8, 0x1b3c, 0xa006, 0x788a, 0x70d6, 0xa006, 0x2071, - 0x0010, 0x2091, 0x8001, 0x007c, 0x2009, 0x3868, 0x2091, 0x8000, - 0x200a, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3840, 0x2104, 0xa086, - 0x0000, 0x00c0, 0x1b62, 0x2009, 0x3812, 0x2104, 0xa005, 0x00c0, - 0x1b62, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1b62, 0x0018, 0x1b62, - 0x781b, 0x0044, 0x0f7f, 0x007c, 0x127e, 0x2091, 0x2300, 0x2071, - 0x3840, 0x2079, 0x0100, 0x2019, 0x305e, 0x20a1, 0x012b, 0x2304, - 0xa005, 0x0040, 0x1b7c, 0x789a, 0x8318, 0x23ac, 0x8318, 0x2398, - 0x53a6, 0x3318, 0x0078, 0x1b6f, 0x789b, 0x0020, 0x20a9, 0x0010, - 0x78af, 0x0000, 0x78af, 0x0220, 0x0070, 0x1b88, 0x0078, 0x1b80, - 0x7003, 0x0000, 0x1078, 0x1c87, 0x7004, 0xa084, 0x000f, 0xa085, - 0x6280, 0x7806, 0x780f, 0x9200, 0x7843, 0x00d8, 0x7853, 0x0080, - 0x780b, 0x0008, 0x7047, 0x387f, 0x7043, 0x0000, 0x127f, 0x2000, - 0x007c, 0xa18c, 0x000f, 0x2011, 0x0101, 0x2204, 0xa084, 0xfff0, - 0xa105, 0x2012, 0x1078, 0x1c87, 0x007c, 0x2011, 0x0101, 0x20a9, - 0x0009, 0x810b, 0x0070, 0x1bb6, 0x0078, 0x1bb1, 0xa18c, 0x0e00, - 0x2204, 0xa084, 0xf1ff, 0xa105, 0x2012, 0x007c, 0x2009, 0x0101, - 0x20a9, 0x0005, 0x8213, 0x0070, 0x1bc7, 0x0078, 0x1bc2, 0xa294, - 0x00e0, 0x2104, 0xa084, 0xff1f, 0xa205, 0x200a, 0x007c, 0x2011, - 0x0101, 0x20a9, 0x000c, 0x810b, 0x0070, 0x1bd8, 0x0078, 0x1bd3, - 0xa18c, 0xf000, 0x2204, 0xa084, 0x0fff, 0xa105, 0x2012, 0x007c, - 0x2011, 0x0102, 0x2204, 0xa084, 0xffcf, 0xa105, 0x2012, 0x007c, - 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, - 0x62ac, 0x63ac, 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, - 0x0c7e, 0x2061, 0x0100, 0x609a, 0x60a4, 0xa084, 0xffdf, 0x60ae, - 0x0c7f, 0x007c, 0x8103, 0x8003, 0xa080, 0x0022, 0x0c7e, 0x2061, - 0x0100, 0x609a, 0x60a4, 0xa085, 0x0020, 0x60ae, 0x0c7f, 0x007c, - 0x8103, 0x8003, 0xa080, 0x0020, 0x0c7e, 0x2061, 0x0100, 0x609a, - 0x60a4, 0x62ae, 0x2010, 0x60a4, 0x63ae, 0x2018, 0x0c7f, 0x007c, - 0x2091, 0x8000, 0x0c7e, 0x0e7e, 0x6818, 0xa005, 0x0040, 0x1c65, - 0x2061, 0x5c00, 0x1078, 0x1c6d, 0x0040, 0x1c53, 0x20a9, 0x0000, - 0x2061, 0x5b00, 0x0c7e, 0x1078, 0x1c6d, 0x0040, 0x1c3f, 0x0c7f, - 0x8c60, 0x0070, 0x1c3d, 0x0078, 0x1c32, 0x0078, 0x1c65, 0x007f, - 0xa082, 0x5b00, 0x2071, 0x3840, 0x70ba, 0x601c, 0xa085, 0x0800, - 0x601e, 0x71b6, 0x60a7, 0x0000, 0x2001, 0x0004, 0x70a2, 0x1078, - 0x1b44, 0x0078, 0x1c61, 0x2071, 0x3840, 0x601c, 0xa085, 0x0800, - 0x601e, 0x71b6, 0x60a7, 0x0000, 0x2001, 0x0006, 0x70a2, 0x1078, - 0x1b44, 0x2001, 0x0000, 0x0078, 0x1c67, 0x2001, 0x0001, 0x2091, - 0x8001, 0xa005, 0x0e7f, 0x0c7f, 0x007c, 0x2c04, 0xa005, 0x0040, - 0x1c84, 0x2060, 0x600c, 0xa306, 0x00c0, 0x1c81, 0x6008, 0xa206, - 0x00c0, 0x1c81, 0x6010, 0xa106, 0x00c0, 0x1c81, 0xa006, 0x0078, - 0x1c86, 0x6000, 0x0078, 0x1c6e, 0xa085, 0x0001, 0x007c, 0x2011, - 0x3841, 0x220c, 0xa18c, 0x000f, 0x2011, 0x013b, 0x2204, 0xa084, - 0x0100, 0x0040, 0x1c96, 0x2021, 0xff00, 0x2122, 0x007c, 0x0e7e, - 0x68e4, 0xa08c, 0x0020, 0x0040, 0x1ce5, 0xa084, 0x0006, 0x00c0, - 0x1ce5, 0x6010, 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, - 0xa0f0, 0x3a80, 0x7004, 0xa084, 0x000a, 0x00c0, 0x1ce5, 0x7108, - 0xa194, 0xff00, 0x0040, 0x1ce5, 0xa18c, 0x00ff, 0x7104, 0xa084, - 0x0014, 0x00c0, 0x1cd2, 0x017e, 0x611c, 0xa18d, 0x0002, 0x611e, - 0x017f, 0xa085, 0x0014, 0x7006, 0x2001, 0x000c, 0xa106, 0x0040, - 0x1cce, 0x2100, 0x8003, 0x2008, 0x0078, 0x1ce2, 0x2009, 0x0019, - 0x0078, 0x1ce2, 0x2011, 0x0000, 0x7000, 0xa084, 0xdfff, 0x7002, - 0x7004, 0xa084, 0xffef, 0x7006, 0x017e, 0x611c, 0xa18d, 0x0002, - 0x611e, 0x017f, 0x2100, 0xa205, 0x700a, 0x0e7f, 0x007c, 0x0068, - 0x1ce7, 0x007e, 0x2071, 0x0000, 0x7018, 0xa084, 0x0001, 0x00c0, - 0x1cec, 0x007f, 0x2e08, 0x2071, 0x0010, 0x70ca, 0x007f, 0x70c6, - 0x70c3, 0x8002, 0x2071, 0x0000, 0x701b, 0x0001, 0x2091, 0x4080, - 0x007f, 0x2070, 0x007f, 0x0078, 0x1d03, 0x107e, 0x007e, 0x127e, - 0x2091, 0x2300, 0x7f3c, 0x7e58, 0x7c30, 0x7d38, 0xa594, 0x003f, - 0xa484, 0x4000, 0x0040, 0x1d1a, 0xa784, 0x007c, 0x00c0, 0x3022, - 0x1078, 0x1ce7, 0xa49c, 0x000f, 0xa382, 0x0004, 0x0050, 0x1d22, - 0x1078, 0x1ce7, 0x8507, 0xa084, 0x000f, 0x0079, 0x1d27, 0x21a1, - 0x2251, 0x2277, 0x24cf, 0x2787, 0x27cf, 0x2808, 0x2883, 0x28dd, - 0x2962, 0x1d4d, 0x1d37, 0x1fb8, 0x208d, 0x2766, 0x1d37, 0x1078, - 0x1ce7, 0x0018, 0x1d0a, 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, - 0x007c, 0x7003, 0x0000, 0x703f, 0x0000, 0x7030, 0xa005, 0x0040, - 0x1d4b, 0x7033, 0x0000, 0x0018, 0x1d0a, 0x705c, 0xa005, 0x00c0, - 0x1df8, 0x70a0, 0xa084, 0x001f, 0x0079, 0x1d56, 0x1e18, 0x1d5e, - 0x1d6c, 0x1d8d, 0x1db3, 0x1ddf, 0x1ddd, 0x1d5e, 0x7808, 0xa084, - 0xfffd, 0x780a, 0x2009, 0x0046, 0x1078, 0x260f, 0x00c0, 0x1d6a, - 0x7003, 0x0004, 0x0078, 0x1d39, 0x1078, 0x2fe4, 0x00c0, 0x1d8b, - 0x70b4, 0x8007, 0x789b, 0x007e, 0x78aa, 0x789b, 0x0010, 0x78ab, - 0x000c, 0x789b, 0x0060, 0x78ab, 0x0001, 0x785b, 0x0004, 0x2009, - 0x00f7, 0x1078, 0x260d, 0x00c0, 0x1d8b, 0x7003, 0x0004, 0x70c3, - 0x000f, 0x7033, 0x3870, 0x0078, 0x1d39, 0x1078, 0x2fe4, 0x00c0, - 0x1db1, 0x71b4, 0x8107, 0x789b, 0x007e, 0x78aa, 0x789b, 0x0010, - 0xa18c, 0x0007, 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0006, 0x789b, - 0x0060, 0x78ab, 0x0002, 0x785b, 0x0004, 0x2009, 0x00f7, 0x1078, - 0x260d, 0x00c0, 0x1db1, 0x7003, 0x0004, 0x70c3, 0x000f, 0x7033, - 0x3870, 0x0078, 0x1d39, 0x1078, 0x2fe4, 0x00c0, 0x1ddb, 0x71b4, - 0x8107, 0x789b, 0x007e, 0x78aa, 0x789b, 0x0010, 0xa18c, 0x0007, - 0xa18d, 0x00c0, 0x79aa, 0x78ab, 0x0020, 0x71b8, 0x79aa, 0x78ab, - 0x000d, 0x789b, 0x0060, 0x78ab, 0x0004, 0x785b, 0x0004, 0x2009, - 0x00f7, 0x1078, 0x260d, 0x00c0, 0x1ddb, 0x7003, 0x0004, 0x70c3, - 0x000f, 0x7033, 0x3870, 0x0078, 0x1d39, 0x0078, 0x1d8d, 0x1078, - 0x2fe4, 0x00c0, 0x1d39, 0x70bc, 0x2068, 0x789b, 0x0010, 0x6f10, - 0x1078, 0x2f11, 0x2c50, 0x6810, 0xa084, 0x001f, 0xa085, 0x0080, - 0x78aa, 0x6e18, 0x2041, 0x0001, 0x2001, 0x0004, 0x0078, 0x1f41, - 0x1078, 0x2fe4, 0x00c0, 0x1d39, 0x789b, 0x0010, 0x705c, 0x2068, - 0x6f10, 0x1078, 0x2f11, 0x2c50, 0x6008, 0xa085, 0x0010, 0x600a, - 0x6810, 0xa084, 0x001f, 0xa085, 0x0080, 0x78aa, 0x2031, 0x0020, - 0x2041, 0x0001, 0x1078, 0x304b, 0x2001, 0x0003, 0x0078, 0x1f2c, - 0x0018, 0x1d0a, 0x7440, 0xa485, 0x0000, 0x0040, 0x1e32, 0xa080, - 0x3880, 0x2030, 0x7144, 0x8108, 0xa12a, 0x0048, 0x1e29, 0x2009, - 0x3880, 0x2164, 0x6504, 0x85ff, 0x00c0, 0x1e3f, 0x8421, 0x00c0, - 0x1e23, 0x7146, 0x7003, 0x0000, 0x703f, 0x0000, 0x0078, 0x1d39, - 0x7640, 0xa6b0, 0x3880, 0x7144, 0x2600, 0x0078, 0x1e2e, 0x7146, - 0x2568, 0x2558, 0x753e, 0x2c50, 0x603c, 0xa085, 0x0000, 0x00c0, - 0x1e3c, 0x6708, 0x7736, 0xa784, 0x033f, 0x0040, 0x1e75, 0xa784, - 0x0021, 0x00c0, 0x1e3c, 0xa784, 0x0002, 0x0040, 0x1e5e, 0xa784, - 0x0004, 0x0040, 0x1e3c, 0xa7bc, 0xfffb, 0x670a, 0xa784, 0x0008, - 0x00c0, 0x1e3c, 0xa784, 0x0010, 0x00c0, 0x1e3c, 0xa184, 0x0200, - 0x00c0, 0x1e3c, 0xa784, 0x0100, 0x0040, 0x1e75, 0x6018, 0xa005, - 0x00c0, 0x1e3c, 0xa7bc, 0xfeff, 0x670a, 0x681f, 0x0000, 0x6e18, - 0xa684, 0x000e, 0x6118, 0x0040, 0x1e85, 0x601c, 0xa102, 0x0048, - 0x1e92, 0x0040, 0x1e92, 0x0078, 0x1e38, 0x81ff, 0x0040, 0x1e92, - 0x6828, 0x8007, 0xa084, 0x00ff, 0xa082, 0x0003, 0x0040, 0x1e92, - 0x00c0, 0x1e38, 0xa184, 0x0400, 0x00c0, 0x1ea1, 0x6130, 0xa18c, - 0xff00, 0x810f, 0x6030, 0xa084, 0xff00, 0xa105, 0x6032, 0x0078, - 0x1ea5, 0x6034, 0x603a, 0xa7bc, 0xfbff, 0xa784, 0x0080, 0x00c0, - 0x1eab, 0x700c, 0x6022, 0xa7bc, 0xff7f, 0x670a, 0x6b10, 0x8307, - 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3a80, 0x2060, - 0x2048, 0x704a, 0x6000, 0x704e, 0x6004, 0x7052, 0x2a60, 0x0018, - 0x1d0a, 0x789b, 0x0010, 0xa046, 0x1078, 0x2fe4, 0x00c0, 0x1d39, - 0x6b10, 0xa39c, 0x001f, 0xa39d, 0x00c0, 0x704c, 0xa084, 0x8000, - 0x0040, 0x1ed6, 0xa684, 0x0001, 0x0040, 0x1ed8, 0xa39c, 0xffbf, - 0xa684, 0x0010, 0x0040, 0x1ede, 0xa39d, 0x0020, 0x7baa, 0x8840, - 0xa684, 0x000e, 0x00c0, 0x1ee9, 0xa7bd, 0x0010, 0x670a, 0x0078, - 0x1f2a, 0x714c, 0xa18c, 0x0800, 0x0040, 0x2b74, 0x2011, 0x0021, - 0x8004, 0x8004, 0x0048, 0x1f00, 0x2011, 0x0022, 0x8004, 0x0048, - 0x1f00, 0x2011, 0x0020, 0x8004, 0x0048, 0x1f00, 0x0040, 0x1f2a, - 0x7aaa, 0x8840, 0x1078, 0x2ffd, 0x6a10, 0x610c, 0x8108, 0xa18c, - 0x00ff, 0xa1e0, 0x5b00, 0x2c64, 0x8cff, 0x0040, 0x1f21, 0x6010, - 0xa206, 0x00c0, 0x1f0b, 0x60b4, 0x8001, 0x60b6, 0x00c0, 0x1f06, - 0x0c7e, 0x2a60, 0x6008, 0xa085, 0x0100, 0x600a, 0x0c7f, 0x0078, - 0x1e18, 0x1078, 0x2fe4, 0x00c0, 0x1d39, 0x2a60, 0x610e, 0x79aa, - 0x8840, 0x712e, 0x2001, 0x0001, 0x007e, 0x7150, 0xa184, 0x0018, - 0x0040, 0x1f40, 0xa184, 0x0010, 0x0040, 0x1f3a, 0x1078, 0x2d3d, - 0x00c0, 0x1f40, 0xa184, 0x0008, 0x0040, 0x1f40, 0x1078, 0x2c58, - 0x007f, 0x7002, 0xa68c, 0x0060, 0x88ff, 0x0040, 0x1f49, 0xa18d, - 0x0004, 0x795a, 0x69b2, 0x789b, 0x0060, 0x2800, 0x78aa, 0x789b, - 0x0061, 0x6814, 0xa085, 0x8000, 0x6816, 0x78aa, 0x157e, 0x137e, - 0x147e, 0x20a1, 0x012c, 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, - 0x000a, 0x2098, 0x53a6, 0x147f, 0x137f, 0x157f, 0x6810, 0x8007, - 0x789b, 0x007e, 0x78aa, 0x6d90, 0x7dd6, 0x7dde, 0x6e94, 0x7ed2, - 0x7eda, 0x7830, 0xa084, 0x00c0, 0x00c0, 0x1f78, 0x0098, 0x1f80, - 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2ffd, 0x0078, 0x1d41, - 0x7200, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1f8d, 0x781b, - 0x0049, 0x1078, 0x2ffd, 0x0078, 0x1f9e, 0x6ab0, 0xa295, 0x2000, - 0x7a5a, 0x781b, 0x0049, 0x1078, 0x2ffd, 0x7200, 0x2500, 0xa605, - 0x0040, 0x1f9e, 0xa284, 0x0007, 0x1079, 0x1fae, 0xad80, 0x0008, - 0x7032, 0xa284, 0x0007, 0xa086, 0x0001, 0x00c0, 0x1fac, 0x6018, - 0x8000, 0x601a, 0x1078, 0x2b4b, 0x0078, 0x1d39, 0x1fb6, 0x3376, - 0x3376, 0x3365, 0x3376, 0x1fb6, 0x1fb6, 0x1fb6, 0x1078, 0x1ce7, - 0x7808, 0xa084, 0xfffd, 0x780a, 0x0f7e, 0x2079, 0x3800, 0x7898, - 0x0f7f, 0xa084, 0x0001, 0x0040, 0x1fde, 0x70a0, 0xa086, 0x0001, - 0x00c0, 0x1fcd, 0x70a2, 0x0078, 0x2071, 0x70a0, 0xa086, 0x0005, - 0x00c0, 0x1fdc, 0x70bc, 0x2068, 0x6817, 0x0004, 0x6813, 0x0000, - 0x681c, 0xa085, 0x0008, 0x681e, 0x70a3, 0x0000, 0x157e, 0x2011, - 0x0004, 0x71a0, 0xa186, 0x0001, 0x0040, 0x2000, 0xa186, 0x0007, - 0x00c0, 0x1ff0, 0x2009, 0x382b, 0x200b, 0x0005, 0x0078, 0x2000, - 0x2009, 0x3813, 0x2104, 0x2009, 0x3812, 0x200a, 0x2009, 0x382b, - 0x200b, 0x0001, 0x70a3, 0x0000, 0x70a7, 0x0001, 0x0078, 0x2002, - 0x70a3, 0x0000, 0x1078, 0x314d, 0x20a9, 0x0010, 0x2039, 0x0000, - 0x1078, 0x2e16, 0xa7b8, 0x0100, 0x0070, 0x2010, 0x0078, 0x2008, - 0x7000, 0x2020, 0x0079, 0x2014, 0x2042, 0x202b, 0x202b, 0x201e, - 0x2042, 0x2042, 0x201c, 0x201c, 0x1078, 0x1ce7, 0x2021, 0x3857, - 0x2404, 0xa005, 0x0040, 0x202b, 0xad06, 0x00c0, 0x202b, 0x6800, - 0x2022, 0x0078, 0x203b, 0x681c, 0xa084, 0x0001, 0x00c0, 0x2037, - 0x6f10, 0x1078, 0x2f11, 0x1078, 0x2b06, 0x0078, 0x203b, 0x7054, - 0x2060, 0x6800, 0x6002, 0x6a16, 0x681c, 0xa085, 0x0008, 0x681e, - 0x1078, 0x18b6, 0x2021, 0x5c00, 0x1078, 0x2077, 0x2021, 0x3857, - 0x1078, 0x2077, 0x20a9, 0x0000, 0x2021, 0x5b00, 0x1078, 0x2077, - 0x8420, 0x0070, 0x2055, 0x0078, 0x204e, 0x1078, 0x2b55, 0x2061, - 0x3b00, 0x2021, 0x0002, 0x20a9, 0x0100, 0x6018, 0x6110, 0xa102, - 0x6012, 0x601b, 0x0000, 0xace0, 0x0010, 0x0070, 0x2069, 0x0078, - 0x205d, 0x2009, 0x382f, 0x200b, 0x0000, 0x8421, 0x00c0, 0x205b, - 0x157f, 0x7003, 0x0000, 0x703f, 0x0000, 0x0078, 0x1d39, 0x047e, - 0x2404, 0xa005, 0x0040, 0x2089, 0x2068, 0x6800, 0x007e, 0x6a16, - 0x681c, 0xa085, 0x0008, 0x681e, 0x1078, 0x18b6, 0x007f, 0x0078, - 0x2079, 0x047f, 0x2023, 0x0000, 0x007c, 0xa282, 0x0003, 0x0050, - 0x2093, 0x1078, 0x1ce7, 0x2300, 0x0079, 0x2096, 0x2099, 0x210c, - 0x211a, 0xa282, 0x0002, 0x0040, 0x209f, 0x1078, 0x1ce7, 0x70a0, - 0x70a3, 0x0000, 0x70c3, 0x0000, 0x0079, 0x20a6, 0x20ae, 0x20ae, - 0x20b0, 0x20e4, 0x2b7a, 0x20ae, 0x20e4, 0x20ae, 0x1078, 0x1ce7, - 0x77b4, 0x1078, 0x2e16, 0x77b4, 0xa7bc, 0x0f00, 0x1078, 0x2f11, - 0x6018, 0xa005, 0x0040, 0x20db, 0x2021, 0x5c00, 0x2009, 0x0004, - 0x2011, 0x0010, 0x1078, 0x216a, 0x0040, 0x20db, 0x157e, 0x20a9, - 0x0000, 0x2021, 0x5b00, 0x047e, 0x2009, 0x0004, 0x2011, 0x0010, - 0x1078, 0x216a, 0x047f, 0x0040, 0x20da, 0x8420, 0x0070, 0x20da, - 0x0078, 0x20cb, 0x157f, 0x8738, 0xa784, 0x001f, 0x00c0, 0x20b6, - 0x0078, 0x1d41, 0x0078, 0x1d41, 0x77b4, 0x1078, 0x2f11, 0x6018, - 0xa005, 0x0040, 0x210a, 0x2021, 0x5c00, 0x2009, 0x0005, 0x2011, - 0x0020, 0x1078, 0x216a, 0x0040, 0x210a, 0x157e, 0x20a9, 0x0000, - 0x2021, 0x5b00, 0x047e, 0x2009, 0x0005, 0x2011, 0x0020, 0x1078, - 0x216a, 0x047f, 0x0040, 0x2109, 0x8420, 0x0070, 0x2109, 0x0078, - 0x20fa, 0x157f, 0x0078, 0x1d41, 0x2200, 0x0079, 0x210f, 0x2112, - 0x2114, 0x2114, 0x1078, 0x1ce7, 0x70a3, 0x0000, 0x70a7, 0x0001, - 0x0078, 0x1d39, 0x2200, 0x0079, 0x211d, 0x2122, 0x2114, 0x2120, - 0x1078, 0x1ce7, 0x1078, 0x261c, 0x70a0, 0xa086, 0x0002, 0x00c0, - 0x2159, 0x77b4, 0x1078, 0x2e16, 0x77b4, 0xa7bc, 0x0f00, 0x1078, - 0x2f11, 0x6018, 0xa005, 0x0040, 0x2154, 0x2021, 0x5c00, 0x2009, - 0x0005, 0x2011, 0x0020, 0x1078, 0x216a, 0x0040, 0x2154, 0x157e, - 0x20a9, 0x0000, 0x2021, 0x5b00, 0x047e, 0x2009, 0x0005, 0x2011, - 0x0020, 0x1078, 0x216a, 0x047f, 0x0040, 0x2153, 0x8420, 0x0070, - 0x2153, 0x0078, 0x2144, 0x157f, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x212f, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2acd, 0x1078, 0x2b1e, - 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2ac0, 0x0040, 0x2acd, - 0x0078, 0x1e18, 0x2404, 0xa005, 0x0040, 0x219d, 0x2068, 0x2d04, - 0x007e, 0x6810, 0xa706, 0x0040, 0x2179, 0x2d20, 0x007f, 0x0078, - 0x216b, 0x007f, 0x2022, 0x6916, 0x6814, 0xa086, 0x0050, 0x00c0, - 0x218c, 0x6817, 0x0006, 0x2200, 0xa086, 0x0010, 0x00c0, 0x218c, - 0x681c, 0xa084, 0xffef, 0x681e, 0x681c, 0xa205, 0x681e, 0x1078, - 0x18b6, 0x1078, 0x2b27, 0x6010, 0x8001, 0x6012, 0x6008, 0xa084, - 0xffef, 0x600a, 0x1078, 0x2b1e, 0x007c, 0xa085, 0x0001, 0x0078, - 0x219c, 0x2300, 0x0079, 0x21a4, 0x21a9, 0x21a7, 0x21ec, 0x1078, - 0x1ce7, 0x78e4, 0xa005, 0x00d0, 0x21cc, 0x0018, 0x21cc, 0x2008, - 0xa084, 0x0030, 0x00c0, 0x21b8, 0x781b, 0x0049, 0x0078, 0x1d39, - 0x78ec, 0xa084, 0x0003, 0x0040, 0x21b4, 0x2100, 0xa084, 0x0007, - 0x0079, 0x21c2, 0x21da, 0x21e0, 0x21d4, 0x21ca, 0x2fde, 0x2fde, - 0x21ca, 0x21e6, 0x1078, 0x1ce7, 0x7000, 0xa005, 0x0040, 0x1d41, - 0x2001, 0x0003, 0x0078, 0x24e3, 0x1078, 0x2df9, 0x781b, 0x0055, - 0x0078, 0x1d39, 0x1078, 0x2df9, 0x781b, 0x00dc, 0x0078, 0x1d39, - 0x1078, 0x2df9, 0x781b, 0x00e3, 0x0078, 0x1d39, 0x1078, 0x2df9, - 0x781b, 0x009d, 0x0078, 0x1d39, 0xa584, 0x000f, 0x00c0, 0x2216, - 0x1078, 0x261c, 0x7000, 0x0079, 0x21f5, 0x21fd, 0x220a, 0x21fd, - 0x2acd, 0x21ff, 0x2acd, 0x21fd, 0x21fd, 0x1078, 0x1ce7, 0x71a0, - 0x70a3, 0x0000, 0xa186, 0x0004, 0x00c0, 0x2208, 0x0078, 0x2b7a, - 0x0078, 0x2acd, 0x1078, 0x2b1e, 0x6008, 0xa084, 0xffef, 0x600a, - 0x1078, 0x2ac0, 0x0040, 0x2acd, 0x0078, 0x1e18, 0x78e4, 0xa005, - 0x00d0, 0x21cc, 0x0018, 0x21cc, 0x2008, 0xa084, 0x0030, 0x00c0, - 0x2225, 0x781b, 0x0049, 0x0078, 0x1d39, 0x78ec, 0xa084, 0x0003, - 0x0040, 0x2221, 0x2100, 0xa184, 0x0007, 0x0079, 0x222f, 0x223f, - 0x2245, 0x2239, 0x2237, 0x2fde, 0x2fde, 0x2237, 0x2fd6, 0x1078, - 0x1ce7, 0x1078, 0x2e01, 0x781b, 0x0055, 0x0078, 0x1d39, 0x1078, - 0x2e01, 0x781b, 0x00dc, 0x0078, 0x1d39, 0x1078, 0x2e01, 0x781b, - 0x00e3, 0x0078, 0x1d39, 0x1078, 0x2e01, 0x781b, 0x009d, 0x0078, - 0x1d39, 0x2300, 0x0079, 0x2254, 0x2259, 0x2257, 0x225b, 0x1078, - 0x1ce7, 0x0078, 0x2883, 0x6817, 0x0008, 0x78a3, 0x0000, 0x79e4, - 0xa184, 0x0030, 0x0040, 0x2883, 0x78ec, 0xa084, 0x0003, 0x0040, - 0x2883, 0xa184, 0x0007, 0x0079, 0x226d, 0x21da, 0x21e0, 0x21d4, - 0x2fb6, 0x2fde, 0x2fde, 0x2275, 0x2fd6, 0x1078, 0x1ce7, 0xa282, - 0x0005, 0x0050, 0x227d, 0x1078, 0x1ce7, 0x2300, 0x0079, 0x2280, - 0x2283, 0x24b7, 0x24c3, 0x2200, 0x0079, 0x2286, 0x228b, 0x228d, - 0x22a0, 0x228b, 0x249c, 0x1078, 0x1ce7, 0x789b, 0x0018, 0x78a8, - 0xa084, 0x00ff, 0xa082, 0x0020, 0x0048, 0x2dda, 0xa08a, 0x0004, - 0x00c8, 0x2dda, 0x0079, 0x229c, 0x2dda, 0x2dda, 0x2dda, 0x2d7c, - 0x789b, 0x0018, 0x79a8, 0xa184, 0x0080, 0x0040, 0x22b5, 0xa184, - 0x0018, 0x0040, 0x22b1, 0x0078, 0x2dda, 0x7000, 0xa005, 0x00c0, - 0x22ab, 0x2011, 0x0003, 0x0078, 0x2970, 0xa184, 0x00ff, 0xa08c, - 0x0080, 0x0040, 0x22e9, 0x7000, 0xa086, 0x0001, 0x00c0, 0x22c8, - 0x1078, 0x2b1e, 0x1078, 0x314d, 0x7034, 0x600a, 0x0078, 0x22cd, - 0x7000, 0xa086, 0x0003, 0x0040, 0x22c2, 0x7003, 0x0005, 0x2001, - 0x5c10, 0x2068, 0x703e, 0x7032, 0x157e, 0x20a9, 0x002f, 0x2003, - 0x0000, 0x8000, 0x0070, 0x22de, 0x0078, 0x22d7, 0x157f, 0x6813, - 0x0000, 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823, 0x0003, 0x0078, - 0x2dda, 0xa08a, 0x0010, 0x00c8, 0x2dda, 0x0079, 0x22ef, 0x2301, - 0x22ff, 0x2317, 0x2319, 0x23ab, 0x2dda, 0x2dda, 0x23ad, 0x2dda, - 0x2dda, 0x2498, 0x2498, 0x2dda, 0x2dda, 0x2dda, 0x249a, 0x1078, - 0x1ce7, 0xa684, 0x1000, 0x0040, 0x230e, 0x2001, 0x0300, 0x8000, - 0x8000, 0x783a, 0x781b, 0x009a, 0x0078, 0x1d39, 0x6814, 0xa084, - 0x8000, 0x0040, 0x2315, 0x6817, 0x0003, 0x0078, 0x2fb6, 0x1078, - 0x1ce7, 0x691c, 0x691e, 0xa684, 0x1800, 0x00c0, 0x2333, 0x681c, - 0xa084, 0x0001, 0x00c0, 0x233b, 0x6814, 0xa086, 0x0008, 0x00c0, - 0x232b, 0x6817, 0x0000, 0xa684, 0x0400, 0x0040, 0x23a7, 0x781b, - 0x0058, 0x0078, 0x1d39, 0xa684, 0x1000, 0x0040, 0x233b, 0x781b, - 0x0058, 0x0078, 0x1d39, 0xa684, 0x0060, 0x0040, 0x23a3, 0xa684, - 0x0800, 0x0040, 0x23a3, 0xa684, 0x8000, 0x00c0, 0x2349, 0x0078, - 0x2363, 0xa6b4, 0x7fff, 0x7e5a, 0x6eb2, 0x789b, 0x0074, 0x7aac, - 0x79ac, 0x78ac, 0x801b, 0x00c8, 0x2356, 0x8000, 0xa084, 0x003f, - 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, 0xa302, 0x68ae, 0x6b90, - 0x2200, 0xa303, 0x68aa, 0xa684, 0x4000, 0x0040, 0x236b, 0xa6b4, - 0xbfff, 0x7e5a, 0x6eb2, 0x7000, 0xa086, 0x0003, 0x00c0, 0x2378, - 0x1078, 0x31c0, 0x1078, 0x3365, 0x781b, 0x0067, 0x0078, 0x1d39, - 0xa006, 0x1078, 0x3414, 0x6aac, 0x69a8, 0x6c94, 0x6b90, 0x2200, - 0xa105, 0x0040, 0x2387, 0x2200, 0xa422, 0x2100, 0xa31b, 0x7cd2, - 0x7bd6, 0x2300, 0xa405, 0x00c0, 0x2395, 0xa6b5, 0x4000, 0x7e5a, - 0x6eb2, 0x781b, 0x0067, 0x0078, 0x1d39, 0x781b, 0x0067, 0x2200, - 0xa115, 0x00c0, 0x239f, 0x1078, 0x3376, 0x0078, 0x1d39, 0x1078, - 0x339d, 0x0078, 0x1d39, 0x781b, 0x006a, 0x0078, 0x1d39, 0x781b, - 0x0058, 0x0078, 0x1d39, 0x1078, 0x1ce7, 0x0078, 0x240a, 0x691c, - 0xa184, 0x0100, 0x0040, 0x23c5, 0xa18c, 0xfeff, 0x691e, 0x0c7e, - 0x7048, 0x2060, 0x6000, 0xa084, 0xefff, 0x6002, 0x6004, 0xa084, - 0xfff5, 0x6006, 0x0c7f, 0x0078, 0x23f9, 0xa184, 0x0200, 0x0040, - 0x23f9, 0xa18c, 0xfdff, 0x691e, 0x0c7e, 0x7048, 0x2060, 0x6000, - 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef, 0x6006, 0x2008, - 0x2c48, 0x0c7f, 0xa184, 0x0008, 0x0040, 0x23f9, 0x1078, 0x2f0d, - 0x1078, 0x2c58, 0x88ff, 0x0040, 0x23f9, 0x789b, 0x0060, 0x2800, - 0x78aa, 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, - 0x23f5, 0x781b, 0x0055, 0x0078, 0x1d39, 0x781b, 0x0069, 0x0078, - 0x1d39, 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2402, 0x781b, 0x0058, - 0x0078, 0x1d39, 0x781b, 0x006a, 0x0078, 0x1d39, 0x0078, 0x2de0, - 0x0078, 0x2de0, 0x2019, 0x0000, 0x7990, 0xa18c, 0x0007, 0x0040, - 0x2408, 0x789b, 0x0010, 0x78a8, 0xa094, 0x00ff, 0xa286, 0x0001, - 0x00c0, 0x242d, 0x2300, 0x7ca8, 0xa400, 0x2018, 0xa102, 0x0040, - 0x2425, 0x0048, 0x2425, 0x0078, 0x2427, 0x0078, 0x23af, 0x24a8, - 0x7aa8, 0x00f0, 0x2427, 0x0078, 0x2413, 0xa284, 0x00f0, 0xa086, - 0x0020, 0x00c0, 0x2489, 0x8318, 0x8318, 0x2300, 0xa102, 0x0040, - 0x243d, 0x0048, 0x243d, 0x0078, 0x2486, 0xa286, 0x0023, 0x0040, - 0x2408, 0x6818, 0xa084, 0xfff1, 0x681a, 0x7e58, 0xa684, 0xfff1, - 0xa085, 0x0010, 0x2030, 0x7e5a, 0x6008, 0xa085, 0x0010, 0x600a, - 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, 0xa184, - 0x0010, 0x0040, 0x2461, 0x1078, 0x2f0d, 0x1078, 0x2d3d, 0x0078, - 0x2470, 0x0c7e, 0x7048, 0x2060, 0x6004, 0x2008, 0x2c48, 0x0c7f, - 0xa184, 0x0008, 0x0040, 0x23f9, 0x1078, 0x2f0d, 0x1078, 0x2c58, - 0x88ff, 0x0040, 0x23f9, 0x789b, 0x0060, 0x2800, 0x78aa, 0xa6b5, - 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2482, 0x781b, 0x0055, - 0x0078, 0x1d39, 0x781b, 0x0069, 0x0078, 0x1d39, 0x7aa8, 0x0078, - 0x2413, 0x8318, 0x2300, 0xa102, 0x0040, 0x2492, 0x0048, 0x2492, - 0x0078, 0x2413, 0xa284, 0x0080, 0x00c0, 0x2de6, 0x0078, 0x2de0, - 0x0078, 0x2de6, 0x0078, 0x2dda, 0x789b, 0x0018, 0x78a8, 0xa084, - 0x00ff, 0xa08e, 0x0001, 0x0040, 0x24a7, 0x1078, 0x1ce7, 0x7aa8, - 0xa294, 0x00ff, 0x78a8, 0xa084, 0x00ff, 0xa08a, 0x0004, 0x00c8, - 0x2dda, 0x0079, 0x24b3, 0x2dda, 0x2bab, 0x2dda, 0x2cd8, 0xa282, - 0x0000, 0x00c0, 0x24bd, 0x1078, 0x1ce7, 0x1078, 0x2df9, 0x781b, - 0x0069, 0x0078, 0x1d39, 0xa282, 0x0003, 0x00c0, 0x24c9, 0x1078, - 0x1ce7, 0x1078, 0x2e09, 0x781b, 0x0069, 0x0078, 0x1d39, 0xa282, - 0x0004, 0x0050, 0x24d5, 0x1078, 0x1ce7, 0x2300, 0x0079, 0x24d8, - 0x24db, 0x25c6, 0x25f7, 0xa286, 0x0003, 0x0040, 0x24e1, 0x1078, - 0x1ce7, 0x2001, 0x0000, 0x703a, 0x7000, 0xa084, 0x0007, 0x0079, - 0x24e9, 0x24f1, 0x24f3, 0x24f3, 0x2703, 0x274c, 0x26cd, 0x24f1, - 0x24f1, 0x1078, 0x1ce7, 0xa684, 0x1000, 0x00c0, 0x24fb, 0x1078, - 0x314d, 0x0040, 0x25a0, 0x7868, 0xa08c, 0x00ff, 0x0040, 0x2557, - 0xa186, 0x0008, 0x00c0, 0x2512, 0x6008, 0xa084, 0xffef, 0x600a, - 0x1078, 0x2ac0, 0x0040, 0x2557, 0x1078, 0x2b1e, 0x1078, 0x314d, - 0x0078, 0x253e, 0xa186, 0x0028, 0x00c0, 0x2557, 0x1078, 0x314d, - 0x6008, 0xa084, 0xffef, 0x600a, 0x1078, 0x2b34, 0x6018, 0xa005, - 0x0040, 0x253e, 0x8001, 0x601a, 0xa005, 0x0040, 0x2534, 0x8001, - 0xa005, 0x0040, 0x2534, 0x601e, 0x0078, 0x253e, 0x6813, 0x0028, - 0x6817, 0x0000, 0x0078, 0x25b5, 0x6030, 0xa084, 0x00ff, 0xa005, - 0x0040, 0x252e, 0x6008, 0xa085, 0x0200, 0x600a, 0x681c, 0xa084, - 0x0001, 0x0040, 0x1d41, 0x681c, 0xa084, 0xfffe, 0x681e, 0x7054, - 0x0c7e, 0x2060, 0x6800, 0x6002, 0x0c7f, 0x6004, 0x6802, 0xa005, - 0x2d00, 0x00c0, 0x2554, 0x6002, 0x6006, 0x0078, 0x1d41, 0x017e, - 0x1078, 0x261c, 0x017f, 0xa684, 0xdf00, 0x681a, 0x6827, 0x0000, - 0x6f10, 0x81ff, 0x0040, 0x25a0, 0xa186, 0x0002, 0x00c0, 0x2598, - 0xa684, 0x0800, 0x00c0, 0x2574, 0xa684, 0x0060, 0x0040, 0x2574, - 0x78d8, 0x7adc, 0x682e, 0x6a2a, 0x8717, 0xa294, 0x000f, 0x8213, - 0x8213, 0x8213, 0xa290, 0x3a80, 0xa290, 0x0000, 0x221c, 0xa384, - 0x0100, 0x00c0, 0x2585, 0x0078, 0x258b, 0x8210, 0x2204, 0xa085, - 0x0018, 0x2012, 0x8211, 0xa384, 0x0400, 0x0040, 0x2598, 0x689c, - 0xa084, 0x0100, 0x00c0, 0x2598, 0x1078, 0x268c, 0x0078, 0x1d41, - 0xa186, 0x0018, 0x0040, 0x25a0, 0xa186, 0x0014, 0x0040, 0x1d41, - 0x6912, 0x6814, 0xa084, 0x8000, 0x0040, 0x25a8, 0x7038, 0x6816, - 0xa68c, 0xdf00, 0x691a, 0x1078, 0x2b0d, 0x1078, 0x2b1e, 0x00c0, - 0x25b5, 0x6008, 0xa084, 0xffef, 0x600a, 0x681c, 0xa084, 0x0001, - 0x00c0, 0x25be, 0x1078, 0x2b06, 0x0078, 0x25c2, 0x7054, 0x2060, - 0x6800, 0x6002, 0x1078, 0x18b6, 0x0078, 0x1d41, 0xa282, 0x0004, - 0x0048, 0x25cc, 0x1078, 0x1ce7, 0x2200, 0x0079, 0x25cf, 0x25d3, - 0x25d5, 0x25e2, 0x25d5, 0x1078, 0x1ce7, 0x7000, 0xa086, 0x0005, - 0x0040, 0x25de, 0x1078, 0x2df9, 0x781b, 0x0069, 0x781b, 0x006a, - 0x0078, 0x1d39, 0x7890, 0x8007, 0x8001, 0xa084, 0x0007, 0xa080, - 0x0018, 0x789a, 0x79a8, 0xa18c, 0x00ff, 0xa186, 0x0003, 0x0040, - 0x25f3, 0x0078, 0x2dda, 0x781b, 0x006a, 0x0078, 0x1d39, 0x681c, - 0xa085, 0x0004, 0x681e, 0x82ff, 0x00c0, 0x2602, 0x1078, 0x2df9, - 0x0078, 0x2609, 0x8211, 0x0040, 0x2607, 0x1078, 0x1ce7, 0x1078, - 0x2e09, 0x781b, 0x0069, 0x0078, 0x1d39, 0x1078, 0x2ffd, 0x7830, - 0xa084, 0x00c0, 0x00c0, 0x2619, 0x0018, 0x2619, 0x791a, 0xa006, - 0x007c, 0xa085, 0x0001, 0x007c, 0xa684, 0x0060, 0x00c0, 0x2626, - 0x682f, 0x0000, 0x682b, 0x0000, 0x0078, 0x268b, 0xa684, 0x0800, - 0x00c0, 0x2635, 0x68b0, 0xa084, 0x4800, 0xa635, 0xa684, 0x0800, - 0x00c0, 0x2635, 0x1078, 0x314d, 0x007c, 0xa684, 0x0020, 0x0040, - 0x265f, 0x78d0, 0x8003, 0x00c8, 0x2643, 0xa006, 0x1078, 0x3414, - 0x78d4, 0x1078, 0x3479, 0xa684, 0x4000, 0x0040, 0x264d, 0x682f, - 0x0000, 0x682b, 0x0000, 0x0078, 0x2632, 0x68b0, 0xa084, 0x4800, - 0xa635, 0xa684, 0x4000, 0x00c0, 0x2647, 0x7038, 0xa005, 0x00c0, - 0x2659, 0x79d8, 0x7adc, 0x692e, 0x6a2a, 0x0078, 0x2632, 0xa684, - 0x4000, 0x0040, 0x2669, 0x682f, 0x0000, 0x682b, 0x0000, 0x0078, - 0x2632, 0x68b0, 0xa084, 0x4800, 0xa635, 0xa684, 0x4000, 0x00c0, - 0x2663, 0x7038, 0xa005, 0x00c0, 0x2675, 0x79d8, 0x7adc, 0x78d0, - 0x80f3, 0x00c8, 0x267c, 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, - 0x0000, 0x692e, 0x6a2a, 0x2100, 0xa205, 0x00c0, 0x2689, 0x0078, - 0x2632, 0x1078, 0x3414, 0x007c, 0xa384, 0x0200, 0x0040, 0x2694, - 0x6008, 0xa085, 0x0002, 0x600a, 0x6817, 0x0006, 0x6a28, 0x692c, - 0x6a3a, 0x693e, 0x682b, 0x0300, 0x682f, 0x0000, 0x6833, 0x2000, - 0x6893, 0x0000, 0x6897, 0x0020, 0x7000, 0x0079, 0x26a7, 0x26af, - 0x26b1, 0x26ba, 0x26af, 0x26af, 0x26af, 0x26af, 0x26af, 0x1078, - 0x1ce7, 0x681c, 0xa084, 0x0001, 0x00c0, 0x26ba, 0x1078, 0x2b06, - 0x0078, 0x26c0, 0x7054, 0x2c50, 0x2060, 0x6800, 0x6002, 0x2a60, - 0x2021, 0x3857, 0x2404, 0xa005, 0x0040, 0x26c9, 0x2020, 0x0078, - 0x26c2, 0x2d22, 0x206b, 0x0000, 0x007c, 0x77b4, 0x1078, 0x2e16, - 0xa7bc, 0x0f00, 0x1078, 0x2f11, 0x6018, 0xa005, 0x0040, 0x26fc, - 0x0d7e, 0x2001, 0x5c10, 0x2068, 0x0d7f, 0x2021, 0x5c00, 0x2009, - 0x0004, 0x2011, 0x0010, 0x1078, 0x216a, 0x0040, 0x26fc, 0x157e, - 0x20a9, 0x0000, 0x2021, 0x5b00, 0x047e, 0x2009, 0x0004, 0x2011, - 0x0010, 0x1078, 0x216a, 0x047f, 0x0040, 0x26fb, 0x8420, 0x0070, - 0x26fb, 0x0078, 0x26ec, 0x157f, 0x8738, 0xa784, 0x001f, 0x00c0, - 0x26d2, 0x0078, 0x1d41, 0x1078, 0x2b0d, 0x1078, 0x2b1e, 0x6827, - 0x0000, 0x789b, 0x000e, 0x6f10, 0x1078, 0x344a, 0x017e, 0xad88, - 0x0010, 0xa188, 0x0006, 0x2104, 0x017f, 0x8007, 0xa084, 0x00ff, - 0xa082, 0x0047, 0x0040, 0x271e, 0x0078, 0x272f, 0x0c7e, 0x6810, - 0x8007, 0xa084, 0x000f, 0x8003, 0x8003, 0x8003, 0xa0e0, 0x3a80, - 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x1078, 0x2f6b, 0x6813, - 0x0002, 0xa684, 0x0800, 0x0040, 0x2739, 0x6918, 0xa18d, 0x2000, - 0x691a, 0x6814, 0xa084, 0x8000, 0x0040, 0x2740, 0x6817, 0x0000, - 0x2021, 0x3857, 0x6800, 0x2022, 0x6a38, 0x693c, 0x6a2a, 0x692e, - 0x1078, 0x18b6, 0x0078, 0x1d41, 0x1078, 0x261c, 0x6827, 0x0000, - 0x789b, 0x000e, 0x6f10, 0x1078, 0x3002, 0xa08c, 0x00ff, 0x6912, - 0x6814, 0xa084, 0x8000, 0x0040, 0x275f, 0x7038, 0x6816, 0xa68c, - 0xdf00, 0x691a, 0x70a3, 0x0000, 0x0078, 0x1d41, 0xa006, 0x1078, - 0x314d, 0x6813, 0x0000, 0x6817, 0x0001, 0xa68c, 0xdf00, 0x691a, - 0x6827, 0x0000, 0x7000, 0x0079, 0x2775, 0x277d, 0x277f, 0x277f, - 0x2781, 0x2781, 0x2781, 0x277d, 0x277d, 0x1078, 0x1ce7, 0x1078, - 0x2b1e, 0x6008, 0xa084, 0xffef, 0x600a, 0x0078, 0x2ad8, 0x2300, - 0x0079, 0x278a, 0x278d, 0x278f, 0x27cd, 0x1078, 0x1ce7, 0x7000, - 0x0079, 0x2792, 0x279a, 0x279c, 0x279c, 0x27a7, 0x279c, 0x27ae, - 0x279a, 0x279a, 0x1078, 0x1ce7, 0xa684, 0x2000, 0x00c0, 0x27a7, - 0xa6b5, 0x2000, 0x7e5a, 0x1078, 0x3376, 0x0078, 0x2fb6, 0x6814, - 0xa084, 0x8000, 0x0040, 0x27ae, 0x6817, 0x0007, 0x2009, 0x3818, - 0x210c, 0xa186, 0x0000, 0x0040, 0x27c3, 0xa186, 0x0001, 0x0040, - 0x27c7, 0x2009, 0x382b, 0x200b, 0x000b, 0x70a3, 0x0001, 0x781b, - 0x0046, 0x0078, 0x1d39, 0x781b, 0x00dd, 0x0078, 0x1d39, 0x2009, - 0x382b, 0x200b, 0x000a, 0x0078, 0x1d39, 0x1078, 0x1ce7, 0x2300, - 0x0079, 0x27d2, 0x27d5, 0x27d7, 0x27fa, 0x1078, 0x1ce7, 0x7000, - 0x0079, 0x27da, 0x27e2, 0x27e4, 0x27e4, 0x27ef, 0x27e4, 0x27f6, - 0x27e2, 0x27e2, 0x1078, 0x1ce7, 0xa684, 0x2000, 0x00c0, 0x27ef, - 0xa6b5, 0x2000, 0x7e5a, 0x1078, 0x3376, 0x0078, 0x2fb6, 0x6814, - 0xa084, 0x8000, 0x0040, 0x27f6, 0x6817, 0x0007, 0x781b, 0x00e4, - 0x0078, 0x1d39, 0x681c, 0xa085, 0x0004, 0x681e, 0x1078, 0x2f6b, - 0xa6b5, 0x0800, 0x1078, 0x2df9, 0x781b, 0x0069, 0x0078, 0x1d39, - 0x2300, 0x0079, 0x280b, 0x280e, 0x2810, 0x2812, 0x1078, 0x1ce7, - 0x1078, 0x1ce7, 0xa684, 0x0400, 0x00c0, 0x2831, 0x782b, 0x3009, - 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x79e4, - 0xa184, 0x0020, 0x0040, 0x2829, 0x78ec, 0xa084, 0x0003, 0x00c0, - 0x282d, 0x2001, 0x0014, 0x0078, 0x24e3, 0xa184, 0x0007, 0x0079, - 0x2869, 0x7a90, 0xa294, 0x0007, 0x789b, 0x0060, 0x79a8, 0x81ff, - 0x0040, 0x2867, 0x789b, 0x0010, 0x7ba8, 0xa384, 0x0001, 0x00c0, - 0x2858, 0x7ba8, 0x7ba8, 0xa386, 0x0001, 0x00c0, 0x284b, 0x2009, - 0xfff7, 0x0078, 0x2851, 0xa386, 0x0003, 0x00c0, 0x2858, 0x2009, - 0xffef, 0x0c7e, 0x7048, 0x2060, 0x6004, 0xa104, 0x6006, 0x0c7f, - 0x789b, 0x0060, 0x78ab, 0x0000, 0xa684, 0xfffb, 0x785a, 0x782b, - 0x3009, 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, 0x691e, 0x0078, - 0x2fb6, 0x21da, 0x21e0, 0x2873, 0x287b, 0x2871, 0x2871, 0x2871, - 0x2fb6, 0x1078, 0x1ce7, 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, - 0x691e, 0x0078, 0x2fbe, 0x691c, 0xa18c, 0xfdff, 0xa18c, 0xfeff, - 0x691e, 0x0078, 0x2fb6, 0x79e4, 0xa184, 0x0030, 0x0040, 0x288d, - 0x78ec, 0xa084, 0x0003, 0x00c0, 0x2895, 0x6814, 0xa085, 0x8000, - 0x6816, 0x2001, 0x0014, 0x0078, 0x24e3, 0xa184, 0x0007, 0x0079, - 0x2899, 0x2fb6, 0x2fb6, 0x28a1, 0x2fb6, 0x2fde, 0x2fde, 0x2fb6, - 0x2fb6, 0xa684, 0x0400, 0x00c0, 0x28d2, 0x681c, 0xa084, 0x0001, - 0x0040, 0x2fbe, 0xa68c, 0x2060, 0xa18c, 0xfffb, 0x795a, 0x69b2, - 0x789b, 0x0060, 0x78ab, 0x0000, 0x789b, 0x0061, 0x6814, 0xa085, - 0x8000, 0x6816, 0x78aa, 0x157e, 0x137e, 0x147e, 0x20a1, 0x012c, - 0x789b, 0x0000, 0x8000, 0x80ac, 0xad80, 0x000a, 0x2098, 0x53a6, - 0x147f, 0x137f, 0x157f, 0x6810, 0x8007, 0x789b, 0x007e, 0x78aa, - 0x0078, 0x2fbe, 0x6814, 0xa084, 0x8000, 0x0040, 0x28d9, 0x6817, - 0x0008, 0x781b, 0x00d8, 0x0078, 0x1d39, 0x2300, 0x0079, 0x28e0, - 0x28e5, 0x2960, 0x28e3, 0x1078, 0x1ce7, 0x7000, 0xa084, 0x0007, - 0x0079, 0x28ea, 0x28f2, 0x28f4, 0x2910, 0x28f2, 0x28f2, 0x26cd, - 0x28f2, 0x28f2, 0x1078, 0x1ce7, 0x691c, 0xa18d, 0x0001, 0x691e, - 0x6800, 0x6006, 0xa005, 0x00c0, 0x28fe, 0x6002, 0x6818, 0xa084, - 0x000e, 0x0040, 0x290a, 0x7014, 0x68b6, 0x712c, 0xa188, 0x5b00, - 0x0078, 0x290c, 0x2009, 0x5c00, 0x2104, 0x6802, 0x2d0a, 0x7156, - 0x6eb2, 0xa684, 0x0060, 0x0040, 0x295e, 0xa684, 0x0800, 0x00c0, - 0x2922, 0xa684, 0x7fff, 0x68b2, 0x6890, 0x6894, 0x1078, 0x314d, - 0x0078, 0x295e, 0xa684, 0x0020, 0x0040, 0x2934, 0xa006, 0x1078, - 0x3414, 0x78d0, 0x8003, 0x00c8, 0x2930, 0x78d4, 0x1078, 0x3479, - 0x79d8, 0x7adc, 0x0078, 0x2938, 0x1078, 0x2f1e, 0x1078, 0x3414, - 0xa684, 0x8000, 0x0040, 0x295e, 0xa684, 0x7fff, 0x68b2, 0x789b, - 0x0074, 0x1078, 0x3002, 0x2010, 0x1078, 0x3002, 0x2008, 0xa684, - 0x0020, 0x00c0, 0x2956, 0x1078, 0x3002, 0x801b, 0x00c8, 0x2951, - 0x8000, 0xa084, 0x003f, 0xa108, 0xa291, 0x0000, 0x6b94, 0x2100, - 0xa302, 0x68ae, 0x6b90, 0x2200, 0xa303, 0x68aa, 0x0078, 0x1d41, - 0x0078, 0x2de6, 0x7033, 0x0000, 0xa282, 0x0005, 0x0050, 0x296a, - 0x1078, 0x1ce7, 0x2300, 0x0079, 0x296d, 0x2970, 0x297a, 0x299d, - 0x2200, 0x0079, 0x2973, 0x2978, 0x2de6, 0x2978, 0x29c6, 0x2a17, - 0x1078, 0x1ce7, 0x7000, 0xa086, 0x0001, 0x00c0, 0x2987, 0x1078, - 0x2b1e, 0x1078, 0x314d, 0x7034, 0x600a, 0x0078, 0x298c, 0x7000, - 0xa086, 0x0003, 0x0040, 0x2981, 0x7003, 0x0005, 0x2001, 0x5c10, - 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, 0x2996, 0x2de6, 0x299b, - 0x29c6, 0x299b, 0x2de6, 0x1078, 0x1ce7, 0x7000, 0xa086, 0x0001, - 0x00c0, 0x29aa, 0x1078, 0x2b1e, 0x1078, 0x314d, 0x7034, 0x600a, - 0x0078, 0x29af, 0x7000, 0xa086, 0x0003, 0x0040, 0x29a4, 0x7003, - 0x0005, 0x2001, 0x5c10, 0x2068, 0x703e, 0x7032, 0x2200, 0x0079, - 0x29b9, 0x29c0, 0x29be, 0x29c0, 0x29be, 0x29c0, 0x1078, 0x1ce7, - 0x1078, 0x2e09, 0x781b, 0x0069, 0x0078, 0x1d39, 0x7000, 0xa086, - 0x0001, 0x00c0, 0x29d3, 0x1078, 0x2b1e, 0x1078, 0x314d, 0x7034, - 0x600a, 0x0078, 0x29d8, 0x7000, 0xa086, 0x0003, 0x0040, 0x29cd, - 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, 0x7ca8, - 0xa484, 0x001f, 0xa215, 0x2069, 0x5c00, 0x2d04, 0x2d08, 0x7156, - 0x2068, 0xa005, 0x0040, 0x29f3, 0x6810, 0xa206, 0x0040, 0x2a0c, - 0x6800, 0x0078, 0x29e6, 0x7003, 0x0005, 0x2001, 0x5c10, 0x2068, - 0x703e, 0x7032, 0x157e, 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, - 0x0070, 0x2a04, 0x0078, 0x29fd, 0x157f, 0x6a12, 0x68b3, 0x0700, - 0x681f, 0x0800, 0x6823, 0x0003, 0x6eb0, 0x7e5a, 0x681c, 0xa084, - 0x0c00, 0x0040, 0x2a6d, 0x1078, 0x2e01, 0x0078, 0x2a6d, 0x7000, - 0xa086, 0x0001, 0x00c0, 0x2a24, 0x1078, 0x2b1e, 0x1078, 0x314d, - 0x7034, 0x600a, 0x0078, 0x2a29, 0x7000, 0xa086, 0x0003, 0x0040, - 0x2a1e, 0x7003, 0x0002, 0x7a80, 0xa294, 0x0f00, 0x789b, 0x0018, - 0x7ca8, 0xa484, 0x001f, 0xa215, 0x79a8, 0x79a8, 0xa18c, 0x00ff, - 0xa1e8, 0x5b00, 0x2d04, 0x2d08, 0x7156, 0x2068, 0xa005, 0x0040, - 0x2a48, 0x6810, 0xa206, 0x0040, 0x2a61, 0x6800, 0x0078, 0x2a3b, - 0x7003, 0x0005, 0x2001, 0x5c10, 0x2068, 0x703e, 0x7032, 0x157e, - 0x20a9, 0x002f, 0x2003, 0x0000, 0x8000, 0x0070, 0x2a59, 0x0078, - 0x2a52, 0x157f, 0x6a12, 0x68b3, 0x0700, 0x681f, 0x0800, 0x6823, - 0x0003, 0x6eb0, 0x7e5a, 0x681c, 0xa084, 0x0c00, 0x0040, 0x2a6d, - 0x1078, 0x2dfd, 0x7e58, 0x0078, 0x2a6d, 0x027e, 0x8207, 0xa084, - 0x000f, 0x8003, 0x8003, 0x8003, 0xa080, 0x3a80, 0x2060, 0x704a, - 0x6000, 0x704e, 0x6004, 0x7052, 0xa684, 0x0060, 0x0040, 0x2aa4, - 0x6b94, 0x6c90, 0x69a8, 0x68ac, 0xa105, 0x00c0, 0x2a92, 0x7bd2, - 0x7bda, 0x7cd6, 0x7cde, 0xa6b4, 0xb7ff, 0x7e5a, 0x1078, 0x3376, - 0x0078, 0x2aa4, 0x68ac, 0xa31a, 0x2100, 0xa423, 0x2400, 0xa305, - 0x0040, 0x2aa4, 0x7bd2, 0x7bda, 0x7cd6, 0x7cde, 0x68ac, 0xa6b4, - 0xbfff, 0x7e5a, 0x1078, 0x339d, 0x077f, 0x1078, 0x2f11, 0x2009, - 0x006a, 0xa684, 0x0008, 0x0040, 0x2aaf, 0x2009, 0x0069, 0xa6b5, - 0x2000, 0x7e5a, 0x791a, 0x2d00, 0x703e, 0x8207, 0xa084, 0x000f, - 0x8003, 0x8003, 0x8003, 0xa080, 0x3a80, 0x2048, 0x0078, 0x1d39, - 0x6020, 0xa005, 0x0040, 0x2acc, 0x8001, 0x6022, 0x6008, 0xa085, - 0x0008, 0x600a, 0x7010, 0x6026, 0x007c, 0xa006, 0x1078, 0x314d, - 0x6813, 0x0000, 0x6817, 0x0001, 0x681f, 0x0040, 0x681b, 0x0100, - 0x7000, 0xa084, 0x0007, 0x0079, 0x2add, 0x2ae5, 0x2ae7, 0x2ae7, - 0x2b02, 0x2aef, 0x2ae5, 0x2ae5, 0x2ae5, 0x1078, 0x1ce7, 0x1078, - 0x2b0d, 0x1078, 0x2b06, 0x1078, 0x18b6, 0x0078, 0x1d41, 0x70a0, - 0x70a3, 0x0000, 0x0079, 0x2af4, 0x2afe, 0x2afe, 0x2afc, 0x2afc, - 0x2afc, 0x2afe, 0x2afc, 0x2afe, 0x0079, 0x20a6, 0x70a3, 0x0000, - 0x0078, 0x1d41, 0x6817, 0x0000, 0x0078, 0x2703, 0x6800, 0xa005, - 0x00c0, 0x2b0b, 0x6002, 0x6006, 0x007c, 0x1078, 0x2b27, 0x6010, - 0xa005, 0x0040, 0x2b18, 0x8001, 0x00d0, 0x2b18, 0x1078, 0x1ce7, - 0x6012, 0x6008, 0xa084, 0xffef, 0x600a, 0x007c, 0x1078, 0x2b34, - 0x6018, 0xa005, 0x0040, 0x2b26, 0x8001, 0x601a, 0x007c, 0x017e, - 0x007e, 0x2009, 0x382e, 0x2104, 0xa005, 0x0040, 0x2b31, 0x8001, - 0x200a, 0x007f, 0x017f, 0x007c, 0x017e, 0x007e, 0x2009, 0x382f, - 0x2104, 0xa005, 0x0040, 0x2b3e, 0x8001, 0x200a, 0x007f, 0x017f, - 0x007c, 0x017e, 0x007e, 0x2009, 0x3830, 0x2104, 0x8000, 0x200a, - 0x007f, 0x017f, 0x007c, 0x017e, 0x007e, 0x2009, 0x382f, 0x2104, - 0x8000, 0x200a, 0x007f, 0x017f, 0x007c, 0x027e, 0x037e, 0x007e, - 0x2009, 0x382e, 0x2114, 0x2019, 0x382f, 0x2304, 0xa202, 0x200a, - 0x201b, 0x0000, 0x2009, 0x3830, 0x007f, 0x037f, 0x027f, 0x007c, - 0x1078, 0x2ffd, 0x6817, 0x0018, 0x0078, 0x2b98, 0x1078, 0x2ffd, - 0x6817, 0x0019, 0x0078, 0x2b98, 0x1078, 0x2ffd, 0x6817, 0x001a, - 0x0078, 0x2b98, 0x77b4, 0x1078, 0x2f11, 0x71b8, 0xa18c, 0x00ff, - 0xa1e8, 0x5b00, 0x2d04, 0x2d08, 0x2068, 0xa005, 0x00c0, 0x2b8a, - 0x0078, 0x1d41, 0x6810, 0x72b4, 0xa206, 0x0040, 0x2b92, 0x6800, - 0x0078, 0x2b83, 0x6800, 0x200a, 0x6817, 0x0005, 0x70bf, 0x0000, - 0x1078, 0x2b0d, 0x681c, 0xa084, 0x0001, 0x00c0, 0x2ba1, 0x1078, - 0x2b06, 0x1078, 0x2b1e, 0x681b, 0x0000, 0x681f, 0x0020, 0x1078, - 0x18b6, 0x0078, 0x1d41, 0xa282, 0x0003, 0x00c0, 0x2dda, 0x7da8, - 0xa5ac, 0x00ff, 0x7ea8, 0xa6b4, 0x00ff, 0x691c, 0xa18d, 0x0080, - 0x691e, 0xa184, 0x0100, 0x0040, 0x2c0b, 0xa18c, 0xfeff, 0x691e, - 0xa6b4, 0x00ff, 0x0040, 0x2bf5, 0xa682, 0x000f, 0x0048, 0x2bcc, - 0x0040, 0x2bcc, 0x2031, 0x000f, 0x852b, 0x852b, 0x1078, 0x2e94, - 0x0040, 0x2bd6, 0x1078, 0x2ca4, 0x0078, 0x2bfe, 0x1078, 0x2e4f, - 0x0c7e, 0x2960, 0x6004, 0xa084, 0xfff5, 0x6006, 0x1078, 0x2cc8, - 0x0c7f, 0x691c, 0xa18d, 0x0100, 0x691e, 0x7e58, 0xa6b5, 0x0004, - 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2bf1, 0x781b, 0x0055, 0x0078, - 0x1d39, 0x781b, 0x0069, 0x0078, 0x1d39, 0x0c7e, 0x2960, 0x6004, - 0xa084, 0xfff5, 0x6006, 0x1078, 0x2cc8, 0x0c7f, 0x7e58, 0xa684, - 0x0400, 0x00c0, 0x2c07, 0x781b, 0x0058, 0x0078, 0x1d39, 0x781b, - 0x006a, 0x0078, 0x1d39, 0x0c7e, 0x7048, 0x2060, 0x6100, 0xa18c, - 0x1000, 0x0040, 0x2c4b, 0x6208, 0x8217, 0xa294, 0x00ff, 0xa282, - 0x000f, 0x0048, 0x2c1f, 0x0040, 0x2c1f, 0x2011, 0x000f, 0x2600, - 0xa202, 0x00c8, 0x2c24, 0x2230, 0x6208, 0xa294, 0x00ff, 0x7018, - 0xa086, 0x0028, 0x00c0, 0x2c34, 0xa282, 0x0019, 0x00c8, 0x2c3a, - 0x2011, 0x0019, 0x0078, 0x2c3a, 0xa282, 0x000c, 0x00c8, 0x2c3a, - 0x2011, 0x000c, 0x2200, 0xa502, 0x00c8, 0x2c3f, 0x2228, 0x1078, - 0x2e53, 0x852b, 0x852b, 0x1078, 0x2e94, 0x0040, 0x2c4b, 0x1078, - 0x2ca4, 0x0078, 0x2c4f, 0x1078, 0x2e4f, 0x1078, 0x2cc8, 0x7858, - 0xa085, 0x0004, 0x785a, 0x0c7f, 0x781b, 0x0069, 0x0078, 0x1d39, - 0x0c7e, 0x2960, 0x6000, 0xa084, 0x1000, 0x00c0, 0x2c72, 0xa084, - 0x0040, 0x00c0, 0x2c6c, 0xa18c, 0x0002, 0x00c0, 0x2c6c, 0xa18c, - 0xfff5, 0x6106, 0x0c7f, 0x007c, 0x2011, 0x0032, 0x2019, 0x0000, - 0x0078, 0x2c94, 0x6208, 0xa294, 0x00ff, 0x7018, 0xa086, 0x0028, - 0x00c0, 0x2c82, 0xa282, 0x0019, 0x00c8, 0x2c88, 0x2011, 0x0019, - 0x0078, 0x2c88, 0xa282, 0x000c, 0x00c8, 0x2c88, 0x2011, 0x000c, - 0x6308, 0x831f, 0xa39c, 0x00ff, 0xa382, 0x000f, 0x0048, 0x2c94, - 0x0040, 0x2c94, 0x2019, 0x000f, 0x78ab, 0x0001, 0x78ab, 0x0003, - 0x78ab, 0x0001, 0x7aaa, 0x7baa, 0xa8c0, 0x0005, 0x681c, 0xa085, - 0x0100, 0x681e, 0x0c7f, 0x007c, 0x0c7e, 0x7148, 0x2160, 0x2008, - 0xa084, 0xfff0, 0xa635, 0x7e86, 0x6018, 0x789a, 0x7eae, 0x6612, - 0x78a4, 0xa084, 0xfff8, 0xa18c, 0x0007, 0xa105, 0x78a6, 0x6016, - 0x788a, 0xa6b4, 0x000f, 0x8637, 0x8204, 0x8004, 0xa084, 0x00ff, - 0xa605, 0x600e, 0x6004, 0xa084, 0xfff5, 0x6006, 0x0c7f, 0x007c, - 0x0c7e, 0x7048, 0x2060, 0x6018, 0x789a, 0x78a4, 0xa084, 0xfff0, - 0x78a6, 0x6012, 0x7884, 0xa084, 0xfff0, 0x7886, 0x0c7f, 0x007c, - 0xa282, 0x0002, 0x00c0, 0x2dda, 0x7aa8, 0x691c, 0xa18d, 0x0080, - 0x691e, 0xa184, 0x0200, 0x0040, 0x2d1d, 0xa18c, 0xfdff, 0x691e, - 0xa294, 0x00ff, 0xa282, 0x0002, 0x00c8, 0x2dda, 0x1078, 0x2d63, - 0x1078, 0x2cc8, 0xa980, 0x0001, 0x200c, 0x1078, 0x2f0d, 0x1078, - 0x2c58, 0x88ff, 0x0040, 0x2d10, 0x789b, 0x0060, 0x2800, 0x78aa, - 0x7e58, 0xa6b5, 0x0004, 0x7e5a, 0xa684, 0x0400, 0x00c0, 0x2d0c, - 0x781b, 0x0055, 0x0078, 0x1d39, 0x781b, 0x0069, 0x0078, 0x1d39, - 0x7e58, 0xa684, 0x0400, 0x00c0, 0x2d19, 0x781b, 0x0058, 0x0078, - 0x1d39, 0x781b, 0x006a, 0x0078, 0x1d39, 0xa282, 0x0002, 0x00c8, - 0x2d25, 0xa284, 0x0001, 0x0040, 0x2d2f, 0x7148, 0xa188, 0x0000, - 0x210c, 0xa18c, 0x2000, 0x00c0, 0x2d2f, 0x2011, 0x0000, 0x1078, - 0x2e41, 0x1078, 0x2d63, 0x1078, 0x2cc8, 0x7858, 0xa085, 0x0004, - 0x785a, 0x781b, 0x0069, 0x0078, 0x1d39, 0x0c7e, 0x027e, 0x2960, - 0x6000, 0x2011, 0x0001, 0xa084, 0x2000, 0x00c0, 0x2d53, 0xa084, - 0x0080, 0x00c0, 0x2d51, 0xa18c, 0xffef, 0x6106, 0xa006, 0x0078, - 0x2d60, 0x2011, 0x0000, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, - 0x0003, 0x7aaa, 0xa8c0, 0x0004, 0x681c, 0xa085, 0x0200, 0x681e, - 0x027f, 0x0c7f, 0x007c, 0x0c7e, 0x7048, 0x2060, 0x82ff, 0x0040, - 0x2d6b, 0x2011, 0x0040, 0x6018, 0xa080, 0x0002, 0x789a, 0x78a4, - 0xa084, 0xffbf, 0xa205, 0x78a6, 0x6016, 0x788a, 0x6004, 0xa084, - 0xffef, 0x6006, 0x0c7f, 0x007c, 0x007e, 0x7000, 0xa086, 0x0003, - 0x0040, 0x2d85, 0x007f, 0x0078, 0x2d88, 0x007f, 0x0078, 0x2dd6, - 0xa684, 0x0020, 0x0040, 0x2dd6, 0x7888, 0xa084, 0x0040, 0x0040, - 0x2dd6, 0x78a8, 0x8001, 0x0040, 0x2d95, 0x7bb8, 0xa384, 0x003f, - 0x831b, 0x00c8, 0x2d9c, 0x8000, 0xa005, 0x0040, 0x2dbd, 0x831b, - 0x00c8, 0x2da5, 0x8001, 0x0040, 0x2dd2, 0xa006, 0x1078, 0x3414, - 0x78b4, 0x1078, 0x3479, 0x0078, 0x2dd6, 0xa684, 0x4000, 0x0040, - 0x2dbd, 0x78b8, 0x801b, 0x00c8, 0x2db6, 0x8000, 0xa084, 0x003f, - 0x00c0, 0x2dd2, 0xa6b4, 0xbfff, 0x7e5a, 0x79d8, 0x7adc, 0x2001, - 0x0001, 0xa108, 0x00c8, 0x2dc6, 0xa291, 0x0000, 0x79d2, 0x79da, - 0x7ad6, 0x7ade, 0x1078, 0x3414, 0x781b, 0x0067, 0x1078, 0x32e4, - 0x0078, 0x1d39, 0x781b, 0x0067, 0x0078, 0x1d39, 0x781b, 0x006a, - 0x0078, 0x1d39, 0x1078, 0x2e0d, 0x781b, 0x0069, 0x0078, 0x1d39, - 0x1078, 0x2df9, 0x781b, 0x0069, 0x0078, 0x1d39, 0x6823, 0x0002, - 0x1078, 0x2e01, 0x691c, 0xa18d, 0x0020, 0x691e, 0x6814, 0xa084, - 0x8000, 0x0040, 0x2df5, 0x6817, 0x0005, 0x781b, 0x0069, 0x0078, - 0x1d39, 0x2001, 0x0005, 0x0078, 0x2e0f, 0x2001, 0x000c, 0x0078, - 0x2e0f, 0x2001, 0x0006, 0x0078, 0x2e0f, 0x2001, 0x000d, 0x0078, - 0x2e0f, 0x2001, 0x0009, 0x0078, 0x2e0f, 0x2001, 0x0007, 0x789b, - 0x007f, 0x78aa, 0xa6b5, 0x0008, 0x7e5a, 0x007c, 0x077e, 0x873f, - 0xa7bc, 0x000f, 0x873b, 0x873b, 0x8703, 0xa0e0, 0x3a80, 0xa7b8, - 0x0020, 0x7f9a, 0x79a4, 0xa184, 0x000f, 0x0040, 0x2e2f, 0xa184, - 0xfff0, 0x78a6, 0x6012, 0x6004, 0xa085, 0x0008, 0x6006, 0x8738, - 0x8738, 0x7f9a, 0x79a4, 0xa184, 0x0040, 0x0040, 0x2e3f, 0xa184, - 0xffbf, 0x78a6, 0x6016, 0x6004, 0xa085, 0x0010, 0x6006, 0x077f, - 0x007c, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab, 0x0002, 0x78ab, - 0x0003, 0x7aaa, 0x789b, 0x0060, 0x78ab, 0x0004, 0x007c, 0x2031, - 0x0000, 0x2029, 0x0032, 0x789b, 0x0010, 0x78ab, 0x0001, 0x78ab, - 0x0003, 0x78ab, 0x0001, 0x7daa, 0x7eaa, 0x789b, 0x0060, 0x78ab, - 0x0005, 0x007c, 0x157e, 0x8007, 0xa084, 0x00ff, 0x8003, 0x8003, - 0xa080, 0x0020, 0x789a, 0x79a4, 0xa18c, 0xfff0, 0x2001, 0x3846, - 0x2004, 0xa082, 0x0028, 0x0040, 0x2e7d, 0x2021, 0x2ef4, 0x2019, - 0x0014, 0x20a9, 0x000c, 0x0078, 0x2e83, 0x2021, 0x2f00, 0x2019, - 0x0019, 0x20a9, 0x000d, 0x2011, 0x0064, 0x2404, 0xa084, 0xfff0, - 0xa106, 0x0040, 0x2e92, 0x8420, 0x2300, 0xa210, 0x0070, 0x2e92, - 0x0078, 0x2e85, 0x157f, 0x007c, 0x157e, 0x2011, 0x3846, 0x2214, - 0xa282, 0x0032, 0x0048, 0x2ea8, 0x0040, 0x2eac, 0x2021, 0x2ee6, - 0x2019, 0x0011, 0x20a9, 0x000e, 0x2011, 0x0032, 0x0078, 0x2ebc, - 0xa282, 0x0028, 0x0040, 0x2eb4, 0x2021, 0x2ef4, 0x2019, 0x0014, - 0x20a9, 0x000c, 0x0078, 0x2eba, 0x2021, 0x2f00, 0x2019, 0x0019, - 0x20a9, 0x000d, 0x2011, 0x0064, 0x2200, 0xa502, 0x0040, 0x2ecc, - 0x0048, 0x2ecc, 0x8420, 0x2300, 0xa210, 0x0070, 0x2ec9, 0x0078, - 0x2ebc, 0x157f, 0xa006, 0x007c, 0x157f, 0xa582, 0x0064, 0x00c8, - 0x2ed5, 0x7808, 0xa085, 0x0070, 0x780a, 0x78ec, 0xa084, 0x0300, - 0x0040, 0x2ee3, 0x2404, 0xa09e, 0x1201, 0x00c0, 0x2ee3, 0x2001, - 0x2101, 0x0078, 0x2ee4, 0x2404, 0xa005, 0x007c, 0x1201, 0x3002, - 0x3202, 0x4203, 0x4403, 0x5404, 0x5604, 0x6605, 0x6805, 0x7806, - 0x7a06, 0x0a07, 0x0c07, 0x0e07, 0x3202, 0x4202, 0x5202, 0x6202, - 0x7202, 0x6605, 0x7605, 0x7805, 0x7a05, 0x7c05, 0x7e05, 0x7f05, - 0x2202, 0x3202, 0x4202, 0x5202, 0x5404, 0x6404, 0x7404, 0x7604, - 0x7804, 0x7a04, 0x7c04, 0x7e04, 0x7f04, 0x789b, 0x0010, 0xa046, - 0x007c, 0xa784, 0x0f00, 0x800b, 0xa784, 0x001f, 0x8003, 0x8003, - 0x8003, 0x8003, 0xa105, 0xa0e0, 0x3b00, 0x007c, 0x79d8, 0x7adc, - 0x78d0, 0x801b, 0x00c8, 0x2f25, 0x8000, 0xa084, 0x003f, 0xa108, - 0xa291, 0x0000, 0x007c, 0x0f7e, 0x2079, 0x0100, 0x2009, 0x3840, - 0x2091, 0x8000, 0x2104, 0x0079, 0x2f35, 0x2f67, 0x2f3f, 0x2f3f, - 0x2f3f, 0x2f3f, 0x2f3f, 0x2f3d, 0x2f3d, 0x1078, 0x1ce7, 0x784b, - 0x0004, 0x7848, 0xa084, 0x0004, 0x00c0, 0x2f41, 0x784b, 0x0008, - 0x7848, 0xa084, 0x0008, 0x00c0, 0x2f48, 0x68b0, 0xa085, 0x4000, - 0x68b2, 0x7858, 0xa085, 0x4000, 0x785a, 0x7830, 0xa084, 0x0080, - 0x00c0, 0x2f67, 0x0018, 0x2f67, 0x6818, 0xa084, 0x0020, 0x00c0, - 0x2f65, 0x781b, 0x00dd, 0x0078, 0x2f67, 0x781b, 0x00e4, 0x2091, - 0x8001, 0x0f7f, 0x007c, 0x0c7e, 0x6810, 0x8007, 0xa084, 0x000f, - 0x8003, 0x8003, 0x8003, 0xa0e0, 0x3a80, 0x6004, 0xa084, 0x000a, - 0x00c0, 0x2fb4, 0x6108, 0xa194, 0xff00, 0x0040, 0x2fb4, 0xa18c, - 0x00ff, 0x6004, 0xa084, 0x0014, 0x00c0, 0x2f9d, 0xa085, 0x0014, - 0x6006, 0x017e, 0x691c, 0xa18d, 0x0002, 0x691e, 0x017f, 0x2001, - 0x000c, 0xa106, 0x0040, 0x2f99, 0x2100, 0x8003, 0x2008, 0x0078, - 0x2fad, 0x2009, 0x0019, 0x0078, 0x2fad, 0x2011, 0x0000, 0x6000, - 0xa084, 0xdfff, 0x6002, 0x6004, 0xa084, 0xffef, 0x6006, 0x017e, - 0x691c, 0xa18d, 0x0002, 0x691e, 0x017f, 0x2100, 0xa205, 0x600a, - 0x6004, 0xa085, 0x000a, 0x6006, 0x0c7f, 0x007c, 0x781b, 0x006a, - 0x0078, 0x1d39, 0x781b, 0x0069, 0x0078, 0x1d39, 0x781b, 0x0058, - 0x0078, 0x1d39, 0x781b, 0x0055, 0x0078, 0x1d39, 0x781b, 0x00dd, - 0x0078, 0x1d39, 0x781b, 0x00dc, 0x0078, 0x1d39, 0x781b, 0x00e4, - 0x0078, 0x1d39, 0x781b, 0x00e3, 0x0078, 0x1d39, 0x781b, 0x009e, - 0x0078, 0x1d39, 0x781b, 0x009d, 0x0078, 0x1d39, 0x70a3, 0x0001, - 0x781b, 0x0046, 0x0078, 0x1d39, 0x007e, 0x7830, 0xa084, 0x00c0, - 0x00c0, 0x2ffb, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, 0x0005, - 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 0x2ffb, 0x7808, - 0xa085, 0x0002, 0x780a, 0x007f, 0x007c, 0x7808, 0xa085, 0x0002, - 0x780a, 0x007c, 0x7830, 0xa084, 0x0040, 0x00c0, 0x3002, 0x0098, - 0x300b, 0x78ac, 0x007c, 0x7808, 0xa084, 0xfffd, 0x780a, 0x0005, - 0x0005, 0x0005, 0x0005, 0x78ec, 0xa084, 0x0021, 0x0040, 0x301a, - 0x0098, 0x3018, 0x78ac, 0x007e, 0x7808, 0xa085, 0x0002, 0x780a, - 0x007f, 0x007c, 0xa784, 0x0070, 0x0040, 0x302e, 0x0c7e, 0x2d60, - 0x2f68, 0x1078, 0x1c97, 0x2d78, 0x2c68, 0x0c7f, 0x6817, 0x0003, - 0x7858, 0xa084, 0x3f00, 0x681a, 0x682f, 0x0000, 0x682b, 0x0000, - 0x784b, 0x0008, 0x78e4, 0xa005, 0x00d0, 0x21cc, 0xa084, 0x0020, - 0x0040, 0x21cc, 0x78ec, 0xa084, 0x0003, 0x0040, 0x21cc, 0x0018, - 0x21cc, 0x0078, 0x2de0, 0x0c7e, 0x6810, 0x8007, 0xa084, 0x000f, - 0x8003, 0x8003, 0x8003, 0xa080, 0x3a80, 0x2060, 0x2048, 0x704a, - 0x6000, 0x704e, 0x6004, 0x7052, 0x0c7f, 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, 0x9847, 0x0014, 0x0014, 0x98f5, - 0x98e7, 0x0014, 0x0014, 0x0080, 0x00bf, 0x0100, 0x0402, 0x2008, - 0xf880, 0xa20a, 0x0014, 0x300b, 0xa20c, 0x0014, 0xa200, 0x8838, - 0x817e, 0x842a, 0x84a0, 0x3806, 0x8839, 0x28c2, 0x9cc3, 0xa805, - 0x0864, 0xa83b, 0x3008, 0x28c1, 0x9cc3, 0xa201, 0x300c, 0x2847, - 0x8161, 0x846a, 0x8000, 0x84a4, 0x1856, 0x883a, 0xa808, 0x28e2, - 0x9ca0, 0xa8f3, 0x0864, 0xa829, 0x300c, 0xa801, 0x3008, 0x28e1, - 0x9ca0, 0x280d, 0xa204, 0x64c0, 0x67a0, 0x6fc0, 0x1814, 0x883b, - 0x7023, 0x8576, 0x8677, 0xa80f, 0x786e, 0x883e, 0xa80c, 0x282b, - 0xa205, 0x64a0, 0x67a0, 0x6fc0, 0x1814, 0x883b, 0x7023, 0x8576, - 0x8677, 0xa801, 0x883e, 0x2069, 0x28c1, 0x9cc3, 0x2044, 0x2103, - 0x20a2, 0x2081, 0xa8dc, 0xa207, 0x0014, 0xa203, 0x8000, 0x84a8, - 0x85a4, 0x1872, 0x849a, 0x883c, 0x1fe2, 0xf601, 0xa208, 0x856e, - 0x866f, 0x0704, 0x3008, 0x9ca0, 0x0014, 0xa202, 0x8000, 0x85a4, - 0x3009, 0x84a8, 0x19e2, 0xf848, 0x8174, 0x86eb, 0x85eb, 0x872e, - 0x87a9, 0x883f, 0x08e6, 0xa8f1, 0xf861, 0xa8e8, 0xf801, 0x0014, - 0xf881, 0x0016, 0x85b2, 0x80f0, 0x9532, 0xfaa2, 0x1de2, 0x0014, - 0x8532, 0xf221, 0x0014, 0x1de2, 0x84a8, 0xd6e0, 0x1fe6, 0x0014, - 0xa206, 0x6865, 0x817f, 0x842a, 0x1dc1, 0x8823, 0x0016, 0x6042, - 0x8008, 0xa8fa, 0x8000, 0x84a4, 0x8160, 0x842a, 0xf021, 0x3008, - 0x84a8, 0x1dc6, 0x20d7, 0x8822, 0x0016, 0x8000, 0x2848, 0x1011, - 0xa8fc, 0x3008, 0x8000, 0xa000, 0x2802, 0x1011, 0xa8fd, 0xa887, - 0x3008, 0x283d, 0x1011, 0xa8fd, 0xa209, 0x0017, 0x300c, 0x8000, - 0x85a4, 0x1de2, 0xdac1, 0x0014, 0x26e0, 0x873a, 0xfaa2, 0x19f2, - 0x1fe2, 0x0014, 0xa20b, 0x0014, 0xa20d, 0x817e, 0x842a, 0x84a0, - 0x3806, 0x0210, 0x9ccd, 0x0704, 0x0000, 0x127e, 0x2091, 0x2200, - 0x2049, 0x314d, 0x7000, 0x7204, 0xa205, 0x720c, 0xa215, 0x7008, - 0xa084, 0xfffd, 0xa205, 0x0040, 0x315f, 0x0078, 0x3164, 0x7003, - 0x0000, 0x127f, 0x2000, 0x007c, 0x7000, 0xa084, 0x0001, 0x00c0, - 0x3192, 0x7108, 0x8104, 0x00c8, 0x3171, 0x1078, 0x322e, 0x0078, - 0x3169, 0x700c, 0xa08c, 0x007f, 0x0040, 0x3192, 0x7004, 0x8004, - 0x00c8, 0x3189, 0x7014, 0xa005, 0x00c0, 0x3185, 0x7010, 0xa005, - 0x0040, 0x3189, 0xa102, 0x00c8, 0x3169, 0x7007, 0x0010, 0x0078, - 0x3192, 0x8aff, 0x0040, 0x3192, 0x1078, 0x33eb, 0x00c0, 0x318c, - 0x0040, 0x3169, 0x1078, 0x31dc, 0x7003, 0x0000, 0x127f, 0x2000, - 0x007c, 0x6424, 0x84ff, 0x0040, 0x31b6, 0x2c70, 0x2039, 0x31bb, - 0x2704, 0xae68, 0x680c, 0xa630, 0x6808, 0xa529, 0x8421, 0x0040, - 0x31b6, 0x8738, 0x2704, 0xa005, 0x00c0, 0x31a1, 0x7098, 0xa075, - 0x0040, 0x31b6, 0x2039, 0x31b8, 0x0078, 0x31a0, 0x007c, 0x0000, - 0x0004, 0x0008, 0x000c, 0x0010, 0x0014, 0x0018, 0x001c, 0x0000, - 0x127e, 0x2091, 0x2200, 0x2079, 0x3800, 0x2071, 0x0010, 0x7007, - 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2071, 0x0020, 0x7007, - 0x000a, 0x7007, 0x0002, 0x7003, 0x0000, 0x2049, 0x0000, 0x78b7, - 0x0000, 0x127f, 0x2000, 0x007c, 0x2049, 0x31dc, 0x7004, 0x8004, - 0x00c8, 0x3208, 0x7007, 0x0012, 0x7108, 0x7008, 0xa106, 0x00c0, - 0x31e4, 0xa184, 0x0030, 0x0040, 0x31f1, 0xa086, 0x0030, 0x00c0, - 0x31e4, 0x7000, 0xa084, 0x0001, 0x00c0, 0x3208, 0x7008, 0xa084, - 0x000c, 0x00c0, 0x3206, 0x710c, 0xa184, 0x0300, 0x00c0, 0x3206, - 0xa184, 0x007f, 0x00c0, 0x31dc, 0x0078, 0x3208, 0x6817, 0x0003, - 0x7007, 0x0012, 0x7007, 0x0008, 0x7004, 0xa084, 0x0008, 0x00c0, - 0x320c, 0x7007, 0x0012, 0x7108, 0x8104, 0x0048, 0x3211, 0x78b7, - 0x0000, 0x7003, 0x0000, 0x2049, 0x0000, 0x007c, 0x107e, 0x007e, - 0x127e, 0x157e, 0x2091, 0x2200, 0x7108, 0x1078, 0x322e, 0x157f, - 0x127f, 0x2091, 0x8001, 0x007f, 0x107f, 0x007c, 0x7204, 0x2118, - 0x7108, 0x700c, 0xa084, 0x0300, 0x00c0, 0x3270, 0xa184, 0x000c, - 0x00c0, 0x3270, 0x8213, 0x8213, 0x8213, 0x8213, 0xa284, 0x0100, - 0xa10d, 0x810b, 0x810b, 0x810f, 0xa184, 0x0007, 0x0079, 0x3248, - 0x3252, 0x3262, 0x3270, 0x3262, 0x3284, 0x3284, 0x3270, 0x3282, - 0x1078, 0x1ce7, 0x7007, 0x0002, 0x8aff, 0x00c0, 0x325b, 0x2049, - 0x0000, 0x0078, 0x325f, 0x1078, 0x33eb, 0x00c0, 0x325b, 0x78b7, - 0x0000, 0x007c, 0x7007, 0x0002, 0x8aff, 0x00c0, 0x3269, 0x0078, - 0x326d, 0x1078, 0x33eb, 0x00c0, 0x3269, 0x78b7, 0x0000, 0x007c, - 0x7007, 0x0002, 0x1078, 0x31dc, 0x1078, 0x2f2b, 0x6814, 0xa084, - 0x8000, 0x0040, 0x327d, 0x6817, 0x0002, 0x007c, 0x1078, 0x1ce7, - 0x1078, 0x1ce7, 0x1078, 0x32d6, 0x7210, 0x7114, 0x700c, 0xa09c, - 0x007f, 0x2800, 0xa300, 0xa211, 0xa189, 0x0000, 0x78b4, 0xa005, - 0x0040, 0x3296, 0x78b7, 0x0000, 0x0078, 0x32b9, 0x1078, 0x32d6, - 0x2704, 0x2c58, 0xac60, 0x630c, 0x2200, 0xa322, 0x6308, 0x2100, - 0xa31b, 0x2400, 0xa305, 0x0040, 0x32af, 0x00c8, 0x32af, 0x8412, - 0x8210, 0x830a, 0xa189, 0x0000, 0x2b60, 0x0078, 0x3296, 0x2b60, - 0x8a07, 0xa7ba, 0x31b8, 0xa73d, 0x2c00, 0x6882, 0x6f86, 0x6c8e, - 0x6b8a, 0x7007, 0x0012, 0x1078, 0x31dc, 0x007c, 0x8738, 0x2704, - 0xa005, 0x00c0, 0x32ca, 0x6098, 0xa005, 0x0040, 0x32d3, 0x2060, - 0x2039, 0x31b8, 0x8a51, 0x0040, 0x32d2, 0x7008, 0xa084, 0x00c0, - 0xa086, 0x00c0, 0x007c, 0x2051, 0x0000, 0x007c, 0x8a50, 0x8739, - 0x2704, 0xa004, 0x00c0, 0x32e3, 0x2039, 0x31be, 0x6000, 0xa064, - 0x00c0, 0x32e3, 0x2d60, 0x007c, 0x127e, 0x0d7e, 0x2091, 0x2200, - 0x0d7f, 0x6880, 0x2060, 0x6884, 0x6b88, 0x6c8c, 0x8057, 0xaad4, - 0x00ff, 0xa084, 0x00ff, 0xa0b8, 0x31b8, 0x7e08, 0xa6b5, 0x000c, - 0x6818, 0xa084, 0x0040, 0x0040, 0x32ff, 0xa6b5, 0x0001, 0x0f7e, - 0x2079, 0x0100, 0x7858, 0x0f7f, 0xa084, 0x0040, 0x0040, 0x330e, - 0xa684, 0x0001, 0x00c0, 0x330e, 0xa6b5, 0x0001, 0x7007, 0x0004, - 0x7004, 0xa084, 0x0004, 0x00c0, 0x3310, 0x7000, 0xa005, 0x0040, - 0x331b, 0x1078, 0x1ce7, 0x2400, 0xa305, 0x00c0, 0x3321, 0x0078, - 0x335e, 0x2c58, 0x2704, 0xac60, 0x6004, 0xa400, 0x007e, 0x701a, - 0x6000, 0xa301, 0x701e, 0x2009, 0x04fd, 0x2104, 0xa086, 0x04fd, - 0x007f, 0x00c0, 0x334e, 0xa084, 0x0001, 0x0040, 0x334e, 0xa684, - 0x0001, 0x00c0, 0x334e, 0x7013, 0x0001, 0x7017, 0x0000, 0x7602, - 0x7007, 0x0001, 0x78b7, 0x0001, 0xa4a0, 0x0001, 0xa399, 0x0000, - 0x6004, 0xa400, 0x701a, 0x6000, 0xa301, 0x701e, 0x620c, 0x2400, - 0xa202, 0x7012, 0x6208, 0x2300, 0xa203, 0x7016, 0x7602, 0x7007, - 0x0001, 0x2b60, 0x1078, 0x32be, 0x0078, 0x3360, 0x1078, 0x33eb, - 0x00c0, 0x335e, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, 0x2091, - 0x2200, 0x0d7f, 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, - 0x336c, 0x7003, 0x0008, 0x127f, 0x2000, 0x007c, 0x127e, 0x0d7e, - 0x2091, 0x2200, 0x0d7f, 0x2049, 0x3376, 0x7007, 0x0004, 0x7004, - 0xa084, 0x0004, 0x00c0, 0x337f, 0x7e08, 0xa6b5, 0x000c, 0x6818, - 0xa084, 0x0040, 0x0040, 0x338e, 0xa6b5, 0x0001, 0x6824, 0xa005, - 0x0040, 0x339a, 0x2050, 0x2039, 0x31bb, 0x2d60, 0x1078, 0x33eb, - 0x00c0, 0x3396, 0x127f, 0x2000, 0x007c, 0x127e, 0x007e, 0x017e, - 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x037f, 0x047f, 0x7e08, 0xa6b5, - 0x000c, 0x6818, 0xa084, 0x0040, 0x0040, 0x33b0, 0xa6b5, 0x0001, - 0x2049, 0x339d, 0x6824, 0xa055, 0x0040, 0x33e8, 0x2d70, 0x2e60, - 0x2039, 0x31bb, 0x2704, 0xae68, 0x680c, 0xa422, 0x6808, 0xa31b, - 0x0048, 0x33d5, 0x8a51, 0x00c0, 0x33c7, 0x1078, 0x1ce7, 0x8738, - 0x2704, 0xa005, 0x00c0, 0x33bb, 0x7098, 0xa075, 0x2060, 0x0040, - 0x33e8, 0x2039, 0x31b8, 0x0078, 0x33ba, 0x8422, 0x8420, 0x831a, - 0xa399, 0x0000, 0x690c, 0x2400, 0xa122, 0x6908, 0x2300, 0xa11b, - 0x00c8, 0x33e4, 0x1078, 0x1ce7, 0x2071, 0x0020, 0x0078, 0x330e, - 0x127f, 0x2000, 0x007c, 0x7008, 0xa084, 0x00c0, 0xa086, 0x00c0, - 0x0040, 0x3413, 0x2704, 0xac08, 0x2104, 0x701e, 0x8108, 0x2104, - 0x701a, 0x8108, 0x2104, 0x7016, 0x8108, 0x2104, 0x7012, 0x0f7e, - 0x2079, 0x0100, 0x7858, 0x0f7f, 0xa084, 0x0040, 0x0040, 0x340e, - 0xa684, 0x0001, 0x00c0, 0x340e, 0xa6b5, 0x0001, 0x7602, 0x7007, - 0x0001, 0x1078, 0x32be, 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, - 0x2200, 0x2049, 0x3414, 0x0d7f, 0x087f, 0x7108, 0xa184, 0x00c0, - 0x00c0, 0x342a, 0x6824, 0xa005, 0x0040, 0x343a, 0x0078, 0x3164, - 0x0078, 0x343a, 0x7108, 0x8104, 0x00c8, 0x3432, 0x1078, 0x322e, - 0x0078, 0x341d, 0x7007, 0x0010, 0x7108, 0x8104, 0x00c8, 0x3434, - 0x1078, 0x322e, 0x7008, 0xa086, 0x0002, 0x00c0, 0x341d, 0x7000, - 0xa005, 0x00c0, 0x341d, 0x7003, 0x0000, 0x2049, 0x0000, 0x127f, - 0x2000, 0x007c, 0x127e, 0x147e, 0x137e, 0x157e, 0x0d7e, 0x2091, - 0x2200, 0x0d7f, 0x2049, 0x344a, 0xad80, 0x0010, 0x20a0, 0x2099, - 0x0031, 0x700c, 0xa084, 0x007f, 0x6826, 0x7007, 0x0008, 0x7007, - 0x0002, 0x7003, 0x0001, 0x0040, 0x3468, 0x8000, 0x80ac, 0x53a5, - 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x346a, 0x2049, - 0x0000, 0x7003, 0x0000, 0x157f, 0x137f, 0x147f, 0x127f, 0x2000, - 0x007c, 0x127e, 0x007e, 0x0d7e, 0x2091, 0x2200, 0x0d7f, 0x2049, - 0x3479, 0x6880, 0x2060, 0x6884, 0x6b88, 0x6c8c, 0x8057, 0xaad4, - 0x00ff, 0xa084, 0x00ff, 0xa0b8, 0x31b8, 0x7e08, 0xa6b5, 0x0004, - 0x7007, 0x0004, 0x7004, 0xa084, 0x0004, 0x00c0, 0x3492, 0x2c58, - 0x2704, 0xac60, 0x6004, 0xa400, 0x701a, 0x6000, 0xa301, 0x701e, - 0x7013, 0x0001, 0x7017, 0x0000, 0x7602, 0x7007, 0x0001, 0x007f, - 0x8007, 0x2009, 0x0031, 0x200a, 0x00a0, 0x34ac, 0x7108, 0x7007, - 0x0002, 0x810c, 0x00c8, 0x34ac, 0x810c, 0x0048, 0x34b9, 0x0078, - 0x3270, 0xa4a0, 0x0001, 0xa399, 0x0000, 0x6b8a, 0x6c8e, 0x7007, - 0x0004, 0x2049, 0x0000, 0x7003, 0x0000, 0x127f, 0x2000, 0x007c, - 0x20a9, 0x0010, 0xa006, 0x8004, 0x8086, 0x818e, 0x00c8, 0x34d1, - 0xa200, 0x00f0, 0x34cc, 0x8086, 0x818e, 0x007c, 0x157e, 0x20a9, - 0x0010, 0xa005, 0x0040, 0x34f7, 0xa11a, 0x00c8, 0x34f7, 0x8213, - 0x818d, 0x0048, 0x34ea, 0xa11a, 0x00c8, 0x34eb, 0x00f0, 0x34df, - 0x0078, 0x34ef, 0xa11a, 0x2308, 0x8210, 0x00f0, 0x34df, 0x007e, - 0x3200, 0xa084, 0xf7ff, 0x2080, 0x007f, 0x157f, 0x007c, 0x007e, - 0x3200, 0xa085, 0x0800, 0x0078, 0x34f3, 0x00e0, 0x3563, 0x2091, - 0x6000, 0x7820, 0x8001, 0x7822, 0x00c0, 0x355b, 0x7824, 0x7822, - 0x2009, 0x3834, 0x2104, 0xa005, 0x00c0, 0x3510, 0x2001, 0x0010, - 0x8001, 0x200a, 0x077e, 0x803f, 0x1078, 0x2f11, 0x077f, 0x20a9, - 0x0020, 0x601f, 0x0064, 0xace0, 0x0010, 0x00f0, 0x3519, 0x2091, - 0x8000, 0x2069, 0x3840, 0x6800, 0xa084, 0x0007, 0x0040, 0x3538, - 0xa086, 0x0002, 0x0040, 0x3538, 0x6830, 0xa00d, 0x0040, 0x3538, - 0x2104, 0xa005, 0x0040, 0x3538, 0x8001, 0x200a, 0x0040, 0x3640, - 0x2061, 0x3b00, 0x2009, 0x0002, 0x20a9, 0x0100, 0x603c, 0xa005, - 0x0040, 0x354e, 0x8001, 0x603e, 0x00c0, 0x354e, 0x6010, 0xa005, - 0x0040, 0x354e, 0x017e, 0x1078, 0x1b49, 0x017f, 0xace0, 0x0010, - 0x0070, 0x3554, 0x0078, 0x353e, 0x8109, 0x0040, 0x355b, 0x20a9, - 0x0100, 0x0078, 0x353e, 0x1078, 0x3578, 0x1078, 0x3566, 0x1078, - 0x359d, 0x1078, 0x3707, 0x2091, 0x8001, 0x007c, 0x783c, 0x8001, - 0x783e, 0x00c0, 0x3577, 0x7840, 0x783e, 0x7848, 0xa005, 0x0040, - 0x3577, 0x8001, 0x784a, 0x00c0, 0x3577, 0x1078, 0x1b49, 0x007c, - 0x7834, 0x8001, 0x7836, 0x00c0, 0x359c, 0x7838, 0x7836, 0x2091, - 0x8000, 0x7844, 0xa005, 0x00c0, 0x3587, 0x2001, 0x0101, 0x8001, - 0x7846, 0xa080, 0x5b00, 0x2040, 0x2004, 0xa065, 0x0040, 0x359c, - 0x6020, 0xa005, 0x0040, 0x3598, 0x8001, 0x6022, 0x0040, 0x35cc, - 0x6000, 0x2c40, 0x0078, 0x358d, 0x007c, 0x7828, 0x8001, 0x782a, - 0x00c0, 0x35cb, 0x782c, 0x782a, 0x7830, 0xa005, 0x00c0, 0x35aa, - 0x2001, 0x0200, 0x8001, 0x7832, 0x8003, 0x8003, 0x8003, 0x8003, - 0xa090, 0x3b00, 0xa298, 0x0002, 0x2304, 0xa084, 0x0008, 0x0040, - 0x35cb, 0xa290, 0x0009, 0x2204, 0xa005, 0x0040, 0x35c3, 0x8001, - 0x2012, 0x00c0, 0x35cb, 0x2304, 0xa084, 0xfff7, 0xa085, 0x0080, - 0x201a, 0x1078, 0x1b49, 0x007c, 0x2069, 0x3840, 0x6800, 0xa005, - 0x0040, 0x35d6, 0x683c, 0xac06, 0x0040, 0x3640, 0x6710, 0x6fb6, - 0x1078, 0x1758, 0x6808, 0xa084, 0x0020, 0x00c0, 0x363d, 0x2009, - 0x382b, 0x2104, 0xa005, 0x0040, 0x35e9, 0x6023, 0x0001, 0x0078, - 0x363d, 0x6808, 0xa084, 0xffef, 0xa085, 0x0021, 0x6017, 0x0006, - 0x60b0, 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff, 0xa085, - 0x0060, 0x601e, 0x6000, 0x2042, 0x6710, 0x6fb6, 0x1078, 0x1758, - 0x6818, 0xa005, 0x0040, 0x3606, 0x8001, 0x681a, 0x6808, 0xa084, - 0xffef, 0x680a, 0x6810, 0x8001, 0x00d0, 0x3610, 0x1078, 0x1ce7, - 0x6812, 0x602f, 0x0000, 0x602b, 0x0000, 0x2c68, 0x1078, 0x18b6, - 0x2069, 0x3840, 0x6710, 0xa784, 0x0f00, 0x68b6, 0x2001, 0x0002, - 0x1078, 0x1b44, 0x2041, 0x0021, 0x2049, 0x0005, 0x2051, 0x0030, - 0x1078, 0x1765, 0x2011, 0x3835, 0x2214, 0x6a3e, 0x8738, 0xa784, - 0x001f, 0x00c0, 0x3622, 0x2009, 0x382b, 0x200b, 0x0008, 0x2009, - 0x382c, 0x2069, 0x3840, 0x68b4, 0x200a, 0x2091, 0x8001, 0x007c, - 0x2009, 0x384f, 0x2164, 0x2069, 0x0100, 0x1078, 0x1c97, 0x6017, - 0x0006, 0x6858, 0xa084, 0x3f00, 0x601a, 0x601c, 0xa084, 0x00ff, - 0xa085, 0x0048, 0x601e, 0x602f, 0x0000, 0x602b, 0x0000, 0x6830, - 0xa084, 0x0040, 0x0040, 0x367c, 0x684b, 0x0004, 0x20a9, 0x0014, - 0x6848, 0xa084, 0x0004, 0x0040, 0x3669, 0x0070, 0x3669, 0x0078, - 0x3660, 0x684b, 0x0009, 0x20a9, 0x0014, 0x6848, 0xa084, 0x0001, - 0x0040, 0x3676, 0x0070, 0x3676, 0x0078, 0x366d, 0x20a9, 0x00fa, - 0x0070, 0x367c, 0x0078, 0x3678, 0x6808, 0xa084, 0xfffd, 0x680a, - 0x681b, 0x0046, 0x2009, 0x3868, 0x200b, 0x0007, 0x784c, 0x784a, - 0x2091, 0x8001, 0x007c, 0x2079, 0x3800, 0x1078, 0x36de, 0x1078, - 0x36a6, 0x1078, 0x36b4, 0x1078, 0x36c9, 0x1078, 0x36f3, 0x2009, - 0x3833, 0x200b, 0x0000, 0x2009, 0x3834, 0x200b, 0x0000, 0x7833, - 0x0000, 0x7847, 0x0000, 0x784b, 0x0000, 0x007c, 0x2019, 0x0003, - 0x2011, 0x3846, 0x2204, 0xa086, 0x003c, 0x0040, 0x36b1, 0x2019, - 0x0002, 0x7b2a, 0x7b2e, 0x007c, 0x2019, 0x0030, 0x2011, 0x3846, - 0x2204, 0xa086, 0x0032, 0x0040, 0x36c6, 0x2019, 0x0039, 0x2204, - 0xa086, 0x003c, 0x0040, 0x36c6, 0x2019, 0x0027, 0x7b36, 0x7b3a, - 0x007c, 0x2019, 0x000f, 0x2011, 0x3846, 0x2204, 0xa086, 0x003c, - 0x0040, 0x36db, 0x2019, 0x000d, 0x2204, 0xa086, 0x0032, 0x0040, - 0x36db, 0x2019, 0x000a, 0x7b3e, 0x7b42, 0x007c, 0x2019, 0x2faf, - 0x2011, 0x3846, 0x2204, 0xa086, 0x0032, 0x0040, 0x36f0, 0x2019, - 0x3971, 0x2204, 0xa086, 0x003c, 0x0040, 0x36f0, 0x2019, 0x2626, - 0x7b22, 0x7b26, 0x007c, 0x2019, 0x0001, 0x2011, 0x3846, 0x2204, - 0xa086, 0x003c, 0x0040, 0x36fe, 0x2019, 0x0001, 0x017e, 0x2009, - 0x3831, 0x230a, 0x2009, 0x3832, 0x230a, 0x017f, 0x007c, 0x2009, - 0x3831, 0x2104, 0x8001, 0x200a, 0xa005, 0x00c0, 0x3755, 0x2009, - 0x3832, 0x2104, 0x2009, 0x3831, 0x200a, 0x2009, 0x3833, 0x2104, - 0xa005, 0x00c0, 0x371d, 0x2001, 0x0200, 0x8001, 0x200a, 0x8003, - 0x8003, 0x8003, 0x8003, 0xa090, 0x3b00, 0x2208, 0xa298, 0x0002, - 0x2304, 0xa084, 0x0200, 0x0040, 0x3755, 0xa290, 0x000e, 0x2204, - 0xa005, 0x0040, 0x3740, 0x8001, 0x0040, 0x3740, 0x8001, 0x0040, - 0x3740, 0x8001, 0x0040, 0x3740, 0x8001, 0x2012, 0x00c0, 0x3755, - 0x2012, 0x2304, 0xa084, 0xfdff, 0xa085, 0x0400, 0x201a, 0xa188, - 0x000c, 0x2104, 0x007e, 0xa084, 0x00ff, 0x8001, 0x027f, 0xa294, - 0xff00, 0xa205, 0x200a, 0x1078, 0x1b49, 0x007c, 0x6ed0 -}; diff --git a/sys/dev/ispfw/ispfw.c b/sys/dev/ispfw/ispfw.c index 3c963663939d..2fface805a63 100644 --- a/sys/dev/ispfw/ispfw.c +++ b/sys/dev/ispfw/ispfw.c @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #if defined(ISP_ALL) || !defined(KLD_MODULE) -#ifdef __sparc64__ -#define ISP_1000 1 -#endif #define ISP_1040 1 #define ISP_1040_IT 1 #define ISP_1080 1 @@ -60,13 +57,6 @@ __FBSDID("$FreeBSD$"); #define MODULE_NAME "ispfw" #endif -#if defined(ISP_1000) -#ifdef __sparc64__ -#include <dev/ispfw/asm_1000.h> -#else -#error "firmware not compatible with this platform" -#endif -#endif #if defined(ISP_1040) || defined(ISP_1040_IT) #include <dev/ispfw/asm_1040.h> #endif @@ -95,9 +85,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ispfw/asm_2500.h> #endif -#if defined(ISP_1000) -static int isp_1000_loaded; -#endif #if defined(ISP_1040) static int isp_1040_loaded; #endif @@ -152,9 +139,6 @@ static int do_load_fw(void) { -#if defined(ISP_1000) - RMACRO(isp_1000); -#endif #if defined(ISP_1040) RMACRO(isp_1040); #endif @@ -190,9 +174,6 @@ do_unload_fw(void) { int error = 0; -#if defined(ISP_1000) - UMACRO(isp_1000); -#endif #if defined(ISP_1040) UMACRO(isp_1040); #endif @@ -240,8 +221,6 @@ static moduledata_t ispfw_mod = { }; #if defined(ISP_ALL) || !defined(KLD_MODULE) DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); -#elif defined(ISP_1000) -DECLARE_MODULE(isp_1000, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_1040) DECLARE_MODULE(isp_1040, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); #elif defined(ISP_1080) diff --git a/sys/dev/le/if_le_lebuffer.c b/sys/dev/le/if_le_lebuffer.c deleted file mode 100644 index 630a47a921fb..000000000000 --- a/sys/dev/le/if_le_lebuffer.c +++ /dev/null @@ -1,393 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD - * - * Copyright (c) 2006 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/endian.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/rman.h> -#include <sys/socket.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <net/ethernet.h> -#include <net/if.h> -#include <net/if_media.h> - -#include <dev/le/lancereg.h> -#include <dev/le/lancevar.h> -#include <dev/le/am7990reg.h> -#include <dev/le/am7990var.h> - -/* - * LANCE registers - */ -#define LEREG1_RDP 0 /* Register Data port */ -#define LEREG1_RAP 2 /* Register Address port */ - -struct le_lebuffer_softc { - struct am7990_softc sc_am7990; /* glue to MI code */ - - struct resource *sc_bres; - - struct resource *sc_rres; - - struct resource *sc_ires; - void *sc_ih; -}; - -static devclass_t le_lebuffer_devclass; - -static device_probe_t le_lebuffer_probe; -static device_attach_t le_lebuffer_attach; -static device_detach_t le_lebuffer_detach; -static device_resume_t le_buffer_resume; -static device_suspend_t le_buffer_suspend; - -static device_method_t le_lebuffer_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, le_lebuffer_probe), - DEVMETHOD(device_attach, le_lebuffer_attach), - DEVMETHOD(device_detach, le_lebuffer_detach), - /* We can just use the suspend method here. */ - DEVMETHOD(device_shutdown, le_buffer_suspend), - DEVMETHOD(device_suspend, le_buffer_suspend), - DEVMETHOD(device_resume, le_buffer_resume), - - { 0, 0 } -}; - -DEFINE_CLASS_0(le, le_lebuffer_driver, le_lebuffer_methods, - sizeof(struct le_lebuffer_softc)); -DRIVER_MODULE(le, lebuffer, le_lebuffer_driver, le_lebuffer_devclass, 0, 0); -MODULE_DEPEND(le, ether, 1, 1, 1); -MODULE_DEPEND(le, lebuffer, 1, 1, 1); - -/* - * Media types supported - */ -static const int le_lebuffer_media[] = { - IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0) -}; -#define NLEMEDIA nitems(le_lebuffer_media) - -static void le_lebuffer_wrcsr(struct lance_softc *, uint16_t, uint16_t); -static uint16_t le_lebuffer_rdcsr(struct lance_softc *, uint16_t); -static void le_lebuffer_copytodesc(struct lance_softc *, void *, int, int); -static void le_lebuffer_copyfromdesc(struct lance_softc *, void *, int, int); -static void le_lebuffer_copytobuf(struct lance_softc *, void *, int, int); -static void le_lebuffer_copyfrombuf(struct lance_softc *, void *, int, int); -static void le_lebuffer_zerobuf(struct lance_softc *, int, int); - -static void -le_lebuffer_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - - bus_write_2(lesc->sc_rres, LEREG1_RAP, port); - bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); - bus_write_2(lesc->sc_rres, LEREG1_RDP, val); -} - -static uint16_t -le_lebuffer_rdcsr(struct lance_softc *sc, uint16_t port) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - - bus_write_2(lesc->sc_rres, LEREG1_RAP, port); - bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); - return (bus_read_2(lesc->sc_rres, LEREG1_RDP)); -} - -/* - * It turns out that using bus_space(9) to access the buffers and the - * descriptors yields way more throughput than accessing them via the - * KVA returned by rman_get_virtual(9). The descriptor rings can be - * accessed using 8-bit up to 64-bit operations while the buffers can - * be only accessed using 8-bit and 16-bit operations. - * NB: For whatever reason setting LE_C3_BSWP has no effect with at - * least the 501-2981 (although their 'busmaster-regval' property - * indicates to set LE_C3_BSWP also for these cards), so we need - * to manually byte swap access to the buffers, i.e. the accesses - * going through the RX/TX FIFOs. - */ - -static void -le_lebuffer_copytodesc(struct lance_softc *sc, void *fromv, int off, int len) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - caddr_t from = fromv; - - for (; len >= 8; len -= 8, off += 8, from += 8) - bus_write_8(lesc->sc_bres, off, be64dec(from)); - for (; len >= 4; len -= 4, off += 4, from += 4) - bus_write_4(lesc->sc_bres, off, be32dec(from)); - for (; len >= 2; len -= 2, off += 2, from += 2) - bus_write_2(lesc->sc_bres, off, be16dec(from)); - if (len == 1) - bus_write_1(lesc->sc_bres, off, *from); -} - -static void -le_lebuffer_copyfromdesc(struct lance_softc *sc, void *tov, int off, int len) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - caddr_t to = tov; - - for (; len >= 8; len -= 8, off += 8, to += 8) - be64enc(to, - bus_read_8(lesc->sc_bres, off)); - for (; len >= 4; len -= 4, off += 4, to += 4) - be32enc(to, - bus_read_4(lesc->sc_bres, off)); - for (; len >= 2; len -= 2, off += 2, to += 2) - be16enc(to, - bus_read_2(lesc->sc_bres, off)); - if (len == 1) - *to = bus_read_1(lesc->sc_bres, off); -} - -static void -le_lebuffer_copytobuf(struct lance_softc *sc, void *fromv, int off, int len) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - caddr_t from = fromv; - - for (; len >= 2; len -= 2, off += 2, from += 2) - bus_write_2(lesc->sc_bres, off, le16dec(from)); - if (len == 1) - bus_write_1(lesc->sc_bres, off + 1, *from); -} - -static void -le_lebuffer_copyfrombuf(struct lance_softc *sc, void *tov, int off, int len) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - caddr_t to = tov; - - for (; len >= 2; len -= 2, off += 2, to += 2) - le16enc(to, - bus_read_2(lesc->sc_bres, off)); - if (len == 1) - *to = bus_read_1(lesc->sc_bres, off + 1); -} - -static void -le_lebuffer_zerobuf(struct lance_softc *sc, int off, int len) -{ - struct le_lebuffer_softc *lesc = (struct le_lebuffer_softc *)sc; - - for (; len >= 2; len -= 2, off += 2) - bus_write_2(lesc->sc_bres, off, 0); - if (len == 1) - bus_write_1(lesc->sc_bres, off + 1, 0); -} - -static int -le_lebuffer_probe(device_t dev) -{ - - if (strcmp(ofw_bus_get_name(dev), "le") == 0) { - device_set_desc(dev, "LANCE Ethernet"); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); -} - -static int -le_lebuffer_attach(device_t dev) -{ - struct le_lebuffer_softc *lesc; - struct lance_softc *sc; - int error, i; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - LE_LOCK_INIT(sc, device_get_nameunit(dev)); - - /* - * The "register space" of the parent is just a buffer where the - * the LANCE descriptor rings and the RX/TX buffers can be stored. - */ - i = 0; - lesc->sc_bres = bus_alloc_resource_any(device_get_parent(dev), - SYS_RES_MEMORY, &i, RF_ACTIVE); - if (lesc->sc_bres == NULL) { - device_printf(dev, "cannot allocate LANCE buffer\n"); - error = ENXIO; - goto fail_mtx; - } - - /* Allocate LANCE registers. */ - i = 0; - lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (lesc->sc_rres == NULL) { - device_printf(dev, "cannot allocate LANCE registers\n"); - error = ENXIO; - goto fail_bres; - } - - /* Allocate LANCE interrupt. */ - i = 0; - if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate interrupt\n"); - error = ENXIO; - goto fail_rres; - } - - /* - * LANCE view is offset by buffer location. - * Note that we don't use sc->sc_mem. - */ - sc->sc_addr = 0; - sc->sc_memsize = rman_get_size(lesc->sc_bres); - sc->sc_flags = 0; - - /* That old black magic... */ - if (OF_getprop(ofw_bus_get_node(dev), "busmaster-regval", - &sc->sc_conf3, sizeof(sc->sc_conf3)) == -1) - sc->sc_conf3 = LE_C3_ACON | LE_C3_BCON; - /* - * Make sure LE_C3_BSWP is cleared so that for cards where - * that flag actually works le_lebuffer_copy{from,to}buf() - * don't fail... - */ - sc->sc_conf3 &= ~LE_C3_BSWP; - - OF_getetheraddr(dev, sc->sc_enaddr); - - sc->sc_copytodesc = le_lebuffer_copytodesc; - sc->sc_copyfromdesc = le_lebuffer_copyfromdesc; - sc->sc_copytobuf = le_lebuffer_copytobuf; - sc->sc_copyfrombuf = le_lebuffer_copyfrombuf; - sc->sc_zerobuf = le_lebuffer_zerobuf; - - sc->sc_rdcsr = le_lebuffer_rdcsr; - sc->sc_wrcsr = le_lebuffer_wrcsr; - sc->sc_hwreset = NULL; - sc->sc_hwinit = NULL; - sc->sc_hwintr = NULL; - sc->sc_nocarrier = NULL; - sc->sc_mediachange = NULL; - sc->sc_mediastatus = NULL; - sc->sc_supmedia = le_lebuffer_media; - sc->sc_nsupmedia = NLEMEDIA; - sc->sc_defaultmedia = le_lebuffer_media[0]; - - error = am7990_config(&lesc->sc_am7990, device_get_name(dev), - device_get_unit(dev)); - if (error != 0) { - device_printf(dev, "cannot attach Am7990\n"); - goto fail_ires; - } - - error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - NULL, am7990_intr, sc, &lesc->sc_ih); - if (error != 0) { - device_printf(dev, "cannot set up interrupt\n"); - goto fail_am7990; - } - - return (0); - - fail_am7990: - am7990_detach(&lesc->sc_am7990); - fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(lesc->sc_ires), lesc->sc_ires); - fail_rres: - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(lesc->sc_rres), lesc->sc_rres); - fail_bres: - bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - rman_get_rid(lesc->sc_bres), lesc->sc_bres); - fail_mtx: - LE_LOCK_DESTROY(sc); - return (error); -} - -static int -le_lebuffer_detach(device_t dev) -{ - struct le_lebuffer_softc *lesc; - struct lance_softc *sc; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih); - am7990_detach(&lesc->sc_am7990); - bus_release_resource(dev, SYS_RES_IRQ, - rman_get_rid(lesc->sc_ires), lesc->sc_ires); - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(lesc->sc_rres), lesc->sc_rres); - bus_release_resource(device_get_parent(dev), SYS_RES_MEMORY, - rman_get_rid(lesc->sc_bres), lesc->sc_bres); - LE_LOCK_DESTROY(sc); - - return (0); -} - -static int -le_buffer_suspend(device_t dev) -{ - struct le_lebuffer_softc *lesc; - - lesc = device_get_softc(dev); - - lance_suspend(&lesc->sc_am7990.lsc); - - return (0); -} - -static int -le_buffer_resume(device_t dev) -{ - struct le_lebuffer_softc *lesc; - - lesc = device_get_softc(dev); - - lance_resume(&lesc->sc_am7990.lsc); - - return (0); -} diff --git a/sys/dev/le/if_le_ledma.c b/sys/dev/le/if_le_ledma.c deleted file mode 100644 index 482c2341038c..000000000000 --- a/sys/dev/le/if_le_ledma.c +++ /dev/null @@ -1,496 +0,0 @@ -/* $NetBSD: if_le_ledma.c,v 1.26 2005/12/11 12:23:44 christos Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD - * - * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum; Jason R. Thorpe of the Numerical Aerospace - * Simulation Facility, NASA Ames Research Center; Paul Kranenburg. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 FOUNDATION OR CONTRIBUTORS - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/endian.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/rman.h> -#include <sys/socket.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <machine/ofw_machdep.h> -#include <machine/resource.h> - -#include <net/ethernet.h> -#include <net/if.h> -#include <net/if_var.h> -#include <net/if_media.h> - -#include <sparc64/sbus/lsi64854reg.h> -#include <sparc64/sbus/lsi64854var.h> - -#include <dev/le/lancereg.h> -#include <dev/le/lancevar.h> -#include <dev/le/am7990var.h> - -#define LEDMA_ALIGNMENT 8 /* ring desc. alignmet for NCR92C990 */ -#define LEDMA_BOUNDARY (16*1024*1024) /* must not cross 16MB boundary */ -#define LEDMA_MEMSIZE (16*1024) /* LANCE memory size */ -#define LEREG1_RDP 0 /* Register Data Port */ -#define LEREG1_RAP 2 /* Register Address Port */ - -struct le_dma_softc { - struct am7990_softc sc_am7990; /* glue to MI code */ - - struct resource *sc_rres; - - struct resource *sc_ires; - void *sc_ih; - - bus_dma_tag_t sc_dmat; - bus_dmamap_t sc_dmam; - bus_addr_t sc_laddr; /* LANCE DMA address */ - - struct lsi64854_softc *sc_dma; /* pointer to DMA engine */ -}; - -static device_probe_t le_dma_probe; -static device_attach_t le_dma_attach; -static device_detach_t le_dma_detach; -static device_resume_t le_dma_resume; -static device_suspend_t le_dma_suspend; - -static device_method_t le_dma_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, le_dma_probe), - DEVMETHOD(device_attach, le_dma_attach), - DEVMETHOD(device_detach, le_dma_detach), - /* We can just use the suspend method here. */ - DEVMETHOD(device_shutdown, le_dma_suspend), - DEVMETHOD(device_suspend, le_dma_suspend), - DEVMETHOD(device_resume, le_dma_resume), - - { 0, 0 } -}; - -DEFINE_CLASS_0(le, le_dma_driver, le_dma_methods, sizeof(struct le_dma_softc)); -DRIVER_MODULE(le, dma, le_dma_driver, le_devclass, 0, 0); -MODULE_DEPEND(le, dma, 1, 1, 1); -MODULE_DEPEND(le, ether, 1, 1, 1); - -/* - * Media types supported - */ -static const int le_dma_supmedia[] = { - IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, 0), - IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0), - IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, 0) -}; - -static void le_dma_wrcsr(struct lance_softc *, uint16_t, uint16_t); -static uint16_t le_dma_rdcsr(struct lance_softc *, uint16_t); -static void le_dma_setutp(struct lance_softc *); -static void le_dma_setaui(struct lance_softc *); -static int le_dma_supmediachange(struct lance_softc *); -static void le_dma_supmediastatus(struct lance_softc *, struct ifmediareq *); -static void le_dma_hwreset(struct lance_softc *); -static int le_dma_hwintr(struct lance_softc *); -static void le_dma_nocarrier(struct lance_softc *); -static bus_dmamap_callback_t le_dma_dma_callback; - -static void -le_dma_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)sc; - - bus_write_2(lesc->sc_rres, LEREG1_RAP, port); - bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); - bus_write_2(lesc->sc_rres, LEREG1_RDP, val); -} - -static uint16_t -le_dma_rdcsr(struct lance_softc *sc, uint16_t port) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)sc; - - bus_write_2(lesc->sc_rres, LEREG1_RAP, port); - bus_barrier(lesc->sc_rres, LEREG1_RAP, 2, BUS_SPACE_BARRIER_WRITE); - return (bus_read_2(lesc->sc_rres, LEREG1_RDP)); -} - -static void -le_dma_setutp(struct lance_softc *sc) -{ - struct lsi64854_softc *dma = ((struct le_dma_softc *)sc)->sc_dma; - - L64854_SCSR(dma, L64854_GCSR(dma) | E_TP_AUI); - DELAY(20000); /* We must not touch the LANCE chip for 20ms. */ -} - -static void -le_dma_setaui(struct lance_softc *sc) -{ - struct lsi64854_softc *dma = ((struct le_dma_softc *)sc)->sc_dma; - - L64854_SCSR(dma, L64854_GCSR(dma) & ~E_TP_AUI); - DELAY(20000); /* We must not touch the LANCE chip for 20ms. */ -} - -static int -le_dma_supmediachange(struct lance_softc *sc) -{ - struct ifmedia *ifm = &sc->sc_media; - - if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) - return (EINVAL); - - /* - * Switch to the selected media. If autoselect is set, we don't - * really have to do anything. We'll switch to the other media - * when we detect loss of carrier. - */ - switch (IFM_SUBTYPE(ifm->ifm_media)) { - case IFM_10_T: - le_dma_setutp(sc); - break; - - case IFM_10_5: - le_dma_setaui(sc); - break; - - case IFM_AUTO: - break; - - default: - return (EINVAL); - } - - return (0); -} - -static void -le_dma_supmediastatus(struct lance_softc *sc, struct ifmediareq *ifmr) -{ - struct lsi64854_softc *dma = ((struct le_dma_softc *)sc)->sc_dma; - - /* - * Notify the world which media we're currently using. - */ - if (L64854_GCSR(dma) & E_TP_AUI) - ifmr->ifm_active = IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0); - else - ifmr->ifm_active = IFM_MAKEWORD(IFM_ETHER, IFM_10_5, 0, 0); -} - -static void -le_dma_hwreset(struct lance_softc *sc) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)sc; - struct lsi64854_softc *dma = lesc->sc_dma; - uint32_t aui_bit, csr; - - /* - * Reset DMA channel. - */ - csr = L64854_GCSR(dma); - aui_bit = csr & E_TP_AUI; - DMA_RESET(dma); - - /* Write bits 24-31 of Lance address. */ - bus_write_4(dma->sc_res, L64854_REG_ENBAR, - lesc->sc_laddr & 0xff000000); - - DMA_ENINTR(dma); - - /* - * Disable E-cache invalidates on chip writes. - * Retain previous cable selection bit. - */ - csr = L64854_GCSR(dma); - csr |= (E_DSBL_WR_INVAL | aui_bit); - L64854_SCSR(dma, csr); - DELAY(20000); /* We must not touch the LANCE chip for 20ms. */ -} - -static int -le_dma_hwintr(struct lance_softc *sc) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)sc; - struct lsi64854_softc *dma = lesc->sc_dma; - - return (DMA_INTR(dma)); -} - -static void -le_dma_nocarrier(struct lance_softc *sc) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)sc; - - /* - * Check if the user has requested a certain cable type, and - * if so, honor that request. - */ - - if (L64854_GCSR(lesc->sc_dma) & E_TP_AUI) { - switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) { - case IFM_10_5: - case IFM_AUTO: - if_printf(sc->sc_ifp, "lost carrier on UTP port, " - "switching to AUI port\n"); - le_dma_setaui(sc); - } - } else { - switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) { - case IFM_10_T: - case IFM_AUTO: - if_printf(sc->sc_ifp, "lost carrier on AUI port, " - "switching to UTP port\n"); - le_dma_setutp(sc); - } - } -} - -static void -le_dma_dma_callback(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) -{ - struct le_dma_softc *lesc = (struct le_dma_softc *)xsc; - - if (error != 0) - return; - KASSERT(nsegs == 1, ("%s: bad DMA segment count", __func__)); - lesc->sc_laddr = segs[0].ds_addr; -} - -static int -le_dma_probe(device_t dev) -{ - - if (strcmp(ofw_bus_get_name(dev), "le") == 0) { - device_set_desc(dev, "LANCE Ethernet"); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); -} - -static int -le_dma_attach(device_t dev) -{ - struct le_dma_softc *lesc; - struct lsi64854_softc *dma; - struct lance_softc *sc; - int error, i; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - LE_LOCK_INIT(sc, device_get_nameunit(dev)); - - /* - * Establish link to `ledma' device. - * XXX hackery. - */ - dma = (struct lsi64854_softc *)device_get_softc(device_get_parent(dev)); - lesc->sc_dma = dma; - lesc->sc_dma->sc_client = lesc; - - i = 0; - lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &i, RF_ACTIVE); - if (lesc->sc_rres == NULL) { - device_printf(dev, "cannot allocate registers\n"); - error = ENXIO; - goto fail_mtx; - } - - i = 0; - if ((lesc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &i, RF_SHAREABLE | RF_ACTIVE)) == NULL) { - device_printf(dev, "cannot allocate interrupt\n"); - error = ENXIO; - goto fail_rres; - } - - /* Attach the DMA engine. */ - error = lsi64854_attach(dma); - if (error != 0) { - device_printf(dev, "lsi64854_attach failed\n"); - goto fail_ires; - } - - sc->sc_memsize = LEDMA_MEMSIZE; - error = bus_dma_tag_create( - dma->sc_parent_dmat, /* parent */ - LEDMA_ALIGNMENT, /* alignment */ - LEDMA_BOUNDARY, /* boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - sc->sc_memsize, /* maxsize */ - 1, /* nsegments */ - sc->sc_memsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &lesc->sc_dmat); - if (error != 0) { - device_printf(dev, "cannot allocate buffer DMA tag\n"); - goto fail_lsi; - } - - error = bus_dmamem_alloc(lesc->sc_dmat, (void **)&sc->sc_mem, - BUS_DMA_WAITOK | BUS_DMA_COHERENT, &lesc->sc_dmam); - if (error != 0) { - device_printf(dev, "cannot allocate DMA buffer memory\n"); - goto fail_dtag; - } - - lesc->sc_laddr = 0; - error = bus_dmamap_load(lesc->sc_dmat, lesc->sc_dmam, sc->sc_mem, - sc->sc_memsize, le_dma_dma_callback, lesc, 0); - if (error != 0 || lesc->sc_laddr == 0) { - device_printf(dev, "cannot load DMA buffer map\n"); - goto fail_dmem; - } - - sc->sc_addr = lesc->sc_laddr & 0xffffff; - sc->sc_flags = 0; - sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON; - - sc->sc_mediachange = le_dma_supmediachange; - sc->sc_mediastatus = le_dma_supmediastatus; - sc->sc_supmedia = le_dma_supmedia; - sc->sc_nsupmedia = nitems(le_dma_supmedia); - sc->sc_defaultmedia = le_dma_supmedia[0]; - - OF_getetheraddr(dev, sc->sc_enaddr); - - sc->sc_copytodesc = lance_copytobuf_contig; - sc->sc_copyfromdesc = lance_copyfrombuf_contig; - sc->sc_copytobuf = lance_copytobuf_contig; - sc->sc_copyfrombuf = lance_copyfrombuf_contig; - sc->sc_zerobuf = lance_zerobuf_contig; - - sc->sc_rdcsr = le_dma_rdcsr; - sc->sc_wrcsr = le_dma_wrcsr; - sc->sc_hwreset = le_dma_hwreset; - sc->sc_hwintr = le_dma_hwintr; - sc->sc_nocarrier = le_dma_nocarrier; - - error = am7990_config(&lesc->sc_am7990, device_get_name(dev), - device_get_unit(dev)); - if (error != 0) { - device_printf(dev, "cannot attach Am7990\n"); - goto fail_dmap; - } - - error = bus_setup_intr(dev, lesc->sc_ires, INTR_TYPE_NET | INTR_MPSAFE, - NULL, am7990_intr, sc, &lesc->sc_ih); - if (error != 0) { - device_printf(dev, "cannot set up interrupt\n"); - goto fail_am7990; - } - - return (0); - - fail_am7990: - am7990_detach(&lesc->sc_am7990); - fail_dmap: - bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam); - fail_dmem: - bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); - fail_dtag: - bus_dma_tag_destroy(lesc->sc_dmat); - fail_lsi: - lsi64854_detach(dma); - fail_ires: - bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(lesc->sc_ires), - lesc->sc_ires); - fail_rres: - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(lesc->sc_rres), - lesc->sc_rres); - fail_mtx: - LE_LOCK_DESTROY(sc); - return (error); -} - -static int -le_dma_detach(device_t dev) -{ - struct le_dma_softc *lesc; - struct lance_softc *sc; - int error; - - lesc = device_get_softc(dev); - sc = &lesc->sc_am7990.lsc; - - bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih); - am7990_detach(&lesc->sc_am7990); - bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam); - bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam); - bus_dma_tag_destroy(lesc->sc_dmat); - error = lsi64854_detach(lesc->sc_dma); - if (error != 0) - return (error); - bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(lesc->sc_ires), - lesc->sc_ires); - bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(lesc->sc_rres), - lesc->sc_rres); - LE_LOCK_DESTROY(sc); - - return (0); -} - -static int -le_dma_suspend(device_t dev) -{ - struct le_dma_softc *lesc; - - lesc = device_get_softc(dev); - - lance_suspend(&lesc->sc_am7990.lsc); - - return (0); -} - -static int -le_dma_resume(device_t dev) -{ - struct le_dma_softc *lesc; - - lesc = device_get_softc(dev); - - lance_resume(&lesc->sc_am7990.lsc); - - return (0); -} diff --git a/sys/dev/le/lebuffer_sbus.c b/sys/dev/le/lebuffer_sbus.c deleted file mode 100644 index f40aca1b6830..000000000000 --- a/sys/dev/le/lebuffer_sbus.c +++ /dev/null @@ -1,305 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2006 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/resource.h> -#include <sys/rman.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/ofw_bus_subr.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/bus_common.h> -#include <machine/resource.h> - -#include <sparc64/sbus/ofw_sbus.h> -#include <sparc64/sbus/sbusreg.h> -#include <sparc64/sbus/sbusvar.h> - -struct lebuffer_devinfo { - struct ofw_bus_devinfo ldi_obdinfo; - struct resource_list ldi_rl; -}; - -static devclass_t lebuffer_devclass; - -static device_probe_t lebuffer_probe; -static device_attach_t lebuffer_attach; -static device_detach_t lebuffer_detach; -static bus_print_child_t lebuffer_print_child; -static bus_probe_nomatch_t lebuffer_probe_nomatch; -static bus_get_resource_list_t lebuffer_get_resource_list; -static ofw_bus_get_devinfo_t lebuffer_get_devinfo; - -static struct lebuffer_devinfo *lebuffer_setup_dinfo(device_t, phandle_t); -static void lebuffer_destroy_dinfo(struct lebuffer_devinfo *); -static int lebuffer_print_res(struct lebuffer_devinfo *); - -static device_method_t lebuffer_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, lebuffer_probe), - DEVMETHOD(device_attach, lebuffer_attach), - DEVMETHOD(device_detach, lebuffer_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, lebuffer_print_child), - DEVMETHOD(bus_probe_nomatch, lebuffer_probe_nomatch), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), - DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_get_resource_list, lebuffer_get_resource_list), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, lebuffer_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - - { 0, 0 } -}; - -DEFINE_CLASS_0(lebuffer, lebuffer_driver, lebuffer_methods, 1); -DRIVER_MODULE(lebuffer, sbus, lebuffer_driver, lebuffer_devclass, 0, 0); -MODULE_DEPEND(lebuffer, sbus, 1, 1, 1); -MODULE_VERSION(lebuffer, 1); - -static int -lebuffer_probe(device_t dev) -{ - const char *name; - - name = ofw_bus_get_name(dev); - if (strcmp(name, "lebuffer") == 0) { - device_set_desc_copy(dev, name); - return (0); - } - return (ENXIO); -} - -static int -lebuffer_attach(device_t dev) -{ - struct lebuffer_devinfo *ldi; - device_t cdev; - phandle_t child; - int children; - - children = 0; - for (child = OF_child(ofw_bus_get_node(dev)); child != 0; - child = OF_peer(child)) { - if ((ldi = lebuffer_setup_dinfo(dev, child)) == NULL) - continue; - if (children != 0) { - device_printf(dev, - "<%s>: only one child per buffer supported\n", - ldi->ldi_obdinfo.obd_name); - lebuffer_destroy_dinfo(ldi); - continue; - } - if ((cdev = device_add_child(dev, NULL, -1)) == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - ldi->ldi_obdinfo.obd_name); - lebuffer_destroy_dinfo(ldi); - continue; - } - device_set_ivars(cdev, ldi); - children++; - } - return (bus_generic_attach(dev)); -} - -static int -lebuffer_detach(device_t dev) -{ - device_t *children; - int i, nchildren; - - bus_generic_detach(dev); - if (device_get_children(dev, &children, &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - lebuffer_destroy_dinfo(device_get_ivars(children[i])); - device_delete_child(dev, children[i]); - } - free(children, M_TEMP); - } - return (0); -} - -static struct lebuffer_devinfo * -lebuffer_setup_dinfo(device_t dev, phandle_t node) -{ - struct lebuffer_devinfo *ldi; - struct sbus_regs *reg; - uint32_t base, iv, *intr; - int i, nreg, nintr, slot, rslot; - - ldi = malloc(sizeof(*ldi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&ldi->ldi_obdinfo, node) != 0) { - free(ldi, M_DEVBUF); - return (NULL); - } - resource_list_init(&ldi->ldi_rl); - slot = -1; - nreg = OF_getprop_alloc_multi(node, "reg", sizeof(*reg), (void **)®); - if (nreg == -1) { - device_printf(dev, "<%s>: incomplete\n", - ldi->ldi_obdinfo.obd_name); - goto fail; - } - for (i = 0; i < nreg; i++) { - base = reg[i].sbr_offset; - if (SBUS_ABS(base)) { - rslot = SBUS_ABS_TO_SLOT(base); - base = SBUS_ABS_TO_OFFSET(base); - } else - rslot = reg[i].sbr_slot; - if (slot != -1 && slot != rslot) { - device_printf(dev, "<%s>: multiple slots\n", - ldi->ldi_obdinfo.obd_name); - OF_prop_free(reg); - goto fail; - } - slot = rslot; - - resource_list_add(&ldi->ldi_rl, SYS_RES_MEMORY, i, base, - base + reg[i].sbr_size, reg[i].sbr_size); - } - OF_prop_free(reg); - if (slot != sbus_get_slot(dev)) { - device_printf(dev, "<%s>: parent and child slot do not match\n", - ldi->ldi_obdinfo.obd_name); - goto fail; - } - - /* - * The `interrupts' property contains the SBus interrupt level. - */ - nintr = OF_getprop_alloc_multi(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr != -1) { - for (i = 0; i < nintr; i++) { - iv = intr[i]; - /* - * SBus card devices need the slot number encoded into - * the vector as this is generally not done. - */ - if ((iv & INTMAP_OBIO_MASK) == 0) - iv |= slot << 3; - /* Set the IGN as appropriate. */ - iv |= sbus_get_ign(dev) << INTMAP_IGN_SHIFT; - resource_list_add(&ldi->ldi_rl, SYS_RES_IRQ, i, - iv, iv, 1); - } - OF_prop_free(intr); - } - return (ldi); - - fail: - lebuffer_destroy_dinfo(ldi); - return (NULL); -} - -static void -lebuffer_destroy_dinfo(struct lebuffer_devinfo *dinfo) -{ - - resource_list_free(&dinfo->ldi_rl); - ofw_bus_gen_destroy_devinfo(&dinfo->ldi_obdinfo); - free(dinfo, M_DEVBUF); -} - -static int -lebuffer_print_child(device_t dev, device_t child) -{ - int rv; - - rv = bus_print_child_header(dev, child); - rv += lebuffer_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(dev, child); - return (rv); -} - -static void -lebuffer_probe_nomatch(device_t dev, device_t child) -{ - const char *type; - - device_printf(dev, "<%s>", ofw_bus_get_name(child)); - lebuffer_print_res(device_get_ivars(child)); - type = ofw_bus_get_type(child); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - -static struct resource_list * -lebuffer_get_resource_list(device_t dev, device_t child) -{ - struct lebuffer_devinfo *ldi; - - ldi = device_get_ivars(child); - return (&ldi->ldi_rl); -} - -static const struct ofw_bus_devinfo * -lebuffer_get_devinfo(device_t bus, device_t child) -{ - struct lebuffer_devinfo *ldi; - - ldi = device_get_ivars(child); - return (&ldi->ldi_obdinfo); -} - -static int -lebuffer_print_res(struct lebuffer_devinfo *ldi) -{ - int rv; - - rv = 0; - rv += resource_list_print_type(&ldi->ldi_rl, "mem", SYS_RES_MEMORY, - "%#jx"); - rv += resource_list_print_type(&ldi->ldi_rl, "irq", SYS_RES_IRQ, "%jd"); - return (rv); -} diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index 1bff77e3758c..8c9000a03e68 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -122,11 +122,6 @@ #include <machine/cpu.h> #include <machine/resource.h> -#ifdef __sparc64__ -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> -#endif - #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c index 2adaa95df32a..94c568c4c205 100644 --- a/sys/dev/mpt/mpt_pci.c +++ b/sys/dev/mpt/mpt_pci.c @@ -372,10 +372,6 @@ mpt_pci_attach(device_t dev) mpt->verbose = MPT_PRT_NONE; mpt->role = MPT_ROLE_NONE; mpt->mpt_ini_id = MPT_INI_ID_NONE; -#ifdef __sparc64__ - if (mpt->is_spi) - mpt->mpt_ini_id = OF_getscsinitid(dev); -#endif mpt_set_options(mpt); if (mpt->verbose == MPT_PRT_NONE) { mpt->verbose = MPT_PRT_WARN; diff --git a/sys/dev/mthca/mthca_srq.c b/sys/dev/mthca/mthca_srq.c index d22f970480c0..579c23a73654 100644 --- a/sys/dev/mthca/mthca_srq.c +++ b/sys/dev/mthca/mthca_srq.c @@ -115,16 +115,10 @@ static void mthca_arbel_init_srq_context(struct mthca_dev *dev, struct mthca_srq *srq, struct mthca_arbel_srq_context *context) { - int logsize, max; + int logsize; memset(context, 0, sizeof *context); - - /* - * Put max in a temporary variable to work around gcc bug - * triggered by ilog2() on sparc64. - */ - max = srq->max; - logsize = ilog2(max); + logsize = ilog2(srq->max); context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn); context->lkey = cpu_to_be32(srq->mr.ibmr.lkey); context->db_index = cpu_to_be32(srq->db_index); diff --git a/sys/dev/mxge/if_mxge_var.h b/sys/dev/mxge/if_mxge_var.h index dd9ec3ff2612..0c3950b5e005 100644 --- a/sys/dev/mxge/if_mxge_var.h +++ b/sys/dev/mxge/if_mxge_var.h @@ -325,27 +325,6 @@ struct mxge_pkt_info { }; -/* implement our own memory barriers, since bus_space_barrier - cannot handle write-combining regions */ - -#if __FreeBSD_version < 800053 - -#if defined (__GNUC__) - #if #cpu(i386) || defined __i386 || defined i386 || defined __i386__ || #cpu(x86_64) || defined __x86_64__ - #define wmb() __asm__ __volatile__ ("sfence;": : :"memory") - #elif #cpu(sparc64) || defined sparc64 || defined __sparcv9 - #define wmb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") - #elif #cpu(sparc) || defined sparc || defined __sparc__ - #define wmb() __asm__ __volatile__ ("stbar;": : :"memory") - #else - #define wmb() /* XXX just to make this compile */ - #endif -#else - #error "unknown compiler" -#endif - -#endif - static inline void mxge_pio_copy(volatile void *to_v, void *from_v, size_t size) { diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index 1f3f4bd0b255..53c8cdf88df8 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -178,13 +178,10 @@ int OF_interpret(const char *cmd, int nreturns, ...); /* * Decode the Nth register property of the given device node and create a bus * space tag and handle for accessing it. This is for use in setting up things - * like early console output before newbus is available. The implementation is - * machine-dependent, and sparc uses a different function signature as well. + * like early console output before newbus is available. */ -#ifndef __sparc64__ int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *ptag, bus_space_handle_t *phandle, bus_size_t *sz); -#endif #endif /* _KERNEL */ #endif /* _DEV_OPENFIRM_H_ */ diff --git a/sys/dev/pcf/envctrl.c b/sys/dev/pcf/envctrl.c deleted file mode 100644 index 1d57b36e000e..000000000000 --- a/sys/dev/pcf/envctrl.c +++ /dev/null @@ -1,194 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004 Joerg Wunsch - * - * derived from sys/i386/isa/pcf.c which is: - * - * Copyright (c) 1998 Nicolas Souchu, Marc Bouget - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * Device specific driver for the SUNW,envctrl device found on some - * UltraSPARC Sun systems. This device is a Philips PCF8584 sitting - * on the Ebus2. - */ - -#include <sys/param.h> -#include <sys/bus.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/malloc.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/systm.h> -#include <sys/uio.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <machine/resource.h> - -#include <sys/rman.h> - -#include <dev/iicbus/iicbus.h> -#include <dev/iicbus/iiconf.h> -#include <dev/pcf/pcfvar.h> -#include "iicbus_if.h" - -#undef PCF_DEFAULT_ADDR -#define PCF_DEFAULT_ADDR 0x55 /* SUNW,pcf default */ - -static int envctrl_probe(device_t); -static int envctrl_attach(device_t); -static int envctrl_detach(device_t); - -static device_method_t envctrl_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, envctrl_probe), - DEVMETHOD(device_attach, envctrl_attach), - DEVMETHOD(device_detach, envctrl_detach), - - /* iicbus interface */ - DEVMETHOD(iicbus_callback, iicbus_null_callback), - DEVMETHOD(iicbus_repeated_start, pcf_repeated_start), - DEVMETHOD(iicbus_start, pcf_start), - DEVMETHOD(iicbus_stop, pcf_stop), - DEVMETHOD(iicbus_write, pcf_write), - DEVMETHOD(iicbus_read, pcf_read), - DEVMETHOD(iicbus_reset, pcf_rst_card), - { 0, 0 } -}; - -static devclass_t envctrl_devclass; - -static driver_t envctrl_driver = { - "envctrl", - envctrl_methods, - sizeof(struct pcf_softc), -}; - -static int -envctrl_probe(device_t dev) -{ - - if (strcmp("SUNW,envctrl", ofw_bus_get_name(dev)) == 0) { - device_set_desc(dev, "EBus SUNW,envctrl"); - return (0); - } - return (ENXIO); -} - -static int -envctrl_attach(device_t dev) -{ - struct pcf_softc *sc; - int rv = ENXIO; - - sc = DEVTOSOFTC(dev); - mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); - - /* IO port is mandatory */ - sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->rid_ioport, RF_ACTIVE); - if (sc->res_ioport == 0) { - device_printf(dev, "cannot reserve I/O port range\n"); - goto error; - } - - sc->pcf_flags = device_get_flags(dev); - - if (!(sc->pcf_flags & IIC_POLLED)) { - sc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->rid_irq, - RF_ACTIVE); - if (sc->res_irq == 0) { - device_printf(dev, "can't reserve irq, polled mode.\n"); - sc->pcf_flags |= IIC_POLLED; - } - } - - /* reset the chip */ - pcf_rst_card(dev, IIC_FASTEST, PCF_DEFAULT_ADDR, NULL); - - rv = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET | INTR_MPSAFE /* | INTR_ENTROPY */, - NULL, pcf_intr, sc, &sc->intr_cookie); - if (rv) { - device_printf(dev, "could not setup IRQ\n"); - goto error; - } - - if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) - device_printf(dev, "could not allocate iicbus instance\n"); - - /* probe and attach the iicbus */ - bus_generic_attach(dev); - - return (0); - -error: - if (sc->res_irq != 0) { - bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, - sc->res_irq); - } - if (sc->res_ioport != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, - sc->res_ioport); - } - mtx_destroy(&sc->pcf_lock); - return (rv); -} - -static int -envctrl_detach(device_t dev) -{ - struct pcf_softc *sc; - int rv; - - sc = DEVTOSOFTC(dev); - - if ((rv = bus_generic_detach(dev)) != 0) - return (rv); - - if ((rv = device_delete_child(dev, sc->iicbus)) != 0) - return (rv); - - if (sc->res_irq != 0) { - bus_teardown_intr(dev, sc->res_irq, sc->intr_cookie); - bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq); - } - - bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport); - mtx_destroy(&sc->pcf_lock); - - return (0); -} - -DRIVER_MODULE(envctrl, ebus, envctrl_driver, envctrl_devclass, 0, 0); -DRIVER_MODULE(iicbus, envctrl, iicbus_driver, iicbus_devclass, 0, 0); diff --git a/sys/dev/pcf/pcf_ebus.c b/sys/dev/pcf/pcf_ebus.c deleted file mode 100644 index 3fa0be6b26cc..000000000000 --- a/sys/dev/pcf/pcf_ebus.c +++ /dev/null @@ -1,256 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004 Marius Strobl, Joerg Wunsch - * - * derived from sys/i386/isa/pcf.c which is: - * - * Copyright (c) 1998 Nicolas Souchu, Marc Bouget - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -/* - * Device specific driver for the EBus i2c devices found on some sun4u - * systems. On systems not having a boot-bus controller the i2c devices - * are PCF8584. - * - * Known onboard slave devices on the primary bus are: - * - * AXe: - * 0x40 PCF8574 I/O fan status (CPU fans 1+2) - * 0x9e PCF8591 A/D temperature (CPU + hotspot) - * - * AXmp: - * 0x70 PCF8574 I/O fan status (fans 1-4) - * 0x78 PCF8574 I/O fan fail interrupt - * 0x9a PCF8591 A/D voltage (CPU core) - * 0x9c PCF8591 A/D temperature (hotspots 1+2, aux. analog 1+2) - * 0x9e PCF8591 A/D temperature (CPUs 1-4) - * - * CP1400: - * 0x70 PCF8574 I/O reserved for factory use - * 0x9e PCF8591 A/D temperature (CPU) - * - * CP1500: - * 0x70 PCF8574 I/O reserved for factory use - * 0x72 PCF8574 I/O geographic address + power supply status lines - * 0x9e PCF8591 A/D temperature (CPU) - * 0xa0 AT24C01A hostid - * - * For AXmp, CP1400 and CP1500 these are described in more detail in: - * http://www.sun.com/oem/products/manuals/805-7581-04.pdf - * - */ - -#include <sys/param.h> -#include <sys/bus.h> -#include <sys/lock.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/mutex.h> -#include <sys/resource.h> -#include <sys/systm.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/resource.h> - -#include <sys/rman.h> - -#include <dev/iicbus/iiconf.h> -#include <dev/pcf/pcfvar.h> -#include "iicbus_if.h" - -#define PCF_NAME "pcf" - -static int pcf_ebus_probe(device_t); -static int pcf_ebus_attach(device_t); -static int pcf_ebus_detach(device_t); - -static device_method_t pcf_ebus_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, pcf_ebus_probe), - DEVMETHOD(device_attach, pcf_ebus_attach), - DEVMETHOD(device_detach, pcf_ebus_detach), - - /* iicbus interface */ - DEVMETHOD(iicbus_callback, iicbus_null_callback), - DEVMETHOD(iicbus_repeated_start, pcf_repeated_start), - DEVMETHOD(iicbus_start, pcf_start), - DEVMETHOD(iicbus_stop, pcf_stop), - DEVMETHOD(iicbus_write, pcf_write), - DEVMETHOD(iicbus_read, pcf_read), - DEVMETHOD(iicbus_reset, pcf_rst_card), - { 0, 0 } -}; - -static devclass_t pcf_ebus_devclass; - -static driver_t pcf_ebus_driver = { - PCF_NAME, - pcf_ebus_methods, - sizeof(struct pcf_softc), -}; - -static int -pcf_ebus_probe(device_t dev) -{ - const char *compat; - - /* - * We must not attach to this i2c device if this is a system with - * a boot-bus controller. Additionally testing the compatibility - * property will hopefully take care of this. - */ - if (strcmp("i2c", ofw_bus_get_name(dev)) == 0) { - compat = ofw_bus_get_compat(dev); - if (compat != NULL && strcmp("i2cpcf,8584", compat) == 0) { - device_set_desc(dev, "PCF8584 I2C bus controller"); - return (0); - } - } - return (ENXIO); -} - -static int -pcf_ebus_attach(device_t dev) -{ - struct pcf_softc *sc; - int rv = ENXIO; - phandle_t node; - uint64_t own_addr; - - sc = DEVTOSOFTC(dev); - mtx_init(&sc->pcf_lock, device_get_nameunit(dev), "pcf", MTX_DEF); - - /* get OFW node of the pcf */ - if ((node = ofw_bus_get_node(dev)) == -1) { - device_printf(dev, "cannot get OFW node\n"); - goto error; - } - - /* IO port is mandatory */ - sc->res_ioport = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->rid_ioport, RF_ACTIVE); - if (sc->res_ioport == 0) { - device_printf(dev, "cannot reserve I/O port range\n"); - goto error; - } - - sc->pcf_flags = device_get_flags(dev); - - /* - * XXX use poll-mode property? - */ - if (!(sc->pcf_flags & IIC_POLLED)) { - sc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->rid_irq, RF_ACTIVE); - if (sc->res_irq == 0) { - device_printf(dev, "can't reserve irq, polled mode.\n"); - sc->pcf_flags |= IIC_POLLED; - } - } - - /* - * XXX on AXmp there's probably a second IRQ which is the fan fail - * interrupt genererated by the PCF8574 at 0x78. - */ - - /* get address of the pcf */ - if (OF_getprop(node, "own-address", &own_addr, sizeof(own_addr)) == - -1) { - device_printf(dev, "cannot get own address\n"); - goto error; - } - if (bootverbose) - device_printf(dev, "PCF8584 address: 0x%08llx\n", (unsigned - long long)own_addr); - - /* reset the chip */ - pcf_rst_card(dev, IIC_FASTEST, own_addr, NULL); - - if (sc->res_irq) { - rv = bus_setup_intr(dev, sc->res_irq, - INTR_TYPE_NET /* | INTR_ENTROPY */, NULL, pcf_intr, sc, - &sc->intr_cookie); - if (rv) { - device_printf(dev, "could not setup IRQ\n"); - goto error; - } - } - - if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) - device_printf(dev, "could not allocate iicbus instance\n"); - - /* probe and attach the iicbus */ - bus_generic_attach(dev); - - return (0); - -error: - if (sc->res_irq != 0) { - bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, - sc->res_irq); - } - if (sc->res_ioport != 0) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, - sc->res_ioport); - } - mtx_destroy(&sc->pcf_lock); - return (rv); -} - -static int -pcf_ebus_detach(device_t dev) -{ - struct pcf_softc *sc; - int rv; - - sc = DEVTOSOFTC(dev); - - if ((rv = bus_generic_detach(dev)) != 0) - return (rv); - - if ((rv = device_delete_child(dev, sc->iicbus)) != 0) - return (rv); - - if (sc->res_irq != 0) { - bus_teardown_intr(dev, sc->res_irq, - sc->intr_cookie); - bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, - sc->res_irq); - } - - bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, - sc->res_ioport); - mtx_destroy(&sc->pcf_lock); - - return (0); -} - -DRIVER_MODULE(pcf_ebus, ebus, pcf_ebus_driver, pcf_ebus_devclass, 0, 0); diff --git a/sys/dev/proto/proto_core.c b/sys/dev/proto/proto_core.c index 404ba498f09d..44199bdd7b8f 100644 --- a/sys/dev/proto/proto_core.c +++ b/sys/dev/proto/proto_core.c @@ -507,9 +507,7 @@ proto_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr, if (offset >= r->r_size) return (EINVAL); *paddr = rman_get_start(r->r_d.res) + offset; -#ifndef __sparc64__ *memattr = VM_MEMATTR_UNCACHEABLE; -#endif break; case PROTO_RES_BUSDMA: if (!proto_busdma_mmap_allowed(r->r_d.busdma, offset)) diff --git a/sys/dev/scc/scc_bfe_ebus.c b/sys/dev/scc/scc_bfe_ebus.c deleted file mode 100644 index 365eb28444ee..000000000000 --- a/sys/dev/scc/scc_bfe_ebus.c +++ /dev/null @@ -1,99 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/module.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <sys/rman.h> -#include <machine/resource.h> - -#include <dev/scc/scc_bfe.h> - -#define EBUS_REGSHFT 0 -#define EBUS_RCLK 29491200 - -static int -scc_ebus_probe(device_t dev) -{ - struct scc_softc *sc; - const char *cmpt, *nm; - - sc = device_get_softc(dev); - nm = ofw_bus_get_name(dev); - cmpt = ofw_bus_get_compat(dev); - if (cmpt == NULL) - cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || - !strcmp(cmpt, "sab82532")) { - device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); - sc->sc_class = &scc_sab82532_class; - return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); - } - return (ENXIO); -} - -static int -scc_ebus_attach(device_t dev) -{ - - return (scc_bfe_attach(dev, 0)); -} - -static device_method_t scc_ebus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, scc_ebus_probe), - DEVMETHOD(device_attach, scc_ebus_attach), - DEVMETHOD(device_detach, scc_bfe_detach), - - DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource), - DEVMETHOD(bus_release_resource, scc_bus_release_resource), - DEVMETHOD(bus_get_resource, scc_bus_get_resource), - DEVMETHOD(bus_read_ivar, scc_bus_read_ivar), - DEVMETHOD(bus_setup_intr, scc_bus_setup_intr), - DEVMETHOD(bus_teardown_intr, scc_bus_teardown_intr), - - DEVMETHOD_END -}; - -static driver_t scc_ebus_driver = { - scc_driver_name, - scc_ebus_methods, - sizeof(struct scc_softc), -}; - -DRIVER_MODULE(scc, ebus, scc_ebus_driver, scc_devclass, NULL, NULL); diff --git a/sys/dev/scc/scc_bfe_sbus.c b/sys/dev/scc/scc_bfe_sbus.c deleted file mode 100644 index b6f0f1a0e8b8..000000000000 --- a/sys/dev/scc/scc_bfe_sbus.c +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2004-2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/module.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <sys/rman.h> -#include <machine/resource.h> - -#include <dev/scc/scc_bfe.h> - -#define SBUS_REGSHFT 1 -#define SBUS_RCLK 307200 - -static int -scc_sbus_probe(device_t dev) -{ - struct scc_softc *sc; - const char *nm; - - sc = device_get_softc(dev); - nm = ofw_bus_get_name(dev); - if (!strcmp(nm, "zs")) { - device_set_desc(dev, "Zilog Z8530 dual channel SCC"); - sc->sc_class = &scc_z8530_class; - return (scc_bfe_probe(dev, SBUS_REGSHFT, SBUS_RCLK, 0)); - } - return (ENXIO); -} - -static int -scc_sbus_attach(device_t dev) -{ - - return (scc_bfe_attach(dev, 0)); -} - -static device_method_t scc_sbus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, scc_sbus_probe), - DEVMETHOD(device_attach, scc_sbus_attach), - DEVMETHOD(device_detach, scc_bfe_detach), - - DEVMETHOD(bus_alloc_resource, scc_bus_alloc_resource), - DEVMETHOD(bus_release_resource, scc_bus_release_resource), - DEVMETHOD(bus_get_resource, scc_bus_get_resource), - DEVMETHOD(bus_read_ivar, scc_bus_read_ivar), - DEVMETHOD(bus_setup_intr, scc_bus_setup_intr), - DEVMETHOD(bus_teardown_intr, scc_bus_teardown_intr), - - DEVMETHOD_END -}; - -static driver_t scc_sbus_driver = { - scc_driver_name, - scc_sbus_methods, - sizeof(struct scc_softc), -}; - -DRIVER_MODULE(scc, fhc, scc_sbus_driver, scc_devclass, NULL, NULL); -DRIVER_MODULE(scc, sbus, scc_sbus_driver, scc_devclass, NULL, NULL); diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h index 1d9ec6a0f228..09825cd23565 100644 --- a/sys/dev/sfxge/common/efsys.h +++ b/sys/dev/sfxge/common/efsys.h @@ -130,26 +130,6 @@ prefetch_read_once(void *addr) : : "r" (addr)); } -#elif defined(__sparc64__) -static __inline void -prefetch_read_many(void *addr) -{ - - __asm__( - "prefetch [%0], 0" - : - : "r" (addr)); -} - -static __inline void -prefetch_read_once(void *addr) -{ - - __asm__( - "prefetch [%0], 1" - : - : "r" (addr)); -} #else static __inline void prefetch_read_many(void *addr) diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index a7c5cd2be6b9..f046b8a47e21 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -829,11 +829,6 @@ tr_pci_attach(device_t dev) bus_addr_t lowaddr; int i, dacn; char status[SND_STATUSLEN]; -#ifdef __sparc64__ - device_t *children; - int nchildren; - u_int32_t data; -#endif tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK | M_ZERO); tr->type = pci_get_devid(dev); @@ -900,34 +895,9 @@ tr_pci_attach(device_t dev) * using a low address of BUS_SPACE_MAXADDR_32BIT for both * we might end up with the play buffer being in the 32-bit * range while the record buffer isn't or vice versa. So we - * limit enabling the 31st bit to sparc64, where the IOMMU - * guarantees that we're using a 32-bit address (and in turn - * requires it). + * don't enabling the 31st bit. */ lowaddr = ALI_MAXADDR; -#ifdef __sparc64__ - if (device_get_children(device_get_parent(dev), &children, - &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - if (pci_get_devid(children[i]) == 0x153310b9) { - lowaddr = BUS_SPACE_MAXADDR_32BIT; - data = pci_read_config(children[i], - 0x7e, 1); - if (bootverbose) - device_printf(dev, - "M1533 0x7e: 0x%x -> ", - data); - data |= 0x1; - if (bootverbose) - printf("0x%x\n", data); - pci_write_config(children[i], 0x7e, - data, 1); - break; - } - } - } - free(children, M_TEMP); -#endif tr->hwchns = ALI_MAXHWCH; tr->bufsz = ALI_BUFSZ; } else { diff --git a/sys/dev/sound/sbus/apcdmareg.h b/sys/dev/sound/sbus/apcdmareg.h deleted file mode 100644 index 719da7d09d12..000000000000 --- a/sys/dev/sound/sbus/apcdmareg.h +++ /dev/null @@ -1,116 +0,0 @@ -/* $FreeBSD$ */ -/* $OpenBSD: apcdmareg.h,v 1.2 2003/06/02 18:53:18 jason Exp $ */ - -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2001 Jason L. Wright (jason@thought.net) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - */ - -/* - * Definitions for Sun APC DMA controller. - */ - -/* APC DMA registers */ -#define APC_CSR 0x0010 /* control/status */ -#define APC_CVA 0x0020 /* capture virtual address */ -#define APC_CC 0x0024 /* capture count */ -#define APC_CNVA 0x0028 /* capture next virtual address */ -#define APC_CNC 0x002c /* capture next count */ -#define APC_PVA 0x0030 /* playback virtual address */ -#define APC_PC 0x0034 /* playback count */ -#define APC_PNVA 0x0038 /* playback next virtual address */ -#define APC_PNC 0x003c /* playback next count */ - -/* - * APC DMA Register definitions - */ -#define APC_CSR_RESET 0x00000001 /* reset */ -#define APC_CSR_CDMA_GO 0x00000004 /* capture dma go */ -#define APC_CSR_PDMA_GO 0x00000008 /* playback dma go */ -#define APC_CSR_CODEC_RESET 0x00000020 /* codec reset */ -#define APC_CSR_CPAUSE 0x00000040 /* capture dma pause */ -#define APC_CSR_PPAUSE 0x00000080 /* playback dma pause */ -#define APC_CSR_CMIE 0x00000100 /* capture pipe empty enb */ -#define APC_CSR_CMI 0x00000200 /* capture pipe empty intr */ -#define APC_CSR_CD 0x00000400 /* capture nva dirty */ -#define APC_CSR_CM 0x00000800 /* capture data lost */ -#define APC_CSR_PMIE 0x00001000 /* pb pipe empty intr enable */ -#define APC_CSR_PD 0x00002000 /* pb nva dirty */ -#define APC_CSR_PM 0x00004000 /* pb pipe empty */ -#define APC_CSR_PMI 0x00008000 /* pb pipe empty interrupt */ -#define APC_CSR_EIE 0x00010000 /* error interrupt enable */ -#define APC_CSR_CIE 0x00020000 /* capture intr enable */ -#define APC_CSR_PIE 0x00040000 /* playback intr enable */ -#define APC_CSR_GIE 0x00080000 /* general intr enable */ -#define APC_CSR_EI 0x00100000 /* error interrupt */ -#define APC_CSR_CI 0x00200000 /* capture interrupt */ -#define APC_CSR_PI 0x00400000 /* playback interrupt */ -#define APC_CSR_GI 0x00800000 /* general interrupt */ - -#define APC_CSR_PLAY ( \ - APC_CSR_EI | \ - APC_CSR_GIE | \ - APC_CSR_PIE | \ - APC_CSR_EIE | \ - APC_CSR_PDMA_GO | \ - APC_CSR_PMIE ) - -#define APC_CSR_CAPTURE ( \ - APC_CSR_EI | \ - APC_CSR_GIE | \ - APC_CSR_CIE | \ - APC_CSR_EIE | \ - APC_CSR_CDMA_GO ) - -#define APC_CSR_PLAY_PAUSE (~( \ - APC_CSR_PPAUSE | \ - APC_CSR_GI | \ - APC_CSR_PI | \ - APC_CSR_CI | \ - APC_CSR_EI | \ - APC_CSR_PMI | \ - APC_CSR_PMIE | \ - APC_CSR_CMI | \ - APC_CSR_CMIE ) ) - -#define APC_CSR_CAPTURE_PAUSE (~( \ - APC_CSR_PPAUSE | \ - APC_CSR_GI | \ - APC_CSR_PI | \ - APC_CSR_CI | \ - APC_CSR_EI | \ - APC_CSR_PMI | \ - APC_CSR_PMIE | \ - APC_CSR_CMI | \ - APC_CSR_CMIE ) ) - -#define APC_CSR_INTR_MASK ( \ - APC_CSR_GI | \ - APC_CSR_PI | \ - APC_CSR_CI | \ - APC_CSR_EI | \ - APC_CSR_PMI | \ - APC_CSR_CMI ) diff --git a/sys/dev/sound/sbus/cs4231.c b/sys/dev/sound/sbus/cs4231.c deleted file mode 100644 index 0fb7164d0f51..000000000000 --- a/sys/dev/sound/sbus/cs4231.c +++ /dev/null @@ -1,1566 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1999 Jason L. Wright (jason@thought.net) - * Copyright (c) 2004 Pyun YongHyeon - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - * - * Effort sponsored in part by the Defense Advanced Research Projects - * Agency (DARPA) and Air Force Research Laboratory, Air Force - * Materiel Command, USAF, under agreement number F30602-01-2-0537. - * - * from: OpenBSD: cs4231.c,v 1.21 2003/07/03 20:36:07 jason Exp - */ - -/* - * Driver for CS4231 based audio found in some sun4m systems (cs4231) - * based on ideas from the S/Linux project and the NetBSD project. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/resource.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/openfirm.h> -#include <machine/bus.h> -#include <machine/ofw_machdep.h> - -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_snd.h" -#endif - -#include <dev/sound/pcm/sound.h> -#include <dev/sound/sbus/apcdmareg.h> -#include <dev/sound/sbus/cs4231.h> - -#include <sparc64/sbus/sbusvar.h> -#include <sparc64/ebus/ebusreg.h> - -#include "mixer_if.h" - -/* - * The driver supports CS4231A audio chips found on Sbus/Ebus based - * UltraSPARCs. Though, CS4231A says it supports full-duplex mode, I - * doubt it due to the lack of independent sampling frequency register - * for playback/capture. - * Since I couldn't find any documentation for APCDMA programming - * information, I guessed the usage of APCDMA from that of OpenBSD's - * driver. The EBDMA information of PCIO can be obtained from - * http://solutions.sun.com/embedded/databook/web/microprocessors/pcio.html - * And CS4231A datasheet can also be obtained from - * ftp://ftp.alsa-project.org/pub/manuals/cirrus/4231a.pdf - * - * Audio capture(recording) was not tested at all and may have bugs. - * Sorry, I don't have microphone. Don't try to use full-duplex mode. - * It wouldn't work. - */ -#define CS_TIMEOUT 90000 - -#define CS4231_MIN_BUF_SZ (16*1024) -#define CS4231_DEFAULT_BUF_SZ (32*1024) -#define CS4231_MAX_BUF_SZ (64*1024) -#define CS4231_MAX_BLK_SZ (8*1024) -#define CS4231_MAX_APC_DMA_SZ (8*1024) - - -#undef CS4231_DEBUG -#ifdef CS4231_DEBUG -#define DPRINTF(x) printf x -#else -#define DPRINTF(x) -#endif -#define CS4231_AUTO_CALIBRATION - -struct cs4231_softc; - -struct cs4231_channel { - struct cs4231_softc *parent; - struct pcm_channel *channel; - struct snd_dbuf *buffer; - u_int32_t format; - u_int32_t speed; - u_int32_t nextaddr; - u_int32_t togo; - int dir; - int locked; -}; - -#define CS4231_RES_MEM_MAX 4 -#define CS4231_RES_IRQ_MAX 2 -struct cs4231_softc { - device_t sc_dev; - int sc_rid[CS4231_RES_MEM_MAX]; - struct resource *sc_res[CS4231_RES_MEM_MAX]; - bus_space_handle_t sc_regh[CS4231_RES_MEM_MAX]; - bus_space_tag_t sc_regt[CS4231_RES_MEM_MAX]; - - int sc_irqrid[CS4231_RES_IRQ_MAX]; - struct resource *sc_irqres[CS4231_RES_IRQ_MAX]; - void *sc_ih[CS4231_RES_IRQ_MAX]; - bus_dma_tag_t sc_dmat[CS4231_RES_IRQ_MAX]; - int sc_burst; - - u_int32_t sc_bufsz; - struct cs4231_channel sc_pch; - struct cs4231_channel sc_rch; - int sc_enabled; - int sc_nmres; - int sc_nires; - int sc_codecv; - int sc_chipvid; - int sc_flags; -#define CS4231_SBUS 0x01 -#define CS4231_EBUS 0x02 - - struct mtx *sc_lock; -}; - -struct mix_table { - u_int32_t reg:8; - u_int32_t bits:8; - u_int32_t mute:8; - u_int32_t shift:4; - u_int32_t neg:1; - u_int32_t avail:1; - u_int32_t recdev:1; -}; - -static int cs4231_bus_probe(device_t); -static int cs4231_sbus_attach(device_t); -static int cs4231_ebus_attach(device_t); -static int cs4231_attach_common(struct cs4231_softc *); -static int cs4231_bus_detach(device_t); -static int cs4231_bus_suspend(device_t); -static int cs4231_bus_resume(device_t); -static void cs4231_getversion(struct cs4231_softc *); -static void cs4231_free_resource(struct cs4231_softc *); -static void cs4231_ebdma_reset(struct cs4231_softc *); -static void cs4231_power_reset(struct cs4231_softc *, int); -static int cs4231_enable(struct cs4231_softc *, int); -static void cs4231_disable(struct cs4231_softc *); -static void cs4231_write(struct cs4231_softc *, u_int8_t, u_int8_t); -static u_int8_t cs4231_read(struct cs4231_softc *, u_int8_t); -static void cs4231_sbus_intr(void *); -static void cs4231_ebus_pintr(void *arg); -static void cs4231_ebus_cintr(void *arg); -static int cs4231_mixer_init(struct snd_mixer *); -static void cs4231_mixer_set_value(struct cs4231_softc *, - const struct mix_table *, u_int8_t); -static int cs4231_mixer_set(struct snd_mixer *, u_int32_t, u_int32_t, - u_int32_t); -static u_int32_t cs4231_mixer_setrecsrc(struct snd_mixer *, u_int32_t); -static void *cs4231_chan_init(kobj_t, void *, struct snd_dbuf *, - struct pcm_channel *, int); -static int cs4231_chan_setformat(kobj_t, void *, u_int32_t); -static u_int32_t cs4231_chan_setspeed(kobj_t, void *, u_int32_t); -static void cs4231_chan_fs(struct cs4231_softc *, int, u_int8_t); -static u_int32_t cs4231_chan_setblocksize(kobj_t, void *, u_int32_t); -static int cs4231_chan_trigger(kobj_t, void *, int); -static u_int32_t cs4231_chan_getptr(kobj_t, void *); -static struct pcmchan_caps * - cs4231_chan_getcaps(kobj_t, void *); -static void cs4231_trigger(struct cs4231_channel *); -static void cs4231_apcdma_trigger(struct cs4231_softc *, - struct cs4231_channel *); -static void cs4231_ebdma_trigger(struct cs4231_softc *, - struct cs4231_channel *); -static void cs4231_halt(struct cs4231_channel *); - -#define CS4231_LOCK(sc) snd_mtxlock(sc->sc_lock) -#define CS4231_UNLOCK(sc) snd_mtxunlock(sc->sc_lock) -#define CS4231_LOCK_ASSERT(sc) snd_mtxassert(sc->sc_lock) - -#define CS_WRITE(sc,r,v) \ - bus_space_write_1((sc)->sc_regt[0], (sc)->sc_regh[0], (r) << 2, (v)) -#define CS_READ(sc,r) \ - bus_space_read_1((sc)->sc_regt[0], (sc)->sc_regh[0], (r) << 2) - -#define APC_WRITE(sc,r,v) \ - bus_space_write_4(sc->sc_regt[0], sc->sc_regh[0], r, v) -#define APC_READ(sc,r) \ - bus_space_read_4(sc->sc_regt[0], sc->sc_regh[0], r) - -#define EBDMA_P_WRITE(sc,r,v) \ - bus_space_write_4((sc)->sc_regt[1], (sc)->sc_regh[1], (r), (v)) -#define EBDMA_P_READ(sc,r) \ - bus_space_read_4((sc)->sc_regt[1], (sc)->sc_regh[1], (r)) - -#define EBDMA_C_WRITE(sc,r,v) \ - bus_space_write_4((sc)->sc_regt[2], (sc)->sc_regh[2], (r), (v)) -#define EBDMA_C_READ(sc,r) \ - bus_space_read_4((sc)->sc_regt[2], (sc)->sc_regh[2], (r)) - -#define AUXIO_CODEC 0x00 -#define AUXIO_WRITE(sc,r,v) \ - bus_space_write_4((sc)->sc_regt[3], (sc)->sc_regh[3], (r), (v)) -#define AUXIO_READ(sc,r) \ - bus_space_read_4((sc)->sc_regt[3], (sc)->sc_regh[3], (r)) - -#define CODEC_WARM_RESET 0 -#define CODEC_COLD_RESET 1 - -/* SBus */ -static device_method_t cs4231_sbus_methods[] = { - DEVMETHOD(device_probe, cs4231_bus_probe), - DEVMETHOD(device_attach, cs4231_sbus_attach), - DEVMETHOD(device_detach, cs4231_bus_detach), - DEVMETHOD(device_suspend, cs4231_bus_suspend), - DEVMETHOD(device_resume, cs4231_bus_resume), - - DEVMETHOD_END -}; - -static driver_t cs4231_sbus_driver = { - "pcm", - cs4231_sbus_methods, - PCM_SOFTC_SIZE -}; - -DRIVER_MODULE(snd_audiocs, sbus, cs4231_sbus_driver, pcm_devclass, 0, 0); - -/* EBus */ -static device_method_t cs4231_ebus_methods[] = { - DEVMETHOD(device_probe, cs4231_bus_probe), - DEVMETHOD(device_attach, cs4231_ebus_attach), - DEVMETHOD(device_detach, cs4231_bus_detach), - DEVMETHOD(device_suspend, cs4231_bus_suspend), - DEVMETHOD(device_resume, cs4231_bus_resume), - - DEVMETHOD_END -}; - -static driver_t cs4231_ebus_driver = { - "pcm", - cs4231_ebus_methods, - PCM_SOFTC_SIZE -}; - -DRIVER_MODULE(snd_audiocs, ebus, cs4231_ebus_driver, pcm_devclass, 0, 0); -MODULE_DEPEND(snd_audiocs, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); -MODULE_VERSION(snd_audiocs, 1); - - -static u_int32_t cs4231_fmt[] = { - SND_FORMAT(AFMT_U8, 1, 0), - SND_FORMAT(AFMT_U8, 2, 0), - SND_FORMAT(AFMT_MU_LAW, 1, 0), - SND_FORMAT(AFMT_MU_LAW, 2, 0), - SND_FORMAT(AFMT_A_LAW, 1, 0), - SND_FORMAT(AFMT_A_LAW, 2, 0), - SND_FORMAT(AFMT_IMA_ADPCM, 1, 0), - SND_FORMAT(AFMT_IMA_ADPCM, 2, 0), - SND_FORMAT(AFMT_S16_LE, 1, 0), - SND_FORMAT(AFMT_S16_LE, 2, 0), - SND_FORMAT(AFMT_S16_BE, 1, 0), - SND_FORMAT(AFMT_S16_BE, 2, 0), - 0 -}; - -static struct pcmchan_caps cs4231_caps = {5510, 48000, cs4231_fmt, 0}; - -/* - * sound(4) channel interface - */ -static kobj_method_t cs4231_chan_methods[] = { - KOBJMETHOD(channel_init, cs4231_chan_init), - KOBJMETHOD(channel_setformat, cs4231_chan_setformat), - KOBJMETHOD(channel_setspeed, cs4231_chan_setspeed), - KOBJMETHOD(channel_setblocksize, cs4231_chan_setblocksize), - KOBJMETHOD(channel_trigger, cs4231_chan_trigger), - KOBJMETHOD(channel_getptr, cs4231_chan_getptr), - KOBJMETHOD(channel_getcaps, cs4231_chan_getcaps), - KOBJMETHOD_END -}; -CHANNEL_DECLARE(cs4231_chan); - -/* - * sound(4) mixer interface - */ -static kobj_method_t cs4231_mixer_methods[] = { - KOBJMETHOD(mixer_init, cs4231_mixer_init), - KOBJMETHOD(mixer_set, cs4231_mixer_set), - KOBJMETHOD(mixer_setrecsrc, cs4231_mixer_setrecsrc), - KOBJMETHOD_END -}; -MIXER_DECLARE(cs4231_mixer); - -static int -cs4231_bus_probe(device_t dev) -{ - const char *compat, *name; - - compat = ofw_bus_get_compat(dev); - name = ofw_bus_get_name(dev); - if (strcmp("SUNW,CS4231", name) == 0 || - (compat != NULL && strcmp("SUNW,CS4231", compat) == 0)) { - device_set_desc(dev, "Sun Audiocs"); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); -} - -static int -cs4231_sbus_attach(device_t dev) -{ - struct cs4231_softc *sc; - int burst; - - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); - sc->sc_dev = dev; - /* - * XXX - * No public documentation exists on programming burst size of APCDMA. - */ - burst = sbus_get_burstsz(sc->sc_dev); - if ((burst & SBUS_BURST_64)) - sc->sc_burst = 64; - else if ((burst & SBUS_BURST_32)) - sc->sc_burst = 32; - else if ((burst & SBUS_BURST_16)) - sc->sc_burst = 16; - else - sc->sc_burst = 0; - sc->sc_flags = CS4231_SBUS; - sc->sc_nmres = 1; - sc->sc_nires = 1; - return cs4231_attach_common(sc); -} - -static int -cs4231_ebus_attach(device_t dev) -{ - struct cs4231_softc *sc; - - sc = malloc(sizeof(struct cs4231_softc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc == NULL) { - device_printf(dev, "cannot allocate softc\n"); - return (ENOMEM); - } - sc->sc_dev = dev; - sc->sc_burst = EBDCSR_BURST_1; - sc->sc_nmres = CS4231_RES_MEM_MAX; - sc->sc_nires = CS4231_RES_IRQ_MAX; - sc->sc_flags = CS4231_EBUS; - return cs4231_attach_common(sc); -} - -static int -cs4231_attach_common(struct cs4231_softc *sc) -{ - char status[SND_STATUSLEN]; - driver_intr_t *ihandler; - int i; - - sc->sc_lock = snd_mtxcreate(device_get_nameunit(sc->sc_dev), - "snd_cs4231 softc"); - - for (i = 0; i < sc->sc_nmres; i++) { - sc->sc_rid[i] = i; - if ((sc->sc_res[i] = bus_alloc_resource_any(sc->sc_dev, - SYS_RES_MEMORY, &sc->sc_rid[i], RF_ACTIVE)) == NULL) { - device_printf(sc->sc_dev, - "cannot map register %d\n", i); - goto fail; - } - sc->sc_regt[i] = rman_get_bustag(sc->sc_res[i]); - sc->sc_regh[i] = rman_get_bushandle(sc->sc_res[i]); - } - for (i = 0; i < sc->sc_nires; i++) { - sc->sc_irqrid[i] = i; - if ((sc->sc_irqres[i] = bus_alloc_resource_any(sc->sc_dev, - SYS_RES_IRQ, &sc->sc_irqrid[i], RF_SHAREABLE | RF_ACTIVE)) - == NULL) { - if ((sc->sc_flags & CS4231_SBUS) != 0) - device_printf(sc->sc_dev, - "cannot allocate interrupt\n"); - else - device_printf(sc->sc_dev, "cannot allocate %s " - "interrupt\n", i == 0 ? "capture" : - "playback"); - goto fail; - } - } - - ihandler = cs4231_sbus_intr; - for (i = 0; i < sc->sc_nires; i++) { - if ((sc->sc_flags & CS4231_EBUS) != 0) { - if (i == 0) - ihandler = cs4231_ebus_cintr; - else - ihandler = cs4231_ebus_pintr; - } - if (snd_setup_intr(sc->sc_dev, sc->sc_irqres[i], INTR_MPSAFE, - ihandler, sc, &sc->sc_ih[i])) { - if ((sc->sc_flags & CS4231_SBUS) != 0) - device_printf(sc->sc_dev, - "cannot set up interrupt\n"); - else - device_printf(sc->sc_dev, "cannot set up %s " - " interrupt\n", i == 0 ? "capture" : - "playback"); - goto fail; - } - } - - sc->sc_bufsz = pcm_getbuffersize(sc->sc_dev, CS4231_MIN_BUF_SZ, - CS4231_DEFAULT_BUF_SZ, CS4231_MAX_BUF_SZ); - for (i = 0; i < sc->sc_nires; i++) { - if (bus_dma_tag_create( - bus_get_dma_tag(sc->sc_dev),/* parent */ - 64, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - sc->sc_bufsz, /* maxsize */ - 1, /* nsegments */ - sc->sc_bufsz, /* maxsegsz */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &sc->sc_dmat[i])) { - if ((sc->sc_flags & CS4231_SBUS) != 0) - device_printf(sc->sc_dev, - "cannot allocate DMA tag\n"); - else - device_printf(sc->sc_dev, "cannot allocate %s " - "DMA tag\n", i == 0 ? "capture" : - "playback"); - goto fail; - } - } - cs4231_enable(sc, CODEC_WARM_RESET); - cs4231_getversion(sc); - if (mixer_init(sc->sc_dev, &cs4231_mixer_class, sc) != 0) - goto fail; - if (pcm_register(sc->sc_dev, sc, 1, 1)) { - device_printf(sc->sc_dev, "cannot register to pcm\n"); - goto fail; - } - if (pcm_addchan(sc->sc_dev, PCMDIR_REC, &cs4231_chan_class, sc) != 0) - goto chan_fail; - if (pcm_addchan(sc->sc_dev, PCMDIR_PLAY, &cs4231_chan_class, sc) != 0) - goto chan_fail; - if ((sc->sc_flags & CS4231_SBUS) != 0) - snprintf(status, SND_STATUSLEN, "at mem 0x%lx irq %ld bufsz %u", - rman_get_start(sc->sc_res[0]), - rman_get_start(sc->sc_irqres[0]), sc->sc_bufsz); - else - snprintf(status, SND_STATUSLEN, "at io 0x%lx 0x%lx 0x%lx 0x%lx " - "irq %ld %ld bufsz %u", rman_get_start(sc->sc_res[0]), - rman_get_start(sc->sc_res[1]), - rman_get_start(sc->sc_res[2]), - rman_get_start(sc->sc_res[3]), - rman_get_start(sc->sc_irqres[0]), - rman_get_start(sc->sc_irqres[1]), sc->sc_bufsz); - pcm_setstatus(sc->sc_dev, status); - return (0); - -chan_fail: - pcm_unregister(sc->sc_dev); -fail: - cs4231_free_resource(sc); - return (ENXIO); -} - -static int -cs4231_bus_detach(device_t dev) -{ - struct cs4231_softc *sc; - struct cs4231_channel *pch, *rch; - int error; - - sc = pcm_getdevinfo(dev); - CS4231_LOCK(sc); - pch = &sc->sc_pch; - rch = &sc->sc_pch; - if (pch->locked || rch->locked) { - CS4231_UNLOCK(sc); - return (EBUSY); - } - /* - * Since EBDMA requires valid DMA buffer to drain its FIFO, we need - * real DMA buffer for draining. - */ - if ((sc->sc_flags & CS4231_EBUS) != 0) - cs4231_ebdma_reset(sc); - CS4231_UNLOCK(sc); - error = pcm_unregister(dev); - if (error) - return (error); - cs4231_free_resource(sc); - return (0); -} - -static int -cs4231_bus_suspend(device_t dev) -{ - - return (ENXIO); -} - -static int -cs4231_bus_resume(device_t dev) -{ - - return (ENXIO); -} - -static void -cs4231_getversion(struct cs4231_softc *sc) -{ - u_int8_t v; - - v = cs4231_read(sc, CS_MISC_INFO); - sc->sc_codecv = v & CS_CODEC_ID_MASK; - v = cs4231_read(sc, CS_VERSION_ID); - v &= (CS_VERSION_NUMBER | CS_VERSION_CHIPID); - sc->sc_chipvid = v; - switch(v) { - case 0x80: - device_printf(sc->sc_dev, "<CS4231 Codec Id. %d>\n", - sc->sc_codecv); - break; - case 0xa0: - device_printf(sc->sc_dev, "<CS4231A Codec Id. %d>\n", - sc->sc_codecv); - break; - case 0x82: - device_printf(sc->sc_dev, "<CS4232 Codec Id. %d>\n", - sc->sc_codecv); - break; - default: - device_printf(sc->sc_dev, - "<Unknown 0x%x Codec Id. %d\n", v, sc->sc_codecv); - break; - } -} - -static void -cs4231_ebdma_reset(struct cs4231_softc *sc) -{ - int i; - - /* playback */ - EBDMA_P_WRITE(sc, EBDMA_DCSR, - EBDMA_P_READ(sc, EBDMA_DCSR) & ~(EBDCSR_INTEN | EBDCSR_NEXTEN)); - EBDMA_P_WRITE(sc, EBDMA_DCSR, EBDCSR_RESET); - for (i = CS_TIMEOUT; - i && EBDMA_P_READ(sc, EBDMA_DCSR) & EBDCSR_DRAIN; i--) - DELAY(1); - if (i == 0) - device_printf(sc->sc_dev, - "timeout waiting for playback DMA reset\n"); - EBDMA_P_WRITE(sc, EBDMA_DCSR, sc->sc_burst); - /* capture */ - EBDMA_C_WRITE(sc, EBDMA_DCSR, - EBDMA_C_READ(sc, EBDMA_DCSR) & ~(EBDCSR_INTEN | EBDCSR_NEXTEN)); - EBDMA_C_WRITE(sc, EBDMA_DCSR, EBDCSR_RESET); - for (i = CS_TIMEOUT; - i && EBDMA_C_READ(sc, EBDMA_DCSR) & EBDCSR_DRAIN; i--) - DELAY(1); - if (i == 0) - device_printf(sc->sc_dev, - "timeout waiting for capture DMA reset\n"); - EBDMA_C_WRITE(sc, EBDMA_DCSR, sc->sc_burst); -} - -static void -cs4231_power_reset(struct cs4231_softc *sc, int how) -{ - u_int32_t v; - int i; - - if ((sc->sc_flags & CS4231_SBUS) != 0) { - APC_WRITE(sc, APC_CSR, APC_CSR_RESET); - DELAY(10); - APC_WRITE(sc, APC_CSR, 0); - DELAY(10); - APC_WRITE(sc, - APC_CSR, APC_READ(sc, APC_CSR) | APC_CSR_CODEC_RESET); - DELAY(20); - APC_WRITE(sc, - APC_CSR, APC_READ(sc, APC_CSR) & (~APC_CSR_CODEC_RESET)); - } else { - v = AUXIO_READ(sc, AUXIO_CODEC); - if (how == CODEC_WARM_RESET && v != 0) { - AUXIO_WRITE(sc, AUXIO_CODEC, 0); - DELAY(20); - } else if (how == CODEC_COLD_RESET){ - AUXIO_WRITE(sc, AUXIO_CODEC, 1); - DELAY(20); - AUXIO_WRITE(sc, AUXIO_CODEC, 0); - DELAY(20); - } - cs4231_ebdma_reset(sc); - } - - for (i = CS_TIMEOUT; - i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--) - DELAY(10); - if (i == 0) - device_printf(sc->sc_dev, "timeout waiting for reset\n"); - - /* turn on cs4231 mode */ - cs4231_write(sc, CS_MISC_INFO, - cs4231_read(sc, CS_MISC_INFO) | CS_MODE2); - /* enable interrupts & clear CSR */ - cs4231_write(sc, CS_PIN_CONTROL, - cs4231_read(sc, CS_PIN_CONTROL) | INTERRUPT_ENABLE); - CS_WRITE(sc, CS4231_STATUS, 0); - /* enable DAC output */ - cs4231_write(sc, CS_LEFT_OUTPUT_CONTROL, - cs4231_read(sc, CS_LEFT_OUTPUT_CONTROL) & ~OUTPUT_MUTE); - cs4231_write(sc, CS_RIGHT_OUTPUT_CONTROL, - cs4231_read(sc, CS_RIGHT_OUTPUT_CONTROL) & ~OUTPUT_MUTE); - /* mute AUX1 since it generates noises */ - cs4231_write(sc, CS_LEFT_AUX1_CONTROL, - cs4231_read(sc, CS_LEFT_AUX1_CONTROL) | AUX_INPUT_MUTE); - cs4231_write(sc, CS_RIGHT_AUX1_CONTROL, - cs4231_read(sc, CS_RIGHT_AUX1_CONTROL) | AUX_INPUT_MUTE); - /* protect buffer underrun and set output level to 0dB */ - cs4231_write(sc, CS_ALT_FEATURE1, - cs4231_read(sc, CS_ALT_FEATURE1) | CS_DAC_ZERO | CS_OUTPUT_LVL); - /* enable high pass filter, dual xtal was disabled due to noises */ - cs4231_write(sc, CS_ALT_FEATURE2, - cs4231_read(sc, CS_ALT_FEATURE2) | CS_HPF_ENABLE); -} - -static int -cs4231_enable(struct cs4231_softc *sc, int how) -{ - cs4231_power_reset(sc, how); - sc->sc_enabled = 1; - return (0); -} - -static void -cs4231_disable(struct cs4231_softc *sc) -{ - u_int8_t v; - - CS4231_LOCK_ASSERT(sc); - - if (sc->sc_enabled == 0) - return; - sc->sc_enabled = 0; - CS4231_UNLOCK(sc); - cs4231_halt(&sc->sc_pch); - cs4231_halt(&sc->sc_rch); - CS4231_LOCK(sc); - v = cs4231_read(sc, CS_PIN_CONTROL) & ~INTERRUPT_ENABLE; - cs4231_write(sc, CS_PIN_CONTROL, v); - - if ((sc->sc_flags & CS4231_SBUS) != 0) { - APC_WRITE(sc, APC_CSR, APC_CSR_RESET); - DELAY(10); - APC_WRITE(sc, APC_CSR, 0); - DELAY(10); - } else - cs4231_ebdma_reset(sc); -} - -static void -cs4231_free_resource(struct cs4231_softc *sc) -{ - int i; - - CS4231_LOCK(sc); - cs4231_disable(sc); - CS4231_UNLOCK(sc); - for (i = 0; i < sc->sc_nires; i++) { - if (sc->sc_irqres[i]) { - if (sc->sc_ih[i]) { - bus_teardown_intr(sc->sc_dev, sc->sc_irqres[i], - sc->sc_ih[i]); - sc->sc_ih[i] = NULL; - } - bus_release_resource(sc->sc_dev, SYS_RES_IRQ, - sc->sc_irqrid[i], sc->sc_irqres[i]); - sc->sc_irqres[i] = NULL; - } - } - for (i = 0; i < sc->sc_nires; i++) { - if (sc->sc_dmat[i]) - bus_dma_tag_destroy(sc->sc_dmat[i]); - } - for (i = 0; i < sc->sc_nmres; i++) { - if (sc->sc_res[i]) - bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, - sc->sc_rid[i], sc->sc_res[i]); - } - snd_mtxfree(sc->sc_lock); - free(sc, M_DEVBUF); -} - -static void -cs4231_write(struct cs4231_softc *sc, u_int8_t r, u_int8_t v) -{ - CS_WRITE(sc, CS4231_IADDR, r); - CS_WRITE(sc, CS4231_IDATA, v); -} - -static u_int8_t -cs4231_read(struct cs4231_softc *sc, u_int8_t r) -{ - CS_WRITE(sc, CS4231_IADDR, r); - return (CS_READ(sc, CS4231_IDATA)); -} - -static void -cs4231_sbus_intr(void *arg) -{ - struct cs4231_softc *sc; - struct cs4231_channel *pch, *rch; - u_int32_t csr; - u_int8_t status; - - sc = arg; - CS4231_LOCK(sc); - - csr = APC_READ(sc, APC_CSR); - if ((csr & APC_CSR_GI) == 0) { - CS4231_UNLOCK(sc); - return; - } - APC_WRITE(sc, APC_CSR, csr); - - if ((csr & APC_CSR_EIE) && (csr & APC_CSR_EI)) { - status = cs4231_read(sc, CS_TEST_AND_INIT); - device_printf(sc->sc_dev, - "apc error interrupt : stat = 0x%x\n", status); - } - - pch = rch = NULL; - if ((csr & APC_CSR_PMIE) && (csr & APC_CSR_PMI)) { - u_long nextaddr, saddr; - u_int32_t togo; - - pch = &sc->sc_pch; - togo = pch->togo; - saddr = sndbuf_getbufaddr(pch->buffer); - nextaddr = pch->nextaddr + togo; - if (nextaddr >= saddr + sndbuf_getsize(pch->buffer)) - nextaddr = saddr; - APC_WRITE(sc, APC_PNVA, nextaddr); - APC_WRITE(sc, APC_PNC, togo); - pch->nextaddr = nextaddr; - } - - if ((csr & APC_CSR_CIE) && (csr & APC_CSR_CI) && (csr & APC_CSR_CD)) { - u_long nextaddr, saddr; - u_int32_t togo; - - rch = &sc->sc_rch; - togo = rch->togo; - saddr = sndbuf_getbufaddr(rch->buffer); - nextaddr = rch->nextaddr + togo; - if (nextaddr >= saddr + sndbuf_getsize(rch->buffer)) - nextaddr = saddr; - APC_WRITE(sc, APC_CNVA, nextaddr); - APC_WRITE(sc, APC_CNC, togo); - rch->nextaddr = nextaddr; - } - CS4231_UNLOCK(sc); - if (pch) - chn_intr(pch->channel); - if (rch) - chn_intr(rch->channel); -} - -/* playback interrupt handler */ -static void -cs4231_ebus_pintr(void *arg) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - u_int32_t csr; - u_int8_t status; - - sc = arg; - CS4231_LOCK(sc); - - csr = EBDMA_P_READ(sc, EBDMA_DCSR); - if ((csr & EBDCSR_INT) == 0) { - CS4231_UNLOCK(sc); - return; - } - - if ((csr & EBDCSR_ERR)) { - status = cs4231_read(sc, CS_TEST_AND_INIT); - device_printf(sc->sc_dev, - "ebdma error interrupt : stat = 0x%x\n", status); - } - EBDMA_P_WRITE(sc, EBDMA_DCSR, csr | EBDCSR_TC); - - ch = NULL; - if (csr & EBDCSR_TC) { - u_long nextaddr, saddr; - u_int32_t togo; - - ch = &sc->sc_pch; - togo = ch->togo; - saddr = sndbuf_getbufaddr(ch->buffer); - nextaddr = ch->nextaddr + togo; - if (nextaddr >= saddr + sndbuf_getsize(ch->buffer)) - nextaddr = saddr; - /* - * EBDMA_DCNT is loaded automatically - * EBDMA_P_WRITE(sc, EBDMA_DCNT, togo); - */ - EBDMA_P_WRITE(sc, EBDMA_DADDR, nextaddr); - ch->nextaddr = nextaddr; - } - CS4231_UNLOCK(sc); - if (ch) - chn_intr(ch->channel); -} - -/* capture interrupt handler */ -static void -cs4231_ebus_cintr(void *arg) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - u_int32_t csr; - u_int8_t status; - - sc = arg; - CS4231_LOCK(sc); - - csr = EBDMA_C_READ(sc, EBDMA_DCSR); - if ((csr & EBDCSR_INT) == 0) { - CS4231_UNLOCK(sc); - return; - } - if ((csr & EBDCSR_ERR)) { - status = cs4231_read(sc, CS_TEST_AND_INIT); - device_printf(sc->sc_dev, - "dma error interrupt : stat = 0x%x\n", status); - } - EBDMA_C_WRITE(sc, EBDMA_DCSR, csr | EBDCSR_TC); - - ch = NULL; - if (csr & EBDCSR_TC) { - u_long nextaddr, saddr; - u_int32_t togo; - - ch = &sc->sc_rch; - togo = ch->togo; - saddr = sndbuf_getbufaddr(ch->buffer); - nextaddr = ch->nextaddr + togo; - if (nextaddr >= saddr + sndbuf_getblksz(ch->buffer)) - nextaddr = saddr; - /* - * EBDMA_DCNT is loaded automatically - * EBDMA_C_WRITE(sc, EBDMA_DCNT, togo); - */ - EBDMA_C_WRITE(sc, EBDMA_DADDR, nextaddr); - ch->nextaddr = nextaddr; - } - CS4231_UNLOCK(sc); - if (ch) - chn_intr(ch->channel); -} - -static const struct mix_table cs4231_mix_table[SOUND_MIXER_NRDEVICES][2] = { - [SOUND_MIXER_PCM] = { - { CS_LEFT_OUTPUT_CONTROL, 6, OUTPUT_MUTE, 0, 1, 1, 0 }, - { CS_RIGHT_OUTPUT_CONTROL, 6, OUTPUT_MUTE, 0, 1, 1, 0 } - }, - [SOUND_MIXER_SPEAKER] = { - { CS_MONO_IO_CONTROL, 4, MONO_OUTPUT_MUTE, 0, 1, 1, 0 }, - { CS_REG_NONE, 0, 0, 0, 0, 1, 0 } - }, - [SOUND_MIXER_LINE] = { - { CS_LEFT_LINE_CONTROL, 5, LINE_INPUT_MUTE, 0, 1, 1, 1 }, - { CS_RIGHT_LINE_CONTROL, 5, LINE_INPUT_MUTE, 0, 1, 1, 1 } - }, - /* - * AUX1 : removed intentionally since it generates noises - * AUX2 : Ultra1/Ultra2 has no internal CD-ROM audio in - */ - [SOUND_MIXER_CD] = { - { CS_LEFT_AUX2_CONTROL, 5, LINE_INPUT_MUTE, 0, 1, 1, 1 }, - { CS_RIGHT_AUX2_CONTROL, 5, LINE_INPUT_MUTE, 0, 1, 1, 1 } - }, - [SOUND_MIXER_MIC] = { - { CS_LEFT_INPUT_CONTROL, 4, 0, 0, 0, 1, 1 }, - { CS_RIGHT_INPUT_CONTROL, 4, 0, 0, 0, 1, 1 } - }, - [SOUND_MIXER_IGAIN] = { - { CS_LEFT_INPUT_CONTROL, 4, 0, 0, 1, 0 }, - { CS_RIGHT_INPUT_CONTROL, 4, 0, 0, 1, 0 } - } -}; - -static int -cs4231_mixer_init(struct snd_mixer *m) -{ - u_int32_t v; - int i; - - v = 0; - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if (cs4231_mix_table[i][0].avail != 0) - v |= (1 << i); - mix_setdevs(m, v); - v = 0; - for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) - if (cs4231_mix_table[i][0].recdev != 0) - v |= (1 << i); - mix_setrecdevs(m, v); - return (0); -} - -static void -cs4231_mixer_set_value(struct cs4231_softc *sc, const struct mix_table *mt, - u_int8_t v) -{ - u_int8_t mask, reg; - u_int8_t old, shift, val; - - if (mt->avail == 0 || mt->reg == CS_REG_NONE) - return; - reg = mt->reg; - if (mt->neg != 0) - val = 100 - v; - else - val = v; - mask = (1 << mt->bits) - 1; - val = ((val * mask) + 50) / 100; - shift = mt->shift; - val <<= shift; - if (v == 0) - val |= mt->mute; - old = cs4231_read(sc, reg); - old &= ~(mt->mute | (mask << shift)); - val |= old; - if (reg == CS_LEFT_INPUT_CONTROL || reg == CS_RIGHT_INPUT_CONTROL) { - if ((val & (mask << shift)) != 0) - val |= ADC_INPUT_GAIN_ENABLE; - else - val &= ~ADC_INPUT_GAIN_ENABLE; - } - cs4231_write(sc, reg, val); -} - -static int -cs4231_mixer_set(struct snd_mixer *m, u_int32_t dev, u_int32_t left, - u_int32_t right) -{ - struct cs4231_softc *sc; - - sc = mix_getdevinfo(m); - CS4231_LOCK(sc); - cs4231_mixer_set_value(sc, &cs4231_mix_table[dev][0], left); - cs4231_mixer_set_value(sc, &cs4231_mix_table[dev][1], right); - CS4231_UNLOCK(sc); - - return (left | (right << 8)); -} - -static u_int32_t -cs4231_mixer_setrecsrc(struct snd_mixer *m, u_int32_t src) -{ - struct cs4231_softc *sc; - u_int8_t v; - - sc = mix_getdevinfo(m); - switch (src) { - case SOUND_MASK_LINE: - v = CS_IN_LINE; - break; - - case SOUND_MASK_CD: - v = CS_IN_DAC; - break; - - case SOUND_MASK_MIC: - default: - v = CS_IN_MIC; - src = SOUND_MASK_MIC; - break; - } - CS4231_LOCK(sc); - cs4231_write(sc, CS_LEFT_INPUT_CONTROL, - (cs4231_read(sc, CS_LEFT_INPUT_CONTROL) & CS_IN_MASK) | v); - cs4231_write(sc, CS_RIGHT_INPUT_CONTROL, - (cs4231_read(sc, CS_RIGHT_INPUT_CONTROL) & CS_IN_MASK) | v); - CS4231_UNLOCK(sc); - - return (src); -} - -static void * -cs4231_chan_init(kobj_t obj, void *dev, struct snd_dbuf *b, - struct pcm_channel *c, int dir) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - bus_dma_tag_t dmat; - - sc = dev; - ch = (dir == PCMDIR_PLAY) ? &sc->sc_pch : &sc->sc_rch; - ch->parent = sc; - ch->channel = c; - ch->dir = dir; - ch->buffer = b; - if ((sc->sc_flags & CS4231_SBUS) != 0) - dmat = sc->sc_dmat[0]; - else { - if (dir == PCMDIR_PLAY) - dmat = sc->sc_dmat[1]; - else - dmat = sc->sc_dmat[0]; - } - if (sndbuf_alloc(ch->buffer, dmat, 0, sc->sc_bufsz) != 0) - return (NULL); - DPRINTF(("%s channel addr: 0x%lx\n", dir == PCMDIR_PLAY ? "playback" : - "capture", sndbuf_getbufaddr(ch->buffer))); - - return (ch); -} - -static int -cs4231_chan_setformat(kobj_t obj, void *data, u_int32_t format) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - u_int32_t encoding; - u_int8_t fs, v; - - ch = data; - sc = ch->parent; - - CS4231_LOCK(sc); - if (ch->format == format) { - CS4231_UNLOCK(sc); - return (0); - } - - encoding = AFMT_ENCODING(format); - fs = 0; - switch (encoding) { - case AFMT_U8: - fs = CS_AFMT_U8; - break; - case AFMT_MU_LAW: - fs = CS_AFMT_MU_LAW; - break; - case AFMT_S16_LE: - fs = CS_AFMT_S16_LE; - break; - case AFMT_A_LAW: - fs = CS_AFMT_A_LAW; - break; - case AFMT_IMA_ADPCM: - fs = CS_AFMT_IMA_ADPCM; - break; - case AFMT_S16_BE: - fs = CS_AFMT_S16_BE; - break; - default: - fs = CS_AFMT_U8; - format = AFMT_U8; - break; - } - - if (AFMT_CHANNEL(format) > 1) - fs |= CS_AFMT_STEREO; - - DPRINTF(("FORMAT: %s : 0x%x\n", ch->dir == PCMDIR_PLAY ? "playback" : - "capture", format)); - v = cs4231_read(sc, CS_CLOCK_DATA_FORMAT); - v &= CS_CLOCK_DATA_FORMAT_MASK; - fs |= v; - cs4231_chan_fs(sc, ch->dir, fs); - ch->format = format; - CS4231_UNLOCK(sc); - - return (0); -} - -static u_int32_t -cs4231_chan_setspeed(kobj_t obj, void *data, u_int32_t speed) -{ - typedef struct { - u_int32_t speed; - u_int8_t bits; - } speed_struct; - - const static speed_struct speed_table[] = { - {5510, (0 << 1) | CLOCK_XTAL2}, - {5510, (0 << 1) | CLOCK_XTAL2}, - {6620, (7 << 1) | CLOCK_XTAL2}, - {8000, (0 << 1) | CLOCK_XTAL1}, - {9600, (7 << 1) | CLOCK_XTAL1}, - {11025, (1 << 1) | CLOCK_XTAL2}, - {16000, (1 << 1) | CLOCK_XTAL1}, - {18900, (2 << 1) | CLOCK_XTAL2}, - {22050, (3 << 1) | CLOCK_XTAL2}, - {27420, (2 << 1) | CLOCK_XTAL1}, - {32000, (3 << 1) | CLOCK_XTAL1}, - {33075, (6 << 1) | CLOCK_XTAL2}, - {33075, (4 << 1) | CLOCK_XTAL2}, - {44100, (5 << 1) | CLOCK_XTAL2}, - {48000, (6 << 1) | CLOCK_XTAL1}, - }; - - struct cs4231_softc *sc; - struct cs4231_channel *ch; - int i, n, sel; - u_int8_t fs; - - ch = data; - sc = ch->parent; - CS4231_LOCK(sc); - if (ch->speed == speed) { - CS4231_UNLOCK(sc); - return (speed); - } - n = sizeof(speed_table) / sizeof(speed_struct); - - for (i = 1, sel =0; i < n - 1; i++) - if (abs(speed - speed_table[i].speed) < - abs(speed - speed_table[sel].speed)) - sel = i; - DPRINTF(("SPEED: %s : %dHz -> %dHz\n", ch->dir == PCMDIR_PLAY ? - "playback" : "capture", speed, speed_table[sel].speed)); - speed = speed_table[sel].speed; - - fs = cs4231_read(sc, CS_CLOCK_DATA_FORMAT); - fs &= ~CS_CLOCK_DATA_FORMAT_MASK; - fs |= speed_table[sel].bits; - cs4231_chan_fs(sc, ch->dir, fs); - ch->speed = speed; - CS4231_UNLOCK(sc); - - return (speed); -} - -static void -cs4231_chan_fs(struct cs4231_softc *sc, int dir, u_int8_t fs) -{ - int i, doreset; -#ifdef CS4231_AUTO_CALIBRATION - u_int8_t v; -#endif - - CS4231_LOCK_ASSERT(sc); - - /* set autocalibration */ - doreset = 0; -#ifdef CS4231_AUTO_CALIBRATION - v = cs4231_read(sc, CS_INTERFACE_CONFIG) | AUTO_CAL_ENABLE; - CS_WRITE(sc, CS4231_IADDR, MODE_CHANGE_ENABLE); - CS_WRITE(sc, CS4231_IADDR, MODE_CHANGE_ENABLE | CS_INTERFACE_CONFIG); - CS_WRITE(sc, CS4231_IDATA, v); -#endif - - /* - * We always need to write CS_CLOCK_DATA_FORMAT register since - * the clock frequency is shared with playback/capture. - */ - CS_WRITE(sc, CS4231_IADDR, MODE_CHANGE_ENABLE | CS_CLOCK_DATA_FORMAT); - CS_WRITE(sc, CS4231_IDATA, fs); - CS_READ(sc, CS4231_IDATA); - CS_READ(sc, CS4231_IDATA); - for (i = CS_TIMEOUT; - i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--) - DELAY(10); - if (i == 0) { - device_printf(sc->sc_dev, "timeout setting playback speed\n"); - doreset++; - } - - /* - * capture channel - * cs4231 doesn't allow separate fs setup for playback/capture. - * I believe this will break full-duplex operation. - */ - if (dir == PCMDIR_REC) { - CS_WRITE(sc, CS4231_IADDR, MODE_CHANGE_ENABLE | CS_REC_FORMAT); - CS_WRITE(sc, CS4231_IDATA, fs); - CS_READ(sc, CS4231_IDATA); - CS_READ(sc, CS4231_IDATA); - for (i = CS_TIMEOUT; - i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--) - DELAY(10); - if (i == 0) { - device_printf(sc->sc_dev, - "timeout setting capture format\n"); - doreset++; - } - } - - CS_WRITE(sc, CS4231_IADDR, 0); - for (i = CS_TIMEOUT; - i && CS_READ(sc, CS4231_IADDR) == CS_IN_INIT; i--) - DELAY(10); - if (i == 0) { - device_printf(sc->sc_dev, "timeout waiting for !MCE\n"); - doreset++; - } - -#ifdef CS4231_AUTO_CALIBRATION - CS_WRITE(sc, CS4231_IADDR, CS_TEST_AND_INIT); - for (i = CS_TIMEOUT; - i && CS_READ(sc, CS4231_IDATA) & AUTO_CAL_IN_PROG; i--) - DELAY(10); - if (i == 0) { - device_printf(sc->sc_dev, - "timeout waiting for autocalibration\n"); - doreset++; - } -#endif - if (doreset) { - /* - * Maybe the last resort to avoid a dreadful message like - * "pcm0:play:0: play interrupt timeout, channel dead" would - * be hardware reset. - */ - device_printf(sc->sc_dev, "trying to hardware reset\n"); - cs4231_disable(sc); - cs4231_enable(sc, CODEC_COLD_RESET); - CS4231_UNLOCK(sc); /* XXX */ - if (mixer_reinit(sc->sc_dev) != 0) - device_printf(sc->sc_dev, - "unable to reinitialize the mixer\n"); - CS4231_LOCK(sc); - } -} - -static u_int32_t -cs4231_chan_setblocksize(kobj_t obj, void *data, u_int32_t blocksize) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - int nblks, error; - - ch = data; - sc = ch->parent; - - if (blocksize > CS4231_MAX_BLK_SZ) - blocksize = CS4231_MAX_BLK_SZ; - nblks = sc->sc_bufsz / blocksize; - error = sndbuf_resize(ch->buffer, nblks, blocksize); - if (error != 0) - device_printf(sc->sc_dev, - "unable to block size, blksz = %d, error = %d\n", - blocksize, error); - - return (blocksize); -} - -static int -cs4231_chan_trigger(kobj_t obj, void *data, int go) -{ - struct cs4231_channel *ch; - - ch = data; - switch (go) { - case PCMTRIG_EMLDMAWR: - case PCMTRIG_EMLDMARD: - break; - case PCMTRIG_START: - cs4231_trigger(ch); - break; - case PCMTRIG_ABORT: - case PCMTRIG_STOP: - cs4231_halt(ch); - break; - default: - break; - } - - return (0); -} - -static u_int32_t -cs4231_chan_getptr(kobj_t obj, void *data) -{ - struct cs4231_softc *sc; - struct cs4231_channel *ch; - u_int32_t cur, ptr, sz; - - ch = data; - sc = ch->parent; - - CS4231_LOCK(sc); - if ((sc->sc_flags & CS4231_SBUS) != 0) - cur = (ch->dir == PCMDIR_PLAY) ? APC_READ(sc, APC_PVA) : - APC_READ(sc, APC_CVA); - else - cur = (ch->dir == PCMDIR_PLAY) ? EBDMA_P_READ(sc, EBDMA_DADDR) : - EBDMA_C_READ(sc, EBDMA_DADDR); - sz = sndbuf_getsize(ch->buffer); - ptr = cur - sndbuf_getbufaddr(ch->buffer) + sz; - CS4231_UNLOCK(sc); - - ptr %= sz; - return (ptr); -} - -static struct pcmchan_caps * -cs4231_chan_getcaps(kobj_t obj, void *data) -{ - - return (&cs4231_caps); -} - -static void -cs4231_trigger(struct cs4231_channel *ch) -{ - struct cs4231_softc *sc; - - sc = ch->parent; - if ((sc->sc_flags & CS4231_SBUS) != 0) - cs4231_apcdma_trigger(sc, ch); - else - cs4231_ebdma_trigger(sc, ch); -} - -static void -cs4231_apcdma_trigger(struct cs4231_softc *sc, struct cs4231_channel *ch) -{ - u_int32_t csr, togo; - u_int32_t nextaddr; - - CS4231_LOCK(sc); - if (ch->locked) { - device_printf(sc->sc_dev, "%s channel already triggered\n", - ch->dir == PCMDIR_PLAY ? "playback" : "capture"); - CS4231_UNLOCK(sc); - return; - } - - nextaddr = sndbuf_getbufaddr(ch->buffer); - togo = sndbuf_getsize(ch->buffer) / 2; - if (togo > CS4231_MAX_APC_DMA_SZ) - togo = CS4231_MAX_APC_DMA_SZ; - ch->togo = togo; - if (ch->dir == PCMDIR_PLAY) { - DPRINTF(("TRG: PNVA = 0x%x, togo = 0x%x\n", nextaddr, togo)); - - cs4231_read(sc, CS_TEST_AND_INIT); /* clear pending error */ - csr = APC_READ(sc, APC_CSR); - APC_WRITE(sc, APC_PNVA, nextaddr); - APC_WRITE(sc, APC_PNC, togo); - - if ((csr & APC_CSR_PDMA_GO) == 0 || - (csr & APC_CSR_PPAUSE) != 0) { - APC_WRITE(sc, APC_CSR, APC_READ(sc, APC_CSR) & - ~(APC_CSR_PIE | APC_CSR_PPAUSE)); - APC_WRITE(sc, APC_CSR, APC_READ(sc, APC_CSR) | - APC_CSR_GIE | APC_CSR_PIE | APC_CSR_EIE | - APC_CSR_EI | APC_CSR_PMIE | APC_CSR_PDMA_GO); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) | - PLAYBACK_ENABLE); - } - /* load next address */ - if (APC_READ(sc, APC_CSR) & APC_CSR_PD) { - nextaddr += togo; - APC_WRITE(sc, APC_PNVA, nextaddr); - APC_WRITE(sc, APC_PNC, togo); - } - } else { - DPRINTF(("TRG: CNVA = 0x%x, togo = 0x%x\n", nextaddr, togo)); - - cs4231_read(sc, CS_TEST_AND_INIT); /* clear pending error */ - APC_WRITE(sc, APC_CNVA, nextaddr); - APC_WRITE(sc, APC_CNC, togo); - csr = APC_READ(sc, APC_CSR); - if ((csr & APC_CSR_CDMA_GO) == 0 || - (csr & APC_CSR_CPAUSE) != 0) { - csr &= APC_CSR_CPAUSE; - csr |= APC_CSR_GIE | APC_CSR_CMIE | APC_CSR_CIE | - APC_CSR_EI | APC_CSR_CDMA_GO; - APC_WRITE(sc, APC_CSR, csr); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) | - CAPTURE_ENABLE); - } - /* load next address */ - if (APC_READ(sc, APC_CSR) & APC_CSR_CD) { - nextaddr += togo; - APC_WRITE(sc, APC_CNVA, nextaddr); - APC_WRITE(sc, APC_CNC, togo); - } - } - ch->nextaddr = nextaddr; - ch->locked = 1; - CS4231_UNLOCK(sc); -} - -static void -cs4231_ebdma_trigger(struct cs4231_softc *sc, struct cs4231_channel *ch) -{ - u_int32_t csr, togo; - u_int32_t nextaddr; - - CS4231_LOCK(sc); - if (ch->locked) { - device_printf(sc->sc_dev, "%s channel already triggered\n", - ch->dir == PCMDIR_PLAY ? "playback" : "capture"); - CS4231_UNLOCK(sc); - return; - } - - nextaddr = sndbuf_getbufaddr(ch->buffer); - togo = sndbuf_getsize(ch->buffer) / 2; - if (togo % 64 == 0) - sc->sc_burst = EBDCSR_BURST_16; - else if (togo % 32 == 0) - sc->sc_burst = EBDCSR_BURST_8; - else if (togo % 16 == 0) - sc->sc_burst = EBDCSR_BURST_4; - else - sc->sc_burst = EBDCSR_BURST_1; - ch->togo = togo; - DPRINTF(("TRG: DNAR = 0x%x, togo = 0x%x\n", nextaddr, togo)); - if (ch->dir == PCMDIR_PLAY) { - cs4231_read(sc, CS_TEST_AND_INIT); /* clear pending error */ - csr = EBDMA_P_READ(sc, EBDMA_DCSR); - - if (csr & EBDCSR_DMAEN) { - EBDMA_P_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_P_WRITE(sc, EBDMA_DADDR, nextaddr); - } else { - EBDMA_P_WRITE(sc, EBDMA_DCSR, EBDCSR_RESET); - EBDMA_P_WRITE(sc, EBDMA_DCSR, sc->sc_burst); - EBDMA_P_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_P_WRITE(sc, EBDMA_DADDR, nextaddr); - - EBDMA_P_WRITE(sc, EBDMA_DCSR, sc->sc_burst | - EBDCSR_DMAEN | EBDCSR_INTEN | EBDCSR_CNTEN | - EBDCSR_NEXTEN); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) | - PLAYBACK_ENABLE); - } - /* load next address */ - if (EBDMA_P_READ(sc, EBDMA_DCSR) & EBDCSR_A_LOADED) { - nextaddr += togo; - EBDMA_P_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_P_WRITE(sc, EBDMA_DADDR, nextaddr); - } - } else { - cs4231_read(sc, CS_TEST_AND_INIT); /* clear pending error */ - csr = EBDMA_C_READ(sc, EBDMA_DCSR); - - if (csr & EBDCSR_DMAEN) { - EBDMA_C_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_C_WRITE(sc, EBDMA_DADDR, nextaddr); - } else { - EBDMA_C_WRITE(sc, EBDMA_DCSR, EBDCSR_RESET); - EBDMA_C_WRITE(sc, EBDMA_DCSR, sc->sc_burst); - EBDMA_C_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_C_WRITE(sc, EBDMA_DADDR, nextaddr); - - EBDMA_C_WRITE(sc, EBDMA_DCSR, sc->sc_burst | - EBDCSR_WRITE | EBDCSR_DMAEN | EBDCSR_INTEN | - EBDCSR_CNTEN | EBDCSR_NEXTEN); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) | - CAPTURE_ENABLE); - } - /* load next address */ - if (EBDMA_C_READ(sc, EBDMA_DCSR) & EBDCSR_A_LOADED) { - nextaddr += togo; - EBDMA_C_WRITE(sc, EBDMA_DCNT, togo); - EBDMA_C_WRITE(sc, EBDMA_DADDR, nextaddr); - } - } - ch->nextaddr = nextaddr; - ch->locked = 1; - CS4231_UNLOCK(sc); -} - -static void -cs4231_halt(struct cs4231_channel *ch) -{ - struct cs4231_softc *sc; - u_int8_t status; - int i; - - sc = ch->parent; - CS4231_LOCK(sc); - if (ch->locked == 0) { - CS4231_UNLOCK(sc); - return; - } - - if (ch->dir == PCMDIR_PLAY ) { - if ((sc->sc_flags & CS4231_SBUS) != 0) { - /* XXX Kills some capture bits */ - APC_WRITE(sc, APC_CSR, APC_READ(sc, APC_CSR) & - ~(APC_CSR_EI | APC_CSR_GIE | APC_CSR_PIE | - APC_CSR_EIE | APC_CSR_PDMA_GO | APC_CSR_PMIE)); - } else { - EBDMA_P_WRITE(sc, EBDMA_DCSR, - EBDMA_P_READ(sc, EBDMA_DCSR) & ~EBDCSR_DMAEN); - } - /* Waiting for playback FIFO to empty */ - status = cs4231_read(sc, CS_TEST_AND_INIT); - for (i = CS_TIMEOUT; - i && (status & PLAYBACK_UNDERRUN) == 0; i--) { - DELAY(5); - status = cs4231_read(sc, CS_TEST_AND_INIT); - } - if (i == 0) - device_printf(sc->sc_dev, "timeout waiting for " - "playback FIFO drain\n"); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) & (~PLAYBACK_ENABLE)); - } else { - if ((sc->sc_flags & CS4231_SBUS) != 0) { - /* XXX Kills some playback bits */ - APC_WRITE(sc, APC_CSR, APC_CSR_CAPTURE_PAUSE); - } else { - EBDMA_C_WRITE(sc, EBDMA_DCSR, - EBDMA_C_READ(sc, EBDMA_DCSR) & ~EBDCSR_DMAEN); - } - /* Waiting for capture FIFO to empty */ - status = cs4231_read(sc, CS_TEST_AND_INIT); - for (i = CS_TIMEOUT; - i && (status & CAPTURE_OVERRUN) == 0; i--) { - DELAY(5); - status = cs4231_read(sc, CS_TEST_AND_INIT); - } - if (i == 0) - device_printf(sc->sc_dev, "timeout waiting for " - "capture FIFO drain\n"); - cs4231_write(sc, CS_INTERFACE_CONFIG, - cs4231_read(sc, CS_INTERFACE_CONFIG) & (~CAPTURE_ENABLE)); - } - ch->locked = 0; - CS4231_UNLOCK(sc); -} diff --git a/sys/dev/sound/sbus/cs4231.h b/sys/dev/sound/sbus/cs4231.h deleted file mode 100644 index 717e7792712e..000000000000 --- a/sys/dev/sound/sbus/cs4231.h +++ /dev/null @@ -1,243 +0,0 @@ -/* $FreeBSD$ */ -/*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD - * - * Copyright (c) 1996 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Ken Hornstein and John Kohl. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``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 REGENTS OR CONTRIBUTORS 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. - */ - -/** - * Register defs for Crystal Semiconductor CS4231 Audio Codec/mixer - * chip, used on Gravis UltraSound MAX cards. - * - * Block diagram: - * +----------------------------------------------------+ - * | | - * | +----------------------------------------------+ | - * | |mixed in +-+ | | - * | +------------>--| | | | - * | mic in | | | | - * Mic --+-->| --------- GAIN ->-| | | | - * | | AUX 1 in |M| | | - * GF1 --)-->| -------------+-->-|U| | | - * | | Line in | |X|---- GAIN ----------+ | | - * Line --)-->| ---------+---)-->-| | | | | - * | | | | | | | | | - * | | | | +-+ ADC | | - * | | | | | | | - * | | | | | | | - * | | | +--- L/M --\ | | | AMP--> - * | | | \ | | | | - * | | | \ | | | | - * | | +---- L/M -------O-->--+--------)-------+-|--+-> line - * | | mono in /| | | | - * +---|-->------------ L/M -----/ | | | | - * | AUX 2 in | | | | - * CD --------|-->------------ L/M -------+ L/M | | - * | | v | - * | | | | - * | DAC | | - * | | | | - * +----------------------------------------------------+ - * | | - * | | - * v v - * Pc BUS (DISK) ??? - * - * Documentation for this chip can be found at: - * http://www.cirrus.com/products/overviews/cs4231.html - */ - -/* - * This file was merged from two header files.(ad1848reg.h and cs4231reg.h) - * And the suffix AD1848 and SP was changed to CS4231 and CS respectively. - */ -/* CS4231 direct registers */ -#define CS4231_IADDR 0x00 -#define CS4231_IDATA 0x01 -#define CS4231_STATUS 0x02 -#define CS4231_PIO 0x03 - -/* Index address register */ -#define CS_IN_INIT 0x80 -#define MODE_CHANGE_ENABLE 0x40 -#define TRANSFER_DISABLE 0x20 -#define ADDRESS_MASK 0xe0 - -/* Status bits */ -#define INTERRUPT_STATUS 0x01 -#define PLAYBACK_READY 0x02 -#define PLAYBACK_LEFT 0x04 -/* pbright is not left */ -#define PLAYBACK_UPPER 0x08 -/* bplower is not upper */ -#define SAMPLE_ERROR 0x10 -#define CAPTURE_READY 0x20 -#define CAPTURE_LEFT 0x40 -/* cpright is not left */ -#define CAPTURE_UPPER 0x80 -/* cplower is not upper */ - -/* CS4231 indirect mapped registers */ -#define CS_LEFT_INPUT_CONTROL 0x00 -#define CS_RIGHT_INPUT_CONTROL 0x01 -#define CS_LEFT_AUX1_CONTROL 0x02 -#define CS_RIGHT_AUX1_CONTROL 0x03 -#define CS_LEFT_AUX2_CONTROL 0x04 -#define CS_RIGHT_AUX2_CONTROL 0x05 -#define CS_LEFT_OUTPUT_CONTROL 0x06 -#define CS_RIGHT_OUTPUT_CONTROL 0x07 -#define CS_CLOCK_DATA_FORMAT 0x08 -#define CS_INTERFACE_CONFIG 0x09 -#define CS_PIN_CONTROL 0x0a -#define CS_TEST_AND_INIT 0x0b -#define CS_MISC_INFO 0x0c -#define CS_DIGITAL_MIX 0x0d -#define CS_UPPER_BASE_COUNT 0x0e -#define CS_LOWER_BASE_COUNT 0x0f -/* CS4231/AD1845 mode2 registers; added to AD1848 registers */ -#define CS_ALT_FEATURE1 0x10 -#define CS_ALT_FEATURE2 0x11 -#define CS_LEFT_LINE_CONTROL 0x12 -#define CS_RIGHT_LINE_CONTROL 0x13 -#define CS_TIMER_LOW 0x14 -#define CS_TIMER_HIGH 0x15 -#define CS_UPPER_FREQUENCY_SEL 0x16 -#define CS_LOWER_FREQUENCY_SEL 0x17 -#define CS_IRQ_STATUS 0x18 -#define CS_VERSION_ID 0x19 -#define CS_MONO_IO_CONTROL 0x1a -#define CS_POWERDOWN_CONTROL 0x1b -#define CS_REC_FORMAT 0x1c -#define CS_XTAL_SELECT 0x1d -#define CS_UPPER_REC_CNT 0x1e -#define CS_LOWER_REC_CNT 0x1f -#define CS_REG_NONE 0xff - -#define CS_IN_MASK 0x2f -#define CS_IN_LINE 0x00 -#define CS_IN_AUX1 0x40 -#define CS_IN_MIC 0x80 -#define CS_IN_DAC 0xc0 -#define CS_MIC_GAIN_ENABLE 0x20 -#define CS_IN_GAIN_MASK 0xf0 - -/* ADC input control - registers I0 (channel 1,left); I1 (channel 1,right) */ -#define ADC_INPUT_ATTEN_BITS 0x0f -#define ADC_INPUT_GAIN_ENABLE 0x20 - -/* Aux input control - registers I2 (channel 1,left); I3 (channel 1,right) - I4 (channel 2,left); I5 (channel 2,right) */ -#define AUX_INPUT_ATTEN_BITS 0x1f -#define AUX_INPUT_ATTEN_MASK 0xe0 -#define AUX_INPUT_MUTE 0x80 - -/* Output bits - registers I6,I7*/ -#define OUTPUT_MUTE 0x80 -#define OUTPUT_ATTEN_BITS 0x3f -#define OUTPUT_ATTEN_MASK (~OUTPUT_ATTEN_BITS & 0xff) - -/* Clock and Data format reg bits (some also Capture Data format) - reg I8 */ -#define CS_CLOCK_DATA_FORMAT_MASK 0x0f -#define CLOCK_XTAL1 0x00 -#define CLOCK_XTAL2 0x01 -#define CLOCK_FREQ_MASK 0xf1 -#define CS_AFMT_STEREO 0x10 -#define CS_AFMT_U8 0x00 -#define CS_AFMT_MU_LAW 0x20 -#define CS_AFMT_S16_LE 0x40 -#define CS_AFMT_A_LAW 0x60 -#define CS_AFMT_IMA_ADPCM 0xa0 -#define CS_AFMT_S16_BE 0xc0 - -/* Interface Configuration reg bits - register I9 */ -#define PLAYBACK_ENABLE 0x01 -#define CAPTURE_ENABLE 0x02 -#define DUAL_DMA 0x00 -#define SINGLE_DMA 0x04 -#define AUTO_CAL_ENABLE 0x08 -#define PLAYBACK_PIO_ENABLE 0x40 -#define CAPTURE_PIO_ENABLE 0x80 - -/* Pin control bits - register I10 */ -#define INTERRUPT_ENABLE 0x02 -#define XCTL0_ENABLE 0x40 -#define XCTL1_ENABLE 0x80 - -/* Test and init reg bits - register I11 (read-only) */ -#define OVERRANGE_LEFT_MASK 0xfc -#define OVERRANGE_RIGHT_MASK 0xf3 -#define DATA_REQUEST_STATUS 0x10 -#define AUTO_CAL_IN_PROG 0x20 -#define PLAYBACK_UNDERRUN 0x40 -#define CAPTURE_OVERRUN 0x80 - -/* Miscellaneous Control reg bits - register I12 */ -#define CS_ID_MASK 0x70 -#define CS_MODE2 0x40 -#define CS_CODEC_ID_MASK 0x0f - -/* Digital Mix Control reg bits - register I13 */ -#define DIGITAL_MIX1_ENABLE 0x01 -#define MIX_ATTEN_MASK 0x03 - -/* Alternate Feature Enable I - register I16 */ -#define CS_DAC_ZERO 0x01 -#define CS_PMC_ENABLE 0x10 -#define CS_CMC_ENABLE 0x20 -#define CS_OUTPUT_LVL 0x80 - -/* Alternate Feature Enable II - register I17 */ -#define CS_HPF_ENABLE 0x01 -#define DUAL_XTAL_ENABLE 0x02 - -/* alternate feature status(I24) */ -#define CS_AFS_TI 0x40 /* timer interrupt */ -#define CS_AFS_CI 0x20 /* capture interrupt */ -#define CS_AFS_PI 0x10 /* playback interrupt */ -#define CS_AFS_CU 0x08 /* capture underrun */ -#define CS_AFS_CO 0x04 /* capture overrun */ -#define CS_AFS_PO 0x02 /* playback overrun */ -#define CS_AFS_PU 0x01 /* playback underrun */ - -/* Version - register I25 */ -#define CS_VERSION_NUMBER 0xe0 -#define CS_VERSION_CHIPID 0x07 - -/* Miscellaneous Control reg bits */ -#define CS_MODE2 0x40 - -#define MONO_INPUT_ATTEN_BITS 0x0f -#define MONO_INPUT_ATTEN_MASK 0xf0 -#define MONO_OUTPUT_MUTE 0x40 -#define MONO_INPUT_MUTE 0x80 -#define MONO_INPUT_MUTE_MASK 0x7f - -#define LINE_INPUT_ATTEN_BITS 0x1f -#define LINE_INPUT_ATTEN_MASK 0xe0 -#define LINE_INPUT_MUTE 0x80 -#define LINE_INPUT_MUTE_MASK 0x7f diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index c338053ad6fa..9b9798d8c57d 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -90,11 +90,6 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <machine/atomic.h> -#ifdef __sparc64__ -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> -#endif - #include <sys/rman.h> #include <cam/cam.h> @@ -134,8 +129,6 @@ typedef u_int32_t u32; #define MEMORY_BARRIER() do { ; } while(0) #elif defined __powerpc__ #define MEMORY_BARRIER() __asm__ volatile("eieio; sync" : : : "memory") -#elif defined __sparc64__ -#define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") #elif defined __arm__ #define MEMORY_BARRIER() dmb() #elif defined __aarch64__ @@ -2652,9 +2645,6 @@ static int sym_prepare_setting(hcb_p np, struct sym_nvram *nvram) */ np->myaddr = 255; sym_nvram_setup_host (np, nvram); -#ifdef __sparc64__ - np->myaddr = OF_getscsinitid(np->device); -#endif /* * Get SCSI addr of host adapter (set by bios?). diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c index 190da5254546..2dc4f503854e 100644 --- a/sys/dev/syscons/scgfbrndr.c +++ b/sys/dev/syscons/scgfbrndr.c @@ -107,38 +107,11 @@ sc_rndr_sw_t grrndrsw = { #endif /* SC_NO_MODE_CHANGE */ #ifndef SC_NO_CUTPASTE -#ifdef __sparc64__ -static u_char mouse_pointer[22 * 2] = { - 0x00, 0x00, /* ............ */ - 0x80, 0x00, /* *........... */ - 0xc0, 0x00, /* **.......... */ - 0xe0, 0x00, /* ***......... */ - 0xf0, 0x00, /* ****........ */ - 0xf8, 0x00, /* *****....... */ - 0xfc, 0x00, /* ******...... */ - 0xfe, 0x00, /* *******..... */ - 0xff, 0x00, /* ********.... */ - 0xff, 0x80, /* *********... */ - 0xfc, 0xc0, /* ******..**.. */ - 0xdc, 0x00, /* **.***...... */ - 0x8e, 0x00, /* *...***..... */ - 0x0e, 0x00, /* ....***..... */ - 0x07, 0x00, /* .....***.... */ - 0x04, 0x00, /* .....*...... */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00, /* ............ */ - 0x00, 0x00 /* ............ */ -}; -#else static u_char mouse_pointer[16] = { 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 }; #endif -#endif static void gfb_nop(scr_stat *scp) @@ -241,7 +214,7 @@ gfb_cursor_shape(scr_stat *scp, int base, int height, int blink) static int pxlblinkrate = 0; -#if defined(__sparc64__) || defined(SC_OFWFB) +#if defined(SC_OFWFB) static void gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { @@ -336,17 +309,12 @@ gfb_blink(scr_stat *scp, int at, int flip) static void gfb_mouse(scr_stat *scp, int x, int y, int on) { -#ifdef __sparc64__ - vidd_putm(scp->sc->adp, x, y, mouse_pointer, - on ? 0xffffffff : 0x0, 22, 12); -#else if (on) { vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8); } else { /* XXX: removal is incomplete for h/w cursors and borders. */ } -#endif } #endif /* SC_NO_CUTPASTE */ diff --git a/sys/dev/syscons/schistory.c b/sys/dev/syscons/schistory.c index 8da242c8a9f8..64f662b5a7f4 100644 --- a/sys/dev/syscons/schistory.c +++ b/sys/dev/syscons/schistory.c @@ -44,8 +44,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/malloc.h> -#if defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__sparc64__) +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/scterm-dumb.c b/sys/dev/syscons/scterm-dumb.c index b888897d5437..3011b0de8f52 100644 --- a/sys/dev/syscons/scterm-dumb.c +++ b/sys/dev/syscons/scterm-dumb.c @@ -35,8 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/consio.h> -#if defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__sparc64__) +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/scterm-sc.c b/sys/dev/syscons/scterm-sc.c index 52ba50714f9d..de46827b5837 100644 --- a/sys/dev/syscons/scterm-sc.c +++ b/sys/dev/syscons/scterm-sc.c @@ -36,8 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/consio.h> -#if defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__sparc64__) +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c index ae231f01d294..b575b4ec3119 100644 --- a/sys/dev/syscons/scterm-teken.c +++ b/sys/dev/syscons/scterm-teken.c @@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$"); #include <sys/consio.h> #include <sys/kbio.h> -#if defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) || defined(__sparc64__) +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> diff --git a/sys/dev/syscons/scvtb.c b/sys/dev/syscons/scvtb.c index 44b667b8ab82..28ea4b41666c 100644 --- a/sys/dev/syscons/scvtb.c +++ b/sys/dev/syscons/scvtb.c @@ -76,12 +76,10 @@ sc_vtb_init(sc_vtb_t *vtb, int type, int cols, int rows, void *buf, int wait) } vtb->vtb_flags |= VTB_VALID; break; -#ifndef __sparc64__ case VTB_FRAMEBUFFER: vtb->vtb_buffer = (vm_offset_t)buf; vtb->vtb_flags |= VTB_VALID; break; -#endif default: break; } @@ -121,44 +119,36 @@ sc_vtb_size(int cols, int rows) int sc_vtb_getc(sc_vtb_t *vtb, int at) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) return (readw(sc_vtb_pointer(vtb, at)) & 0x00ff); else -#endif return (*(u_int16_t *)sc_vtb_pointer(vtb, at) & 0x00ff); } int sc_vtb_geta(sc_vtb_t *vtb, int at) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) return (readw(sc_vtb_pointer(vtb, at)) & 0xff00); else -#endif return (*(u_int16_t *)sc_vtb_pointer(vtb, at) & 0xff00); } void sc_vtb_putc(sc_vtb_t *vtb, int at, int c, int a) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) writew(sc_vtb_pointer(vtb, at), a | c); else -#endif *(u_int16_t *)sc_vtb_pointer(vtb, at) = a | c; } vm_offset_t sc_vtb_putchar(sc_vtb_t *vtb, vm_offset_t p, int c, int a) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) writew(p, a | c); else -#endif *(u_int16_t *)p = a | c; return (p + sizeof(u_int16_t)); } @@ -178,18 +168,15 @@ sc_vtb_pos(sc_vtb_t *vtb, int pos, int offset) void sc_vtb_clear(sc_vtb_t *vtb, int c, int attr) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) fillw_io(attr | c, sc_vtb_pointer(vtb, 0), vtb->vtb_size); else -#endif fillw(attr | c, (void *)sc_vtb_pointer(vtb, 0), vtb->vtb_size); } void sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count) { -#ifndef __sparc64__ /* XXX if both are VTB_VRAMEBUFFER... */ if (vtb2->vtb_type == VTB_FRAMEBUFFER) bcopy_toio(sc_vtb_pointer(vtb1, from), @@ -200,7 +187,6 @@ sc_vtb_copy(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int to, int count) sc_vtb_pointer(vtb2, to), count*sizeof(u_int16_t)); else -#endif bcopy((void *)sc_vtb_pointer(vtb1, from), (void *)sc_vtb_pointer(vtb2, to), count*sizeof(u_int16_t)); @@ -216,13 +202,11 @@ sc_vtb_append(sc_vtb_t *vtb1, int from, sc_vtb_t *vtb2, int count) while (count > 0) { len = imin(count, vtb2->vtb_size - vtb2->vtb_tail); -#ifndef __sparc64__ if (vtb1->vtb_type == VTB_FRAMEBUFFER) bcopy_fromio(sc_vtb_pointer(vtb1, from), sc_vtb_pointer(vtb2, vtb2->vtb_tail), len*sizeof(u_int16_t)); else -#endif bcopy((void *)sc_vtb_pointer(vtb1, from), (void *)sc_vtb_pointer(vtb2, vtb2->vtb_tail), len*sizeof(u_int16_t)); @@ -243,11 +227,9 @@ sc_vtb_erase(sc_vtb_t *vtb, int at, int count, int c, int attr) { if (at + count > vtb->vtb_size) count = vtb->vtb_size - at; -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) fillw_io(attr | c, sc_vtb_pointer(vtb, at), count); else -#endif fillw(attr | c, (void *)sc_vtb_pointer(vtb, at), count); } @@ -260,12 +242,10 @@ sc_vtb_move(sc_vtb_t *vtb, int from, int to, int count) count = vtb->vtb_size - to; if (count <= 0) return; -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) bcopy_io(sc_vtb_pointer(vtb, from), sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t)); else -#endif bcopy((void *)sc_vtb_pointer(vtb, from), (void *)sc_vtb_pointer(vtb, to), count*sizeof(u_int16_t)); } @@ -279,23 +259,19 @@ sc_vtb_delete(sc_vtb_t *vtb, int at, int count, int c, int attr) count = vtb->vtb_size - at; len = vtb->vtb_size - at - count; if (len > 0) { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) bcopy_io(sc_vtb_pointer(vtb, at + count), sc_vtb_pointer(vtb, at), len*sizeof(u_int16_t)); else -#endif bcopy((void *)sc_vtb_pointer(vtb, at + count), (void *)sc_vtb_pointer(vtb, at), len*sizeof(u_int16_t)); } -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) fillw_io(attr | c, sc_vtb_pointer(vtb, at + len), vtb->vtb_size - at - len); else -#endif fillw(attr | c, (void *)sc_vtb_pointer(vtb, at + len), vtb->vtb_size - at - len); } @@ -306,21 +282,17 @@ sc_vtb_ins(sc_vtb_t *vtb, int at, int count, int c, int attr) if (at + count > vtb->vtb_size) count = vtb->vtb_size - at; else { -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) bcopy_io(sc_vtb_pointer(vtb, at), sc_vtb_pointer(vtb, at + count), (vtb->vtb_size - at - count)*sizeof(u_int16_t)); else -#endif bcopy((void *)sc_vtb_pointer(vtb, at), (void *)sc_vtb_pointer(vtb, at + count), (vtb->vtb_size - at - count)*sizeof(u_int16_t)); } -#ifndef __sparc64__ if (vtb->vtb_type == VTB_FRAMEBUFFER) fillw_io(attr | c, sc_vtb_pointer(vtb, at), count); else -#endif fillw(attr | c, (void *)sc_vtb_pointer(vtb, at), count); } diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 06d4e525e834..d822820e13a0 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -65,8 +65,7 @@ __FBSDID("$FreeBSD$"); #include <sys/power.h> #include <machine/clock.h> -#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) || \ - defined(__sparc64__) +#if defined(__arm__) || defined(__mips__) || defined(__powerpc__) #include <machine/sc_machdep.h> #else #include <machine/pc/display.h> @@ -536,10 +535,8 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc_t *sc, int unit) scp->end = 0; scp->cursor_pos = scp->cursor_oldpos = scp->xsize * scp->xsize; scp->mode = sc->initial_mode = vmode; -#ifndef __sparc64__ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, (void *)sc->adp->va_window, FALSE); -#endif sc_alloc_scr_buffer(scp, FALSE, FALSE); sc_init_emulator(scp, NULL); #ifndef SC_NO_CUTPASTE @@ -725,9 +722,7 @@ sctty_open(struct tty *tp) int unit = scdevtounit(tp); sc_softc_t *sc; scr_stat *scp; -#ifndef __sparc64__ keyarg_t key; -#endif DPRINTF(5, ("scopen: dev:%s, unit:%d, vty:%d\n", devtoname(tp->t_dev), unit, @@ -741,13 +736,11 @@ sctty_open(struct tty *tp) if (!tty_opened(tp)) { /* Use the current setting of the <-- key as default VERASE. */ /* If the Delete key is preferable, an stty is necessary */ -#ifndef __sparc64__ if (sc->kbd != NULL) { key.keynum = KEYCODE_BS; (void)kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); tp->t_termios.c_cc[VERASE] = key.key.map[0]; } -#endif } scp = sc_get_stat(tp); @@ -789,9 +782,7 @@ sctty_close(struct tty *tp) scp->smode.mode = VT_AUTO; } else { sc_vtb_destroy(&scp->vtb); -#ifndef __sparc64__ sc_vtb_destroy(&scp->scr); -#endif sc_free_history_buffer(scp, scp->ysize); SC_STAT(tp) = NULL; free(scp, M_DEVBUF); @@ -3003,11 +2994,9 @@ exchange_scr(sc_softc_t *sc) scp = sc->cur_scp = sc->new_scp; if (sc->old_scp->mode != scp->mode || ISUNKNOWNSC(sc->old_scp)) set_mode(scp); -#ifndef __sparc64__ else sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, (void *)sc->adp->va_window, FALSE); -#endif scp->status |= MOUSE_HIDDEN; sc_move_cursor(scp, scp->xpos, scp->ypos); if (!ISGRAPHSC(scp)) @@ -3334,14 +3323,12 @@ scinit(int unit, int flags) } sc->cur_scp = scp; -#ifndef __sparc64__ /* copy screen to temporary buffer */ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, (void *)scp->sc->adp->va_window, FALSE); if (ISTEXTSC(scp)) sc_vtb_copy(&scp->scr, 0, &scp->vtb, 0, scp->xsize * scp->ysize); -#endif /* Sync h/w cursor position to s/w (sc and teken). */ if (col >= scp->xsize) @@ -3666,9 +3653,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) #endif sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE); -#ifndef __sparc64__ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE); -#endif scp->xoff = scp->yoff = 0; scp->xpos = scp->ypos = 0; scp->start = scp->xsize * scp->ysize - 1; @@ -4192,10 +4177,8 @@ set_mode(scr_stat *scp) /* setup video hardware for the given mode */ vidd_set_mode(scp->sc->adp, scp->mode); scp->rndr->init(scp); -#ifndef __sparc64__ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, (void *)scp->sc->adp->va_window, FALSE); -#endif update_font(scp); diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 405e5ba42932..21060352f767 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -88,15 +88,7 @@ #define DPRINTF(l, p) if (SC_DEBUG_LEVEL >= (l)) printf p -#ifndef __sparc64__ #define SC_DRIVER_NAME "sc" -#else -/* - * Use a different driver name on sparc64 so it does not get confused - * with the system controller devices which are also termed 'sc' in OFW. - */ -#define SC_DRIVER_NAME "syscons" -#endif #define SC_VTY(dev) (((sc_ttysoftc *)tty_softc(tp))->st_index) #define SC_DEV(sc, vty) ((sc)->dev[(vty) - (sc)->first_vty]) #define SC_STAT(tp) (*((scr_stat **)&((sc_ttysoftc *)tty_softc(tp))->st_stat)) @@ -287,9 +279,7 @@ typedef struct scr_stat { int index; /* index of this vty */ struct sc_softc *sc; /* pointer to softc */ struct sc_rndr_sw *rndr; /* renderer */ -#ifndef __sparc64__ sc_vtb_t scr; -#endif sc_vtb_t vtb; int xpos; /* current X position */ diff --git a/sys/dev/uart/uart_bus_ebus.c b/sys/dev/uart/uart_bus_ebus.c deleted file mode 100644 index dd50ff83596f..000000000000 --- a/sys/dev/uart/uart_bus_ebus.c +++ /dev/null @@ -1,108 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2001 by Thomas Moestl <tmm@FreeBSD.org>. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/module.h> - -#include <dev/ofw/ofw_bus.h> - -#include <machine/bus.h> -#include <sys/rman.h> -#include <machine/resource.h> -#include <machine/ver.h> - -#include <dev/uart/uart.h> -#include <dev/uart/uart_bus.h> -#include <dev/uart/uart_cpu.h> - -static int uart_ebus_probe(device_t dev); - -static device_method_t uart_ebus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, uart_ebus_probe), - DEVMETHOD(device_attach, uart_bus_attach), - DEVMETHOD(device_detach, uart_bus_detach), - { 0, 0 } -}; - -static driver_t uart_ebus_driver = { - uart_driver_name, - uart_ebus_methods, - sizeof(struct uart_softc), -}; - -static int -uart_ebus_probe(device_t dev) -{ - const char *nm, *cmpt; - struct uart_softc *sc; - struct uart_devinfo dummy; - - sc = device_get_softc(dev); - sc->sc_class = NULL; - - nm = ofw_bus_get_name(dev); - cmpt = ofw_bus_get_compat(dev); - if (cmpt == NULL) - cmpt = ""; - if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") || - !strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") || - !strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") || - !strcmp(cmpt, "su16550") || !strcmp(cmpt, "su16552")) { - /* - * On AXi and AXmp boards the NS16550 (used to connect - * keyboard/mouse) share their IRQ lines with the i8042. - * Any IRQ activity (typically during attach) of the - * NS16550 used to connect the keyboard when actually the - * PS/2 keyboard is selected in OFW causes interaction - * with the OBP i8042 driver resulting in a hang and vice - * versa. As RS232 keyboards and mice obviously aren't - * meant to be used in parallel with PS/2 ones on these - * boards don't attach to the NS16550 in case the RS232 - * keyboard isn't selected in order to prevent such hangs. - */ - if ((!strcmp(sparc64_model, "SUNW,UltraAX-MP") || - !strcmp(sparc64_model, "SUNW,UltraSPARC-IIi-Engine")) && - uart_cpu_getdev(UART_DEV_KEYBOARD, &dummy)) { - device_disable(dev); - return (ENXIO); - } - sc->sc_class = &uart_ns8250_class; - return (uart_bus_probe(dev, 0, 0, 0, 0, 0, 0)); - } - - return (ENXIO); -} - -DRIVER_MODULE(uart, ebus, uart_ebus_driver, uart_devclass, 0, 0); diff --git a/sys/dev/uart/uart_cpu_sparc64.c b/sys/dev/uart/uart_cpu_sparc64.c deleted file mode 100644 index 17a2ca84bb6c..000000000000 --- a/sys/dev/uart/uart_cpu_sparc64.c +++ /dev/null @@ -1,307 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003, 2004 Marcel Moolenaar - * Copyright (c) 2004 - 2006 Marius Strobl <marius@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> - -#include <machine/bus.h> -#include <machine/bus_private.h> - -#include <dev/ofw/openfirm.h> -#include <machine/ofw_machdep.h> - -#include <dev/uart/uart.h> -#include <dev/uart/uart_cpu.h> - -bus_space_tag_t uart_bus_space_io; -bus_space_tag_t uart_bus_space_mem; - -static struct bus_space_tag bst_store[3]; - -/* - * Determine which channel of a SCC a device referenced by a full device - * path or as an alias is (in the latter case we try to look up the device - * path via the /aliases node). - * Only the device paths of devices which are used for TTYs really allow - * to do this as they look like these (taken from /aliases nodes): - * ttya: '/central/fhc/zs@0,902000:a' - * ttyc: '/pci@1f,0/pci@1,1/ebus@1/se@14,400000:a' - * Additionally, for device paths of SCCs which are connected to a RSC - * (Remote System Control) device we can hardcode the appropriate channel. - * Such device paths look like these: - * rsc: '/pci@1f,4000/ebus@1/se@14,200000:ssp' - * ttyc: '/pci@1f,4000/ebus@1/se@14,200000:ssp' - */ -static int -uart_cpu_channel(char *dev) -{ - char alias[64]; - phandle_t aliases; - int len; - const char *p; - - strcpy(alias, dev); - if ((aliases = OF_finddevice("/aliases")) != -1) - (void)OF_getprop(aliases, dev, alias, sizeof(alias)); - len = strlen(alias); - if ((p = strrchr(alias, ':')) == NULL) - return (0); - p++; - if (p - alias == len - 1 && (*p == 'a' || *p == 'b')) - return (*p - 'a' + 1); - if (strcmp(p, "ssp") == 0) - return (1); - return (0); -} - -int -uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) -{ - - return ((b1->bsh == b2->bsh) ? 1 : 0); -} - -/* - * Get the package handle of the UART that is selected as the console, if - * the console is an UART of course. Note that we enforce that both input - * and output are selected. - * Note that the currently active console (i.e. /chosen/stdout and - * /chosen/stdin) may not be the same as the device selected in the - * environment (ie /options/output-device and /options/input-device) because - * keyboard and screen were selected but the keyboard was unplugged or the - * user has changed the environment. In the latter case I would assume that - * the user expects that FreeBSD uses the new console setting. - * For weirder configurations, use ofw_console(4). - */ -static phandle_t -uart_cpu_getdev_console(phandle_t options, char *dev, size_t devsz) -{ - char buf[sizeof("serial")]; - ihandle_t inst; - phandle_t chosen, input, output; - - if (OF_getprop(options, "input-device", dev, devsz) == -1) - return (-1); - input = OF_finddevice(dev); - if (OF_getprop(options, "output-device", dev, devsz) == -1) - return (-1); - output = OF_finddevice(dev); - if (input == -1 || output == -1 || - OF_getproplen(input, "keyboard") >= 0) { - if ((chosen = OF_finddevice("/chosen")) == -1) - return (-1); - if (OF_getprop(chosen, "stdin", &inst, sizeof(inst)) == -1) - return (-1); - if ((input = OF_instance_to_package(inst)) == -1) - return (-1); - if (OF_getprop(chosen, "stdout", &inst, sizeof(inst)) == -1) - return (-1); - if ((output = OF_instance_to_package(inst)) == -1) - return (-1); - snprintf(dev, devsz, "ttya"); - } - if (input != output) - return (-1); - if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) - return (-1); - if (strcmp(buf, "serial") != 0) - return (-1); - /* For a Serengeti console device point to the bootbus controller. */ - if (OF_getprop(input, "name", buf, sizeof(buf)) > 0 && - !strcmp(buf, "sgcn")) { - if ((chosen = OF_finddevice("/chosen")) == -1) - return (-1); - if (OF_getprop(chosen, "iosram", &input, sizeof(input)) == -1) - return (-1); - } - return (input); -} - -/* - * Get the package handle of the UART that's selected as the debug port. - * Since there's no place for this in the OF, we use the kernel environment - * variable "hw.uart.dbgport". Note however that the variable is not a - * list of attributes. It's single device name or alias, as known by - * the OF. - */ -static phandle_t -uart_cpu_getdev_dbgport(char *dev, size_t devsz) -{ - char buf[sizeof("serial")]; - phandle_t input; - - if (!getenv_string("hw.uart.dbgport", dev, devsz)) - return (-1); - if ((input = OF_finddevice(dev)) == -1) - return (-1); - if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) - return (-1); - if (strcmp(buf, "serial") != 0) - return (-1); - return (input); -} - -/* - * Get the package handle of the UART that is selected as the keyboard port, - * if it's actually used to connect the keyboard according to the OF. I.e. - * this will return the UART used to connect the keyboard regardless whether - * it's stdin or not, however not in case the user or the OF gave preference - * to e.g. a PS/2 keyboard by setting /aliases/keyboard accordingly. - */ -static phandle_t -uart_cpu_getdev_keyboard(char *dev, size_t devsz) -{ - char buf[sizeof("serial")]; - phandle_t input; - - if ((input = OF_finddevice("keyboard")) == -1) - return (-1); - if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) - return (-1); - if (strcmp(buf, "serial") != 0) - return (-1); - if (OF_getprop(input, "name", dev, devsz) == -1) - return (-1); - /* - * So far this also matched PS/2 keyboard nodes so make sure it's - * one of the SCCs/UARTs known to be used to connect keyboards. - */ - if (strcmp(dev, "su") && strcmp(dev, "su_pnp") && strcmp(dev, "zs")) - return (-1); - return (input); -} - -int -uart_cpu_getdev(int devtype, struct uart_devinfo *di) -{ - char buf[32], compat[32], dev[64]; - struct uart_class *class; - phandle_t input, options; - bus_addr_t addr; - int baud, bits, error, range, space, stop; - char flag, par; - - if ((options = OF_finddevice("/options")) == -1) - return (ENXIO); - switch (devtype) { - case UART_DEV_CONSOLE: - input = uart_cpu_getdev_console(options, dev, sizeof(dev)); - break; - case UART_DEV_DBGPORT: - input = uart_cpu_getdev_dbgport(dev, sizeof(dev)); - break; - case UART_DEV_KEYBOARD: - input = uart_cpu_getdev_keyboard(dev, sizeof(dev)); - break; - default: - input = -1; - break; - } - if (input == -1) - return (ENXIO); - error = OF_decode_addr(input, 0, &space, &addr); - if (error) - return (error); - - /* Get the device class. */ - if (OF_getprop(input, "name", buf, sizeof(buf)) == -1) - return (ENXIO); - if (OF_getprop(input, "compatible", compat, sizeof(compat)) == -1) - compat[0] = '\0'; - di->bas.regshft = 0; - di->bas.rclk = 0; - class = NULL; - if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || - !strcmp(compat, "sab82532")) { - class = &uart_sab82532_class; - /* SAB82532 are only known to be used for TTYs. */ - if ((di->bas.chan = uart_cpu_channel(dev)) == 0) - return (ENXIO); - addr += uart_getrange(class) * (di->bas.chan - 1); - } else if (!strcmp(buf, "zs")) { - class = &uart_z8530_class; - if ((di->bas.chan = uart_cpu_channel(dev)) == 0) { - /* - * There's no way to determine from OF which - * channel has the keyboard. Should always be - * on channel 1 however. - */ - if (devtype == UART_DEV_KEYBOARD) - di->bas.chan = 1; - else - return (ENXIO); - } - di->bas.regshft = 1; - range = uart_getrange(class) << di->bas.regshft; - addr += range - range * (di->bas.chan - 1); - } else if (!strcmp(buf, "lom-console") || !strcmp(buf, "su") || - !strcmp(buf, "su_pnp") || !strcmp(compat, "rsc-console") || - !strcmp(compat, "su") || !strcmp(compat, "su16550") || - !strcmp(compat, "su16552")) { - class = &uart_ns8250_class; - di->bas.chan = 0; - } else if (!strcmp(compat, "sgsbbc")) { - class = &uart_sbbc_class; - di->bas.chan = 0; - } - if (class == NULL) - return (ENXIO); - - /* Fill in the device info. */ - di->ops = uart_getops(class); - di->bas.bst = &bst_store[devtype]; - di->bas.bsh = sparc64_fake_bustag(space, addr, di->bas.bst); - - /* Get the line settings. */ - if (devtype == UART_DEV_KEYBOARD) - di->baudrate = 1200; - else if (!strcmp(compat, "rsc-console")) - di->baudrate = 115200; - else - di->baudrate = 9600; - di->databits = 8; - di->stopbits = 1; - di->parity = UART_PARITY_NONE; - snprintf(buf, sizeof(buf), "%s-mode", dev); - if (OF_getprop(options, buf, buf, sizeof(buf)) == -1 && - OF_getprop(input, "ssp-console-modes", buf, sizeof(buf)) == -1) - return (0); - if (sscanf(buf, "%d,%d,%c,%d,%c", &baud, &bits, &par, &stop, &flag) - != 5) - return (0); - di->baudrate = baud; - di->databits = bits; - di->stopbits = stop; - di->parity = (par == 'n') ? UART_PARITY_NONE : - (par == 'o') ? UART_PARITY_ODD : UART_PARITY_EVEN; - return (0); -} diff --git a/sys/dev/uart/uart_kbd_sun.c b/sys/dev/uart/uart_kbd_sun.c deleted file mode 100644 index 5c9d7555f186..000000000000 --- a/sys/dev/uart/uart_kbd_sun.c +++ /dev/null @@ -1,869 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_kbd.h" -#include "opt_sunkbd.h" - -#if (defined(SUNKBD_EMULATE_ATKBD) && defined(SUNKBD_DFLT_KEYMAP)) || \ - !defined(SUNKBD_EMULATE_ATKBD) -#define KBD_DFLT_KEYMAP -#endif - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/interrupt.h> -#include <sys/kbio.h> -#include <sys/kernel.h> -#include <sys/limits.h> - -#include <machine/bus.h> - -#include <dev/kbd/kbdreg.h> -#include <dev/kbd/kbdtables.h> - -#include <dev/uart/uart.h> -#include <dev/uart/uart_bus.h> -#include <dev/uart/uart_cpu.h> - -#include <dev/uart/uart_kbd_sun.h> -#if !defined(SUNKBD_EMULATE_ATKBD) -#include <dev/uart/uart_kbd_sun_tables.h> -#endif - -#if defined(SUNKBD_EMULATE_ATKBD) && defined(SUNKBD_DFLT_KEYMAP) -#include "sunkbdmap.h" -#endif -#include "uart_if.h" - -#define SUNKBD_DRIVER_NAME "sunkbd" - -#define TODO printf("%s: unimplemented", __func__) - -struct sunkbd_softc { - keyboard_t sc_kbd; - struct uart_softc *sc_uart; - struct uart_devinfo *sc_sysdev; - - struct callout sc_repeat_callout; - int sc_repeat_key; - - int sc_accents; - int sc_composed_char; - int sc_flags; -#define KPCOMPOSE (1 << 0) - int sc_mode; - int sc_polling; - int sc_repeating; - int sc_state; - -#if defined(SUNKBD_EMULATE_ATKBD) - int sc_buffered_char[2]; -#endif -}; - -static int sunkbd_configure(int flags); -static int sunkbd_probe_keyboard(struct uart_devinfo *di); - -static int sunkbd_probe(int unit, void *arg, int flags); -static int sunkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags); -static int sunkbd_term(keyboard_t *kbd); -static int sunkbd_intr(keyboard_t *kbd, void *arg); -static int sunkbd_test_if(keyboard_t *kbd); -static int sunkbd_enable(keyboard_t *kbd); -static int sunkbd_disable(keyboard_t *kbd); -static int sunkbd_read(keyboard_t *kbd, int wait); -static int sunkbd_check(keyboard_t *kbd); -static u_int sunkbd_read_char(keyboard_t *kbd, int wait); -static int sunkbd_check_char(keyboard_t *kbd); -static int sunkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data); -static int sunkbd_lock(keyboard_t *kbd, int lock); -static void sunkbd_clear_state(keyboard_t *kbd); -static int sunkbd_get_state(keyboard_t *kbd, void *buf, size_t len); -static int sunkbd_set_state(keyboard_t *kbd, void *buf, size_t len); -static int sunkbd_poll_mode(keyboard_t *kbd, int on); -static void sunkbd_diag(keyboard_t *kbd, int level); - -static void sunkbd_repeat(void *v); -#if defined(SUNKBD_EMULATE_ATKBD) -static int keycode2scancode(int keycode, int shift, int up); -#endif - -static keyboard_switch_t sunkbdsw = { - .probe = sunkbd_probe, - .init = sunkbd_init, - .term = sunkbd_term, - .intr = sunkbd_intr, - .test_if = sunkbd_test_if, - .enable = sunkbd_enable, - .disable = sunkbd_disable, - .read = sunkbd_read, - .check = sunkbd_check, - .read_char = sunkbd_read_char, - .check_char = sunkbd_check_char, - .ioctl = sunkbd_ioctl, - .lock = sunkbd_lock, - .clear_state = sunkbd_clear_state, - .get_state = sunkbd_get_state, - .set_state = sunkbd_set_state, - .poll = sunkbd_poll_mode, - .diag = sunkbd_diag -}; - -KEYBOARD_DRIVER(sunkbd, sunkbdsw, sunkbd_configure); - -static struct sunkbd_softc sunkbd_softc; -static struct uart_devinfo uart_keyboard; - -#if defined(SUNKBD_EMULATE_ATKBD) - -#define SCAN_PRESS 0x000 -#define SCAN_RELEASE 0x080 -#define SCAN_PREFIX_E0 0x100 -#define SCAN_PREFIX_E1 0x200 -#define SCAN_PREFIX_CTL 0x400 -#define SCAN_PREFIX_SHIFT 0x800 -#define SCAN_PREFIX (SCAN_PREFIX_E0 | SCAN_PREFIX_E1 | \ - SCAN_PREFIX_CTL | SCAN_PREFIX_SHIFT) - -#define NOTR 0x0 /* no translation */ - -static const uint8_t sunkbd_trtab[] = { - NOTR, 0x6d, 0x78, 0x6e, 0x79, 0x3b, 0x3c, 0x44, /* 0x00 - 0x07 */ - 0x3d, 0x57, 0x3e, 0x58, 0x3f, 0x5d, 0x40, NOTR, /* 0x08 - 0x0f */ - 0x41, 0x42, 0x43, 0x38, 0x5f, 0x68, 0x5c, 0x46, /* 0x10 - 0x17 */ - 0x61, 0x6f, 0x70, 0x64, 0x62, 0x01, 0x02, 0x03, /* 0x18 - 0x1f */ - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, /* 0x20 - 0x27 */ - 0x0c, 0x0d, 0x29, 0x0e, 0x66, 0x77, 0x5b, 0x37, /* 0x28 - 0x2f */ - 0x7a, 0x71, 0x53, 0x74, 0x5e, 0x0f, 0x10, 0x11, /* 0x30 - 0x37 */ - 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, /* 0x38 - 0x3f */ - 0x1a, 0x1b, 0x67, 0x6b, 0x47, 0x48, 0x49, 0x4a, /* 0x40 - 0x47 */ - 0x73, 0x72, 0x63, NOTR, 0x1d, 0x1e, 0x1f, 0x20, /* 0x48 - 0x4f */ - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, /* 0x50 - 0x57 */ - 0x2b, 0x1c, 0x59, 0x4b, 0x4c, 0x4d, 0x52, 0x75, /* 0x58 - 0x5f */ - 0x60, 0x76, 0x45, 0x2a, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x60 - 0x67 */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, NOTR, /* 0x68 - 0x6f */ - 0x4f, 0x50, 0x51, NOTR, NOTR, NOTR, 0x6c, 0x3a, /* 0x70 - 0x77 */ - 0x69, 0x39, 0x6a, 0x65, 0x56, 0x4e, NOTR, NOTR /* 0x78 - 0x7f */ -}; - -#endif - -static int -sunkbd_probe_keyboard(struct uart_devinfo *di) -{ - int c, id, ltries, tries; - - for (tries = 5; tries != 0; tries--) { - uart_putc(di, SKBD_CMD_RESET); - for (ltries = 1000; ltries != 0; ltries--) { - if (uart_poll(di) == SKBD_RSP_RESET) - break; - DELAY(1000); - } - if (ltries == 0) - continue; - id = -1; - for (ltries = 1000; ltries != 0; ltries--) { - switch (c = uart_poll(di)) { - case -1: - break; - case SKBD_RSP_IDLE: - return (id); - default: - id = c; - } - DELAY(1000); - } - } - return (-1); -} - -static int sunkbd_attach(struct uart_softc *sc); -static void sunkbd_uart_intr(void *arg); - -static int -sunkbd_configure(int flags) -{ - struct sunkbd_softc *sc; - - /* - * We are only prepared to be used for the high-level console - * when the keyboard is both configured and attached. - */ - if (!(flags & KB_CONF_PROBE_ONLY)) { - if (KBD_IS_INITIALIZED(&sunkbd_softc.sc_kbd)) - goto found; - else - return (0); - } - - if (uart_cpu_getdev(UART_DEV_KEYBOARD, &uart_keyboard)) - return (0); - if (uart_probe(&uart_keyboard)) - return (0); - uart_init(&uart_keyboard); - - uart_keyboard.type = UART_DEV_KEYBOARD; - uart_keyboard.attach = sunkbd_attach; - uart_add_sysdev(&uart_keyboard); - - if (sunkbd_probe_keyboard(&uart_keyboard) != KB_SUN4) - return (0); - - sc = &sunkbd_softc; - callout_init(&sc->sc_repeat_callout, 0); - sunkbd_clear_state(&sc->sc_kbd); - -#if defined(SUNKBD_EMULATE_ATKBD) - kbd_init_struct(&sc->sc_kbd, SUNKBD_DRIVER_NAME, KB_101, 0, 0, 0, 0); - kbd_set_maps(&sc->sc_kbd, &key_map, &accent_map, fkey_tab, - sizeof(fkey_tab) / sizeof(fkey_tab[0])); -#else - kbd_init_struct(&sc->sc_kbd, SUNKBD_DRIVER_NAME, KB_OTHER, 0, 0, 0, 0); - kbd_set_maps(&sc->sc_kbd, &keymap_sun_us_unix_kbd, - &accentmap_sun_us_unix_kbd, fkey_tab, - sizeof(fkey_tab) / sizeof(fkey_tab[0])); -#endif - sc->sc_mode = K_XLATE; - kbd_register(&sc->sc_kbd); - - sc->sc_sysdev = &uart_keyboard; - - found: - /* Return number of found keyboards. */ - return (1); -} - -static int -sunkbd_attach(struct uart_softc *sc) -{ - - /* - * Don't attach if we didn't probe the keyboard. Note that - * the UART is still marked as a system device in that case. - */ - if (sunkbd_softc.sc_sysdev == NULL) { - device_printf(sc->sc_dev, "keyboard not present\n"); - return (0); - } - - if (sc->sc_sysdev != NULL) { - sunkbd_softc.sc_uart = sc; - -#ifdef KBD_INSTALL_CDEV - kbd_attach(&sunkbd_softc.sc_kbd); -#endif - sunkbd_enable(&sunkbd_softc.sc_kbd); - - swi_add(&tty_intr_event, uart_driver_name, sunkbd_uart_intr, - &sunkbd_softc, SWI_TTY, INTR_TYPE_TTY, &sc->sc_softih); - - sc->sc_opened = 1; - KBD_INIT_DONE(&sunkbd_softc.sc_kbd); - } - - return (0); -} - -static void -sunkbd_uart_intr(void *arg) -{ - struct sunkbd_softc *sc = arg; - int pend; - - if (sc->sc_uart->sc_leaving) - return; - - pend = atomic_readandclear_32(&sc->sc_uart->sc_ttypend); - if (!(pend & SER_INT_MASK)) - return; - - if (pend & SER_INT_RXREADY) { - if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { - sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd, - KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg); - } - } -} - -static int -sunkbd_probe(int unit, void *arg, int flags) -{ - - TODO; - return (0); -} - -static int -sunkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags) -{ - - TODO; - return (0); -} - -static int -sunkbd_term(keyboard_t *kbd) -{ - - TODO; - return (0); -} - -static int -sunkbd_intr(keyboard_t *kbd, void *arg) -{ - - TODO; - return (0); -} - -static int -sunkbd_test_if(keyboard_t *kbd) -{ - - TODO; - return (0); -} - -static int -sunkbd_enable(keyboard_t *kbd) -{ - - KBD_ACTIVATE(kbd); - return (0); -} - -static int -sunkbd_disable(keyboard_t *kbd) -{ - - KBD_DEACTIVATE(kbd); - return (0); -} - -static int -sunkbd_read(keyboard_t *kbd, int wait) -{ - - TODO; - return (0); -} - -static int -sunkbd_check(keyboard_t *kbd) -{ - struct sunkbd_softc *sc; - - if (!KBD_IS_ACTIVE(kbd)) - return (FALSE); - - sc = (struct sunkbd_softc *)kbd; - -#if defined(SUNKBD_EMULATE_ATKBD) - if (sc->sc_buffered_char[0]) - return (TRUE); -#endif - - if (sc->sc_repeating) - return (TRUE); - - if (sc->sc_uart != NULL && !uart_rx_empty(sc->sc_uart)) - return (TRUE); - - if (sc->sc_polling != 0 && sc->sc_sysdev != NULL && - uart_rxready(sc->sc_sysdev)) - return (TRUE); - - return (FALSE); -} - -static u_int -sunkbd_read_char(keyboard_t *kbd, int wait) -{ - struct sunkbd_softc *sc; - int key, release, repeated, suncode; - - sc = (struct sunkbd_softc *)kbd; - -#if defined(SUNKBD_EMULATE_ATKBD) - if (sc->sc_mode == K_RAW && sc->sc_buffered_char[0]) { - key = sc->sc_buffered_char[0]; - if (key & SCAN_PREFIX) { - sc->sc_buffered_char[0] = key & ~SCAN_PREFIX; - return ((key & SCAN_PREFIX_E0) ? 0xe0 : 0xe1); - } else { - sc->sc_buffered_char[0] = sc->sc_buffered_char[1]; - sc->sc_buffered_char[1] = 0; - return (key); - } - } -#endif - - repeated = 0; - if (sc->sc_repeating) { - repeated = 1; - sc->sc_repeating = 0; - callout_reset(&sc->sc_repeat_callout, hz / 10, - sunkbd_repeat, sc); - suncode = sc->sc_repeat_key; - goto process_code; - } - - for (;;) { - next_code: - if (!(sc->sc_flags & KPCOMPOSE) && (sc->sc_composed_char > 0)) { - key = sc->sc_composed_char; - sc->sc_composed_char = 0; - if (key > UCHAR_MAX) - return (ERRKEY); - return (key); - } - - if (sc->sc_uart != NULL && !uart_rx_empty(sc->sc_uart)) { - suncode = uart_rx_get(sc->sc_uart); - } else if (sc->sc_polling != 0 && sc->sc_sysdev != NULL) { - if (wait) - suncode = uart_getc(sc->sc_sysdev); - else if ((suncode = uart_poll(sc->sc_sysdev)) == -1) - return (NOKEY); - } else { - return (NOKEY); - } - - switch (suncode) { - case SKBD_RSP_IDLE: - break; - default: - process_code: - ++kbd->kb_count; - key = SKBD_KEY_CHAR(suncode); - release = suncode & SKBD_KEY_RELEASE; - if (!repeated) { - if (release == 0) { - callout_reset(&sc->sc_repeat_callout, - hz / 2, sunkbd_repeat, sc); - sc->sc_repeat_key = suncode; - } else if (sc->sc_repeat_key == key) { - callout_stop(&sc->sc_repeat_callout); - sc->sc_repeat_key = -1; - } - } - -#if defined(SUNKBD_EMULATE_ATKBD) - key = sunkbd_trtab[key]; - if (key == NOTR) - return (NOKEY); - - if (!repeated) { - switch (key) { - case 0x1d: /* ctrl */ - if (release != 0) - sc->sc_flags &= ~CTLS; - else - sc->sc_flags |= CTLS; - break; - case 0x2a: /* left shift */ - case 0x36: /* right shift */ - if (release != 0) - sc->sc_flags &= ~SHIFTS; - else - sc->sc_flags |= SHIFTS; - break; - case 0x38: /* alt */ - case 0x5d: /* altgr */ - if (release != 0) - sc->sc_flags &= ~ALTS; - else - sc->sc_flags |= ALTS; - break; - } - } - if (sc->sc_mode == K_RAW) { - key = keycode2scancode(key, sc->sc_flags, - release); - if (key & SCAN_PREFIX) { - if (key & SCAN_PREFIX_CTL) { - sc->sc_buffered_char[0] = - 0x1d | (key & SCAN_RELEASE); - sc->sc_buffered_char[1] = - key & ~SCAN_PREFIX; - } else if (key & SCAN_PREFIX_SHIFT) { - sc->sc_buffered_char[0] = - 0x2a | (key & SCAN_RELEASE); - sc->sc_buffered_char[1] = - key & ~SCAN_PREFIX_SHIFT; - } else { - sc->sc_buffered_char[0] = - key & ~SCAN_PREFIX; - sc->sc_buffered_char[1] = 0; - } - return ((key & SCAN_PREFIX_E0) ? - 0xe0 : 0xe1); - } - return (key); - } - switch (key) { - case 0x5c: /* print screen */ - if (sc->sc_flags & ALTS) - key = 0x54; /* sysrq */ - break; - case 0x68: /* pause/break */ - if (sc->sc_flags & CTLS) - key = 0x6c; /* break */ - break; - } - - if (sc->sc_mode == K_CODE) - return (key | release); -#else - if (sc->sc_mode == K_RAW || sc->sc_mode == K_CODE) - return (suncode); -#endif - -#if defined(SUNKBD_EMULATE_ATKBD) - if (key == 0x38) { /* left alt (KP compose key) */ -#else - if (key == 0x13) { /* left alt (KP compose key) */ -#endif - if (release != 0) { - if (sc->sc_flags & KPCOMPOSE) { - sc->sc_flags &= ~KPCOMPOSE; - if (sc->sc_composed_char > - UCHAR_MAX) - sc->sc_composed_char = - 0; - } - } else { - if (!(sc->sc_flags & KPCOMPOSE)) { - sc->sc_flags |= KPCOMPOSE; - sc->sc_composed_char = 0; - } - } - } - if (sc->sc_flags & KPCOMPOSE) { - switch (suncode) { - case 0x44: /* KP 7 */ - case 0x45: /* KP 8 */ - case 0x46: /* KP 9 */ - sc->sc_composed_char *= 10; - sc->sc_composed_char += suncode - 0x3d; - if (sc->sc_composed_char > UCHAR_MAX) - return (ERRKEY); - goto next_code; - case 0x5b: /* KP 4 */ - case 0x5c: /* KP 5 */ - case 0x5d: /* KP 6 */ - sc->sc_composed_char *= 10; - sc->sc_composed_char += suncode - 0x58; - if (sc->sc_composed_char > UCHAR_MAX) - return (ERRKEY); - goto next_code; - case 0x70: /* KP 1 */ - case 0x71: /* KP 2 */ - case 0x72: /* KP 3 */ - sc->sc_composed_char *= 10; - sc->sc_composed_char += suncode - 0x6f; - if (sc->sc_composed_char > UCHAR_MAX) - return (ERRKEY); - goto next_code; - case 0x5e: /* KP 0 */ - sc->sc_composed_char *= 10; - if (sc->sc_composed_char > UCHAR_MAX) - return (ERRKEY); - goto next_code; - - case 0x44 | SKBD_KEY_RELEASE: /* KP 7 */ - case 0x45 | SKBD_KEY_RELEASE: /* KP 8 */ - case 0x46 | SKBD_KEY_RELEASE: /* KP 9 */ - case 0x5b | SKBD_KEY_RELEASE: /* KP 4 */ - case 0x5c | SKBD_KEY_RELEASE: /* KP 5 */ - case 0x5d | SKBD_KEY_RELEASE: /* KP 6 */ - case 0x70 | SKBD_KEY_RELEASE: /* KP 1 */ - case 0x71 | SKBD_KEY_RELEASE: /* KP 2 */ - case 0x72 | SKBD_KEY_RELEASE: /* KP 3 */ - case 0x5e | SKBD_KEY_RELEASE: /* KP 0 */ - goto next_code; - default: - if (sc->sc_composed_char > 0) { - sc->sc_flags &= ~KPCOMPOSE; - sc->sc_composed_char = 0; - return (ERRKEY); - } - } - } - - key = genkbd_keyaction(kbd, key, release, - &sc->sc_state, &sc->sc_accents); - if (key != NOKEY || repeated) - return (key); - } - } - return (0); -} - -static int -sunkbd_check_char(keyboard_t *kbd) -{ - struct sunkbd_softc *sc; - - if (!KBD_IS_ACTIVE(kbd)) - return (FALSE); - - sc = (struct sunkbd_softc *)kbd; - if (!(sc->sc_flags & KPCOMPOSE) && (sc->sc_composed_char > 0)) - return (TRUE); - - return (sunkbd_check(kbd)); -} - -static int -sunkbd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data) -{ - struct sunkbd_softc *sc; - int c, error; -#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) - int ival; -#endif - - sc = (struct sunkbd_softc *)kbd; - error = 0; - switch (cmd) { - case KDGKBMODE: - *(int *)data = sc->sc_mode; - break; -#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) - case _IO('K', 7): - ival = IOCPARM_IVAL(data); - data = (caddr_t)&ival; - /* FALLTHROUGH */ -#endif - case KDSKBMODE: - switch (*(int *)data) { - case K_XLATE: - if (sc->sc_mode != K_XLATE) { - /* make lock key state and LED state match */ - sc->sc_state &= ~LOCK_MASK; - sc->sc_state |= KBD_LED_VAL(kbd); - } - /* FALLTHROUGH */ - case K_RAW: - case K_CODE: - if (sc->sc_mode != *(int *)data) { - sunkbd_clear_state(kbd); - sc->sc_mode = *(int *)data; - } - break; - default: - error = EINVAL; - break; - } - break; - case KDGETLED: - *(int *)data = KBD_LED_VAL(kbd); - break; -#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) - case _IO('K', 66): - ival = IOCPARM_IVAL(data); - data = (caddr_t)&ival; - /* FALLTHROUGH */ -#endif - case KDSETLED: - if (*(int *)data & ~LOCK_MASK) { - error = EINVAL; - break; - } - if (sc->sc_sysdev == NULL) - break; - c = 0; - if (*(int *)data & CLKED) - c |= SKBD_LED_CAPSLOCK; - if (*(int *)data & NLKED) - c |= SKBD_LED_NUMLOCK; - if (*(int *)data & SLKED) - c |= SKBD_LED_SCROLLLOCK; - uart_lock(sc->sc_sysdev->hwmtx); - sc->sc_sysdev->ops->putc(&sc->sc_sysdev->bas, SKBD_CMD_SETLED); - sc->sc_sysdev->ops->putc(&sc->sc_sysdev->bas, c); - uart_unlock(sc->sc_sysdev->hwmtx); - KBD_LED_VAL(kbd) = *(int *)data; - break; - case KDGKBSTATE: - *(int *)data = sc->sc_state & LOCK_MASK; - break; -#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) - case _IO('K', 20): - ival = IOCPARM_IVAL(data); - data = (caddr_t)&ival; - /* FALLTHROUGH */ -#endif - case KDSKBSTATE: - if (*(int *)data & ~LOCK_MASK) { - error = EINVAL; - break; - } - sc->sc_state &= ~LOCK_MASK; - sc->sc_state |= *(int *)data; - /* set LEDs and quit */ - return (sunkbd_ioctl(kbd, KDSETLED, data)); - case KDSETREPEAT: - case KDSETRAD: - break; - case PIO_KEYMAP: - case OPIO_KEYMAP: - case PIO_KEYMAPENT: - case PIO_DEADKEYMAP: - default: - return (genkbd_commonioctl(kbd, cmd, data)); - } - return (error); -} - -static int -sunkbd_lock(keyboard_t *kbd, int lock) -{ - - TODO; - return (0); -} - -static void -sunkbd_clear_state(keyboard_t *kbd) -{ - struct sunkbd_softc *sc; - - sc = (struct sunkbd_softc *)kbd; - sc->sc_repeat_key = -1; - sc->sc_accents = 0; - sc->sc_composed_char = 0; - sc->sc_flags = 0; - sc->sc_polling = 0; - sc->sc_repeating = 0; - sc->sc_state &= LOCK_MASK; /* Preserve locking key state. */ - -#if defined(SUNKBD_EMULATE_ATKBD) - sc->sc_buffered_char[0] = 0; - sc->sc_buffered_char[1] = 0; -#endif -} - -static int -sunkbd_get_state(keyboard_t *kbd, void *buf, size_t len) -{ - - TODO; - return (0); -} - -static int -sunkbd_set_state(keyboard_t *kbd, void *buf, size_t len) -{ - - TODO; - return (0); -} - -static int -sunkbd_poll_mode(keyboard_t *kbd, int on) -{ - struct sunkbd_softc *sc; - - sc = (struct sunkbd_softc *)kbd; - if (on) - sc->sc_polling++; - else - sc->sc_polling--; - return (0); -} - -static void -sunkbd_diag(keyboard_t *kbd, int level) -{ - - TODO; -} - -static void -sunkbd_repeat(void *v) -{ - struct sunkbd_softc *sc = v; - - if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { - if (sc->sc_repeat_key != -1) { - sc->sc_repeating = 1; - sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd, - KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg); - } - } -} - -#if defined(SUNKBD_EMULATE_ATKBD) -static int -keycode2scancode(int keycode, int shift, int up) -{ - static const int scan[] = { - /* KP enter, right ctrl, KP divide */ - 0x1c , 0x1d , 0x35 , - /* print screen */ - 0x37 | SCAN_PREFIX_SHIFT, - /* right alt, home, up, page up, left, right, end */ - 0x38, 0x47, 0x48, 0x49, 0x4b, 0x4d, 0x4f, - /* down, page down, insert, delete */ - 0x50, 0x51, 0x52, 0x53, - /* pause/break (see also below) */ - 0x46, - /* - * MS: left window, right window, menu - * also Sun: left meta, right meta, compose - */ - 0x5b, 0x5c, 0x5d, - /* Sun type 6 USB */ - /* help, stop, again, props, undo, front, copy */ - 0x68, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, - /* open, paste, find, cut, audiomute, audiolower, audioraise */ - 0x64, 0x65, 0x66, 0x67, 0x25, 0x1f, 0x1e, - /* power */ - 0x20 - }; - int scancode; - - scancode = keycode; - if ((keycode >= 89) && (keycode < 89 + nitems(scan))) - scancode = scan[keycode - 89] | SCAN_PREFIX_E0; - /* pause/break */ - if ((keycode == 104) && !(shift & CTLS)) - scancode = 0x45 | SCAN_PREFIX_E1 | SCAN_PREFIX_CTL; - if (shift & SHIFTS) - scancode &= ~SCAN_PREFIX_SHIFT; - return (scancode | (up ? SCAN_RELEASE : SCAN_PRESS)); -} -#endif diff --git a/sys/dev/uart/uart_kbd_sun.h b/sys/dev/uart/uart_kbd_sun.h deleted file mode 100644 index 05a4597930f9..000000000000 --- a/sys/dev/uart/uart_kbd_sun.h +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-4-Clause - * - * Copyright (c) 2002 Jason L. Wright (jason@thought.net) - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jason L. Wright - * 4. 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. - * - * Effort sponsored in part by the Defense Advanced Research Projects - * Agency (DARPA) and Air Force Research Laboratory, Air Force - * Materiel Command, USAF, under agreement number F30602-01-2-0537. - * - * $FreeBSD$ - */ - -/* keyboard commands (host->kbd) */ -#define SKBD_CMD_RESET 0x01 -#define SKBD_CMD_BELLON 0x02 -#define SKBD_CMD_BELLOFF 0x03 -#define SKBD_CMD_CLICKON 0x0a -#define SKBD_CMD_CLICKOFF 0x0b -#define SKBD_CMD_SETLED 0x0e -#define SKBD_CMD_LAYOUT 0x0f - -/* keyboard responses (kbd->host) */ -#define SKBD_RSP_RESET_OK 0x04 /* normal reset status for type 4/5/6 */ -#define SKBD_RSP_IDLE 0x7f /* no keys down */ -#define SKBD_RSP_LAYOUT 0xfe /* layout follows */ -#define SKBD_RSP_RESET 0xff /* reset status follows */ - -#define SKBD_LED_NUMLOCK 0x01 -#define SKBD_LED_COMPOSE 0x02 -#define SKBD_LED_SCROLLLOCK 0x04 -#define SKBD_LED_CAPSLOCK 0x08 - -#define SKBD_STATE_RESET 0 -#define SKBD_STATE_LAYOUT 1 -#define SKBD_STATE_GETKEY 2 - -/* keyboard types */ -#define KB_SUN2 2 /* type 2 keyboard */ -#define KB_SUN3 3 /* type 3 keyboard */ -#define KB_SUN4 4 /* type 4/5/6 keyboard */ - -#define SKBD_KEY_RELEASE 0x80 -#define SKBD_KEY_CHAR(c) ((c) & 0x7f) diff --git a/sys/dev/uart/uart_kbd_sun_tables.h b/sys/dev/uart/uart_kbd_sun_tables.h deleted file mode 100644 index e7dc61205104..000000000000 --- a/sys/dev/uart/uart_kbd_sun_tables.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Automatically generated from sun.us.unix.kbd. - * DO NOT EDIT! - * - * $FreeBSD$ - */ -static keymap_t keymap_sun_us_unix_kbd = { 0x80, { -/* alt - * scan cntrl alt alt cntrl - * code base shift cntrl shift alt shift cntrl shift spcl flgs - * --------------------------------------------------------------------------- - */ -/*00*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*01*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*02*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*03*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*04*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*05*/{{ F( 1), F(13), F(25), F(37), S( 1), S(11), S( 1), S(11),}, 0xFF,0x00 }, -/*06*/{{ F( 2), F(14), F(26), F(38), S( 2), S(12), S( 2), S(12),}, 0xFF,0x00 }, -/*07*/{{ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10),}, 0xFF,0x00 }, -/*08*/{{ F( 3), F(15), F(27), F(39), S( 3), S(13), S( 3), S(13),}, 0xFF,0x00 }, -/*09*/{{ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11),}, 0xFF,0x00 }, -/*0a*/{{ F( 4), F(16), F(28), F(40), S( 4), S(14), S( 4), S(14),}, 0xFF,0x00 }, -/*0b*/{{ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12),}, 0xFF,0x00 }, -/*0c*/{{ F( 5), F(17), F(29), F(41), S( 5), S(15), S( 5), S(15),}, 0xFF,0x00 }, -/*0d*/{{ RALT, RALT, RALT, RALT, RALT, RALT, RALT, RALT, }, 0xFF,0x00 }, -/*0e*/{{ F( 6), F(18), F(30), F(42), S( 6), S(16), S( 6), S(16),}, 0xFF,0x00 }, -/*0f*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*10*/{{ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7),}, 0xFF,0x00 }, -/*11*/{{ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8),}, 0xFF,0x00 }, -/*12*/{{ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9),}, 0xFF,0x00 }, -/*13*/{{ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, }, 0xFF,0x00 }, -/*14*/{{ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50),}, 0xFF,0x00 }, -/*15*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*16*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*17*/{{ SLK, SPSC, SLK, SPSC, SUSP, NOP, SUSP, NOP, }, 0xFF,0x00 }, -/*18*/{{ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53),}, 0xFF,0x00 }, -/*19*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*1a*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*1b*/{{ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58),}, 0xFF,0x00 }, -/*1c*/{{ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55),}, 0xFF,0x00 }, -/*1d*/{{ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, }, 0x02,0x00 }, -/*1e*/{{ '1', '!', NOP, NOP, '1', '!', NOP, NOP, }, 0x33,0x00 }, -/*1f*/{{ '2', '@', 0x00, 0x00, '2', '@', 0x00, 0x00, }, 0x00,0x00 }, -/*20*/{{ '3', '#', NOP, NOP, '3', '#', NOP, NOP, }, 0x33,0x00 }, -/*21*/{{ '4', '$', NOP, NOP, '4', '$', NOP, NOP, }, 0x33,0x00 }, -/*22*/{{ '5', '%', NOP, NOP, '5', '%', NOP, NOP, }, 0x33,0x00 }, -/*23*/{{ '6', '^', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, }, 0x00,0x00 }, -/*24*/{{ '7', '&', NOP, NOP, '7', '&', NOP, NOP, }, 0x33,0x00 }, -/*25*/{{ '8', '*', NOP, NOP, '8', '*', NOP, NOP, }, 0x33,0x00 }, -/*26*/{{ '9', '(', NOP, NOP, '9', '(', NOP, NOP, }, 0x33,0x00 }, -/*27*/{{ '0', ')', NOP, NOP, '0', ')', NOP, NOP, }, 0x33,0x00 }, -/*28*/{{ '-', '_', 0x1F, 0x1F, '-', '_', 0x1F, 0x1F, }, 0x00,0x00 }, -/*29*/{{ '=', '+', NOP, NOP, '=', '+', NOP, NOP, }, 0x33,0x00 }, -/*2a*/{{ '`', '~', NOP, NOP, '`', '~', DBG, NOP, }, 0x33,0x00 }, -/*2b*/{{ 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, }, 0x00,0x00 }, -/*2c*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*2d*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*2e*/{{ '/', '/', '/', '/', '/', '/', '/', '/', }, 0x00,0x02 }, -/*2f*/{{ '*', '*', '*', '*', '*', '*', '*', '*', }, 0x00,0x00 }, -/*30*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*31*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*32*/{{ 0x08, '.', '.', '.', '.', '.', RBT, RBT, }, 0x03,0x02 }, -/*33*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*34*/{{ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49),}, 0xFF,0x00 }, -/*35*/{{ 0x09, BTAB, NOP, NOP, 0x09, BTAB, NOP, NOP, }, 0x77,0x00 }, -/*36*/{{ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, }, 0x00,0x01 }, -/*37*/{{ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, }, 0x00,0x01 }, -/*38*/{{ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, }, 0x00,0x01 }, -/*39*/{{ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, }, 0x00,0x01 }, -/*3a*/{{ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, }, 0x00,0x01 }, -/*3b*/{{ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, }, 0x00,0x01 }, -/*3c*/{{ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, }, 0x00,0x01 }, -/*3d*/{{ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, }, 0x00,0x01 }, -/*3e*/{{ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, }, 0x00,0x01 }, -/*3f*/{{ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, }, 0x00,0x01 }, -/*40*/{{ '[', '{', 0x1B, 0x1B, '[', '{', 0x1B, 0x1B, }, 0x00,0x00 }, -/*41*/{{ ']', '}', 0x1D, 0x1D, ']', '}', 0x1D, 0x1D, }, 0x00,0x00 }, -/*42*/{{ 0x7F, 0x7F, 0x08, 0x08, 0x7F, 0x7F, 0x08, 0x08, }, 0x00,0x00 }, -/*43*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*44*/{{ F(49), '7', '7', '7', '7', '7', '7', '7', }, 0x80,0x02 }, -/*45*/{{ F(50), '8', '8', '8', '8', '8', '8', '8', }, 0x80,0x02 }, -/*46*/{{ F(51), '9', '9', '9', '9', '9', '9', '9', }, 0x80,0x02 }, -/*47*/{{ F(52), '-', '-', '-', '-', '-', '-', '-', }, 0x80,0x02 }, -/*48*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*49*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*4a*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*4b*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*4c*/{{ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, }, 0xFF,0x00 }, -/*4d*/{{ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, }, 0x00,0x01 }, -/*4e*/{{ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, }, 0x00,0x01 }, -/*4f*/{{ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, }, 0x00,0x01 }, -/*50*/{{ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, }, 0x00,0x01 }, -/*51*/{{ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, }, 0x00,0x01 }, -/*52*/{{ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, }, 0x00,0x01 }, -/*53*/{{ 'j', 'J', 0x0A, 0x0A, 'j', 'J', 0x0A, 0x0A, }, 0x00,0x01 }, -/*54*/{{ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, }, 0x00,0x01 }, -/*55*/{{ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, }, 0x00,0x01 }, -/*56*/{{ ';', ':', NOP, NOP, ';', ':', NOP, NOP, }, 0x33,0x00 }, -/*57*/{{ '\'', '"', NOP, NOP, '\'', '"', NOP, NOP, }, 0x33,0x00 }, -/*58*/{{ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, }, 0x00,0x00 }, -/*59*/{{ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, }, 0x00,0x00 }, -/*5a*/{{ 0x0D, 0x0D, 0x0A, 0x0A, 0x0D, 0x0D, 0x0A, 0x0A, }, 0x00,0x00 }, -/*5b*/{{ F(53), '4', '4', '4', '4', '4', '4', '4', }, 0x80,0x02 }, -/*5c*/{{ F(54), '5', '5', '5', '5', '5', '5', '5', }, 0x80,0x02 }, -/*5d*/{{ F(55), '6', '6', '6', '6', '6', '6', '6', }, 0x80,0x02 }, -/*5e*/{{ F(60), '0', '0', '0', '0', '0', '0', '0', }, 0x80,0x02 }, -/*5f*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*60*/{{ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51),}, 0xFF,0x00 }, -/*61*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*62*/{{ NLK, NLK, NLK, NLK, NLK, NLK, NLK, NLK, }, 0xFF,0x00 }, -/*63*/{{ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, }, 0xFF,0x00 }, -/*64*/{{ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, }, 0x00,0x01 }, -/*65*/{{ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, }, 0x00,0x01 }, -/*66*/{{ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, }, 0x00,0x01 }, -/*67*/{{ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, }, 0x00,0x01 }, -/*68*/{{ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, }, 0x00,0x01 }, -/*69*/{{ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, }, 0x00,0x01 }, -/*6a*/{{ 'm', 'M', 0x0D, 0x0D, 'm', 'M', 0x0D, 0x0D, }, 0x00,0x01 }, -/*6b*/{{ ',', '<', NOP, NOP, ',', '<', NOP, NOP, }, 0x33,0x00 }, -/*6c*/{{ '.', '>', NOP, NOP, '.', '>', NOP, NOP, }, 0x33,0x00 }, -/*6d*/{{ '/', '?', NOP, NOP, '/', '?', NOP, NOP, }, 0x33,0x00 }, -/*6e*/{{ RSH, RSH, RSH, RSH, RSH, RSH, RSH, RSH, }, 0xFF,0x00 }, -/*6f*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*70*/{{ F(57), '1', '1', '1', '1', '1', '1', '1', }, 0x80,0x02 }, -/*71*/{{ F(58), '2', '2', '2', '2', '2', '2', '2', }, 0x80,0x02 }, -/*72*/{{ F(59), '3', '3', '3', '3', '3', '3', '3', }, 0x80,0x02 }, -/*73*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*74*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*75*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*76*/{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }, 0x00,0x00 }, -/*77*/{{ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, }, 0xFF,0x00 }, -/*78*/{{ META, META, META, META, META, META, META, META, }, 0xFF,0x00 }, -/*79*/{{ ' ', ' ', 0x00, ' ', ' ', ' ', SUSP, ' ', }, 0x02,0x00 }, -/*7a*/{{ META, META, META, META, META, META, META, META, }, 0xFF,0x00 }, -/*7b*/{{ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59),}, 0xFF,0x00 }, -/*7c*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*7d*/{{ F(56), '+', '+', '+', '+', '+', '+', '+', }, 0x80,0x02 }, -/*7e*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -/*7f*/{{ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, }, 0xFF,0x00 }, -} }; - -static accentmap_t accentmap_sun_us_unix_kbd = { 0 }; - diff --git a/sys/dev/vt/hw/fb/vt_early_fb.c b/sys/dev/vt/hw/fb/vt_early_fb.c index e538ace2c052..12db4368d919 100644 --- a/sys/dev/vt/hw/fb/vt_early_fb.c +++ b/sys/dev/vt/hw/fb/vt_early_fb.c @@ -233,10 +233,6 @@ vt_efb_init(struct vt_device *vd) sc->sc_memt = &bs_be_tag; bus_space_map(sc->sc_memt, info->fb_pbase, info->fb_size, BUS_SPACE_MAP_PREFETCHABLE, &info->fb_vbase); - #elif defined(__sparc64__) - OF_decode_addr(node, 0, &space, &phys); - sc->sc_memt = &vt_efb_memt[0]; - info->addr = sparc64_fake_bustag(space, fb_phys, sc->sc_memt); #else bus_space_map(fdtbus_bs_tag, info->fb_pbase, info->fb_size, BUS_SPACE_MAP_PREFETCHABLE, @@ -274,11 +270,6 @@ vt_efb_init(struct vt_device *vd) #if defined(__powerpc__) OF_decode_addr(node, info->fb_pbase, &sc->sc_memt, &info->fb_vbase); - #elif defined(__sparc64__) - OF_decode_addr(node, info->fb_pbase, &space, &info->fb_pbase); - sc->sc_memt = &vt_efb_memt[0]; - info->fb_vbase = sparc64_fake_bustag(space, info->fb_pbase, - sc->sc_memt); #else bus_space_map(fdtbus_bs_tag, info->fb_pbase, info->fb_size, BUS_SPACE_MAP_PREFETCHABLE, diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 77e1ac687314..24c907ad9063 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -1,4 +1,4 @@ -/*- +e/*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 Nathan Whitehorn @@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$"); #include <vm/pmap.h> #include <machine/bus.h> -#ifdef __sparc64__ -#include <machine/bus_private.h> -#endif #include <machine/cpu.h> #include <dev/ofw/openfirm.h> @@ -366,11 +363,6 @@ ofwfb_init(struct vt_device *vd) uint32_t depth, height, width, stride; uint32_t fb_phys; int i, len; -#ifdef __sparc64__ - static struct bus_space_tag ofwfb_memt[1]; - bus_addr_t phys; - int space; -#endif /* Initialize softc */ vd->vd_softc = sc = &ofwfb_conssoftc; @@ -445,11 +437,6 @@ ofwfb_init(struct vt_device *vd) sc->sc_memt = &bs_be_tag; bus_space_map(sc->sc_memt, fb_phys, sc->fb.fb_size, BUS_SPACE_MAP_PREFETCHABLE, &sc->fb.fb_vbase); - #elif defined(__sparc64__) - OF_decode_addr(node, 0, &space, &phys); - sc->sc_memt = &ofwfb_memt[0]; - sc->fb.fb_vbase = - sparc64_fake_bustag(space, fb_phys, sc->sc_memt); #elif defined(__arm__) sc->sc_memt = fdtbus_bs_tag; bus_space_map(sc->sc_memt, sc->fb.fb_pbase, sc->fb.fb_size, diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 54584a10cddf..d3adc9604ab4 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -217,6 +217,7 @@ exit1(struct thread *td, int rval, int signo) * XXX in case we're rebooting we just let init die in order to * work around an unsolved stack overflow seen very late during * shutdown on sparc64 when the gmirror worker process exists. + * XXX what to do now that sparc64 is gone... remove if? */ if (p == initproc && rebooting == 0) { printf("init died (signal %d, exit %d)\n", signo, rval); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index cf98ca8c2ff7..3ecac176ac02 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -930,9 +930,7 @@ reallocf(void *addr, size_t size, struct malloc_type *mtp, int flags) return (mem); } -#ifndef __sparc64__ CTASSERT(VM_KMEM_SIZE_SCALE >= 1); -#endif /* * Initialize the kernel memory (kmem) arena. diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 92d1066da383..61119dd2f34c 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -166,7 +166,7 @@ void init_param1(void) { -#if !defined(__mips__) && !defined(__arm64__) && !defined(__sparc64__) +#if !defined(__mips__) && !defined(__arm64__) TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); #endif hz = -1; diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c index 5d98e8fbc69f..04c5fb162405 100644 --- a/sys/kern/subr_uio.c +++ b/sys/kern/subr_uio.c @@ -501,77 +501,6 @@ copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz) return (0); } -#ifdef NO_FUEWORD -/* - * XXXKIB The temporal implementation of fue*() functions which do not - * handle usermode -1 properly, mixing it with the fault code. Keep - * this until MD code is written. Currently sparc64 does not have a - * proper implementation. - */ - -int -fueword(volatile const void *base, long *val) -{ - long res; - - res = fuword(base); - if (res == -1) - return (-1); - *val = res; - return (0); -} - -int -fueword32(volatile const void *base, int32_t *val) -{ - int32_t res; - - res = fuword32(base); - if (res == -1) - return (-1); - *val = res; - return (0); -} - -#ifdef _LP64 -int -fueword64(volatile const void *base, int64_t *val) -{ - int64_t res; - - res = fuword64(base); - if (res == -1) - return (-1); - *val = res; - return (0); -} -#endif - -int -casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, - uint32_t newval) -{ - int32_t ov; - - ov = casuword32(base, oldval, newval); - if (ov == -1) - return (-1); - *oldvalp = ov; - return (0); -} - -int -casueword(volatile u_long *p, u_long oldval, u_long *oldvalp, u_long newval) -{ - u_long ov; - - ov = casuword(p, oldval, newval); - if (ov == -1) - return (-1); - *oldvalp = ov; - return (0); -} -#else /* NO_FUEWORD */ int32_t fuword32(volatile const void *addr) { @@ -623,5 +552,3 @@ casuword(volatile u_long *addr, u_long old, u_long new) rv = casueword(addr, old, &val, new); return (rv == -1 ? -1 : val); } - -#endif /* NO_FUEWORD */ diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index bf87e908ed8f..f48095fc22ea 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -657,10 +657,6 @@ static struct witness_order_list_entry order_lists[] = { #ifdef __i386__ { "cy", &lock_class_mtx_spin }, #endif -#ifdef __sparc64__ - { "pcib_mtx", &lock_class_mtx_spin }, - { "rtc_mtx", &lock_class_mtx_spin }, -#endif { "scc_hwmtx", &lock_class_mtx_spin }, { "uart_hwmtx", &lock_class_mtx_spin }, { "fast_taskqueue", &lock_class_mtx_spin }, @@ -692,9 +688,6 @@ static struct witness_order_list_entry order_lists[] = { */ { "intrcnt", &lock_class_mtx_spin }, { "icu", &lock_class_mtx_spin }, -#if defined(SMP) && defined(__sparc64__) - { "ipi", &lock_class_mtx_spin }, -#endif #ifdef __i386__ { "allpmaps", &lock_class_mtx_spin }, { "descriptor tables", &lock_class_mtx_spin }, diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 952255b32fde..6055587fa0c6 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -57,7 +57,6 @@ SUBDIR= \ ath_rate \ ath_pci \ ${_autofs} \ - ${_auxio} \ ${_bce} \ ${_bcm283x_clkman} \ ${_bcm283x_pwm} \ @@ -110,7 +109,6 @@ SUBDIR= \ ${_efirt} \ ${_em} \ ${_ena} \ - ${_epic} \ esp \ ${_et} \ evdev \ @@ -397,8 +395,7 @@ _autofs= autofs .if ${MK_CDDL} != "no" || defined(ALL_MODULES) .if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \ - ${MACHINE_CPUARCH} != "mips" && \ - ${MACHINE_CPUARCH} != "sparc64" + ${MACHINE_CPUARCH} != "mips" SUBDIR+= dtrace .endif SUBDIR+= opensolaris @@ -771,12 +768,6 @@ _nvram= opal_nvram _nvram+= powermac_nvram .endif -.if ${MACHINE_CPUARCH} == "sparc64" -_auxio= auxio -_em= em -_epic= epic -.endif - .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386") _cloudabi32= cloudabi32 diff --git a/sys/modules/auxio/Makefile b/sys/modules/auxio/Makefile deleted file mode 100644 index f46f438accc5..000000000000 --- a/sys/modules/auxio/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/dev/auxio - -KMOD= auxio - -SRCS= auxio.c -SRCS+= device_if.h bus_if.h ofw_bus_if.h - -.include <bsd.kmod.mk> diff --git a/sys/modules/bge/Makefile b/sys/modules/bge/Makefile index 53e3364f0e3a..9a197e8fab3f 100644 --- a/sys/modules/bge/Makefile +++ b/sys/modules/bge/Makefile @@ -5,8 +5,4 @@ KMOD= if_bge SRCS= if_bge.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h -.if ${MACHINE_CPUARCH} == sparc64 -SRCS+= ofw_bus_if.h -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/cas/Makefile b/sys/modules/cas/Makefile index 2e6fcfb4cb45..ef53564f9356 100644 --- a/sys/modules/cas/Makefile +++ b/sys/modules/cas/Makefile @@ -5,7 +5,7 @@ KMOD= if_cas SRCS= bus_if.h device_if.h if_cas.c miibus_if.h pci_if.h ${ofw_bus_if} -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "powerpc" ofw_bus_if= ofw_bus_if.h .endif diff --git a/sys/modules/epic/Makefile b/sys/modules/epic/Makefile deleted file mode 100644 index b791d340b844..000000000000 --- a/sys/modules/epic/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/sparc64/ebus - -KMOD= epic -SRCS= device_if.h epic.c bus_if.h ofw_bus_if.h - -.include <bsd.kmod.mk> diff --git a/sys/modules/esp/Makefile b/sys/modules/esp/Makefile index d582a2da5dbe..1880d385dfb8 100644 --- a/sys/modules/esp/Makefile +++ b/sys/modules/esp/Makefile @@ -6,9 +6,4 @@ KMOD= esp SRCS= device_if.h esp_pci.c ${esp_sbus} bus_if.h ncr53c9x.c ${ofw_bus_if} SRCS+= opt_cam.h pci_if.h -.if ${MACHINE} == "sparc64" -ofw_bus_if= ofw_bus_if.h -esp_sbus= esp_sbus.c -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/gem/Makefile b/sys/modules/gem/Makefile index 54083b0de6cb..13c9003dc38c 100644 --- a/sys/modules/gem/Makefile +++ b/sys/modules/gem/Makefile @@ -3,14 +3,10 @@ .PATH: ${SRCTOP}/sys/dev/gem KMOD= if_gem -SRCS= bus_if.h device_if.h if_gem.c if_gem_pci.c ${if_gem_sbus} miibus_if.h +SRCS= bus_if.h device_if.h if_gem.c if_gem_pci.c miibus_if.h SRCS+= ${ofw_bus_if} pci_if.h -.if ${MACHINE} == "sparc64" -if_gem_sbus= if_gem_sbus.c -.endif - -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "powerpc" ofw_bus_if= ofw_bus_if.h .endif diff --git a/sys/modules/hme/Makefile b/sys/modules/hme/Makefile index 74633717bbd3..ab7fd5be64ee 100644 --- a/sys/modules/hme/Makefile +++ b/sys/modules/hme/Makefile @@ -3,12 +3,7 @@ .PATH: ${SRCTOP}/sys/dev/hme KMOD= if_hme -SRCS= bus_if.h device_if.h if_hme.c if_hme_pci.c ${if_hme_sbus} miibus_if.h -SRCS+= ${ofw_bus_if} pci_if.h - -.if ${MACHINE} == "sparc64" -if_hme_sbus= if_hme_sbus.c -ofw_bus_if= ofw_bus_if.h -.endif +SRCS= bus_if.h device_if.h if_hme.c if_hme_pci.c miibus_if.h +SRCS+= pci_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/hwpmc/Makefile b/sys/modules/hwpmc/Makefile index 23bd648be229..c4500fb4a174 100644 --- a/sys/modules/hwpmc/Makefile +++ b/sys/modules/hwpmc/Makefile @@ -35,8 +35,4 @@ SRCS+= hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c SRCS+= hwpmc_powerpc.c hwpmc_e500.c hwpmc_mpc7xxx.c hwpmc_ppc970.c .endif -.if ${MACHINE_CPUARCH} == "sparc64" -SRCS+= hwpmc_sparc64.c -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/i2c/controllers/pcf/Makefile b/sys/modules/i2c/controllers/pcf/Makefile index 94b4b0c22fc7..f213b0b3168e 100644 --- a/sys/modules/i2c/controllers/pcf/Makefile +++ b/sys/modules/i2c/controllers/pcf/Makefile @@ -3,18 +3,12 @@ .PATH: ${SRCTOP}/sys/dev/pcf KMOD= pcf -SRCS= ${envctrl} pcf.c ${pcf_ebus} ${pcf_isa} -SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if} ${ofw_bus_if} +SRCS= pcf.c ${pcf_isa} +SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if} .if ${MACHINE_CPUARCH} == "i386" isa_if= isa_if.h pcf_isa= pcf_isa.c .endif -.if ${MACHINE_CPUARCH} == "sparc64" -envctrl= envctrl.c -ofw_bus_if= ofw_bus_if.h -pcf_ebus= pcf_ebus.c -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/isp/Makefile b/sys/modules/isp/Makefile index d59d54036be6..89f612f35b55 100644 --- a/sys/modules/isp/Makefile +++ b/sys/modules/isp/Makefile @@ -7,8 +7,4 @@ SRCS= bus_if.h device_if.h pci_if.h \ opt_cam.h opt_ddb.h opt_isp.h \ isp.c isp_library.c isp_target.c isp_freebsd.c isp_pci.c -.if ${MACHINE} == sparc64 -SRCS+= isp_sbus.c ofw_bus_if.h -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/ispfw/Makefile b/sys/modules/ispfw/Makefile index fa61f172d80b..05de489c3412 100644 --- a/sys/modules/ispfw/Makefile +++ b/sys/modules/ispfw/Makefile @@ -37,8 +37,5 @@ SUBDIR += isp_2300 SUBDIR += isp_2322 SUBDIR += isp_2400 SUBDIR += isp_2500 -.if ${MACHINE} == "sparc64" -SUBDIR += isp_1000 -.endif .include <bsd.subdir.mk> diff --git a/sys/modules/le/Makefile b/sys/modules/le/Makefile index 96a157c50ac9..b77a2e69f161 100644 --- a/sys/modules/le/Makefile +++ b/sys/modules/le/Makefile @@ -3,20 +3,12 @@ .PATH: ${SRCTOP}/sys/dev/le KMOD= if_le -SRCS= am7990.c am79900.c ${if_le_isa} ${if_le_lebuffer} -SRCS+= ${if_le_ledma} if_le_pci.c lance.c ${lebuffer_sbus} -SRCS+= bus_if.h device_if.h ${isa_if} ${ofw_bus_if} pci_if.h +SRCS= am7990.c am79900.c ${if_le_isa} if_le_pci.c lance.c +SRCS+= bus_if.h device_if.h ${isa_if} pci_if.h .if ${MACHINE_CPUARCH} == "i386" if_le_isa= if_le_isa.c isa_if= isa_if.h .endif -.if ${MACHINE} == "sparc64" -if_le_lebuffer= if_le_lebuffer.c -if_le_ledma= if_le_ledma.c -lebuffer_sbus= lebuffer_sbus.c -ofw_bus_if= ofw_bus_if.h -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/scc/Makefile b/sys/modules/scc/Makefile index 05a67b2db85d..d138bcd3c8f2 100644 --- a/sys/modules/scc/Makefile +++ b/sys/modules/scc/Makefile @@ -2,9 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/scc -.if ${MACHINE} == "sparc64" -scc_bfe= scc_bfe_ebus.c scc_bfe_sbus.c -.endif .if ${MACHINE_CPUARCH} == "powerpc" scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c scc_dev_quicc.c .endif diff --git a/sys/modules/sound/driver/Makefile b/sys/modules/sound/driver/Makefile index d00ccaa10286..8c21a719966a 100644 --- a/sys/modules/sound/driver/Makefile +++ b/sys/modules/sound/driver/Makefile @@ -21,12 +21,6 @@ _maestro3= maestro3 SUBDIR+= cmi mss .endif -.if ${MACHINE_CPUARCH} == "sparc64" -.if ${MACHINE} == "sparc64" -SUBDIR+= audiocs -.endif -.endif - .if ${MACHINE_CPUARCH} == "powerpc" SUBDIR+= ai2s davbus .endif diff --git a/sys/modules/sound/driver/audiocs/Makefile b/sys/modules/sound/driver/audiocs/Makefile deleted file mode 100644 index 0cd516cc8bc0..000000000000 --- a/sys/modules/sound/driver/audiocs/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/dev/sound/sbus - -KMOD= snd_audiocs -SRCS= device_if.h bus_if.h ofw_bus_if.h -SRCS+= channel_if.h feeder_if.h mixer_if.h -SRCS+= cs4231.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile index 85e513d5f898..256cfe3ac744 100644 --- a/sys/modules/syscons/Makefile +++ b/sys/modules/syscons/Makefile @@ -1,36 +1,22 @@ # $FreeBSD$ SUBDIR= ${_apm} \ - ${_beastie} \ + beastie \ blank \ - ${_daemon} \ - ${_dragon} \ + daemon \ + dragon \ fade \ - ${_fire} \ + fire \ green \ - ${_logo} \ - ${_plasma} \ - ${_rain} \ - ${_snake} \ - ${_star} \ - ${_warp} + logo \ + plasma \ + rain \ + snake \ + star \ + warp .if ${MACHINE_CPUARCH} == "i386" _apm= apm .endif -.if ${MACHINE_CPUARCH} != "sparc64" -_beastie= beastie -_beastie= beastie -_daemon= daemon -_dragon= dragon -_fire= fire -_logo= logo -_plasma= plasma -_rain= rain -_snake= snake -_star= star -_warp= warp -.endif - .include <bsd.subdir.mk> diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile index 199440ae78db..b6bba88da9ca 100644 --- a/sys/modules/uart/Makefile +++ b/sys/modules/uart/Makefile @@ -8,13 +8,8 @@ uart_bus_acpi=uart_bus_acpi.c uart_cpu_acpi=uart_cpu_acpi.c .endif -.if ${MACHINE_CPUARCH} == "sparc64" -uart_bus_ebus= uart_bus_ebus.c -.endif - .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ - ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "riscv" ofw_bus_if= ofw_bus_if.h .endif diff --git a/sys/sparc64/central/central.c b/sys/sparc64/central/central.c deleted file mode 100644 index a376fd2bee20..000000000000 --- a/sys/sparc64/central/central.c +++ /dev/null @@ -1,301 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2003 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/module.h> - -#include <dev/ofw/ofw_bus.h> -#include <dev/ofw/ofw_bus_subr.h> -#include <dev/ofw/openfirm.h> - -#include <machine/bus.h> -#include <machine/resource.h> - -#include <sys/rman.h> - -#include <sparc64/sbus/ofw_sbus.h> - -struct central_devinfo { - struct ofw_bus_devinfo cdi_obdinfo; - struct resource_list cdi_rl; -}; - -struct central_softc { - int sc_nrange; - struct sbus_ranges *sc_ranges; -}; - -static device_probe_t central_probe; -static device_attach_t central_attach; -static bus_print_child_t central_print_child; -static bus_probe_nomatch_t central_probe_nomatch; -static bus_alloc_resource_t central_alloc_resource; -static bus_adjust_resource_t central_adjust_resource; -static bus_get_resource_list_t central_get_resource_list; -static ofw_bus_get_devinfo_t central_get_devinfo; - -static int central_print_res(struct central_devinfo *); - -static device_method_t central_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, central_probe), - DEVMETHOD(device_attach, central_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, central_print_child), - DEVMETHOD(bus_probe_nomatch, central_probe_nomatch), - DEVMETHOD(bus_alloc_resource, central_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_adjust_resource, central_adjust_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), - DEVMETHOD(bus_get_resource_list, central_get_resource_list), - DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), - - /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_devinfo, central_get_devinfo), - DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), - DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), - DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), - DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), - DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - - DEVMETHOD_END -}; - -static driver_t central_driver = { - "central", - central_methods, - sizeof(struct central_softc), -}; - -static devclass_t central_devclass; - -EARLY_DRIVER_MODULE(central, nexus, central_driver, central_devclass, 0, 0, - BUS_PASS_BUS); -MODULE_DEPEND(fhc, nexus, 1, 1, 1); -MODULE_VERSION(central, 1); - -static int -central_probe(device_t dev) -{ - - if (strcmp(ofw_bus_get_name(dev), "central") == 0) { - device_set_desc(dev, "central"); - return (0); - } - return (ENXIO); -} - -static int -central_attach(device_t dev) -{ - struct central_devinfo *cdi; - struct sbus_regs *reg; - struct central_softc *sc; - phandle_t child; - phandle_t node; - device_t cdev; - int nreg; - int i; - - sc = device_get_softc(dev); - node = ofw_bus_get_node(dev); - - sc->sc_nrange = OF_getprop_alloc_multi(node, "ranges", - sizeof(*sc->sc_ranges), (void **)&sc->sc_ranges); - if (sc->sc_nrange == -1) { - device_printf(dev, "can't get ranges\n"); - return (ENXIO); - } - - for (child = OF_child(node); child != 0; child = OF_peer(child)) { - cdi = malloc(sizeof(*cdi), M_DEVBUF, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(&cdi->cdi_obdinfo, child) != 0) { - free(cdi, M_DEVBUF); - continue; - } - nreg = OF_getprop_alloc_multi(child, "reg", sizeof(*reg), - (void **)®); - if (nreg == -1) { - device_printf(dev, "<%s>: incomplete\n", - cdi->cdi_obdinfo.obd_name); - ofw_bus_gen_destroy_devinfo(&cdi->cdi_obdinfo); - free(cdi, M_DEVBUF); - continue; - } - resource_list_init(&cdi->cdi_rl); - for (i = 0; i < nreg; i++) - resource_list_add(&cdi->cdi_rl, SYS_RES_MEMORY, i, - reg[i].sbr_offset, reg[i].sbr_offset + - reg[i].sbr_size, reg[i].sbr_size); - OF_prop_free(reg); - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - cdi->cdi_obdinfo.obd_name); - resource_list_free(&cdi->cdi_rl); - ofw_bus_gen_destroy_devinfo(&cdi->cdi_obdinfo); - free(cdi, M_DEVBUF); - continue; - } - device_set_ivars(cdev, cdi); - } - - return (bus_generic_attach(dev)); -} - -static int -central_adjust_resource(device_t bus __unused, device_t child __unused, - int type __unused, struct resource *r __unused, rman_res_t start __unused, - rman_res_t end __unused) -{ - - return (ENXIO); -} - -static int -central_print_child(device_t dev, device_t child) -{ - int rv; - - rv = bus_print_child_header(dev, child); - rv += central_print_res(device_get_ivars(child)); - rv += bus_print_child_footer(dev, child); - return (rv); -} - -static void -central_probe_nomatch(device_t dev, device_t child) -{ - const char *type; - - device_printf(dev, "<%s>", ofw_bus_get_name(child)); - central_print_res(device_get_ivars(child)); - type = ofw_bus_get_type(child); - printf(" type %s (no driver attached)\n", - type != NULL ? type : "unknown"); -} - -static struct resource * -central_alloc_resource(device_t bus, device_t child, int type, int *rid, - rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) -{ - struct resource_list *rl; - struct resource_list_entry *rle; - struct central_softc *sc; - struct resource *res; - bus_addr_t coffset; - bus_addr_t cend; - bus_addr_t phys; - int isdefault; - int passthrough; - int i; - - isdefault = RMAN_IS_DEFAULT_RANGE(start, end); - passthrough = (device_get_parent(child) != bus); - res = NULL; - rle = NULL; - rl = BUS_GET_RESOURCE_LIST(bus, child); - sc = device_get_softc(bus); - switch (type) { - case SYS_RES_IRQ: - return (resource_list_alloc(rl, bus, child, type, rid, start, - end, count, flags)); - case SYS_RES_MEMORY: - if (!passthrough) { - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - return (NULL); - if (rle->res != NULL) - panic("%s: resource entry is busy", __func__); - if (isdefault) { - start = rle->start; - count = ulmax(count, rle->count); - end = ulmax(rle->end, start + count - 1); - } - } - for (i = 0; i < sc->sc_nrange; i++) { - coffset = sc->sc_ranges[i].coffset; - cend = coffset + sc->sc_ranges[i].size - 1; - if (start >= coffset && end <= cend) { - start -= coffset; - end -= coffset; - phys = sc->sc_ranges[i].poffset | - ((bus_addr_t)sc->sc_ranges[i].pspace << 32); - res = bus_generic_alloc_resource(bus, child, - type, rid, phys + start, phys + end, - count, flags); - if (!passthrough) - rle->res = res; - break; - } - } - break; - } - return (res); -} - -static struct resource_list * -central_get_resource_list(device_t bus, device_t child) -{ - struct central_devinfo *cdi; - - cdi = device_get_ivars(child); - return (&cdi->cdi_rl); -} - -static const struct ofw_bus_devinfo * -central_get_devinfo(device_t bus, device_t child) -{ - struct central_devinfo *cdi; - - cdi = device_get_ivars(child); - return (&cdi->cdi_obdinfo); -} - -static int -central_print_res(struct central_devinfo *cdi) -{ - - return (resource_list_print_type(&cdi->cdi_rl, "mem", SYS_RES_MEMORY, - "%#jx")); -} diff --git a/sys/sparc64/conf/DEFAULTS b/sys/sparc64/conf/DEFAULTS deleted file mode 100644 index c99480c8f86f..000000000000 --- a/sys/sparc64/conf/DEFAULTS +++ /dev/null @@ -1,23 +0,0 @@ -# -# DEFAULTS -- Default kernel configuration file for FreeBSD/sparc64 -# -# $FreeBSD$ - -machine sparc64 - -# Pseudo devices. -device mem # Memory and kernel memory devices - -# UART chips on this platform -device uart_ns8250 -device uart_sab82532 -device uart_z8530 - -# Default partitioning schemes -options GEOM_PART_BSD -options GEOM_PART_VTOC8 - -# Let sunkbd emulate an AT keyboard by default. -options SUNKBD_EMULATE_ATKBD - -options NEW_PCIB diff --git a/sys/sparc64/conf/GENERIC b/sys/sparc64/conf/GENERIC deleted file mode 100644 index 4509269c19ff..000000000000 --- a/sys/sparc64/conf/GENERIC +++ /dev/null @@ -1,253 +0,0 @@ -# -# GENERIC -- Generic kernel configuration file for FreeBSD/sparc64 -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -cpu SUN4U -ident GENERIC - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - -# Platforms supported -# At this time all platforms are supported, as-is. - -options SCHED_ULE # ULE scheduler -options PREEMPTION # Enable kernel thread preemption -options VIMAGE # Subsystem virtualization, e.g. VNET -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 -options TCP_HHOOK # hhook(9) f |