diff options
237 files changed, 79 insertions, 34356 deletions
diff --git a/Makefile.cross b/Makefile.cross index 4e8a3f7b6a4..d0cbb80e819 100644 --- a/Makefile.cross +++ b/Makefile.cross @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.cross,v 1.86 2016/08/10 14:27:15 deraadt Exp $ +# $OpenBSD: Makefile.cross,v 1.87 2016/09/03 13:37:39 guenther Exp $ cross-tools: cross-includes cross-binutils cross-gcc cross-lib cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var @@ -6,7 +6,7 @@ cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var # Have to compute TARGET_ARCH directly in the Makefile, for .if tests involving # this variable to work. -.if (${TARGET} == "armv7" || ${TARGET} == "zaurus") +.if (${TARGET} == "armv7") TARGET_ARCH= arm .elif (${TARGET} == "luna88k") TARGET_ARCH= m88k diff --git a/distrib/Makefile b/distrib/Makefile index 54fd3e4ab1a..5fba7bbe829 100644 --- a/distrib/Makefile +++ b/distrib/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.49 2016/09/01 10:08:28 deraadt Exp $ +# $OpenBSD: Makefile,v 1.50 2016/09/03 13:37:39 guenther Exp $ SUBDIR= special notes .if make(obj) SUBDIR+=alpha amd64 armv7 hppa i386 \ landisk loongson luna88k macppc \ - octeon sgi socppc sparc64 zaurus + octeon sgi socppc sparc64 .elif exists(${MACHINE}) SUBDIR+=${MACHINE} .endif diff --git a/distrib/notes/Makefile b/distrib/notes/Makefile index 158ca1bd7b8..03cc50c62ec 100644 --- a/distrib/notes/Makefile +++ b/distrib/notes/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.45 2016/09/01 10:08:28 deraadt Exp $ +# $OpenBSD: Makefile,v 1.46 2016/09/03 13:37:39 guenther Exp $ NOPROG= NOMAN= @@ -20,7 +20,7 @@ allarchs: @cd $(.CURDIR); \ for arch in alpha amd64 armv7 hppa i386 landisk \ loongson luna88k macppc octeon sgi socppc \ - sparc64 zaurus; \ + sparc64; \ do ${MAKE} M=$$arch; done $(TARG): $(DEP) diff --git a/distrib/notes/zaurus/contents b/distrib/notes/zaurus/contents deleted file mode 100644 index f6deef711d8..00000000000 --- a/distrib/notes/zaurus/contents +++ /dev/null @@ -1,38 +0,0 @@ -dnl $OpenBSD: contents,v 1.19 2015/12/30 23:49:00 rpe Exp $ -TopPart - -OpenBSDdistsets - -OpenBSDbsd - -OpenBSDrd -dnl not yet... -dnl OpenBSDcd - - zboot The OpenBSD/MACHINE disk-based boot loader. - - zbsdmod.o The OpenBSD/MACHINE memory-based boot loader. - - openbsd{:--:}OSrev{:--:}_arm.ipk - An installable package for Linux containing - the boot loader and the RAMDISK kernel. - - Packages Index file for the Linux package installer. - -DistributionDescription(eight) - -OpenBSDbase(58019231,161214704) - -OpenBSDcomp(42699590,129234278) - -OpenBSDgame(2683205,6036821) - -OpenBSDman(9189565,35917709) - -OpenBSDxbase(15368993,41512234) - -OpenBSDxfont(39938444,52169245) - -OpenBSDxserv(6354308,15370245) - -OpenBSDxshare(4561931,25735496) diff --git a/distrib/notes/zaurus/features b/distrib/notes/zaurus/features deleted file mode 100644 index dc9981334a0..00000000000 --- a/distrib/notes/zaurus/features +++ /dev/null @@ -1,40 +0,0 @@ -dnl $OpenBSD: features,v 1.3 2013/02/25 20:16:04 miod Exp $ -dnl -dnl This file lists almost all the conditional features of this port, -dnl which are used to provide accurate installation notes. -dnl -dnl Information about the installer script features should be in sync with -dnl src/distrib/zaurus/ramdisk/install.md -dnl and the list files in -dnl src/distrib/zaurus/ramdisk/list -dnl -dnl ==== -dnl -dnl architecture name (for the packages directory) -define({:-MACHINE_ARCH-:},arm)dnl -dnl -dnl define if /sbin/kbd exists on the media -define({:-MDKBD-:},)dnl -dnl -dnl define if serial consoles needs to be enabled in /etc/ttys -dnl (i.e. md_consoleinfo is not empty) -define({:-MDSERCONS-:},1)dnl -dnl -dnl define if SMP kernels are provided -define({:-MDSMP-:},)dnl -dnl -dnl define if shared libraries are provided -define({:-MDSO-:},1)dnl -dnl -dnl define if some media have timezone information (TZ in their list) -define({:-MDTZ-:},1)dnl -dnl -dnl define if glass console is possible -dnl (XXX does not imply availablity of X servers though) -define({:-MDX-:},1)dnl -dnl -dnl define if the X server can't start until machdep.allow_aperture is set -define({:-MDXAPERTURE-:},)dnl -dnl -dnl define if the X server can start without a configuration file -define({:-MDXDM-:},1)dnl diff --git a/distrib/notes/zaurus/hardware b/distrib/notes/zaurus/hardware deleted file mode 100644 index 60fdf6bf19c..00000000000 --- a/distrib/notes/zaurus/hardware +++ /dev/null @@ -1,7 +0,0 @@ -dnl $OpenBSD: hardware,v 1.34 2014/02/27 18:48:15 deraadt Exp $ -dnl When more than one model is supported, turn this into a list... -The following Sharp Zaurus models are supported by OpenBSD: - - SL-C3000 - SL-C3100 - SL-C3200 diff --git a/distrib/notes/zaurus/install b/distrib/notes/zaurus/install deleted file mode 100644 index eb1ff90a664..00000000000 --- a/distrib/notes/zaurus/install +++ /dev/null @@ -1,197 +0,0 @@ -dnl $OpenBSD: install,v 1.28 2013/12/04 23:20:19 jmc Exp $ -OpenBSDInstallPrelude - -OpenBSD is installed on the Zaurus by effectively converting -Linux into a bootloader. This can be done easily by installing -a package from Qtopia, or manually from a terminal. Both ways -are described below, the easy one first. - -The package takes care of modifying the Linux startup files for -you as necessary. To protect you from a common pitfall, ext3 -filesystems mounted on /hdd[12] are converted back to ext2. - -(That way a fatal error in Linux startup scripts is avoided when -the journal has been destroyed by mounting one of the ext3 -filesystems as ext2 on OpenBSD). - -1. Press "Home" until the second icon tab is selected (Settings). -2. Open the "Add/Remove Software" dialog. That's the green icon - with an arrow pointing from left to right into a rectangle. -3. Press "Install packages via networks", the middle one of the - three big buttons. The "Package Manager" dialog pops up. -4. Press the yellow switch icon in the lower right corner to - bring up the "Package Servers" dialog. -5. Press the left button, which is labeled "New" if your Zaurus - is in English, enter the HTTP/FTP URL of the nearest OpenBSD - mirror, and change the field above the URL into a name for - that server. Press the "OK" button in the upper right corner - to return to the "Package Manager" dialog. -6. Press the "Upgrade" button in the lower left corner to update - the package index if that was not done automatically. A - package named "openbsd" should appear in the package list. - Select this package and press the question mark icon in the - lower right corner. -7. Now you see the package details and three buttons, labeled - "Install", "Remove", and "Ignore" in this order. Press the - leftmost button and twice "OK" to finish the installation. - Then close the "Add/Remove Software" dialog. -8. Activate the "Q" menu in the lower left corner of the screen - and choose "Reboot" (that's the item with a green icon next - to it, above the power-off icon). Wait for the system to - reboot. At the boot> prompt, hit enter to boot OpenBSD, or - type 'r' to boot Linux. Since you want to install OpenBSD, - this time you will want to type 'r'. -9. Wait while Linux is coming up, then switch to the first tab - (Applications), scroll down, and press the icon which is - labeled "Install OpenBSD". A few seconds later, an OpenBSD - bsd.rd will boot on your Zaurus, so that you can perform the - standard install process. - -Another way to install the package is from a shell. You will -need the following file from the distribution on the Zaurus: - - openbsd{:--:}OSrev{:--:}_arm.ipk - -Perform the following operation as root to install the package, -and then continue as in step 8, above: - - {:-#-:} ipkg install openbsd{:--:}OSrev{:--:}_arm.ipk - -To install the OpenBSD boot program manually, you will need the -following files from the distribution: - - zbsdmod.o - zboot - bsd.rd - -After starting up some sort of terminal emulator on the Zaurus -and becoming root, perform the following operation: - - # insmod zbsdmod.o - # cp bsd.rd /proc/zboot - -A few seconds later, OpenBSD will boot on your Zaurus. - -If you already have a bsd.rd or bsd kernel contained in a FFS -partition on the C3x00 hard drive, you can instead use - - # insmod zbsdmod.o - # ./zboot - -OpenBSDInstallPart2 - -OpenBSDInstallPart3(,"wd0") - -OpenBSDInstallPart4 - -OpenBSDInstallMBRPart1 - - One of the three partitions on the Zaurus C3x00 hard drive is - a 3GB or 5GB MS-DOS filesystem. This partition has application - and user data on it and can be a lot smaller. It is therefore - recommended that you cut most of the space off this large MS-DOS - partition, and create a new A6 partition afterwards, like this: - - 0: 83 0 3 13 - 1511 7 17 [ 63: 205569 ] Linux files* - 1: 83 1512 0 1 - 7559 7 17 [ 205632: 822528 ] Linux files* - 2: 0C 7560 0 1 - 9065 7 1 [ 1028160: 204800 ] Win95 FAT32L - 3: A6 9065 7 2 - 67885 5 3 [ 1232960: 7999488 ] OpenBSD - - After shrinking the MS-DOS partition, you will need to - reformat it from Linux or OpenBSD once OpenBSD is installed. - (You will be reminded of this later in this document) - -OpenBSDInstallMBRPart2 - -OpenBSDInstallPart5({:- - If you have Linux partitions defined on the disk, these will - usually show up as partition 'i', 'j' and so on.-:}) - -OpenBSDInstallPart6({:-CD-ROM, -:}) - -OpenBSDURLInstall - -OpenBSDCDROMInstall - -OpenBSDDISKInstall({:-"wdN" or -:},,{:-, Linux (ext2) or MS-DOS-:}) - -OpenBSDCommonInstall - -OpenBSDInstallWrapup - -OpenBSDCongratulations - - If you have kept the MS-DOS partition, do not forget to - newfs it using: - - newfs -t msdos /dev/rwd0k - - This should be done before attempting to mount and use this - partition from Linux or OpenBSD. - - For purposes of recovery in case Linux becomes inoperable for - one reason or another with HDD1 Errors and such, we detail the - process to come up single user: - - Remove power and the battery. - Begin holding down the 'b' and 'd' keys. - Wait for 1 minute. - Insert battery and power on unit. - As soon as a login screen starts to show up, release the 'b' - and 'd' keys. - Login as root. - - The following sequence is also recommended inside Linux so that - problems will happen less often. By default the boot scripts fail - if the MS-DOS partition is corrupt in any way. If you are already - root do the following, which will skip mounting the MS-DOS partition. - - Login as root. - - Find the rc.rofilesys file. It is either in - /root/etc/rc.d - - cd /root/home/etc/rc.d - - Or you have to mount it using: - - mount /dev/mtdblock2 /mnt - cd /mnt/home/etc/rc.d - - cat rc.rofilesys | sed -e '/vfat/s/^/#/' > vfat - diff -u rc.rofilesys vfat # to double check - cp rc.rofilesys rc.rofilesys.vfat - cp vfat rc.rofilesys - - In these cases below we avoid using vi because Linux quality is of - such high caliber that vi locks up the console. If you logged in - multiuser you may be able to use vi. - - Please be aware that if you fsck the two Linux partitions on - the disk, they are actually ext3fs partitions and you will thereby - corrupt their journals. This will make them into ext2fs partitions. - Linux will not be able to boot, and you will need to use the - processes below to get to the point where Linux will mount them as - ext2fs partitions: - - Login as root. - - Find the rc.rofilesys file. It is either in - /root/etc/rc.d - - cd /root/home/etc/rc.d - - Or you have to mount it using: - - mount /dev/mtdblock2 /mnt - cd /mnt/home/etc/rc.d - - cat rc.rofilesys | sed -e '/^LINUXFMT=ext3$/s/^/#/' \ - -e '/^#LINUXFMT=ext2$/s/^#//' > ext2 - diff -u rc.rofilesys ext2 # to double check - cp rc.rofilesys rc.rofilesys.ext3 - cp ext2 rc.rofilesys - - - -OpenBSDUnattendedInstallation diff --git a/distrib/notes/zaurus/prep b/distrib/notes/zaurus/prep deleted file mode 100644 index 38f8a8eeade..00000000000 --- a/distrib/notes/zaurus/prep +++ /dev/null @@ -1,6 +0,0 @@ -dnl $OpenBSD: prep,v 1.3 2008/08/06 18:23:56 miod Exp $ -No specific preparation is required before installing OpenBSD/MACHINE. - -However, the installation process will require the data partition to -be shrunk and recreated; before installing OpenBSD/MACHINE, you should -make sure any important data on this partition is backed up. diff --git a/distrib/notes/zaurus/upgrade b/distrib/notes/zaurus/upgrade deleted file mode 100644 index 526c52c7f05..00000000000 --- a/distrib/notes/zaurus/upgrade +++ /dev/null @@ -1,3 +0,0 @@ -dnl $OpenBSD: upgrade,v 1.2 2005/01/15 17:52:09 miod Exp $ -dnl OpenBSDUpgrade({:-the CD-ROM-:}) -OpenBSDUpgrade({:-your usual boot device-:}) diff --git a/distrib/notes/zaurus/whatis b/distrib/notes/zaurus/whatis deleted file mode 100644 index 8c9c0232460..00000000000 --- a/distrib/notes/zaurus/whatis +++ /dev/null @@ -1,4 +0,0 @@ -dnl $OpenBSD: whatis,v 1.4 2006/04/04 00:26:33 uwe Exp $ - -OpenBSD/MACHINE runs on the Sharp Zaurus SL-C3000, SL-C3100 and -SL-C3200 PDA. diff --git a/distrib/notes/zaurus/xfer b/distrib/notes/zaurus/xfer deleted file mode 100644 index ed3fc960a7e..00000000000 --- a/distrib/notes/zaurus/xfer +++ /dev/null @@ -1,12 +0,0 @@ -dnl $OpenBSD: xfer,v 1.5 2015/06/10 06:38:40 jasper Exp $ -Installation is supported from several media types, including: - - CD-ROM - FFS partitions - DOS (FAT) partitions - EXT2 partitions - HTTP - -OpenBSDXferShortPrelude - -OpenBSDXferFFS diff --git a/distrib/sets/lists/base/md.zaurus b/distrib/sets/lists/base/md.zaurus deleted file mode 100644 index d20998bae1c..00000000000 --- a/distrib/sets/lists/base/md.zaurus +++ /dev/null @@ -1,2144 +0,0 @@ -./etc/examples/wsconsctl.conf -./etc/firmware/atu-at76c503-i3863-ext -./etc/firmware/atu-at76c503-i3863-int -./etc/firmware/atu-at76c503-rfmd-acc-ext -./etc/firmware/atu-at76c503-rfmd-acc-int -./etc/firmware/atu-at76c505-rfmd-ext -./etc/firmware/atu-at76c505-rfmd-int -./etc/firmware/atu-intersil-ext -./etc/firmware/atu-intersil-int -./etc/firmware/atu-license -./etc/firmware/atu-rfmd-ext -./etc/firmware/atu-rfmd-int -./etc/firmware/atu-rfmd2958-ext -./etc/firmware/atu-rfmd2958-int -./etc/firmware/atu-rfmd2958smc-ext -./etc/firmware/atu-rfmd2958smc-int -./etc/firmware/kue -./etc/firmware/kue-license -./etc/firmware/rum-license -./etc/firmware/rum-rt2573 -./etc/firmware/run-license -./etc/firmware/run-rt2870 -./etc/firmware/run-rt3071 -./etc/firmware/symbol-eprim -./etc/firmware/symbol-esec -./etc/firmware/symbol-license -./etc/firmware/tusb3410 -./etc/firmware/tusb3410-license -./etc/firmware/udl_huffman -./etc/firmware/zd1211 -./etc/firmware/zd1211-license -./etc/firmware/zd1211b -./sbin/kbd -./sbin/wsconsctl -./usr/lib/gcc-lib/arm-unknown-openbsd6.0 -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1 -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/collect2 -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/libgcc.a -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/specs -./usr/libdata/perl5/arm-openbsd -./usr/libdata/perl5/arm-openbsd/5.20.3 -./usr/libdata/perl5/arm-openbsd/5.20.3/.packlist -./usr/libdata/perl5/arm-openbsd/5.20.3/B -./usr/libdata/perl5/arm-openbsd/5.20.3/B.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/B/Concise.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/B/Showlex.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/B/Terse.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/B/Xref.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/EXTERN.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/INTERN.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/XSUB.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/av.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/bitcount.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/charclass_invlists.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/config.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/cop.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/cv.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/dosish.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/embed.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/embedvar.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/fakesdio.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/feature.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/form.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/git_version.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/gv.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/handy.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/hv.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/hv_func.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/inline.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/intrpvar.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/iperlsys.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/keywords.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/l1_char_class_tab.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/malloc_ctl.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/metaconfig.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/mg.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/mg_data.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/mg_raw.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/mg_vtable.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/mydtrace.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/nostdio.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/op.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/op_reg_common.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/opcode.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/opnames.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/overload.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/pad.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/parser.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/patchlevel.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perl.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perlapi.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perlio.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perliol.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perlsdio.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perlvars.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/perly.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/pp.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/pp_proto.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/proto.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/reentr.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/regcharclass.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/regcomp.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/regexp.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/regnodes.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/scope.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/sv.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/thread.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/time64.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/time64_config.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/uconfig.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/unicode_constants.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/unixish.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/utf8.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/utfebcdic.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/util.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/uudmap.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/vutil.h -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/vxs.inc -./usr/libdata/perl5/arm-openbsd/5.20.3/CORE/warnings.h -./usr/libdata/perl5/arm-openbsd/5.20.3/Compress -./usr/libdata/perl5/arm-openbsd/5.20.3/Compress/Raw -./usr/libdata/perl5/arm-openbsd/5.20.3/Compress/Raw/Bzip2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Compress/Raw/Zlib.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Compress/Zlib.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Config.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Config.pod -./usr/libdata/perl5/arm-openbsd/5.20.3/Config_git.pl -./usr/libdata/perl5/arm-openbsd/5.20.3/Config_heavy.pl -./usr/libdata/perl5/arm-openbsd/5.20.3/Cwd.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/DB_File.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Data -./usr/libdata/perl5/arm-openbsd/5.20.3/Data/Dumper.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Devel -./usr/libdata/perl5/arm-openbsd/5.20.3/Devel/PPPort.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Devel/Peek.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Digest -./usr/libdata/perl5/arm-openbsd/5.20.3/Digest/MD5.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Digest/SHA.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/DynaLoader.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Alias.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Byte.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/CJKConstants.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/CN -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/CN.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/CN/HZ.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Config.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/EBCDIC.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Encoder.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Encoding.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/GSM0338.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Guess.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/JP -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/JP.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/JP/H2Z.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/JP/JIS7.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/KR -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/KR.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/KR/2022_KR.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/MIME -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/MIME/Header -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/MIME/Header.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/MIME/Header/ISO_2022_JP.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/MIME/Name.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Symbol.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/TW.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Unicode -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Unicode.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Encode/Unicode/UTF7.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Errno.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Fcntl.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File -./usr/libdata/perl5/arm-openbsd/5.20.3/File/DosGlob.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Glob.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/GlobMapper.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Cygwin.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Epoc.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Functions.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Mac.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/OS2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Unix.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/VMS.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/File/Spec/Win32.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Filter -./usr/libdata/perl5/arm-openbsd/5.20.3/Filter/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/Filter/Util/Call.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Hash -./usr/libdata/perl5/arm-openbsd/5.20.3/Hash/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/Hash/Util.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Hash/Util/FieldHash.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/I18N -./usr/libdata/perl5/arm-openbsd/5.20.3/I18N/Langinfo.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO -./usr/libdata/perl5/arm-openbsd/5.20.3/IO.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Adapter -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Adapter/Bzip2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Adapter/Deflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Adapter/Identity.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Base -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Base.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Base/Common.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Bzip2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Deflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Gzip -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Gzip.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Gzip/Constants.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/RawDeflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zip -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zip.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zip/Constants.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zlib -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zlib/Constants.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Compress/Zlib/Extra.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Dir.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/File.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Handle.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Pipe.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Poll.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Seekable.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Select.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Socket -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Socket.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Socket/INET.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Socket/UNIX.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Adapter -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Adapter/Bunzip2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Adapter/Identity.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Adapter/Inflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/AnyInflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/AnyUncompress.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Base.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Bunzip2.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Gunzip.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Inflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/RawInflate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IO/Uncompress/Unzip.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IPC -./usr/libdata/perl5/arm-openbsd/5.20.3/IPC/Msg.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IPC/Semaphore.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IPC/SharedMem.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/IPC/SysV.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/List -./usr/libdata/perl5/arm-openbsd/5.20.3/List/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/List/Util.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/List/Util/XS.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/MIME -./usr/libdata/perl5/arm-openbsd/5.20.3/MIME/Base64.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/MIME/QuotedPrint.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Math -./usr/libdata/perl5/arm-openbsd/5.20.3/Math/BigInt -./usr/libdata/perl5/arm-openbsd/5.20.3/Math/BigInt/FastCalc.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/NDBM_File.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/O.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Opcode.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/OpenBSD -./usr/libdata/perl5/arm-openbsd/5.20.3/OpenBSD/MkTemp.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/OpenBSD/Pledge.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/POSIX.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/POSIX.pod -./usr/libdata/perl5/arm-openbsd/5.20.3/PerlIO -./usr/libdata/perl5/arm-openbsd/5.20.3/PerlIO/encoding.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/PerlIO/mmap.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/PerlIO/scalar.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/PerlIO/via.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/SDBM_File.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Scalar -./usr/libdata/perl5/arm-openbsd/5.20.3/Scalar/Util.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Socket.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Storable.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Sys -./usr/libdata/perl5/arm-openbsd/5.20.3/Sys/Hostname.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Sys/Syslog.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Term -./usr/libdata/perl5/arm-openbsd/5.20.3/Term/ReadKey.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Tie -./usr/libdata/perl5/arm-openbsd/5.20.3/Tie/Hash -./usr/libdata/perl5/arm-openbsd/5.20.3/Tie/Hash/NamedCapture.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Time -./usr/libdata/perl5/arm-openbsd/5.20.3/Time/HiRes.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Time/Piece.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Time/Seconds.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Unicode -./usr/libdata/perl5/arm-openbsd/5.20.3/Unicode/Collate -./usr/libdata/perl5/arm-openbsd/5.20.3/Unicode/Collate.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Unicode/Collate/Locale.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/Unicode/Normalize.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/arybase.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/attributes.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/auto -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/B -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/B/B.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress/Raw -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress/Raw/Bzip2 -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress/Raw/Bzip2/Bzip2.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress/Raw/Zlib -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Compress/Raw/Zlib/Zlib.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Cwd -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Cwd/Cwd.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/DB_File -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/DB_File/DB_File.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Data -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Data/Dumper -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Data/Dumper/Dumper.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Devel -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Devel/PPPort -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Devel/PPPort/PPPort.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Devel/Peek -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Devel/Peek/Peek.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Digest -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Digest/MD5 -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Digest/MD5/MD5.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Digest/SHA -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Digest/SHA/SHA.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Byte -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Byte/Byte.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/CN -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/CN/CN.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/EBCDIC -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/EBCDIC/EBCDIC.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Encode.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/JP -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/JP/JP.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/KR -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/KR/KR.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Symbol -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Symbol/Symbol.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/TW -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/TW/TW.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Unicode -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Encode/Unicode/Unicode.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Fcntl -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Fcntl/Fcntl.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/File -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/File/DosGlob -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/File/DosGlob/DosGlob.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/File/Glob -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/File/Glob/Glob.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Filter -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Filter/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Filter/Util/Call -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Filter/Util/Call/Call.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Hash -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Hash/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Hash/Util/FieldHash -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Hash/Util/FieldHash/FieldHash.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Hash/Util/Util.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/I18N -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/I18N/Langinfo -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/I18N/Langinfo/Langinfo.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/IO -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/IO/IO.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/IPC -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/IPC/SysV -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/IPC/SysV/SysV.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/List -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/List/Util -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/List/Util/Util.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/MIME -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/MIME/Base64 -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/MIME/Base64/Base64.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Math -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Math/BigInt -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Math/BigInt/FastCalc -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Math/BigInt/FastCalc/FastCalc.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/NDBM_File -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/NDBM_File/NDBM_File.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Opcode -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Opcode/Opcode.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/OpenBSD -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/OpenBSD/MkTemp -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/OpenBSD/MkTemp/MkTemp.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/OpenBSD/Pledge -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/OpenBSD/Pledge/Pledge.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/POSIX -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/POSIX/POSIX.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/encoding -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/encoding/encoding.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/mmap -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/mmap/mmap.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/scalar -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/scalar/scalar.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/via -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/PerlIO/via/via.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/SDBM_File -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/SDBM_File/SDBM_File.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Socket -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Socket/Socket.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Storable -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Storable/Storable.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Sys -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Sys/Hostname -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Sys/Hostname/Hostname.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Sys/Syslog -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Sys/Syslog/Syslog.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Term -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Term/ReadKey -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Term/ReadKey/ReadKey.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Term/ReadKey/autosplit.ix -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Tie -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Tie/Hash -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Tie/Hash/NamedCapture -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Tie/Hash/NamedCapture/NamedCapture.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Time -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Time/HiRes -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Time/HiRes/HiRes.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Time/Piece -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Time/Piece/Piece.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Unicode -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Unicode/Collate -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Unicode/Collate/Collate.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Unicode/Normalize -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/Unicode/Normalize/Normalize.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/arybase -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/arybase/arybase.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/attributes -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/attributes/attributes.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/mro -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/mro/mro.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/re -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/re/re.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/sdbm -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/sdbm/extralibs.ld -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/threads -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/threads/shared -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/threads/shared/shared.so -./usr/libdata/perl5/arm-openbsd/5.20.3/auto/threads/threads.so -./usr/libdata/perl5/arm-openbsd/5.20.3/encoding.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/lib.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/mro.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/ops.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/re.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/threads -./usr/libdata/perl5/arm-openbsd/5.20.3/threads.pm -./usr/libdata/perl5/arm-openbsd/5.20.3/threads/shared.pm -./usr/libdata/perl5/site_perl/arm-openbsd -./usr/libdata/perl5/site_perl/arm-openbsd/_h2ph_pre.ph -./usr/libdata/perl5/site_perl/arm-openbsd/a.out.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm -./usr/libdata/perl5/site_perl/arm-openbsd/arm/_float.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/apmvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/armreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/asm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/atomic.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/bus.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/cdefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/conf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/cpu.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/cpuconf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/cpufunc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/db_machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/disklabel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/endian.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/exec.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/fdt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/fenv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/fiq.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/fp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/frame.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/ieee.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/ieeefp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/isa_machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/kcore.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/limits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/lock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/mutex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/openpromio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/param.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/pcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/pci_machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/pio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/pmap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/proc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/profile.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/pte.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/ptrace.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/reloc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/setjmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/signal.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/softintr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/spinlock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/stdarg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/swi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/sysarch.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/sysreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/tcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/trap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/undefined.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arm/vmparam.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arpa -./usr/libdata/perl5/site_perl/arm-openbsd/arpa/ftp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arpa/inet.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arpa/nameser.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arpa/telnet.ph -./usr/libdata/perl5/site_perl/arm-openbsd/arpa/tftp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/asr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/assert.ph -./usr/libdata/perl5/site_perl/arm-openbsd/bitstring.ph -./usr/libdata/perl5/site_perl/arm-openbsd/blf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/bsd_auth.ph -./usr/libdata/perl5/site_perl/arm-openbsd/complex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/cpio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/arc4.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/blf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/cast.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/castsb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/chacha_private.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/chachapoly.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/cmac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/cryptodev.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/cryptosoft.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/des_locl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/gmac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/hmac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/idgen.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/key_wrap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/md5.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/michael.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/podd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/poly1305.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/rijndael.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/rmd160.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/sha1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/sha2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/siphash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/sk.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/spr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/crypto/xform.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ctype.ph -./usr/libdata/perl5/site_perl/arm-openbsd/curses.ph -./usr/libdata/perl5/site_perl/arm-openbsd/db.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_access.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_break.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_command.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_interface.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_lex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_output.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_run.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_sym.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_variables.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ddb/db_watch.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/acpidebug.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/acpidev.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/acpireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/acpivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/amltypes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/acpi/dsdt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb/adb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb/akbdmap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb/akbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb/amsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/adb/keyboard.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/atareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/atascsi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/atavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/pmreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/satareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ata/wdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/audio_if.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/biovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cardbus -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cardbus/cardbus_exrom.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cardbus/cardbusvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cardbus/cardslotvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cardbus/rbus.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/clock_subr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/cons.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/dec -./usr/libdata/perl5/site_perl/arm-openbsd/dev/dec/clockvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/dec/mcclockvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/eisa -./usr/libdata/perl5/site_perl/arm-openbsd/dev/eisa/eisadevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/eisa/eisadevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/eisa/eisareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/eisa/eisavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/flashvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/gpio -./usr/libdata/perl5/site_perl/arm-openbsd/dev/gpio/gpiovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid/hid.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid/hidkbdsc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid/hidkbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid/hidmsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hid/hidmtvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil/hildevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil/hildevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil/hilkbdmap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil/hilreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/hil/hilvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c/i2c_bitbang.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c/i2c_io.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c/i2cvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c/ihidev.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/i2c/wm8750reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aac_tables.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aacreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aacvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ac97.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/acxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/acxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ad1843reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ad1848reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/adv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/advlib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/adw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/adwlib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ahcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ahcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic6250reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic6250var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic6360reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic6360var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic6915.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic79xx.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic79xx_inline.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic79xx_openbsd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic7xxx_cam.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic7xxx_inline.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic7xxx_openbsd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/aic7xxxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am7930reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am7930var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am79900reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am79900var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am7990reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/am7990var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/amireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/amivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/anreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/anvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/apcdmareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5008reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5210reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5210var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5211reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5211var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5212reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5212var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5416reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar5xxx.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar9003reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar9280reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar9285reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar9287reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ar9380reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/arcofivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/athnreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/athnvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/athvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/atwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/atwvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/atxxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ax88190reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ax88190var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bhareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bhavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt458reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt463reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt463var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt485reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt485var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bt8xx.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bwireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/bwivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cacreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cacvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cd1190reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cd1400reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cissreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cissvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/comreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/comvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cs4231reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/cyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dc21040reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dc503reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dl10019reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dl10019var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dp8390reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dp8390var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dp8573areg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dptreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dptvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ds1286reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ds1687reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dwc_gmac_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/dwc_gmac_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/elink3reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/elink3var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/espreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/fxpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/fxpvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/gdtreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/gdtvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/gemreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/gemvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/hayespreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/hmereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/hmevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i8042reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82365reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82365var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i8237reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i8253reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82586reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82595reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82596reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82596var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i8259reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82802reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/i82810reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ibm525reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ibm561reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ibm561var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ics2101reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/if_wi_hostap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/if_wi_ieee.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/if_wireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/if_wivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/iha.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/intersil7170.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lancereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lancevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lemacreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lemacvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lm700x.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lm78var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lptreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lptvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lsi64854reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/lsi64854var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/m41t8xreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/malo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/max2820reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mc146818reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mc6845.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mc6845reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mfireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mfivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mk48txxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/monitors.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mpireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mpivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mpuvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mtd8xxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/mtd8xxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ncr5380reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ncr5380var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ncr53c9xreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ncr53c9xvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ne2000reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ne2000var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/nec765reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ns16450reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ns16550reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/nvmereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/nvmevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/oosiopreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/oosiopvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/osiopreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/osiopvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/p9000.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pcdisplay.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pcdisplayvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pcf8584var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pckbcvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pgtreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pgtvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/pt2254a.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/qlareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/qlavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/qlwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/qlwvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/r92creg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/ramdac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/revar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rf3000reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2560reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2560var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2661reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2661var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2860reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rt2860var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtl80x9reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtl80x9var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtl81x9reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtl8225reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtsxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtsxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtwnvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/rtwvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/s3_617.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/sa2400reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/seeq8003reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/si4136reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/silireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/silivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/siopreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/siopvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/siopvar_common.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/slireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/slivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/smc83c170reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/smc83c170var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/smc91cxxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/smc91cxxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/smc93cx6var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/stireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/stivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tc921x.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tcic2reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tcic2var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tea5757.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/tivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/trm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/twereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/twevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/uhareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/uhavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/vgareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/vgavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/w83l518d_sdmmc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/w83l518dreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/w83l518dvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/wd33c93reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/wd33c93var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/wdcevent.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/wdcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/wdcvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/xlreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/z8530reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ic/z8530sc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ipmi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ipmivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/ad1848var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/ahareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/cs4231var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/elink.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/essreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/essvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/fdlink.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/fdreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/gscsioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/gusreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/gusvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/i82365_isavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/ics2101var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_ecreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_egreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_elreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_exreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_ie507.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_ieatt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_iee16.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_levar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/if_wereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/isadmareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/isadmavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/isapnpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/isareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/isavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/itvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/madreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/pasreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/pcdisplayvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/pcppireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/pcppivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/pnpdevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/rtreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/rtvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/sbdspvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/sbreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/sbvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/spkrio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/vga_isavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/viasioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/wbsioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/isa/wdsreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/midi_if.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/midivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/acphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/amphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/bmtphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/brgphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/ciphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/eephyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/icsphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/inphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/iophyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/ipgphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/jmphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/lxtphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/mii.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/mii_bitbang.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/miidevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/miivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/mtdphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/nsgphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/nsphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/nsphyterreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/qsphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/rgephyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/sqphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/tlphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/tlphyvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/tqphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/txphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/urlphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mii/xmphyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/mulaw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/fdt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/ofw_clock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/ofw_gpio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/ofw_pci.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/ofw_pinctrl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/ofw_regulator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/ofw/openfirm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/onewire -./usr/libdata/perl5/site_perl/arm-openbsd/dev/onewire/onewiredevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/onewire/onewiredevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/onewire/onewirereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/onewire/onewirevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/agpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/agpvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/amas.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/auacerreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/auixpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/auixpvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/autrireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/autrivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/auviavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/azalia.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_audio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_card.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_core.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_os.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bktr/bktr_tuner.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/bt8370reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cmpcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cmpcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cs4280reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cs4281reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cy82c693reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/cy82c693var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/czreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/eapreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/emuxkireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/emuxkivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/envyreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/envyvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/esareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/esavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/esoreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/esovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/fmsreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/fmsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/gcu_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/gcu_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/glxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/glxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/hifn7751reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/hifn7751var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/i82365_pcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ichreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_agereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_alcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_alereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_bcereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_bgereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_bnxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_casreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_casvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_devar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_em.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_em_hw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_em_osdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_em_soc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_etreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ipwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ipwvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwmreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwmvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwnreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_iwnvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ix.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ixgb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ixgb_osdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_jmereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_jmevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_lgereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_liireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_mskvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_myxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_nfereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_nfevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ngereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_ocereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_sereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_sisreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_skreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_skvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_stereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_stgereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_tlreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_txpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_vgereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_vgevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_vmxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_vrreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_vtereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_wbreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_wpireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_wpivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/if_xgereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ixgb_ee.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ixgb_hw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ixgb_ids.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ixgbe.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ixgbe_type.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/mpiireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/neoreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pccbbreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pccbbvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pcidevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pcidevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_acard_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_acer_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_amd_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_apollo_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_cmd_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_cy693_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_hpt_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_i31244_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_ite_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_ixp_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_jmicron_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_natsemi_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_nforce_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_opti_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_pdc202xx_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_piix_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_rdc_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_sii3112_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_sis_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciide_svwsata_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciidereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pciidevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pcscpreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/piixreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/plx9060reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/plx9060var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ppbreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/pucvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/qlereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/safereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/safevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/siop_pci_common.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/tgareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/tgavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ubsecreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ubsecvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/vga_pcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/vioblkreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/vioscsireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/virtioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/virtiovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ydsreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pci/ydsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pckbc -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pckbc/pckbdreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pckbc/pckbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pckbc/pmsreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pckbc/wskbdmap_mfii.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/cfxgareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/gprio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/if_cnwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/if_maloreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/if_malovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/if_xereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/pcmciachip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/pcmciadevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/pcmciareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pcmcia/pcmciavar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/hypervreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/hypervvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/if_hvnreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/pvreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/pvvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/rndisreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/xenreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/pv/xenvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/radio_if.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/radiovar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/rasops -./usr/libdata/perl5/site_perl/arm-openbsd/dev/rasops/rasops.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/rasops/rasops_bitops.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/rasops/rasops_masks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/rndvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/asioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/bereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/bppreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/cgsixreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/cgtwelvereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/cs4231var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/lebuffervar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/magmareg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/qecreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/qecvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/qereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/sbusvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/spifreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/spifvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/stp4020reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/stp4020var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/uperf_sbusreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/xboxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/xboxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sbus/zxreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdhcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdhcvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmc_ioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmc_scsi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmcchip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmcdevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sdmmc/sdmmcvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/softraidvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/spdmemvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun/disklabel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun/sunkbdreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun/sunkbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun/sunmsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/sun/uperfio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/ascvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/if_levar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/ioasicreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/ioasicvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/tcdevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/tcdsreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/tcdsvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/tcreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/tc/tcvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2 -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2/dwc2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2/dwc2_core.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2/dwc2_hcd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2/dwc2_hw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/dwc2/dwc2var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ehcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ehcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_athn_usb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_atureg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_auereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_axenreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_axereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_cdcereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_cuereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_kuereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_kuevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_mosreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_otusreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_ralreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_ralvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_rsureg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_rumreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_rumvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_runvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_smscreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_uathreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_uathvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_udavreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_umb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_upgtvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_urereg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_urlreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_urndisreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_urtwreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_wi_usb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/if_zydreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/mbim.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ohcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ohcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uaudioreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ucomvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/udl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/udlio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uftdireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uhcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uhcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uhid_rdesc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uhidev.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/ukbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umass_quirks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umass_scsi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umassvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umcs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umct.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umidi_quirks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umidireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/umidivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uoak.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uowreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usb_mem.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usb_quirks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbcdc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbdevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbdevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbdi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbdi_util.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbdivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbfvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/usbhid.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uslhcomreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/utvfu.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/uvideo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/xhcireg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/usb/xhcivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/video_if.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/ediddevs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/ediddevs_data.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/edidreg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/edidvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/vesagtf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/videomode/videomode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/vndioctl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/vscsivar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/ascii.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/unicode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wscons_callbacks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wscons_features.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsconsio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsdisplay_usl_io.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsdisplayvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsemul_vt100var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsemulvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wseventvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wskbdraw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wskbdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsksymdef.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsksymvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsmoused.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsmouseinput.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsmousevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wscons/wsmuxvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/bold8x16-iso1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/bold8x16.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/gallant12x22.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/lucida16x29.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/omron12x20.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/qvss8x15.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/sony12x24.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/sony8x16.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/vt220l8x10.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/vt220l8x8.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/wsfont/wsfont.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/x86emu -./usr/libdata/perl5/site_perl/arm-openbsd/dev/x86emu/x86emu.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dev/x86emu/x86emu_regs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dirent.ph -./usr/libdata/perl5/site_perl/arm-openbsd/disktab.ph -./usr/libdata/perl5/site_perl/arm-openbsd/dlfcn.ph -./usr/libdata/perl5/site_perl/arm-openbsd/elf_abi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/endian.ph -./usr/libdata/perl5/site_perl/arm-openbsd/err.ph -./usr/libdata/perl5/site_perl/arm-openbsd/errno.ph -./usr/libdata/perl5/site_perl/arm-openbsd/eti.ph -./usr/libdata/perl5/site_perl/arm-openbsd/event.ph -./usr/libdata/perl5/site_perl/arm-openbsd/evutil.ph -./usr/libdata/perl5/site_perl/arm-openbsd/expat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/expat_external.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fcntl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fenv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/float.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fnmatch.ph -./usr/libdata/perl5/site_perl/arm-openbsd/form.ph -./usr/libdata/perl5/site_perl/arm-openbsd/frame.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fstab.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fts.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ftw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fuse.ph -./usr/libdata/perl5/site_perl/arm-openbsd/fuse_opt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++ -./usr/libdata/perl5/site_perl/arm-openbsd/g++/FlexLexer.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0 -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/atomic_word.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/basic_file.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/c++allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/c++config.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/c++io.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/c++locale.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/c++locale_internal.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/compatibility.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/cpu_defines.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/ctype_base.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/ctype_inline.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/ctype_noninline.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/cxxabi_tweaks.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/gthr-default.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/gthr-posix.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/gthr-single.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/gthr-tpf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/gthr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/messages_members.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/os_defines.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/arm-unknown-openbsd6.0/bits/time_members.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/algo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/algobase.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/alloc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/backward_warning.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/bvector.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/complex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/defalloc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/deque.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/fstream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/function.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/hash_map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/hash_set.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/hashtable.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/heap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/iomanip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/iostream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/istream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/iterator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/list.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/multimap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/multiset.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/new.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/ostream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/pair.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/queue.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/rope.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/set.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/slist.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/stack.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/stream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/streambuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/tempbuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/tree.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/backward/vector.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/basic_ios.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/basic_string.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/boost_concept_check.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/char_traits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/codecvt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/concept_check.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/cpp_type_traits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/functexcept.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/gslice.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/gslice_array.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/indirect_array.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/ios_base.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/locale_classes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/locale_facets.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/localefwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/mask_array.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/ostream_insert.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/postypes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/slice_array.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_algo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_algobase.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_bvector.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_construct.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_deque.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_function.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_heap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_iterator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_iterator_base_funcs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_iterator_base_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_list.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_multimap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_multiset.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_numeric.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_pair.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_queue.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_raw_storage_iter.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_relops.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_set.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_stack.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_tempbuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_tree.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_uninitialized.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stl_vector.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stream_iterator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/streambuf_iterator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/stringfwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/valarray_after.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/valarray_array.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/bits/valarray_before.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/cxxabi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/debug.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/formatter.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/functions.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/hash_map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/hash_multimap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/hash_multiset.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/hash_set.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/macros.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/multimap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/multiset.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/safe_base.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/safe_iterator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/safe_sequence.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/debug/set.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/exception_defines.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/array_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/atomicity.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/bitmap_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/codecvt_specializations.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/concurrence.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/debug_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/hash_fun.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/hashtable.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/malloc_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/mt_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/new_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/numeric_traits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/pod_char_traits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/pool_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/rc_string_base.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/ropeimpl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/sso_string_base.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/stdio_filebuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/stdio_sync_filebuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/throw_allocator.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/type_traits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/typelist.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/vstring.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/vstring_fwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/ext/vstring_util.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1 -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/bind_iterate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/bind_repeat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/boost_shared_ptr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/common.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/ctype.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/fenv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/float.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/functional_hash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/functional_iterate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/hashtable_policy.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/inttypes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/limits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/math.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/mu_iterate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/ref_fwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/ref_wrap_iterate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/repeat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/stdarg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/stdbool.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/stdint.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/stdio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/stdlib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/tgmath.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/tuple_defs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/tuple_iterate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/type_traits_fwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/wchar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/g++/tr1/wctype.ph -./usr/libdata/perl5/site_perl/arm-openbsd/getopt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/glob.ph -./usr/libdata/perl5/site_perl/arm-openbsd/grp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/histedit.ph -./usr/libdata/perl5/site_perl/arm-openbsd/icdb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ieeefp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ifaddrs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/imsg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/inttypes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/iso646.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660 -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660/cd9660_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660/cd9660_node.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660/cd9660_rrip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660/iso.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/cd9660/iso_rrip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/udf -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/udf/ecma167-udf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/udf/udf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/isofs/udf/udf_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/keynote.ph -./usr/libdata/perl5/site_perl/arm-openbsd/kvm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/langinfo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/libgen.ph -./usr/libdata/perl5/site_perl/arm-openbsd/limits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/link.ph -./usr/libdata/perl5/site_perl/arm-openbsd/link_elf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/locale.ph -./usr/libdata/perl5/site_perl/arm-openbsd/login_cap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/machine -./usr/libdata/perl5/site_perl/arm-openbsd/math.ph -./usr/libdata/perl5/site_perl/arm-openbsd/md5.ph -./usr/libdata/perl5/site_perl/arm-openbsd/memory.ph -./usr/libdata/perl5/site_perl/arm-openbsd/menu.ph -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs/fifofs -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs/fifofs/fifo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs/fuse -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs/fuse/fusefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/miscfs/fuse/fusefs_node.ph -./usr/libdata/perl5/site_perl/arm-openbsd/mmintrin.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/bootsect.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/bpb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/denode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/direntry.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/fat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/msdosfs/msdosfsmount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ncurses.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ndbm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net -./usr/libdata/perl5/site_perl/arm-openbsd/net/art.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/bpf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/bpfdesc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/ethertypes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/hfsc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_arp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_bridge.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_dl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_enc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_etherip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_gif.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_gre.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_llc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_media.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_pflog.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_pflow.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_pfsync.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_ppp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_pppoe.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_pppvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_sppp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_switch.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_trunk.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_tun.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_vlan_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/if_vxlan.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/ifq.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/netisr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/ofp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/pfkeyv2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/pfvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/pipex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/pipex_local.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/ppp-comp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/ppp_defs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/radix.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/radix_mpath.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/raw_cb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/route.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/rtable.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/slcompress.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/slip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net/trunklacp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211 -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_amrr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_crypto.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_ioctl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_node.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_priv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_proto.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_radiotap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_regdomain.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_rssadapt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/net80211/ieee80211_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netdb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netgroup.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/icmp6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/icmp_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/if_ether.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/igmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/igmp_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/in.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/in_pcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/in_systm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/in_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ah.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_carp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_divert.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ecn.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_esp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ether.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_gre.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_icmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ipcomp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ipip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_ipsp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_mroute.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/ip_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/pim.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/pim_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp_debug.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp_fsm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp_seq.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp_timer.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcp_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/tcpip.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/udp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet/udp_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6 -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/in6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/in6_ifattach.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/in6_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/ip6_divert.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/ip6_mroute.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/ip6_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/ip6protosw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/mld6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/mld6_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/nd6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/pim6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/pim6_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/raw_ip6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netinet6/tcpipv6.ph -./usr/libdata/perl5/site_perl/arm-openbsd/netmpls -./usr/libdata/perl5/site_perl/arm-openbsd/netmpls/mpls.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/krpc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfs_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsdiskless.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsm_subs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsmount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsnode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsproto.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/nfsrvcache.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/rpcv2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nfs/xdr_subs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nl_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/nlist.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs_compr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs_ihash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs_inode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs_subr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfs_vfsops.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ntfs/ntfsmount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc -./usr/libdata/perl5/site_perl/arm-openbsd/objc/NXConstStr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/Object.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/Protocol.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/encoding.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/hash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/objc-api.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/objc-decls.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/objc-list.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/objc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/runtime.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/sarray.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/thr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/objc/typedstream.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ohash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/aes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/asn1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/asn1_mac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/asn1t.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/bio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/blowfish.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/bn.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/buffer.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/camellia.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/cast.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/chacha.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/cmac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/cms.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/comp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/conf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/conf_api.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/crypto.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/des.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/dh.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/dsa.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/dso.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/dtls1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ec.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ecdh.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ecdsa.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/engine.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/err.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/evp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/gost.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/hmac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/idea.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/krb5_asn.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/lhash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/md4.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/md5.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/modes.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/obj_mac.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/objects.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ocsp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/opensslconf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/opensslfeatures.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/opensslv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ossl_typ.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/pem.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/pem2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/pkcs12.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/pkcs7.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/poly1305.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/rand.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/rc2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/rc4.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ripemd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/rsa.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/safestack.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/sha.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/srtp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ssl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ssl2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ssl23.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ssl3.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/stack.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/tls1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ts.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/txt_db.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ui.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/ui_compat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/whrlpool.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/x509.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/x509_vfy.ph -./usr/libdata/perl5/site_perl/arm-openbsd/openssl/x509v3.ph -./usr/libdata/perl5/site_perl/arm-openbsd/panel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/paths.ph -./usr/libdata/perl5/site_perl/arm-openbsd/pcap-namedb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/pcap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/poll.ph -./usr/libdata/perl5/site_perl/arm-openbsd/protocols -./usr/libdata/perl5/site_perl/arm-openbsd/protocols/dumprestore.ph -./usr/libdata/perl5/site_perl/arm-openbsd/protocols/routed.ph -./usr/libdata/perl5/site_perl/arm-openbsd/protocols/rwhod.ph -./usr/libdata/perl5/site_perl/arm-openbsd/protocols/talkd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/protocols/timed.ph -./usr/libdata/perl5/site_perl/arm-openbsd/pthread.ph -./usr/libdata/perl5/site_perl/arm-openbsd/pthread_np.ph -./usr/libdata/perl5/site_perl/arm-openbsd/pwd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/radius.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ranlib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline -./usr/libdata/perl5/site_perl/arm-openbsd/readline/chardefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/history.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/keymaps.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/readline.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/rlconf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/rlstdc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/rltypedefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readline/tilde.ph -./usr/libdata/perl5/site_perl/arm-openbsd/readpassphrase.ph -./usr/libdata/perl5/site_perl/arm-openbsd/regex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/resolv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rmd160.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/auth.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/auth_unix.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/clnt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/pmap_clnt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/pmap_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/pmap_rmt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/rpc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/rpc_des.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/rpc_msg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/svc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/svc_auth.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpc/xdr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/bootparam_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/klm_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/mount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/nfs_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/nlm_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rnusers.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rquota.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rstat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rusers.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/rwall.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/sm_inter.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/spray.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/yp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/yp_prot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/ypclnt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/rpcsvc/yppasswd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sched.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/cd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/iscsi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/mpathvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/safte.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_all.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_changer.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_debug.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_disk.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_message.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_scanner.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsi_tape.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/scsiconf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/sdvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/scsi/ses.ph -./usr/libdata/perl5/site_perl/arm-openbsd/search.ph -./usr/libdata/perl5/site_perl/arm-openbsd/semaphore.ph -./usr/libdata/perl5/site_perl/arm-openbsd/setjmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sha1.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sha2.ph -./usr/libdata/perl5/site_perl/arm-openbsd/signal.ph -./usr/libdata/perl5/site_perl/arm-openbsd/siphash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/skey.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sndio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/soundcard.ph -./usr/libdata/perl5/site_perl/arm-openbsd/spawn.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sqlite3.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sqlite3ext.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ssl -./usr/libdata/perl5/site_perl/arm-openbsd/stdarg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/stdbool.ph -./usr/libdata/perl5/site_perl/arm-openbsd/stddef.ph -./usr/libdata/perl5/site_perl/arm-openbsd/stdint.ph -./usr/libdata/perl5/site_perl/arm-openbsd/stdio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/stdlib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/string.ph -./usr/libdata/perl5/site_perl/arm-openbsd/strings.ph -./usr/libdata/perl5/site_perl/arm-openbsd/struct.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys -./usr/libdata/perl5/site_perl/arm-openbsd/sys/_endian.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/_time.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/acct.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ataio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/atomic.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/audioio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/buf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/cdefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/cdio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/chio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/conf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/core.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/device.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/dir.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/dirent.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/disk.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/disklabel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/dkbad.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/dkio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/domain.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/endian.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/errno.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/evcount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/event.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/eventvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/exec.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/exec_elf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/exec_script.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/extent.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/fcntl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/file.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/filedesc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/filio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/fusebuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/gmon.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/gpio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/hibernate.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/hotplug.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ioccom.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ioctl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ipc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/kcore.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/kernel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/kgdb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/kthread.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ktrace.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/limits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/lock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/lockf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/malloc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mbuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/memrange.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mman.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mplock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/msg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/msgbuf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mtio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/mutex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/namei.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/param.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/pciio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/pipe.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/pledge.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/poll.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/pool.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/proc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/protosw.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ptrace.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/queue.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/radioio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/reboot.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/refcnt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/resource.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/resourcevar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/rwlock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/scanio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/sched.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/scsiio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/select.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/selinfo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/sem.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/sensors.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/shm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/siginfo.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/signal.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/signalvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/socket.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/socketvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/sockio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/specdev.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/srp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/stat.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/statvfs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/stdarg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/stdint.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/swap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/syscall.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/syscall_mi.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/syscallargs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/sysctl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/syslimits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/syslog.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/systm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/task.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/termios.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/time.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/timeout.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/times.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/timetc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/tprintf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/tree.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/tty.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ttycom.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ttydefaults.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/ucred.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/uio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/un.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/unistd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/unpcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/user.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/utsname.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/uuid.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/varargs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/videoio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/vmmeter.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/vnode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sys/wait.ph -./usr/libdata/perl5/site_perl/arm-openbsd/sysexits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/syslog.ph -./usr/libdata/perl5/site_perl/arm-openbsd/tar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/term.ph -./usr/libdata/perl5/site_perl/arm-openbsd/termcap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/termios.ph -./usr/libdata/perl5/site_perl/arm-openbsd/tgmath.ph -./usr/libdata/perl5/site_perl/arm-openbsd/tib.ph -./usr/libdata/perl5/site_perl/arm-openbsd/time.ph -./usr/libdata/perl5/site_perl/arm-openbsd/tls.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ttyent.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs/ext2fs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs/ext2fs_dinode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs/ext2fs_dir.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs/ext2fs_extents.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ext2fs/ext2fs_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ffs -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ffs/ffs_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ffs/fs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ffs/softdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/mfs -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/mfs/mfs_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/mfs/mfsnode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/dinode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/dir.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/dirhash.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/inode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/quota.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/ufs_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/ufs/ufs/ufsmount.ph -./usr/libdata/perl5/site_perl/arm-openbsd/unctrl.ph -./usr/libdata/perl5/site_perl/arm-openbsd/unistd.ph -./usr/libdata/perl5/site_perl/arm-openbsd/unwind.ph -./usr/libdata/perl5/site_perl/arm-openbsd/usbhid.ph -./usr/libdata/perl5/site_perl/arm-openbsd/util.ph -./usr/libdata/perl5/site_perl/arm-openbsd/utime.ph -./usr/libdata/perl5/site_perl/arm-openbsd/utmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uuid.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_addr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_amap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_anon.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_aobj.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_ddb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_device.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_extern.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_fault.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_glue.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_km.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_map.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_object.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_page.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_pager.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_param.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_pmap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_pmemrange.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_swap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_swap_encrypt.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvm_vnode.ph -./usr/libdata/perl5/site_perl/arm-openbsd/uvm/uvmexp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/varargs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/vis.ph -./usr/libdata/perl5/site_perl/arm-openbsd/wchar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/wctype.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/_float.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/_types.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/apmvar.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/asm.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/atomic.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/bootconfig.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/bus.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/cdefs.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/conf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/cpu.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/db_machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/disklabel.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/endian.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/exec.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/fenv.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/fp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/frame.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/ieee.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/ieeefp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/intr.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/limits.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/loadfile_machdep.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/lock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/machine_reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/mutex.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/param.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/pcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/pio.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/pmap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/proc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/profile.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/ptrace.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/reg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/reloc.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/setjmp.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/signal.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/spinlock.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/stdarg.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/sysarch.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/tcb.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/trap.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/vmparam.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zaurus/zaurus_var.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zconf.ph -./usr/libdata/perl5/site_perl/arm-openbsd/zlib.ph -./usr/local/libdata/perl5/site_perl/arm-openbsd -./usr/mdec/zboot -./usr/mdec/zbsdmod.o -./usr/sbin/ZZZ -./usr/sbin/apm -./usr/sbin/apmd -./usr/sbin/hotplugd -./usr/sbin/wsconscfg -./usr/sbin/wsfontload -./usr/sbin/ztsscale -./usr/sbin/zzz diff --git a/distrib/sets/lists/comp/md.zaurus b/distrib/sets/lists/comp/md.zaurus deleted file mode 100644 index 468919fcfd2..00000000000 --- a/distrib/sets/lists/comp/md.zaurus +++ /dev/null @@ -1,685 +0,0 @@ -./usr/bin/addr2line -./usr/bin/objcopy -./usr/bin/readelf -./usr/include/arm -./usr/include/arm/_float.h -./usr/include/arm/_types.h -./usr/include/arm/apmvar.h -./usr/include/arm/armreg.h -./usr/include/arm/asm.h -./usr/include/arm/atomic.h -./usr/include/arm/bus.h -./usr/include/arm/cdefs.h -./usr/include/arm/conf.h -./usr/include/arm/cpu.h -./usr/include/arm/cpuconf.h -./usr/include/arm/cpufunc.h -./usr/include/arm/db_machdep.h -./usr/include/arm/disklabel.h -./usr/include/arm/endian.h -./usr/include/arm/exec.h -./usr/include/arm/fdt.h -./usr/include/arm/fenv.h -./usr/include/arm/fiq.h -./usr/include/arm/fp.h -./usr/include/arm/frame.h -./usr/include/arm/ieee.h -./usr/include/arm/ieeefp.h -./usr/include/arm/isa_machdep.h -./usr/include/arm/kcore.h -./usr/include/arm/limits.h -./usr/include/arm/lock.h -./usr/include/arm/machdep.h -./usr/include/arm/mutex.h -./usr/include/arm/openpromio.h -./usr/include/arm/param.h -./usr/include/arm/pcb.h -./usr/include/arm/pci_machdep.h -./usr/include/arm/pio.h -./usr/include/arm/pmap.h -./usr/include/arm/proc.h -./usr/include/arm/profile.h -./usr/include/arm/pte.h -./usr/include/arm/ptrace.h -./usr/include/arm/reg.h -./usr/include/arm/reloc.h -./usr/include/arm/setjmp.h -./usr/include/arm/signal.h -./usr/include/arm/softintr.h -./usr/include/arm/spinlock.h -./usr/include/arm/stdarg.h -./usr/include/arm/swi.h -./usr/include/arm/sysarch.h -./usr/include/arm/sysreg.h -./usr/include/arm/tcb.h -./usr/include/arm/trap.h -./usr/include/arm/undefined.h -./usr/include/arm/vmparam.h -./usr/include/g++/arm-unknown-openbsd6.0 -./usr/include/g++/arm-unknown-openbsd6.0/bits -./usr/include/g++/arm-unknown-openbsd6.0/bits/atomic_word.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/basic_file.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/c++allocator.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/c++config.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/c++io.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/c++locale.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/c++locale_internal.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/compatibility.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/cpu_defines.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/ctype_base.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/ctype_inline.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/ctype_noninline.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/cxxabi_tweaks.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/gthr-default.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/gthr-posix.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/gthr-single.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/gthr-tpf.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/gthr.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/messages_members.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/os_defines.h -./usr/include/g++/arm-unknown-openbsd6.0/bits/time_members.h -./usr/include/g++/backward -./usr/include/g++/backward/algo.h -./usr/include/g++/backward/algobase.h -./usr/include/g++/backward/alloc.h -./usr/include/g++/backward/backward_warning.h -./usr/include/g++/backward/bvector.h -./usr/include/g++/backward/complex.h -./usr/include/g++/backward/defalloc.h -./usr/include/g++/backward/deque.h -./usr/include/g++/backward/fstream.h -./usr/include/g++/backward/function.h -./usr/include/g++/backward/hash_map.h -./usr/include/g++/backward/hash_set.h -./usr/include/g++/backward/hashtable.h -./usr/include/g++/backward/heap.h -./usr/include/g++/backward/iomanip.h -./usr/include/g++/backward/iostream.h -./usr/include/g++/backward/istream.h -./usr/include/g++/backward/iterator.h -./usr/include/g++/backward/list.h -./usr/include/g++/backward/map.h -./usr/include/g++/backward/multimap.h -./usr/include/g++/backward/multiset.h -./usr/include/g++/backward/new.h -./usr/include/g++/backward/ostream.h -./usr/include/g++/backward/pair.h -./usr/include/g++/backward/queue.h -./usr/include/g++/backward/rope.h -./usr/include/g++/backward/set.h -./usr/include/g++/backward/slist.h -./usr/include/g++/backward/stack.h -./usr/include/g++/backward/stream.h -./usr/include/g++/backward/streambuf.h -./usr/include/g++/backward/strstream -./usr/include/g++/backward/tempbuf.h -./usr/include/g++/backward/tree.h -./usr/include/g++/backward/vector.h -./usr/include/g++/bits -./usr/include/g++/bits/allocator.h -./usr/include/g++/bits/basic_ios.h -./usr/include/g++/bits/basic_ios.tcc -./usr/include/g++/bits/basic_string.h -./usr/include/g++/bits/basic_string.tcc -./usr/include/g++/bits/boost_concept_check.h -./usr/include/g++/bits/char_traits.h -./usr/include/g++/bits/cmath.tcc -./usr/include/g++/bits/codecvt.h -./usr/include/g++/bits/concept_check.h -./usr/include/g++/bits/cpp_type_traits.h -./usr/include/g++/bits/deque.tcc -./usr/include/g++/bits/fstream.tcc -./usr/include/g++/bits/functexcept.h -./usr/include/g++/bits/gslice.h -./usr/include/g++/bits/gslice_array.h -./usr/include/g++/bits/indirect_array.h -./usr/include/g++/bits/ios_base.h -./usr/include/g++/bits/istream.tcc -./usr/include/g++/bits/list.tcc -./usr/include/g++/bits/locale_classes.h -./usr/include/g++/bits/locale_facets.h -./usr/include/g++/bits/locale_facets.tcc -./usr/include/g++/bits/localefwd.h -./usr/include/g++/bits/mask_array.h -./usr/include/g++/bits/ostream.tcc -./usr/include/g++/bits/ostream_insert.h -./usr/include/g++/bits/postypes.h -./usr/include/g++/bits/slice_array.h -./usr/include/g++/bits/sstream.tcc -./usr/include/g++/bits/stl_algo.h -./usr/include/g++/bits/stl_algobase.h -./usr/include/g++/bits/stl_bvector.h -./usr/include/g++/bits/stl_construct.h -./usr/include/g++/bits/stl_deque.h -./usr/include/g++/bits/stl_function.h -./usr/include/g++/bits/stl_heap.h -./usr/include/g++/bits/stl_iterator.h -./usr/include/g++/bits/stl_iterator_base_funcs.h -./usr/include/g++/bits/stl_iterator_base_types.h -./usr/include/g++/bits/stl_list.h -./usr/include/g++/bits/stl_map.h -./usr/include/g++/bits/stl_multimap.h -./usr/include/g++/bits/stl_multiset.h -./usr/include/g++/bits/stl_numeric.h -./usr/include/g++/bits/stl_pair.h -./usr/include/g++/bits/stl_queue.h -./usr/include/g++/bits/stl_raw_storage_iter.h -./usr/include/g++/bits/stl_relops.h -./usr/include/g++/bits/stl_set.h -./usr/include/g++/bits/stl_stack.h -./usr/include/g++/bits/stl_tempbuf.h -./usr/include/g++/bits/stl_tree.h -./usr/include/g++/bits/stl_uninitialized.h -./usr/include/g++/bits/stl_vector.h -./usr/include/g++/bits/stream_iterator.h -./usr/include/g++/bits/streambuf.tcc -./usr/include/g++/bits/streambuf_iterator.h -./usr/include/g++/bits/stringfwd.h -./usr/include/g++/bits/valarray_after.h -./usr/include/g++/bits/valarray_array.h -./usr/include/g++/bits/valarray_array.tcc -./usr/include/g++/bits/valarray_before.h -./usr/include/g++/bits/vector.tcc -./usr/include/g++/cxxabi.h -./usr/include/g++/debug -./usr/include/g++/debug/bitset -./usr/include/g++/debug/debug.h -./usr/include/g++/debug/deque -./usr/include/g++/debug/formatter.h -./usr/include/g++/debug/functions.h -./usr/include/g++/debug/hash_map -./usr/include/g++/debug/hash_map.h -./usr/include/g++/debug/hash_multimap.h -./usr/include/g++/debug/hash_multiset.h -./usr/include/g++/debug/hash_set -./usr/include/g++/debug/hash_set.h -./usr/include/g++/debug/list -./usr/include/g++/debug/macros.h -./usr/include/g++/debug/map -./usr/include/g++/debug/map.h -./usr/include/g++/debug/multimap.h -./usr/include/g++/debug/multiset.h -./usr/include/g++/debug/safe_base.h -./usr/include/g++/debug/safe_iterator.h -./usr/include/g++/debug/safe_iterator.tcc -./usr/include/g++/debug/safe_sequence.h -./usr/include/g++/debug/set -./usr/include/g++/debug/set.h -./usr/include/g++/debug/string -./usr/include/g++/debug/vector -./usr/include/g++/exception_defines.h -./usr/include/g++/ext -./usr/include/g++/ext/algorithm -./usr/include/g++/ext/array_allocator.h -./usr/include/g++/ext/atomicity.h -./usr/include/g++/ext/bitmap_allocator.h -./usr/include/g++/ext/codecvt_specializations.h -./usr/include/g++/ext/concurrence.h -./usr/include/g++/ext/debug_allocator.h -./usr/include/g++/ext/functional -./usr/include/g++/ext/hash_fun.h -./usr/include/g++/ext/hash_map -./usr/include/g++/ext/hash_set -./usr/include/g++/ext/hashtable.h -./usr/include/g++/ext/iterator -./usr/include/g++/ext/malloc_allocator.h -./usr/include/g++/ext/memory -./usr/include/g++/ext/mt_allocator.h -./usr/include/g++/ext/new_allocator.h -./usr/include/g++/ext/numeric -./usr/include/g++/ext/numeric_traits.h -./usr/include/g++/ext/pb_ds -./usr/include/g++/ext/pb_ds/assoc_container.hpp -./usr/include/g++/ext/pb_ds/detail -./usr/include/g++/ext/pb_ds/detail/basic_tree_policy -./usr/include/g++/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp -./usr/include/g++/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp -./usr/include/g++/ext/pb_ds/detail/basic_tree_policy/traits.hpp -./usr/include/g++/ext/pb_ds/detail/basic_types.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_ -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/bin_search_tree_/traits.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_ -./usr/include/g++/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/const_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/entry_pred.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/resize_policy.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_ -./usr/include/g++/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_ -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_ -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp -./usr/include/g++/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/cond_dealtor.hpp -./usr/include/g++/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/container_base_dispatch.hpp -./usr/include/g++/ext/pb_ds/detail/eq_fn -./usr/include/g++/ext/pb_ds/detail/eq_fn/eq_by_less.hpp -./usr/include/g++/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_ -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp -./usr/include/g++/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn -./usr/include/g++/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp -./usr/include/g++/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_ -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_ -./usr/include/g++/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/lu_map_.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_policy -./usr/include/g++/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp -./usr/include/g++/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp -./usr/include/g++/ext/pb_ds/detail/map_debug_base.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_ -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/ov_tree_map_/traits.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_ -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_ -./usr/include/g++/ext/pb_ds/detail/pat_trie_/child_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/head.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/internal_node.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/leaf.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/node_base.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/node_iterators.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/point_iterators.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/traits.hpp -./usr/include/g++/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/priority_queue_base_dispatch.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_ -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/node.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rb_tree_map_/traits.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_ -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy -./usr/include/g++/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp -./usr/include/g++/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_ -./usr/include/g++/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/node.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/splay_tree_/traits.hpp -./usr/include/g++/ext/pb_ds/detail/standard_policies.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_ -./usr/include/g++/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp -./usr/include/g++/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp -./usr/include/g++/ext/pb_ds/detail/tree_policy -./usr/include/g++/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp -./usr/include/g++/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp -./usr/include/g++/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp -./usr/include/g++/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp -./usr/include/g++/ext/pb_ds/detail/tree_trace_base.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy -./usr/include/g++/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp -./usr/include/g++/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp -./usr/include/g++/ext/pb_ds/detail/type_utils.hpp -./usr/include/g++/ext/pb_ds/detail/types_traits.hpp -./usr/include/g++/ext/pb_ds/detail/unordered_iterator -./usr/include/g++/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp -./usr/include/g++/ext/pb_ds/detail/unordered_iterator/iterator.hpp -./usr/include/g++/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp -./usr/include/g++/ext/pb_ds/exception.hpp -./usr/include/g++/ext/pb_ds/hash_policy.hpp -./usr/include/g++/ext/pb_ds/list_update_policy.hpp -./usr/include/g++/ext/pb_ds/priority_queue.hpp -./usr/include/g++/ext/pb_ds/tag_and_trait.hpp -./usr/include/g++/ext/pb_ds/tree_policy.hpp -./usr/include/g++/ext/pb_ds/trie_policy.hpp -./usr/include/g++/ext/pod_char_traits.h -./usr/include/g++/ext/pool_allocator.h -./usr/include/g++/ext/rb_tree -./usr/include/g++/ext/rc_string_base.h -./usr/include/g++/ext/rope -./usr/include/g++/ext/ropeimpl.h -./usr/include/g++/ext/slist -./usr/include/g++/ext/sso_string_base.h -./usr/include/g++/ext/stdio_filebuf.h -./usr/include/g++/ext/stdio_sync_filebuf.h -./usr/include/g++/ext/throw_allocator.h -./usr/include/g++/ext/type_traits.h -./usr/include/g++/ext/typelist.h -./usr/include/g++/ext/vstring.h -./usr/include/g++/ext/vstring.tcc -./usr/include/g++/ext/vstring_fwd.h -./usr/include/g++/ext/vstring_util.h -./usr/include/g++/ios -./usr/include/g++/istream -./usr/include/g++/limits -./usr/include/g++/locale -./usr/include/g++/ostream -./usr/include/g++/streambuf -./usr/include/g++/tr1 -./usr/include/g++/tr1/array -./usr/include/g++/tr1/bind_iterate.h -./usr/include/g++/tr1/bind_repeat.h -./usr/include/g++/tr1/boost_shared_ptr.h -./usr/include/g++/tr1/cctype -./usr/include/g++/tr1/cfenv -./usr/include/g++/tr1/cfloat -./usr/include/g++/tr1/cinttypes -./usr/include/g++/tr1/climits -./usr/include/g++/tr1/cmath -./usr/include/g++/tr1/common.h -./usr/include/g++/tr1/complex -./usr/include/g++/tr1/cstdarg -./usr/include/g++/tr1/cstdbool -./usr/include/g++/tr1/cstdint -./usr/include/g++/tr1/cstdio -./usr/include/g++/tr1/cstdlib -./usr/include/g++/tr1/ctgmath -./usr/include/g++/tr1/ctime -./usr/include/g++/tr1/ctype.h -./usr/include/g++/tr1/cwchar -./usr/include/g++/tr1/cwctype -./usr/include/g++/tr1/fenv.h -./usr/include/g++/tr1/float.h -./usr/include/g++/tr1/functional -./usr/include/g++/tr1/functional_hash.h -./usr/include/g++/tr1/functional_iterate.h -./usr/include/g++/tr1/hashtable -./usr/include/g++/tr1/hashtable_policy.h -./usr/include/g++/tr1/inttypes.h -./usr/include/g++/tr1/limits.h -./usr/include/g++/tr1/math.h -./usr/include/g++/tr1/memory -./usr/include/g++/tr1/mu_iterate.h -./usr/include/g++/tr1/random -./usr/include/g++/tr1/random.tcc -./usr/include/g++/tr1/ref_fwd.h -./usr/include/g++/tr1/ref_wrap_iterate.h -./usr/include/g++/tr1/repeat.h -./usr/include/g++/tr1/stdarg.h -./usr/include/g++/tr1/stdbool.h -./usr/include/g++/tr1/stdint.h -./usr/include/g++/tr1/stdio.h -./usr/include/g++/tr1/stdlib.h -./usr/include/g++/tr1/tgmath.h -./usr/include/g++/tr1/tuple -./usr/include/g++/tr1/tuple_defs.h -./usr/include/g++/tr1/tuple_iterate.h -./usr/include/g++/tr1/type_traits -./usr/include/g++/tr1/type_traits_fwd.h -./usr/include/g++/tr1/unordered_map -./usr/include/g++/tr1/unordered_set -./usr/include/g++/tr1/utility -./usr/include/g++/tr1/wchar.h -./usr/include/g++/tr1/wctype.h -./usr/include/ieeefp.h -./usr/include/mmintrin.h -./usr/include/objc/objc-decls.h -./usr/include/objc/runtime.h -./usr/include/unwind.h -./usr/include/zaurus -./usr/include/zaurus/_float.h -./usr/include/zaurus/_types.h -./usr/include/zaurus/apmvar.h -./usr/include/zaurus/asm.h -./usr/include/zaurus/atomic.h -./usr/include/zaurus/bootconfig.h -./usr/include/zaurus/bus.h -./usr/include/zaurus/cdefs.h -./usr/include/zaurus/conf.h -./usr/include/zaurus/cpu.h -./usr/include/zaurus/db_machdep.h -./usr/include/zaurus/disklabel.h -./usr/include/zaurus/endian.h -./usr/include/zaurus/exec.h -./usr/include/zaurus/fenv.h -./usr/include/zaurus/fp.h -./usr/include/zaurus/frame.h -./usr/include/zaurus/ieee.h -./usr/include/zaurus/ieeefp.h -./usr/include/zaurus/intr.h -./usr/include/zaurus/limits.h -./usr/include/zaurus/loadfile_machdep.h -./usr/include/zaurus/lock.h -./usr/include/zaurus/machine_reg.h -./usr/include/zaurus/mutex.h -./usr/include/zaurus/param.h -./usr/include/zaurus/pcb.h -./usr/include/zaurus/pio.h -./usr/include/zaurus/pmap.h -./usr/include/zaurus/proc.h -./usr/include/zaurus/profile.h -./usr/include/zaurus/ptrace.h -./usr/include/zaurus/reg.h -./usr/include/zaurus/reloc.h -./usr/include/zaurus/setjmp.h -./usr/include/zaurus/signal.h -./usr/include/zaurus/spinlock.h -./usr/include/zaurus/stdarg.h -./usr/include/zaurus/sysarch.h -./usr/include/zaurus/tcb.h -./usr/include/zaurus/trap.h -./usr/include/zaurus/vmparam.h -./usr/include/zaurus/zaurus_var.h -./usr/lib/crtbegin.o -./usr/lib/crtbeginS.o -./usr/lib/crtend.o -./usr/lib/crtendS.o -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/cc1 -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/cc1obj -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/cc1plus -./usr/lib/gcc-lib/arm-unknown-openbsd6.0/4.2.1/libgcov.a -./usr/lib/libarm.a -./usr/lib/libarm_p.a -./usr/lib/libstdc++_p.a -./usr/lib/libsupc++.a -./usr/lib/libsupc++_p.a -./usr/libdata/ldscripts -./usr/libdata/ldscripts/armelf_obsd.x -./usr/libdata/ldscripts/armelf_obsd.xbn -./usr/libdata/ldscripts/armelf_obsd.xc -./usr/libdata/ldscripts/armelf_obsd.xn -./usr/libdata/ldscripts/armelf_obsd.xr -./usr/libdata/ldscripts/armelf_obsd.xs -./usr/libdata/ldscripts/armelf_obsd.xsc -./usr/libdata/ldscripts/armelf_obsd.xsw -./usr/libdata/ldscripts/armelf_obsd.xu -./usr/libdata/ldscripts/armelf_obsd.xw -./usr/libdata/ldscripts/armelf_obsd.xz -./usr/libdata/ldscripts/armelfb_obsd.x -./usr/libdata/ldscripts/armelfb_obsd.xbn -./usr/libdata/ldscripts/armelfb_obsd.xc -./usr/libdata/ldscripts/armelfb_obsd.xn -./usr/libdata/ldscripts/armelfb_obsd.xr -./usr/libdata/ldscripts/armelfb_obsd.xs -./usr/libdata/ldscripts/armelfb_obsd.xsc -./usr/libdata/ldscripts/armelfb_obsd.xsw -./usr/libdata/ldscripts/armelfb_obsd.xu -./usr/libdata/ldscripts/armelfb_obsd.xw -./usr/libdata/ldscripts/armelfb_obsd.xz -./usr/share/info/bfd.info diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi index 5aa45f0024f..c8fe82370e5 100644 --- a/distrib/sets/lists/comp/mi +++ b/distrib/sets/lists/comp/mi @@ -1602,6 +1602,9 @@ ./usr/share/man/man2/amd64 ./usr/share/man/man2/amd64/amd64_get_fsbase.2 ./usr/share/man/man2/amd64/amd64_iopl.2 +./usr/share/man/man2/armv7 +./usr/share/man/man2/armv7/arm_drain_writebuf.2 +./usr/share/man/man2/armv7/arm_sync_icache.2 ./usr/share/man/man2/bind.2 ./usr/share/man/man2/brk.2 ./usr/share/man/man2/chdir.2 @@ -1734,9 +1737,6 @@ ./usr/share/man/man2/vfork.2 ./usr/share/man/man2/wait.2 ./usr/share/man/man2/write.2 -./usr/share/man/man2/zaurus -./usr/share/man/man2/zaurus/arm_drain_writebuf.2 -./usr/share/man/man2/zaurus/arm_sync_icache.2 ./usr/share/man/man3/ASN1_OBJECT_new.3 ./usr/share/man/man3/ASN1_STRING_length.3 ./usr/share/man/man3/ASN1_STRING_new.3 diff --git a/distrib/sets/lists/etc/md.zaurus b/distrib/sets/lists/etc/md.zaurus deleted file mode 100644 index e69de29bb2d..00000000000 --- a/distrib/sets/lists/etc/md.zaurus +++ /dev/null diff --git a/distrib/sets/lists/game/md.zaurus b/distrib/sets/lists/game/md.zaurus deleted file mode 100644 index e69de29bb2d..00000000000 --- a/distrib/sets/lists/game/md.zaurus +++ /dev/null diff --git a/distrib/sets/lists/man/md.zaurus b/distrib/sets/lists/man/md.zaurus deleted file mode 100644 index e69de29bb2d..00000000000 --- a/distrib/sets/lists/man/md.zaurus +++ /dev/null diff --git a/distrib/sets/lists/man/mi b/distrib/sets/lists/man/mi index eeeef0c0c62..84004d6129e 100644 --- a/distrib/sets/lists/man/mi +++ b/distrib/sets/lists/man/mi @@ -1916,26 +1916,6 @@ ./usr/share/man/man4/xnf.4 ./usr/share/man/man4/xspd.4 ./usr/share/man/man4/yds.4 -./usr/share/man/man4/zaurus -./usr/share/man/man4/zaurus/apm.4 -./usr/share/man/man4/zaurus/autoconf.4 -./usr/share/man/man4/zaurus/intro.4 -./usr/share/man/man4/zaurus/lcd.4 -./usr/share/man/man4/zaurus/mem.4 -./usr/share/man/man4/zaurus/pxadmac.4 -./usr/share/man/man4/zaurus/pxagpio.4 -./usr/share/man/man4/zaurus/pxaintc.4 -./usr/share/man/man4/zaurus/pxaip.4 -./usr/share/man/man4/zaurus/pxammc.4 -./usr/share/man/man4/zaurus/pxaost.4 -./usr/share/man/man4/zaurus/pxapcic.4 -./usr/share/man/man4/zaurus/pxaudc.4 -./usr/share/man/man4/zaurus/scoop.4 -./usr/share/man/man4/zaurus/zaudio.4 -./usr/share/man/man4/zaurus/zkbd.4 -./usr/share/man/man4/zaurus/zrc.4 -./usr/share/man/man4/zaurus/zssp.4 -./usr/share/man/man4/zaurus/zts.4 ./usr/share/man/man4/zero.4 ./usr/share/man/man4/zyd.4 ./usr/share/man/man5 @@ -2062,7 +2042,6 @@ ./usr/share/man/man5/wsconsctl.conf.5 ./usr/share/man/man5/ypldap.conf.5 ./usr/share/man/man5/ypserv.acl.5 -./usr/share/man/man5/zaurus ./usr/share/man/man6 ./usr/share/man/man7/ascii.7 ./usr/share/man/man7/editline.7 @@ -2436,12 +2415,5 @@ ./usr/share/man/man8/ypserv.8 ./usr/share/man/man8/ypset.8 ./usr/share/man/man8/ypxfr.8 -./usr/share/man/man8/zaurus -./usr/share/man/man8/zaurus/MAKEDEV.8 -./usr/share/man/man8/zaurus/apm.8 -./usr/share/man/man8/zaurus/apmd.8 -./usr/share/man/man8/zaurus/boot.8 -./usr/share/man/man8/zaurus/boot_zaurus.8 -./usr/share/man/man8/zaurus/ztsscale.8 ./usr/share/man/man8/zdump.8 ./usr/share/man/man8/zic.8 diff --git a/distrib/special/Makefile b/distrib/special/Makefile index b87f067d73a..7c345b11112 100644 --- a/distrib/special/Makefile +++ b/distrib/special/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.40 2016/08/16 04:55:33 tedu Exp $ +# $OpenBSD: Makefile,v 1.41 2016/09/03 13:37:40 guenther Exp $ SUBDIR= libstubs \ arch bioctl cat chmod chroot cp date dd df dhclient disklabel dmesg \ @@ -7,7 +7,7 @@ SUBDIR= libstubs \ mkdir mknod mkuboot more mount mount_cd9660 mount_ext2fs \ mount_ffs mount_msdos mount_nfs mount_udf mt mv newfs newfs_ext2fs \ newfs_msdos pax pdisk ping ping6 pwd_mkdb reboot restore rm route sed \ - signify sleep stty sync sysctl umount ztsscale + signify sleep stty sync sysctl umount install: diff --git a/distrib/special/disklabel/Makefile b/distrib/special/disklabel/Makefile index a2a12b8ec79..32d25ff9e2e 100644 --- a/distrib/special/disklabel/Makefile +++ b/distrib/special/disklabel/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2016/09/01 10:08:29 deraadt Exp $ +# $OpenBSD: Makefile,v 1.8 2016/09/03 13:37:40 guenther Exp $ PROG= disklabel SRCS= disklabel.c dkcksum.c editor.c manual.c @@ -49,10 +49,6 @@ CFLAGS+= -DSEEALSO="\"fdisk(8), pdisk(8)\"" CFLAGS+= -DSEEALSO="\"installboot(8)\"" -DSUN_CYLCHECK -DSUN_AAT0 .endif -.if (${MACHINE} == "zaurus") -CFLAGS+= -DSEEALSO="\"fdisk(8)\"" -.endif - .ifdef NOPIC CFLAGS+= -DSTATICLINKING .endif diff --git a/distrib/special/installboot/Makefile b/distrib/special/installboot/Makefile index 6cf8a66a68b..760daf0e44e 100644 --- a/distrib/special/installboot/Makefile +++ b/distrib/special/installboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2016/09/01 10:08:29 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2016/09/03 13:37:40 guenther Exp $ .PATH: ${.CURDIR}/../../../usr.sbin/installboot @@ -71,10 +71,6 @@ SRCS += sparc64_installboot.c SRCS += sparc64_softraid.c .endif -.if ${MACHINE} == "zaurus" -SRCS += stubs.c -.endif - .if !empty(CFLAGS:M-DBOOTSTRAP) SRCS += bootstrap.c .endif diff --git a/distrib/special/ztsscale/Makefile b/distrib/special/ztsscale/Makefile deleted file mode 100644 index 62318d78c46..00000000000 --- a/distrib/special/ztsscale/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2014/01/09 15:02:52 deraadt Exp $ - -.PATH: ${.CURDIR}/../../../usr.sbin/ztsscale - -.if ${MACHINE} == "zaurus" -SRCS= ztsscale.c - -PROG= ztsscale -.else -NOPROG=yes -.endif - -.include <bsd.prog.mk> diff --git a/distrib/zaurus/Makefile b/distrib/zaurus/Makefile deleted file mode 100644 index cdbf0cd8424..00000000000 --- a/distrib/zaurus/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2005/03/18 20:26:28 deraadt Exp $ - -SUBDIR= ramdisk ipk - -.include <bsd.subdir.mk> diff --git a/distrib/zaurus/ipk/Makefile b/distrib/zaurus/ipk/Makefile deleted file mode 100644 index 0c0de3f2d5e..00000000000 --- a/distrib/zaurus/ipk/Makefile +++ /dev/null @@ -1,73 +0,0 @@ -# $OpenBSD: Makefile,v 1.10 2009/04/17 03:58:55 deraadt Exp $ - -TOP= ${.CURDIR}/.. -IPK= openbsd${OSrev}_arm.ipk - -all: ${IPK} Packages - -${IPK}: - install -o ${BINOWN} -g ${BINGRP} -m 755 -d ${.OBJDIR}/data/usr/local/OpenBSD - install -o ${BINOWN} -g ${BINGRP} -m 755 -d \ - ${.OBJDIR}/data/opt/QtPalmtop/apps/Applications - install -o ${BINOWN} -g ${BINGRP} -m 755 -d ${.OBJDIR}/data/opt/QtPalmtop/bin - install -o ${BINOWN} -g ${BINGRP} -m 755 -d ${.OBJDIR}/data/opt/QtPalmtop/pics - - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.OBJDIR}/../ramdisk/bsd.rd \ - ${.OBJDIR}/data/usr/local/OpenBSD - install -o ${BINOWN} -g ${BINGRP} -m 755 ${DESTDIR}/usr/mdec/zboot \ - ${.OBJDIR}/data/usr/local/OpenBSD - install -o ${BINOWN} -g ${BINGRP} -m 755 ${DESTDIR}/usr/mdec/zbsdmod.o \ - ${.OBJDIR}/data/usr/local/OpenBSD - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.CURDIR}/rc.zboot \ - ${.OBJDIR}/data/usr/local/OpenBSD - - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.CURDIR}/bootbsd \ - ${.OBJDIR}/data/opt/QtPalmtop/bin - grep -v '^#' ${.CURDIR}/bootbsd.desktop > ${.OBJDIR}/bootbsd.desktmp - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.OBJDIR}/bootbsd.desktmp \ - ${.OBJDIR}/data/opt/QtPalmtop/apps/Applications/bootbsd.desktop - uudecode < ${.CURDIR}/bootbsd.png.uu - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.OBJDIR}/bootbsd.png \ - ${.OBJDIR}/data/opt/QtPalmtop/pics - cd ${.OBJDIR}/data && tar -czf ../data.tar.gz . - install -o ${BINOWN} -g ${BINGRP} -m 755 -d ${.OBJDIR}/control - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.CURDIR}/postinst \ - ${.OBJDIR}/control; - install -o ${BINOWN} -g ${BINGRP} -m 755 ${.CURDIR}/postrm \ - ${.OBJDIR}/control; - - echo "Package: openbsd" > ${.OBJDIR}/control/control - echo "Version: ${OSREV}" >> ${.OBJDIR}/control/control - echo "Priority: optional" >> ${.OBJDIR}/control/control - echo "Section: Misc" >> ${.OBJDIR}/control/control - echo "Architecture: arm" >> ${.OBJDIR}/control/control - echo "Maintainer: uwe@openbsd.org" >> ${.OBJDIR}/control/control - echo "Filename: ${IPK}" >> ${.OBJDIR}/control/control - echo "Installed-Size:" \ - `/usr/bin/du -hs ${.OBJDIR}/data | awk '{print $$1}'` \ - >> ${.OBJDIR}/control/control - echo "Description: OpenBSD ${OSREV} boot loader and kernel" \ - >> ${.OBJDIR}/control/control - - cd ${.OBJDIR}/data/ && find . -type f | sed 's,^\.,,' > ../control/openbsd.list - cd ${.OBJDIR}/control && tar -czf ../control.tar.gz . - echo 2.0 > debian-binary; chown ${BINOWN}:${BINGRP} debian-binary - tar -czf ${IPK} ./debian-binary ./data.tar.gz ./control.tar.gz - -Packages: ${IPK} - cp ${.OBJDIR}/control/control Packages - echo "Size:" `/bin/ls -l ${IPK} | awk '{print $$5}'` \ - >> ${.OBJDIR}/Packages - -.ifdef RELEASEDIR -install: ${IPK} Packages - cp ${IPK} ${RELEASEDIR} - cp Packages ${RELEASEDIR} -.endif - -clean cleandir: - rm -rf data control ${IPK} debian-binary control.tar.gz data.tar.gz \ - bootbsd.desktmp bootbsd.png Packages - -.include <bsd.prog.mk> -.include <bsd.subdir.mk> diff --git a/distrib/zaurus/ipk/bootbsd b/distrib/zaurus/ipk/bootbsd deleted file mode 100644 index e4296037256..00000000000 --- a/distrib/zaurus/ipk/bootbsd +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# $OpenBSD: bootbsd,v 1.3 2006/04/04 00:25:58 uwe Exp $ -# -# Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# -if [ -s /hdd2/bsd.rd ]; then - cp /hdd2/bsd.rd /proc/zboot -fi -cp /usr/local/OpenBSD/bsd.rd /proc/zboot diff --git a/distrib/zaurus/ipk/bootbsd.desktop b/distrib/zaurus/ipk/bootbsd.desktop deleted file mode 100644 index db078b52d02..00000000000 --- a/distrib/zaurus/ipk/bootbsd.desktop +++ /dev/null @@ -1,25 +0,0 @@ -# $OpenBSD: bootbsd.desktop,v 1.2 2005/07/12 06:31:53 uwe Exp $ -# -# Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# -[Desktop Entry] -#Comment=Boot the OpenBSD ramdisk kernel bsd.rd -Exec=bootbsd -Icon=bootbsd -Type=Application -CanFastload=0 -Name=Install OpenBSD -Display=640x480/144dpi,480x640/144dpi -#HidePrivilege=1 diff --git a/distrib/zaurus/ipk/bootbsd.png.uu b/distrib/zaurus/ipk/bootbsd.png.uu deleted file mode 100644 index 4c94a0df45b..00000000000 --- a/distrib/zaurus/ipk/bootbsd.png.uu +++ /dev/null @@ -1,202 +0,0 @@ - $OpenBSD: bootbsd.png.uu,v 1.2 2005/07/12 06:31:53 uwe Exp $ - -Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, 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. - -begin 644 bootbsd.png -MB5!.1PT*&@H````-24A$4@```$````!`"`8```"J:7'>````!F)+1T0`_P#_ -M`/^@O:>3````"7!(67,```L2```+$@'2W7[\````!W1)344'U0,2$`,?B90_ -MO@``'Z9)1$%4>)SMFF=\E576MZ]]EW-.3GH/"2&04$(()?0F"*B`J$@1+",@ -MY6$4QRX.@S*B(CHRCG4047`H*@P@("`HTGL/+8&$DD)-3TZ_RWX_Z,SSO._X -M.#KC^'[Q__N=C^?<>UWW6O^]]CX+?M$O^D6_Z!?]/!H^?)@>"-0+:=A"6J8( -MA`(B9!G"L"QA2?G-QS+%S[DFY>=Z4-FEHJZ'#YUZHJ:ZH0V:B51,I*U07^L! -M*1&``*2T,8S`SPKA/Z+KUZ^K'H\GV>/Q]#'-X,/'3Q[Z(CPL65X\7UIFVH%[ -MRZY>$:&0)9HTR13GSIT7MFT+V[:$809$@Z=&#!]^I_YSK%/[J7_0-$TGD#5V -M[-B^7;ITZ=BU:]<L1=#.Y=3C6V8Y.'OJ>..HF-X+%B]9_LC=(P9]&AFI;X^+ -MBRPN*CKC;YK1-$$*L_V6+5L&2^Q8O]\S+2PLXO)/O<;_J9\40"@43#MV[-@= -M[=NW&^-I:.B8GW_,T:-G=SY\_T,RFR0Q9EP6\]Z=Q99M?9P];^K=[;WWWNC6 -MIT]'7$Z%SU;^E2>>F$IU=37OO/,VPX8-1PBJ]NS9]<>>/7M?^BG7^3^E_JM? -M-$U33)OQM*HZG#%=.O5NOG7+QCX0O/<O2SX>TZ-[EW:+YLU7RZ\7<?K,08H/ -M[2$S]1K#ADJ40)#5GVVC_.I%2LH*<3K"L4(1K%G[&2U:9/&'YY_&E!9C)HXE -M+C(I=\[K,Q-[].IU??^^0_\1"/^2V02#P01%448@K<9'C^R+FOG\$VEWW_U` -M]J#!8YNUZ=S"?<^(4:S^^"\,'=Z9;IV#],G5T%4#%8$M(PGH(39N,ZFM:D'! -MR1.D-_6!%<*EN1DX,)>9<P[RY_D;*3Q9P*S7GV+NW.4;FV9DK==U_;"JJ@>% -M$.9/!>!'EX"4TFF:YLROOOIJ7&Q<M+M5LVRZ=8<#NUYD]4>+:9=JT2EG+T79 -MX=S8.9.:J_DXVFDX[#1L(:EKJ",R*9JZTNO<-*09@9I2'AB7B1LGFFUBH'+S -M#8V9^=MG\%NEN!P*C=,:#UJR9$F7<>/&'9=2+K,L:XFJJMZ?`L"/V@:EE`Y@ -M?%55U?":FAKWW/GO\?J;[W)J3QWC1Z0Q>WJ(Q6^D,*"-1913I7/'+!H\&CZE -M,89+4&V&\_4!@2%:<Z7"1UI&-&D9651>3T-JF50%PC`Q&#:L*T(Y2VYV%$E1 -M+=F^93_%Q<7Q0#_;MM];O7KU&X\^^FC4SPI`2JE+*6^64CZE:5K*2R^]1'IB -M+$>VO\^4\4DD1ZEXO1:A4`Q2BT*X'%A*%2/O;$O598$JTBFZZ&/OP1J"H6@> -M>G`P+MNDWXVQ!$,J05WA#V\4H(=UH.A<'<VR$DB,3"(\_`ICQP\C+R\/C\?# -MFV^^R;QY\T;/G#GS^4`@$/OO`OA!)FB:IB(MN[UA^M[X>MO.EBU:9BG5URO8 -MN&81K\QN1$9:"9JJ4E[9E#4;:LG-2\$,!6B7W027(XK8^%2$FL+6+>=Q.A5Z -M]FY/7'06JI)`1%0<B<GI[-A]C),GRNG2J2-[]I[G_OM'<&C_*29.[$:'G$8L -M_V@]7WSQ(7L.;.7=]SYQ)C:*[Z$)M7UJ2L:N]1O6UOVK`'Y0!HP>/;K1KMW[ -MGT8)YC74>[7>W>]@^_;5#!G:@I4?AR@^E@-V/*D9<+'42\&I$'?=T0=-1&$I -M\>",0NINPB*<M&O7FO(R/]+IPG8ZD7H\OI#*F8)J1H[J1VIZ.F,?N`NG,Q9; -M*L2%-^/FWIV9^_9H9DR]F[SL/%ID95%76<W,YZ<,6K/AS>T+%_RY4]#_K[70 -M/R@#6K5J==>JE0O&?K7^JRBSQB#HW<?3T^(YML_'U*FW4U+0@-\;)#D]DKKZ -M,,Z<J:=ERTPB(](Q910>OZ2FSL074.C8N3NEY14T;=8<18T!Q<6\#Y9Q8_^> -MA(6[24UMCB`,T$EODDI$>`Q7*BX1&2DQ[0"K5QW'[[=8L>8EK%`E73H,C1D_ -M_J$LH8H-+[[XHN_'`OBG&6`81N2B18L&-DZ)2!ES;P,9"4MYX:D&6D5;J)X@ -M(7\%76[TT*I-%BK-*"NK8]+DL1P_58NB)U!3I[+^RWPRLMHP<,A0DM):T*O? -M8(Z>+.5">2TU7NC=KS]-F[?%'9F&XDQ"=<:B.R-(3LODX/$R_CSW:X0CG/SC -M)<3%"2R93UQT%%:P&2G)3?$T!#LK*C<%#,^/;I__*0`IY8TNEVO0J)%/:%LW -M7Z%?/P?)L2%T44.7+GZ$?0YAQB)T':FZ\`5<N,+C&#!X`*K3#9I&\86+5-<; -M*(YH%#T*W1E#_HDBBBZ4$9>02E['7L3$-26I42M,PE&=D1@2/E^WB9DOO<WD -M1YXF__0E',XLIC__!*JF\?:?=K-C7P&$643$.J(-PW[DU,G"-C\6P/?V`;9M -M.K[<N/%W1XX<BZJLO<JQ?=5$3$@B&&B)=-KTZNG&I42CJQ$TU$4CPB.X>5`G -M'$X-55&QA9N3!4=Y]+''*#Q;RHVIK0`-K]^'SQ_@8LE%'(XP$"I2FA04GJ6^ -MWD>73FW9]O57&";\]MDGR6S6F&89MV,:7DX4%O/;I^:CNL*IJKU"^5D/\^;. -MH^Q:48]%"U9.7;Y\^9A1HT;]X$;I?S4.*:60TAYFA$)_/7_NHG+SP-MX;E(, -MPP86<\G7BK?>J&32^#9D-8E'T\()!!.8.W\G8R;>25IZ)I;I0G<FX`U"9$P, -M4M40PH%`Y7K%5<+<.E55M31MVA+3@.,G#K%[]V9Z]NQ'ERY=L`P_GZU<QI#; -M;L$A7&#[,*P*GIGV"L/N'$QR:BQ5UPLI*SZ('A?&Q\O/\_B4.;Y>?6X:Z'`Z -M=_U0`-]7`BD2Y6FANY2FS;.(<7GIT-DDI#;B0+Z.'G<#!PI2R#\C,;1H'%$1 -MM&C3C"W;3G&QY`H.5Q1""R,4LE`U%XH2CJJ%@=!);M2$J*AD,K-:L&W;-J24 -M&"&+FV^YE924)DCI0%'=U-0&<+EBJ/<'D7H4BI;(L[][A*Z=,DB+<].Y>3.& -MW-B-XB,64QZ80^>.?=U"41[]H<%_+P#+LN^QH'55U74>>V0B+1J9I"1Z*;]D -M<2;?Q6NOSV;*XR]R[G(TATY4@1Y%>D8S;NC;DZ;-<D%QHVAA+/]L+:O6;,`? -ML+%L!105RP2)SOGS)=34UN%T.>G1\P82$M*)BT]!HB*ERI#;[^#Q)WY'=7TM -MMJ*B*+'$1K5$&DF<+Z[`UG0\@3B6+L_G_24?L^/PEP#]#,/H]D,!?*<'2,N( -MMJ08*6T[>L;TQVC>V$2['H[?CN"3OP9HURV=-__X'K')<73JW(T_OOH*K3([ -MT3$O#RET5#T"H80CU3`Z=>Y!JYP<3-M&4:&LK(3RLLMT[]Z;E)0TLIK[L9&H -MBDY24F-`$`AX6;CP`ZHKKY":ED)&1DL$<*[X)"L_7<7QPT>X:6`?LEKT("PJ -M1*NVB<QY_2524](Q32->2OF\;=L3%47YIR?([P1@8?=%JCV6?/0!=LB/VQU% -M1*+"VJ^\'#Z1P`VW=6/$F)$T>$.\^O)S0!B?K\UG\G]EH;O""!HVK@@=-(VN -MW7L@A(I0=,`D.3F94,C$LBS"(Z+)S6V'HFA(*9!2(`0XG$[&CAW+AQ_,8\*$ -ML1PZ<)(-Z]<2%R<Y7W:<:3-_3?-F&:CR&BHJS=/3V;UI&Y9ILV#I7*Y<J1E4 -M>*;H26G+/PI%?"^$?R@!*:60@D="P0#OOS>7:]<#-&XQG(#M(,:=P?"1=S+D -MSM&XP\-)2$YBUFMO4G[5AW#Z0+>QA$K!V2)6?_XYIBT10D41"D((%.'`Z8@D -MLUG+;QXN=)P.-XK0L"P;(0`)BE0)=T?A<$3@<L70K4</GG_Q]]AH/#7U25KG -M="+@UWCC3YMX;N8ZKE654E2\@%V[Y],H(8ZU:U8!8B+(YZ4=_-YR^"X/2%), -MK8?JD-PU;@ROO?5'%`FFS\`=Y:%MQY;<?L=]O/S*+#1`M25I3>*X?]P]()-0 -M-)56N5T9<L=HA'`0"H58LV85`$((I)04%!0P>_;L_\XXRV;)DB7LW[\/,`F& -MO.S>O8.!@VY"*#8@"05-$A,:T3RK#:JB$QFC\YO')C#C]U-Y>OI83IZM)+?= -M72Q:NIZF63E8PHZ4PIR(L)^WK-##EFGVL0PKS;0L)X`MI5-*F?9=)3!2RI`; -MJ5-]S8?;&<LK+\^B=2.3AKH:+*[PT@NS24T+YWIY&>^\\P95URK8OOT8MPT9 -M@K#CT#0;(10D*@Z'@SY]^WP;J(40@C9MVI"6EH9IF@@A$$+0OW]_8F)B4!2! -MT^D@&`H2$Q-)*!3`'VC`H3D8/>I7&"$?AP[N):]]:S3-Y,J5BSPX\5W.E]<R -M;$0,"Q<MI*"H@%=?>P5A*Q@!>]"	]V6;UJQ7&)?2XQ-;/RY-DS@6`PZ-(U -M+>$?^@`I[3.6Y6VY^^O]3)M^#U.?GDWW7H-Y[^7>#!Z:QH*/TYGSYGQ>?O$9 -M2L\=8/SD(>1U[H]#BT;*2F104%550UI65X021\@T<3EU+/N;,E!5%<NR4!0% -MRY)<N'"!J*@H$A(2OBT+D-(B$`R@ZRH@^7#A/$HOEI,0$\/X!^YEW>=_I;#P -M)'??=1?S_SR7SEU:L6395CR!*!Y]ZB&&#AV!4!0JKY6Q8O'[9$35TJ%S`$NY -MQOJ-M;SRZ@E&C)W`B[->^K]-4$KY,,B6'K_-GUY[CI=F-F+#VK<Y=OP2';ND -MD1`;I/+:?B9/&DU&FN#U.8\0&=,"Q9&,HCH)>L-P.,JY7I[/GCU'&3WV2?;N -M/4B;-JU`:,1$QZ"J*AZ/!Z?3B:8Y2$A(^'L62"F14H!4<3K=@(VT+9HU;4JS -MC`QR6K5!=[CP^?P,N*DW+I?DJ2?&$Q.M8%HVII;)\!$C$9:++9N_8,>.)4R> -M=!?A+H,=7Z_CX,$Z#N3[^--'"VF2EF&6EI8V_/TT:-MVG&W;VZ24+%_^&=65 -MR_'5Z'B\N6B1D51?ND;+S"`YV4U9N_8XK\Z90%)L;]2P>(3N1@@'NL.)%&%$ -MQ;O9OV<;&9D=2$W/YK/5']/GAGYHFHYMVS@<#G1=Q[),7"XG#H>.;5N</7N& -MQ*0$A)`HBD#:$J&HQ,<ED=.J#5%1,>BJ3OMVG<A(:TY]?1DQT3H2E=++9<Q] -M?R5#AHUF[?+/V+C^3:9.FXBN->+8GB-4UE[D9&$-DQ]\E8&W]:]OFI%Y(B4Y -MY3/E;\X/O":$P#1--JU806YV*TRE*R^_.9]GG_T=]TSX$YOW&(1'!<A(B\?M -MRD0XPA"*&U4+1W6X4507NIZ`.ZP)-PWHS=HU*XF.CB(B/)J&!@^V;6.:)AZ/ -MY^]^\+=.4`C!^?/G*;EX$2$$MFUQY<H5I+2)CHI"J`HUM=7X_5Z$L+%%B)KZ -M*MY^]R^4E5Y$%?4,Z=^,%QX=RZ72KYD]>SJ)8>EHGBLT3JUE\[9B>O8;;_<> -MT*U"M5W+A!03@6?^5@)M@!$`9:6E-%3N)RDQ"V=D-M6!*BZ7G">W;7>R<B:0 -M?^A+-*46*22F;>-074C%"5(@%!4D:$H\<7'Q2*XAD?B\)I65E41&1F(8!@<. -M'*!___Y(*2DI*2$4"N%VNQDT:!"*D%BVP>E3IRDH*&#HG4/1-1V!Y/RY(JY< -M+F7PH/[4U-7SQ<:]-$UOS/K5N\C.U9CTP&AB$ILCPF(1I&'XCZ,YKI&?7XS3 -MV8Z[QTZXI.J!]S09^@"A5P@AI":E#`>F`=&695%>7D9F3@K-,[.9.W\KH\;= -MP^G"8QS)/\*0OG=04EC&B3-'"0:\N#0?>KB"1"(4!5#!MI!V`%N"KNDH0L&T -M@EB6!4!86!C]^O7[QO`4A7OOO1>'P_&-06HJGH8Z;,LBJWDF.3FML6P+`5B6 -M28>\=JQ;NYP6+1J1FI3&77<.)C4I#&$$,*DE/+HU:G0NBM)`7?TASITNYN"^ -M/:Q<5\S23S?7NS1]J8)KOJ**BK^5O@;<`?).*6U6KU[%$T\\SETCLVF7.Y3X -M\#_S^)0GR6C>DL4?+*7HMK.D-`E16>_EX/Y\!MW4"ML.@5`1*$@L$$%,JPXC -M9%!568=MVX2Y->+CX_[>"X"DI.0BF[_:1'V]EPL7+Q(6YL:R33KFM6?$B&$X -M'4YL:;%AP^<,Z'\S`@NOMY:''WF(M]]Z@S'WW$-&XSCRCVVA1?-T2B]=)R>A -M/[8B4'PZCOHZ='F&/7M.\*O)SYAQ2>$;55LN4/3_#AY`DR%KFE1-=UU#-?/F -MO<YOI@SDTIGSH(1P1SNY)6\8)TYMX?"1+41&-:.\?#^+YVUBY9IU].S3B3B_ -M0&HI6$HXBA("Z47*`"672VC1,@L[Z,7I@/!P!U65541&1*+H(=SA?NX8D$QE -MC8^DE%N(B$G%$ZCDZ<>>I:[F.K]^<!I"U'-3_^Y\O/@#.G9NSXZ=>SE[MHCL -MYHD\]-ACS'GE.?R^6+;L/83+$46NZ41:/D)6%9:W"L7VXI5)C!HQ[*JB:&L5 -M52_Z?[=]S2_\;:7AY(,%'S/AO\;2M7T')M]S#V67EW+I\B5^,[TW>IB%VYT! -M"NS;?9!)D[*)BE'9N6D'_0<8N*,DEHA!=RC8EA<CX./@H7P>G/(:G@8_.:W; -M4U?;P+IU7S)ZU"C,4("RTJM$ZQ'DM,U#41-`B<7E3N#%EV9QW_WW<^^O)J$Z -M@NS<N0U==Y"0D,B4*0]AF7X4/.3EM<-;[R$WIREOS=U)^>4";NY;BO1%8P6O -M<?C$+A8LVL_P^Y[!Z7#F`]N^H^E#>??M#^G2M0V[MJZG1_L\HB/J"(]Q<.I, -M`690H(EH[A@Z'*%[L>P09>>+Z9F7P"T]DR@[MX4+Q;L)^LXAS<MX:DLP_57X -M_3Y&C7H`GS=`9%0DK;/;$Q>?R-@Q8W"ZPHB*C*-CQ]XHKC1>F3.7D#2Q;`ND -M1GI:.O??<P?K/_\+X:X(!@X<ABL\C,9IJ2B`JBA47+W*D8,'R,F.8=%'"_#4 -M"4X7E+-CWPJ,^G-XJTY27%Y&>;6#$:-&`>P'KGTG@/%C[L9A*D1J!A\O?I7Y -M[\_E:DV03Q;7(YQU7+UR'F&#(B-HJ*_GQ.G-Q,?[4$(.1MS9"FE<PPY=`?,: -MFJQ%6G7$Q2<0'YO&9ZM6L7+5$@S3AY06-@92AK`LD_/G+K+GP'YRV[=GZ=(E -M5%9>)!2Z1.6U4XP>V8=`PS%V;?D2V]3P>6HX>?PHT@YB6WYBHMP4%Y9R_.A) -M1H]I2_N><8R^?PR;-U]$FI7(X&4:?&XZ=.^+*APHBG)8413KNP"H,UYZ^?F[ -M1HZFI*R"Z@8701+YS9,S\-4XJ:LM8//6G3B4**1HX/D7IG/A]'D&W^+$Z1#H -M6A(Q43&`AFU+O-XZ=$W#D@XT+9+39\Z2TS:+I)1D!`J*(EFZ=!&N,!<MFK<D -M+CZ>SIVZL/WKW1P]N)^(\'KJJXYRH6@;:6D6+\R8CRLLG)MNZ<C"!8OHT[<G -M7D\-RSY90GJ3!#:L^YH.;7OS_E]V\KO?SV'/[N.D)=52>JZ`C5M+N7WT.%HT -M:XVBB%>%$-^9`<*2LB/2SA&($2#ZR6^WPZ`OP.^G3\>ROR+!97"FT$N/3DY* -M:R0=VVG<T"&5+;LL;KFQ,ZK#B="2V+#E`(,&#V;+EGSZWSP4M`C"HV.P4=$( -M0U%5EBU;3JOL;-IWZ/CM)J1A!"WFO/8J7VQ<17B8C4"A9\_VW'[;?;C#HSE7 -M=(PM6[[&'17+XX],1!@5K/O\<V:]]E=:=^A*N[;MF?G[%\D_6L!ST^]F^O3> -MO/C"=E[^XW)R\G)P"%>F$,J%[P0`?^\$PX%>(&?9=K"3;3DQK!JF/SX#(3<R -M9KQ-_>DZ&F4ELV^K3N_^"2SYK(Y)8WIQO>(ZR2FM^7#A"5*;)-*W;QL2$C-1 -M'+&8Z%14U9'>.!,A-'P!$TW5<8:Y.7+T$.GI34A(2.3X\:,HBDEM30.]>O:B -MJJ("E].!V^W",BP"H2KFOC>'_GWRR,U,!Z.&=Q=LXH4_;:9%=@Y?;]N(.RJ> -MQ>^]P_SW7Z6^)LC"I1O(Z]D)MZHU%T*<^TX/`!!"2"&$!_@2Q%W8^B="D7Y5 -M"V?0\%OX9%4ELY\W*:](($PTT+V7P?;#7N)3DECYU\,$@G7X_&44GCE-ITZ- -MB(W4L8UJ[&`E(E3'R<,'V+9Y(X6GCN'6!0Y-9?G23]B[:Q?1$6%(RT]"O)O= -MN[ZD1?/&6*:7?7MV4%-]&3M4@V5581L>PH2#G*Q$I'4-(^BAMC;`VK5K&#MF -M+"_/FH5MAY@P>0HK5NQATH-3>7_A>UR]<AT@04KYG?>?_]=I4`@A@0NV[7\4 -M6W.77:P:NF3I2E:OW\24*:,Y7>VB9)&7`;>I?+W],ME9(>X9&4&8TZ"RX@I/ -M/)9+7*2#HJ(B6F:W1MKU"&%RJ?0L;=MWI$5F"M+R(&2(B`@51<2B*0I8-LD) -M2=S8IQ^>NBKV[MH.MD7`5X%M*]BB"DU$4GW5`Y9*R++9M/T$J[\\S>.S.G!C -M_Q[LWW4`JSZ$&N_P-<UJ>N&IWSY5:(O0)2F=]8#U[<NVOQ?`W]-"":NP3&.: -MVVTW?OOU=SKMW+.-F(AT-FUMX*4I\2`KZ=(F@J&#;"Y?ND2S)BFDQ$0B52>U -M#84XG%E45%:Q<\\AAMXQA%MO[45<?!,LPX-M!1"J1O=N+:BLJD1:E7@\`:JJ -MJVB6D8RT)2Z]-?/G+2#<Y>=\\5&:-<LD/<V%,\S@;$D^)65>/EVV@UL'-J7T -M0C'Q[3O3[8;>2.$H%H@-*,&=`O64*IVE@._;%_N=^E^OQ86B%*8TBGLK,L91 -ME],ZE[5KON2AR9-Y>VXID<D-C+C51\UUDZ/Y2>A:#HH=0I4UG"P\B^KVLV'5 -M-F[IG8EB>`ESV926%6+;?C9_M9E@L!J7`W9LVT/0'V#-JC4(LQ[IK4/UUZ'; -M-@-NSF/[MCUTR&[*6W,64';)0W*3-&;,6L?._19YO0<@G!$L^W0I0E5"4JC[ -MA,+K2/X@A&N%$'J!4%2O4-3_-?CO!:`HJI32]:64VM&FS3*PI,JZ+Y;1JD<& -M"^;'$%1,CIWUT*[;8$1T&L=.!;E65\_IX@:6?K2%04-B<"I!+*,<R[S,EYMV -M4%1T#K__"HKE09C7Z=NG-:M6?L+UJQ=(27(@\&)1S<H5J^F8F\J4";<2J6M, -M^O4-C!OW)*G-&M&H<2ZS__`^TV>^P8TW/<"^`P>IKKY^1%.4UU58+'[`5?@/ -M`O`-!*5"2KG3-$VF/CF-2^4E[-WMXTQQ%@N7)',P/X;LW#:\\_86:GTE:)%> -M+A:99&<'J:WU8NG5F)8'VS!HJ`OQU<:==.F4!,$J[$`)1K"4RZ4G:)H>XL#> -M[=3656"H+HX>.0,>/]$N#X9ZG@K/%4PI6+EJ#WZK%DT'180S:.!P_FOBP\5+ -M%B];8%GV!D51/3\F^'\*0`AAV;:];<:,&>52K6;AA^O9L>,4*S:MPU('DMP< -MQOWJ(7PUU73K[L4E*T@.AUX]579NJ4/5XRDI*V?=BJ-X/0U`+4>/%!(*->"I -M]W!XWRF:I"2AAAPT3M7Y:.$:3,.-SVK`9Y=1&RAGQ<I3?/#G*K[X<A^S9R^B -MKB[$YFV?(X2&KCE]]]T[9M$-O?LNUW7'OS0T]4__'G<ZG5N&#!GRV%MOSREH -MT3+;D'H](<N@_-HY]N]7*+T:0>,V?H(A!1D4C!@9@4H5P8"*:<6R?-DQ!MR2 -M@-]30_-6#E:M+,36%+;N+,.I"_IT3Z5]6T%LE$!W55%8N)A+Y=?X[<R-W#=I -M+8N7[63"@V-)2&Y$0G(LDR=.X^CALRAJJ`*8I6KBG2Y=._]G1V3Z].FS4E5C -M1PBI'!`RCM6K/^?XJ0*>_?V;[#Q\D&L5PWAAMH-=)X(X4VJQI`,AK[%QW6XZ -M=X@F,OP4_7LY:=?*36J2P!,(L%C)2(G&&E1,5(Z@)'B<B*H$5'Y\C+#*> -MO&[C2,QHR9A?]\;KKT%H(-00M]]^:W#:U*GKA+!'(.0<(43-OQH\_,A!22EE -M3B`0V#1PX,#&]]UW'Q/&CT=*L&VX=_2=7+UTD*#73]?.<21&Q7/T1`F_>:PY -MK=,,-.'%5%VL6BUHE-6#1Q[]"W]XJ3^*5L.&-=>I\L/-MTSD4OD)SI66LVS5 -M1LX5%S+[^<=HG=N#:<_-0DI9I"C*>\!BH/+[MK<?JA\U*"F$."VE[+QV[=JG -MW6[W72A&$VP-PV_A"931J6LVT>Z^V+H?K[67HJMQO#ZWCD;A%HE1%<@PE<O7 -M4O`=.4YBX\8L6%%'8<%1DI)C>.;IMQEVSP`^7?0)!XXOQ;"@659KNO<:QJX] -MNPW@O!!BDA!BY[\;]+^M;X8G9(1I^>\T0M:*@_OWG>S1K;EW_6?+I16TY*=+ -M/Y;]^C:7>W;OD(?W'I'WC4B5LY_+D:_-?$9N6+M.IJ4ER?S\/;*JZHKLUC-- -M/OQ$KKQ<4B(MPY155=7RF6G/2$^@7@9,G_1Z??*AAQ[>91A&UO_ON/]!AF4* -MP[!B9DS_[>U+%G[X9LAG%AE&0+X_[PW9M4.N-,R@K*NMD<_^MH^<,BE75ERZ -M)BNKJV5B4HJLO'Y9FGY3SICZK.S3,UO:AE^:IE]:ME\:9E!:EB%#H8`TC&!9 -M34U-B_]4#/_6N+RN:A*H!3XW`^81H1N%EG2-B4]*Z_CP$T\[I*+CC'3@='1% -M52J(2XH@)`(\,&XR#CT"H=O<-FR8[Z-/%EZP%+/0EA&7-*SKBA05"HI?",VR -M,7?%QL:6_C3A_H<EI8RP;7ND95E[I932-$T9"H7D[-FSY=:M6Z5M6](P#>GS -M^;VF:9XT#..=8#`X_/;;;V]C&$:R81A.V[;%MR6F?'M,_X_J)W^`;=N*E#)) -M493V4LK&MFW+#1LVD)>7%YZ2DA(KA)!2RC(A1`%PUK;M.H?#\0^GM%_TBW[1 -;+_I%/X/^#R9GD%IT%/R9`````$E%3D2N0F"" -` -end diff --git a/distrib/zaurus/ipk/postinst b/distrib/zaurus/ipk/postinst deleted file mode 100644 index 002638437ef..00000000000 --- a/distrib/zaurus/ipk/postinst +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# $OpenBSD: postinst,v 1.6 2006/04/04 00:25:58 uwe Exp $ -# -# Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# - -cd /root/etc/rc.d || exit $? - -rmmod zbsdmod 2>/dev/null - -mount -o remount,rw / - -# The C3100/C3200 models have a 32M root filesystem in NAND flash, -# but it is completely full. Move things around to make some room. -rootsz=`df -k / | awk 'NR==2{print $2}'` -if [ ${rootsz:-0} -ge 32768 ]; then - if [ -f /usr/QtPalmtop.rom/etc/kanwadict ]; then - # C3100 - rm -f /home/QtPalmtop/etc/kanwadict - mv /usr/QtPalmtop.rom/etc/kanwadict /home/QtPalmtop/etc/kanwadict - else - # C3200 - if [ -L /home/QtPalmtop/etc/speech -a \ - -d /usr/QtPalmtop.rom/etc/speech ]; then - rm -f /home/QtPalmtop/etc/speech - mv /usr/QtPalmtop.rom/etc/speech /home/QtPalmtop/etc - ln -s /home/QtPalmtop/etc/speech /usr/QtPalmtop.rom/etc - fi - # Copying bsd.rd onto a disk partition significantly - # increases the chance that zbsdmod.o can boot it. - hddsz=`df -k /hdd2 | awk 'NR==2{print $4}'` - if [ ${hddsz:-0} -ge 5120 ]; then - cp /usr/local/OpenBSD/bsd.rd /hdd2 - fi - fi -fi - -if [ ! -f rc.rofilesys.openbsd ]; then - cp -p rc.rofilesys rc.rofilesys.openbsd -fi - -cat rc.rofilesys | sed -e '/vfat/s/^/#/' > tmp || exit $? -mv tmp rc.rofilesys -cat rc.rofilesys | sed -e '/^LINUXFMT=ext3$/s/^/#/' \ - -e '/^#LINUXFMT=ext2$/s/^#//' > tmp || exit $? -mv tmp rc.rofilesys -cat rc.rofilesys | sed \ - -e '/\/pcmcia start$/s,$,; sh /root/etc/rc.d/rc.zboot,' > tmp || exit $? -mv tmp rc.rofilesys -chown root:root rc.rofilesys -chmod 775 rc.rofilesys - -# Convert all mounted ext3 filesystems back into ext2 on reboot. -for dev in `mount | awk '/on \/hdd[123] type ext3/ {print $1}'`; do - cat <<- EOF | debugfs - open -f -w ${dev} - features -has_journal -needs_recovery - quit -EOF -done - -rm -f rc.zboot -rm -f zboot -rm -f zbsdmod.o -cp /usr/local/OpenBSD/rc.zboot . -cp /usr/local/OpenBSD/zboot . -cp /usr/local/OpenBSD/zbsdmod.o . - -sync; sleep 3 -mount -o remount,ro / - -insmod /usr/local/OpenBSD/zbsdmod.o diff --git a/distrib/zaurus/ipk/postrm b/distrib/zaurus/ipk/postrm deleted file mode 100644 index b69593f73f3..00000000000 --- a/distrib/zaurus/ipk/postrm +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# $OpenBSD: postrm,v 1.4 2006/04/04 00:25:58 uwe Exp $ -# -# Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# - -rmmod zbsdmod - -cd /root/etc/rc.d || exit $? - -mount -o remount,rw / - -rm -f /root/etc/rc.d/rc.zboot -rm -f /root/etc/rc.d/zboot -rm -f /root/etc/rc.d/zbsdmod.o - -# XXX removing ext2/ext3 and vfat hacks can cause HDD1 Error and such. -#if [ -f /root/etc/rc.d/rc.rofilesys.openbsd ]; then -# mv -f /root/etc/rc.d/rc.rofilesys.openbsd /root/etc/rc.d/rc.rofilesys -#fi - -# There is a chance that this file has not been installed by the -# postinst script, but what does it matter... -if [ -s /hdd2/bsd.rd ]; then - rm -f /hdd2/bsd.rd -fi - -mount -o remount,ro / diff --git a/distrib/zaurus/ipk/rc.zboot b/distrib/zaurus/ipk/rc.zboot deleted file mode 100644 index 1e9e7f1a874..00000000000 --- a/distrib/zaurus/ipk/rc.zboot +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $OpenBSD: rc.zboot,v 1.4 2006/04/21 17:45:44 uwe Exp $ -# -# Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# -/bin/busybox clear - -# Wait until the card in socket 1 appears. -i=0 -while ! grep '^1' /var/lib/pcmcia/stab > /dev/null; do - [ $i -lt 30 ] || break - i=$(($i+1)) - /bin/busybox sleep 1 -done - -/sbin/insmod /root/etc/rc.d/zbsdmod.o && -echo /bin/true > /proc/sys/kernel/modprobe && -/root/etc/rc.d/zboot && -echo /sbin/modprobe > /proc/sys/kernel/modprobe diff --git a/distrib/zaurus/ramdisk/Makefile b/distrib/zaurus/ramdisk/Makefile deleted file mode 100644 index 74560b855c0..00000000000 --- a/distrib/zaurus/ramdisk/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# $OpenBSD: Makefile,v 1.13 2013/10/15 22:46:54 deraadt Exp $ - -REV= ${OSrev} - -TOP= ${.CURDIR}/.. - -BSD_RD= bsd.rd -IMAGE= mr.fs -CBIN?= instbin -CRUNCHCONF?= ${CBIN}.conf -CRUNCHCONFS?= ${.CURDIR}/../common/crunch.conf -LISTS= ${.CURDIR}/list -UTILS?= ${.CURDIR}/../../miniroot - -MOUNT_POINT= /mnt -MTREE= ${UTILS}/mtree.conf - -VND?= vnd0 -VND_DEV= /dev/${VND}a -VND_RDEV= /dev/r${VND}a -VND_CRDEV= /dev/r${VND}c -PID!= echo $$$$ - - -DISKTYPE= rdroot2.5M -NBLKS= 5120 -# minfree, opt, b/i trks, sects, cpg -NEWFSARGS= -m 0 -o space -i 4096 - -.ifndef DESTDIR -all ${IMAGE}: - @echo setenv DESTDIR before making a ramdisk! - @false -.else - -# mix config is not needed. -all: ${BSD_RD} - -${BSD_RD}: ${CBIN} ${IMAGE} bsd rdsetroot - cp bsd ${BSD_RD} - ${.OBJDIR}/rdsetroot ${BSD_RD} ${IMAGE} - -${IMAGE}: rd_setup do_files rd_teardown - -.endif - -bsd: - cd ${TOP}/../../sys/arch/zaurus/conf && config RAMDISK - cd ${TOP}/../../sys/arch/zaurus/compile/RAMDISK && \ - ${MAKE} clean && exec ${MAKE} - cp ${TOP}/../../sys/arch/zaurus/compile/RAMDISK/bsd bsd - -rd_setup: - dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS} - vnconfig -v -c ${VND} ${IMAGE} - disklabel -w ${VND} ${DISKTYPE} - newfs ${NEWFSARGS} ${VND_RDEV} - fsck ${VND_RDEV} - mount ${VND_DEV} ${MOUNT_POINT} - -rd_teardown: - @df -i ${MOUNT_POINT} - -umount ${MOUNT_POINT} - -vnconfig -u ${VND} - -rdsetroot: ${TOP}/../common/elfrdsetroot.c - ${HOSTCC} ${HOSTCFLAGS} -o rdsetroot \ - ${TOP}/../common/elfrdsetroot.c ${TOP}/../common/elf32.c \ - ${TOP}/../common/elf64.c - -unconfig: - -umount -f ${MOUNT_POINT} - -vnconfig -u ${VND} - -.PRECIOUS: ${IMAGE} - -${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} - crunchgen -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC} - -${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c - ${MAKE} -f ${CBIN}.mk SRCLIBDIR=${.CURDIR}/../../../lib all - -${CRUNCHCONF}: ${LISTS} - awk -f ${UTILS}/makeconf.awk CBIN=${CBIN} ${LISTS} > ${CBIN}.conf - -do_files: - cat ${MTREE} | mtree -de -p ${MOUNT_POINT}/ -u - TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ - REV=${REV} TARGDIR=${MOUNT_POINT} UTILS=${UTILS} \ - RELEASEDIR=${RELEASEDIR} sh ${UTILS}/runlist.sh ${LISTS} - rm ${MOUNT_POINT}/${CBIN} - -clean cleandir: - /bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \ - lib*.a lib*.olist ${CBIN}.map \ - *.o *.lo *.c bsd ${BSD_RD} rdsetroot - rm -f instbin.conf - rm -rf cd-dir - -.ifdef RELEASEDIR -install: - cp ${BSD_RD} ${RELEASEDIR} -.endif # RELEASEDIR - -.include <bsd.obj.mk> -.include <bsd.subdir.mk> diff --git a/distrib/zaurus/ramdisk/Makefile.inc b/distrib/zaurus/ramdisk/Makefile.inc deleted file mode 100644 index 55385fb2dc2..00000000000 --- a/distrib/zaurus/ramdisk/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.2 2014/07/16 19:59:30 okan Exp $ - -CRUNCHGENOPTS= -E diff --git a/distrib/zaurus/ramdisk/install.md b/distrib/zaurus/ramdisk/install.md deleted file mode 100644 index ef06ccbd3f0..00000000000 --- a/distrib/zaurus/ramdisk/install.md +++ /dev/null @@ -1,119 +0,0 @@ -# $OpenBSD: install.md,v 1.41 2016/02/08 17:28:09 krw Exp $ -# -# -# Copyright (c) 1996 The NetBSD Foundation, Inc. -# All rights reserved. -# -# This code is derived from software contributed to The NetBSD Foundation -# by Jason R. Thorpe. -# -# 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. -# -# -# machine dependent section of installation/upgrade script. -# - -MDXDM=y - -md_installboot() { -} - -md_prep_fdisk() { - local _disk=$1 _q _d - - while :; do - _d=whole - if disk_has $_disk mbr; then - fdisk $_disk - if disk_has $_disk mbr openbsd; then - _q=", use the (O)penBSD area" - _d=OpenBSD - fi - else - echo "MBR has invalid signature; not showing it." - fi - ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" - case $resp in - [wW]*) - echo -n "Setting OpenBSD MBR partition to whole $_disk..." - fdisk -iy $_disk >/dev/null - echo "done." - return ;; - [eE]*) - # Manually configure the MBR. - cat <<__EOT - -You will now create a single MBR partition to contain your OpenBSD data. This -partition must have an id of 'A6'; must *NOT* overlap other partitions; and -must be marked as the only active partition. Inside the fdisk command, the -'manual' command describes all the fdisk commands in detail. - -$(fdisk ${_disk}) -__EOT - fdisk -e ${_disk} - disk_has $_disk mbr openbsd && return - echo No OpenBSD partition in MBR, try again. ;; - [oO]*) - [[ $_d == OpenBSD ]] || continue - return ;; - esac - done -} - -md_prep_disklabel() { - local _disk=$1 _f=/tmp/fstab.$1 - - md_prep_fdisk $_disk - - disklabel_autolayout $_disk $_f || return - [[ -s $_f ]] && return - - # Edit disklabel manually. - # Abandon all hope, ye who enter here. - disklabel -F $_f -E $_disk -} - -md_congrats() { - val=`ztsscale` - case $? in - 0) - echo - grep -v '^mouse\.scale.*$' /mnt/etc/wsconsctl.conf \ - >/tmp/wsconsctl.conf 2>/dev/null - echo $val "# see ztsscale(8)" >> /tmp/wsconsctl.conf - cp /tmp/wsconsctl.conf /mnt/etc/wsconsctl.conf - ;; - esac -} - -md_consoleinfo() { - local _u _d=com - - for _u in $(scan_dmesg "/^$_d\([0-9]\) .*/s//\1/p"); do - if [[ $_d$_u == $CONSOLE || -z $CONSOLE ]]; then - CDEV=$_d$_u - CPROM=com$_u - CTTY=tty0$_u - return - fi - done -} diff --git a/distrib/zaurus/ramdisk/list b/distrib/zaurus/ramdisk/list deleted file mode 100644 index e1254df0ba8..00000000000 --- a/distrib/zaurus/ramdisk/list +++ /dev/null @@ -1,92 +0,0 @@ -# $OpenBSD: list,v 1.36 2016/09/03 10:57:12 rpe Exp $ - -SRCDIRS distrib/special - -# copy the crunched binary, link to it, and kill it -COPY ${OBJDIR}/instbin instbin -LINK instbin bin/arch -LINK instbin bin/cat -LINK instbin bin/chmod bin/chgrp sbin/chown -LINK instbin bin/cp -LINK instbin bin/date -LINK instbin bin/dd -LINK instbin bin/df -LINK instbin bin/ed -LINK instbin bin/hostname -LINK instbin bin/ksh bin/sh -ARGVLINK ksh -sh -LINK instbin bin/ln -LINK instbin bin/ls -LINK instbin bin/md5 bin/sha256 bin/sha512 -SPECIAL rm bin/md5 -LINK instbin bin/mkdir -LINK instbin bin/mt bin/eject -LINK instbin bin/mv -LINK instbin bin/pax bin/tar -LINK instbin bin/rm -LINK instbin bin/sleep -LINK instbin bin/stty -LINK instbin bin/sync -LINK instbin sbin/bioctl -LINK instbin sbin/dhclient -LINK instbin sbin/disklabel -LINK instbin sbin/dmesg -LINK instbin sbin/fdisk -LINK instbin sbin/fsck -LINK instbin sbin/fsck_ext2fs -LINK instbin sbin/fsck_ffs -LINK instbin sbin/ifconfig -LINK instbin sbin/init -LINK instbin sbin/mknod -LINK instbin sbin/mount -LINK instbin sbin/mount_cd9660 -LINK instbin sbin/mount_ext2fs -LINK instbin sbin/mount_ffs -LINK instbin sbin/mount_msdos -LINK instbin sbin/mount_nfs -LINK instbin sbin/newfs -LINK instbin sbin/newfs_msdos -LINK instbin sbin/ping -LINK instbin sbin/ping6 -LINK instbin sbin/reboot sbin/halt -LINK instbin sbin/route -LINK instbin sbin/sysctl -LINK instbin sbin/umount -LINK instbin usr/bin/doas -LINK instbin usr/bin/encrypt -LINK instbin usr/bin/ftp -LINK instbin usr/bin/grep usr/bin/egrep usr/bin/fgrep -LINK instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat -LINK instbin usr/bin/more usr/bin/less -LINK instbin usr/bin/sed -LINK instbin usr/bin/signify -LINK instbin usr/sbin/chroot -LINK instbin usr/sbin/pwd_mkdb -LINK instbin usr/sbin/ztsscale - -# copy the MAKEDEV script and make some devices -SCRIPT ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV -SPECIAL cd dev; sh MAKEDEV ramdisk - -# various files that we need in /etc for the install -COPY ${DESTDIR}/etc/group etc/group -COPY ${CURDIR}/../../miniroot/master.passwd etc/master.passwd -SPECIAL pwd_mkdb -p -d etc master.passwd; rm etc/master.passwd -COPY ${DESTDIR}/etc/signify/openbsd-${REV}-base.pub etc/signify/openbsd-${REV}-base.pub -COPY ${CURDIR}/../../miniroot/protocols etc/protocols -COPY ${CURDIR}/../../miniroot/services etc/services -SYMLINK /tmp/fstab.shadow etc/fstab -SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf -SYMLINK /tmp/hosts etc/hosts -TERMCAP vt100,vt220,dumb usr/share/misc/termcap - -# and the installation tools -SCRIPT ${CURDIR}/../../miniroot/dot.profile .profile -SCRIPT ${CURDIR}/install.md install.md -SCRIPT ${CURDIR}/../../miniroot/install.sub install.sub -SPECIAL chmod 755 install.sub -SYMLINK install.sub autoinstall -SYMLINK install.sub install -SYMLINK install.sub upgrade - -TZ diff --git a/etc/Makefile b/etc/Makefile index 8b38d20b049..edd13915bad 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.429 2016/09/03 11:58:32 pirofti Exp $ +# $OpenBSD: Makefile,v 1.430 2016/09/03 13:37:40 guenther Exp $ TZDIR= /usr/share/zoneinfo LOCALTIME= Canada/Mountain @@ -264,7 +264,7 @@ distrib: SUBDIR+= etc.alpha etc.amd64 etc.armv7 SUBDIR+= etc.hppa etc.i386 etc.landisk etc.loongson etc.luna88k SUBDIR+= etc.macppc etc.octeon -SUBDIR+= etc.sgi etc.socppc etc.sparc64 etc.zaurus +SUBDIR+= etc.sgi etc.socppc etc.sparc64 .include <bsd.subdir.mk> .include <bsd.prog.mk> diff --git a/etc/etc.zaurus/MAKEDEV b/etc/etc.zaurus/MAKEDEV deleted file mode 100644 index 42f3ee03556..00000000000 --- a/etc/etc.zaurus/MAKEDEV +++ /dev/null @@ -1,499 +0,0 @@ -#!/bin/sh - -# -# THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. -# generated from: -# -# OpenBSD: etc.zaurus/MAKEDEV.md,v 1.44 2016/09/02 17:06:14 goda Exp -# OpenBSD: MAKEDEV.common,v 1.90 2016/09/02 17:06:13 goda Exp -# OpenBSD: MAKEDEV.mi,v 1.82 2016/03/12 17:58:59 espie Exp -# OpenBSD: MAKEDEV.sub,v 1.14 2005/02/07 06:14:18 david Exp -# -# -# Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> -# -# Permission to use, copy, modify, and distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, 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. -# -# Device "make" file. Valid arguments: -# all makes all known devices, including local devices. -# Tries to make the ``standard'' number of each type. -# ramdisk Ramdisk kernel devices -# std Standard devices -# local Configuration specific devices -# Disks: -# cd* ATAPI and SCSI CD-ROM drives -# ch* SCSI media changers -# rd* "rd" pseudo-disks -# sd* SCSI disks, including flopticals -# vnd* "file" pseudo-disk devices -# wd* "winchester" disk drives (ST506, IDE, ESDI, RLL, ...) -# Tapes: -# st* SCSI tape drives -# Terminal ports: -# tty[0-7][0-9a-f] NS16x50 serial ports -# Pseudo terminals: -# ptm pty master device -# pty* Set of 62 master pseudo terminals -# tty* Set of 62 slave pseudo terminals -# Console ports: -# ttyC-J* wscons display devices -# wscons Minimal wscons devices -# wskbd* wscons keyboards -# wsmouse* wscons mice -# wsmux wscons keyboard/mouse mux devices -# USB devices: -# ttyU* USB serial ports -# uall All USB devices -# ugen* Generic USB devices -# uhid* Generic HID devices -# ulpt* Printer devices -# usb* Bus control devices used by usbd for attach/detach -# Special purpose devices: -# apm Power management device -# audio* Audio devices -# bio ioctl tunnel pseudo-device -# bktr* Video frame grabbers -# bpf Berkeley Packet Filter -# diskmap Disk mapper -# fd fd/* nodes -# fuse Userland Filesystem -# hotplug devices hot plugging -# pf* Packet Filter -# pppx* PPP Multiplexer -# radio* FM tuner devices -# *random In-kernel random data source -# rmidi* Raw MIDI devices -# tun* Network tunnel driver -# tap* Ethernet tunnel driver -# tuner* Tuner devices -# uk* Unknown SCSI devices -# video* Video V4L2 devices -# vscsi* Virtual SCSI controller -# switch* Switch driver -PATH=/sbin:/usr/sbin:/bin:/usr/bin -T=$0 - -# set this to echo for Echo-Only debugging -[ "$eo" ] || eo= - -hex() -{ - case $1 in - [0-9]) echo -n $1;; - 10) echo -n a;; - 11) echo -n b;; - 12) echo -n c;; - 13) echo -n d;; - 14) echo -n e;; - 15) echo -n f;; - esac -} - -alph2d() -{ - local t="$1" - local p="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - local sub=${p%${t}*} - echo ${#sub} -} - -h2d() -{ - local s="$1" - local f=${s%*[0-9a-f]} n=${s#[0-9a-f]*} - - echo $(($(_h2d $f)*16+ $(_h2d $n) )) -} - -_h2d() -{ - case $1 in - [0-9]) echo -n $1;; - a) echo -n 10;; - b) echo -n 11;; - c) echo -n 12;; - d) echo -n 13;; - e) echo -n 14;; - f) echo -n 15;; - esac -} - -unt() -{ - # XXX pdksh can't seem to deal with locally scoped variables - # in ${foo#$bar} expansions - arg="$1" - tmp="${arg#[a-zA-Z]*}" - tmp="${tmp%*[a-zA-Z]}" - while [ "$tmp" != "$arg" ] - do - arg=$tmp - tmp="${arg#[a-zA-Z]*}" - tmp="${tmp%*[a-zA-Z]}" - done - echo $arg -} - -dodisk() -{ - [ "$DEBUG" ] && set -x - n=$(($((${5}*${7:-16}))+${6})) count=0 - [ 0$7 -ne 8 ] && l="i j k l m n o p" - for d in a b c d e f g h $l - do - M $1$2$d b $3 $(($n+$count)) 640 operator - M r$1$2$d c $4 $(($n+$count)) 640 operator - let count=count+1 - done -} - -dodisk2() -{ - n=$(($(($5*${7:-16}))+$6)) - M $1$2a b $3 $n 640 operator - M r$1$2a c $4 $n 640 operator - n=$(($n+2)) - M $1$2c b $3 $n 640 operator - M r$1$2c c $4 $n 640 operator -} - -# M name b/c major minor [mode] [group] -RMlist[0]="rm -f" - -mkl() { - : ${mklist[0]:=";mknod"} - mklist[${#mklist[*]}]=" -m $1 $2 $3 $4 $5" -} - -M() { - RMlist[${#RMlist[*]}]=$1 - mkl ${5-666} $1 $2 $3 $4 - G=${6:-wheel} - [ "$7" ] && { - MKlist[${#MKlist[*]}]="&& chown $7:$G $1" - } || { - case $G in - wheel) - [ ${#whlist[*]} = 0 ] && whlist[0]="&& chgrp wheel" - whlist[${#whlist[*]}]="$1" - ;; - operator) - [ ${#oplist[*]} = 0 ] && oplist[0]="&& chgrp operator" - oplist[${#oplist[*]}]="$1" - ;; - *) - MKlist[${#MKlist[*]}]="&& chgrp $G $1"; - esac - } - return 0 -} - -R() { -[ "$DEBUG" ] && set -x -for i in "$@" -do -U=`unt $i` -[ "$U" ] || U=0 - -case $i in -ramdisk) - R std bpf wd0 wd1 sd0 tty00 rd0 wsmouse - R st0 ttyC0 wskbd0 apm bio diskmap random - ;; - -std) - M console c 0 0 600 - M tty c 1 0 - M mem c 2 0 640 kmem - M kmem c 2 1 640 kmem - M null c 2 2 - M zero c 2 12 - M stdin c 7 0 - M stdout c 7 1 - M stderr c 7 2 - M ksyms c 8 0 640 kmem - M klog c 6 0 600 - ;; - -switch*) - M switch$U c 105 $U 600 - ;; - -vscsi*) - M vscsi$U c 100 $U 600 - ;; - -video*) - M video$U c 38 $U 600 - MKlist[${#MKlist[*]}]=";[ -e video ] || ln -s video$U video" - ;; - -uk*) - M uk$U c 28 $U 640 operator - ;; - -tuner*) - M tuner$U c 75 $(($(($U*2))+16)) 644 - ;; - -tap*) - M tap$U c 104 $U 600 - ;; - -tun*) - M tun$U c 33 $U 600 - ;; - -rmidi*) - M rmidi$U c 57 $U 666 - ;; - -*random) - n=0 - for pre in " " s u a - do - M ${pre}random c 40 $n 644 - n=$(($n+1)) - done - ;; - -radio*) - M radio$U c 97 $U - MKlist[${#MKlist[*]}]=";[ -e radio ] || ln -s radio$U radio" - ;; - -pppx*) - M pppx$U c 103 $U 600 - ;; - -pf*) - M pf c 46 0 600 - ;; - -hotplug) - M hotplug c 37 $U 400 - ;; - -fuse) - M fuse$U c 77 $U 600 - ;; - -fd) - RMlist[${#RMlist[*]}]=";mkdir -p fd;rm -f" n=0 - while [ $n -lt 64 ];do M fd/$n c 7 $n;n=$(($n+1));done - MKlist[${#MKlist[*]}]=";chmod 555 fd" - ;; - -diskmap) - M diskmap c 102 0 640 operator - ;; - -bpf) - M bpf c 22 0 600 - M bpf0 c 22 0 600 - ;; - -bktr*) - M bktr$U c 75 $U 644 - ;; - -bio) - M bio c 52 0 600 - ;; - -audio*) - M sound$U c 36 $U - M mixer$U c 36 $(($U+16)) - M audio$U c 36 $(($U+128)) - M audioctl$U c 36 $(($U+192)) - MKlist[${#MKlist[*]}]=";[ -e audio ] || ln -s audio$U audio" - MKlist[${#MKlist[*]}]=";[ -e mixer ] || ln -s mixer$U mixer" - MKlist[${#MKlist[*]}]=";[ -e sound ] || ln -s sound$U sound" - MKlist[${#MKlist[*]}]=";[ -e audioctl ] || ln -s audioctl$U audioctl" - ;; - -apm*) - M apm c 34 0 644 - M apmctl c 34 8 644 - ;; - -usb*) - [ "$i" = "usb" ] && u= || u=$U - M usb$u c 64 $U 660 - ;; - -ulpt*) - M ulpt$U c 66 $U 660 - ;; - -uhid*) - M uhid$U c 65 $U 660 - ;; - -ugen*) - n=$(($U*16)) - for j in 0{0,1,2,3,4,5,6,7,8,9} 1{0,1,2,3,4,5} - do - M ugen$U.$j c 70 $(($n+10#$j)) 660 - done - ;; - -uall) - R ttyU0 ttyU1 ttyU2 ttyU3 ugen0 ugen1 ugen2 ugen3 ugen4 ugen5 - R ugen6 ugen7 ulpt0 ulpt1 uhid0 uhid1 uhid2 uhid3 usb0 usb1 - R usb2 usb3 usb4 usb5 usb6 usb7 - ;; - -ttyU[0-9a-zA-Z]) - U=${i#ttyU*} - o=$(alph2d $U) - M ttyU$U c 68 $o 660 dialer uucp - M cuaU$U c 68 $(($o+128)) 660 dialer uucp - ;; - -wsmux|wsmouse|wskbd) - M wsmouse c 63 0 600 - M wskbd c 63 1 600 - ;; - -wsmouse[0-9]*) - M wsmouse$U c 62 $U 600 - ;; - -wskbd[0-9]*) - M wskbd$U c 61 $U 600 - ;; - -wscons) - R wsmouse0 wsmouse1 wsmouse2 wsmouse3 wskbd0 wskbd1 wskbd2 - R wskbd3 wsmux ttyCcfg ttyC0 ttyC1 ttyC2 ttyC3 ttyC4 ttyC5 - R ttyC6 ttyC7 ttyC8 ttyC9 ttyCa ttyCb - ;; - -tty[C-J]*) - U=${i##tty[C-J]} - case $i in - ttyC*) n=C m=0;; - ttyD*) n=D m=256;; - ttyE*) n=E m=512;; - ttyF*) n=F m=768;; - ttyG*) n=G m=1024;; - ttyH*) n=H m=1280;; - ttyI*) n=I m=1536;; - ttyJ*) n=J m=1792;; - esac - case $U in - [0-9a-f]) M tty$n$U c 60 $((16#$U+$m)) 600;; - cfg) M tty${n}cfg c 60 $((255+$m)) 600;; - *) echo bad unit $U for $i; exit 1;; - esac - ;; - -pty*) - if [ $U -gt 15 ]; then - echo bad unit for pty in: $i - continue - fi - set -A letters p q r s t u v w x y z P Q R S T - set -A suffixes 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q \ - r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X \ - Y Z - - name=${letters[$U]} - n=0 - while [ $n -lt 62 ] - do - nam=$name${suffixes[$n]} - off=$(($U*62)) - M tty$nam c 4 $(($off+$n)) - M pty$nam c 5 $(($off+$n)) - n=$(($n+1)) - done - ;; - -ptm) - M ptm c 98 0 666 - ;; - -tty[0-7][0-9a-f]) - U=${i#tty*} - o=$(h2d $U) - M tty$U c 12 $o 660 dialer uucp - M cua$U c 12 $(($o+128)) 660 dialer uucp - ;; - -st*) - n=$(($U*16)) - for pre in " " n e en - do - M ${pre}st$U b 25 $n 660 operator - M ${pre}rst$U c 25 $n 660 operator - n=$(($n+1)) - done - ;; - -vnd*) - dodisk vnd $U 19 19 $U 0 - ;; - -rd*) - dodisk2 rd $U 18 18 $U 0 - ;; - -ch*) - M ch$U c 27 $U 660 operator - ;; - -cd*) - dodisk2 cd $U 26 26 $U 0 - ;; - -local) - test -s $T.local && sh $T.local - ;; - -all) - R switch0 switch1 switch2 switch3 vnd0 vnd1 vnd2 vnd3 sd0 sd1 - R sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 cd0 cd1 rd0 tap0 tap1 tap2 - R tap3 tun0 tun1 tun2 tun3 pty0 bio diskmap vscsi0 ch0 audio0 - R audio1 audio2 bpf fuse pppx hotplug ptm local wscons uall - R rmidi0 rmidi1 rmidi2 rmidi3 rmidi4 rmidi5 rmidi6 rmidi7 - R tuner0 radio0 video0 video1 uk0 random tty00 tty01 tty02 - R tty03 tty04 tty05 tty06 tty07 tty08 tty09 tty0a tty0b apm pf - R wd0 wd1 wd2 wd3 std st0 st1 fd - ;; - -wd*|sd*) - case $i in - wd*) dodisk wd $U 16 16 $U 0;; - sd*) dodisk sd $U 24 24 $U 0;; - esac - ;; - -*) - echo $i: unknown device - ;; -esac -done -} -R "$@" -{ -echo -n ${RMlist[*]} -echo -n ${mklist[*]} -echo -n ${MKlist[*]} -echo -n ${whlist[*]} -echo ${oplist[*]} -} | if [ "$eo" = "echo" ]; then - cat -else - sh -fi diff --git a/etc/etc.zaurus/MAKEDEV.md b/etc/etc.zaurus/MAKEDEV.md deleted file mode 100644 index 78470387b07..00000000000 --- a/etc/etc.zaurus/MAKEDEV.md +++ /dev/null @@ -1,116 +0,0 @@ -define(MACHINE,zaurus)dnl -vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.44 2016/09/02 17:06:14 goda Exp $-}, -etc.MACHINE)dnl -dnl -dnl Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> -dnl All rights reserved. -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl 1. Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl 2. The name of the author may not be used to endorse or promote products -dnl derived from this software without specific prior written permission. -dnl -dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -dnl AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -dnl THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -dnl OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -dnl ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -dnl -dnl -__devitem(apm, apm, Power management device)dnl -_TITLE(make) -_DEV(all) -_DEV(ramdisk) -_DEV(std) -_DEV(local) -_TITLE(dis) -_DEV(cd, 26, 26) -_DEV(ch, 27) -_DEV(rd, 18, 18) -_DEV(sd, 24, 24) -_DEV(vnd, 19, 19) -_DEV(wd, 16, 16) -_TITLE(tap) -_DEV(st, 25, 25) -_TITLE(term) -dnl _DEV(com, 12) -dnl _DEV(fcom, 54) -_DEV(com, 12) -_TITLE(pty) -_DEV(ptm, 98) -_DEV(pty, 5) -_DEV(tty, 4) -_TITLE(cons) -_DEV(wsdisp, 60) -_DEV(wscons) -_DEV(wskbd, 61) -_DEV(wsmouse, 62) -_DEV(wsmux, 63) -_TITLE(usb) -_DEV(ttyU, 68) -_DEV(uall) -_DEV(ugen, 70) -_DEV(uhid, 65) -_DEV(ulpt, 66) -_DEV(usb, 64) -_TITLE(spec) -_DEV(apm, 34) -_DEV(au, 36) -_DEV(bio, 52) -_DEV(bktr, 75) -_DEV(bpf, 22) -_DEV(diskmap, 102) -_DEV(fdesc, 7) -_DEV(fuse, 77) -_DEV(hotplug, 37) -_DEV(pf, 46) -_DEV(pppx, 103) -_DEV(radio, 97) -_DEV(rnd, 40) -_DEV(rmidi, 57) -_DEV(tun, 33) -_DEV(tap, 104) -_DEV(tuner, 75) -_DEV(uk, 28) -_DEV(vi, 38) -_DEV(vscsi, 100) -_DEV(switch, 105) -dnl -divert(__mddivert)dnl -dnl -ramdisk) - _recurse std bpf wd0 wd1 sd0 tty00 rd0 wsmouse - _recurse st0 ttyC0 wskbd0 apm bio diskmap random - ;; - -_std(1, 2, 8, 6) - ;; -dnl -dnl *** zaurus specific targets -dnl -twrget(all, au, audio, 0, 1, 2)dnl -target(all, ch, 0)dnl -target(all, vscsi, 0)dnl -target(all, diskmap)dnl -target(all, bio)dnl -twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl -twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl -target(all, pty, 0)dnl -target(all, tun, 0, 1, 2, 3)dnl -target(all, tap, 0, 1, 2, 3)dnl -target(all, xy, 0, 1, 2, 3)dnl -target(all, rd, 0)dnl -target(all, cd, 0, 1)dnl -target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl -target(all, vnd, 0, 1, 2, 3)dnl -target(all, switch, 0, 1, 2, 3)dnl -target(all, ttyC, 0, 1)dnl diff --git a/etc/etc.zaurus/Makefile b/etc/etc.zaurus/Makefile deleted file mode 100644 index 324bc9769a7..00000000000 --- a/etc/etc.zaurus/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2008/06/15 01:51:56 todd Exp $ - -all: MAKEDEV - -.include <bsd.prog.mk> diff --git a/etc/etc.zaurus/Makefile.inc b/etc/etc.zaurus/Makefile.inc deleted file mode 100644 index 755dea35f2e..00000000000 --- a/etc/etc.zaurus/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.11 2011/07/22 09:30:54 espie Exp $ - -bootblocks: - cp ${DESTDIR}/usr/mdec/zboot ${RELEASEDIR} - cp ${DESTDIR}/usr/mdec/zbsdmod.o ${RELEASEDIR} - -MDEXT= bsd.rd zboot zbsdmod.o openbsd${OSrev}_arm.ipk Packages diff --git a/etc/etc.zaurus/disktab b/etc/etc.zaurus/disktab deleted file mode 100644 index a892dfbdb99..00000000000 --- a/etc/etc.zaurus/disktab +++ /dev/null @@ -1,26 +0,0 @@ -# $OpenBSD: disktab,v 1.5 2015/08/14 23:45:56 krw Exp $ - -# Leave nc=16; adjust size using: ns -rdroot|ramdiskroot|RAM-disk root FS image:\ - :dt=rdroot:se#512:nc#16:nt#2:ns#256:\ - :ta=4.2BSD:oa#0:pa#8192:fa#512:ba#4096:\ - :ob#0:pb#0:oc#0:pc#8192: - - -rdroot2.5M|ramdiskroot2.5M|RAM-disk root FS image:\ - :dt=rdroot:se#512:nc#16:nt#2:ns#160:\ - :oa#0:pa#5120:ta=4.2BSD:fa#512:ba#4096:\ - :ob#0:pb#0:tb=swap:\ - :oc#0:pc#5120: - -# pseudo-geometry taken from rd794 -miniroot:\ - :dt=rdroot:ns#16:nt#7:nc#968:\ - :pa#10240:ba#8192:fa#1024: - -floppy|floppy3|3in|3.5in High Density Floppy:\ - :dt=floppy:se#512:nt#2:ns#18:nc#80:\ - :pa#2880:oa#0:ba#4096:fa#512:\ - :pb#2880:ob#0:\ - :pc#2880:oc#0: - diff --git a/etc/etc.zaurus/fbtab b/etc/etc.zaurus/fbtab deleted file mode 100644 index d898c1cbe53..00000000000 --- a/etc/etc.zaurus/fbtab +++ /dev/null @@ -1,2 +0,0 @@ -/dev/tty00 0600 /dev/console -/dev/ttyC0 0600 /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg diff --git a/etc/etc.zaurus/login.conf b/etc/etc.zaurus/login.conf deleted file mode 100644 index 0f98caebb32..00000000000 --- a/etc/etc.zaurus/login.conf +++ /dev/null @@ -1,107 +0,0 @@ -# $OpenBSD: login.conf,v 1.5 2015/10/23 22:55:50 sthen Exp $ - -# -# Sample login.conf file. See login.conf(5) for details. -# - -# -# Standard authentication styles: -# -# passwd Use only the local password file -# chpass Do not authenticate, but change users password (change -# the YP password if the user has one, else change the -# local password) -# lchpass Do not login; change user's local password instead -# radius Use radius authentication -# reject Use rejected authentication -# skey Use S/Key authentication -# activ ActivCard X9.9 token authentication -# crypto CRYPTOCard X9.9 token authentication -# snk Digital Pathways SecureNet Key authentication -# tis TIS Firewall Toolkit authentication -# token Generic X9.9 token authentication -# yubikey YubiKey authentication -# - -# Default allowed authentication styles -auth-defaults:auth=passwd,skey: - -# Default allowed authentication styles for authentication type ftp -auth-ftp-defaults:auth-ftp=passwd: - -# -# The default values -# To alter the default authentication types change the line: -# :tc=auth-defaults:\ -# to be read something like: (enables passwd, "myauth", and activ) -# :auth=passwd,myauth,activ:\ -# Any value changed in the daemon class should be reset in default -# class. -# -default:\ - :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\ - :umask=022:\ - :datasize-max=512M:\ - :datasize-cur=512M:\ - :maxproc-max=256:\ - :maxproc-cur=128:\ - :openfiles-cur=512:\ - :stacksize-cur=4M:\ - :localcipher=blowfish,8:\ - :tc=auth-defaults:\ - :tc=auth-ftp-defaults: - -# -# Settings used by /etc/rc and root -# This must be set properly for daemons started as root by inetd as well. -# Be sure reset these values back to system defaults in the default class! -# -daemon:\ - :ignorenologin:\ - :datasize=infinity:\ - :maxproc=infinity:\ - :openfiles-cur=128:\ - :stacksize-cur=8M:\ - :localcipher=blowfish,9:\ - :tc=default: - -# -# Staff have fewer restrictions and can login even when nologins are set. -# -staff:\ - :datasize-cur=512M:\ - :datasize-max=infinity:\ - :maxproc-max=512:\ - :maxproc-cur=128:\ - :ignorenologin:\ - :requirehome@:\ - :tc=default: - -# -# Authpf accounts get a special motd and shell -# -authpf:\ - :welcome=/etc/motd.authpf:\ - :shell=/usr/sbin/authpf:\ - :tc=default: - -# -# Building ports with DPB uses raised limits -# -pbuild:\ - :datasize-max=infinity:\ - :datasize-cur=1024M:\ - :maxproc-max=1024:\ - :maxproc-cur=256:\ - :tc=default: - -# -# Override resource limits for certain daemons started by rc.d(8) -# -bgpd:\ - :openfiles-cur=512:\ - :tc=daemon: - -unbound:\ - :openfiles-cur=512:\ - :tc=daemon: diff --git a/etc/etc.zaurus/sysctl.conf b/etc/etc.zaurus/sysctl.conf deleted file mode 100644 index c311d345a12..00000000000 --- a/etc/etc.zaurus/sysctl.conf +++ /dev/null @@ -1,3 +0,0 @@ -#machdep.maxspeed=520 # set change maximum processor speed -#machdep.lidsuspend=0 # do not suspend laptop upon lid closing -#hw.setperf=0 # 0=slowest speed, 100=fastest speed diff --git a/etc/etc.zaurus/ttys b/etc/etc.zaurus/ttys deleted file mode 100644 index d06bc2026e9..00000000000 --- a/etc/etc.zaurus/ttys +++ /dev/null @@ -1,16 +0,0 @@ -# -# $OpenBSD: ttys,v 1.4 2008/01/09 17:39:42 miod Exp $ -# -# name getty type status comments -# -console "/usr/libexec/getty std.9600" vt220 off secure -ttyC0 "/usr/libexec/getty std.9600" vt220 on secure -ttyC1 "/usr/libexec/getty std.9600" vt220 off secure -tty00 "/usr/libexec/getty std.9600" unknown off secure -tty01 "/usr/libexec/getty std.9600" unknown off secure -tty02 "/usr/libexec/getty std.9600" unknown off -tty03 "/usr/libexec/getty std.9600" unknown off -tty04 "/usr/libexec/getty std.9600" unknown off -tty05 "/usr/libexec/getty std.9600" unknown off -tty06 "/usr/libexec/getty std.9600" unknown off -tty07 "/usr/libexec/getty std.9600" unknown off diff --git a/etc/mtree/4.4BSD.dist b/etc/mtree/4.4BSD.dist index 7b63aee311d..cb0cc132d9e 100644 --- a/etc/mtree/4.4BSD.dist +++ b/etc/mtree/4.4BSD.dist @@ -1,4 +1,4 @@ -# $OpenBSD: 4.4BSD.dist,v 1.285 2016/09/01 09:54:17 deraadt Exp $ +# $OpenBSD: 4.4BSD.dist,v 1.286 2016/09/03 13:37:41 guenther Exp $ /set type=dir uname=root gname=wheel mode=0755 @@ -473,9 +473,9 @@ usr .. amd64 .. - i386 + armv7 .. - zaurus + i386 .. .. @@ -519,8 +519,6 @@ usr .. sparc64 .. - zaurus - .. .. # ./usr/share/man/man5 @@ -537,8 +535,6 @@ usr .. socppc .. - zaurus - .. .. # ./usr/share/man/man6 @@ -575,8 +571,6 @@ usr .. sparc64 .. - zaurus - .. .. # ./usr/share/man/man9 diff --git a/lib/libarch/arm/Makefile b/lib/libarch/arm/Makefile index 9424cd2fbb6..256ebba755d 100644 --- a/lib/libarch/arm/Makefile +++ b/lib/libarch/arm/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.7 2016/08/10 14:27:16 deraadt Exp $ +# $OpenBSD: Makefile,v 1.8 2016/09/03 13:37:41 guenther Exp $ MAN+= arm_sync_icache.2 arm_drain_writebuf.2 -MANSUBDIR=zaurus +MANSUBDIR=armv7 .if ${MACHINE_ARCH} == "arm" NOPIC= diff --git a/regress/etc/MAKEDEV/Makefile b/regress/etc/MAKEDEV/Makefile index 9764131c6d2..fa33eb0cd68 100644 --- a/regress/etc/MAKEDEV/Makefile +++ b/regress/etc/MAKEDEV/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.34 2016/09/01 10:13:05 tedu Exp $ +# $OpenBSD: Makefile,v 1.35 2016/09/03 13:37:41 guenther Exp $ MAKEDEVARCHS+=alpha amd64 armv7 hppa i386 landisk MAKEDEVARCHS+=loongson luna88k macppc -MAKEDEVARCHS+=sgi socppc sparc64 zaurus +MAKEDEVARCHS+=sgi socppc sparc64 MAKEDEVTARGS?=all ramdisk diff --git a/regress/usr.bin/mdoclint/mdoclint b/regress/usr.bin/mdoclint/mdoclint index c97fed392a3..a648524c35b 100644 --- a/regress/usr.bin/mdoclint/mdoclint +++ b/regress/usr.bin/mdoclint/mdoclint @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $OpenBSD: mdoclint,v 1.52 2016/09/01 10:55:27 jmc Exp $ +# $OpenBSD: mdoclint,v 1.53 2016/09/03 13:37:41 guenther Exp $ # $NetBSD: mdoclint,v 1.49 2014/06/23 18:10:21 wiz Exp $ # # Copyright (c) 2001-2013 Thomas Klausner @@ -199,7 +199,7 @@ my $valid_date_re; @arches = (qw(alpha amd64 armv7 hppa i386 landisk loongson luna88k macppc mips64 octeon sgi - socppc sparc64 zaurus)); + socppc sparc64)); } if (NETBSD) { @arches = diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 6aa369f6ba6..922181d778d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.637 2016/09/01 10:04:51 jcs Exp $ +# $OpenBSD: Makefile,v 1.638 2016/09/03 13:37:41 guenther Exp $ MAN= aac.4 ac97.4 acphy.4 \ acpi.4 acpiac.4 acpials.4 acpiasus.4 acpibat.4 \ @@ -67,7 +67,7 @@ MAN= aac.4 ac97.4 acphy.4 \ ukphy.4 ulpt.4 umass.4 umb.4 umbg.4 umcs.4 umct.4 umidi.4 umodem.4 \ ums.4 umsm.4 unix.4 uonerng.4 uow.4 uoaklux.4 uoakrh.4 uoakv.4 upd.4 \ upgt.4 upl.4 uplcom.4 ural.4 ure.4 url.4 urlphy.4 \ - urndis.4 urtw.4 urtwn.4 usb.4 usbf.4 uscom.4 uslcom.4 usps.4 \ + urndis.4 urtw.4 urtwn.4 usb.4 uscom.4 uslcom.4 usps.4 \ uthum.4 uticom.4 utpms.4 utwitch.4 utrh.4 uts.4 utvfu.4 uvideo.4 \ uvisor.4 uvscom.4 \ vether.4 vga.4 vgafb.4 vge.4 \ @@ -83,7 +83,7 @@ MAN= aac.4 ac97.4 acphy.4 \ SUBDIR= man4.alpha man4.amd64 man4.armv7 \ man4.hppa man4.i386 man4.landisk man4.loongson man4.luna88k \ man4.macppc man4.octeon \ - man4.sgi man4.socppc man4.sparc64 man4.zaurus + man4.sgi man4.socppc man4.sparc64 CLEANFILES+= wi.4 diff --git a/share/man/man4/cdce.4 b/share/man/man4/cdce.4 index 77bec8b4ce6..8b00fe3099e 100644 --- a/share/man/man4/cdce.4 +++ b/share/man/man4/cdce.4 @@ -25,9 +25,9 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: cdce.4,v 1.20 2015/11/04 09:20:01 stsp Exp $ +.\" $OpenBSD: cdce.4,v 1.21 2016/09/03 13:37:41 guenther Exp $ .\" -.Dd $Mdocdate: November 4 2015 $ +.Dd $Mdocdate: September 3 2016 $ .Dt CDCE 4 .Os .Sh NAME @@ -62,8 +62,6 @@ NetChip EthernetGadget .It Prolific PL-2501 .It -Sharp Zaurus -.It Sony Ericsson K610i .It Sony Ericsson F3705g diff --git a/share/man/man4/com.4 b/share/man/man4/com.4 index 7662bc9a2a4..2d0fd6ca887 100644 --- a/share/man/man4/com.4 +++ b/share/man/man4/com.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: com.4,v 1.38 2016/09/01 12:24:56 jmc Exp $ +.\" $OpenBSD: com.4,v 1.39 2016/09/03 13:37:41 guenther Exp $ .\" $NetBSD: com.4,v 1.5 1996/03/16 00:07:08 thorpej Exp $ .\" .\" Copyright (c) 1990, 1991 The Regents of the University of California. @@ -33,7 +33,7 @@ .\" .\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91 .\" -.Dd $Mdocdate: September 1 2016 $ +.Dd $Mdocdate: September 3 2016 $ .Dt COM 4 .Os .Sh NAME @@ -93,12 +93,6 @@ .Cd "com* at asio?" .Cd "com* at ebus?" .Cd "com* at puc?" -.Pp -.Cd "# zaurus" -.Cd "com0 at pxaip? addr 0x40100000 intr 22 " Pq "full function UART" -.Cd "com1 at pxaip? addr 0x40200000 intr 21 " Pq "bluetooth UART" -.Cd "com2 at pxaip? addr 0x40700000 intr 20 " Pq "slow infrared UART" -.Cd "com* at pcmcia?" .Sh DESCRIPTION The .Nm com diff --git a/share/man/man4/man4.zaurus/Makefile b/share/man/man4/man4.zaurus/Makefile deleted file mode 100644 index c052dc1fd8b..00000000000 --- a/share/man/man4/man4.zaurus/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $OpenBSD: Makefile,v 1.12 2016/03/30 06:38:44 jmc Exp $ - -# TODO: aupxa(eventually) cpu -MAN= apm.4 autoconf.4 intro.4 lcd.4 mem.4 pxadmac.4 \ - pxagpio.4 pxaintc.4 pxaip.4 pxammc.4 pxaost.4 pxapcic.4 \ - pxaudc.4 scoop.4 zaudio.4 zkbd.4 zrc.4 zssp.4 zts.4 - -MANSUBDIR=zaurus - -.include <bsd.prog.mk> diff --git a/share/man/man4/man4.zaurus/apm.4 b/share/man/man4/man4.zaurus/apm.4 deleted file mode 100644 index 0175662f471..00000000000 --- a/share/man/man4/man4.zaurus/apm.4 +++ /dev/null @@ -1,251 +0,0 @@ -.\" $OpenBSD: apm.4,v 1.15 2016/02/27 20:57:32 natano Exp $ -.\" -.\" Copyright (c) 1998 Marco S. Hyman -.\" -.\" Permission to copy all or part of this material for any purpose is -.\" granted provided that the above copyright notice and this paragraph -.\" are duplicated in all copies. THIS SOFTWARE IS PROVIDED ``AS IS'' -.\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT -.\" LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -.\" FOR A PARTICULAR PURPOSE. -.\" -.Dd $Mdocdate: February 27 2016 $ -.Dt APM 4 zaurus -.Os -.Sh NAME -.Nm apm -.Nd advanced power management device interface -.Sh SYNOPSIS -.Cd "apm0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver provides an interface which simulates the Advanced Power Management -.Pq APM -BIOS functions. -The BIOS functions are translated into the appropriate Power Manager requests. -Currently only battery level, AC connection, and charging status is available -from the -.Nm -device, and no distinction is made between standby and suspend requests. -Other power events are -.Em NOT YET SUPPORTED . -.Pp -Configuration options: -.Pp -.Bl -tag -width DIAGNOSTIC -compact -offset indent -.It Dv APMDEBUG -Enable various driver status messages. -.It Dv DIAGNOSTIC -Enable debugging messages. -.It Dv DEBUG -Enable other debugging messages. -.El -.Pp -The -.Nm -driver implements the following -.Xr ioctl 2 -calls. -They are defined in -.In machine/apmvar.h . -.Bl -tag -width Ds -.It Dv APM_IOC_REJECT -.Pq Li "struct apm_event_info" -.Em Not implemented . -.Em DO NOT USE . -.It Dv APM_IOC_STANDBY -.Pq Li "no parameters" -Request -.Dq standby -mode. -.It Dv APM_IOC_SUSPEND -.Pq Li "no parameters" -Request -.Dq suspend -mode. -.\" .It Dv APM_IOC_HIBERNATE -.\" .Em NOT YET SUPPORTED on zaurus -.\" .Pq Li "no parameters" -.\" Request -.\" .Dq hibernate -.\" mode. -.It Dv APM_IOC_GETPOWER -.Pq Li "struct apm_power_info" -Request the current power state. -The argument structure is as follows: -.Bd -literal -offset indent -struct apm_power_info { - u_char battery_state; - u_char ac_state; - u_char battery_life; - u_char spare1; - u_int minutes_left; - u_int spare2[6]; -}; -.Ed -.Pp -The following values are defined for -.Va battery_state : -.Bl -tag -width Ds -.It Dv APM_BATT_HIGH -Battery has a high state of charge. -.It Dv APM_BATT_LOW -Battery has a low state of charge. -.It Dv APM_BATT_CRITICAL -Battery has a critical state of charge. -.It Dv APM_BATT_CHARGING -Battery is not high, low, or critical and is currently charging. -.It Dv APM_BATT_UNKNOWN -Cannot read the current battery state. -.It Dv APM_BATTERY_ABSENT -No battery installed. -.El -.Pp -The following values are defined for -.Va ac_state : -.Bl -tag -width Ds -.It Dv APM_AC_OFF -External power not detected. -.It Dv APM_AC_ON -External power detected. -.It Dv APM_AC_BACKUP -Backup power in use. -.It Dv APM_AC_UNKNOWN -External power state unknown. -.El -.Pp -The -.Va battery_life -value contains the estimated percentage of battery life available. -100% indicates a full charge. -.Pp -The -.Va minutes_left -value contains the estimated number of minutes of battery life -remaining. -If no time estimate is available, the -.Va minutes_left -value is 0. -.It Dv APM_IOC_NEXTEVENT -.Em NOT YET SUPPORTED on zaurus -.Pq Li "struct apm_event_info" -The APM driver stores up to -.Dv APM_NEVENTS -events. -This was defined as 16 at the time this documentation was written. -If the event list is full when a new event is detected the new event is lost. -.Dv APM_IOC_NEXTEVENT -ioctl returns the next event on the list or -.Er EAGAIN -if the event list is empty. -The format of the returned event is: -.Bd -literal -offset indent -struct apm_event_info { - u_int type; - u_int index; - u_int spare[8]; -}; -.Ed -where -.Va index -is a sequential count of events that can be used to check if any -events were lost and -.Va type -is one of: -.Pp -.Bl -tag -width Ds -offset indent -compact -.It Dv APM_STANDBY_REQ -.It Dv APM_SUSPEND_REQ -.It Dv APM_NORMAL_RESUME -.It Dv APM_CRIT_RESUME -.It Dv APM_BATTERY_LOW -.It Dv APM_POWER_CHANGE -.It Dv APM_UPDATE_TIME -.It Dv APM_CRIT_SUSPEND_REQ -.It Dv APM_USER_STANDBY_REQ -.It Dv APM_USER_SUSPEND_REQ -.It Dv APM_SYS_STANDBY_RESUME -.El -.It Dv APM_IOC_DEV_CTL -.Em NOT YET SUPPORTED on zaurus -.Pq Li "struct apm_ctl" -Allows an application to directly set the -APM operating mode. -The argument structure is as follows: -.Bd -literal -offset indent -struct apm_ctl { - u_int dev; - u_int mode; -}; -.Ed -.Pp -.Va dev -indicates the device, typically -.Dv APM_DEV_ALLDEVS . -.Pp -.Va mode -indicates the desired operating mode. -Possible values are -.Bl -tag -width Ds -compact -offset indent -.It Dv APM_SYS_READY -.It Dv APM_SYS_STANDBY -.It Dv APM_SYS_SUSPEND -.It Dv APM_SYS_OFF -.It Dv APM_LASTREQ_INPROG -.It Dv APM_LASTREQ_REJECTED -.El -.It Dv APM_IOC_PRN_CTL -.Pq Li "int" -This -.Xr ioctl 2 -controls message output by the APM -driver when a power change event is detected. -The integer parameter is one of: -.Bl -tag -width Ds -.It Dv APM_PRINT_ON -All power change events result in a message. -This is the normal operating mode for the driver. -.It Dv APM_PRINT_OFF -Power change event messages are suppressed. -.It Dv APM_PRINT_PCT -Power change event messages are suppressed unless the estimated -battery life percentage changes. -.El -.Pp -However, in no case will power status messages be displayed until the -battery life goes below the percentage in the -.Xr sysctl 8 -state variable -.Dv machdep.apmwarn . -Setting -.Dv machdep.apmwarn -to zero disables all warnings regardless of the -.Dv APM_IOC_PRN_CTL -setting. -.El -.Sh FILES -.Bl -tag -width "/dev/apmctlXXX" -.It /dev/apm -Power management data device. -May only be opened read-only. -May be opened by multiple concurrent users. -.It /dev/apmctl -Power management control device. -May be opened read-write or write-only. -May only be opened by one user at a time. -An attempt to open the file when in use will fail, returning -.Er EBUSY . -.El -.Sh SEE ALSO -.Xr intro 4 , -.Xr sysctl.conf 5 , -.Xr apm 8 , -.Xr apmd 8 , -.Xr halt 8 , -.Xr sysctl 8 -.Sh BUGS -Power events are not supported. -.Pp -Reported battery life remaining and minutes left can be off by 25% -or more, and are generally overestimated while the battery is charging. diff --git a/share/man/man4/man4.zaurus/autoconf.4 b/share/man/man4/man4.zaurus/autoconf.4 deleted file mode 100644 index 611d37b6608..00000000000 --- a/share/man/man4/man4.zaurus/autoconf.4 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $OpenBSD: autoconf.4,v 1.3 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 1994 Christopher G. Demetriou -.\" 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 Christopher G. Demetriou. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt AUTOCONF 4 zaurus -.Os -.Sh NAME -.Nm autoconf -.Nd diagnostics from the autoconfiguration code -.Sh DESCRIPTION -When -.Ox -bootstraps it probes the innards of the machine -on which it is running -and locates controllers, mass storage, and other devices, printing out -what it finds on the console. -This procedure is driven by a system configuration table which is processed by -.Xr config 8 -and compiled into each kernel. -Devices which exist in the machine but are not configured into the -kernel are usually not detected. -.Sh SEE ALSO -.Xr intro 4 , -.Xr boot_zaurus 8 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/intro.4 b/share/man/man4/man4.zaurus/intro.4 deleted file mode 100644 index ac8d2850f82..00000000000 --- a/share/man/man4/man4.zaurus/intro.4 +++ /dev/null @@ -1,162 +0,0 @@ -.\" $OpenBSD: intro.4,v 1.17 2014/09/19 12:24:38 schwarze Exp $ -.\" -.\" Copyright (c) 1983, 1986, 1991 Regents of the University of California. -.\" 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. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. -.\" -.Dd $Mdocdate: September 19 2014 $ -.Dt INTRO 4 zaurus -.Os -.Sh NAME -.Nm intro -.Nd introduction to special files and hardware support -.Sh DESCRIPTION -The manual pages in section 4 describe the special files, -related driver functions, and networking support -available in the system. -In this part of the manual, the SYNOPSIS section of -each configurable device gives a sample specification -for use in constructing a system description for the -.Xr config 8 -program. -The DIAGNOSTICS section lists messages which may appear on the console -and/or in the system error log -.Pa /var/log/messages -due to errors in device operation; -see -.Xr syslogd 8 -for more information. -.Pp -This section contains both devices -which may be configured into the system -and network related information. -The networking support is introduced in -.Xr netintro 4 . -.Sh DEVICE SUPPORT -This section describes the hardware supported on the zaurus platform. -Software support for these devices comes in two forms. -A hardware device may be supported with a character or block -.Em device driver , -or it may be used within the networking subsystem and have a -.Em network interface driver . -Block and character devices are accessed through files in the file -system of a special type; see -.Xr mknod 8 . -Network interfaces are indirectly accessed through the interprocess -communication facilities provided by the system; see -.Xr socket 2 . -.Pp -A hardware device is identified to the system at configuration time -and the appropriate device or network interface driver is then compiled -into the system. -When the resultant system is booted, the autoconfiguration facilities -in the system probe for the device and, if found, enable the software -support for it. -If a device does not respond at autoconfiguration -time it is not accessible at any time afterwards. -To enable a device which did not autoconfigure, -the system will have to be rebooted. -.Pp -The autoconfiguration system is described in -.Xr autoconf 4 . -A list of the supported devices is given below. -.Sh LIST OF DEVICES -The devices listed below are supported in this incarnation of -the system. -Pseudo-devices are not listed. -.\" Devices are indicated by their functional interface. -Not all supported devices are listed. -.Pp -.Bl -tag -width lotsofletters -compact -offset indent -.It Xr apm 4 -advanced power management device interface -.It Xr cd 4 -ATAPI and SCSI CD-ROM driver -.It Xr com 4 -serial communications interface -.\" cpu -.It Xr lcd 4 -Zaurus LCD display -.It Xr pxadmac 4 -PXA2x0 DMA controller -.It Xr pxagpio 4 -PXA2x0 GPIO interface -.It Xr pxaintc 4 -PXA2x0 interrupt controller -.It Xr pxaip 4 -PXA2x0 Integrated Peripheral Bus -.It Xr pxammc 4 -MMC/SD/SDIO controller -.It Xr pxaost 4 -PXA2x0 OS timer -.It Xr pxapcic 4 -PXA2x0 PCMCIA interface -.It Xr pxaudc 4 -PXA27x USB device controller -.It Xr scoop 4 -Compact Flash and GPIO controller -.It Xr sd 4 -SCSI disk driver -.It Xr wd 4 -WD100x compatible hard disk driver -.It Xr wdc 4 -WD100x compatible hard disk controller driver -.It Xr zaudio 4 -Zaurus audio device -.It Xr zkbd 4 -Zaurus keyboard support -.It Xr zrc 4 -Zaurus remote control support -.It Xr zssp 4 -SSP for inter-chip communication -.It Xr zts 4 -Zaurus touchscreen support -.El -.Pp -A further list of available devices is contained within the pages -describing the system buses and controllers. -For example, a PCMCIA device would be listed in the -.Xr pcmcia 4 -man page. -The following buses and controllers list these devices: -.Pp -.Bl -tag -width "cardbus(4)XX" -offset 3n -compact -.It Xr onewire 4 -1-Wire bus -.It Xr pcmcia 4 -introduction to PCMCIA (PC Card) support -.It Xr usb 4 -introduction to Universal Serial Bus support -.El -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr config 8 -.Sh HISTORY -The -zaurus -.Nm intro -first appeared in -.Ox 3.7 . diff --git a/share/man/man4/man4.zaurus/lcd.4 b/share/man/man4/man4.zaurus/lcd.4 deleted file mode 100644 index 894da3ec328..00000000000 --- a/share/man/man4/man4.zaurus/lcd.4 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $OpenBSD: lcd.4,v 1.5 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt LCD 4 zaurus -.Os -.Sh NAME -.Nm lcd -.Nd Zaurus LCD display -.Sh SYNOPSIS -.Cd "lcd0 at pxaip?" -.Cd "wsdisplay* at lcd?" -.Sh DESCRIPTION -The -.Nm -driver interfaces the Zaurus LCD display with the -.Xr wscons 4 -console framework. -It does not provide direct device driver entry points -but makes its functions available via the internal -.Xr wsdisplay 4 -interface. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr wscons 4 , -.Xr wsdisplay 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/mem.4 b/share/man/man4/man4.zaurus/mem.4 deleted file mode 100644 index 9e0caf1f84b..00000000000 --- a/share/man/man4/man4.zaurus/mem.4 +++ /dev/null @@ -1,75 +0,0 @@ -.\" $OpenBSD: mem.4,v 1.3 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 1991 The Regents of the University of California. -.\" 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. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. -.\" -.\" from: @(#)mem.4 5.3 (Berkeley) 5/2/91 -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt MEM 4 zaurus -.Os -.Sh NAME -.Nm mem , -.Nm kmem -.Nd memory files -.Sh DESCRIPTION -The special file -.Pa /dev/mem -is an interface to the physical memory of the computer. -Byte offsets in this file are interpreted as physical memory addresses. -Reading and writing this file is equivalent to reading and writing -memory itself. -Only offsets within the bounds of -.Pa /dev/mem -are allowed. -.Pp -Kernel virtual memory is accessed through the interface -.Pa /dev/kmem -in the same manner as -.Pa /dev/mem . -Only kernel virtual addresses that are currently mapped to memory are allowed. -.Pp -On zaurus, physical memory is contiguous. -The kernel virtual memory begins at address -.Li 0xc0000000 . -.Pp -Writeability of these devices is controlled by the system -.Xr securelevel 7 . -.Sh FILES -.Bl -tag -width Pa -compact -.It Pa /dev/mem -.It Pa /dev/kmem -.El -.Sh SEE ALSO -.Xr securelevel 7 -.Sh HISTORY -The -.Pa /dev/mem -and -.Pa /dev/kmem -files appeared in -.At v6 . diff --git a/share/man/man4/man4.zaurus/pxadmac.4 b/share/man/man4/man4.zaurus/pxadmac.4 deleted file mode 100644 index afd22e7e366..00000000000 --- a/share/man/man4/man4.zaurus/pxadmac.4 +++ /dev/null @@ -1,35 +0,0 @@ -.\" $OpenBSD: pxadmac.4,v 1.3 2007/05/31 19:19:57 jmc Exp $ */ -.\" -.\" Copyright (c) 2005 David Gwynne <dlg@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt PXADMAC 4 zaurus -.Os -.Sh NAME -.Nm pxadmac -.Nd PXA2x0 DMA controller -.Sh SYNOPSIS -.Cd "pxadmac0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver manages the integrated DMA controller found -on the Intel PXA210, PXA250, PXA260 and PXA270 processor boards. -.Pp -It provides DMA handler registration for service requests to other drivers. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/pxagpio.4 b/share/man/man4/man4.zaurus/pxagpio.4 deleted file mode 100644 index c51e874ac59..00000000000 --- a/share/man/man4/man4.zaurus/pxagpio.4 +++ /dev/null @@ -1,49 +0,0 @@ -.\" $OpenBSD: pxagpio.4,v 1.3 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt PXAGPIO 4 zaurus -.Os -.Sh NAME -.Nm pxagpio -.Nd PXA2x0 GPIO interface -.Sh SYNOPSIS -.Cd "pxagpio0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver manages the integrated GPIO controller found -on the Intel PXA210, PXA250, PXA260 and PXA270 processors. -.Pp -It provides low-level services to other drivers. -Due to the tight integration of drivers on PXA2x0 processors, it is not -possible to provide the userland -.Xr gpio 4 -interface. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/pxaintc.4 b/share/man/man4/man4.zaurus/pxaintc.4 deleted file mode 100644 index b31480ade12..00000000000 --- a/share/man/man4/man4.zaurus/pxaintc.4 +++ /dev/null @@ -1,46 +0,0 @@ -.\" $OpenBSD: pxaintc.4,v 1.4 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt PXAINTC 4 zaurus -.Os -.Sh NAME -.Nm pxaintc -.Nd PXA2x0 interrupt controller -.Sh SYNOPSIS -.Cd "pxaintc0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver manages the integrated interrupt controller found -on the Intel PXA210, PXA250, PXA260 and PXA270 processor boards. -.Pp -It provides interrupt handler registration and interrupt dispatching services -to other drivers. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/pxaip.4 b/share/man/man4/man4.zaurus/pxaip.4 deleted file mode 100644 index b14406f0a3c..00000000000 --- a/share/man/man4/man4.zaurus/pxaip.4 +++ /dev/null @@ -1,106 +0,0 @@ -.\" $OpenBSD: pxaip.4,v 1.13 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt PXAIP 4 zaurus -.Os -.Sh NAME -.Nm pxaip -.Nd PXA2x0 Integrated Peripheral Bus -.Sh SYNOPSIS -.Cd "pxaip0 at mainbus?" -.Pp -.Cd "pxaintc0 at pxaip?" -.Cd "pxagpio0 at pxaip?" -.Cd "pxadmac0 at pxaip?" -.Cd "scoop0 at pxaip?" -.Cd "scoop1 at pxaip?" -.Cd "pxaost0 at pxaip? addr 0x40a00000 size 0x20" -.Cd "zts0 at pxaip?" -.Cd "zkbd0 at pxaip?" -.Cd "pxaudc0 at pxaip?" -.Cd "ohci0 at pxaip?" -.Cd "com0 at pxaip? addr 0x40100000 intr 22" -.Cd "com1 at pxaip? addr 0x40200000 intr 21" -.Cd "com2 at pxaip? addr 0x40700000 intr 20" -.Cd "pxapcic0 at pxaip?" -.Cd "lcd0 at pxaip?" -.Cd "zssp0 at pxaip?" -.Cd "apm0 at pxaip?" -.Cd "zaudio0 at pxaip?" -.Cd "zrc0 at pxaip?" -.Cd "pxammc0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver provides a generic interface to the integrated peripheral bus found -on the Intel PXA210, PXA250, PXA260 and PXA270 processors. -.Pp -Companion drivers provide access to the various resources: -.Pp -.Bl -tag -compact -width "pxadmac(4)XXX" -offset indent -.It Xr apm 4 -advanced power management device interface -.It Xr com 4 -serial communications interface -.It Xr lcd 4 -Zaurus LCD display -.It Xr ohci 4 -USB Open Host Controller Interface -.It Xr pxadmac 4 -PXA2x0 DMA controller -.It Xr pxagpio 4 -PXA2x0 GPIO interface -.It Xr pxaintc 4 -PXA2x0 interrupt controller -.It Xr pxammc 4 -MMC/SD/SDIO controller -.It Xr pxaost 4 -PXA2x0 OS timer -.It Xr pxapcic 4 -PXA2x0 PCMCIA interface -.It Xr pxaudc 4 -PXA27x USB device controller -.It Xr scoop 4 -Compact Flash and GPIO controller -.It Xr zaudio 4 -Zaurus audio device -.It Xr zkbd 4 -Zaurus keyboard support -.It Xr zrc 4 -Zaurus remote control support -.It Xr zssp 4 -SSP for inter-chip communication -.It Xr zts 4 -Zaurus touchscreen support -.El -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr intro 4 , -.Xr config 8 -.Sh HISTORY -Support for the PXA2x0 family appeared in -.Ox 3.7 . diff --git a/share/man/man4/man4.zaurus/pxammc.4 b/share/man/man4/man4.zaurus/pxammc.4 deleted file mode 100644 index 8e67e7986c3..00000000000 --- a/share/man/man4/man4.zaurus/pxammc.4 +++ /dev/null @@ -1,41 +0,0 @@ -.\" $OpenBSD: pxammc.4,v 1.3 2013/07/16 16:05:50 schwarze Exp $ -.\" -.\" Uwe Stuehler, 2007. Public Domain. -.\" -.Dd $Mdocdate: July 16 2013 $ -.Dt PXAMMC 4 zaurus -.Os -.Sh NAME -.Nm pxammc -.Nd MMC/SD/SDIO controller -.Sh SYNOPSIS -.Cd "pxammc0 at pxaip?" -.Cd "sdmmc* at pxammc?" -.Sh DESCRIPTION -The -.Nm -driver supports the MMC/SD/SDIO controller integrated in PXA255 and -PXA27x processors. -.Pp -The -.Xr sdmmc 4 -subsystem performs SD/MMC transactions to communicate with whatever -MMC/SD/SDIO devices are inserted into the card slot. -.Sh SEE ALSO -.Xr intro 4 , -.Xr sdmmc 4 -.Sh HISTORY -The -.Nm -driver first appeared in -.Ox 4.2 . -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was written by -.An Uwe Stuehler Aq Mt uwe@openbsd.org . -.Sh CAVEATS -To work around a problem stated in an errata for the PXA27x processor -family, the driver limits the bus frequency to 9.75 MHz instead of the -theoretically supported maximum frequency of 19.5 MHz. diff --git a/share/man/man4/man4.zaurus/pxaost.4 b/share/man/man4/man4.zaurus/pxaost.4 deleted file mode 100644 index 6feba6eda69..00000000000 --- a/share/man/man4/man4.zaurus/pxaost.4 +++ /dev/null @@ -1,56 +0,0 @@ -.\" $OpenBSD: pxaost.4,v 1.3 2013/07/16 16:05:50 schwarze Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: July 16 2013 $ -.Dt PXAOST 4 zaurus -.Os -.Sh NAME -.Nm pxaost -.Nd PXA2x0 OS timer -.Sh SYNOPSIS -.Cd "pxaost0 at pxaip? addr 0x40a00000 size 0x20" -.Sh DESCRIPTION -The -.Nm -driver uses the -.Dq OS timer -found on the PXA2x0 -.Pq XScale -processors as a tick/stat clock source for the system. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 -.Sh HISTORY -The -.Nm -driver appeared in -.Ox 3.9 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Dale Rahn Aq Mt drahn@openbsd.org . diff --git a/share/man/man4/man4.zaurus/pxapcic.4 b/share/man/man4/man4.zaurus/pxapcic.4 deleted file mode 100644 index 45bd9bc6e74..00000000000 --- a/share/man/man4/man4.zaurus/pxapcic.4 +++ /dev/null @@ -1,47 +0,0 @@ -.\" $OpenBSD: pxapcic.4,v 1.4 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005, Miodrag Vallat. -.\" 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt PXAPCIC 4 zaurus -.Os -.Sh NAME -.Nm pxapcic -.Nd PXA2x0 PCMCIA interface -.Sh SYNOPSIS -.Cd "pxapcic0 at pxaip?" -.Cd "pcmcia* at pxapcic?" -.Sh DESCRIPTION -The -.Nm -driver provides support for the integrated PCMCIA interface found -on some Intel PXA210, PXA250, PXA260 and PXA270 processors. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pcmcia 4 , -.Xr pxaip 4 , -.Xr config 8 -.Sh BUGS -Currently, only the Zaurus C3000 PCMCIA slot is supported. diff --git a/share/man/man4/man4.zaurus/pxaudc.4 b/share/man/man4/man4.zaurus/pxaudc.4 deleted file mode 100644 index 88c5f1b6373..00000000000 --- a/share/man/man4/man4.zaurus/pxaudc.4 +++ /dev/null @@ -1,58 +0,0 @@ -.\" $OpenBSD: pxaudc.4,v 1.11 2013/07/16 16:05:50 schwarze Exp $ -.\" -.\" Copyright (c) 2005 David Gwynne <dlg@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: July 16 2013 $ -.Dt PXAUDC 4 zaurus -.Os -.Sh NAME -.Nm pxaudc -.Nd PXA27x USB device controller -.Sh SYNOPSIS -.Cd "pxaudc0 at pxaip?" -.Cd "usbf* at pxaudc?" -.Sh DESCRIPTION -The PXA27x USB Device Controller supplies bus interface functions -so that -the USB Function support driver, -.Xr usbf 4 , -can support client-cable USB functions. -.Pp -The -.Nm -driver is able to detect the presence of either host or client cables. -If a host cable is detected, the USB pins are routed to -the USB host controller, -.Xr ohci 4 , -which supplies USB device support for many devices as described in -.Xr usb 4 . -If a client cable is detected, the USB pins are directly used by -.Nm -to support USB client functionality, as described in -.Xr usbf 4 . -.Sh SEE ALSO -.Xr ohci 4 , -.Xr usb 4 , -.Xr usbf 4 -.Sh AUTHORS -.An -nosplit -The initial -.Nm -driver was written by -.An David Gwynne Aq Mt dlg@openbsd.org . -USB Client support was later developed by -.An Uwe Stuehler Aq Mt uwe@openbsd.org -and completed by -.An Dale Rahn Aq Mt drahn@openbsd.org . diff --git a/share/man/man4/man4.zaurus/scoop.4 b/share/man/man4/man4.zaurus/scoop.4 deleted file mode 100644 index bad7e85cdf1..00000000000 --- a/share/man/man4/man4.zaurus/scoop.4 +++ /dev/null @@ -1,34 +0,0 @@ -.\" $OpenBSD: scoop.4,v 1.4 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt SCOOP 4 zaurus -.Os -.Sh NAME -.Nm scoop -.Nd Compact Flash and GPIO controller -.Sh SYNOPSIS -.Cd "scoop0 at pxaip?" -.Cd "scoop1 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver controls some Compact Flash slot functions, and sixteen general -purpose I/O pins. -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/zaudio.4 b/share/man/man4/man4.zaurus/zaudio.4 deleted file mode 100644 index efbeb8474f1..00000000000 --- a/share/man/man4/man4.zaurus/zaudio.4 +++ /dev/null @@ -1,62 +0,0 @@ -.\" $OpenBSD: zaudio.4,v 1.6 2013/07/16 16:05:50 schwarze Exp $ -.\" -.\" Copyright (c) 2005 David Gwynne <dlg@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: July 16 2013 $ -.Dt ZAUDIO 4 zaurus -.Os -.Sh NAME -.Nm zaudio -.Nd Zaurus audio device -.Sh SYNOPSIS -.Cd "zaudio0 at pxaip?" -.Cd "audio* at zaudio?" -.Sh DESCRIPTION -The -.Nm -driver interfaces the sound hardware found on the Zaurus with the -.Xr audio 4 -framework. -Sound support on the Zaurus is provided by the Inter-IC Sound (I2S) -Controller which is used to transfer samples to a Wolfson Microelectronics -WM8750 audio codec. -The WM8750 is controlled via the PXA2x0 I2C Controller. -.Pp -The hardware is capable of using both the internal speaker and headphone -socket for the playback of 8- and 16-bit audio samples at rates -ranging from 8kHz to 48kHz. -.Sh SEE ALSO -.Xr audio 4 , -.Xr intro 4 , -.Xr pxaip 4 -.Sh HISTORY -The -.Nm -device driver first appeared in -.Ox 3.8 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Christopher Pascoe Aq Mt pascoe@openbsd.org . -.Sh CAVEATS -Recording is unimplemented in the -.Nm -driver. -.Pp -The -.Nm -driver only supports the hardware found on the Zaurus C3000, C3100, and C3200, -though support for the C860 is planned for the future. diff --git a/share/man/man4/man4.zaurus/zkbd.4 b/share/man/man4/man4.zaurus/zkbd.4 deleted file mode 100644 index 05ffca6905d..00000000000 --- a/share/man/man4/man4.zaurus/zkbd.4 +++ /dev/null @@ -1,104 +0,0 @@ -.\" $OpenBSD: zkbd.4,v 1.17 2011/06/24 19:47:48 naddy Exp $ -.\" -.\" Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: June 24 2011 $ -.Dt ZKBD 4 zaurus -.Os -.Sh NAME -.Nm zkbd -.Nd Zaurus keyboard support -.Sh SYNOPSIS -.Cd "zkbd0 at pxaip?" -.Cd "wskbd* at zkdb?" -.Sh DESCRIPTION -The -.Nm -driver provides support for the native keyboard found on the -Zaurus. -Access to the keyboard is through the -.Xr wskbd 4 -driver. -.Sh LAYOUT -The Zaurus keyboard uses some strange chording behaviours to make -certain key combinations show up. -The left-hand Japanese key beside Ctrl (kana/hira) is mapped as the ALT key. -The non-obvious key mappings are explained here: -.Pp -.Bl -tag -width "xxxxxxxxxxxxx" -compact -offset indent -.It Li \&Fn u -{ -.It Li \&Fn i -} -.It Li \&Fn d -` -.It Li Calendar -F1 -.It Li Address -F2 -.It Li Mail -F3 -.It Li Home -F4 -.It Li Menu -F5 -.It Li Cancel -ESC -.It Li OK -Enter -.It Li Rear Toggle -Up and Down -.It Li Rear OK -Right -.It Li Rear Cancel -Left -.It Li \&Fn Up -Page Up -.It Li \&Fn Down -Page Down -.It Li \&Fn Left -Home -.It Li \&Fn Right -End -.El -.Pp -On/Off is special: pressing the key will immediately suspend the system. -Pressing the key while the Zaurus is suspended will cause it to resume. -Pressing the key longer than 3 seconds will do a nice halt if -the -.Va hw.allowpowerdown -.Xr sysctl 8 -variable is 1. -.Pp -All keyboard input (including the On/Off key) is ignored if the display is -shut. -.Pp -Additional keys can be generated by a remote control plugged into the -headphone jack \- see -.Xr zrc 4 . -For information on the use and configuration of the keyboard refer to -.Xr wskbd 4 . -.Sh SEE ALSO -.Xr intro 4 , -.Xr pxaip 4 , -.Xr wskbd 4 , -.Xr zrc 4 , -.Xr sysctl 8 -.Sh HISTORY -The -.Nm -driver -appeared in -.Ox 3.7 . diff --git a/share/man/man4/man4.zaurus/zrc.4 b/share/man/man4/man4.zaurus/zrc.4 deleted file mode 100644 index b815e0be124..00000000000 --- a/share/man/man4/man4.zaurus/zrc.4 +++ /dev/null @@ -1,115 +0,0 @@ -.\" $OpenBSD: zrc.4,v 1.7 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt ZRC 4 zaurus -.Os -.Sh NAME -.Nm zrc -.Nd Zaurus remote control support -.Sh SYNOPSIS -.Cd "zrc0 at pxaip?" -.Cd "wskbd* at zrc?" -.Sh DESCRIPTION -The -.Nm -driver provides support for the CE-RH2 remote control that can be -plugged into the headphone jack of the Zaurus C1000, C3000, C3100, and C3200. -Access to the additional keys generated by the remote control is -through the -.Xr wskbd 4 -driver. -.Pp -In translated mode (when not running X) the keys generated by -pressing the buttons on the remote control are: -.Pp -.Bl -tag -width "xxxxxxxxxxxx" -compact -offset indent -.It Li Mute -m -.It Li Volume Down -- -.It Li Volume Up -+ -.It Li Rewind -b -.It Li Forward -f -.It Li Play/Pause -p -.It Li Stop -s -.El -.Pp -In raw mode (when running X) the following keycodes are generated: -.Pp -.Bl -tag -width "xxxxxxxxxxxx" -compact -offset indent -.It Li Mute -133 -.It Li Volume Down -134 -.It Li Volume Up -135 -.It Li Rewind -160 -.It Li Forward -161 -.It Li Play/Pause -162 -.It Li Stop -163 -.El -.Sh EXAMPLES -Sample -.Pa ~/.Xmodmap -configuration file that can be loaded with -.Xr xmodmap 1 , -or automatically when -.Xr X 1 -starts: -.Bd -literal -offset indent -! Map to xmms control keys; mute becomes "shuffle" -keycode 133 = s -keycode 134 = Down -keycode 135 = Up -keycode 160 = z -keycode 161 = b -keycode 162 = x -keycode 163 = v -.Ed -.Pp -To control applications that handle the standard audio keysyms, this -configuration can be used instead: -.Bd -literal -offset indent -! Map to standard audio keysyms -keycode 133 = XF86AudioMute -keycode 134 = XF86AudioLowerVolume -keycode 135 = XF86AudioRaiseVolume -keycode 160 = XF86AudioPrev -keycode 161 = XF86AudioNext -keycode 162 = XF86AudioPlay -keycode 163 = XF86AudioStop -.Ed -.Sh SEE ALSO -.Xr xmodmap 1 , -.Xr intro 4 , -.Xr pxaip 4 , -.Xr wscons 4 , -.Xr wskbd 4 -.Sh HISTORY -The -.Nm -driver first appeared in -.Ox 3.9 . diff --git a/share/man/man4/man4.zaurus/zssp.4 b/share/man/man4/man4.zaurus/zssp.4 deleted file mode 100644 index b491b166394..00000000000 --- a/share/man/man4/man4.zaurus/zssp.4 +++ /dev/null @@ -1,44 +0,0 @@ -.\" $OpenBSD: zssp.4,v 1.3 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt ZSSP 4 zaurus -.Os -.Sh NAME -.Nm zssp -.Nd SSP for inter-chip communication -.Sh SYNOPSIS -.Cd "zssp0 at pxaip?" -.Sh DESCRIPTION -The -.Nm -driver controls the dedicated SSP unit, which is connected to three companion -chips in the zaurus. -.Pp -The three companion chips are: -.Pp -.Bl -tag -compact -width tenletters -.It MAX1111 -ADC for reading the battery voltage. -.It ADS7846 -Touch-screen controller. -.It LZ9JG18 -DAC to adjust the backlight brightness. -.El -.Sh SEE ALSO -.Xr autoconf 4 , -.Xr pxaip 4 , -.Xr config 8 diff --git a/share/man/man4/man4.zaurus/zts.4 b/share/man/man4/man4.zaurus/zts.4 deleted file mode 100644 index ac2c4ba6475..00000000000 --- a/share/man/man4/man4.zaurus/zts.4 +++ /dev/null @@ -1,60 +0,0 @@ -.\" $OpenBSD: zts.4,v 1.6 2007/05/31 19:19:57 jmc Exp $ -.\" -.\" Copyright (c) 2005 David Gwynne <dlg@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt ZTS 4 zaurus -.Os -.Sh NAME -.Nm zts -.Nd Zaurus touchscreen support -.Sh SYNOPSIS -.Cd "zts0 at pxaip?" -.Cd "wsmouse* at zts?" -.Sh DESCRIPTION -The -.Nm -driver provides support for the touchscreen on the Zaurus. -Access to the touchscreen is provided through the -.Xr wscons 4 -framework. -.Pp -Touching the screen will emulate mouse button 0 being pressed. -Holding either -.Li \&Fn -or -.Li Alt -while tapping will cause mouse buttons 1 or 2, respectively, -to be "pressed" instead. -.Pp -The touch screen sensor is poorly aligned with respect to the -.Xr lcd 4 , -therefore -.Xr ztsscale 8 -should be used to provide calibration results to the -.Nm -driver. -.Sh SEE ALSO -.Xr intro 4 , -.Xr pxaip 4 , -.Xr wscons 4 , -.Xr wsmouse 4 , -.Xr ztsscale 8 -.Sh HISTORY -The -.Nm -driver -appeared in -.Ox 3.7 . diff --git a/share/man/man4/ohci.4 b/share/man/man4/ohci.4 index 590f5280b50..69ff2cc9595 100644 --- a/share/man/man4/ohci.4 +++ b/share/man/man4/ohci.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ohci.4,v 1.13 2010/02/26 14:53:08 miod Exp $ +.\" $OpenBSD: ohci.4,v 1.14 2016/09/03 13:37:41 guenther Exp $ .\" $NetBSD: ohci.4,v 1.5 1999/11/23 01:47:34 augustss Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 26 2010 $ +.Dd $Mdocdate: September 3 2016 $ .Dt OHCI 4 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh SYNOPSIS .Cd "ohci* at cardbus?" .Cd "ohci* at pci?" -.Cd "ohci* at pxaip? " Pq zaurus .Cd "ohci* at voyager? " Pq loongson .Cd "usb* at ohci?" .Sh DESCRIPTION @@ -52,7 +51,6 @@ devices. .Xr ehci 4 , .Xr intro 4 , .Xr pci 4 , -.Xr pxaip 4 , .Xr uhci 4 , .Xr usb 4 , .Xr voyager 4 diff --git a/share/man/man4/pcmcia.4 b/share/man/man4/pcmcia.4 index 1f5cf3ab8ae..745723e9972 100644 --- a/share/man/man4/pcmcia.4 +++ b/share/man/man4/pcmcia.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pcmcia.4,v 1.62 2016/09/01 12:24:56 jmc Exp $ +.\" $OpenBSD: pcmcia.4,v 1.63 2016/09/03 13:37:41 guenther Exp $ .\" $NetBSD: pcmcia.4,v 1.4 1998/06/07 09:10:30 enami Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 1 2016 $ +.Dd $Mdocdate: September 3 2016 $ .Dt PCMCIA 4 .Os .Sh NAME @@ -53,10 +53,6 @@ .Cd "stp* at sbus?" .Cd "pcmcia* at stp?" .Pp -.Cd "# zaurus" -.Cd "pxapcic0 at pxaip?" -.Cd "pcmcia* at pxapcic?" -.Pp .Cd "# all architectures" .Cd "cbb* at pci?" .Cd "cardslot* at cbb? flags 0x0000" diff --git a/share/man/man4/sdmmc.4 b/share/man/man4/sdmmc.4 index 3ffb5ebe662..9437b01e39d 100644 --- a/share/man/man4/sdmmc.4 +++ b/share/man/man4/sdmmc.4 @@ -1,8 +1,8 @@ -.\" $OpenBSD: sdmmc.4,v 1.13 2014/07/11 22:10:51 tedu Exp $ +.\" $OpenBSD: sdmmc.4,v 1.14 2016/09/03 13:37:41 guenther Exp $ .\" .\" Theo de Raadt, 2006. Public Domain. .\" -.Dd $Mdocdate: July 11 2014 $ +.Dd $Mdocdate: September 3 2016 $ .Dt SDMMC 4 .Os .Sh NAME @@ -11,8 +11,6 @@ .Sh SYNOPSIS .Cd "# armv7" .Cd "sdmmc* at ommmc?" -.Cd "# zaurus" -.Cd "sdmmc* at pxammc?" .Cd "# all architectures" .Cd "sdmmc* at rtsx?" .Cd "sdmmc* at sdhc?" diff --git a/share/man/man4/usb.4 b/share/man/man4/usb.4 index 88a39812ddb..27966d3ec7f 100644 --- a/share/man/man4/usb.4 +++ b/share/man/man4/usb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: usb.4,v 1.180 2016/06/28 06:31:30 jmc Exp $ +.\" $OpenBSD: usb.4,v 1.181 2016/09/03 13:37:41 guenther Exp $ .\" $NetBSD: usb.4,v 1.15 1999/07/29 14:20:32 augustss Exp $ .\" .\" Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 28 2016 $ +.Dd $Mdocdate: September 3 2016 $ .Dt USB 4 .Os .Sh NAME @@ -38,8 +38,6 @@ .Sh SYNOPSIS .Cd "# octeon specific" .Cd "dwctwo0 at iobus? irq 56" -.Cd "# zaurus specific" -.Cd "ohci0 at pxaip?" .Cd "# all architectures" .Cd "ehci* at cardbus?" .Cd "ohci* at cardbus?" diff --git a/share/man/man4/usbf.4 b/share/man/man4/usbf.4 deleted file mode 100644 index 1fe2c841be2..00000000000 --- a/share/man/man4/usbf.4 +++ /dev/null @@ -1,75 +0,0 @@ -.\" $OpenBSD: usbf.4,v 1.7 2013/07/16 16:05:49 schwarze Exp $ -.\" -.\" Uwe Stuehler, 2006. Public Domain. -.\" -.Dd $Mdocdate: July 16 2013 $ -.Dt USBF 4 -.Os -.Sh NAME -.Nm usbf -.Nd introduction to Universal Serial Bus function support -.Sh SYNOPSIS -.\" XXX SYNOPSIS should be similar to usb.4 -.Cd "usbf* at pxaudc? # zaurus" -.Cd "cdcef* at usbf?" -.Sh DESCRIPTION -.Ox -provides machine-independent bus support and drivers for Universal Serial -Bus -.Pq Tn USB -functions, making it possible in principle for machines running -.Ox -to act as -.Tn USB -device to a -.Tn USB -host. -.Pp -The -.Ox -.Nm -driver has three layers: the controller, the logical device, and the -function layer. -The controller attaches to a physical bus. -The logical device attaches to the controller and the function attaches -to the logical device. -.Pp -Function drivers implement the characteristics of a particular -.Tn USB -device class that the -.Tn USB -host will see when the device is connected to the bus. -.\" .Pp -.\" See -.\" .Xr usbf 9 -.\" for a description of the kernel programming interfaces for -.\" .Tn USB -.\" function support. -.Sh SUPPORTED FUNCTIONS -.Ox -includes the following machine-independent -.Tn USB -function drivers, sorted by device type and driver name: -.Ss Communication devices -.Bl -tag -width 12n -offset ind -compact -.It Xr cdcef 4 -Communication Device Class Ethernet Emulation Model -.Tn USB -network adapter. -.El -.Sh SEE ALSO -.Xr cdcef 4 , -.Xr intro 4 , -.Xr pxaudc 4 -.\" .Xr usbf 9 -.Sh HISTORY -The -.Nm -driver first appeared in -.Ox 4.1 . -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was written by -.An Uwe Stuehler Aq Mt uwe@openbsd.org . diff --git a/share/man/man7/mdoc.7 b/share/man/man7/mdoc.7 index 16815da1a35..f2aad3778e4 100644 --- a/share/man/man7/mdoc.7 +++ b/share/man/man7/mdoc.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mdoc.7,v 1.143 2016/09/01 10:59:15 jmc Exp $ +.\" $OpenBSD: mdoc.7,v 1.144 2016/09/03 13:37:41 guenther Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010, 2011, 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: September 1 2016 $ +.Dd $Mdocdate: September 3 2016 $ .Dt MDOC 7 .Os .Sh NAME @@ -1362,9 +1362,8 @@ the following are valid architectures: .Cm octeon , .Cm sgi , .Cm socppc , -.Cm sparc64 , and -.Cm zaurus . +.Cm sparc64 . .El .Pp Examples: diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile index 0bdf5d73c44..5505222cccc 100644 --- a/share/man/man8/Makefile +++ b/share/man/man8/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.95 2016/09/01 09:53:08 tedu Exp $ +# $OpenBSD: Makefile,v 1.96 2016/09/03 13:37:41 guenther Exp $ # $NetBSD: Makefile,v 1.13 1996/03/28 21:36:40 mark Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 @@ -11,7 +11,6 @@ MAN= afterboot.8 autoinstall.8 boot_config.8 \ SUBDIR= man8.alpha man8.amd64 man8.armv7 \ man8.hppa man8.i386 man8.landisk \ man8.loongson man8.luna88k man8.macppc \ - man8.octeon man8.sgi man8.socppc man8.sparc64 \ - man8.zaurus + man8.octeon man8.sgi man8.socppc man8.sparc64 .include <bsd.prog.mk> diff --git a/share/man/man8/man8.zaurus/MAKEDEV.8 b/share/man/man8/man8.zaurus/MAKEDEV.8 deleted file mode 100644 index 16bac6a881b..00000000000 --- a/share/man/man8/man8.zaurus/MAKEDEV.8 +++ /dev/null @@ -1,239 +0,0 @@ -.\" $OpenBSD: MAKEDEV.8,v 1.56 2016/04/28 18:17:32 natano Exp $ -.\" -.\" THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. -.\" generated from: -.\" -.\" OpenBSD: etc.zaurus/MAKEDEV.md,v 1.42 2016/04/25 20:38:11 tedu Exp -.\" OpenBSD: MAKEDEV.common,v 1.86 2016/04/25 20:39:42 tedu Exp -.\" OpenBSD: MAKEDEV.man,v 1.8 2016/03/12 17:59:27 espie Exp -.\" OpenBSD: MAKEDEV.mansub,v 1.2 2004/02/20 19:13:01 miod Exp -.\" -.\" Copyright (c) 2004, Miodrag Vallat -.\" Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: April 28 2016 $ -.Dt MAKEDEV 8 zaurus -.Os -.Sh NAME -.Nm MAKEDEV -.Nd create system and device special files -.Sh SYNOPSIS -.Nm MAKEDEV -.Op Ar name ... -.Sh DESCRIPTION -The shell script -.Nm , -found in the -.Pa /dev -directory, is used to create various special files. -See -.Xr intro 4 -for a more complete discussion of special files. -.Pp -.Nm -takes any number of device names as arguments, where the names are -the common abbreviation for the device or group of devices. -.Pp -Where a device name is followed by a star -.Sq * , -the star must be replaced by a unit number. -If units are expected for a device but not provided, -.Nm -will supply the standard numbers in most cases. -.Pp -The zaurus supports the following devices: -.Pp -.Sy Special device names -.Bl -tag -width tenletters -compact -.It Ar all -Creates special files for all devices on zaurus. -.It Ar ramdisk -Ramdisk kernel devices. -.It Ar std -Creates the -.Sq standard -devices (console, klog, kmem, ksyms, mem, null, -stderr, stdin, stdout, tty, zero) -which are absolutely necessary for the system to function properly. -.It Ar local -Creates configuration-specific devices, by invoking the shell file -.Pa MAKEDEV.local . -.El -.Pp -.Sy Disks -.Bl -tag -width tenletters -compact -.It Ar cd* -ATAPI and SCSI CD-ROM drives, see -.Xr cd 4 . -.It Ar ch* -SCSI media changers, see -.Xr ch 4 . -.It Ar rd* -.Dq rd -pseudo-disks, see -.Xr rd 4 . -.It Ar sd* -SCSI disks, including flopticals, see -.Xr sd 4 . -.It Ar vnd* -.Dq file -pseudo-disk devices, see -.Xr vnd 4 . -.It Ar wd* -.Dq winchester -disk drives (ST506, IDE, ESDI, RLL, ...), see -.Xr wd 4 . -.El -.Pp -.Sy Tapes -.Bl -tag -width tenletters -compact -.It Ar st* -SCSI tape drives, see -.Xr st 4 . -.El -.Pp -.Sy Terminal ports -.Bl -tag -width tenletters -compact -.It Ar tty[0-7][0-9a-f] -NS16x50 serial ports, see -.Xr com 4 . -.El -.Pp -.Sy Pseudo terminals -.Bl -tag -width tenletters -compact -.It Ar ptm -pty master device, see -.Xr ptm 4 . -.It Ar pty* -Set of 62 master pseudo terminals, see -.Xr pty 4 . -.It Ar tty* -Set of 62 slave pseudo terminals, see -.Xr tty 4 . -.El -.Pp -.Sy Console ports -.Bl -tag -width tenletters -compact -.It Ar ttyC-J* -wscons display devices, see -.Xr wsdisplay 4 . -.It Ar wscons -Minimal wscons devices, see -.Xr wscons 4 . -.It Ar wskbd* -wscons keyboards, see -.Xr wskbd 4 . -.It Ar wsmouse* -wscons mice, see -.Xr wsmouse 4 . -.It Ar wsmux -wscons keyboard/mouse mux devices, see -.Xr wsmux 4 . -.El -.Pp -.Sy USB devices -.Bl -tag -width tenletters -compact -.It Ar ttyU* -USB serial ports, see -.Xr ucom 4 . -.It Ar uall -All USB devices, see -.Xr usb 4 . -.It Ar ugen* -Generic USB devices, see -.Xr ugen 4 . -.It Ar uhid* -Generic HID devices, see -.Xr uhid 4 . -.It Ar ulpt* -Printer devices, see -.Xr ulpt 4 . -.It Ar usb* -Bus control devices used by usbd for attach/detach, see -.Xr usb 4 . -.El -.Pp -.Sy Special purpose devices -.Bl -tag -width tenletters -compact -.It Ar apm -Power management device, see -.Xr apm 4 . -.It Ar audio* -Audio devices, see -.Xr audio 4 . -.It Ar bio -ioctl tunnel pseudo-device, see -.Xr bio 4 . -.It Ar bktr* -Video frame grabbers, see -.Xr bktr 4 . -.It Ar bpf -Berkeley Packet Filter, see -.Xr bpf 4 . -.It Ar diskmap -Disk mapper, see -.Xr diskmap 4 . -.It Ar fd -fd/* nodes, see -.Xr fd 4 . -.It Ar fuse -Userland Filesystem, see -.Xr fuse 4 . -.It Ar hotplug -devices hot plugging, see -.Xr hotplug 4 . -.It Ar pf* -Packet Filter, see -.Xr pf 4 . -.It Ar pppx* -PPP Multiplexer, see -.Xr pppx 4 . -.It Ar radio* -FM tuner devices, see -.Xr radio 4 . -.It Ar *random -In-kernel random data source, see -.Xr random 4 . -.It Ar rmidi* -Raw MIDI devices, see -.Xr midi 4 . -.It Ar tun* -Network tunnel driver, see -.Xr tun 4 . -.It Ar tap* -Ethernet tunnel driver, see -.Xr tap 4 . -.It Ar tuner* -Tuner devices, see -.Xr bktr 4 . -.It Ar uk* -Unknown SCSI devices, see -.Xr uk 4 . -.It Ar video* -Video V4L2 devices, see -.Xr video 4 . -.It Ar vscsi* -Virtual SCSI controller, see -.Xr vscsi 4 . -.El -.Sh FILES -.Bl -tag -width /dev -compact -.It Pa /dev -The special file directory. -.El -.Sh SEE ALSO -.Xr intro 4 , -.Xr config 8 , -.Xr mknod 8 diff --git a/share/man/man8/man8.zaurus/Makefile b/share/man/man8/man8.zaurus/Makefile deleted file mode 100644 index 6cc9264c587..00000000000 --- a/share/man/man8/man8.zaurus/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2005/04/19 23:08:17 uwe Exp $ - -MAN= MAKEDEV.8 boot_zaurus.8 -MANSUBDIR=zaurus - -.include <bsd.prog.mk> diff --git a/share/man/man8/man8.zaurus/boot_zaurus.8 b/share/man/man8/man8.zaurus/boot_zaurus.8 deleted file mode 100644 index f0454138a0e..00000000000 --- a/share/man/man8/man8.zaurus/boot_zaurus.8 +++ /dev/null @@ -1,75 +0,0 @@ -.\" $OpenBSD: boot_zaurus.8,v 1.2 2007/05/31 19:20:00 jmc Exp $ -.\" -.\" Copyright (c) 2005 Uwe Stuehler -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt BOOT_ZAURUS 8 zaurus -.Os -.Sh NAME -.Nm boot_zaurus -.Nd zaurus system bootstrapping procedures -.Sh DESCRIPTION -.Ss System starts -When powered on, or if the system is rebooted via -.Xr reboot 8 -or -.Xr shutdown 8 , -the processor begins executing code at physical address 0. -The early startup code is preinstalled by the manufacturer, -and will load a minimal UNIX-like operating system from internal -flash memory (our primary bootstrap loader, for now). -.Ss Boot process options -On most systems, booting -.Ox -from the primary bootstrap loader will eventually load the -.Ox Ns -specific -zaurus bootstrapping code. -This versatile program is described in a separate document, -.Xr boot 8 . -.Ss Abnormal system termination -In case of system crashes, the kernel will usually enter the kernel -debugger, -.Xr ddb 4 , -unless it is not present in the kernel, or it is disabled via the -.Em ddb.panic -sysctl. -Upon leaving ddb, or if ddb was not entered, the kernel will halt the system -if it was still in device configuration phase, or attempt a dump to the -configured dump device, if possible. -The crash dump will then be recovered by -.Xr savecore 8 -during the next multi-user boot cycle. -It is also possible to force other behaviours from ddb. -.Sh FILES -.Bl -tag -width /usr/mdec/zbsdmod.o -compact -.It Pa /bsd -default system kernel -.It Pa /bsd.rd -standalone installation kernel, suitable for disaster recovery -.It Pa /usr/mdec/zboot -system bootstrap -.It Pa /usr/mdec/zbsdmod.o -kernel module for the primary bootstrap loader that must be -loaded before the system bootstrap -.El -.Sh SEE ALSO -.Xr ddb 4 , -.Xr boot 8 , -.Xr halt 8 , -.Xr init 8 , -.\" .Xr installboot 8 , -.Xr reboot 8 , -.Xr savecore 8 , -.Xr shutdown 8 diff --git a/sys/Makefile b/sys/Makefile index 76604e983fb..2ce99d44c1b 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.47 2016/09/01 09:32:49 deraadt Exp $ +# $OpenBSD: Makefile,v 1.48 2016/09/03 13:37:42 guenther Exp $ # $NetBSD: Makefile,v 1.5 1995/09/15 21:05:21 pk Exp $ SUBDIR= dev/microcode \ @@ -6,8 +6,7 @@ SUBDIR= dev/microcode \ arch/hppa arch/i386 \ arch/landisk arch/loongson arch/luna88k \ arch/macppc arch/octeon \ - arch/sgi arch/socppc arch/sparc64 \ - arch/zaurus + arch/sgi arch/socppc arch/sparc64 tags: cd ${.CURDIR}/kern; make tags diff --git a/sys/arch/arm/xscale/files.pxa2x0 b/sys/arch/arm/xscale/files.pxa2x0 deleted file mode 100644 index 102d2df4119..00000000000 --- a/sys/arch/arm/xscale/files.pxa2x0 +++ /dev/null @@ -1,89 +0,0 @@ -# $OpenBSD: files.pxa2x0,v 1.25 2016/05/02 08:15:55 patrick Exp $ -# $NetBSD: files.pxa2x0,v 1.6 2004/05/01 19:09:14 thorpej Exp $ -# -# Configuration info for Intel PXA2[51]0 CPU support -# - -file arch/arm/arm/softintr.c # Use the generic ARM soft interrupt code. - -# PXA2[51]0's integrated peripherals bus. -define pxaip {[addr=-1], [size=0], [intr=-1], [index=-1]} -device pxaip -attach pxaip at fdt -file arch/arm/xscale/pxa2x0.c -file arch/arm/arm/irq_dispatch.S -file arch/arm/xscale/pxa2x0_space.c -#file arch/arm/xscale/pxa2x0_freqchg.S -file arch/arm/xscale/pxa2x0_dma.c - -# Cotulla integrated peripherals. - -# INTC controller -device pxaintc -attach pxaintc at pxaip -file arch/arm/xscale/pxa2x0_intr.c pxaintc -file arch/arm/xscale/pxa2x0_mutex.c pxaintc -#defflag opt_pxa2x0_gpio.h PXAGPIO_HAS_GPION_INTRS - -# GPIO controller -device pxagpio -attach pxagpio at pxaip -file arch/arm/xscale/pxa2x0_gpio.c pxagpio needs-flag - -# DMA controller -device pxadmac -attach pxadmac at pxaip -file arch/arm/xscale/pxa2x0_dmac.c pxadmac needs-flag - -# PXA2x0's built-in timer. -device pxaost -attach pxaost at pxaip -file arch/arm/xscale/pxa2x0_clock.c pxaost - -# NS16550 compatible serial ports -attach com at pxaip with com_pxaip -file arch/arm/xscale/pxa2x0_com.c com_pxaip -file arch/arm/xscale/pxa2x0_a4x_space.c com_pxaip -file arch/arm/xscale/pxa2x0_a4x_io.S com_pxaip - -# PXA27x USB Device Controller -device pxaudc: usbdev -file arch/arm/xscale/pxa27x_udc.c pxaudc - -# OHCI USB Controller -attach ohci at pxaip with pxaohci -file arch/arm/xscale/pxa2x0_ohci.c pxaohci - -# LCD controller -device lcd: wsemuldisplaydev, rasops16, rasops8, rasops4, rasops_rotation -file arch/arm/xscale/pxa2x0_lcd.c lcd needs-flag - -# Inter-Integrated Circuit controller -device i2c {} -file arch/arm/xscale/pxa2x0_i2c.c i2c - -# Inter-IC Sound controller -device i2s {} -file arch/arm/xscale/pxa2x0_i2s.c i2s - -# Power manager and APM emulation -device apm -file arch/arm/xscale/pxa2x0_apm.c apm needs-flag -file arch/arm/xscale/pxa2x0_apm_asm.S apm - -include "dev/pcmcia/files.pcmcia" - -# PCMCIA controller -device pxapcic: pcmciabus -file arch/arm/xscale/pxa2x0_pcic.c pxapcic - -# XXX this is a hack to use dev/pcmcia without fdc.c -device fdc - -# MMC/SD/SDIO controller -device pxammc: sdmmcbus -file arch/arm/xscale/pxa2x0_mmc.c pxammc - -# PXA27x keypad -device pxa27x_kpc: wskbddev -file arch/arm/xscale/pxa27x_kpc.c pxa27x_kpc diff --git a/sys/arch/arm/xscale/pxa27x_kpc.c b/sys/arch/arm/xscale/pxa27x_kpc.c deleted file mode 100644 index 7ae267330d0..00000000000 --- a/sys/arch/arm/xscale/pxa27x_kpc.c +++ /dev/null @@ -1,227 +0,0 @@ -/* $OpenBSD: pxa27x_kpc.c,v 1.3 2014/01/26 17:48:07 miod Exp $ */ -/* - * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/limits.h> -#include <sys/timeout.h> -#include <sys/systm.h> - -#include <arch/arm/xscale/pxa2x0_gpio.h> -#include <arch/arm/xscale/pxa2x0reg.h> -#include <arch/arm/xscale/pxa2x0var.h> -#include <arch/arm/xscale/pxa27x_kpc.h> - -int pxa27x_kpc_enable(void *, int); -void pxa27x_kpc_setleds(void *, int); -int pxa27x_kpc_ioctl(void *, u_long, caddr_t, int, struct proc *); - -inline void pxa27x_kpc_submit(struct pxa27x_kpc_softc *, int); -int pxa27x_kpc_intr(void *); - -struct cfdriver pxa27x_kpc_cd = { - NULL, "pxa27x_kpc", DV_DULL, -}; - -struct wskbd_accessops pxa27x_kpc_accessops = { - pxa27x_kpc_enable, - pxa27x_kpc_setleds, - pxa27x_kpc_ioctl, -}; - -struct wscons_keydesc pxa27x_kpc_keydesctab[] = { - {KB_US, 0, 0, 0}, - {0, 0, 0, 0}, -}; - -struct wskbd_mapdata pxa27x_kpc_mapdata = { - pxa27x_kpc_keydesctab, KB_US | KB_DEFAULT, -}; - -void pxa27x_kpc_cngetc(void *, u_int *, int *); -void pxa27x_kpc_cnpollc(void *, int); -void pxa27x_kpc_cnbell(void *, u_int, u_int, u_int); - -struct wskbd_consops pxa27x_kpc_consops = { - pxa27x_kpc_cngetc, - pxa27x_kpc_cnpollc, - pxa27x_kpc_cnbell, -}; - -int -pxa27x_kpc_match(void *aux) -{ - struct pxaip_attach_args *pxa = aux; - - if (pxa->pxa_addr != PXA2X0_KPC_BASE) - return 0; /* Wrong device */ - - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) != CPU_ID_PXA27X) - return 0; /* Wrong CPU */ - - pxa->pxa_size = PXA2X0_KPC_SIZE; - return 1; -} - -void -pxa27x_kpc_attach(struct pxa27x_kpc_softc *sc, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - struct wskbddev_attach_args a; - - sc->sc_iot = pxa->pxa_sa.sa_iot; - if (bus_space_map(sc->sc_iot, pxa->pxa_addr, pxa->pxa_size, 0, - &sc->sc_ioh) != 0) { - printf(": can't map regs\n"); - goto err; - } - - pxa2x0_clkman_config(CKEN_KEY, 1); - - sc->sc_ih = pxa2x0_intr_establish(PXA2X0_INT_KPC, IPL_TTY, - pxa27x_kpc_intr, sc, sc->sc_dev.dv_xname); - if (!sc->sc_ih) { - printf(": can't establish interrupt\n"); - goto err2; - } - - bus_space_write_4(sc->sc_iot, sc->sc_ioh, KPC_KPC, KPC_MIE | KPC_ME | - KPC_MS(0xff) | KPC_IMKP | KPC_MI | KPC_MKCN(sc->sc_cols) | - KPC_MKRN(sc->sc_rows) | KPC_ASACT); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, KPC_KPKDI, 0x30); - - pxa27x_kpc_keydesctab[0].map_size = sc->sc_ksize; - pxa27x_kpc_keydesctab[0].map = sc->sc_kcodes; - - a.console = 1; - a.keymap = &pxa27x_kpc_mapdata; - a.accessops = &pxa27x_kpc_accessops; - a.accesscookie = sc; - - printf("\n"); - - wskbd_cnattach(&pxa27x_kpc_consops, sc, &pxa27x_kpc_mapdata); - - sc->sc_wskbddev = config_found((struct device *)sc, &a, wskbddevprint); - - return; - -err2: - bus_space_unmap(sc->sc_iot, sc->sc_ioh, PXA2X0_KPC_SIZE); -err: - return; -} - -inline void -pxa27x_kpc_submit(struct pxa27x_kpc_softc *sc, int event) -{ -#ifdef WSDISPLAY_COMPAT_RAWKBD - u_char key; - - if (sc->sc_rawkbd) { - key = sc->sc_key; - if (event == WSCONS_EVENT_KEY_DOWN) - key |= 0x80; - wskbd_rawinput(sc->sc_wskbddev, &key, 1); - } else -#endif - wskbd_input(sc->sc_wskbddev, event, sc->sc_key); -} - -int -pxa27x_kpc_intr(void *arg) -{ - u_int32_t val; - int row = -1, col = -1; - int i = 0; - struct pxa27x_kpc_softc *sc = arg; - - val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, KPC_KPC); - if (!(val & KPC_MI)) /* interrupt didn't happen .. what ?! */ - return 0; - - val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, KPC_KPAS); - if (val & KPAS_SO) /* bogus interrupt */ - return 0; - - if (val & KPAS_MUKP) { /* keypress */ - col = val & KPAS_CP; - row = (val & KPAS_RP) >> 4; - for (i = 0; i < sc->sc_ksize; i++) - if (sc->sc_kmap[i].row == row && - sc->sc_kmap[i].col == col) { - sc->sc_key = sc->sc_kmap[i].key; - pxa27x_kpc_submit(sc, WSCONS_EVENT_KEY_DOWN); - break; - } - } else /* no keypress aka keyrelease */ - pxa27x_kpc_submit(sc, WSCONS_EVENT_KEY_UP); - - return 1; -} - -int -pxa27x_kpc_enable(void *v, int power) -{ - return 0; -} - -void -pxa27x_kpc_setleds(void *v, int power) -{ -} - -int -pxa27x_kpc_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ -#ifdef WSDISPLAY_COMPAT_RAWKBD - struct pxa27x_kpc_softc *sc = v; -#endif - - switch (cmd) { - case WSKBDIO_GTYPE: - *(int *)data = WSKBD_TYPE_KPC; - return 0; - case WSKBDIO_SETLEDS: - return 0; - case WSKBDIO_GETLEDS: - *(int *)data = 0; - return 0; -#ifdef WSDISPLAY_COMPAT_RAWKBD - case WSKBDIO_SETMODE: - sc->sc_rawkbd = *(int *)data == WSKBD_RAW; - return 0; -#endif - } - return -1; -} - -void -pxa27x_kpc_cnbell(void *v, u_int pitch, u_int period, u_int volume) -{ -} - -void -pxa27x_kpc_cngetc(void *v, u_int *type, int *data) -{ -} - -void -pxa27x_kpc_cnpollc(void *v, int on) -{ -} diff --git a/sys/arch/arm/xscale/pxa27x_kpc.h b/sys/arch/arm/xscale/pxa27x_kpc.h deleted file mode 100644 index 3541d007790..00000000000 --- a/sys/arch/arm/xscale/pxa27x_kpc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $OpenBSD: pxa27x_kpc.h,v 1.2 2013/10/24 22:40:10 aalm Exp $ */ -/* - * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wskbdraw.h> -#include <dev/wscons/wskbdvar.h> -#include <dev/wscons/wsksymdef.h> -#include <dev/wscons/wsksymvar.h> - -struct pxa27x_kpc_keymap { - int row; - int col; - keysym_t key; -}; - -struct pxa27x_kpc_softc { - struct device sc_dev; - struct device *sc_wskbddev; - void *sc_ih; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - int sc_key; - int sc_rawkbd; - - int sc_rows; - int sc_cols; - const struct pxa27x_kpc_keymap *sc_kmap; - const keysym_t *sc_kcodes; - const keysym_t *sc_xt_kcodes; - int sc_ksize; -}; - -int pxa27x_kpc_match(void *); -void pxa27x_kpc_attach(struct pxa27x_kpc_softc *, void *); diff --git a/sys/arch/arm/xscale/pxa27x_udc.c b/sys/arch/arm/xscale/pxa27x_udc.c deleted file mode 100644 index a809141c57a..00000000000 --- a/sys/arch/arm/xscale/pxa27x_udc.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* $OpenBSD: pxa27x_udc.c,v 1.31 2015/05/15 13:32:08 jsg Exp $ */ - -/* - * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/timeout.h> - -#include <machine/intr.h> -#include <machine/bus.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbdivar.h> -#include <dev/usb/usbf.h> -#include <dev/usb/usbfvar.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <arm/xscale/pxa27x_udc.h> - -#include "usbf.h" - -struct pxaudc_xfer { - struct usbf_xfer xfer; - u_int16_t frmlen; -}; - -struct pxaudc_pipe { - struct usbf_pipe pipe; -// LIST_ENTRY(pxaudc_pipe) list; -}; - -void pxaudc_enable(struct pxaudc_softc *); -void pxaudc_disable(struct pxaudc_softc *); -void pxaudc_read_ep0(struct pxaudc_softc *, struct usbf_xfer *); -void pxaudc_read_epN(struct pxaudc_softc *sc, int ep); -void pxaudc_write_ep0(struct pxaudc_softc *, struct usbf_xfer *); -void pxaudc_write(struct pxaudc_softc *, struct usbf_xfer *); -void pxaudc_write_epN(struct pxaudc_softc *sc, int ep); - -int pxaudc_connect_intr(void *); -int pxaudc_intr(void *); -void pxaudc_intr1(struct pxaudc_softc *); -void pxaudc_ep0_intr(struct pxaudc_softc *); -void pxaudc_epN_intr(struct pxaudc_softc *sc, int ep, int isr); - -usbf_status pxaudc_open(struct usbf_pipe *); -void pxaudc_softintr(void *); -usbf_status pxaudc_allocm(struct usbf_bus *, struct usb_dma *, u_int32_t); -void pxaudc_freem(struct usbf_bus *, struct usb_dma *); -struct usbf_xfer *pxaudc_allocx(struct usbf_bus *); -void pxaudc_freex(struct usbf_bus *, struct usbf_xfer *); - -usbf_status pxaudc_ctrl_transfer(struct usbf_xfer *); -usbf_status pxaudc_ctrl_start(struct usbf_xfer *); -void pxaudc_ctrl_abort(struct usbf_xfer *); -void pxaudc_ctrl_done(struct usbf_xfer *); -void pxaudc_ctrl_close(struct usbf_pipe *); - -usbf_status pxaudc_bulk_transfer(struct usbf_xfer *); -usbf_status pxaudc_bulk_start(struct usbf_xfer *); -void pxaudc_bulk_abort(struct usbf_xfer *); -void pxaudc_bulk_done(struct usbf_xfer *); -void pxaudc_bulk_close(struct usbf_pipe *); - -struct cfdriver pxaudc_cd = { - NULL, "pxaudc", DV_DULL -}; - -#if NUSBF > 0 - -struct usbf_bus_methods pxaudc_bus_methods = { - pxaudc_open, - pxaudc_softintr, - pxaudc_allocm, - pxaudc_freem, - pxaudc_allocx, - pxaudc_freex -}; - -struct usbf_pipe_methods pxaudc_ctrl_methods = { - pxaudc_ctrl_transfer, - pxaudc_ctrl_start, - pxaudc_ctrl_abort, - pxaudc_ctrl_done, - pxaudc_ctrl_close -}; - -struct usbf_pipe_methods pxaudc_bulk_methods = { - pxaudc_bulk_transfer, - pxaudc_bulk_start, - pxaudc_bulk_abort, - pxaudc_bulk_done, - pxaudc_bulk_close -}; - -#endif /* NUSBF > 0 */ - -#define DEVNAME(sc) ((sc)->sc_bus.bdev.dv_xname) - -#define CSR_READ_4(sc, reg) \ - bus_space_read_4((sc)->sc_iot, (sc)->sc_ioh, (reg)) -#define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -#define CSR_SET_4(sc, reg, val) \ - CSR_WRITE_4((sc), (reg), CSR_READ_4((sc), (reg)) | (val)) -#define CSR_CLR_4(sc, reg, val) \ - CSR_WRITE_4((sc), (reg), CSR_READ_4((sc), (reg)) & ~(val)) - -#ifndef PXAUDC_DEBUG -#define DPRINTF(l, x) do {} while (0) -#else -int pxaudcdebug = 0; -#define DPRINTF(l, x) if ((l) <= pxaudcdebug) printf x; else {} -#endif - -int -pxaudc_match(void) -{ - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) != CPU_ID_PXA27X) - return (0); - - return (1); -} - -void -pxaudc_attach(struct pxaudc_softc *sc, void *aux) -{ - struct pxaip_attach_args *pxa = aux; -#if NUSBF > 0 - int i; -#endif - - sc->sc_iot = pxa->pxa_iot; - if (bus_space_map(sc->sc_iot, PXA2X0_USBDC_BASE, PXA2X0_USBDC_SIZE, 0, - &sc->sc_ioh)) { - printf(": cannot map mem space\n"); - return; - } - sc->sc_size = PXA2X0_USBDC_SIZE; - - printf(": USB Device Controller\n"); - - bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, sc->sc_size, - BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE); - - /* Set up GPIO pins and disable the controller. */ - pxaudc_disable(sc); - -#if NUSBF > 0 - /* Establish USB device interrupt. */ - sc->sc_ih = pxa2x0_intr_establish(PXA2X0_INT_USB, IPL_USB, - pxaudc_intr, sc, DEVNAME(sc)); - if (sc->sc_ih == NULL) { - printf(": unable to establish interrupt\n"); - bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_size = 0; - return; - } - - /* Establish device connect interrupt. */ -#if 0 - sc->sc_conn_ih = pxa2x0_gpio_intr_establish(PXA_USB_DEVICE_PIN, /* XXX */ - IST_EDGE_BOTH, IPL_USB, pxaudc_connect_intr, sc, "usbc"); -#endif - sc->sc_conn_ih = pxa2x0_gpio_intr_establish(sc->sc_gpio_detect, - IST_EDGE_BOTH, IPL_USB, pxaudc_connect_intr, sc, "usbc"); - if (sc->sc_conn_ih == NULL) { - printf(": unable to establish connect interrupt\n"); - pxa2x0_intr_disestablish(sc->sc_ih); - bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_ioh = 0; - sc->sc_size = 0; - return; - } - - /* Set up the bus struct. */ - sc->sc_bus.methods = &pxaudc_bus_methods; - sc->sc_bus.pipe_size = sizeof(struct pxaudc_pipe); - sc->sc_bus.ep0_maxp = PXAUDC_EP0MAXP; - sc->sc_bus.usbrev = USBREV_1_1; - sc->sc_bus.dmatag = pxa->pxa_dmat; - sc->sc_npipe = 0; /* ep0 is always there. */ - - sc->sc_ep_map[0] = 0; - /* 16 == max logical endpoints */ - for (i = 1; i < 16; i++) { - sc->sc_ep_map[i] = -1; - } - - /* Attach logical device and function. */ - (void)config_found((struct device *)sc, &sc->sc_bus, NULL); - - /* Enable the controller unless we're now acting as a host. */ - if (!sc->sc_is_host()) - pxaudc_enable(sc); -#endif -} - -int -pxaudc_detach(struct pxaudc_softc *sc, int flags) -{ - if (sc->sc_conn_ih != NULL) - pxa2x0_gpio_intr_disestablish(sc->sc_conn_ih); - - if (sc->sc_ih != NULL) - pxa2x0_intr_disestablish(sc->sc_ih); - - if (sc->sc_size) { - bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_size = 0; - } - - return (0); -} - -int -pxaudc_activate(struct pxaudc_softc *self, int act) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)self; - - switch (act) { - case DVACT_SUSPEND: - pxaudc_disable(sc); - break; - case DVACT_RESUME: - pxaudc_enable(sc); - break; - } - return 0; -} - -/* - * Register manipulation - */ - -#if 0 -static void -pxaudc_dump_regs(struct pxaudc_softc *sc) -{ - printf("UDCCR\t%b\n", CSR_READ_4(sc, USBDC_UDCCR), - USBDC_UDCCR_BITS); - printf("UDCICR0\t%b\n", CSR_READ_4(sc, USBDC_UDCICR0), - USBDC_UDCISR0_BITS); - printf("UDCICR1\t%b\n", CSR_READ_4(sc, USBDC_UDCICR1), - USBDC_UDCISR1_BITS); - printf("OTGICR\t%b\n", CSR_READ_4(sc, USBDC_UDCOTGICR), - USBDC_UDCOTGISR_BITS); -} -#endif - -void -pxaudc_enable(struct pxaudc_softc *sc) -{ - int i; - - DPRINTF(10,("pxaudc_enable\n")); - - /* Start the clocks. */ - pxa2x0_clkman_config(CKEN_USBDC, 1); - -#if 0 - /* Configure Port 2 for USB device. */ - CSR_WRITE_4(sc, USBDC_UP2OCR, USBDC_UP2OCR_DMPUE | - USBDC_UP2OCR_DPPUE | USBDC_UP2OCR_HXOE); -#else - /* Configure Port 2 for USB device. */ - CSR_WRITE_4(sc, USBDC_UP2OCR, USBDC_UP2OCR_DPPUE | USBDC_UP2OCR_HXOE); -#endif - - CSR_SET_4(sc, USBDC_UDCCR, 0); - sc->sc_icr0 = 0; - sc->sc_icr1 = 0; - - for (i = 1; i < PXAUDC_NEP; i++) - CSR_WRITE_4(sc, USBDC_UDCECR(i), 0); /* disable endpoints */ - - for (i = 1; i < sc->sc_npipe; i++) { - if (sc->sc_pipe[i] != NULL) { - struct usbf_endpoint *ep = - sc->sc_pipe[i]->pipe.endpoint; - u_int32_t cr; - int dir = usbf_endpoint_dir(ep); - usb_endpoint_descriptor_t *ed = ep->edesc; - - if (i < 16) - sc->sc_icr0 |= USBDC_UDCICR0_IE(i); - else - sc->sc_icr1 |= USBDC_UDCICR1_IE(i-16); - - cr = USBDC_UDCECR_EE | USBDC_UDCECR_DE; - cr |= USBDC_UDCECR_ENs( - UE_GET_ADDR(ed->bEndpointAddress)); - cr |= USBDC_UDCECR_MPSs(UGETW(ed->wMaxPacketSize)); - cr |= USBDC_UDCECR_ETs(ed->bmAttributes & UE_XFERTYPE); - if (dir == UE_DIR_IN) - cr |= USBDC_UDCECR_ED; - - /* XXX - until pipe has cn/in/ain */ - cr |= USBDC_UDCECR_AISNs(0) | USBDC_UDCECR_INs(0) | - USBDC_UDCECR_CNs(1); - - CSR_WRITE_4(sc, USBDC_UDCECR(i), cr); - - /* clear old status */ - CSR_WRITE_4(sc, USBDC_UDCCSR(1), - USBDC_UDCCSR_PC | USBDC_UDCCSR_TRN | - USBDC_UDCCSR_SST | USBDC_UDCCSR_FEF); - } - } - - CSR_WRITE_4(sc, USBDC_UDCISR0, 0xffffffff); /* clear all */ - CSR_WRITE_4(sc, USBDC_UDCISR1, 0xffffffff); /* clear all */ - CSR_SET_4(sc, USBDC_UDCCSR0, USBDC_UDCCSR0_ACM); - - - /* Enable interrupts for configured endpoints. */ - CSR_WRITE_4(sc, USBDC_UDCICR0, USBDC_UDCICR0_IE(0) | - sc->sc_icr0); - - CSR_WRITE_4(sc, USBDC_UDCICR1, USBDC_UDCICR1_IERS | - USBDC_UDCICR1_IESU | USBDC_UDCICR1_IERU | - USBDC_UDCICR1_IECC | sc->sc_icr1); - - /* Enable the controller. */ - CSR_CLR_4(sc, USBDC_UDCCR, USBDC_UDCCR_EMCE); - CSR_SET_4(sc, USBDC_UDCCR, USBDC_UDCCR_UDE); - - /* Enable USB client on port 2. */ - pxa2x0_gpio_clear_bit(37); /* USB_P2_8 */ -} - -void -pxaudc_disable(struct pxaudc_softc *sc) -{ - DPRINTF(10,("pxaudc_disable\n")); - - /* Disable the controller. */ - CSR_CLR_4(sc, USBDC_UDCCR, USBDC_UDCCR_UDE); - - /* Disable all interrupts. */ - CSR_WRITE_4(sc, USBDC_UDCICR0, 0); - CSR_WRITE_4(sc, USBDC_UDCICR1, 0); - CSR_WRITE_4(sc, USBDC_UDCOTGICR, 0); - - /* Set Port 2 output to "Non-OTG Host with Differential Port". */ - CSR_WRITE_4(sc, USBDC_UP2OCR, USBDC_UP2OCR_HXS | USBDC_UP2OCR_HXOE); - - /* Set "Host Port 2 Transceiver D Pull Down Enable". */ - CSR_SET_4(sc, USBDC_UP2OCR, USBDC_UP2OCR_DMPDE); - - /* Stop the clocks. */ - pxa2x0_clkman_config(CKEN_USBDC, 0); - - /* Enable USB host on port 2. */ - pxa2x0_gpio_set_bit(37); /* USB_P2_8 */ -} - -#if NUSBF > 0 - -/* - * Endpoint FIFO handling - */ - -void -pxaudc_read_ep0(struct pxaudc_softc *sc, struct usbf_xfer *xfer) -{ - size_t len; - u_int8_t *p; - - xfer->actlen = CSR_READ_4(sc, USBDC_UDCBCR(0)); - len = MIN(xfer->actlen, xfer->length); - p = xfer->buffer; - - while (CSR_READ_4(sc, USBDC_UDCCSR0) & USBDC_UDCCSR0_RNE) { - u_int32_t v = CSR_READ_4(sc, USBDC_UDCDR(0)); - - if (len > 0) { - if (((unsigned)p & 0x3) == 0) - *(u_int32_t *)p = v; - else { - *(p+0) = v & 0xff; - *(p+1) = (v >> 8) & 0xff; - *(p+2) = (v >> 16) & 0xff; - *(p+3) = (v >> 24) & 0xff; - } - p += 4; - len -= 4; - } - } - - CSR_WRITE_4(sc, USBDC_UDCCSR0, USBDC_UDCCSR0_SA | USBDC_UDCCSR0_OPC); - - xfer->status = USBF_NORMAL_COMPLETION; - usbf_transfer_complete(xfer); -} - -void -pxaudc_read_epN(struct pxaudc_softc *sc, int ep) -{ - size_t len, tlen; - u_int8_t *p; - struct pxaudc_pipe *ppipe; - struct usbf_pipe *pipe = NULL; - struct usbf_xfer *xfer = NULL; - int count; - u_int32_t csr; - - ppipe = sc->sc_pipe[ep]; - - if (ppipe == NULL) { - return; - } - pipe = &ppipe->pipe; -again: - xfer = SIMPLEQ_FIRST(&pipe->queue); - - if (xfer == NULL) { - printf("pxaudc_read_epN: ep %d, no xfer\n", ep); - return; - } - - count = CSR_READ_4(sc, USBDC_UDCBCR(ep)); - tlen = len = MIN(count, xfer->length - xfer->actlen); - p = xfer->buffer + xfer->actlen; - csr = CSR_READ_4(sc, USBDC_UDCCSR(ep)); - - if ((csr & USBDC_UDCCSR_PC) && count == 0) - { -#ifdef DEBUG_RX - printf("trans1 complete\n"); -#endif - xfer->status = USBF_NORMAL_COMPLETION; - usbf_transfer_complete(xfer); - CSR_SET_4(sc, USBDC_UDCCSR(ep), USBDC_UDCCSR_PC); - return; - } - -#ifdef DEBUG_RX - printf("reading data from endpoint %x, len %x csr %x", - ep, count, csr); -#endif - - while (CSR_READ_4(sc, USBDC_UDCCSR(ep)) & USBDC_UDCCSR_BNE) { - u_int32_t v = CSR_READ_4(sc, USBDC_UDCDR(ep)); - - /* double buffering? */ - if (len > 0) { - if (((unsigned)p & 0x3) == 0) - *(u_int32_t *)p = v; - else { - *(p+0) = v & 0xff; - *(p+1) = (v >> 8) & 0xff; - *(p+2) = (v >> 16) & 0xff; - *(p+3) = (v >> 24) & 0xff; - } - p += 4; - len -= 4; - xfer->actlen += 4; - } - count -= 4; - } - CSR_SET_4(sc, USBDC_UDCCSR(ep), USBDC_UDCCSR_PC); - - - if (xfer->length == xfer->actlen || (tlen == 0 && xfer->actlen != 0) || - csr & USBDC_UDCCSR_SP) { -#ifdef DEBUG_RX - printf("trans2 complete\n"); -#endif - xfer->status = USBF_NORMAL_COMPLETION; - usbf_transfer_complete(xfer); - } - csr = CSR_READ_4(sc, USBDC_UDCCSR(ep)); -#ifdef DEBUG_RX - printf("csr now %x len %x\n", - csr, CSR_READ_4(sc, USBDC_UDCBCR(ep))); -#endif - if (csr & USBDC_UDCCSR_PC) - goto again; -} - -void -pxaudc_write_ep0(struct pxaudc_softc *sc, struct usbf_xfer *xfer) -{ - struct pxaudc_xfer *lxfer = (struct pxaudc_xfer *)xfer; - u_int32_t len; - u_int8_t *p; - - if (lxfer->frmlen > 0) { - xfer->actlen += lxfer->frmlen; - lxfer->frmlen = 0; - } - - DPRINTF(11,("%s: ep0 ctrl-in, xfer=%p, len=%u, actlen=%u\n", - DEVNAME(sc), xfer, xfer->length, xfer->actlen)); - - if (xfer->actlen >= xfer->length) { - sc->sc_ep0state = EP0_SETUP; - usbf_transfer_complete(xfer); - return; - } - - sc->sc_ep0state = EP0_IN; - - p = (u_char *)xfer->buffer + xfer->actlen; - len = xfer->length - xfer->actlen; - len = MIN(len, PXAUDC_EP0MAXP); - lxfer->frmlen = len; - - while (len >= 4) { - u_int32_t v; - - if (((unsigned)p & 0x3) == 0) - v = *(u_int32_t *)p; - else { - v = *(p+0); - v |= *(p+1) << 8; - v |= *(p+2) << 16; - v |= *(p+3) << 24; - } - - CSR_WRITE_4(sc, USBDC_UDCDR(0), v); - len -= 4; - p += 4; - } - - while (len > 0) { - CSR_WRITE_1(sc, USBDC_UDCDR(0), *p); - len--; - p++; - } - - /* (12.6.7) Set IPR only for short packets. */ - if (lxfer->frmlen < PXAUDC_EP0MAXP) - CSR_SET_4(sc, USBDC_UDCCSR0, USBDC_UDCCSR0_IPR); -} - -void -pxaudc_write(struct pxaudc_softc *sc, struct usbf_xfer *xfer) -{ - u_int8_t *p; - int ep = sc->sc_ep_map[usbf_endpoint_index(xfer->pipe->endpoint)]; - int tlen = 0; - int maxp = UGETW(xfer->pipe->endpoint->edesc->wMaxPacketSize); - u_int32_t csr, csr_o; - -#ifdef DEBUG_TX_PKT - if (xfer->actlen == 0) - printf("new packet len %x\n", xfer->length); -#endif - -#ifdef DEBUG_TX - printf("writing data to endpoint %x, xlen %x xact %x\n", - ep, xfer->length, xfer->actlen); -#endif - - - if (xfer->actlen == xfer->length) { - /* - * If the packet size is wMaxPacketSize byte multiple - * send a zero packet to indicate termiation. - */ - if ((xfer->actlen % maxp) == 0 && - xfer->status != USBF_NORMAL_COMPLETION && - xfer->flags & USBD_FORCE_SHORT_XFER) { - if (CSR_READ_4(sc, USBDC_UDCCSR(ep)) - & USBDC_UDCCSR_BNF) { - CSR_SET_4(sc, USBDC_UDCCSR(ep), - USBDC_UDCCSR_SP); - /* - * if we send a zero packet, we are 'done', but - * dont to usbf_transfer_complete() just yet - * because the short packet will cause another - * interrupt. - */ - xfer->status = USBF_NORMAL_COMPLETION; - return; - } else { - printf("fifo full when trying to set short packet\n"); - } - } - xfer->status = USBF_NORMAL_COMPLETION; -#ifdef DEBUG_TX_PKT - printf("packet complete %x\n", xfer->actlen); -#endif - usbf_transfer_complete(xfer); - return; - } - - p = xfer->buffer + xfer->actlen; - - - - csr_o = 0; - csr = CSR_READ_4(sc, USBDC_UDCCSR(ep)); - if (csr & USBDC_UDCCSR_PC) - csr_o |= USBDC_UDCCSR_PC; - if (csr & USBDC_UDCCSR_TRN) - csr_o |= USBDC_UDCCSR_TRN; - if (csr & USBDC_UDCCSR_SST) - csr_o |= USBDC_UDCCSR_SST; - if (csr_o != 0) - CSR_WRITE_4(sc, USBDC_UDCCSR(ep), csr_o); - - - while (CSR_READ_4(sc, USBDC_UDCCSR(ep)) & USBDC_UDCCSR_BNF) { - u_int32_t v; - - if (xfer->length - xfer->actlen < 4) { - while (xfer->actlen < xfer->length) { - CSR_WRITE_1(sc, USBDC_UDCDR(ep), *p); - p++; - xfer->actlen++; - tlen++; - } - break; - } - if (((unsigned)p & 0x3) == 0) - v = *(u_int32_t *)p; - else { - v = *(p+0); - v |= *(p+1) << 8; - v |= *(p+2) << 16; - v |= *(p+3) << 24; - } - CSR_WRITE_4(sc, USBDC_UDCDR(ep), v); - - p += 4; - xfer->actlen += 4; - - tlen += 4; - } -#ifdef DEBUG_TX - printf(" wrote tlen %x %x\n", tlen, xfer->actlen); - if (xfer->actlen == 0) { - printf("whoa, write_ep called, but no free space\n"); - } -#endif - if (xfer->actlen == xfer->length) { - if ((xfer->actlen % maxp) != 0) { - if (xfer->flags & USBD_FORCE_SHORT_XFER) { - CSR_SET_4(sc, USBDC_UDCCSR(ep), USBDC_UDCCSR_SP); -#ifdef DEBUG_TX - printf("setting short packet on %x csr\n", ep, - CSR_READ_4(sc, USBDC_UDCCSR(ep))); -#endif - } else { - /* fill buffer to maxpacket size??? */ - } - } - } -} - -/* - * Interrupt handling - */ - -int -pxaudc_connect_intr(void *v) -{ - struct pxaudc_softc *sc = v; - - DPRINTF(10,("pxaudc_connect_intr: connect=%d\n", - pxa2x0_gpio_get_bit(sc->sc_gpio_detect))); - - /* XXX only set a flag here */ - if (sc->sc_is_host()) { -#if 0 - printf("%s:switching to host\n", sc->sc_bus.bdev.dv_xname); -#endif - pxaudc_disable(sc); - } else { -#if 0 - printf("%s:switching to client\n", sc->sc_bus.bdev.dv_xname); -#endif - pxaudc_enable(sc); - } - - /* Claim this interrupt. */ - return 1; -} - -int -pxaudc_intr(void *v) -{ - struct pxaudc_softc *sc = v; - u_int32_t isr0, isr1, otgisr; - - isr0 = CSR_READ_4(sc, USBDC_UDCISR0); - isr1 = CSR_READ_4(sc, USBDC_UDCISR1); - otgisr = CSR_READ_4(sc, USBDC_UDCOTGISR); - - DPRINTF(10,("pxaudc_intr: isr0=%b, isr1=%b, otgisr=%b\n", - isr0, USBDC_UDCISR0_BITS, isr1, USBDC_UDCISR1_BITS, - otgisr, USBDC_UDCOTGISR_BITS)); - - if (isr0 || isr1 || otgisr) { - sc->sc_isr0 |= isr0; - sc->sc_isr1 |= isr1; - sc->sc_otgisr |= otgisr; - - //usbf_schedsoftintr(&sc->sc_bus); - pxaudc_intr1(sc); /* XXX */ - } - - CSR_WRITE_4(sc, USBDC_UDCISR0, isr0); - CSR_WRITE_4(sc, USBDC_UDCISR1, isr1); - CSR_WRITE_4(sc, USBDC_UDCOTGISR, otgisr); - - /* Claim this interrupt. */ - return 1; -} -u_int32_t csr1, csr2; - -void -pxaudc_intr1(struct pxaudc_softc *sc) -{ - u_int32_t isr0, isr1, otgisr; - int i; - //int s; - - //s = splhardusb(); - isr0 = sc->sc_isr0; - isr1 = sc->sc_isr1; - otgisr = sc->sc_otgisr; - sc->sc_isr0 = 0; - sc->sc_isr1 = 0; - sc->sc_otgisr = 0; - //splx(s); - - sc->sc_bus.intr_context++; - - if (isr1 & USBDC_UDCISR1_IRCC) { - u_int32_t ccr; - CSR_SET_4(sc, USBDC_UDCCR, USBDC_UDCCR_SMAC); - - /* wait for reconfig to finish (SMAC auto clears) */ - while (CSR_READ_4(sc, USBDC_UDCCR) & USBDC_UDCCR_SMAC) - delay(10); - - ccr = CSR_READ_4(sc, USBDC_UDCCR); - sc->sc_cn = USBDC_UDCCR_ACNr(ccr); - sc->sc_in = USBDC_UDCCR_AINr(ccr); - sc->sc_isn = USBDC_UDCCR_AAISNr(ccr); - goto ret; - } -#if 0 - printf("pxaudc_intr: isr0=%b, isr1=%b, otgisr=%b\n", - isr0, USBDC_UDCISR0_BITS, isr1, USBDC_UDCISR1_BITS, - otgisr, USBDC_UDCOTGISR_BITS); -#endif - - /* Handle USB RESET condition. */ - if (isr1 & USBDC_UDCISR1_IRRS) { - sc->sc_ep0state = EP0_SETUP; - usbf_host_reset(&sc->sc_bus); - /* Discard all other interrupts. */ - goto ret; - } - - /* Service control pipe interrupts. */ - if (isr0 & USBDC_UDCISR0_IR(0)) - pxaudc_ep0_intr(sc); - - for (i = 1; i < 24; i++) { - if (i < 16) { - if (USBDC_UDCISR0_IRs(isr0,i)) - pxaudc_epN_intr(sc, i, - USBDC_UDCISR0_IRs(isr0,i)); - } else { - if (USBDC_UDCISR1_IRs(isr1,i)) - pxaudc_epN_intr(sc, i, - USBDC_UDCISR1_IRs(isr1,i)); - } - } - - if (isr1 & USBDC_UDCISR1_IRSU) { - /* suspend ?? */ - } - if (isr1 & USBDC_UDCISR1_IRRU) { - /* resume ?? */ - } - -ret: - sc->sc_bus.intr_context--; -} - -void -pxaudc_epN_intr(struct pxaudc_softc *sc, int ep, int isr) -{ - struct pxaudc_pipe *ppipe; - struct usbf_pipe *pipe; - int dir; - - /* should not occur before device is configured */ - if (sc->sc_cn == 0) - return; - if (isr & 2) - printf("ep%d: fifo error\n", ep); /* XXX */ - - /* faster method of determining direction? */ - ppipe = sc->sc_pipe[ep]; - - if (ppipe == NULL) - return; - pipe = &ppipe->pipe; - dir = usbf_endpoint_dir(pipe->endpoint); - - if (dir == UE_DIR_IN) { - pxaudc_write_epN(sc, ep); - } else { - pxaudc_read_epN(sc, ep); - } - -} - -void -pxaudc_write_epN(struct pxaudc_softc *sc, int ep) -{ - struct pxaudc_pipe *ppipe; - struct usbf_pipe *pipe = NULL; - struct usbf_xfer *xfer = NULL; - - ppipe = sc->sc_pipe[ep]; - - if (ppipe == NULL) { - return; - } - pipe = &ppipe->pipe; - xfer = SIMPLEQ_FIRST(&pipe->queue); - if (xfer != NULL) - pxaudc_write(sc, xfer); -} -void -pxaudc_ep0_intr(struct pxaudc_softc *sc) -{ - struct pxaudc_pipe *ppipe; - struct usbf_pipe *pipe = NULL; - struct usbf_xfer *xfer = NULL; - u_int32_t csr0; - - csr0 = CSR_READ_4(sc, USBDC_UDCCSR0); - DPRINTF(10,("pxaudc_ep0_intr: csr0=%b\n", csr0, USBDC_UDCCSR0_BITS)); - delay (25); - - ppipe = sc->sc_pipe[0]; - if (ppipe != NULL) { - pipe = &ppipe->pipe; - xfer = SIMPLEQ_FIRST(&pipe->queue); - } - - if (sc->sc_ep0state == EP0_SETUP && (csr0 & USBDC_UDCCSR0_OPC)) { - if (pipe == NULL) { - DPRINTF(10,("pxaudc_ep0_intr: no control pipe\n")); - return; - } - - if (xfer == NULL) { - DPRINTF(10,("pxaudc_ep0_intr: no xfer\n")); - return; - } - - pxaudc_read_ep0(sc, xfer); - } else if (sc->sc_ep0state == EP0_IN && - (csr0 & USBDC_UDCCSR0_IPR) == 0 && xfer) { - pxaudc_write_ep0(sc, xfer); - } -} - -/* - * Bus methods - */ - -usbf_status -pxaudc_open(struct usbf_pipe *pipe) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)pipe->device->bus; - struct pxaudc_pipe *ppipe = (struct pxaudc_pipe *)pipe; - int ep_idx; - int s; - - ep_idx = usbf_endpoint_index(pipe->endpoint); - if (ep_idx >= PXAUDC_NEP) - return USBF_BAD_ADDRESS; - - DPRINTF(10,("pxaudc_open\n")); - s = splhardusb(); - - switch (usbf_endpoint_type(pipe->endpoint)) { - case UE_CONTROL: - pipe->methods = &pxaudc_ctrl_methods; - break; - - case UE_BULK: - pipe->methods = &pxaudc_bulk_methods; - break; - - case UE_ISOCHRONOUS: - case UE_INTERRUPT: - default: - /* XXX */ - splx(s); - return USBF_BAD_ADDRESS; - } - - if (ep_idx != 0 && sc->sc_ep_map[ep_idx] != -1) { - printf("endpoint %d already used by %c", - ep_idx, '@'+ sc->sc_ep_map[0]); - splx(s); - return USBF_BAD_ADDRESS; - } - sc->sc_ep_map[ep_idx] = sc->sc_npipe; - - sc->sc_pipe[sc->sc_npipe] = ppipe; - sc->sc_npipe++; - - splx(s); - return USBF_NORMAL_COMPLETION; -} - -void -pxaudc_softintr(void *v) -{ - struct pxaudc_softc *sc = v; - - pxaudc_intr1(sc); -} - -usbf_status -pxaudc_allocm(struct usbf_bus *bus, struct usb_dma *dmap, u_int32_t size) -{ - return usbf_allocmem(bus, size, 0, dmap); -} - -void -pxaudc_freem(struct usbf_bus *bus, struct usb_dma *dmap) -{ - usbf_freemem(bus, dmap); -} - -struct usbf_xfer * -pxaudc_allocx(struct usbf_bus *bus) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)bus; - struct usbf_xfer *xfer; - - xfer = SIMPLEQ_FIRST(&sc->sc_free_xfers); - if (xfer != NULL) - SIMPLEQ_REMOVE_HEAD(&sc->sc_free_xfers, next); - else - xfer = malloc(sizeof(struct pxaudc_xfer), M_USB, M_NOWAIT); - if (xfer != NULL) - bzero(xfer, sizeof(struct pxaudc_xfer)); - return xfer; -} - -void -pxaudc_freex(struct usbf_bus *bus, struct usbf_xfer *xfer) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)bus; - - SIMPLEQ_INSERT_HEAD(&sc->sc_free_xfers, xfer, next); -} - -/* - * Control pipe methods - */ - -usbf_status -pxaudc_ctrl_transfer(struct usbf_xfer *xfer) -{ - usbf_status err; - - /* Insert last in queue. */ - err = usbf_insert_transfer(xfer); - if (err) - return err; - - /* - * Pipe isn't running (otherwise err would be USBF_IN_PROGRESS), - * so start first. - */ - return pxaudc_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue)); -} - -usbf_status -pxaudc_ctrl_start(struct usbf_xfer *xfer) -{ - struct usbf_pipe *pipe = xfer->pipe; - struct pxaudc_softc *sc = (struct pxaudc_softc *)pipe->device->bus; - int iswrite = !(xfer->rqflags & URQ_REQUEST); - int s; - - s = splusb(); - xfer->status = USBF_IN_PROGRESS; - if (iswrite) - pxaudc_write_ep0(sc, xfer); - else { - /* XXX boring message, this case is normally reached if - * XXX the xfer for a device request is being queued. */ - DPRINTF(10,("%s: ep[%x] ctrl-out, xfer=%p, len=%u, " - "actlen=%u\n", DEVNAME(sc), - usbf_endpoint_address(xfer->pipe->endpoint), - xfer, xfer->length, - xfer->actlen)); - } - splx(s); - return USBF_IN_PROGRESS; -} - -/* (also used by bulk pipes) */ -void -pxaudc_ctrl_abort(struct usbf_xfer *xfer) -{ - int s; -#ifdef PXAUDC_DEBUG - struct usbf_pipe *pipe = xfer->pipe; - struct pxaudc_softc *sc = (struct pxaudc_softc *)pipe->device->bus; - int index = usbf_endpoint_index(pipe->endpoint); - int dir = usbf_endpoint_dir(pipe->endpoint); - int type = usbf_endpoint_type(pipe->endpoint); -#endif - - DPRINTF(10,("%s: ep%d %s-%s abort, xfer=%p\n", DEVNAME(sc), index, - type == UE_CONTROL ? "ctrl" : "bulk", dir == UE_DIR_IN ? - "in" : "out", xfer)); - - /* - * Step 1: Make soft interrupt routine and hardware ignore the xfer. - */ - s = splusb(); - xfer->status = USBF_CANCELLED; - timeout_del(&xfer->timeout_handle); - splx(s); - - /* - * Step 2: Make sure hardware has finished any possible use of the - * xfer and the soft interrupt routine has run. - */ - s = splusb(); - /* XXX this does not seem right, what if there - * XXX are two xfers in the FIFO and we only want to - * XXX ignore one? */ -#ifdef notyet - pxaudc_flush(sc, usbf_endpoint_address(pipe->endpoint)); -#endif - /* XXX we're not doing DMA and the soft interrupt routine does not - XXX need to clean up anything. */ - splx(s); - - /* - * Step 3: Execute callback. - */ - s = splusb(); - usbf_transfer_complete(xfer); - splx(s); -} - -void -pxaudc_ctrl_done(struct usbf_xfer *xfer) -{ -} - -void -pxaudc_ctrl_close(struct usbf_pipe *pipe) -{ - /* XXX */ -} - -/* - * Bulk pipe methods - */ - -usbf_status -pxaudc_bulk_transfer(struct usbf_xfer *xfer) -{ - usbf_status err; - - /* Insert last in queue. */ - err = usbf_insert_transfer(xfer); - if (err) - return err; - - /* - * Pipe isn't running (otherwise err would be USBF_IN_PROGRESS), - * so start first. - */ - return pxaudc_bulk_start(SIMPLEQ_FIRST(&xfer->pipe->queue)); -} - -usbf_status -pxaudc_bulk_start(struct usbf_xfer *xfer) -{ - struct usbf_pipe *pipe = xfer->pipe; - struct pxaudc_softc *sc = (struct pxaudc_softc *)pipe->device->bus; - int iswrite = (usbf_endpoint_dir(pipe->endpoint) == UE_DIR_IN); - int s; - - DPRINTF(0,("%s: ep%d bulk-%s start, xfer=%p, len=%u\n", DEVNAME(sc), - usbf_endpoint_index(pipe->endpoint), iswrite ? "in" : "out", - xfer, xfer->length)); - - s = splusb(); - xfer->status = USBF_IN_PROGRESS; - if (iswrite) - pxaudc_write(sc, xfer); - else { - /* enable interrupt */ - } - splx(s); - return USBF_IN_PROGRESS; -} - -void -pxaudc_bulk_abort(struct usbf_xfer *xfer) -{ - pxaudc_ctrl_abort(xfer); -} - -void -pxaudc_bulk_done(struct usbf_xfer *xfer) -{ -#if 0 - int ep = usbf_endpoint_address(xfer->pipe->endpoint); - struct usbf_pipe *pipe = xfer->pipe; - struct pxaudc_softc *sc = (struct pxaudc_softc *)pipe->device->bus; - -#endif -} - -void -pxaudc_bulk_close(struct usbf_pipe *pipe) -{ - /* XXX */ -} - -#endif /* NUSBF > 0 */ diff --git a/sys/arch/arm/xscale/pxa27x_udc.h b/sys/arch/arm/xscale/pxa27x_udc.h deleted file mode 100644 index f3d97217a02..00000000000 --- a/sys/arch/arm/xscale/pxa27x_udc.h +++ /dev/null @@ -1,68 +0,0 @@ -/* $OpenBSD: pxa27x_udc.h,v 1.4 2013/10/24 22:40:10 aalm Exp $ */ -/* - * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> - * - * Moved from pxa27x_udc.c: - * - * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <arm/xscale/pxa27x_udcreg.h> - -#define PXAUDC_EP0MAXP 16 /* XXX */ -#define PXAUDC_NEP 24 /* total number of endpoints */ - -struct pxaudc_softc { - struct usbf_bus sc_bus; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - bus_size_t sc_size; - void *sc_ih; - void *sc_conn_ih; - SIMPLEQ_HEAD(,usbf_xfer) sc_free_xfers; /* recycled xfers */ - u_int32_t sc_icr0; /* enabled EP interrupts */ - u_int32_t sc_icr1; /* enabled EP interrupts */ - enum { - EP0_SETUP, - EP0_IN - } sc_ep0state; - u_int32_t sc_isr0; /* XXX deferred interrupts */ - u_int32_t sc_isr1; /* XXX deferred interrupts */ - u_int32_t sc_otgisr; /* XXX deferred interrupts */ - struct pxaudc_pipe *sc_pipe[PXAUDC_NEP]; - int sc_npipe; - - int sc_cn; - int sc_in; - int sc_isn; - int8_t sc_ep_map[16]; - - struct device *sc_dev; - - int sc_gpio_detect; - int sc_gpio_detect_inv; - - int sc_gpio_pullup; - int sc_gpio_pullup_inv; - - int (*sc_is_host)(void); -}; - -int pxaudc_match(void); -void pxaudc_attach(struct pxaudc_softc *, void *); -int pxaudc_detach(struct pxaudc_softc *, int); -int pxaudc_activate(struct pxaudc_softc *, int); diff --git a/sys/arch/arm/xscale/pxa27x_udcreg.h b/sys/arch/arm/xscale/pxa27x_udcreg.h deleted file mode 100644 index 1d95141ecf0..00000000000 --- a/sys/arch/arm/xscale/pxa27x_udcreg.h +++ /dev/null @@ -1,189 +0,0 @@ -/* $OpenBSD: pxa27x_udcreg.h,v 1.5 2007/02/25 01:40:12 drahn Exp $ */ - -/* - * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * Register Descriptions for the USB Device Controller - * - * Reference: - * Intel(r) PXA27x Processor Family - * Developer's Manual - * (2800002.pdf) - */ - -#ifndef _ARM_XSCALE_PXA27X_UDCREG_H_ -#define _ARM_XSCALE_PXA27X_UDCREG_H_ - -#define USBDC_UDCCR 0x0000 /* UDC Control Register */ -#define USBDC_UDCCR_UDE (1<<0) /* UDC Enable */ -#define USBDC_UDCCR_UDA (1<<1) /* UDC Active */ -#define USBDC_UDCCR_UDR (1<<2) /* UDC Resume */ -#define USBDC_UDCCR_EMCE (1<<3) /* Endpoint Mem Config Error */ -#define USBDC_UDCCR_SMAC (1<<4) /* Switch EndPt Mem to Active Config */ -#define USBDC_UDCCR_AAISN (7<<5) /* Active UDC Alt Iface Setting */ -#define USBDC_UDCCR_AAISNr(x) ((x>>5)&7) /* Active UDC Config */ -#define USBDC_UDCCR_AIN (7<<8) /* Active UDC Iface */ -#define USBDC_UDCCR_AINr(x) ((x>>8)&7) /* Active UDC Config */ -#define USBDC_UDCCR_ACN (7<<11) /* Active UDC Config */ -#define USBDC_UDCCR_ACNr(x) ((x>>11)&7) /* Active UDC Config */ -#define USBDC_UDCCR_DWRE (1<<16) /* Device Remote Wake-Up Feature */ -#define USBDC_UDCCR_BHNP (1<<28) /* B-Device Host Neg Proto Enable */ -#define USBDC_UDCCR_AHNP (1<<29) /* A-Device Host NEg Proto Support */ -#define USBDC_UDCCR_AALTHNP (1<<30) /* A-Dev Alt Host Neg Proto Port Sup */ -#define USBDC_UDCCR_OEN (1<<31) /* On-The-Go Enable */ -#define USBDC_UDCICR0 0x0004 /* UDC Interrupt Control Register 0 */ -#define USBDC_UDCICR0_IE(n) (3<<((n)*2)) /* Interrupt Enables */ -#define USBDC_UDCICR1 0x0008 /* UDC Interrupt Control Register 1 */ -#define USBDC_UDCICR1_IE(n) (3<<((n)*2)) /* Interrupt Enables */ -#define USBDC_UDCICR1_IERS (1<<27) /* Interrupt Enable Reset */ -#define USBDC_UDCICR1_IESU (1<<28) /* Interrupt Enable Suspend */ -#define USBDC_UDCICR1_IERU (1<<29) /* Interrupt Enable Resume */ -#define USBDC_UDCICR1_IESOF (1<<30) /* Interrupt Enable Start of Frame */ -#define USBDC_UDCICR1_IECC (1<<31) /* Interrupt Enable Config Change */ -#define USBDC_UDCISR0 0x000c /* UDC Interrupt Status Register 0 */ -#define USBDC_UDCISR0_IR(n) (3<<((n)*2)) /* Interrupt Requests */ -#define USBDC_UDCISR0_IRs(v,n) (((v)>>((n)*2))&3) /* Interrupt Requests */ -#define USBDC_UDCISR1 0x0010 /* UDC Interrupt Status Register 1 */ -#define USBDC_UDCISR1_IR(n) (3<<((n)*2)) /* Interrupt Requests */ -#define USBDC_UDCISR1_IRs(v,n) (((v)>>((n)*2))&3) /* Interrupt Requests */ -#define USBDC_UDCISR1_IRRS (1<<27) /* Interrupt Enable Reset */ -#define USBDC_UDCISR1_IRSU (1<<28) /* Interrupt Enable Suspend */ -#define USBDC_UDCISR1_IRRU (1<<29) /* Interrupt Enable Resume */ -#define USBDC_UDCISR1_IRSOF (1<<30) /* Interrupt Enable Start of Frame */ -#define USBDC_UDCISR1_IRCC (1<<31) /* Interrupt Enable Config Change */ -#define USBDC_UDCFNR 0x0014 /* UDC Frame Number Register */ -#define USBDC_UDCFNR_FN (1023<<0) /* Frame Number */ -#define USBDC_UDCOTGICR 0x0018 /* UDC OTG Interrupt Control Register */ -#define USBDC_UDCOTGICR_IEIDF (1<<0) /* OTG ID Change Fall Intr En */ -#define USBDC_UDCOTGICR_IEIDR (1<<1) /* OTG ID Change Ris Intr En */ -#define USBDC_UDCOTGICR_IESDF (1<<2) /* OTG A-Dev SRP Detect Fall Intr En */ -#define USBDC_UDCOTGICR_IESDR (1<<3) /* OTG A-Dev SRP Detect Ris Intr En */ -#define USBDC_UDCOTGICR_IESVF (1<<4) /* OTG Session Valid Fall Intr En */ -#define USBDC_UDCOTGICR_IESVR (1<<5) /* OTG Session Valid Ris Intr En */ -#define USBDC_UDCOTGICR_IEVV44F (1<<6) /* OTG Vbus Valid 4.4V Fall Intr En */ -#define USBDC_UDCOTGICR_IEVV44R (1<<7) /* OTG Vbus Valid 4.4V Ris Intr En */ -#define USBDC_UDCOTGICR_IEVV40F (1<<8) /* OTG Vbus Valid 4.0V Fall Intr En */ -#define USBDC_UDCOTGICR_IEVV40R (1<<9) /* OTG Vbus Valid 4.0V Ris Intr En */ -#define USBDC_UDCOTGICR_IEXF (1<<16) /* Extern Transceiver Intr Fall En */ -#define USBDC_UDCOTGICR_IEXR (1<<17) /* Extern Transceiver Intr Ris En */ -#define USBDC_UDCOTGICR_IESF (1<<24) /* OTG SET_FEATURE Command Recvd */ -#define USBDC_UDCOTGISR 0x001c /* UDC OTG Interrupt Status Register */ -#define USBDC_UDCOTGISR_IRIDF (1<<0) /* OTG ID Change Fall Intr Req */ -#define USBDC_UDCOTGISR_IRIDR (1<<1) /* OTG ID Change Ris Intr Req */ -#define USBDC_UDCOTGISR_IRSDF (1<<2) /* OTG A-Dev SRP Detect Fall Intr Req */ -#define USBDC_UDCOTGISR_IRSDR (1<<3) /* OTG A-Dev SRP Detect Ris Intr Req */ -#define USBDC_UDCOTGISR_IRSVF (1<<4) /* OTG Session Valid Fall Intr Req */ -#define USBDC_UDCOTGISR_IRSVR (1<<5) /* OTG Session Valid Ris Intr Req */ -#define USBDC_UDCOTGISR_IRVV44F (1<<6) /* OTG Vbus Valid 4.4V Fall Intr Req */ -#define USBDC_UDCOTGISR_IRVV44R (1<<7) /* OTG Vbus Valid 4.4V Ris Intr Req */ -#define USBDC_UDCOTGISR_IRVV40F (1<<8) /* OTG Vbus Valid 4.0V Fall Intr Req */ -#define USBDC_UDCOTGISR_IRVV40R (1<<9) /* OTG Vbus Valid 4.0V Ris Intr Req */ -#define USBDC_UDCOTGISR_IRXF (1<<16) /* Extern Transceiver Intr Fall Req */ -#define USBDC_UDCOTGISR_IRXR (1<<17) /* Extern Transceiver Intr Ris Req */ -#define USBDC_UDCOTGISR_IRSF (1<<24) /* OTG SET_FEATURE Command Recvd */ -#define USBDC_UP2OCR 0x0020 /* USB Port 2 Output Control Register */ -#define USBDC_UP2OCR_CPVEN (1<<0) /* Charge Pump Vbus Enable */ -#define USBDC_UP2OCR_CPVPE (1<<1) /* Charge Pump Vbus Pulse Enable */ -#define USBDC_UP2OCR_DPPDE (1<<2) /* Host Transc D+ Pull Down En */ -#define USBDC_UP2OCR_DMPDE (1<<3) /* Host Transc D- Pull Down En */ -#define USBDC_UP2OCR_DPPUE (1<<4) /* Host Transc D+ Pull Up En */ -#define USBDC_UP2OCR_DMPUE (1<<5) /* Host Transc D- Pull Up En */ -#define USBDC_UP2OCR_DPPUBE (1<<6) /* Host Transc D+ Pull Up Bypass En */ -#define USBDC_UP2OCR_DMPUBE (1<<7) /* Host Transc D- Pull Up Bypass En */ -#define USBDC_UP2OCR_EXSP (1<<8) /* External Transc Speed Control */ -#define USBDC_UP2OCR_EXSUS (1<<9) /* External Transc Suspend Control */ -#define USBDC_UP2OCR_IDON (1<<10) /* OTG ID Read Enable */ -#define USBDC_UP2OCR_HXS (1<<16) /* Host Transc Output Select */ -#define USBDC_UP2OCR_HXOE (1<<17) /* Host Transc Output Enable */ -#define USBDC_UP2OCR_SEOS (7<<24) /* Single-Ended Output Select */ -#define USBDC_UP3OCR 0x0024 /* USB Port 3 Output Control Register */ -#define USBDC_UP3OCR_CFG (3<<0) /* Host Port Configuration */ -/* 0x0028 to 0x00fc is reserved */ -#define USBDC_UDCCSR0 0x0100 /* UDC Endpoint 0 Control/Status Registers */ -#define USBDC_UDCCSR0_OPC (1<<0) /* OUT Packet Complete */ -#define USBDC_UDCCSR0_IPR (1<<1) /* IN Packet Ready */ -#define USBDC_UDCCSR0_FTF (1<<2) /* Flush Transmit FIFO */ -#define USBDC_UDCCSR0_DME (1<<3) /* DMA Enable */ -#define USBDC_UDCCSR0_SST (1<<4) /* Sent Stall */ -#define USBDC_UDCCSR0_FST (1<<5) /* Force Stall */ -#define USBDC_UDCCSR0_RNE (1<<6) /* Receive FIFO Not Empty */ -#define USBDC_UDCCSR0_SA (1<<7) /* Setup Active */ -#define USBDC_UDCCSR0_AREN (1<<8) /* ACK Response Enable */ -#define USBDC_UDCCSR0_ACM (1<<9) /* ACK Control Mode */ -#define USBDC_UDCCSR(n) (0x0100+4*(n)) /* UDC Control/Status Registers */ -#define USBDC_UDCCSR_FS (1<<0) /* FIFO Needs Service */ -#define USBDC_UDCCSR_PC (1<<1) /* Packet Complete */ -#define USBDC_UDCCSR_TRN (1<<2) /* Tx/Rx NAK */ -#define USBDC_UDCCSR_DME (1<<3) /* DMA Enable */ -#define USBDC_UDCCSR_SST (1<<4) /* Sent STALL */ -#define USBDC_UDCCSR_FST (1<<5) /* Force STALL */ -#define USBDC_UDCCSR_BNE (1<<6) /* OUT: Buffer Not Empty */ -#define USBDC_UDCCSR_BNF (1<<6) /* IN: Buffer Not Full */ -#define USBDC_UDCCSR_SP (1<<7) /* Short Packet Control/Status */ -#define USBDC_UDCCSR_FEF (1<<8) /* Flush Endpoint FIFO */ -#define USBDC_UDCCSR_DPE (1<<9) /* Data Packet Empty (async EP only) */ -/* 0x0160 to 0x01fc is reserved */ -#define USBDC_UDCBCR(n) (0x0200+4*(n)) /* UDC Byte Count Registers */ -#define USBDC_UDCBCR_BC (1023<<0) /* Byte Count */ -/* 0x0260 to 0x02fc is reserved */ -#define USBDC_UDCDR(n) (0x0300+4*(n)) /* UDC Data Registers */ -/* 0x0360 to 0x03fc is reserved */ -/* 0x0400 is reserved */ -#define USBDC_UDCECR(n) (0x0400+4*(n)) /* UDC Configuration Registers */ -#define USBDC_UDCECR_EE (1<<0) /* Endpoint Enable */ -#define USBDC_UDCECR_DE (1<<1) /* Double-Buffering Enable */ -#define USBDC_UDCECR_MPS (1023<<2) /* Maximum Packet Size */ -#define USBDC_UDCECR_ED (1<<12) /* USB Endpoint Direction 0 OUT, 1 IN */ -#define USBDC_UDCECR_ET (3<<13) /* USB Enpoint Type */ -#define USBDC_UDCECR_EN (15<<15) /* Endpoint Number */ -#define USBDC_UDCECR_AISN (7<<19) /* Alternate Interface Number */ -#define USBDC_UDCECR_IN (7<<22) /* Interface Number */ -#define USBDC_UDCECR_CN (3<<25) /* Configuration Number */ - -#define USBDC_UDCECR_MPSs(n) ((n)<<2) /* Maximum Packet Size */ -#define USBDC_UDCECR_ETs(n) ((n)<<13) /* USB Enpoint Type */ -#define USBDC_UDCECR_ET_INT 3 -#define USBDC_UDCECR_ET_BULK 2 -#define USBDC_UDCECR_ET_ISO 1 -#define USBDC_UDCECR_ENs(n) ((n)<<15) /* Endpoint Number */ -#define USBDC_UDCECR_AISNs(n) ((n)<<19) /* Alternate Interface Number */ -#define USBDC_UDCECR_INs(n) ((n)<<22) /* Interface Number */ -#define USBDC_UDCECR_CNs(n) ((n)<<25) /* Configuration Number */ - -#define USBDC_UDCCR_BITS \ - "\20\001UDE\002UDA\003UDR\004EMCE\005SMAC\021DWRE" \ - "\035BHNP\036AHNP\037OEN" -#define USBDC_UDCISR0_BITS \ - "\20\0010P\0020F\003AP\004AF\005BP\006BF\007CP\010CF" \ - "\011DP\012DF\013EP\014EF\015FP\016FF\017GP\020GF" \ - "\031HP\032HF\033IP\034IF\035JP\036JF\037KP\030KF" \ - "\041LP\042LF\043MP\044MF\045NP\046NF\047PP\040PF" -#define USBDC_UDCISR1_BITS \ - "\20\001QP\002QF\003RP\004RF\005SP\006SF\007TP\010TF" \ - "\011UP\012UF\013VP\014VF\015WP\016WF\017XP\020XF" \ - "\034RS\035SU\036RU\037SOF\040CC" -#define USBDC_UDCOTGISR_BITS \ - "\20\001IRIDF\002IRIDR\003IRSDF\004IRSDR\005IRSVF\006IRSVR" \ - "\007IRVV44F\010IRVV44R\011IRVV40F\012IRVV40R" -#define USBDC_UDCCSR0_BITS \ - "\20\001OPC\002IPR\003FTF\004DME\005SST\006FST\007RNE" \ - "\010SA\011AREN\012ACM" -#define USBDC_UDCCSRN_BITS \ - "\20\001FS\002PC\003TRN\004DME\005SST\006FST\007BNEF" \ - "\010SP\011FEF\012DPE" - -#endif /* _ARM_XSCALE_PXA27X_UDCREG_H_ */ diff --git a/sys/arch/arm/xscale/pxa2x0.c b/sys/arch/arm/xscale/pxa2x0.c deleted file mode 100644 index baefb42bf37..00000000000 --- a/sys/arch/arm/xscale/pxa2x0.c +++ /dev/null @@ -1,461 +0,0 @@ -/* $OpenBSD: pxa2x0.c,v 1.20 2016/01/31 00:14:50 jsg Exp $ */ -/* $NetBSD: pxa2x0.c,v 1.5 2003/12/12 16:42:44 thorpej Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - * - * - * Autoconfiguration support for the Intel PXA2[15]0 application - * processor. This code is derived from arm/sa11x0/sa11x0.c - */ - -/*- - * Copyright (c) 2001, The NetBSD Foundation, Inc. All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by IWAMOTO Toshihiro and Ichiro FUKUHARA. - * - * 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. - */ -/*- - * Copyright (c) 1999 - * Shin Takemura and PocketBSD Project. 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 the PocketBSD project - * and its contributors. - * 4. Neither the name of the project nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. - * - */ - -#include "pxagpio.h" -#include "pxadmac.h" - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/reboot.h> -#include <sys/timetc.h> - -#include <machine/cpu.h> -#include <machine/bus.h> - -#include <arm/cpufunc.h> -#include <arm/mainbus/mainbus.h> -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> - -struct pxaip_softc { - struct device sc_dev; - bus_space_tag_t sc_bust; - bus_dma_tag_t sc_dmat; - bus_space_handle_t sc_bush_clk; - bus_space_handle_t sc_bush_rtc; -}; - -/* prototypes */ -int pxaip_match(struct device *, void *, void *); -void pxaip_attach(struct device *, struct device *, void *); -int pxaip_search(struct device *, void *, void *); -void pxaip_attach_critical(struct pxaip_softc *); -int pxaip_print(void *, const char *); - -int pxaip_measure_cpuclock(struct pxaip_softc *); - -/* attach structures */ -#ifdef __NetBSD__ -CFATTACH_DECL(pxaip, sizeof(struct pxaip_softc), - pxaip_match, pxaip_attach, NULL, NULL); -#else -struct cfattach pxaip_ca = { - sizeof(struct pxaip_softc), pxaip_match, pxaip_attach -}; - -struct cfdriver pxaip_cd = { - NULL, "pxaip", DV_DULL -}; -#endif - -struct pxaip_softc *pxaip_sc; - -int -pxaip_match(struct device *parent, void *match, void *aux) -{ - - return 1; -} - -void -pxaip_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxaip_softc *sc = (struct pxaip_softc *)self; -#ifdef __APM__ - extern int freq; -#endif - int cpuclock; - - pxaip_sc = sc; - sc->sc_bust = &pxa2x0_bs_tag; - sc->sc_dmat = &pxa2x0_bus_dma_tag; - - if (bus_space_map(sc->sc_bust, PXA2X0_CLKMAN_BASE, PXA2X0_CLKMAN_SIZE, - 0, &sc->sc_bush_clk)) - panic("pxaip_attach: failed to map CLKMAN"); - - if (bus_space_map(sc->sc_bust, PXA2X0_RTC_BASE, PXA2X0_RTC_SIZE, - 0, &sc->sc_bush_rtc)) - panic("pxaip_attach: failed to map RTC"); - - /* - * Calculate clock speed - * This takes 2 secs at most. - */ - cpuclock = pxaip_measure_cpuclock(sc) / 1000; - if (cpuclock % 1000 > 500) - cpuclock = cpuclock + 1000 - cpuclock % 1000; -#ifdef __APM__ - freq = cpuclock / 1000; -#endif - - printf(": CPU clock = %d.%03d MHz\n", cpuclock/1000, cpuclock%1000); - - /* - * Attach critical devices - */ - pxaip_attach_critical(sc); - - /* - * Attach all other devices - */ - config_search(pxaip_search, self, sc); - -} - -int -pxaip_search(struct device *parent, void *c, void *aux) -{ - struct pxaip_softc *sc = aux; - struct pxaip_attach_args aa; - struct cfdata *cf = c; - - aa.pxa_iot = sc->sc_bust; - aa.pxa_dmat = sc->sc_dmat; -#if 0 - aa.pxa_addr = cf->cf_addr; - aa.pxa_size = cf->cf_size; - aa.pxa_intr = cf->cf_intr; - aa.pxa_index = cf->cf_index; -#else - aa.pxa_addr = (cf->cf_loc)[0]; - aa.pxa_size = (cf->cf_loc)[1]; - aa.pxa_intr = (cf->cf_loc)[2]; - aa.pxa_index = (cf->cf_loc)[3]; -#endif - - config_found(parent, &aa, pxaip_print); - - return 0; -} - -void -pxaip_attach_critical(struct pxaip_softc *sc) -{ - struct pxaip_attach_args aa; - - aa.pxa_iot = sc->sc_bust; - aa.pxa_dmat = sc->sc_dmat; - aa.pxa_addr = PXA2X0_INTCTL_BASE; - aa.pxa_size = PXA2X0_INTCTL_SIZE; - aa.pxa_intr = -1; - if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL) - panic("pxaip_attach_critical: failed to attach INTC!"); - -#if NPXAGPIO > 0 - aa.pxa_iot = sc->sc_bust; - aa.pxa_dmat = sc->sc_dmat; - aa.pxa_addr = PXA2X0_GPIO_BASE; - aa.pxa_size = PXA2X0_GPIO_SIZE; - aa.pxa_intr = -1; - if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL) - panic("pxaip_attach_critical: failed to attach GPIO!"); -#endif - -#if NPXADMAC > 0 - aa.pxa_iot = sc->sc_bust; - aa.pxa_dmat = sc->sc_dmat; - aa.pxa_addr = PXA2X0_DMAC_BASE; - aa.pxa_size = PXA2X0_DMAC_SIZE; - aa.pxa_intr = PXA2X0_INT_DMA; - if (config_found(&sc->sc_dev, &aa, pxaip_print) == NULL) - panic("pxaip_attach_critical: failed to attach DMAC!"); -#endif -} - -int -pxaip_print(void *aux, const char *name) -{ - struct pxaip_attach_args *sa = (struct pxaip_attach_args*)aux; - - if (sa->pxa_addr != -1) { - printf(" addr 0x%lx", sa->pxa_addr); - if (sa->pxa_size > -1) - printf("-0x%lx", sa->pxa_addr + sa->pxa_size-1); - } - if (sa->pxa_intr != -1) - printf(" intr %d", sa->pxa_intr); - - return (UNCONF); -} - -static inline uint32_t -read_clock_counter(void) -{ - uint32_t x; - __asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (x)); - - return x; -} - -int -pxaip_measure_cpuclock(struct pxaip_softc *sc) -{ - uint32_t rtc0, rtc1, start, end; - uint32_t pmcr_save; - bus_space_handle_t ioh; - int irq; - - ioh = sc->sc_bush_rtc; - irq = disable_interrupts(PSR_I|PSR_F); - - __asm volatile( "mrc p14, 0, %0, c0, c1, 0" : "=r" (pmcr_save)); - /* Enable clock counter */ - __asm volatile( "mcr p14, 0, %0, c0, c1, 0" : : "r" (0x0001)); - - rtc0 = bus_space_read_4(sc->sc_bust, ioh, RTC_RCNR); - /* Wait for next second starts */ - while ((rtc1 = bus_space_read_4(sc->sc_bust, ioh, RTC_RCNR)) == rtc0) - ; - start = read_clock_counter(); - while(rtc1 == bus_space_read_4(sc->sc_bust, ioh, RTC_RCNR)) - ; /* Wait for 1sec */ - end = read_clock_counter(); - - __asm volatile( "mcr p14, 0, %0, c0, c1, 0" : : "r" (pmcr_save)); - restore_interrupts(irq); - - return end - start; -} - -void -pxa2x0_turbo_mode(int f) -{ - __asm volatile("mcr p14, 0, %0, c6, c0, 0" : : "r" (f)); -} - -void -pxa2x0_probe_sdram(vaddr_t memctl_va, paddr_t *start, paddr_t *size) -{ - u_int32_t mdcnfg, dwid, dcac, drac, dnb; - int i; - - mdcnfg = *((volatile u_int32_t *)(memctl_va + MEMCTL_MDCNFG)); - - /* - * Scan all 4 SDRAM banks - */ - for (i = 0; i < PXA2X0_SDRAM_BANKS; i++) { - start[i] = 0; - size[i] = 0; - - switch (i) { - case 0: - case 1: - if ((i == 0 && (mdcnfg & MDCNFG_DE0) == 0) || - (i == 1 && (mdcnfg & MDCNFG_DE1) == 0)) - continue; - dwid = mdcnfg >> MDCNFD_DWID01_SHIFT; - dcac = mdcnfg >> MDCNFD_DCAC01_SHIFT; - drac = mdcnfg >> MDCNFD_DRAC01_SHIFT; - dnb = mdcnfg >> MDCNFD_DNB01_SHIFT; - break; - - case 2: - case 3: - if ((i == 2 && (mdcnfg & MDCNFG_DE2) == 0) || - (i == 3 && (mdcnfg & MDCNFG_DE3) == 0)) - continue; - dwid = mdcnfg >> MDCNFD_DWID23_SHIFT; - dcac = mdcnfg >> MDCNFD_DCAC23_SHIFT; - drac = mdcnfg >> MDCNFD_DRAC23_SHIFT; - dnb = mdcnfg >> MDCNFD_DNB23_SHIFT; - break; - default: - panic("pxa2x0_probe_sdram: impossible"); - } - - dwid = 2 << (1 - (dwid & MDCNFD_DWID_MASK)); /* 16/32 width */ - dcac = 1 << ((dcac & MDCNFD_DCAC_MASK) + 8); /* 8-11 columns */ - drac = 1 << ((drac & MDCNFD_DRAC_MASK) + 11); /* 11-13 rows */ - dnb = 2 << (dnb & MDCNFD_DNB_MASK); /* # of banks */ - - size[i] = (paddr_t)(dwid * dcac * drac * dnb); - start[i] = PXA2X0_SDRAM0_START + (i * PXA2X0_SDRAM_BANK_SIZE); - } -} - -void -pxa2x0_clkman_config(u_int clk, int enable) -{ - struct pxaip_softc *sc; - u_int32_t rv; - - KDASSERT(pxaip_sc != NULL); - sc = pxaip_sc; - - rv = bus_space_read_4(sc->sc_bust, sc->sc_bush_clk, CLKMAN_CKEN); - rv &= ~clk; - - if (enable) - rv |= clk; - - bus_space_write_4(sc->sc_bust, sc->sc_bush_clk, CLKMAN_CKEN, rv); -} - -void -pxa2x0_rtc_setalarm(u_int32_t secs) -{ - struct pxaip_softc *sc; - u_int32_t rv; - int s; - - KDASSERT(pxaip_sc != NULL); - sc = pxaip_sc; - - s = splhigh(); - bus_space_write_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RTAR, secs); - rv = bus_space_read_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RTSR); - if (secs == 0) - bus_space_write_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RTSR, - (rv | RTSR_AL) & ~RTSR_ALE); - else - bus_space_write_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RTSR, - (rv | RTSR_AL | RTSR_ALE)); - splx(s); -} - -u_int32_t -pxa2x0_rtc_getalarm(void) -{ - struct pxaip_softc *sc; - - KDASSERT(pxaip_sc != NULL); - sc = pxaip_sc; - - return (bus_space_read_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RTAR)); -} - -u_int32_t -pxa2x0_rtc_getsecs(void) -{ - struct pxaip_softc *sc; - - KDASSERT(pxaip_sc != NULL); - sc = pxaip_sc; - - return (bus_space_read_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RCNR)); -} - -void -resettodr(void) -{ - struct pxaip_softc *sc = pxaip_sc; - struct timeval tv; - - microtime(&tv); - - bus_space_write_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RCNR, - (u_int32_t)tv.tv_sec); -} - -void -inittodr(time_t base) -{ - struct pxaip_softc *sc = pxaip_sc; - struct timespec ts; - u_int32_t rcnr; - - /* XXX decide if RCNR can be valid, based on the last reset - * XXX reason, i.e. RCSR. */ - rcnr = bus_space_read_4(sc->sc_bust, sc->sc_bush_rtc, RTC_RCNR); - - /* XXX check how much RCNR differs from the filesystem date. */ - if (rcnr > base) - ts.tv_sec = rcnr; - else { - printf("WARNING: using filesystem date -- CHECK AND RESET THE DATE!\n"); - ts.tv_sec = base; - } - - ts.tv_nsec = 0; - tc_setclock(&ts); -} diff --git a/sys/arch/arm/xscale/pxa2x0_a4x_io.S b/sys/arch/arm/xscale/pxa2x0_a4x_io.S deleted file mode 100644 index 447c4862c8e..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_a4x_io.S +++ /dev/null @@ -1,104 +0,0 @@ -/* $OpenBSD: pxa2x0_a4x_io.S,v 1.2 2005/01/02 19:52:36 drahn Exp $ */ -/* $NetBSD: pxa2x0_a4x_io.S,v 1.1 2002/10/19 19:31:39 bsh Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * There are simple bus space functions for IO registers mapped at - * 32-bit aligned positions. offset is multiplied by 4. - */ - -#include <machine/asm.h> - -/* - * bus_space I/O functions with offset*4 - */ - -/* - * read single - */ - -ENTRY(a4x_bs_r_1) - ldrb r0, [r1, r2, LSL #2] - mov pc, lr - -ENTRY(a4x_bs_r_2) - mov r2, r2, LSL #2 - ldrh r0, [r1, r2] - mov pc, lr - -ENTRY(a4x_bs_r_4) - ldr r0, [r1, r2, LSL #2] - mov pc, lr - -/* - * write single - */ - -ENTRY(a4x_bs_w_1) - strb r3, [r1, r2, LSL #2] - mov pc, lr - -ENTRY(a4x_bs_w_2) - mov r2, r2, LSL #2 - strh r3, [r1, r2] - mov pc, lr - -ENTRY(a4x_bs_w_4) - str r3, [r1, r2, LSL #2] - mov pc, lr - -/* - * read multiple - */ -ENTRY(a4x_bs_rm_1) - mov r2, r2, LSL #2 - b generic_bs_rm_1 - -ENTRY(a4x_bs_rm_2) - mov r2, r2, LSL #2 - b generic_armv4_bs_rm_2 - - - -/* - * write multiple - */ -ENTRY(a4x_bs_wm_1) - mov r2, r2, LSL #2 - b generic_bs_wm_1 - -ENTRY(a4x_bs_wm_2) - mov r2, r2, LSL #2 - b generic_armv4_bs_wm_2 diff --git a/sys/arch/arm/xscale/pxa2x0_a4x_space.c b/sys/arch/arm/xscale/pxa2x0_a4x_space.c deleted file mode 100644 index 54ef6a03071..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_a4x_space.c +++ /dev/null @@ -1,134 +0,0 @@ -/* $OpenBSD: pxa2x0_a4x_space.c,v 1.3 2008/05/15 22:17:08 brad Exp $ */ -/* $NetBSD: pxa2x0_a4x_space.c,v 1.2 2003/07/15 00:24:54 lukem Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * Bus space tag for 8/16-bit devices on 32-bit bus. - * all registers are located at the address of multiple of 4. - */ - -#include <sys/param.h> -#include <sys/systm.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> - -/* Prototypes for all the bus_space structure functions */ -bs_protos(pxa2x0); -bs_protos(a4x); -bs_protos(generic); -bs_protos(generic_armv4); -bs_protos(bs_notimpl); - -struct bus_space pxa2x0_a4x_bs_tag = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - pxa2x0_bs_map, - pxa2x0_bs_unmap, - pxa2x0_bs_subregion, - - /* allocation/deallocation */ - pxa2x0_bs_alloc, /* not implemented */ - pxa2x0_bs_free, /* not implemented */ - - /* get kernel virtual address */ - pxa2x0_bs_vaddr, - - /* mmap */ - bs_notimpl_bs_mmap, - - /* barrier */ - pxa2x0_bs_barrier, - - /* read (single) */ - a4x_bs_r_1, - a4x_bs_r_2, - a4x_bs_r_4, - bs_notimpl_bs_r_8, - - /* read multiple */ - a4x_bs_rm_1, - a4x_bs_rm_2, - bs_notimpl_bs_rm_4, - bs_notimpl_bs_rm_8, - - /* read region */ - bs_notimpl_bs_rr_1, - bs_notimpl_bs_rr_2, - bs_notimpl_bs_rr_4, - bs_notimpl_bs_rr_8, - - /* write (single) */ - a4x_bs_w_1, - a4x_bs_w_2, - a4x_bs_w_4, - bs_notimpl_bs_w_8, - - /* write multiple */ - a4x_bs_wm_1, - a4x_bs_wm_2, - bs_notimpl_bs_wm_4, - bs_notimpl_bs_wm_8, - - /* write region */ - bs_notimpl_bs_wr_1, - bs_notimpl_bs_wr_2, - bs_notimpl_bs_wr_4, - bs_notimpl_bs_wr_8, - - /* set multiple */ - bs_notimpl_bs_sm_1, - bs_notimpl_bs_sm_2, - bs_notimpl_bs_sm_4, - bs_notimpl_bs_sm_8, - - /* set region */ - bs_notimpl_bs_sr_1, - bs_notimpl_bs_sr_2, - bs_notimpl_bs_sr_4, - bs_notimpl_bs_sr_8, - - /* copy */ - bs_notimpl_bs_c_1, - bs_notimpl_bs_c_2, - bs_notimpl_bs_c_4, - bs_notimpl_bs_c_8, -}; - - - diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c deleted file mode 100644 index 10dc039297f..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ /dev/null @@ -1,1585 +0,0 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.44 2016/01/31 00:14:50 jsg Exp $ */ - -/*- - * Copyright (c) 2001 Alexander Guy. All rights reserved. - * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. - * Copyright (c) 1995 John T. Kohl. 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 the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 MIND, 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/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/kthread.h> -#include <sys/rwlock.h> -#include <sys/proc.h> -#include <sys/buf.h> -#include <sys/device.h> -#include <sys/fcntl.h> -#include <sys/ioctl.h> -#include <sys/reboot.h> -#include <sys/event.h> - -#include <machine/conf.h> -#include <machine/cpu.h> -#include <machine/apmvar.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_apm.h> -#include <arm/xscale/pxa2x0_gpio.h> -#include <dev/wscons/wsdisplayvar.h> - -#include "wsdisplay.h" - -#if defined(APMDEBUG) -#define DPRINTF(x) printf x -#else -#define DPRINTF(x) /**/ -#endif - -#define APM_LOCK(sc) rw_enter_write(&(sc)->sc_lock); -#define APM_UNLOCK(sc) rw_exit_write(&(sc)->sc_lock); - -struct cfdriver apm_cd = { - NULL, "apm", DV_DULL -}; - -#define APMUNIT(dev) (minor(dev)&0xf0) -#define APMDEV(dev) (minor(dev)&0x0f) -#define APMDEV_NORMAL 0 -#define APMDEV_CTL 8 - -int apm_userstandbys; -int apm_suspends; -int apm_battlow; - -/* battery percentage at which we get verbose in our warnings. This - value can be changed using sysctl(8), value machdep.apmwarn. - Setting it to zero kills all warnings */ -int cpu_apmwarn = 10; - -void apm_power_print(struct pxa2x0_apm_softc *, struct apm_power_info *); -void apm_power_info(struct pxa2x0_apm_softc *, struct apm_power_info *); -void apm_suspend(struct pxa2x0_apm_softc *); -void apm_resume(struct pxa2x0_apm_softc *); -int apm_get_event(struct pxa2x0_apm_softc *, u_int *); -int apm_handle_event(struct pxa2x0_apm_softc *, u_int); -void apm_thread_create(void *); -void apm_thread(void *); - -extern int perflevel; -int freq; -void pxa2x0_setperf(int speed); -int pxa2x0_cpuspeed(int *speed); - -int apm_record_event(struct pxa2x0_apm_softc *, u_int); -void filt_apmrdetach(struct knote *kn); -int filt_apmread(struct knote *kn, long hint); -int apmkqfilter(dev_t dev, struct knote *kn); - -struct filterops apmread_filtops = - { 1, NULL, filt_apmrdetach, filt_apmread}; - -/* - * Flags to control kernel display - * SCFLAG_NOPRINT: do not output APM power messages due to - * a power change event. - * - * SCFLAG_PCTPRINT: do not output APM power messages due to - * to a power change event unless the battery - * percentage changes. - */ - -#define SCFLAG_NOPRINT 0x0008000 -#define SCFLAG_PCTPRINT 0x0004000 -#define SCFLAG_PRINT (SCFLAG_NOPRINT|SCFLAG_PCTPRINT) - -#define SCFLAG_OREAD (1 << 0) -#define SCFLAG_OWRITE (1 << 1) -#define SCFLAG_OPEN (SCFLAG_OREAD|SCFLAG_OWRITE) - -/* This structure must be kept in sync with pxa2x0_apm_asm.S. */ -struct pxa2x0_memcfg { - /* SDRAM refresh */ - u_int32_t mdrefr_high; /* 0x00 */ - u_int32_t mdrefr_low; /* 0x04 */ - u_int32_t mdrefr_low2; /* 0x08 */ - /* Synchronous, static, or VLIO interfaces */ - u_int32_t msc_high[3]; /* 0x0c */ - u_int32_t msc_low[3]; /* 0x18 */ - /* XXX move up */ - u_int32_t mdrefr_91; /* 0x24 */ -}; - -/* XXX */ -#define MDREFR_C3000 (MDREFR_K0DB2 | MDREFR_E1PIN | MDREFR_K1RUN | \ - MDREFR_K1DB2 | MDREFR_K2DB2 | MDREFR_APD) -#define MSC0_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 2 << MSC_RRR_SHIFT) | \ - (13 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RBW /* PXA271 */ | \ - MSC_RT_NONBURST -#define MSC1_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_VLIO << 16) | \ - ( 3 << MSC_RRR_SHIFT) | \ - ( 4 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC2_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 3 << MSC_RRR_SHIFT) | \ - ( 4 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC0_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 8 << MSC_RDN_SHIFT) | \ - ( 8 << MSC_RDF_SHIFT) | \ - MSC_RBW /* PXA271 */ | \ - MSC_RT_NONBURST -#define MSC1_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_VLIO << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 2 << MSC_RDN_SHIFT) | \ - ( 6 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC2_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 2 << MSC_RDN_SHIFT) | \ - ( 6 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -struct pxa2x0_memcfg pxa2x0_memcfg = { - (MDREFR_C3000 | 0x030), - (MDREFR_C3000 | 0x00b), - (MDREFR_C3000 | 0x017), - { MSC0_HIGH, MSC1_HIGH, MSC2_HIGH }, - { MSC1_LOW, MSC1_LOW, MSC2_LOW }, - (MDREFR_C3000 | 0x013) -}; - -#define PI2C_RETRY_COUNT 10 -/* XXX varies depending on voltage regulator IC. */ -#define PI2C_VOLTAGE_LOW 0x13 /* 1.00V */ -#define PI2C_VOLTAGE_HIGH 0x1a /* 1.35V */ - -void pxa2x0_pi2c_open(bus_space_tag_t, bus_space_handle_t); -void pxa2x0_pi2c_close(bus_space_tag_t, bus_space_handle_t); -int pxa2x0_pi2c_read(bus_space_tag_t, bus_space_handle_t, u_char, u_char *); -int pxa2x0_pi2c_write(bus_space_tag_t, bus_space_handle_t, u_char, u_char); -int pxa2x0_pi2c_getvoltage(bus_space_tag_t, bus_space_handle_t, u_char *); -int pxa2x0_pi2c_setvoltage(bus_space_tag_t, bus_space_handle_t, u_char); -#if 0 -void pxa2x0_pi2c_print(struct pxa2x0_apm_softc *); -#endif - -/* XXX used in pxa2x0_apm_asm.S */ -bus_space_handle_t pxa2x0_gpio_ioh; -bus_space_handle_t pxa2x0_clkman_ioh; -bus_space_handle_t pxa2x0_memctl_ioh; - -/* pxa2x0_apm_asm.S */ -void pxa27x_run_mode(void); -void pxa27x_fastbus_run_mode(int, u_int32_t); -void pxa27x_frequency_change(int, int, struct pxa2x0_memcfg *); -void pxa2x0_cpu_suspend(void); -void pxa2x0_cpu_resume(void); -void pxa27x_cpu_speed_high(void); -void pxa27x_cpu_speed_low(void); -void pxa27x_cpu_speed_91(void); -void pxa27x_cpu_speed_208(void); - -void -apm_power_print(struct pxa2x0_apm_softc *sc, struct apm_power_info *powerp) -{ - - if (powerp->battery_life != APM_BATT_LIFE_UNKNOWN) - printf("%s: battery life expectancy %d%%\n", - sc->sc_dev.dv_xname, powerp->battery_life); - - printf("%s: AC ", sc->sc_dev.dv_xname); - switch (powerp->ac_state) { - case APM_AC_OFF: - printf("off,"); - break; - case APM_AC_ON: - printf("on,"); - break; - case APM_AC_BACKUP: - printf("backup power,"); - break; - default: - case APM_AC_UNKNOWN: - printf("unknown,"); - break; - } - - printf(" battery is "); - switch (powerp->battery_state) { - case APM_BATT_HIGH: - printf("high"); - break; - case APM_BATT_LOW: - printf("low"); - break; - case APM_BATT_CRITICAL: - printf("CRITICAL"); - break; - case APM_BATT_CHARGING: - printf("charging"); - break; - case APM_BATT_UNKNOWN: - printf("unknown"); - break; - default: - printf("undecoded (%x)", powerp->battery_state); - break; - } - - printf("\n"); -} - -void -apm_power_info(struct pxa2x0_apm_softc *sc, - struct apm_power_info *power) -{ - - power->ac_state = APM_AC_UNKNOWN; - power->battery_state = APM_BATT_UNKNOWN; - power->battery_life = 0 /* APM_BATT_LIFE_UNKNOWN */; - power->minutes_left = 0; - - if (sc->sc_power_info != NULL) - sc->sc_power_info(sc, power); -} - -void -apm_suspend(struct pxa2x0_apm_softc *sc) -{ - int s; - -#if NWSDISPLAY > 0 - wsdisplay_suspend(); -#endif /* NWSDISPLAY > 0 */ - - resettodr(); - - if (sc->sc_suspend == NULL) - pxa2x0_wakeup_config(PXA2X0_WAKEUP_ALL, 1); - else - sc->sc_suspend(sc); - - s = splhigh(); - config_suspend_all(DVACT_SUSPEND); - - /* XXX - * Flag to disk drivers that they should "power down" the disk - * when we get to DVACT_POWERDOWN. - */ - boothowto |= RB_POWERDOWN; - config_suspend_all(DVACT_POWERDOWN); - boothowto &= ~RB_POWERDOWN; - - splx(s); - - pxa2x0_apm_sleep(sc); -} - -void -apm_resume(struct pxa2x0_apm_softc *sc) -{ - int s; - - s = splhigh(); - config_suspend_all(DVACT_RESUME); - splx(s); - - inittodr(0); - - /* - * Clear the OTG Peripheral hold after running the pxaudc and pxaohci - * ca_activate to re-enable their operation. See 3.8.1.2 - */ - /* XXX ifdef NPXAUDC > 0 */ - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSSR, PSSR_OTGPH); - - bufq_restart(); - - config_suspend_all(DVACT_WAKEUP); - -#if NWSDISPLAY > 0 - wsdisplay_resume(); -#endif /* NWSDISPLAY > 0 */ -} - -int -apm_get_event(struct pxa2x0_apm_softc *sc, u_int *typep) -{ - - if (sc->sc_get_event != NULL) - return (sc->sc_get_event(sc, typep)); - - *typep = APM_NOEVENT; - return (1); -} - -int -apm_handle_event(struct pxa2x0_apm_softc *sc, u_int type) -{ - struct apm_power_info power; - int ret = 0; - - switch (type) { - case APM_NOEVENT: - ret = 1; - break; - case APM_CRIT_SUSPEND_REQ: - DPRINTF(("suspend required immediately\n")); -#if 0 - /* XXX apmd would make us suspend again after resume. */ - (void)apm_record_event(sc, type); -#endif - /* - * We ignore APM_CRIT_RESUME and just suspend here as usual - * to simplify the actual apm_get_event() implementation. - */ - apm_suspends++; - ret = 1; - break; - case APM_USER_SUSPEND_REQ: - case APM_SUSPEND_REQ: - DPRINTF(("suspend requested\n")); - if (apm_record_event(sc, type)) { - DPRINTF(("suspend ourselves\n")); - apm_suspends++; - } - break; - case APM_POWER_CHANGE: - DPRINTF(("power status change\n")); - apm_power_info(sc, &power); - if (power.battery_life != APM_BATT_LIFE_UNKNOWN && - power.battery_life < cpu_apmwarn && - (sc->sc_flags & SCFLAG_PRINT) != SCFLAG_NOPRINT && - ((sc->sc_flags & SCFLAG_PRINT) != SCFLAG_PCTPRINT || - sc->sc_batt_life != power.battery_life)) { - sc->sc_batt_life = power.battery_life; - apm_power_print(sc, &power); - } - apm_record_event(sc, type); - break; - case APM_BATTERY_LOW: - DPRINTF(("Battery low!\n")); - apm_battlow++; - apm_record_event(sc, type); - break; - default: - DPRINTF(("apm_handle_event: unsupported event, code %d\n", - type)); - } - - return (ret); -} - -void -apm_thread_create(void *v) -{ - struct pxa2x0_apm_softc *sc = v; - - if (kthread_create(apm_thread, sc, &sc->sc_thread, - sc->sc_dev.dv_xname)) { - /* apm_disconnect(sc); */ - printf("%s: failed to create kernel thread, disabled", - sc->sc_dev.dv_xname); - } -} - -void -apm_thread(void *v) -{ - struct pxa2x0_apm_softc *sc = v; - u_int type; - - for (;;) { - APM_LOCK(sc); - - while (1) { - if (apm_get_event(sc, &type) != 0) - break; - if (apm_handle_event(sc, type) != 0) - break; - } - if (apm_suspends || apm_userstandbys /* || apm_battlow*/) { - apm_suspend(sc); - apm_resume(sc); - } - apm_battlow = apm_suspends = apm_userstandbys = 0; - - APM_UNLOCK(sc); - tsleep(&lbolt, PWAIT, "apmev", 0); - } -} - -int -apmopen(dev_t dev, int flag, int mode, struct proc *p) -{ - struct pxa2x0_apm_softc *sc; - int error = 0; - - /* apm0 only */ - if (!apm_cd.cd_ndevs || APMUNIT(dev) != 0 || - !(sc = apm_cd.cd_devs[APMUNIT(dev)])) - return (ENXIO); - - DPRINTF(("apmopen: dev %d pid %d flag %x mode %x\n", - APMDEV(dev), p->p_pid, flag, mode)); - - switch (APMDEV(dev)) { - case APMDEV_CTL: - if (!(flag & FWRITE)) { - error = EINVAL; - break; - } - if (sc->sc_flags & SCFLAG_OWRITE) { - error = EBUSY; - break; - } - sc->sc_flags |= SCFLAG_OWRITE; - break; - case APMDEV_NORMAL: - if (!(flag & FREAD) || (flag & FWRITE)) { - error = EINVAL; - break; - } - sc->sc_flags |= SCFLAG_OREAD; - break; - default: - error = ENXIO; - break; - } - return (error); -} - -int -apmclose(dev_t dev, int flag, int mode, struct proc *p) -{ - struct pxa2x0_apm_softc *sc; - - /* apm0 only */ - if (!apm_cd.cd_ndevs || APMUNIT(dev) != 0 || - !(sc = apm_cd.cd_devs[APMUNIT(dev)])) - return (ENXIO); - - DPRINTF(("apmclose: pid %d flag %x mode %x\n", p->p_pid, flag, mode)); - - switch (APMDEV(dev)) { - case APMDEV_CTL: - sc->sc_flags &= ~SCFLAG_OWRITE; - break; - case APMDEV_NORMAL: - sc->sc_flags &= ~SCFLAG_OREAD; - break; - } - return (0); -} - -int -apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) -{ - struct pxa2x0_apm_softc *sc; - struct apm_power_info *power; - int error = 0; - - /* apm0 only */ - if (!apm_cd.cd_ndevs || APMUNIT(dev) != 0 || - !(sc = apm_cd.cd_devs[APMUNIT(dev)])) - return (ENXIO); - - switch (cmd) { - /* some ioctl names from linux */ - case APM_IOC_STANDBY: - if ((flag & FWRITE) == 0) - error = EBADF; - else - apm_userstandbys++; - break; - case APM_IOC_SUSPEND: - if ((flag & FWRITE) == 0) - error = EBADF; - else - apm_suspends++; /* XXX */ - break; - case APM_IOC_PRN_CTL: - if ((flag & FWRITE) == 0) - error = EBADF; - else { - int flag = *(int *)data; - DPRINTF(( "APM_IOC_PRN_CTL: %d\n", flag )); - switch (flag) { - case APM_PRINT_ON: /* enable printing */ - sc->sc_flags &= ~SCFLAG_PRINT; - break; - case APM_PRINT_OFF: /* disable printing */ - sc->sc_flags &= ~SCFLAG_PRINT; - sc->sc_flags |= SCFLAG_NOPRINT; - break; - case APM_PRINT_PCT: /* disable some printing */ - sc->sc_flags &= ~SCFLAG_PRINT; - sc->sc_flags |= SCFLAG_PCTPRINT; - break; - default: - error = EINVAL; - break; - } - } - break; - case APM_IOC_DEV_CTL: - if ((flag & FWRITE) == 0) - error = EBADF; - break; - case APM_IOC_GETPOWER: - power = (struct apm_power_info *)data; - apm_power_info(sc, power); - break; - case APM_IOC_STANDBY_REQ: - if ((flag & FWRITE) == 0) - error = EBADF; - else if (apm_record_event(sc, APM_USER_STANDBY_REQ)) - error = EINVAL; /* ? */ - break; - case APM_IOC_SUSPEND_REQ: - if ((flag & FWRITE) == 0) - error = EBADF; - else if (apm_record_event(sc, APM_USER_SUSPEND_REQ)) - error = EINVAL; /* ? */ - default: - error = ENOTTY; - } - - return (error); -} - -int -apm_record_event(struct pxa2x0_apm_softc *sc, u_int type) -{ - static int apm_evindex; - - /* skip if no user waiting */ - if ((sc->sc_flags & SCFLAG_OPEN) == 0) - return (1); - - apm_evindex++; - KNOTE(&sc->sc_note, APM_EVENT_COMPOSE(type, apm_evindex)); - - return (0); -} - -void -filt_apmrdetach(struct knote *kn) -{ - struct pxa2x0_apm_softc *sc = - (struct pxa2x0_apm_softc *)kn->kn_hook; - - SLIST_REMOVE(&sc->sc_note, kn, knote, kn_selnext); -} - -int -filt_apmread(struct knote *kn, long hint) -{ - /* XXX weird kqueue_scan() semantics */ - if (hint && !kn->kn_data) - kn->kn_data = (int)hint; - - return (1); -} - -int -apmkqfilter(dev_t dev, struct knote *kn) -{ - struct pxa2x0_apm_softc *sc; - - /* apm0 only */ - if (!apm_cd.cd_ndevs || APMUNIT(dev) != 0 || - !(sc = apm_cd.cd_devs[APMUNIT(dev)])) - return (ENXIO); - - switch (kn->kn_filter) { - case EVFILT_READ: - kn->kn_fop = &apmread_filtops; - break; - default: - return (EINVAL); - } - - kn->kn_hook = (caddr_t)sc; - SLIST_INSERT_HEAD(&sc->sc_note, kn, kn_selnext); - - return (0); -} - -void -pxa2x0_apm_attach_sub(struct pxa2x0_apm_softc *sc) -{ - - sc->sc_iot = &pxa2x0_bs_tag; - - if (bus_space_map(sc->sc_iot, PXA2X0_POWMAN_BASE, - PXA2X0_POWMAN_SIZE, 0, &sc->sc_pm_ioh)) { - printf("pxa2x0_apm_attach_sub: failed to map POWMAN\n"); - return; - } - - rw_init(&sc->sc_lock, "apmlk"); - - kthread_create_deferred(apm_thread_create, sc); - - printf("\n"); - - if (bus_space_map(sc->sc_iot, PXA2X0_CLKMAN_BASE, PXA2X0_CLKMAN_SIZE, - 0, &pxa2x0_clkman_ioh)) { - printf("%s: failed to map CLKMAN\n", sc->sc_dev.dv_xname); - return; - } - - if (bus_space_map(sc->sc_iot, PXA2X0_MEMCTL_BASE, PXA2X0_MEMCTL_SIZE, - 0, &pxa2x0_memctl_ioh)) { - printf("%s: failed to map MEMCTL\n", sc->sc_dev.dv_xname); - return; - } - sc->sc_memctl_ioh = pxa2x0_memctl_ioh; - - if (bus_space_map(sc->sc_iot, PXA2X0_GPIO_BASE, PXA2X0_GPIO_SIZE, - 0, &pxa2x0_gpio_ioh)) { - printf("%s: can't map GPIO\n", sc->sc_dev.dv_xname); - return; - } - - /* Clear all reset status flags. */ - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_RCSR, - RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR); -} - -void -pxa2x0_wakeup_config(u_int wsrc, int enable) -{ - struct pxa2x0_apm_softc *sc; - u_int32_t prer; - u_int32_t pfer; - u_int32_t pkwr; - - if (apm_cd.cd_ndevs < 1 || apm_cd.cd_devs[0] == NULL) - return; - sc = apm_cd.cd_devs[0]; - - prer = pfer = pkwr = 0; - - if ((wsrc & PXA2X0_WAKEUP_POWERON) != 0) { - prer |= (1<<0); - pfer |= (1<<0); - pkwr |= (1<<12); /* XXX */ - } - - if ((wsrc & PXA2X0_WAKEUP_GPIORST) != 0) - pfer |= (1<<1); - if ((wsrc & PXA2X0_WAKEUP_SD) != 0) - prer |= (1<<9); - if ((wsrc & PXA2X0_WAKEUP_RC) != 0) - prer |= (1<<13); - if ((wsrc & PXA2X0_WAKEUP_SYNC) != 0) - pkwr |= (1<<1); - if ((wsrc & PXA2X0_WAKEUP_KEYNS0) != 0) - prer |= (1<<12); - if ((wsrc & PXA2X0_WAKEUP_KEYNS1) != 0) - pkwr |= (1<<2); - if ((wsrc & PXA2X0_WAKEUP_KEYNS2) != 0) - pkwr |= (1<<9); - if ((wsrc & PXA2X0_WAKEUP_KEYNS3) != 0) - pkwr |= (1<<3); - if ((wsrc & PXA2X0_WAKEUP_KEYNS4) != 0) - pkwr |= (1<<4); - if ((wsrc & PXA2X0_WAKEUP_KEYNS5) != 0) - pkwr |= (1<<6); - if ((wsrc & PXA2X0_WAKEUP_KEYNS6) != 0) - pkwr |= (1<<7); - if ((wsrc & PXA2X0_WAKEUP_CF0) != 0) - pkwr |= (1<<11); - if ((wsrc & PXA2X0_WAKEUP_CF1) != 0) - pkwr |= (1<<10); - if ((wsrc & PXA2X0_WAKEUP_USBD) != 0) - prer |= (1<<24); - - if ((wsrc & PXA2X0_WAKEUP_LOCKSW) != 0) { - prer |= (1<<15); - pfer |= (1<<15); - } - - if ((wsrc & PXA2X0_WAKEUP_JACKIN) != 0) { - prer |= (1<<23); - pfer |= (1<<23); - } - - if ((wsrc & PXA2X0_WAKEUP_CHRGFULL) != 0) - pkwr |= (1<<18); - if ((wsrc & PXA2X0_WAKEUP_RTC) != 0) - prer |= (1<<31); - - if (enable) { - sc->sc_wakeon |= wsrc; - prer |= bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PRER); - pfer |= bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PFER); - pkwr |= bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PKWR); - } else { - sc->sc_wakeon &= ~wsrc; - prer = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PRER) & ~prer; - pfer = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PFER) & ~pfer; - pkwr = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, - POWMAN_PKWR) & ~pkwr; - } - - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PKWR, pkwr); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PRER, prer); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PFER, pfer); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PWER, - prer | pfer); -} - -u_int -pxa2x0_wakeup_status(void) -{ - struct pxa2x0_apm_softc *sc; - u_int32_t rv; - u_int wsrc; - - if (apm_cd.cd_ndevs < 1 || apm_cd.cd_devs[0] == NULL) - return (0); - - sc = apm_cd.cd_devs[0]; - wsrc = 0; - - rv = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PEDR); - if ((rv & (1<<0)) != 0) - wsrc |= PXA2X0_WAKEUP_POWERON; - if ((rv & (1<<1)) != 0) - wsrc |= PXA2X0_WAKEUP_GPIORST; - if ((rv & (1<<9)) != 0) - wsrc |= PXA2X0_WAKEUP_SD; - if ((rv & (1<<12)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS0; - if ((rv & (1<<13)) != 0) - wsrc |= PXA2X0_WAKEUP_RC; - if ((rv & (1<<15)) != 0) - wsrc |= PXA2X0_WAKEUP_LOCKSW; - if ((rv & (1<<23)) != 0) - wsrc |= PXA2X0_WAKEUP_JACKIN; - if ((rv & (1<<24)) != 0) - wsrc |= PXA2X0_WAKEUP_USBD; - if ((rv & (1<<31)) != 0) - wsrc |= PXA2X0_WAKEUP_RTC; - - rv = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PKSR); - if ((rv & (1<<1)) != 0) - wsrc |= PXA2X0_WAKEUP_SYNC; - if ((rv & (1<<2)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS1; - if ((rv & (1<<9)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS2; - if ((rv & (1<<3)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS3; - if ((rv & (1<<4)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS4; - if ((rv & (1<<6)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS5; - if ((rv & (1<<7)) != 0) - wsrc |= PXA2X0_WAKEUP_KEYNS6; - if ((rv & (1<<10)) != 0) - wsrc |= PXA2X0_WAKEUP_CF1; - if ((rv & (1<<11)) != 0) - wsrc |= PXA2X0_WAKEUP_CF0; - if ((rv & (1<<12)) != 0) - wsrc |= PXA2X0_WAKEUP_POWERON; - if ((rv & (1<<18)) != 0) - wsrc |= PXA2X0_WAKEUP_CHRGFULL; - - return (wsrc); -} - -struct pxa2x0_sleep_data { - /* OS timer registers */ - u_int32_t sd_osmr0, sd_osmr1, sd_osmr2, sd_osmr3; - u_int32_t sd_oscr0; - u_int32_t sd_osmr4, sd_osmr5; - u_int32_t sd_oscr4; - u_int32_t sd_omcr4, sd_omcr5; - u_int32_t sd_oier; - /* GPIO registers */ - u_int32_t sd_gpdr0, sd_gpdr1, sd_gpdr2, sd_gpdr3; - u_int32_t sd_grer0, sd_grer1, sd_grer2, sd_grer3; - u_int32_t sd_gfer0, sd_gfer1, sd_gfer2, sd_gfer3; - u_int32_t sd_gafr0_l, sd_gafr1_l, sd_gafr2_l, sd_gafr3_l; - u_int32_t sd_gafr0_u, sd_gafr1_u, sd_gafr2_u, sd_gafr3_u; - u_int32_t sd_gplr0, sd_gplr1, sd_gplr2, sd_gplr3; - /* Interrupt controller registers */ - u_int32_t sd_iclr; - u_int32_t sd_icmr; - u_int32_t sd_iccr; - /* Memory controller registers */ - u_int32_t sd_mecr; - u_int32_t sd_mcmem0, sd_mcmem1; - u_int32_t sd_mcatt0, sd_mcatt1; - u_int32_t sd_mcio0, sd_mcio1; - /* Clocks manager registers */ - u_int32_t sd_cken; -}; - -void -pxa2x0_apm_sleep(struct pxa2x0_apm_softc *sc) -{ - struct pxa2x0_sleep_data sd; - bus_space_handle_t ost_ioh; - int save; - u_int32_t rv; - - ost_ioh = (bus_space_handle_t)0; - if (bus_space_map(sc->sc_iot, PXA2X0_OST_BASE, PXA2X0_OST_SIZE, 0, - &ost_ioh)) { - printf("pxa2x0_apm_sleep: can't map OST\n"); - goto out; - } - - save = disable_interrupts(PSR_I|PSR_F); - - sd.sd_oscr0 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSCR0); - sd.sd_oscr4 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSCR4); - sd.sd_omcr4 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OMCR4); - sd.sd_omcr5 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OMCR5); - sd.sd_osmr0 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR0); - sd.sd_osmr1 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR1); - sd.sd_osmr2 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR2); - sd.sd_osmr3 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR3); - sd.sd_osmr4 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR4); - sd.sd_osmr5 = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OSMR5); - sd.sd_oier = bus_space_read_4(sc->sc_iot, ost_ioh, OST_OIER); - - /* Bring the PXA27x into 416MHz turbo mode. */ - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X && - bus_space_read_4(sc->sc_iot, pxa2x0_clkman_ioh, CLKMAN_CCCR) != - (CCCR_A | CCCR_TURBO_X2 | CCCR_RUN_X16)) { -#if 0 - pxa27x_cpu_speed_high(); -#else -#define CLKCFG_T (1<<0) /* turbo */ -#define CLKCFG_F (1<<1) /* frequency change */ -#define CLKCFG_B (1<<3) /* fast-bus */ - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_B | CLKCFG_F | CLKCFG_T, - &pxa2x0_memcfg); -#endif - delay(500000); /* XXX */ - } - -suspend_again: - /* Clear wake-up status. */ - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PEDR, - 0xffffffff); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PKSR, - 0xffffffff); - - /* XXX control battery charging in sleep mode. */ - - /* XXX schedule RTC alarm to check the battery, or schedule - XXX wake-up shortly before an already programmed alarm? */ - - pxa27x_run_mode(); -#define MDREFR_LOW (MDREFR_C3000 | 0x00b) - pxa27x_fastbus_run_mode(0, MDREFR_LOW); - delay(1); -#if 1 - pxa27x_cpu_speed_91(); -#else - pxa27x_frequency_change(CCCR_TURBO_X1 | CCCR_RUN_X7, CLKCFG_F, - &pxa2x0_memcfg); -#endif - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, PI2C_VOLTAGE_LOW); - - sd.sd_gpdr0 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR0); - sd.sd_gpdr1 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR1); - sd.sd_gpdr2 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR2); - sd.sd_gpdr3 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR3); - - sd.sd_grer0 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER0); - sd.sd_grer1 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER1); - sd.sd_grer2 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER2); - sd.sd_grer3 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER3); - - sd.sd_gfer0 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER0); - sd.sd_gfer1 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER1); - sd.sd_gfer2 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER2); - sd.sd_gfer3 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER3); - - sd.sd_gafr0_l = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR0_L); - sd.sd_gafr1_l = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR1_L); - sd.sd_gafr2_l = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR2_L); - sd.sd_gafr3_l = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR3_L); - - sd.sd_gafr0_u = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR0_U); - sd.sd_gafr1_u = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR1_U); - sd.sd_gafr2_u = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR2_U); - sd.sd_gafr3_u = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR3_U); - - sd.sd_gplr0 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPLR0); - sd.sd_gplr1 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPLR1); - sd.sd_gplr2 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPLR2); - sd.sd_gplr3 = bus_space_read_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPLR3); - - sd.sd_iclr = read_icu(INTCTL_ICLR); - sd.sd_icmr = read_icu(INTCTL_ICMR); - sd.sd_iccr = read_icu(INTCTL_ICCR); - write_icu(INTCTL_ICMR, 0); - - sd.sd_mecr = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MECR); - sd.sd_mcmem0 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCMEM(0)); - sd.sd_mcmem1 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCMEM(1)); - sd.sd_mcatt0 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCATT(0)); - sd.sd_mcatt1 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCATT(1)); - sd.sd_mcio0 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCIO(0)); - sd.sd_mcio1 = bus_space_read_4(sc->sc_iot, pxa2x0_memctl_ioh, - MEMCTL_MCIO(1)); - - sd.sd_cken = bus_space_read_4(sc->sc_iot, pxa2x0_clkman_ioh, - CLKMAN_CKEN); - - /* - * Stop clocks to all units except to the memory controller, and - * to the keypad controller if it is enabled as a wake-up source. - */ - rv = CKEN_MEM; - if ((sc->sc_wakeon & PXA2X0_WAKEUP_KEYNS_ALL) != 0) - rv |= CKEN_KEY; - bus_space_write_4(sc->sc_iot, pxa2x0_clkman_ioh, CLKMAN_CKEN, rv); - - /* Disable nRESET_OUT. */ - rv = bus_space_read_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSLR); -#define PSLR_SL_ROD (1<<20) - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSLR, - rv | PSLR_SL_ROD); - - /* Clear all reset status flags. */ - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_RCSR, - RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR); - - /* Stop 3/13MHz oscillator; do not float PCMCIA and chip-selects. */ - rv = PCFR_OPDE; - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) - /* Enable nRESET_GPIO as a GPIO reset input. */ - rv |= PCFR_GPR_EN; - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PCFR, rv); - - /* XXX C3000 */ -#define GPIO_G0_STROBE_BIT 0x0f800000 -#define GPIO_G1_STROBE_BIT 0x00100000 -#define GPIO_G2_STROBE_BIT 0x01000000 -#define GPIO_G3_STROBE_BIT 0x00041880 -#define GPIO_KEY_STROBE0 88 - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR0, - 0x00144018); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR1, - 0x00ef0000); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR2, - 0x0121c000); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR3, - 0x00600000); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR0, - 0x00144018 & ~GPIO_G0_STROBE_BIT); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR1, - 0x00ef0000 & ~GPIO_G1_STROBE_BIT); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR2, - 0x0121c000 & ~GPIO_G2_STROBE_BIT); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR3, - 0x00600000 & ~GPIO_G3_STROBE_BIT); - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PGSR2, - (0x0121c000 & ~GPIO_G2_STROBE_BIT) | - GPIO_BIT(GPIO_KEY_STROBE0)); - - /* C3000 */ -#define GPIO_EXT_BUS_READY 18 - pxa2x0_gpio_set_function(GPIO_EXT_BUS_READY, GPIO_SET | GPIO_OUT); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR0, 0xd01c4418); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR1, 0xfcefbd21); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR2, 0x13a5ffff); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR3, 0x01e3e10c); - - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSPR, - (u_int32_t)&pxa2x0_cpu_resume - 0xc0200000 + 0xa0200000); - - pxa2x0_cpu_suspend(); - - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PSPR, 0); - - pxa2x0_clkman_config(CKEN_SSP|CKEN_PWM0|CKEN_PWM1, 1); - pxa2x0_clkman_config(CKEN_KEY, 0); - -#if 1 - /* Clear all GPIO interrupt sources. */ - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GEDR0, 0xffffffff); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GEDR1, 0xffffffff); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GEDR2, 0xffffffff); -#endif - - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR0, sd.sd_gpdr0); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR1, sd.sd_gpdr1); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR2, sd.sd_gpdr2); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER0, sd.sd_grer0); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER1, sd.sd_grer1); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER2, sd.sd_grer2); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER0, sd.sd_gfer0); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER1, sd.sd_gfer1); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER2, sd.sd_gfer2); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR0_L, sd.sd_gafr0_l); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR1_L, sd.sd_gafr1_l); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR2_L, sd.sd_gafr2_l); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR0_U, sd.sd_gafr0_u); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR1_U, sd.sd_gafr1_u); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR2_U, sd.sd_gafr2_u); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPSR0, sd.sd_gplr0 & - sd.sd_gpdr0); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPSR1, sd.sd_gplr1 & - sd.sd_gpdr1); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPSR2, sd.sd_gplr2 & - sd.sd_gpdr2); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPCR0, ~sd.sd_gplr0 & - sd.sd_gpdr0); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPCR1, ~sd.sd_gplr1 & - sd.sd_gpdr1); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPCR2, ~sd.sd_gplr2 & - sd.sd_gpdr2); - - /* PXA27x */ -#if 0 - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GEDR3, 0xffffffff); -#endif - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPDR3, sd.sd_gpdr3); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GRER3, sd.sd_grer3); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GFER3, sd.sd_gfer3); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR3_L, sd.sd_gafr3_l); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GAFR3_U, sd.sd_gafr3_u); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPSR3, sd.sd_gplr3 & - sd.sd_gpdr3); - bus_space_write_4(sc->sc_iot, pxa2x0_gpio_ioh, GPIO_GPCR3, ~sd.sd_gplr3 & - sd.sd_gpdr3); - - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MECR, - sd.sd_mecr); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCMEM(0), - sd.sd_mcmem0); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCMEM(1), - sd.sd_mcmem1); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCATT(0), - sd.sd_mcatt0); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCATT(1), - sd.sd_mcatt1); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCIO(0), - sd.sd_mcio0); - bus_space_write_4(sc->sc_iot, pxa2x0_memctl_ioh, MEMCTL_MCIO(1), - sd.sd_mcio1); - - bus_space_write_4(sc->sc_iot, pxa2x0_clkman_ioh, CLKMAN_CKEN, - sd.sd_cken); - - write_icu(INTCTL_ICLR, sd.sd_iclr); - write_icu(INTCTL_ICCR, sd.sd_iccr); - write_icu(INTCTL_ICMR, sd.sd_icmr); - - if ((read_icu(INTCTL_ICIP) & 0x1) != 0) - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PEDR, 0x1); - - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR0, sd.sd_osmr0); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR1, sd.sd_osmr1); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR2, sd.sd_osmr2); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR3, sd.sd_osmr3); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR4, sd.sd_osmr4); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSMR5, sd.sd_osmr5); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OMCR4, sd.sd_omcr4); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OMCR5, sd.sd_omcr5); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSCR0, sd.sd_oscr0); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OSCR4, sd.sd_oscr4); - bus_space_write_4(sc->sc_iot, ost_ioh, OST_OIER, sd.sd_oier); - - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, PI2C_VOLTAGE_HIGH); - - /* Change to 208MHz run mode with fast-bus still disabled. */ - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | CCCR_RUN_X16, - CLKCFG_F, &pxa2x0_memcfg); - delay(1); /* XXX is the delay long enough, and necessary at all? */ - pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); - - /* Change to 416MHz turbo mode with fast-bus enabled. */ - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | CCCR_RUN_X16, - CLKCFG_B | CLKCFG_F | CLKCFG_T, &pxa2x0_memcfg); - - if (sc->sc_resume != NULL) { - if (!sc->sc_resume(sc)) - goto suspend_again; - } - - /* - * Allow immediate entry into deep-sleep mode if power fails. - * Resume from immediate deep-sleep is not implemented yet. - */ - bus_space_write_4(sc->sc_iot, sc->sc_pm_ioh, POWMAN_PMCR, 0); - - - restore_interrupts(save); - - pxa2x0_setperf(perflevel); - - out: - if (ost_ioh != (bus_space_handle_t)0) - bus_space_unmap(sc->sc_iot, ost_ioh, PXA2X0_OST_SIZE); -} - -void -pxa2x0_pi2c_open(bus_space_tag_t iot, bus_space_handle_t ioh) -{ - u_int32_t rv; - - /* Enable the I2C unit, and disable automatic voltage change. */ - rv = bus_space_read_4(iot, ioh, POWMAN_PCFR); - bus_space_write_4(iot, ioh, POWMAN_PCFR, rv | PCFR_PI2C_EN); - rv = bus_space_read_4(iot, ioh, POWMAN_PCFR); - bus_space_write_4(iot, ioh, POWMAN_PCFR, rv & ~PCFR_FVC); - delay(1); - - /* Enable the clock to the power manager I2C unit. */ - pxa2x0_clkman_config(CKEN_PI2C, 1); - delay(1); -} - -void -pxa2x0_pi2c_close(bus_space_tag_t iot, bus_space_handle_t ioh) -{ - u_int32_t rv; - - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_UR); - bus_space_write_4(iot, ioh, POWMAN_PISAR, 0); - delay(1); - - /* Disable the clock to the power manager I2C unit. */ - pxa2x0_clkman_config(CKEN_PI2C, 0); - delay(1); - - /* Disable the I2C unit, and disable automatic voltage change. */ - rv = bus_space_read_4(iot, ioh, POWMAN_PCFR); - bus_space_write_4(iot, ioh, POWMAN_PCFR, - rv & ~(PCFR_PI2C_EN | PCFR_FVC)); - delay(1); -} - -int -pxa2x0_pi2c_read(bus_space_tag_t iot, bus_space_handle_t ioh, - u_char slave, u_char *valuep) -{ - u_int32_t rv; - int timeout; - int tries = PI2C_RETRY_COUNT; - -retry: - - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_UR); - bus_space_write_4(iot, ioh, POWMAN_PISAR, 0x00); - delay(1); - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_IUE | PICR_SCLE); - - /* Write slave device address. */ - bus_space_write_4(iot, ioh, POWMAN_PIDBR, (slave<<1) | 0x1); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_START); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & ~PICR_STOP); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_ITE) == 0) { - if (timeout-- == 0) { - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - goto err; - } - delay(1); - } - - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & ~PICR_START); - - /* Read data value. */ - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | - (PICR_STOP | PICR_ACKNAK)); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_IRF) == 0) { - if (timeout-- == 0) { - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_IRF); - goto err; - } - delay(1); - } - - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_IRF); - rv = bus_space_read_4(iot, ioh, POWMAN_PIDBR); - *valuep = (u_char)rv; - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & - ~(PICR_STOP | PICR_ACKNAK)); - - return (0); -err: - if (tries-- >= 0) - goto retry; - - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_UR); - bus_space_write_4(iot, ioh, POWMAN_PISAR, 0x00); - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_IUE | PICR_SCLE); - - return (-EIO); -} - -int -pxa2x0_pi2c_write(bus_space_tag_t iot, bus_space_handle_t ioh, - u_char slave, u_char value) -{ - u_int32_t rv; - int timeout; - int tries = PI2C_RETRY_COUNT; - -retry: - - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_UR); - bus_space_write_4(iot, ioh, POWMAN_PISAR, 0x00); - delay(1); - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_IUE | PICR_SCLE); - - /* Write slave device address. */ - bus_space_write_4(iot, ioh, POWMAN_PIDBR, (slave<<1)); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_START); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & ~PICR_STOP); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_ITE) == 0) { - if (timeout-- == 0) { - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - goto err; - } - delay(1); - } - if ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_ACKNAK) != 0) - goto err; - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - - /* Write data. */ - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & ~PICR_START); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_STOP); - bus_space_write_4(iot, ioh, POWMAN_PIDBR, value); - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv | PICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_ITE) == 0) { - if (timeout-- == 0) { -#if 0 - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); -#endif - goto err; - } - delay(1); - } - if ((bus_space_read_4(iot, ioh, POWMAN_PISR) & PISR_ACKNAK) != 0) - goto err; - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - - rv = bus_space_read_4(iot, ioh, POWMAN_PICR); - bus_space_write_4(iot, ioh, POWMAN_PICR, rv & ~PICR_STOP); - - return (0); -err: - bus_space_write_4(iot, ioh, POWMAN_PISR, PISR_ITE); - if (tries-- >= 0) - goto retry; - - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_UR); - bus_space_write_4(iot, ioh, POWMAN_PISAR, 0x00); - bus_space_write_4(iot, ioh, POWMAN_PICR, PICR_IUE | PICR_SCLE); - - return (-EIO); -} - -int -pxa2x0_pi2c_getvoltage(bus_space_tag_t iot, bus_space_handle_t ioh, - u_char *valuep) -{ - int res; - - pxa2x0_pi2c_open(iot, ioh); - res = pxa2x0_pi2c_read(iot, ioh, 0x0c, valuep); - pxa2x0_pi2c_close(iot, ioh); - return (res); -} - -int -pxa2x0_pi2c_setvoltage(bus_space_tag_t iot, bus_space_handle_t ioh, - u_char value) -{ - int res; - - pxa2x0_pi2c_open(iot, ioh); - res = pxa2x0_pi2c_write(iot, ioh, 0x0c, value); - pxa2x0_pi2c_close(iot, ioh); - return (res); -} - -#if 0 -void -pxa2x0_pi2c_print(struct pxa2x0_apm_softc *sc) -{ - u_char value = 0; - - (void)pxa2x0_pi2c_getvoltage(sc->sc_iot, sc->sc_pm_ioh, &value); - printf("xscale core voltage: %s\n", value == PI2C_VOLTAGE_HIGH ? - "high" : (value == PI2C_VOLTAGE_LOW ? "low" : "unknown")); -} -#endif - -struct { - int maxspeed; - int numspeeds; - int hz [6]; - int rate [6]; /* could this be simplfied by not having 100% in table? */ -} -speedtables[] = { - { 91, 1, { 91 }, { 100 }}, - { 208, 2, { 91, 208}, {50, 100}}, - { 416, 3, { 91, 208, 416}, {25, 50, 100}}, - { 520, 4, { 91, 208, 416, 520}, {18, 40 ,80, 100}}, - { 624, 5, { 91, 208, 416, 520, 624}, {15, 34, 67, 82, 100}}, - { 0 } -}; -int xscale_maxspeed = 416; /* XXX */ - -int speed_to_freq(int speed); - -int -speed_to_freq(int speed) -{ - int i, j; - int newspeed = 0; - int numspeeds; - for (i = 0; speedtables[i].maxspeed != 0; i++) { - if (speedtables[i].maxspeed != xscale_maxspeed) - continue; - - if (speed <= speedtables[i].rate[0]) { - return speedtables[i].hz[0]; - - } - numspeeds = speedtables[i].numspeeds; - if (speed == speedtables[i].rate[numspeeds-1]) { - return speedtables[i].hz[numspeeds-1]; - } - for (j = 1; j < numspeeds; j++) { - if (speed < speedtables[i].rate[j]) { - return speedtables[i].hz[j-1]; - } - } - } - return newspeed; -} - - -void -pxa2x0_setperf(int speed) -{ - struct pxa2x0_apm_softc *sc; - int s; - int newfreq; - - sc = apm_cd.cd_devs[0]; - - newfreq = speed_to_freq(speed); - - if (newfreq == 0) { - printf("bogus new frequency 0 for rate %d maxclock %d\n", - speed, xscale_maxspeed); - } - - DPRINTF(("setperf speed %d newfreq %d, maxfreq %d\n", - speed, newfreq, xscale_maxspeed)); - - s = disable_interrupts(PSR_I|PSR_F); - - if (newfreq == 91) { - if (freq > 91) { - pxa27x_run_mode(); - pxa27x_fastbus_run_mode(0, MDREFR_LOW); - pxa27x_cpu_speed_91(); - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, - PI2C_VOLTAGE_LOW); - freq = 91; - } - } else if (newfreq == 208) { - if (freq < 208) - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, - PI2C_VOLTAGE_HIGH); - if (freq != 208) { - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_F, &pxa2x0_memcfg); - pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); - freq = 208; - } - } else if (newfreq == 416) { - if (freq < 208) { - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, - PI2C_VOLTAGE_HIGH); - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_F, &pxa2x0_memcfg); - pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); - } - if (freq != 416) { - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_B | CLKCFG_F | CLKCFG_T, - &pxa2x0_memcfg); - freq = 416; - } - } else if (newfreq == 520) { - if (freq < 208) { - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, - PI2C_VOLTAGE_HIGH); - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_F, &pxa2x0_memcfg); - pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); - } - if (freq != 520) { - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X25 | - CCCR_RUN_X16, CLKCFG_B | CLKCFG_F | CLKCFG_T, - &pxa2x0_memcfg); - freq = 520; - } - } else if (newfreq == 624) { - if (freq < 208) { - pxa2x0_pi2c_setvoltage(sc->sc_iot, sc->sc_pm_ioh, - PI2C_VOLTAGE_HIGH); - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X2 | - CCCR_RUN_X16, CLKCFG_F, &pxa2x0_memcfg); - pxa27x_fastbus_run_mode(1, pxa2x0_memcfg.mdrefr_high); - } - if (freq != 624) { - pxa27x_frequency_change(CCCR_A | CCCR_TURBO_X3 | - CCCR_RUN_X16, CLKCFG_B | CLKCFG_F | CLKCFG_T, - &pxa2x0_memcfg); - freq = 624; - } - } - - restore_interrupts(s); -} - -int -pxa2x0_cpuspeed(int *freqp) -{ - *freqp = freq; - return 0; -} - -void pxa2x0_maxspeed(int *speedp); - -void -pxa2x0_maxspeed(int *speedp) -{ - /* XXX assumes a pxa270 */ - - if (*speedp < 207) { - *speedp = 91; - } else if (*speedp < 415) { - *speedp = 208; - } else if (*speedp < 519) { - *speedp = 416; - } else if (*speedp < 624) { - *speedp = 520; -#if 0 - } else if (*speedp < 651) { - *speedp = 624; -#endif - } else { - *speedp = 520; /* hope this is safe. */ - } - xscale_maxspeed = *speedp; - pxa2x0_setperf(perflevel); -} diff --git a/sys/arch/arm/xscale/pxa2x0_apm.h b/sys/arch/arm/xscale/pxa2x0_apm.h deleted file mode 100644 index 6d5fe3935f6..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_apm.h +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: pxa2x0_apm.h,v 1.8 2009/03/27 16:01:37 oga Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#ifndef _PXA2X0_APM_H_ -#define _PXA2X0_APM_H_ - -#include <sys/event.h> - -#include <machine/bus.h> -#include <machine/apmvar.h> - -struct pxa2x0_apm_softc { - struct device sc_dev; - struct proc *sc_thread; - struct rwlock sc_lock; - struct klist sc_note; - int sc_flags; - int sc_wakeon; /* enabled wakeup sources */ - int sc_batt_life; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_pm_ioh; - bus_space_handle_t sc_memctl_ioh; - int (*sc_get_event)(struct pxa2x0_apm_softc *, u_int *); - void (*sc_power_info)(struct pxa2x0_apm_softc *, - struct apm_power_info *); - void (*sc_suspend)(struct pxa2x0_apm_softc *); - int (*sc_resume)(struct pxa2x0_apm_softc *); -}; - -void pxa2x0_apm_attach_sub(struct pxa2x0_apm_softc *); -void pxa2x0_apm_sleep(struct pxa2x0_apm_softc *); - -#define PXA2X0_WAKEUP_POWERON (1<<0) -#define PXA2X0_WAKEUP_GPIORST (1<<1) -#define PXA2X0_WAKEUP_SD (1<<2) -#define PXA2X0_WAKEUP_RC (1<<3) -#define PXA2X0_WAKEUP_SYNC (1<<4) -#define PXA2X0_WAKEUP_KEYNS0 (1<<5) -#define PXA2X0_WAKEUP_KEYNS1 (1<<6) -#define PXA2X0_WAKEUP_KEYNS2 (1<<7) -#define PXA2X0_WAKEUP_KEYNS3 (1<<8) -#define PXA2X0_WAKEUP_KEYNS4 (1<<9) -#define PXA2X0_WAKEUP_KEYNS5 (1<<10) -#define PXA2X0_WAKEUP_KEYNS6 (1<<11) -#define PXA2X0_WAKEUP_CF0 (1<<12) -#define PXA2X0_WAKEUP_CF1 (1<<13) -#define PXA2X0_WAKEUP_USBD (1<<14) -#define PXA2X0_WAKEUP_LOCKSW (1<<15) -#define PXA2X0_WAKEUP_JACKIN (1<<16) -#define PXA2X0_WAKEUP_CHRGFULL (1<<17) -#define PXA2X0_WAKEUP_RTC (1<<18) - -#define PXA2X0_WAKEUP_KEYNS_ALL (PXA2X0_WAKEUP_KEYNS0| \ - PXA2X0_WAKEUP_KEYNS1|PXA2X0_WAKEUP_KEYNS2|PXA2X0_WAKEUP_KEYNS3| \ - PXA2X0_WAKEUP_KEYNS4|PXA2X0_WAKEUP_KEYNS5|PXA2X0_WAKEUP_KEYNS6) - -#define PXA2X0_WAKEUP_CF_ALL (PXA2X0_WAKEUP_CF0|PXA2X0_WAKEUP_CF1) - -#define PXA2X0_WAKEUP_ALL (PXA2X0_WAKEUP_POWERON| \ - PXA2X0_WAKEUP_GPIORST|PXA2X0_WAKEUP_SD|PXA2X0_WAKEUP_RC| \ - PXA2X0_WAKEUP_SYNC|PXA2X0_WAKEUP_KEYNS_ALL|PXA2X0_WAKEUP_CF_ALL| \ - PXA2X0_WAKEUP_USBD|PXA2X0_WAKEUP_LOCKSW|PXA2X0_WAKEUP_JACKIN| \ - PXA2X0_WAKEUP_CHRGFULL|PXA2X0_WAKEUP_RTC) - -void pxa2x0_wakeup_config(u_int, int); -u_int pxa2x0_wakeup_status(void); - -#endif diff --git a/sys/arch/arm/xscale/pxa2x0_apm_asm.S b/sys/arch/arm/xscale/pxa2x0_apm_asm.S deleted file mode 100644 index 7ed388e463e..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_apm_asm.S +++ /dev/null @@ -1,588 +0,0 @@ -/* $OpenBSD: pxa2x0_apm_asm.S,v 1.6 2016/04/25 04:46:56 jsg Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <machine/asm.h> -#include <arm/sysreg.h> -#include <machine/cpu.h> - -#include <arch/arm/xscale/pxa2x0reg.h> -#include <arch/arm/sa11x0/sa11x0_reg.h> - -/* XXX replace with values defined elsewhere. */ -#define DCACHE_CACHELINECOUNT 1024 -#define CACHELINESIZE 32 -#define DCACHE_SIZE (CACHELINESIZE * DCACHE_CACHELINECOUNT) - -/* cp14 register 6 */ -#define CLKCFG_T (1<<0) /* turbo */ -#define CLKCFG_F (1<<1) /* frequency change */ -#define CLKCFG_HT (1<<2) /* half-turbo */ -#define CLKCFG_B (1<<3) /* fast-bus */ - -/* cp14 register 7 */ -#define PWRMODE_NORMAL (0<<0) -#define PWRMODE_IDLE (1<<0) -#define PWRMODE_STANDBY (2<<0) -#define PWRMODE_SLEEP (3<<0) -#define PWRMODE_DEEP_SLEEP (7<<0) - -/* XXX */ -#define MDREFR_C3000 (MDREFR_K0DB2|MDREFR_E1PIN|MDREFR_K1RUN|\ - MDREFR_K1DB2|MDREFR_K2DB2|MDREFR_APD) -#define MDREFR_DRI_91MHZ (0x13<<0) -#define MDREFR_HIGH (MDREFR_C3000 | 0x030) -#define MDREFR_LOW (MDREFR_C3000 | 0x00b) -#define MDREFR_SPEED_91 (MDREFR_C3000 | MDREFR_DRI_91MHZ) -#define MDREFR_SPEED_LOW (MDREFR_C3000 | 0x017) -#define MSC0_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 2 << MSC_RRR_SHIFT) | \ - (13 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RBW /* PXA271 */ | \ - MSC_RT_NONBURST -#define MSC1_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_VLIO << 16) | \ - ( 3 << MSC_RRR_SHIFT) | \ - ( 4 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC2_HIGH \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 3 << MSC_RRR_SHIFT) | \ - ( 4 << MSC_RDN_SHIFT) | \ - (13 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC0_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 8 << MSC_RDN_SHIFT) | \ - ( 8 << MSC_RDF_SHIFT) | \ - MSC_RBW /* PXA271 */ | \ - MSC_RT_NONBURST -#define MSC1_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_VLIO << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 2 << MSC_RDN_SHIFT) | \ - ( 6 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO -#define MSC2_LOW \ - ( 7 << MSC_RRR_SHIFT << 16) | \ - (15 << MSC_RDN_SHIFT << 16) | \ - (15 << MSC_RDF_SHIFT << 16) | \ - (MSC_RT_NONBURST << 16) | \ - ( 1 << MSC_RRR_SHIFT) | \ - ( 2 << MSC_RDN_SHIFT) | \ - ( 6 << MSC_RDF_SHIFT) | \ - MSC_RT_VLIO - - .text - .global _C_LABEL(vector_page) - .global _C_LABEL(xscale_cache_clean_addr) - .global _C_LABEL(pxa2x0_clkman_ioh) - .global _C_LABEL(pxa2x0_memctl_ioh) - -.Lvector_page: - .word _C_LABEL(vector_page) -.Lxscale_cache_clean_addr: - .word _C_LABEL(xscale_cache_clean_addr) - -.Lgpioiohp: .word _C_LABEL(pxa2x0_gpio_ioh) -.Lclkmaniohp: .word _C_LABEL(pxa2x0_clkman_ioh) -.Lmemctliohp: .word _C_LABEL(pxa2x0_memctl_ioh) - -.Lsleepdata: .word sleepdata -.Lsleepdata_phys: .word sleepdata - 0xc0200000 + 0xa0200000 /* XXX */ -.Lsleepdata_svc: .word sleepdata_svc - -.Lcccr_high: .word CCCR_A | CCCR_TURBO_X2 | CCCR_RUN_X16 -.Lmdrefr_high: .word MDREFR_HIGH -.Lmsc0_high: .word MSC0_HIGH -.Lmsc1_high: .word MSC1_HIGH -.Lmsc2_high: .word MSC2_HIGH -.Lmdrefr_low: .word MDREFR_LOW -.Lmsc0_low: .word MSC0_LOW -.Lmsc1_low: .word MSC1_LOW -.Lmsc2_low: .word MSC2_LOW - -/* - * void pxa2x0_cpu_suspend(void) - * - * Enter sleep mode without automatic voltage change. The core must - * be in low power mode, and interrupts disabled. - */ -ENTRY(pxa2x0_cpu_suspend) - stmdb sp!, {r0-r12, lr} - - ldr r3, .Lsleepdata /* Point to the data area. */ - ldr r2, =pxa2x0_cpu_resume_virt - str r2, [r3], #4 - - mrc CP15_SCTLR(r2) /* Load MMU control register. */ - mov r0, #0xff000000 - orr r0, r0, #0x00ff0000 - bic r2, r2, r0 /* Clear undefined bits. */ - str r2, [r3], #4 /* Save MMU control register. */ - - mrc CP15_TTBR0(r2) /* Load TTB address. */ - mov r0, #0x00003f00 - orr r0, r0, #0x000000ff - bic r2, r2, r0 /* Clear undefined bits. */ - str r2, [r3], #4 /* Save TTB address. */ - - mrc CP15_DACR(r2) /* Load domain access control. */ - str r2, [r3], #4 /* Save domain access control. */ - - mrs r2, spsr /* Load SVC saved CPSR. */ - str r2, [r3], #4 /* Save SVC saved CPSR. */ - str sp, [r3], #4 /* Save SVC stack pointer. */ - - mov r1, #(PSR_FIQ32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Enter FIQ mode. */ - mrs r2, spsr /* Load FIQ mode saved CPSR. */ - stmia r3!, {r2, r8-r12, sp, lr} /* Save FIQ mode registers. */ - - mov r1, #(PSR_IRQ32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Enter IRQ mode. */ - mrs r0, spsr /* Load IRQ mode saved CPSR. */ - stmia r3!, {r0, sp, lr} /* Save IRQ mode registers. */ - - mov r1, #(PSR_ABT32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Enter ABT mode. */ - mrs r0, spsr /* Load ABT mode saved CPSR. */ - stmia r3!, {r0, sp, lr} /* Save ABT mode registers. */ - - mov r1, #(PSR_UND32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Enter UND mode. */ - mrs r0, spsr /* Load UND mode saved CPSR. */ - stmia r3!, {r0, sp, lr} /* Save UND mode registers. */ - - mov r1, #(PSR_SYS32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Enter SYS mode. */ - stmia r3!, {sp, lr} /* Save SYS mode registers. */ - - mov r1, #(PSR_SVC32_MODE | PSR_I | PSR_F) - msr cpsr, r1 /* Return to SVC mode. */ - - /* At this point all critical registers have been saved. */ - - mov r0, #0 - mcr CP15_CP15DSB(r0) /* drain write buffer */ - - mov r1, #DCACHE_CACHELINECOUNT - ldr r2, .Lxscale_cache_clean_addr - ldr r0, [r2] - /* - * For an explanation of the following two instructions, refer - * to the ``BUG ALERT'' section of the XSCALE_CACHE_CLEAN_PROLOGUE - * macro in arch/arm/arm/cpufunc_asm_xscale.S. - */ - eor r0, r0, #(DCACHE_SIZE) - str r0, [r2] - -cache_flush_loop: - mrs r2, cpsr - orr r2, r2, #(PSR_I|PSR_F) - msr cpsr_c, r2 /* disable IRQ/FIQ */ - - mcr p15, 0, r0, c7, c2, 5 /* allocate cache line */ - mcr CP15_DCIMVAC(r0) /* flush D cache single entry */ - - mrs r2, cpsr - and r2, r2, #~(PSR_I|PSR_F) - msr cpsr_c, r2 /* enable IRQ/FIQ */ - - add r0, r0, #CACHELINESIZE - subs r1, r1, #1 - bne cache_flush_loop - - mov r0, #0 - mcr CP15_CP15DSB(r0) /* drain write buffer */ - - b 1f -1: - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - nop - - /* Prepare to enter sleep mode. */ - mov r1, #PWRMODE_SLEEP - - /* Prepare to put SDRAM into self-refresh mode. */ - ldr r4, .Lmemctliohp - ldr r4, [r4] - add r4, r4, #MEMCTL_MDREFR - ldr r5, [r4] - orr r5, r5, #MDREFR_SLFRSH - - /* XXX prepare pointer to physical address 0, but for whom? */ - ldr r2, .Lvector_page - - /* - * Execute the rest of this routine from cache. The needed values - * are now in registers. - */ - b 1f - /* XXX tell as(1) to dump the literal pool here, but why? */ - .ltorg - .align 5 -1: - - /* Put SDRAM into self-refresh mode manually. */ - str r5, [r4] - nop - - /* - * Enter sleep mode. Exit from sleep mode returns the processor - * to normal run mode. Execution resumes at the physical address - * stored in the PSPR after the required boot sequence (a short - * excursion into the ROM boot loader). - */ - mcr p14, 0, r1, c7, c0, 0 - - /* Just in case that wake-up does not resume at */ - nop - nop - nop -1: - b 1b - -/* - * void pxa2x0_cpu_resume(void) - */ - .align 5 -ENTRY(pxa2x0_cpu_resume) - /* XXX C3000-specific */ - ldr r0, .Lmdrefr_addr_phys - b 1f - .align 5 -1: - ldr r2, [r0] - bic r2, r2, #MDREFR_DRI & 0x000000ff - bic r2, r2, #MDREFR_DRI & 0x0000ff00 - orr r2, r2, #MDREFR_DRI_91MHZ - str r2, [r0] - b 1f - .align 5 -1: - ldr r0, .Lsleepdata_phys /* Point to PA of saved data. */ - - ldmia r0!, {r7-r10} - mcr CP15_DACR(r10) /* Restore domain access control. */ - mcr CP15_TTBR0(r9) /* Restore TTB address. */ - mcr CP15_TLBIALL(r0) /* Flush I+D TLBs. */ - mcr p15, 0, r0, c7, c7, 0 /* Flush I+D BTB. */ - mcr CP15_SCTLR(r8) /* Restore MMU control. */ - mov pc, r7 /* Jump to virtual address. */ - nop - nop - nop - nop - nop - nop - nop - nop - -pxa2x0_cpu_resume_virt: - ldr r2, .Lsleepdata_svc /* Load VA of saved registers. */ - - /* Restore SVC mode SPSR and stack pointer. */ - ldr r0, [r2], #4 - msr spsr, r0 - ldr sp, [r2], #4 - - /* Restore FIQ mode registers. */ - mov r1, #(PSR_FIQ32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - ldr r0, [r2], #4 - msr spsr, r0 - ldr r8, [r2], #4 - ldr r9, [r2], #4 - ldr r10, [r2], #4 - ldr r11, [r2], #4 - ldr r12, [r2], #4 - ldr sp, [r2], #4 - ldr lr, [r2], #4 - - /* Restore IRQ mode registers. */ - mov r1, #(PSR_IRQ32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - ldr r0, [r2], #4 - msr spsr, r0 - ldr sp, [r2], #4 - ldr lr, [r2], #4 - - /* Restore ABT mode registers. */ - mov r1, #(PSR_ABT32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - ldr r0, [r2], #4 - msr spsr, r0 - ldr sp, [r2], #4 - ldr lr, [r2], #4 - - /* Restore UND mode registers. */ - mov r1, #(PSR_UND32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - ldr r0, [r2], #4 - msr spsr, r0 - ldr sp, [r2], #4 - ldr lr, [r2], #4 - - /* Restore SYS mode registers. */ - mov r1, #(PSR_SYS32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - ldr sp, [r2], #4 - ldr lr, [r2], #4 - - /* Return to SVC mode. */ - mov r1, #(PSR_SVC32_MODE | PSR_I | PSR_F) - msr cpsr, r1 - - ldmia sp!, {r0-r12, pc} - -.Lmdrefr_addr_phys: - .word PXA2X0_MEMCTL_BASE + MEMCTL_MDREFR - - .data - -/* - * Saved processor state - */ - .align 5 -sleepdata: - .word 0 /* =pxa2x0_cpu_resume_virt */ - .word 0 /* MMU control */ - .word 0 /* MMU TTB address */ - .word 0 /* MMU domain access control */ -sleepdata_svc: - .word 0 /* SVC mode saved CPSR */ - .word 0 /* SVC mode stack pointer */ - .word 0 /* FIQ mode saved CPSR */ - .word 0 /* FIQ mode r8 */ - .word 0 /* FIQ mode r9 */ - .word 0 /* FIQ mode r10 */ - .word 0 /* FIQ mode r11 */ - .word 0 /* FIQ mode r12 */ - .word 0 /* FIQ mode stack pointer */ - .word 0 /* FIQ mode link register */ - .word 0 /* IRQ mode saved CPSR */ - .word 0 /* IRQ mode stack pointer */ - .word 0 /* IRQ mode link register */ - .word 0 /* ABT mode saved CPSR */ - .word 0 /* ABT mode stack pointer */ - .word 0 /* ABT mode link register */ - .word 0 /* UND mode saved CPSR */ - .word 0 /* UND mode stack pointer */ - .word 0 /* UND mode link register */ - .word 0 /* SYS mode stack pointer */ - .word 0 /* SYS mode link register */ - - .text - -/* - * void pxa27x_run_mode(void) - * - * Disable half-turbo and turbo mode, but keep fast-bus mode. - * Memory and LCD clock is not changed, so no reconfiguration is - * necessary. - */ -ENTRY(pxa27x_run_mode) - stmdb sp!, {r0} - mrc p14, 0, r0, c6, c0, 0 - and r0, r0, #~(CLKCFG_HT | CLKCFG_F| CLKCFG_T) - mcr p14, 0, r0, c6, c0, 0 - ldmia sp!, {r0} - mov pc, lr - -/* - * void pxa27x_fastbus_run_mode(int enable, u_int32_t mdrefr) - * - * Enter normal run mode with fast-bus mode enabled or disabled. - * The new value of MDREFR is programmed before or after CLKCFG, - * as appropriate. - */ - .align 5 -ENTRY(pxa27x_fastbus_run_mode) - stmdb sp!, {r0-r2, lr} - ldr r2, .Lmemctliohp - ldr r2, [r2] - cmp r0, #0 - beq disable_fastbus - b enable_fastbus - .align 5 -enable_fastbus: - /* Enter normal run mode with fast-bus mode enabled. */ - mov r0, #CLKCFG_B - mcr p14, 0, r0, c6, c0, 0 - /* Set the new SDRAM refresh rate. */ - str r1, [r2, #MEMCTL_MDREFR] - ldr r0, [r2, #MEMCTL_MDREFR] - mov r0, r0 - ldmia sp!, {r0-r2, pc} - .align 5 -disable_fastbus: - /* Set the new SDRAM refresh rate. */ - str r1, [r2, #MEMCTL_MDREFR] - ldr r0, [r2, #MEMCTL_MDREFR] - mov r0, r0 - /* Enter normal run mode with fast-bus mode disabled. */ - mov r0, #0x0 - mcr p14, 0, r0, c6, c0, 0 - ldmia sp!, {r0-r2, pc} - -/* Keep these offsets in sync with struct memcfg. */ -#define memcfg_mdrefr_high 0x00 -#define memcfg_mdrefr_low 0x04 -#define memcfg_mdrefr_low2 0x08 /* unused */ -#define memcfg_msc_high 0x0c -#define memcfg_msc_low 0x18 -#define memcfg_mdrefr_91 0x24 - -/* - * void pxa27x_frequency_change(int cccr, int clkcfg, - * struct pxa2x0_memcfg *memcfg) - * - * Change the core PLL frequency and SDRAM refresh rate, ensuring the - * proper sequence of operations. If the CCCR_A bit is clear and L - * is not equal to 7 the result is undefined. - */ - .align 5 -ENTRY(pxa27x_frequency_change) - stmdb sp!, {r0-r5, lr} - - /* Always write to CCCR before a frequency change. */ - ldr r3, .Lclkmaniohp - ldr r3, [r3] - str r0, [r3, #CLKMAN_CCCR] - - /* Load the needed values into registers to avoid SDRAM access. */ - and r3, r0, #CCCR_L_MASK - ldr r0, .Lmemctliohp - ldr r0, [r0] - cmp r3, #CCCR_RUN_X7 /* L=7 is 91MHz mode */ - beq frequency_change_91 - and r3, r1, #CLKCFG_B - cmp r3, #CLKCFG_B - bne frequency_change_208 - /* FALLTHROUGH */ -frequency_change_high: - ldr r3, [r2, #memcfg_mdrefr_low] - ldr r4, [r2, #memcfg_mdrefr_high] - add r2, r2, #memcfg_msc_high - bl frequency_change_on_cache /* XXX why BL? */ -frequency_change_208: - ldr r3, [r2, #memcfg_mdrefr_low] - ldr r4, [r2, #memcfg_mdrefr_low] - add r2, r2, #memcfg_msc_high - bl frequency_change_on_cache -frequency_change_91: - ldr r3, [r2, #memcfg_mdrefr_low] - ldr r4, [r2, #memcfg_mdrefr_91] - add r2, r2, #memcfg_msc_low - bl frequency_change_on_cache - - /* Align execution to a cache line. */ - .align 5 -frequency_change_on_cache: - /* Change to a low SDRAM refresh rate. Wait until the store to - * MDREFR is complete, following section 2.4 I/O Ordering and - * 6.5.1.4 of the PXA27x Developer's Manual. */ - str r3, [r0, #MEMCTL_MDREFR] - ldr r5, [r0, #MEMCTL_MDREFR] - mov r5, r5 - /* Program new CLKCFG value, starting a core PLL frequency change - * if CLKCFG_F is set. */ - mcr p14, 0, r1, c6, c0, 0 - /* Change SDRAM clock frequency to 104MHz, and ensure that the - * store to MDREFR is complete before the next SDRAM access. */ - str r4, [r0, #MEMCTL_MDREFR] - ldr r5, [r0, #MEMCTL_MDREFR] - mov r5, r5 - /* Configure synchronous, static, and VLIO interfaces. */ - ldr r1, [r2], #4 - str r1, [r0, #MEMCTL_MSC0] - ldr r1, [r2], #4 - str r1, [r0, #MEMCTL_MSC1] - ldr r1, [r2] - str r1, [r0, #MEMCTL_MSC2] - ldmia sp!, {r0-r5, pc} - -/* - * void pxa27x_cpu_speed_91(void) - * - * Switch core run frequency to 91 MHz. - */ - .align 5 -ENTRY(pxa27x_cpu_speed_91) - stmdb sp!, {r0-r3, lr} - - ldr r0, .Lclkmaniohp - ldr r0, [r0] - ldr r1, .Lcccr_91 - str r1, [r0, #CLKMAN_CCCR] - - ldr r0, .Lmemctliohp - ldr r0, [r0] - ldr r2, .Lmdrefr_91 - ldr r3, .Lmdrefr_low - - bl 1f - .align 5 -1: - str r3, [r0, #MEMCTL_MDREFR] - ldr r3, [r0, #MEMCTL_MDREFR] - - mov r1, #CLKCFG_F - mcr p14, 0, r1, c6, c0, 0 - str r2, [r0, #MEMCTL_MDREFR] - ldr r2, [r0, #MEMCTL_MDREFR] - - ldr r1, .Lmsc0_low - str r1, [r0, #MEMCTL_MSC0] - ldr r1, .Lmsc1_low - str r1, [r0, #MEMCTL_MSC1] - ldr r1, .Lmsc2_low - str r1, [r0, #MEMCTL_MSC2] - - ldmia sp!, {r0-r3, pc} - -.Lcccr_91: .word CCCR_TURBO_X1 | CCCR_RUN_X7 -.Lmdrefr_91: .word MDREFR_SPEED_91 diff --git a/sys/arch/arm/xscale/pxa2x0_clock.c b/sys/arch/arm/xscale/pxa2x0_clock.c deleted file mode 100644 index 89b9c444614..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_clock.c +++ /dev/null @@ -1,301 +0,0 @@ -/* $OpenBSD: pxa2x0_clock.c,v 1.6 2008/01/03 17:59:32 kettenis Exp $ */ - -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/device.h> -#include <sys/timetc.h> - -#include <machine/bus.h> -#include <machine/intr.h> - -#include <arm/cpufunc.h> - -#include <arm/sa11x0/sa11x0_reg.h> -#include <arm/sa11x0/sa11x0_var.h> -#include <arm/sa11x0/sa11x0_ostreg.h> -#include <arm/xscale/pxa2x0reg.h> - -int pxaost_match(struct device *, void *, void *); -void pxaost_attach(struct device *, struct device *, void *); - -int doclockintr(void *); -int clockintr(void *); -int statintr(void *); -void rtcinit(void); - -struct pxaost_softc { - struct device sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - - u_int32_t sc_clock_count; - u_int32_t sc_statclock_count; - u_int32_t sc_statclock_step; - u_int32_t sc_clock_step; - u_int32_t sc_clock_step_err_cnt; - u_int32_t sc_clock_step_error; -}; - -static struct pxaost_softc *pxaost_sc = NULL; - -#define CLK4_TIMER_FREQUENCY 32768 /* 32.768KHz */ - -#define CLK0_TIMER_FREQUENCY 3250000 /* 3.2500MHz */ - -#ifndef STATHZ -#define STATHZ 64 -#endif - -struct cfattach pxaost_ca = { - sizeof (struct pxaost_softc), pxaost_match, pxaost_attach -}; - -struct cfdriver pxaost_cd = { - NULL, "pxaost", DV_DULL -}; - -u_int pxaost_get_timecount(struct timecounter *tc); - -static struct timecounter pxaost_timecounter = { - pxaost_get_timecount, NULL, 0xffffffff, CLK4_TIMER_FREQUENCY, - "pxaost", 0, NULL -}; - -int -pxaost_match(parent, match, aux) - struct device *parent; - void *match; - void *aux; -{ - return (1); -} - -void -pxaost_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; -{ - struct pxaost_softc *sc = (struct pxaost_softc*)self; - struct sa11x0_attach_args *sa = aux; - - printf("\n"); - - sc->sc_iot = sa->sa_iot; - - pxaost_sc = sc; - - if (bus_space_map(sa->sa_iot, sa->sa_addr, sa->sa_size, 0, - &sc->sc_ioh)) - panic("%s: Cannot map registers", self->dv_xname); - - /* disable all channel and clear interrupt status */ - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_IR, 0); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_SR, 0x3f); - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OMCR4, 0xc1); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OMCR5, 0x41); - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR4, - pxaost_sc->sc_clock_count); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR5, - pxaost_sc->sc_statclock_count); - - /* Zero the counter value */ - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSCR4, 0); - -} - -u_int -pxaost_get_timecount(struct timecounter *tc) -{ - return bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSCR4); -} - -int -clockintr(arg) - void *arg; -{ - struct clockframe *frame = arg; - u_int32_t oscr, match; - u_int32_t match_error; - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_SR, 0x10); - - match = pxaost_sc->sc_clock_count; - - do { - match += pxaost_sc->sc_clock_step; - pxaost_sc->sc_clock_step_error += - pxaost_sc->sc_clock_step_err_cnt; - if (pxaost_sc->sc_clock_count > hz) { - match_error = pxaost_sc->sc_clock_step_error / hz; - pxaost_sc->sc_clock_step_error -= (match_error * hz); - match += match_error; - } - pxaost_sc->sc_clock_count = match; - hardclock(frame); - - oscr = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSCR4); - - } while ((signed)(oscr - match) > 0); - - /* prevent missed interrupts */ - if (oscr - match < 5) - match += 5; - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR4, - match); - - return(1); -} - -int -statintr(arg) - void *arg; -{ - struct clockframe *frame = arg; - u_int32_t oscr, match; - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_SR, 0x20); - - /* schedule next clock intr */ - match = pxaost_sc->sc_statclock_count; - do { - match += pxaost_sc->sc_statclock_step; - pxaost_sc->sc_statclock_count = match; - statclock(frame); - - oscr = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSCR4); - - } while ((signed)(oscr - match) > 0); - - /* prevent missed interrupts */ - if (oscr - match < 5) - match += 5; - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR5, - match); - - return(1); -} - -void -setstatclockrate(int newstathz) -{ - u_int32_t count; - pxaost_sc->sc_statclock_step = CLK4_TIMER_FREQUENCY / newstathz; - count = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSCR4); - count += pxaost_sc->sc_statclock_step; - pxaost_sc->sc_statclock_count = count; - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSMR5, count); -} - -int -doclockintr(void *arg) -{ - u_int32_t status; - int result = 0; - - status = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_SR); - if (status & 0x10) - result |= clockintr(arg); - if (status & 0x20) - result |= statintr(arg); - - return (result); -} - -void -cpu_initclocks() -{ - u_int32_t clk; - - stathz = STATHZ; - profhz = stathz; - pxaost_sc->sc_statclock_step = CLK4_TIMER_FREQUENCY / stathz; - pxaost_sc->sc_clock_step = CLK4_TIMER_FREQUENCY / hz; - pxaost_sc->sc_clock_step_err_cnt = CLK4_TIMER_FREQUENCY % hz; - pxaost_sc->sc_clock_step_error = 0; - - /* Use the channels 0 and 1 for hardclock and statclock, respectively */ - pxaost_sc->sc_clock_count = pxaost_sc->sc_clock_step; - pxaost_sc->sc_statclock_count = CLK4_TIMER_FREQUENCY / stathz; - - pxa2x0_intr_establish(PXA2X0_INT_OST, IPL_CLOCK, doclockintr, 0, "clock"); - - clk = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSCR4); - - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_SR, 0x3f); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, SAOST_IR, 0x30); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR4, - clk + pxaost_sc->sc_clock_count); - bus_space_write_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, OST_OSMR5, - clk + pxaost_sc->sc_statclock_count); - - tc_init(&pxaost_timecounter); -} - -void -delay(usecs) - u_int usecs; -{ - u_int32_t clock, oclock, delta, delaycnt; - volatile int j; - int csec, usec; - - if (usecs > (0x80000000 / (CLK4_TIMER_FREQUENCY))) { - csec = usecs / 10000; - usec = usecs % 10000; - - delaycnt = (CLK4_TIMER_FREQUENCY / 100) * csec + - (CLK4_TIMER_FREQUENCY / 100) * usec / 10000; - } else { - delaycnt = CLK4_TIMER_FREQUENCY * usecs / 1000000; - } - - if (delaycnt <= 1) - for (j = 100; j > 0; j--) - ; - - if (!pxaost_sc) { - /* clock isn't initialized yet */ - for (; usecs > 0; usecs--) - for (j = 100; j > 0; j--) - ; - return; - } - - oclock = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSCR4); - - while (1) { - for (j = 100; j > 0; j--) - ; - clock = bus_space_read_4(pxaost_sc->sc_iot, pxaost_sc->sc_ioh, - OST_OSCR4); - delta = clock - oclock; - if (delta > delaycnt) - break; - } -} diff --git a/sys/arch/arm/xscale/pxa2x0_com.c b/sys/arch/arm/xscale/pxa2x0_com.c deleted file mode 100644 index 64a65bd880d..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_com.c +++ /dev/null @@ -1,181 +0,0 @@ -/* $OpenBSD: pxa2x0_com.c,v 1.12 2010/09/07 16:21:35 deraadt Exp $ */ -/* $NetBSD: pxa2x0_com.c,v 1.4 2003/07/15 00:24:55 lukem Exp $ */ - -/* - * Copyright 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Steve C. Woodford for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef COM_PXA2X0 -#error "You must use options COM_PXA2X0 to get PXA2x0 serial port support" -#endif - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/tty.h> - -#include <machine/intr.h> -#include <machine/bus.h> - -#include <dev/ic/comreg.h> -#include <dev/ic/comvar.h> - -#define com_isr 8 -#define ISR_RECV (ISR_RXPL | ISR_XMODE | ISR_RCVEIR) - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> - -#ifdef __zaurus__ -#include <zaurus/dev/zaurus_scoopvar.h> -#endif - -int pxauart_match(struct device *, void *, void *); -void pxauart_attach(struct device *, struct device *, void *); -int pxauart_activate(struct device *, int); - -struct cfattach com_pxaip_ca = { - sizeof (struct com_softc), pxauart_match, pxauart_attach, NULL, - pxauart_activate -}; - -int -pxauart_match(struct device *parent, void *cf, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - bus_space_tag_t bt = &pxa2x0_a4x_bs_tag; /* XXX: This sucks */ - bus_space_handle_t bh; - int rv; - - switch (pxa->pxa_addr) { - case PXA2X0_FFUART_BASE: - if (pxa->pxa_intr != PXA2X0_INT_FFUART) - return (0); - break; - - case PXA2X0_STUART_BASE: - if (pxa->pxa_intr != PXA2X0_INT_STUART) - return (0); - break; - - case PXA2X0_BTUART_BASE: /* XXX: Config file option ... */ - if (pxa->pxa_intr != PXA2X0_INT_BTUART) - return (0); - break; - - default: - return (0); - } - - pxa->pxa_size = 0x20; - - { - extern bus_addr_t comconsaddr; - - if (comconsaddr == pxa->pxa_addr) - return (1); - } - - if (bus_space_map(bt, pxa->pxa_addr, pxa->pxa_size, 0, &bh)) - return (0); - - /* Make sure the UART is enabled */ - bus_space_write_1(bt, bh, com_ier, IER_EUART); - - rv = comprobe1(bt, bh); - bus_space_unmap(bt, bh, pxa->pxa_size); - - return (rv); -} - -void -pxauart_attach(struct device *parent, struct device *self, void *aux) -{ - struct com_softc *sc = (struct com_softc *)self; - struct pxaip_attach_args *pxa = aux; - - sc->sc_iot = &pxa2x0_a4x_bs_tag; /* XXX: This sucks */ - sc->sc_iobase = pxa->pxa_addr; - sc->sc_frequency = PXA2X0_COM_FREQ; - sc->sc_uarttype = COM_UART_PXA2X0; - -#if 0 - if (com_is_console(sc->sc_iot, sc->sc_iobase, &sc->sc_ioh) == 0 && - bus_space_map(sc->sc_iot, sc->sc_iobase, pxa->pxa_size, 0, - &sc->sc_ioh)) { - printf(": can't map registers\n"); - return; - } -#endif - bus_space_map(sc->sc_iot, sc->sc_iobase, pxa->pxa_size, 0, &sc->sc_ioh); - - com_attach_subr(sc); - - (void)pxa2x0_intr_establish(pxa->pxa_intr, IPL_TTY, comintr, - sc, sc->sc_dev.dv_xname); -} - -int -pxauart_activate(struct device *self, int act) -{ - struct com_softc *sc = (struct com_softc *)self; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - struct tty *tp = sc->sc_tty; - - switch (act) { - case DVACT_SUSPEND: -#ifdef __zaurus__ - if (sc->enabled && ISSET(sc->sc_hwflags, COM_HW_SIR)) - scoop_set_irled(0); -#endif - break; - case DVACT_RESUME: - if (sc->enabled) { - sc->sc_initialize = 1; - comparam(tp, &tp->t_termios); - bus_space_write_1(iot, ioh, com_ier, sc->sc_ier); - - if (ISSET(sc->sc_hwflags, COM_HW_SIR)) { -#ifdef __zaurus__ - scoop_set_irled(1); -#endif - bus_space_write_1(iot, ioh, com_isr, - ISR_RECV); - } - } - break; - } - return 0; -} diff --git a/sys/arch/arm/xscale/pxa2x0_dma.c b/sys/arch/arm/xscale/pxa2x0_dma.c deleted file mode 100644 index adc0a287d52..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_dma.c +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: pxa2x0_dma.c,v 1.4 2008/05/15 22:17:08 brad Exp $ */ -/* $NetBSD: pxa2x0_dma.c,v 1.3 2003/08/07 16:58:35 bsh Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * bus dma tag for PXA2[15]0 processor. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> - -#include <uvm/uvm_extern.h> - -#define _ARM32_BUS_DMA_PRIVATE -#include <machine/bus.h> - -struct arm32_bus_dma_tag pxa2x0_bus_dma_tag = { - 0, - 0, - NULL, - _bus_dmamap_create, - _bus_dmamap_destroy, - _bus_dmamap_load, - _bus_dmamap_load_mbuf, - _bus_dmamap_load_uio, - _bus_dmamap_load_raw, - _bus_dmamap_unload, - _bus_dmamap_sync, - _bus_dmamem_alloc, - _bus_dmamem_free, - _bus_dmamem_map, - _bus_dmamem_unmap, - _bus_dmamem_mmap, -}; - diff --git a/sys/arch/arm/xscale/pxa2x0_dmac.c b/sys/arch/arm/xscale/pxa2x0_dmac.c deleted file mode 100644 index 60bce8ac1ae..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_dmac.c +++ /dev/null @@ -1,315 +0,0 @@ -/* $OpenBSD: pxa2x0_dmac.c,v 1.4 2012/12/05 23:20:11 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * DMA Controller Handler for the Intel PXA2X0 processor. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/malloc.h> -#include <sys/evcount.h> -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> -#include <machine/intr.h> -#include <machine/lock.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_dmac.h> - -typedef void (*pxadmac_intrhandler)(void *); - -struct pxadmac_softc { - struct device sc_dev; - bus_space_tag_t sc_bust; - bus_space_handle_t sc_bush; - void *sc_ih; - int sc_nchan; - int sc_npri; - pxadmac_intrhandler sc_intrhandlers[DMAC_N_CHANNELS_PXA27X]; - void *sc_intrargs[DMAC_N_CHANNELS_PXA27X]; -}; - -int pxadmac_intr(void *); - -/* - * DMAC autoconf glue - */ -int pxadmac_match(struct device *, void *, void *); -void pxadmac_attach(struct device *, struct device *, void *); - -struct cfattach pxadmac_ca = { - sizeof(struct pxadmac_softc), pxadmac_match, pxadmac_attach -}; - -struct cfdriver pxadmac_cd = { - NULL, "pxadmac", DV_DULL -}; - -static struct pxadmac_softc *pxadmac_softc = NULL; - -int -pxadmac_match(struct device *parent, void *cf, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - - if (pxadmac_softc != NULL || pxa->pxa_addr != PXA2X0_DMAC_BASE) - return (0); - - return (1); -} - -void -pxadmac_attach(struct device *parent, struct device *self, void *args) -{ - struct pxadmac_softc *sc = (struct pxadmac_softc *)self; - struct pxaip_attach_args *pxa = args; - bus_size_t bus_size; - - sc->sc_bust = pxa->pxa_iot; - - printf(": DMA Controller\n"); - - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) { - sc->sc_nchan = DMAC_N_CHANNELS_PXA27X; - sc->sc_npri = DMAC_N_PRIORITIES_PXA27X; - bus_size = PXA27X_DMAC_SIZE; - } else { - sc->sc_nchan = DMAC_N_CHANNELS; - sc->sc_npri = DMAC_N_PRIORITIES; - bus_size = PXA2X0_DMAC_SIZE; - } - - if (bus_space_map(sc->sc_bust, pxa->pxa_addr, bus_size, 0, - &sc->sc_bush)) { - printf("%s: Can't map registers!\n", sc->sc_dev.dv_xname); - return; - } - - sc->sc_ih = pxa2x0_intr_establish(pxa->pxa_intr, IPL_BIO, - pxadmac_intr, sc, "pxadmac"); - if (sc->sc_ih == NULL) { - printf(": unable to establish interrupt\n"); - bus_space_unmap(sc->sc_bust, sc->sc_bush, bus_size); - return; - } - - pxadmac_softc = sc; -} - -/* Perform non-descriptor based DMA to a FIFO */ -int -pxa2x0_dma_to_fifo(int periph, int chan, bus_addr_t fifo_addr, int width, - int burstsize, bus_addr_t src_addr, int length, void (*intr)(void *), - void *intrarg) -{ - struct pxadmac_softc *sc = pxadmac_softc; - uint32_t cmd; - - if (periph < 0 || periph > 63 || periph == 23) { - printf("pxa2x0_dma_to_fifo: bogus peripheral %d", periph); - return EINVAL; - } - - if (chan < 0 || chan >= sc->sc_nchan) { - printf("pxa2x0_dma_to_fifo: bogus dma channel %d", chan); - return EINVAL; - } - - if (length < 0 || length > DCMD_LENGTH_MASK) { - printf("pxa2x0_dma_to_fifo: bogus length %d", length); - return EINVAL; - } - - cmd = (length & DCMD_LENGTH_MASK) | DCMD_INCSRCADDR | DCMD_FLOWTRG - | DCMD_ENDIRQEN; - - switch (width) { - case 1: - cmd |= DCMD_WIDTH_1; - break; - case 4: - cmd |= DCMD_WIDTH_4; - break; - default: - printf("pxa2x0_dma_to_fifo: bogus width %d", width); - return EINVAL; - } - - switch (burstsize) { - case 8: - cmd |= DCMD_SIZE_8; - break; - case 16: - cmd |= DCMD_SIZE_16; - break; - case 32: - cmd |= DCMD_SIZE_32; - break; - default: - printf("pxa2x0_dma_to_fifo: bogus burstsize %d", burstsize); - return EINVAL; - } - - /* XXX: abort anything already in progress, hopefully nothing. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCSR(chan), - DCSR_NODESCFETCH); - - /* Save handler for interrupt-on-completion. */ - sc->sc_intrhandlers[chan] = intr; - sc->sc_intrargs[chan] = intrarg; - - /* Map peripheral to channel for flow control setup. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DRCMR(periph), - chan | DRCMR_MAPVLD); - - /* Setup transfer addresses. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DDADR(chan), - DDADR_STOP); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DSADR(chan), - src_addr); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DTADR(chan), - fifo_addr); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCMD(chan), - cmd); - - /* Start the transfer. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCSR(chan), - DCSR_RUN | DCSR_NODESCFETCH); - - return 0; -} - -/* Perform non-descriptor based DMA from a FIFO */ -int -pxa2x0_dma_from_fifo(int periph, int chan, bus_addr_t fifo_addr, int width, - int burstsize, bus_addr_t trg_addr, int length, void (*intr)(void *), - void *intrarg) -{ - struct pxadmac_softc *sc = pxadmac_softc; - uint32_t cmd; - - if (periph < 0 || periph > 63 || periph == 23) { - printf("pxa2x0_dma_from_fifo: bogus peripheral %d", periph); - return EINVAL; - } - - if (chan < 0 || chan >= sc->sc_nchan) { - printf("pxa2x0_dma_from_fifo: bogus dma channel %d", chan); - return EINVAL; - } - - if (length < 0 || length > DCMD_LENGTH_MASK) { - printf("pxa2x0_dma_from_fifo: bogus length %d", length); - return EINVAL; - } - - cmd = (length & DCMD_LENGTH_MASK) | DCMD_INCTRGADDR | DCMD_FLOWSRC - | DCMD_ENDIRQEN; - - switch (width) { - case 1: - cmd |= DCMD_WIDTH_1; - break; - case 4: - cmd |= DCMD_WIDTH_4; - break; - default: - printf("pxa2x0_dma_from_fifo: bogus width %d", width); - return EINVAL; - } - - switch (burstsize) { - case 8: - cmd |= DCMD_SIZE_8; - break; - case 16: - cmd |= DCMD_SIZE_16; - break; - case 32: - cmd |= DCMD_SIZE_32; - break; - default: - printf("pxa2x0_dma_from_fifo: bogus burstsize %d", burstsize); - return EINVAL; - } - - /* XXX: abort anything already in progress, hopefully nothing. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCSR(chan), - DCSR_NODESCFETCH); - - /* Save handler for interrupt-on-completion. */ - sc->sc_intrhandlers[chan] = intr; - sc->sc_intrargs[chan] = intrarg; - - /* Map peripheral to channel for flow control setup. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DRCMR(periph), - chan | DRCMR_MAPVLD); - - /* Setup transfer addresses. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DDADR(chan), - DDADR_STOP); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DSADR(chan), - fifo_addr); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DTADR(chan), - trg_addr); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCMD(chan), - cmd); - - /* Start the transfer. */ - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCSR(chan), - DCSR_RUN | DCSR_NODESCFETCH); - - return 0; -} - -int -pxadmac_intr(void *v) -{ - struct pxadmac_softc *sc = v; - u_int32_t dint, dcsr; - int chan; - - /* Interrupt for us? */ - dint = bus_space_read_4(sc->sc_bust, sc->sc_bush, DMAC_DINT); - if (!dint) - return 0; - - /* Process individual channels and run handlers. */ - /* XXX: this does not respect priority order for channels. */ - for (chan = 0; dint != 0 && chan < 32; chan++) { - /* Don't ack channels that weren't ready at call time. */ - if ((dint & (1 << chan)) == 0) - continue; - dint &= ~(1 << chan); - - /* Acknowledge individual channel interrupt. */ - dcsr = bus_space_read_4(sc->sc_bust, sc->sc_bush, - DMAC_DCSR(chan)); - bus_space_write_4(sc->sc_bust, sc->sc_bush, DMAC_DCSR(chan), - dcsr & 0x7C80021F); - - /* Call the registered handler. */ - if (sc->sc_intrhandlers[chan]) - sc->sc_intrhandlers[chan](sc->sc_intrargs[chan]); - } - - return 1; -} diff --git a/sys/arch/arm/xscale/pxa2x0_dmac.h b/sys/arch/arm/xscale/pxa2x0_dmac.h deleted file mode 100644 index 840965896b1..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_dmac.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $OpenBSD: pxa2x0_dmac.h,v 1.2 2006/04/04 11:37:05 pascoe Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#ifndef _PXA2X0_DMAC_H -#define _PXA2X0_DMAC_H - -int pxa2x0_dma_to_fifo(int periph, int chan, bus_addr_t fifo_addr, int width, - int burstsize, bus_addr_t src_addr, int length, void (*intr)(void *), - void *intrarg); - -int pxa2x0_dma_from_fifo(int periph, int chan, bus_addr_t fifo_addr, int width, - int burstsize, bus_addr_t trg_addr, int length, void (*intr)(void *), - void *intrarg); - -#endif /* _PXA2X0_DMAC_H */ diff --git a/sys/arch/arm/xscale/pxa2x0_gpio.c b/sys/arch/arm/xscale/pxa2x0_gpio.c deleted file mode 100644 index 5c86d1425af..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_gpio.c +++ /dev/null @@ -1,776 +0,0 @@ -/* $OpenBSD: pxa2x0_gpio.c,v 1.25 2016/01/31 00:14:50 jsg Exp $ */ -/* $NetBSD: pxa2x0_gpio.c,v 1.2 2003/07/15 00:24:55 lukem Exp $ */ - -/* - * Copyright 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Steve C. Woodford for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/evcount.h> - -#include <machine/intr.h> -#include <machine/bus.h> - -#include <arm/cpufunc.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> - -struct gpio_irq_handler { - struct gpio_irq_handler *gh_next; - int (*gh_func)(void *); - void *gh_arg; - int gh_spl; - u_int gh_gpio; - int gh_level; - int gh_irq; - struct evcount gh_count; -}; - -struct pxagpio_softc { - struct device sc_dev; - bus_space_tag_t sc_bust; - bus_space_handle_t sc_bush; - void *sc_irqcookie[4]; - u_int32_t sc_mask[3]; -#ifdef PXAGPIO_HAS_GPION_INTRS - struct gpio_irq_handler *sc_handlers[GPIO_NPINS]; - int sc_minipl; - int sc_maxipl; -#else - struct gpio_irq_handler *sc_handlers[2]; -#endif - int npins; - int pxa27x_pins; -}; - -int pxagpio_match(struct device *, void *, void *); -void pxagpio_attach(struct device *, struct device *, void *); - -#ifdef __NetBSD__ -CFATTACH_DECL(pxagpio, sizeof(struct pxagpio_softc), - pxagpio_match, pxagpio_attach, NULL, NULL); -#else -struct cfattach pxagpio_ca = { - sizeof (struct pxagpio_softc), pxagpio_match, pxagpio_attach -}; - -struct cfdriver pxagpio_cd = { - NULL, "pxagpio", DV_DULL -}; - -#endif - -static struct pxagpio_softc *pxagpio_softc; -static vaddr_t pxagpio_regs; -#define GPIO_BOOTSTRAP_REG(reg) \ - (*((volatile u_int32_t *)(pxagpio_regs + (reg)))) - -void pxa2x0_gpio_set_intr_level(u_int, int); -int pxagpio_intr0(void *); -int pxagpio_intr1(void *); -#ifdef PXAGPIO_HAS_GPION_INTRS -int pxagpio_dispatch(struct pxagpio_softc *, int); -int pxagpio_intrN(void *); -int pxagpio_intrlow(void *); -void pxa2x0_gpio_intr_fixup(int minipl, int maxipl); -#endif -u_int32_t pxagpio_reg_read(struct pxagpio_softc *sc, int reg); -void pxagpio_reg_write(struct pxagpio_softc *sc, int reg, u_int32_t val); - -u_int32_t -pxagpio_reg_read(struct pxagpio_softc *sc, int reg) -{ - if (__predict_true(sc != NULL)) - return (bus_space_read_4(sc->sc_bust, sc->sc_bush, reg)); - else - if (pxagpio_regs) - return (GPIO_BOOTSTRAP_REG(reg)); - panic("pxagpio_reg_read: not bootstrapped"); -} - -void -pxagpio_reg_write(struct pxagpio_softc *sc, int reg, u_int32_t val) -{ - if (__predict_true(sc != NULL)) - bus_space_write_4(sc->sc_bust, sc->sc_bush, reg, val); - else - if (pxagpio_regs) - GPIO_BOOTSTRAP_REG(reg) = val; - else - panic("pxagpio_reg_write: not bootstrapped"); - return; -} - -int -pxagpio_match(struct device *parent, void *cf, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - - if (pxagpio_softc != NULL || pxa->pxa_addr != PXA2X0_GPIO_BASE) - return (0); - - pxa->pxa_size = PXA2X0_GPIO_SIZE; - - return (1); -} - -void -pxagpio_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxagpio_softc *sc = (struct pxagpio_softc *)self; - struct pxaip_attach_args *pxa = aux; - - sc->sc_bust = pxa->pxa_iot; - - printf(": GPIO Controller\n"); - - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) { - sc->npins = GPIO_NPINS; - sc->pxa27x_pins = 1; - } else { - sc->npins = GPIO_NPINS_25x; - sc->pxa27x_pins = 0; - } - - if (bus_space_map(sc->sc_bust, pxa->pxa_addr, pxa->pxa_size, 0, - &sc->sc_bush)) { - printf("%s: Can't map registers!\n", sc->sc_dev.dv_xname); - return; - } - - memset(sc->sc_handlers, 0, sizeof(sc->sc_handlers)); - - /* - * Disable all GPIO interrupts - */ - pxagpio_reg_write(sc, GPIO_GRER0, 0); - pxagpio_reg_write(sc, GPIO_GRER1, 0); - pxagpio_reg_write(sc, GPIO_GRER2, 0); - pxagpio_reg_write(sc, GPIO_GRER3, 0); - pxagpio_reg_write(sc, GPIO_GFER0, 0); - pxagpio_reg_write(sc, GPIO_GFER1, 0); - pxagpio_reg_write(sc, GPIO_GFER2, 0); - pxagpio_reg_write(sc, GPIO_GFER3, 0); - pxagpio_reg_write(sc, GPIO_GEDR0, ~0); - pxagpio_reg_write(sc, GPIO_GEDR1, ~0); - pxagpio_reg_write(sc, GPIO_GEDR2, ~0); - pxagpio_reg_write(sc, GPIO_GEDR3, ~0); - -#ifdef PXAGPIO_HAS_GPION_INTRS - sc->sc_minipl = IPL_NONE; - sc->sc_maxipl = IPL_NONE; -#endif - - sc->sc_irqcookie[0] = sc->sc_irqcookie[1] = NULL; - - pxagpio_softc = sc; -} - -void -pxa2x0_gpio_bootstrap(vaddr_t gpio_regs) -{ - - pxagpio_regs = gpio_regs; -} - -void * -pxa2x0_gpio_intr_establish(u_int gpio, int level, int spl, int (*func)(void *), - void *arg, const char *name) -{ - struct pxagpio_softc *sc = pxagpio_softc; - struct gpio_irq_handler *gh; - u_int32_t bit; - -#ifdef DEBUG -#ifdef PXAGPIO_HAS_GPION_INTRS - if (gpio >= sc->npins) - panic("pxa2x0_gpio_intr_establish: bad pin number: %d", gpio); -#else - if (gpio > 1) - panic("pxa2x0_gpio_intr_establish: bad pin number: %d", gpio); -#endif -#endif - - if (GPIO_FN_IS_OUT(pxa2x0_gpio_get_function(gpio)) != GPIO_IN) - panic("pxa2x0_gpio_intr_establish: Pin %d not GPIO_IN", gpio); - - gh = (struct gpio_irq_handler *)malloc(sizeof(struct gpio_irq_handler), - M_DEVBUF, M_NOWAIT); - - gh->gh_func = func; - gh->gh_arg = arg; - gh->gh_spl = spl; - gh->gh_gpio = gpio; - gh->gh_irq = gpio+32; - gh->gh_level = level; - evcount_attach(&gh->gh_count, name, &gh->gh_irq); - - gh->gh_next = sc->sc_handlers[gpio]; - sc->sc_handlers[gpio] = gh; - - if (gpio == 0) { - KDASSERT(sc->sc_irqcookie[0] == NULL); - sc->sc_irqcookie[0] = pxa2x0_intr_establish(PXA2X0_INT_GPIO0, - spl, pxagpio_intr0, sc, NULL); - KDASSERT(sc->sc_irqcookie[0]); - } else if (gpio == 1) { - KDASSERT(sc->sc_irqcookie[1] == NULL); - sc->sc_irqcookie[1] = pxa2x0_intr_establish(PXA2X0_INT_GPIO1, - spl, pxagpio_intr1, sc, NULL); - KDASSERT(sc->sc_irqcookie[1]); - } else { -#ifdef PXAGPIO_HAS_GPION_INTRS - int minipl, maxipl; - - if (sc->sc_maxipl == IPL_NONE || spl > sc->sc_maxipl) { - maxipl = spl; - } else { - maxipl = sc->sc_maxipl; - } - - - if (sc->sc_minipl == IPL_NONE || spl < sc->sc_minipl) { - minipl = spl; - } else { - minipl = sc->sc_minipl; - } - pxa2x0_gpio_intr_fixup(minipl, maxipl); -#endif - } - - bit = GPIO_BIT(gpio); - sc->sc_mask[GPIO_BANK(gpio)] |= bit; - - pxa2x0_gpio_set_intr_level(gpio, gh->gh_level); - - return (gh); -} - -void -pxa2x0_gpio_intr_disestablish(void *cookie) -{ - struct pxagpio_softc *sc = pxagpio_softc; - struct gpio_irq_handler *gh = cookie; - u_int32_t bit, reg; - - evcount_detach(&gh->gh_count); - - bit = GPIO_BIT(gh->gh_gpio); - - reg = pxagpio_reg_read(sc, GPIO_REG(GPIO_GFER0, gh->gh_gpio)); - reg &= ~bit; - pxagpio_reg_write(sc, GPIO_REG(GPIO_GFER0, gh->gh_gpio), reg); - reg = pxagpio_reg_read(sc, GPIO_REG(GPIO_GRER0, gh->gh_gpio)); - reg &= ~bit; - pxagpio_reg_write(sc, GPIO_REG(GPIO_GRER0, gh->gh_gpio), reg); - - pxagpio_reg_write(sc, GPIO_REG(GPIO_GEDR0, gh->gh_gpio), bit); - - sc->sc_mask[GPIO_BANK(gh->gh_gpio)] &= ~bit; - sc->sc_handlers[gh->gh_gpio] = NULL; - - if (gh->gh_gpio == 0) { - pxa2x0_intr_disestablish(sc->sc_irqcookie[0]); - sc->sc_irqcookie[0] = NULL; - } else if (gh->gh_gpio == 1) { - pxa2x0_intr_disestablish(sc->sc_irqcookie[1]); - sc->sc_irqcookie[1] = NULL; - } else { -#ifdef PXAGPIO_HAS_GPION_INTRS - int i, minipl, maxipl, ipl; - minipl = IPL_HIGH; - maxipl = IPL_NONE; - for (i = 2; i < sc->npins; i++) { - if (sc->sc_handlers[i] != NULL) { - ipl = sc->sc_handlers[i]->gh_spl; - if (minipl > ipl) - minipl = ipl; - - if (maxipl < ipl) - maxipl = ipl; - } - } - pxa2x0_gpio_intr_fixup(minipl, maxipl); -#endif /* PXAGPIO_HAS_GPION_INTRS */ - } - - free(gh, M_DEVBUF, 0); -} - -#ifdef PXAGPIO_HAS_GPION_INTRS -void -pxa2x0_gpio_intr_fixup(int minipl, int maxipl) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int save = disable_interrupts(PSR_I); - - if (maxipl == IPL_NONE && minipl == IPL_HIGH) { - /* no remaining interrupts */ - if (sc->sc_irqcookie[2]) - pxa2x0_intr_disestablish(sc->sc_irqcookie[2]); - sc->sc_irqcookie[2] = NULL; - if (sc->sc_irqcookie[3]) - pxa2x0_intr_disestablish(sc->sc_irqcookie[3]); - sc->sc_irqcookie[3] = NULL; - sc->sc_minipl = IPL_NONE; - sc->sc_maxipl = IPL_NONE; - restore_interrupts(save); - return; - } - - if (sc->sc_maxipl == IPL_NONE || maxipl > sc->sc_maxipl) { - if (sc->sc_irqcookie[2]) - pxa2x0_intr_disestablish(sc->sc_irqcookie[2]); - - sc->sc_maxipl = maxipl; - sc->sc_irqcookie[2] = - pxa2x0_intr_establish(PXA2X0_INT_GPION, - maxipl, pxagpio_intrN, sc, NULL); - - if (sc->sc_irqcookie[2] == NULL) { - printf("%s: failed to hook main " - "GPIO interrupt\n", - sc->sc_dev.dv_xname); - /* XXX - panic? */ - } - } - if (sc->sc_minipl == IPL_NONE || minipl < sc->sc_minipl) { - if (sc->sc_irqcookie[3]) - pxa2x0_intr_disestablish(sc->sc_irqcookie[3]); - - sc->sc_minipl = minipl; - sc->sc_irqcookie[3] = - pxa2x0_intr_establish(PXA2X0_INT_GPION, - sc->sc_minipl, pxagpio_intrlow, sc, NULL); - - if (sc->sc_irqcookie[3] == NULL) { - printf("%s: failed to hook main " - "GPIO interrupt\n", - sc->sc_dev.dv_xname); - /* XXX - panic? */ - } - } - restore_interrupts(save); -} -#endif /* PXAGPIO_HAS_GPION_INTRS */ - -const char * -pxa2x0_gpio_intr_string(void *cookie) -{ - static char irqstr[32]; - struct gpio_irq_handler *gh = cookie; - - if (gh == NULL) - snprintf(irqstr, sizeof irqstr, "couldn't establish interrupt"); - else - snprintf(irqstr, sizeof irqstr, "irq %d", gh->gh_irq); - return(irqstr); -} - - -int -pxagpio_intr0(void *arg) -{ - struct pxagpio_softc *sc = arg; - int ret; - -#ifdef DIAGNOSTIC - if (sc->sc_handlers[0] == NULL) { - printf("%s: stray GPIO#0 edge interrupt\n", - sc->sc_dev.dv_xname); - return (0); - } -#endif - - bus_space_write_4(sc->sc_bust, sc->sc_bush, GPIO_REG(GPIO_GEDR0, 0), - GPIO_BIT(0)); - - ret = (sc->sc_handlers[0]->gh_func)(sc->sc_handlers[0]->gh_arg); - if (ret != 0) - sc->sc_handlers[0]->gh_count.ec_count++; - return ret; -} - -int -pxagpio_intr1(void *arg) -{ - struct pxagpio_softc *sc = arg; - int ret; - -#ifdef DIAGNOSTIC - if (sc->sc_handlers[1] == NULL) { - printf("%s: stray GPIO#1 edge interrupt\n", - sc->sc_dev.dv_xname); - return (0); - } -#endif - - bus_space_write_4(sc->sc_bust, sc->sc_bush, GPIO_REG(GPIO_GEDR0, 1), - GPIO_BIT(1)); - - ret = (sc->sc_handlers[1]->gh_func)(sc->sc_handlers[1]->gh_arg); - if (ret != 0) - sc->sc_handlers[1]->gh_count.ec_count++; - return ret; -} - -#ifdef PXAGPIO_HAS_GPION_INTRS -int -pxagpio_dispatch(struct pxagpio_softc *sc, int gpio_base) -{ - struct gpio_irq_handler **ghp, *gh; - int i, s, nhandled, handled, pins; - u_int32_t gedr, mask; - int bank; - - /* Fetch bitmap of pending interrupts on this GPIO bank */ - gedr = pxagpio_reg_read(sc, GPIO_REG(GPIO_GEDR0, gpio_base)); - - /* Don't handle GPIO 0/1 here */ - if (gpio_base == 0) - gedr &= ~(GPIO_BIT(0) | GPIO_BIT(1)); - - /* Bail early if there are no pending interrupts in this bank */ - if (gedr == 0) - return (0); - - /* Acknowledge pending interrupts. */ - pxagpio_reg_write(sc, GPIO_REG(GPIO_GEDR0, gpio_base), gedr); - - bank = GPIO_BANK(gpio_base); - - /* - * We're only interested in those for which we have a handler - * registered - */ -#ifdef DEBUG - if ((gedr & sc->sc_mask[bank]) == 0) { - printf("%s: stray GPIO interrupt. Bank %d, GEDR 0x%08x, mask 0x%08x\n", - sc->sc_dev.dv_xname, bank, gedr, sc->sc_mask[bank]); - return (1); /* XXX: Pretend we dealt with it */ - } -#endif - - gedr &= sc->sc_mask[bank]; - ghp = &sc->sc_handlers[gpio_base]; - if (sc->pxa27x_pins == 1) - pins = (gpio_base < 96) ? 32 : 25; - else - pins = (gpio_base < 64) ? 32 : 17; - handled = 0; - - for (i = 0, mask = 1; i < pins && gedr; i++, ghp++, mask <<= 1) { - if ((gedr & mask) == 0) - continue; - gedr &= ~mask; - - if ((gh = *ghp) == NULL) { - printf("%s: unhandled GPIO interrupt. GPIO#%d\n", - sc->sc_dev.dv_xname, gpio_base + i); - continue; - } - - s = _splraise(gh->gh_spl); - do { - nhandled = (gh->gh_func)(gh->gh_arg); - if (nhandled != 0) - gh->gh_count.ec_count++; - handled |= nhandled; - gh = gh->gh_next; - } while (gh != NULL); - splx(s); - } - - return (handled); -} - -int -pxagpio_intrN(void *arg) -{ - struct pxagpio_softc *sc = arg; - int handled; - - handled = pxagpio_dispatch(sc, 0); - handled |= pxagpio_dispatch(sc, 32); - handled |= pxagpio_dispatch(sc, 64); - handled |= pxagpio_dispatch(sc, 96); - - return (handled); -} - -int -pxagpio_intrlow(void *arg) -{ - /* dummy */ - return 0; -} -#endif /* PXAGPIO_HAS_GPION_INTRS */ - -u_int -pxa2x0_gpio_get_function(u_int gpio) -{ - struct pxagpio_softc *sc = pxagpio_softc; - u_int32_t rv, io; - - if (__predict_true(sc != NULL)) - KDASSERT(gpio < sc->npins); - - rv = pxagpio_reg_read(sc, GPIO_FN_REG(gpio)) >> GPIO_FN_SHIFT(gpio); - rv = GPIO_FN(rv); - - io = pxagpio_reg_read(sc, GPIO_REG(GPIO_GPDR0, gpio)); - if (io & GPIO_BIT(gpio)) - rv |= GPIO_OUT; - - io = pxagpio_reg_read(sc, GPIO_REG(GPIO_GPLR0, gpio)); - if (io & GPIO_BIT(gpio)) - rv |= GPIO_SET; - - return (rv); -} - -u_int -pxa2x0_gpio_set_function(u_int gpio, u_int fn) -{ - struct pxagpio_softc *sc = pxagpio_softc; - u_int32_t rv, bit; - u_int oldfn; - - if (__predict_true(sc != NULL)) - KDASSERT(gpio < sc->npins); - - oldfn = pxa2x0_gpio_get_function(gpio); - - if (GPIO_FN(fn) == GPIO_FN(oldfn) && - GPIO_FN_IS_OUT(fn) == GPIO_FN_IS_OUT(oldfn)) { - /* - * The pin's function is not changing. - * For Alternate Functions and GPIO input, we can just - * return now. - * For GPIO output pins, check the initial state is - * the same. - * - * Return 'fn' instead of 'oldfn' so the caller can - * reliably detect that we didn't change anything. - * (The initial state might be different for non- - * GPIO output pins). - */ - if (!GPIO_IS_GPIO_OUT(fn) || - GPIO_FN_IS_SET(fn) == GPIO_FN_IS_SET(oldfn)) - return (fn); - } - - /* - * See section 4.1.3.7 of the PXA2x0 Developer's Manual for - * the correct procedure for changing GPIO pin functions. - */ - - bit = GPIO_BIT(gpio); - - /* - * 1. Configure the correct set/clear state of the pin - */ - if (GPIO_FN_IS_SET(fn)) - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPSR0, gpio), bit); - else - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPCR0, gpio), bit); - - /* - * 2. Configure the pin as an input or output as appropriate - */ - rv = pxagpio_reg_read(sc, GPIO_REG(GPIO_GPDR0, gpio)) & ~bit; - if (GPIO_FN_IS_OUT(fn)) - rv |= bit; - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPDR0, gpio), rv); - - /* - * 3. Configure the pin's function - */ - bit = GPIO_FN_MASK << GPIO_FN_SHIFT(gpio); - fn = GPIO_FN(fn) << GPIO_FN_SHIFT(gpio); - rv = pxagpio_reg_read(sc, GPIO_FN_REG(gpio)) & ~bit; - pxagpio_reg_write(sc, GPIO_FN_REG(gpio), rv | fn); - - return (oldfn); -} - -/* - * Quick function to read pin value - */ -int -pxa2x0_gpio_get_bit(u_int gpio) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int bit; - - bit = GPIO_BIT(gpio); - if (pxagpio_reg_read(sc, GPIO_REG(GPIO_GPLR0, gpio)) & bit) - return 1; - else - return 0; -} - -/* - * Quick function to set pin to 1 - */ -void -pxa2x0_gpio_set_bit(u_int gpio) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int bit; - - bit = GPIO_BIT(gpio); - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPSR0, gpio), bit); -} - -/* - * Quick function to set pin to 0 - */ -void -pxa2x0_gpio_clear_bit(u_int gpio) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int bit; - - bit = GPIO_BIT(gpio); - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPCR0, gpio), bit); -} - -/* - * Quick function to change pin direction - */ -void -pxa2x0_gpio_set_dir(u_int gpio, int dir) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int bit; - u_int32_t reg; - - bit = GPIO_BIT(gpio); - - reg = pxagpio_reg_read(sc, GPIO_REG(GPIO_GPDR0, gpio)) & ~bit; - if (GPIO_FN_IS_OUT(dir)) - reg |= bit; - pxagpio_reg_write(sc, GPIO_REG(GPIO_GPDR0, gpio), reg); -} - -/* - * Quick function to clear interrupt status on a pin - * GPIO pins may be toggle in an interrupt and we dont want - * extra spurious interrupts to occur. - * Suppose this causes a slight race if a key is pressed while - * the interrupt handler is running. (yes this is for the keyboard driver) - */ -void -pxa2x0_gpio_clear_intr(u_int gpio) -{ - struct pxagpio_softc *sc = pxagpio_softc; - int bit; - - bit = GPIO_BIT(gpio); - pxagpio_reg_write(sc, GPIO_REG(GPIO_GEDR0, gpio), bit); -} - -/* - * Quick function to mask (disable) a GPIO interrupt - */ -void -pxa2x0_gpio_intr_mask(void *v) -{ - struct gpio_irq_handler *gh = v; - - pxa2x0_gpio_set_intr_level(gh->gh_gpio, IPL_NONE); -} - -/* - * Quick function to unmask (enable) a GPIO interrupt - */ -void -pxa2x0_gpio_intr_unmask(void *v) -{ - struct gpio_irq_handler *gh = v; - - pxa2x0_gpio_set_intr_level(gh->gh_gpio, gh->gh_level); -} - -/* - * Configure the edge sensitivity of interrupt pins - */ -void -pxa2x0_gpio_set_intr_level(u_int gpio, int level) -{ - struct pxagpio_softc *sc = pxagpio_softc; - u_int32_t bit; - u_int32_t gfer; - u_int32_t grer; - int s; - - s = splhigh(); - - bit = GPIO_BIT(gpio); - gfer = pxagpio_reg_read(sc, GPIO_REG(GPIO_GFER0, gpio)); - grer = pxagpio_reg_read(sc, GPIO_REG(GPIO_GRER0, gpio)); - - switch (level) { - case IST_NONE: - gfer &= ~bit; - grer &= ~bit; - break; - case IST_EDGE_FALLING: - gfer |= bit; - grer &= ~bit; - break; - case IST_EDGE_RISING: - gfer &= ~bit; - grer |= bit; - break; - case IST_EDGE_BOTH: - gfer |= bit; - grer |= bit; - break; - default: - panic("pxa2x0_gpio_set_intr_level: bad level: %d", level); - break; - } - - pxagpio_reg_write(sc, GPIO_REG(GPIO_GFER0, gpio), gfer); - pxagpio_reg_write(sc, GPIO_REG(GPIO_GRER0, gpio), grer); - - splx(s); -} diff --git a/sys/arch/arm/xscale/pxa2x0_gpio.h b/sys/arch/arm/xscale/pxa2x0_gpio.h deleted file mode 100644 index bab08809bb4..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_gpio.h +++ /dev/null @@ -1,71 +0,0 @@ -/* $OpenBSD: pxa2x0_gpio.h,v 1.6 2009/08/22 02:54:50 mk Exp $ */ -/* $wasabi$ */ - -/* - * Copyright 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Steve C. Woodford for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _PXA2X0_GPIO_H -#define _PXA2X0_GPIO_H - -/* - * If you want to fiddle with GPIO registers before the - * driver has been autoconfigured (e.g. from initarm()), - * call this function with the virtual address of the - * GPIO controller's registers - */ -void pxa2x0_gpio_bootstrap(vaddr_t); - -/* - * GPIO pin function query/manipulation functions - */ -u_int pxa2x0_gpio_get_function(u_int); -u_int pxa2x0_gpio_set_function(u_int, u_int); -int pxa2x0_gpio_get_bit(u_int gpio); -void pxa2x0_gpio_set_bit(u_int gpio); -void pxa2x0_gpio_clear_bit(u_int gpio); -void pxa2x0_gpio_set_dir(u_int gpio, int dir); -void pxa2x0_gpio_clear_intr(u_int gpio); - -/* - * Establish/Disestablish interrupt handlers for GPIO pins - */ -void *pxa2x0_gpio_intr_establish(u_int, int, int, int (*)(void *), void *, - const char *); -void pxa2x0_gpio_intr_disestablish(void *); -const char *pxa2x0_gpio_intr_string(void *); -void pxa2x0_gpio_intr_mask(void *); -void pxa2x0_gpio_intr_unmask(void *); - -#endif /* _PXA2X0_GPIO_H */ diff --git a/sys/arch/arm/xscale/pxa2x0_i2c.c b/sys/arch/arm/xscale/pxa2x0_i2c.c deleted file mode 100644 index 014cc9c82bb..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_i2c.c +++ /dev/null @@ -1,322 +0,0 @@ -/* $OpenBSD: pxa2x0_i2c.c,v 1.2 2005/05/26 03:52:07 pascoe Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_i2c.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#define I2C_RETRY_COUNT 10 - -int -pxa2x0_i2c_attach_sub(struct pxa2x0_i2c_softc *sc) -{ - if (bus_space_map(sc->sc_iot, PXA2X0_I2C_BASE, - PXA2X0_I2C_SIZE, 0, &sc->sc_ioh)) { - sc->sc_size = 0; - return EIO; - } - bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, sc->sc_size, - BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE); - - /* - * Configure the alternate functions. The _IN is arbitrary, as the - * direction is managed by the I2C unit when comms are in progress. - */ - pxa2x0_gpio_set_function(117, GPIO_ALT_FN_1_IN); /* SCL */ - pxa2x0_gpio_set_function(118, GPIO_ALT_FN_1_IN); /* SDA */ - - pxa2x0_i2c_init(sc); - - return 0; -} - -int -pxa2x0_i2c_detach_sub(struct pxa2x0_i2c_softc *sc) -{ - if (sc->sc_size) { - bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_size = 0; - } - pxa2x0_clkman_config(CKEN_I2C, 0); - - return 0; -} - -void -pxa2x0_i2c_init(struct pxa2x0_i2c_softc *sc) -{ - pxa2x0_i2c_open(sc); - pxa2x0_i2c_close(sc); -} - -void -pxa2x0_i2c_open(struct pxa2x0_i2c_softc *sc) -{ - /* Enable the clock to the standard I2C unit. */ - pxa2x0_clkman_config(CKEN_I2C, 1); -} - -void -pxa2x0_i2c_close(struct pxa2x0_i2c_softc *sc) -{ - /* Reset and disable the standard I2C unit. */ - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2C_ICR, ICR_UR); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2C_ISAR, 0); - delay(1); - pxa2x0_clkman_config(CKEN_I2C, 0); -} - -int -pxa2x0_i2c_read(struct pxa2x0_i2c_softc *sc, u_char slave, u_char *valuep) -{ - u_int32_t rv; - int timeout; - int tries = I2C_RETRY_COUNT; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - -retry: - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF); - delay(1); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - /* Write slave device address. */ - bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1) | 0x1); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START); - - /* Read data value. */ - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | - (ICR_STOP | ICR_ACKNAK)); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_IRF) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_IRF); - - rv = bus_space_read_4(iot, ioh, I2C_IDBR); - *valuep = (u_char)rv; - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & - ~(ICR_STOP | ICR_ACKNAK)); - - return (0); -err: - if (tries-- >= 0) - goto retry; - - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - return (-EIO); -} - -int -pxa2x0_i2c_write(struct pxa2x0_i2c_softc *sc, u_char slave, u_char value) -{ - u_int32_t rv; - int timeout; - int tries = I2C_RETRY_COUNT; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - -retry: - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - delay(1); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - /* Write slave device address. */ - bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1)); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0) - goto err; - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - /* Write data. */ - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP); - bus_space_write_4(iot, ioh, I2C_IDBR, value); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0) - goto err; - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - - return (0); -err: - if (tries-- >= 0) - goto retry; - - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - return (-EIO); -} - -int -pxa2x0_i2c_write_2(struct pxa2x0_i2c_softc *sc, u_char slave, u_short value) -{ - u_int32_t rv; - int timeout; - int tries = I2C_RETRY_COUNT; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - -retry: - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - delay(1); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - /* Write slave device address. */ - bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1)); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0) - goto err; - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - /* Write upper 8 bits of data. */ - bus_space_write_4(iot, ioh, I2C_IDBR, (value >> 8) & 0xff); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0) - goto err; - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - /* Write lower 8 bits of data. */ - bus_space_write_4(iot, ioh, I2C_IDBR, value & 0xff); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP); - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB); - - timeout = 10000; - while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) { - if (timeout-- == 0) - goto err; - delay(1); - } - if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0) - goto err; - - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - - rv = bus_space_read_4(iot, ioh, I2C_ICR); - bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP); - - return (0); -err: - if (tries-- >= 0) - goto retry; - - bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR); - bus_space_write_4(iot, ioh, I2C_ISAR, 0x00); - bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE); - bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE); - - return (-EIO); -} diff --git a/sys/arch/arm/xscale/pxa2x0_i2c.h b/sys/arch/arm/xscale/pxa2x0_i2c.h deleted file mode 100644 index fb5c9144515..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_i2c.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $OpenBSD: pxa2x0_i2c.h,v 1.2 2005/05/26 03:52:07 pascoe Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#ifndef _PXA2X0_I2C_H_ -#define _PXA2X0_I2C_H_ - -#include <machine/bus.h> - -struct pxa2x0_i2c_softc { - struct device sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - bus_size_t sc_size; -}; - -int pxa2x0_i2c_attach_sub(struct pxa2x0_i2c_softc *); -int pxa2x0_i2c_detach_sub(struct pxa2x0_i2c_softc *); -void pxa2x0_i2c_init(struct pxa2x0_i2c_softc *); -void pxa2x0_i2c_open(struct pxa2x0_i2c_softc *); -void pxa2x0_i2c_close(struct pxa2x0_i2c_softc *); -int pxa2x0_i2c_read(struct pxa2x0_i2c_softc *sc, u_char, u_char *); -int pxa2x0_i2c_write(struct pxa2x0_i2c_softc *, u_char, u_char); -int pxa2x0_i2c_write_2(struct pxa2x0_i2c_softc *, u_char, u_short); - -#endif diff --git a/sys/arch/arm/xscale/pxa2x0_i2s.c b/sys/arch/arm/xscale/pxa2x0_i2s.c deleted file mode 100644 index ccefc84081b..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_i2s.c +++ /dev/null @@ -1,346 +0,0 @@ -/* $OpenBSD: pxa2x0_i2s.c,v 1.8 2014/07/12 18:44:41 tedu Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/malloc.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> -#include <arm/xscale/pxa2x0_i2s.h> -#include <arm/xscale/pxa2x0_dmac.h> - -struct pxa2x0_i2s_dma { - struct pxa2x0_i2s_dma *next; - caddr_t addr; - size_t size; - bus_dmamap_t map; - bus_dma_segment_t seg; -}; - -void -pxa2x0_i2s_init(struct pxa2x0_i2s_softc *sc) -{ - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SACR0, SACR0_RST); - delay(100); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SACR0, - SACR0_BCKD | SACR0_SET_TFTH(7) | SACR0_SET_RFTH(7)); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SACR1, 0); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SADR, 0); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SADIV, sc->sc_sadiv); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SACR0, - SACR0_BCKD | SACR0_SET_TFTH(7) | SACR0_SET_RFTH(7) | SACR0_ENB); -} - -int -pxa2x0_i2s_attach_sub(struct pxa2x0_i2s_softc *sc) -{ - if (bus_space_map(sc->sc_iot, PXA2X0_I2S_BASE, PXA2X0_I2S_SIZE, 0, - &sc->sc_ioh)) { - sc->sc_size = 0; - return 1; - } - sc->sc_sadiv = SADIV_3_058MHz; - - bus_space_barrier(sc->sc_iot, sc->sc_ioh, 0, sc->sc_size, - BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE); - - pxa2x0_gpio_set_function(28, GPIO_ALT_FN_1_OUT); /* I2S_BITCLK */ - pxa2x0_gpio_set_function(113, GPIO_ALT_FN_1_OUT); /* I2S_SYSCLK */ - pxa2x0_gpio_set_function(31, GPIO_ALT_FN_1_OUT); /* I2S_SYNC */ - pxa2x0_gpio_set_function(30, GPIO_ALT_FN_1_OUT); /* I2S_SDATA_OUT */ - pxa2x0_gpio_set_function(29, GPIO_ALT_FN_2_IN); /* I2S_SDATA_IN */ - - pxa2x0_i2s_init(sc); - - return 0; -} - -void pxa2x0_i2s_open(struct pxa2x0_i2s_softc *sc) -{ - sc->sc_open++; - pxa2x0_clkman_config(CKEN_I2S, 1); -} - -void pxa2x0_i2s_close(struct pxa2x0_i2s_softc *sc) -{ - pxa2x0_clkman_config(CKEN_I2S, 0); - sc->sc_open--; -} - -int -pxa2x0_i2s_detach_sub(struct pxa2x0_i2s_softc *sc) -{ - if (sc->sc_size > 0) { - bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size); - sc->sc_size = 0; - } - pxa2x0_clkman_config(CKEN_I2S, 0); - - return (0); -} - -void pxa2x0_i2s_write(struct pxa2x0_i2s_softc *sc, u_int32_t data) -{ - if (! sc->sc_open) - return; - - /* Clear intr and underrun bit if set. */ - if (bus_space_read_4(sc->sc_iot, sc->sc_ioh, I2S_SASR0) & SASR0_TUR) - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SAICR, SAICR_TUR); - - /* Wait for transmit fifo to have space. */ - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, I2S_SASR0) & SASR0_TNF) - == 0) - ; /* nothing */ - - /* Queue data */ - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SADR, data); -} - -void -pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *sc, u_long *argp) -{ - /* - * The available speeds are in the following table. - * Keep the speeds in increasing order. - */ - typedef struct { - int speed; - int div; - } speed_struct; - u_long arg = *argp; - - static speed_struct speed_table[] = { - {8000, SADIV_513_25kHz}, - {11025, SADIV_702_75kHz}, - {16000, SADIV_1_026MHz}, - {22050, SADIV_1_405MHz}, - {44100, SADIV_2_836MHz}, - {48000, SADIV_3_058MHz}, - }; - - int i, n, selected = -1; - - n = sizeof(speed_table) / sizeof(speed_struct); - - if (arg < speed_table[0].speed) - selected = 0; - if (arg > speed_table[n - 1].speed) - selected = n - 1; - - for (i = 1; selected == -1 && i < n; i++) { - if (speed_table[i].speed == arg) - selected = i; - else if (speed_table[i].speed > arg) { - int diff1, diff2; - - diff1 = arg - speed_table[i - 1].speed; - diff2 = speed_table[i].speed - arg; - if (diff1 < diff2) - selected = i - 1; - else - selected = i; - } - } - - if (selected == -1) - selected = 0; - - *argp = speed_table[selected].speed; - - sc->sc_sadiv = speed_table[selected].div; - bus_space_write_4(sc->sc_iot, sc->sc_ioh, I2S_SADIV, sc->sc_sadiv); -} - -void * -pxa2x0_i2s_allocm(void *hdl, int direction, size_t size, int type, int flags) -{ - struct device *sc_dev = hdl; - struct pxa2x0_i2s_softc *sc = - (struct pxa2x0_i2s_softc *)((struct device *)hdl + 1); - struct pxa2x0_i2s_dma *p; - int error; - int rseg; - - p = malloc(sizeof(*p), type, flags); - if (!p) - return 0; - - p->size = size; - if ((error = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0, &p->seg, 1, - &rseg, BUS_DMA_NOWAIT)) != 0) { - printf("%s: unable to allocate dma, error = %d\n", - sc_dev->dv_xname, error); - goto fail_alloc; - } - - if ((error = bus_dmamem_map(sc->sc_dmat, &p->seg, rseg, size, &p->addr, - BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0) { - printf("%s: unable to map dma, error = %d\n", - sc_dev->dv_xname, error); - goto fail_map; - } - - if ((error = bus_dmamap_create(sc->sc_dmat, size, 1, size, 0, - BUS_DMA_NOWAIT, &p->map)) != 0) { - printf("%s: unable to create dma map, error = %d\n", - sc_dev->dv_xname, error); - goto fail_create; - } - - if ((error = bus_dmamap_load(sc->sc_dmat, p->map, p->addr, size, NULL, - BUS_DMA_NOWAIT)) != 0) { - printf("%s: unable to load dma map, error = %d\n", - sc_dev->dv_xname, error); - goto fail_load; - } - - p->next = sc->sc_dmas; - sc->sc_dmas = p; - - return p->addr; - -fail_load: - bus_dmamap_destroy(sc->sc_dmat, p->map); -fail_create: - bus_dmamem_unmap(sc->sc_dmat, p->addr, size); -fail_map: - bus_dmamem_free(sc->sc_dmat, &p->seg, 1); -fail_alloc: - free(p, type, 0); - return 0; -} - -void -pxa2x0_i2s_freem(void *hdl, void *ptr, int type) -{ - struct pxa2x0_i2s_softc *sc = - (struct pxa2x0_i2s_softc *)((struct device *)hdl + 1); - struct pxa2x0_i2s_dma **pp, *p; - - for (pp = &(sc->sc_dmas); (p = *pp) != NULL; pp = &p->next) - if (p->addr == ptr) { - bus_dmamap_unload(sc->sc_dmat, p->map); - bus_dmamap_destroy(sc->sc_dmat, p->map); - bus_dmamem_unmap(sc->sc_dmat, p->addr, p->size); - bus_dmamem_free(sc->sc_dmat, &p->seg, 1); - - *pp = p->next; - free(p, type, 0); - return; - } - - panic("pxa2x0_i2s_freem: trying to free unallocated memory"); -} - -paddr_t -pxa2x0_i2s_mappage(void *hdl, void *mem, off_t off, int prot) -{ - struct pxa2x0_i2s_softc *sc = - (struct pxa2x0_i2s_softc *)((struct device *)hdl + 1); - struct pxa2x0_i2s_dma *p; - - if (off < 0) - return -1; - - for (p = sc->sc_dmas; p && p->addr != mem; p = p->next) - ; - if (!p) - return -1; - - if (off > p->size) - return -1; - - return bus_dmamem_mmap(sc->sc_dmat, &p->seg, 1, off, prot, - BUS_DMA_WAITOK); -} - -int -pxa2x0_i2s_round_blocksize(void *hdl, int bs) -{ - /* Enforce individual DMA block size limit */ - if (bs > DCMD_LENGTH_MASK) - return (DCMD_LENGTH_MASK & ~0x03); - - return (bs + 0x03) & ~0x03; /* 32-bit multiples */ -} - -size_t -pxa2x0_i2s_round_buffersize(void *hdl, int direction, size_t bufsize) -{ - return bufsize; -} - -int -pxa2x0_i2s_start_output(struct pxa2x0_i2s_softc *sc, void *block, int bsize, - void (*intr)(void *), void *intrarg) -{ - struct pxa2x0_i2s_dma *p; - int offset; - - /* Find mapping which contains block completely */ - for (p = sc->sc_dmas; p && (((caddr_t)block < p->addr) || - ((caddr_t)block + bsize > p->addr + p->size)); p = p->next) - ; /* Nothing */ - - if (!p) { - printf("pxa2x0_i2s_start_output: request with bad start " - "address: %p, size: %d)\n", block, bsize); - return ENXIO; - } - - /* Offset into block to use in mapped block */ - offset = (caddr_t)block - p->addr; - - /* Start DMA */ - pxa2x0_dma_to_fifo(3, 1, 0x40400080, 4, 32, - p->map->dm_segs[0].ds_addr + offset, bsize, intr, intrarg); - - return 0; -} - -int -pxa2x0_i2s_start_input(struct pxa2x0_i2s_softc *sc, void *block, int bsize, - void (*intr)(void *), void *intrarg) -{ - struct pxa2x0_i2s_dma *p; - int offset; - - /* Find mapping which contains block completely */ - for (p = sc->sc_dmas; p && (((caddr_t)block < p->addr) || - ((caddr_t)block + bsize > p->addr + p->size)); p = p->next) - ; /* Nothing */ - - if (!p) { - printf("pxa2x0_i2s_start_input: request with bad start " - "address: %p, size: %d)\n", block, bsize); - return ENXIO; - } - - /* Offset into block to use in mapped block */ - offset = (caddr_t)block - p->addr; - - /* Start DMA */ - pxa2x0_dma_from_fifo(2, 2, 0x40400080, 4, 32, - p->map->dm_segs[0].ds_addr + offset, bsize, intr, intrarg); - - return 0; -} diff --git a/sys/arch/arm/xscale/pxa2x0_i2s.h b/sys/arch/arm/xscale/pxa2x0_i2s.h deleted file mode 100644 index 09aed24746d..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_i2s.h +++ /dev/null @@ -1,58 +0,0 @@ -/* $OpenBSD: pxa2x0_i2s.h,v 1.3 2006/04/04 11:45:40 pascoe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#ifndef _PXA2X0_I2S_H_ -#define _PXA2X0_I2S_H_ - -#include <machine/bus.h> - -struct pxa2x0_i2s_dma; - -struct pxa2x0_i2s_softc { - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - bus_size_t sc_size; - bus_dma_tag_t sc_dmat; - - int sc_open; - u_int32_t sc_sadiv; - - struct pxa2x0_i2s_dma *sc_dmas; -}; - -void pxa2x0_i2s_init(struct pxa2x0_i2s_softc *sc); -int pxa2x0_i2s_attach_sub(struct pxa2x0_i2s_softc *); -int pxa2x0_i2s_detach_sub(struct pxa2x0_i2s_softc *); -void pxa2x0_i2s_open(struct pxa2x0_i2s_softc *); -void pxa2x0_i2s_close(struct pxa2x0_i2s_softc *); -void pxa2x0_i2s_write(struct pxa2x0_i2s_softc *, u_int32_t); - -void pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *, u_long *); - -void * pxa2x0_i2s_allocm(void *, int, size_t, int, int); -void pxa2x0_i2s_freem(void *, void *, int); -paddr_t pxa2x0_i2s_mappage(void *, void *, off_t, int); -int pxa2x0_i2s_round_blocksize(void *, int); -size_t pxa2x0_i2s_round_buffersize(void *, int, size_t); - -int pxa2x0_i2s_start_output(struct pxa2x0_i2s_softc *, void *, int, - void (*)(void *), void *); -int pxa2x0_i2s_start_input(struct pxa2x0_i2s_softc *, void *, int, - void (*)(void *), void *); - -#endif diff --git a/sys/arch/arm/xscale/pxa2x0_intr.c b/sys/arch/arm/xscale/pxa2x0_intr.c deleted file mode 100644 index 9c959b19c04..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_intr.c +++ /dev/null @@ -1,711 +0,0 @@ -/* $OpenBSD: pxa2x0_intr.c,v 1.28 2016/04/03 10:29:41 jsg Exp $ */ -/* $NetBSD: pxa2x0_intr.c,v 1.5 2003/07/15 00:24:55 lukem Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * IRQ handler for the Intel PXA2X0 processor. - * It has integrated interrupt controller. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/malloc.h> -#include <sys/evcount.h> -#include <sys/queue.h> -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> -#include <machine/intr.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_intr.h> -#include <arm/sa11x0/sa11x0_var.h> - -/* - * INTC autoconf glue - */ -int pxaintc_match(struct device *, void *, void *); -void pxaintc_attach(struct device *, struct device *, void *); - -#ifdef __NetBSD__ -CFATTACH_DECL(pxaintc, sizeof(struct device), - pxaintc_match, pxaintc_attach, NULL, NULL); -#else -struct cfattach pxaintc_ca = { - sizeof(struct device), pxaintc_match, pxaintc_attach -}; - -struct cfdriver pxaintc_cd = { - NULL, "pxaintc", DV_DULL -}; - -#endif - -static int pxaintc_attached; - -int pxa2x0_stray_interrupt(void *); -void pxa2x0_init_interrupt_masks(void); - -/* - * interrupt dispatch table. - */ -#if 1 -#define MULTIPLE_HANDLERS_ON_ONE_IRQ -#endif -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ -struct intrhand { - TAILQ_ENTRY(intrhand) ih_list; /* link on intrq list */ - int (*ih_func)(void *); /* handler */ - void *ih_arg; /* arg for handler */ - char *ih_name; - struct evcount ih_count; - int ih_irq; - int ih_level; -}; -#endif - -static struct intrhandler{ -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - TAILQ_HEAD(,intrhand) list; -#else - pxa2x0_irq_handler_t func; - char *name; - void *arg; /* NULL for stackframe */ - int ih_irq; - struct evcount ih_count; -#endif -} handler[ICU_LEN]; - -volatile int softint_pending; -volatile int current_spl_level; -/* interrupt masks for each level */ -int pxa2x0_imask[NIPL]; -static int extirq_level[ICU_LEN]; - - -int -pxaintc_match(struct device *parent, void *cf, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - - if (pxaintc_attached || pxa->pxa_addr != PXA2X0_INTCTL_BASE) - return (0); - - return (1); -} - -void -pxaintc_attach(struct device *parent, struct device *self, void *args) -{ - int i; - - pxaintc_attached = 1; - - printf(": Interrupt Controller\n"); - -#define SAIPIC_ICCR 0x14 - - write_icu(SAIPIC_ICCR, 1); - write_icu(SAIPIC_MR, 0); - - for(i = 0; i < sizeof handler / sizeof handler[0]; ++i){ -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - TAILQ_INIT(&handler[i].list); - extirq_level[i] = IPL_NONE; -#else - handler[i].name = "stray"; - handler[i].func = pxa2x0_stray_interrupt; - handler[i].arg = (void *)(u_int32_t) i; - extirq_level[i] = IPL_HIGH; -#endif - - } - - pxa2x0_init_interrupt_masks(); - - _splraise(IPL_HIGH); - enable_interrupts(PSR_I); -} - -/* - * Invoked very early on from the board-specific initarm(), in order to - * inform us the virtual address of the interrupt controller's registers. - */ -vaddr_t pxaic_base; -void -pxa2x0_intr_bootstrap(vaddr_t addr) -{ - - pxaic_base = addr; -} - -/* - * PXA27x has MSL interface and SSP3 interrupts [0,1], USIM interface - * and SSP2 interrupts [15,16]. PXA255 has bits [0..6,15] reserved and - * bit [16] network SSP interrupt. We don't need any of those, so we - * map software interrupts to bits [0..1,15..16]. Sadly there are no - * four contiguous bits safe enough to use on both processors. - */ -#define SI_TO_IRQBIT(si) ((si) < 2 ? 1U<<(si) : 1U<<(15-2+(si))) - -/* - * Map a software interrupt queue to an interrupt priority level. - */ -static const int si_to_ipl[SI_NQUEUES] = { - IPL_SOFT, /* SI_SOFT */ - IPL_SOFTCLOCK, /* SI_SOFTCLOCK */ - IPL_SOFTNET, /* SI_SOFTNET */ - IPL_SOFTTTY, /* SI_SOFTTTY */ -}; - -/* - * called from irq_entry. - */ -void -pxa2x0_irq_handler(void *arg) -{ - struct clockframe *frame = arg; - uint32_t irqbits; - int irqno; - int saved_spl_level; -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - struct intrhand *ih; -#endif - - saved_spl_level = current_spl_level; - - /* get pending IRQs */ - irqbits = read_icu(SAIPIC_IP); - - while ((irqno = find_first_bit(irqbits)) >= 0) { - /* XXX: Should we handle IRQs in priority order? */ - - /* raise spl to stop interrupts of lower priorities */ - if (saved_spl_level < extirq_level[irqno]) - pxa2x0_setipl(extirq_level[irqno]); - - /* Enable interrupt */ - enable_interrupts(PSR_I); - -#ifndef MULTIPLE_HANDLERS_ON_ONE_IRQ - (* handler[irqno].func)( - handler[irqno].arg == 0 - ? frame : handler[irqno].arg ); - handler[irqno].ih_count.ec_count++; -#else - TAILQ_FOREACH(ih, &handler[irqno].list, ih_list) { - if ((ih->ih_func)( ih->ih_arg == 0 - ? frame : ih->ih_arg)) - ih->ih_count.ec_count++; - } -#endif - - /* Disable interrupt */ - disable_interrupts(PSR_I); - - irqbits &= ~(1<<irqno); - } - - /* restore spl to that was when this interrupt happen */ - pxa2x0_setipl(saved_spl_level); - - if(softint_pending & pxa2x0_imask[current_spl_level]) - pxa2x0_do_pending(); -} - -int -pxa2x0_stray_interrupt(void *cookie) -{ - int irqno = (int)cookie; - printf("stray interrupt %d\n", irqno); - - if (PXA2X0_IRQ_MIN <= irqno && irqno < ICU_LEN){ - int save = disable_interrupts(PSR_I); - write_icu(SAIPIC_MR, - read_icu(SAIPIC_MR) & ~(1U<<irqno)); - restore_interrupts(save); - } - - return 0; -} - - - -/* - * Interrupt Mask Handling - */ - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ -void pxa2x0_update_intr_masks(void); - -void -pxa2x0_update_intr_masks() -#else -void pxa2x0_update_intr_masks(int irqno, int level); - -void -pxa2x0_update_intr_masks(int irqno, int irqlevel) -#endif -{ - int psw; - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - int irq; -#ifdef DEBUG - int level; -#endif - struct intrhand *ih; - psw = disable_interrupts(PSR_I); - - /* First figure out which levels each IRQ uses. */ - for (irq = 0; irq < ICU_LEN; irq++) { - int i; - int max = IPL_NONE; - int min = IPL_HIGH; - TAILQ_FOREACH(ih, &handler[irq].list, ih_list) { - if (ih->ih_level > max) - max = ih->ih_level; - - if (ih->ih_level < min) - min = ih->ih_level; - } - - extirq_level[irq] = max; - - if (min == IPL_HIGH) - min = IPL_NONE; - - /* Enable interrupt at lower level */ - for(i = 0; i < min; ++i) - pxa2x0_imask[i] |= (1 << irq); - - /* Disable interrupt at upper level */ - for( ; i < NIPL; ++i) - pxa2x0_imask[i] &= ~(1 << irq); - } - - /* fixup */ - pxa2x0_imask[IPL_NONE] |= - SI_TO_IRQBIT(SI_SOFT) | - SI_TO_IRQBIT(SI_SOFTCLOCK) | - SI_TO_IRQBIT(SI_SOFTNET) | - SI_TO_IRQBIT(SI_SOFTTTY); - pxa2x0_imask[IPL_SOFT] |= - SI_TO_IRQBIT(SI_SOFTCLOCK) | - SI_TO_IRQBIT(SI_SOFTNET) | - SI_TO_IRQBIT(SI_SOFTTTY); - pxa2x0_imask[IPL_SOFTCLOCK] |= - SI_TO_IRQBIT(SI_SOFTNET) | - SI_TO_IRQBIT(SI_SOFTTTY); - pxa2x0_imask[IPL_SOFTNET] |= - SI_TO_IRQBIT(SI_SOFTTTY); - pxa2x0_imask[IPL_SOFTTTY] |= - 0; -#else - int level; /* debug */ - int mask = 1U<<irqno; - int i; - psw = disable_interrupts(PSR_I); - - for(i = 0; i < irqlevel; ++i) - pxa2x0_imask[i] |= mask; /* Enable interrupt at lower level */ - - for( ; i < NIPL; ++i) - pxa2x0_imask[i] &= ~mask; /* Disable interrupt at upper level */ -#endif - - /* - * Enforce a hierarchy that gives "slow" device (or devices with - * limited input buffer space/"real-time" requirements) a better - * chance at not dropping data. - */ - pxa2x0_imask[IPL_BIO] &= pxa2x0_imask[IPL_SOFTNET]; - pxa2x0_imask[IPL_NET] &= pxa2x0_imask[IPL_BIO]; - pxa2x0_imask[IPL_SOFTTTY] &= pxa2x0_imask[IPL_NET]; - pxa2x0_imask[IPL_TTY] &= pxa2x0_imask[IPL_SOFTTTY]; - - /* - * splvm() blocks all interrupts that use the kernel memory - * allocation facilities. - */ - pxa2x0_imask[IPL_VM] &= pxa2x0_imask[IPL_TTY]; - - /* - * Audio devices are not allowed to perform memory allocation - * in their interrupt routines, and they have fairly "real-time" - * requirements, so give them a high interrupt priority. - */ - pxa2x0_imask[IPL_AUDIO] &= pxa2x0_imask[IPL_VM]; - - /* - * splclock() must block anything that uses the scheduler. - */ - pxa2x0_imask[IPL_CLOCK] &= pxa2x0_imask[IPL_AUDIO]; - - /* - * splhigh() must block "everything". - */ - pxa2x0_imask[IPL_HIGH] &= pxa2x0_imask[IPL_STATCLOCK]; - -#ifdef DEBUG - for (level = IPL_NONE; level < NIPL; level++) { - printf("imask %d, %x\n", level, pxa2x0_imask[level]); - } -#endif - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - for (irq = 0; irq < ICU_LEN; irq++) { - int max_irq = IPL_NONE; - TAILQ_FOREACH(ih, &handler[irq].list, ih_list) { - if (ih->ih_level > max_irq) - max_irq = ih->ih_level; - } - extirq_level[irq] = max_irq; - } -#endif - - write_icu(SAIPIC_MR, pxa2x0_imask[current_spl_level]); - - restore_interrupts(psw); -} - - -void -pxa2x0_init_interrupt_masks(void) -{ - - memset(pxa2x0_imask, 0, sizeof(pxa2x0_imask)); - - /* - * IPL_NONE has soft interrupts enabled only, at least until - * hardware handlers are installed. - */ - pxa2x0_imask[IPL_NONE] = - SI_TO_IRQBIT(SI_SOFT) | - SI_TO_IRQBIT(SI_SOFTCLOCK) | - SI_TO_IRQBIT(SI_SOFTNET) | - SI_TO_IRQBIT(SI_SOFTTTY); - - /* - * Initialize the soft interrupt masks to block themselves. - */ - pxa2x0_imask[IPL_SOFT] = ~SI_TO_IRQBIT(SI_SOFT); - pxa2x0_imask[IPL_SOFTCLOCK] = ~SI_TO_IRQBIT(SI_SOFTCLOCK); - pxa2x0_imask[IPL_SOFTNET] = ~SI_TO_IRQBIT(SI_SOFTNET); - pxa2x0_imask[IPL_SOFTTTY] = ~SI_TO_IRQBIT(SI_SOFTTTY); - - pxa2x0_imask[IPL_SOFT] &= pxa2x0_imask[IPL_NONE]; - - /* - * splsoftclock() is the only interface that users of the - * generic software interrupt facility have to block their - * soft intrs, so splsoftclock() must also block IPL_SOFT. - */ - pxa2x0_imask[IPL_SOFTCLOCK] &= pxa2x0_imask[IPL_SOFT]; - - /* - * splsoftnet() must also block splsoftclock(), since we don't - * want timer-driven network events to occur while we're - * processing incoming packets. - */ - pxa2x0_imask[IPL_SOFTNET] &= pxa2x0_imask[IPL_SOFTCLOCK]; -} - -void -pxa2x0_do_pending(void) -{ - int oldirqstate, spl_save; - - oldirqstate = disable_interrupts(PSR_I); - - spl_save = current_spl_level; - -#define DO_SOFTINT(si,ipl) \ - if ((softint_pending & pxa2x0_imask[current_spl_level]) & \ - SI_TO_IRQBIT(si)) { \ - softint_pending &= ~SI_TO_IRQBIT(si); \ - if (current_spl_level < ipl) \ - pxa2x0_setipl(ipl); \ - restore_interrupts(oldirqstate); \ - softintr_dispatch(si); \ - oldirqstate = disable_interrupts(PSR_I); \ - pxa2x0_setipl(spl_save); \ - } - - do { - DO_SOFTINT(SI_SOFTTTY,IPL_SOFTTTY); - DO_SOFTINT(SI_SOFTNET, IPL_SOFTNET); - DO_SOFTINT(SI_SOFTCLOCK, IPL_SOFTCLOCK); - DO_SOFTINT(SI_SOFT, IPL_SOFT); - } while( softint_pending & pxa2x0_imask[current_spl_level] ); - - restore_interrupts(oldirqstate); -} - -#undef splx -void -splx(int ipl) -{ - - pxa2x0_splx(ipl); -} - -#undef _splraise -int -_splraise(int ipl) -{ - - return pxa2x0_splraise(ipl); -} - -#undef _spllower -int -_spllower(int ipl) -{ - - return pxa2x0_spllower(ipl); -} - -#undef _setsoftintr -void -_setsoftintr(int si) -{ - - return pxa2x0_setsoftintr(si); -} - -void * -pxa2x0_intr_establish(int irqno, int level, - int (*func)(void *), void *arg, const char *name) -{ - int psw; -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - struct intrhand *ih; -#else - struct intrhandler *ih; -#endif - - if (irqno < PXA2X0_IRQ_MIN || irqno >= ICU_LEN) - panic("intr_establish: bogus irq number %d", irqno); - - psw = disable_interrupts(PSR_I); - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - /* no point in sleeping unless someone can free memory. */ - ih = (struct intrhand *)malloc(sizeof *ih, M_DEVBUF, - cold ? M_NOWAIT : M_WAITOK); - if (ih == NULL) - panic("intr_establish: can't malloc handler info"); - ih->ih_func = func; - ih->ih_arg = arg; - ih->ih_level = level; - ih->ih_irq = irqno; - - TAILQ_INSERT_TAIL(&handler[irqno].list, ih, ih_list); -#else - ih = &handler[irqno]; - ih->arg = arg; - ih->func = func; - ih->name = name; - ih->ih_irq = irqno; - extirq_level[irqno] = level; -#endif - - if (name != NULL) - evcount_attach(&ih->ih_count, name, &ih->ih_irq); - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - pxa2x0_update_intr_masks(); -#else - pxa2x0_update_intr_masks(irqno, level); -#endif - - restore_interrupts(psw); - - return (ih); -} - -void -pxa2x0_intr_disestablish(void *cookie) -{ - -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - int psw; - struct intrhand *ih = cookie; - int irqno = ih->ih_irq; - - psw = disable_interrupts(PSR_I); - TAILQ_REMOVE(&handler[irqno].list, ih, ih_list); - - free(ih, M_DEVBUF, 0); - - pxa2x0_update_intr_masks(); - - restore_interrupts(psw); -#else - struct intrhandler *lhandler = cookie; - int irqno; - int psw; - struct intrhandler *ih; - irqno = lhandler - handler; - - if (irqno < PXA2X0_IRQ_MIN || irqno >= ICU_LEN) - panic("intr_disestablish: bogus irq number %d", irqno); - - psw = disable_interrupts(PSR_I); - - ih = &handler[irqno]; - if (ih->name != NULL) - evcount_detach(&ih->ih_count); - - ih->arg = (void *) irqno; - ih->func = pxa2x0_stray_interrupt; - ih->name = "stray"; - extirq_level[irqno] = IPL_HIGH; - pxa2x0_update_intr_masks(irqno, IPL_HIGH); - - restore_interrupts(psw); -#endif -} - -/* - * Glue for drivers of sa11x0 compatible integrated logic. - */ -void * -sa11x0_intr_establish(sa11x0_chipset_tag_t ic, int irq, int type, int level, - int (*ih_fun)(void *), void *ih_arg, const char *name) -{ - - return pxa2x0_intr_establish(irq, level, ih_fun, ih_arg, name); -} - -void -pxa2x0_setipl(int new) -{ - u_int32_t intr_mask; - - intr_mask = pxa2x0_imask[new]; - current_spl_level = new; - write_icu( SAIPIC_MR, intr_mask ); -} - - -void -pxa2x0_splx(int new) -{ - int psw; - - psw = disable_interrupts(PSR_I); - pxa2x0_setipl(new); - restore_interrupts(psw); - - /* If there are pending software interrupts, process them. */ - if (softint_pending & pxa2x0_imask[current_spl_level]) - pxa2x0_do_pending(); -} - - -int -pxa2x0_splraise(int ipl) -{ - int old, psw; - - old = current_spl_level; - if( ipl > current_spl_level ){ - psw = disable_interrupts(PSR_I); - pxa2x0_setipl(ipl); - restore_interrupts(psw); - } - - return (old); -} - -int -pxa2x0_spllower(int ipl) -{ - int old = current_spl_level; - int psw = disable_interrupts(PSR_I); - pxa2x0_splx(ipl); - restore_interrupts(psw); - return(old); -} - -void -pxa2x0_setsoftintr(int si) -{ - softint_pending |= SI_TO_IRQBIT(si); - - /* Process unmasked pending soft interrupts. */ - if ( softint_pending & pxa2x0_imask[current_spl_level] ) - pxa2x0_do_pending(); -} - -const char * -pxa2x0_intr_string(void *cookie) -{ -#ifdef MULTIPLE_HANDLERS_ON_ONE_IRQ - struct intrhand *ih = cookie; -#else - struct intrhandler *lhandler = cookie; -#endif - static char irqstr[32]; - - if (ih == NULL) - snprintf(irqstr, sizeof irqstr, "couldn't establish interrupt"); - else - snprintf(irqstr, sizeof irqstr, "irq %d", ih->ih_irq); - - return irqstr; -} - -#ifdef DIAGNOSTIC -void -pxa2x0_splassert_check(int wantipl, const char *func) -{ - int oldipl = current_spl_level, psw; - - if (oldipl < wantipl) { - splassert_fail(wantipl, oldipl, func); - /* - * If the splassert_ctl is set to not panic, raise the ipl - * in a feeble attempt to reduce damage. - */ - psw = disable_interrupts(PSR_I); - pxa2x0_setipl(wantipl); - restore_interrupts(psw); - } -} -#endif diff --git a/sys/arch/arm/xscale/pxa2x0_intr.h b/sys/arch/arm/xscale/pxa2x0_intr.h deleted file mode 100644 index 71478df5872..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_intr.h +++ /dev/null @@ -1,127 +0,0 @@ -/* $OpenBSD: pxa2x0_intr.h,v 1.14 2014/03/29 18:09:28 guenther Exp $ */ -/* $NetBSD: pxa2x0_intr.h,v 1.4 2003/07/05 06:53:08 dogcow Exp $ */ - -/* Derived from i80321_intr.h */ - -/* - * Copyright (c) 2001, 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _PXA2X0_INTR_H_ -#define _PXA2X0_INTR_H_ - -#define ARM_IRQ_HANDLER _C_LABEL(pxa2x0_irq_handler) - -#ifndef _LOCORE - -#include <arm/armreg.h> -#include <arm/cpufunc.h> -#include <arm/softintr.h> - -extern vaddr_t pxaic_base; /* Shared with pxa2x0_irq.S */ -#define read_icu(offset) (*(volatile uint32_t *)(pxaic_base+(offset))) -#define write_icu(offset,value) \ - (*(volatile uint32_t *)(pxaic_base+(offset))=(value)) - -extern volatile int current_spl_level; -extern volatile int softint_pending; -extern int pxa2x0_imask[]; -void pxa2x0_do_pending(void); - -void pxa2x0_setipl(int new); -void pxa2x0_splx(int new); -int pxa2x0_splraise(int ipl); -int pxa2x0_spllower(int ipl); -void pxa2x0_setsoftintr(int si); - - -/* - * An useful function for interrupt handlers. - * XXX: This shouldn't be here. - */ -static __inline int -find_first_bit( uint32_t bits ) -{ - int count; - - /* since CLZ is available only on ARMv5, this isn't portable - * to all ARM CPUs. This file is for PXA2[15]0 processor. - */ - asm( "clz %0, %1" : "=r" (count) : "r" (bits) ); - return 31-count; -} - - -int _splraise(int); -int _spllower(int); -void splx(int); -void _setsoftintr(int); - -/* - * This function *MUST* be called very early on in a port's - * initarm() function, before ANY spl*() functions are called. - * - * The parameter is the virtual address of the PXA2x0's Interrupt - * Controller registers. - */ -void pxa2x0_intr_bootstrap(vaddr_t); - -void pxa2x0_irq_handler(void *); -void *pxa2x0_intr_establish(int irqno, int level, int (*func)(void *), - void *cookie, const char *name); -void pxa2x0_intr_disestablish(void *cookie); -const char *pxa2x0_intr_string(void *cookie); - -#ifdef DIAGNOSTIC -/* - * Although this function is implemented in MI code, it must be in this MD - * header because we don't want this header to include MI includes. - */ -void splassert_fail(int, int, const char *); -extern int splassert_ctl; -void pxa2x0_splassert_check(int, const char *); -#define splassert(__wantipl) do { \ - if (splassert_ctl > 0) { \ - pxa2x0_splassert_check(__wantipl, __func__); \ - } \ -} while (0) -#define splsoftassert(wantipl) splassert(wantipl) -#else -#define splassert(wantipl) do { /* nothing */ } while (0) -#define splsoftassert(wantipl) do { /* nothing */ } while (0) -#endif - -#endif /* ! _LOCORE */ - -#endif /* _PXA2X0_INTR_H_ */ diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.c b/sys/arch/arm/xscale/pxa2x0_lcd.c deleted file mode 100644 index 9238889c8e4..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_lcd.c +++ /dev/null @@ -1,869 +0,0 @@ -/* $OpenBSD: pxa2x0_lcd.c,v 1.27 2016/01/31 00:14:50 jsg Exp $ */ -/* $NetBSD: pxa2x0_lcd.c,v 1.8 2003/10/03 07:24:05 bsh Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * Support PXA2[15]0's integrated LCD controller. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/conf.h> -#include <sys/uio.h> -#include <sys/malloc.h> -#include <sys/kernel.h> /* for cold */ - -#include <uvm/uvm_extern.h> - -#include <dev/cons.h> - -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wsdisplayvar.h> -#include <dev/rasops/rasops.h> - -#include <machine/bus.h> -#include <machine/cpu.h> -#include <arm/cpufunc.h> - -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0_lcd.h> -#include <arm/xscale/pxa2x0_gpio.h> - -/* - * Console variables. These are necessary since console is setup very early, - * before devices get attached. - */ -struct { - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_dma_tag_t dma_tag; - const struct lcd_panel_geometry *geometry; - struct pxa2x0_lcd_screen scr; -} pxa2x0_lcd_console; - -int lcdintr(void *); -void pxa2x0_lcd_geometry(bus_space_tag_t, bus_space_handle_t, - const struct lcd_panel_geometry *); -void pxa2x0_lcd_initialize(bus_space_tag_t, bus_space_handle_t, - const struct lcd_panel_geometry *, void (*)(u_int, int)); -int pxa2x0_lcd_new_screen(struct pxa2x0_lcd_softc *, - struct pxa2x0_lcd_screen *, int); -void pxa2x0_lcd_setup_console(struct pxa2x0_lcd_softc *, - const struct pxa2x0_wsscreen_descr *); -void pxa2x0_lcd_setup_rasops(struct rasops_info *, - struct pxa2x0_wsscreen_descr *, - const struct lcd_panel_geometry *); -void pxa2x0_lcd_start_dma(bus_space_tag_t, bus_space_handle_t, - struct pxa2x0_lcd_screen *); -void pxa2x0_lcd_stop_dma(bus_space_tag_t, bus_space_handle_t); - -/* - * Setup display geometry parameters. - */ -void -pxa2x0_lcd_geometry(bus_space_tag_t iot, bus_space_handle_t ioh, - const struct lcd_panel_geometry *info) -{ - int lines; - uint32_t ccr0; - - ccr0 = LCCR0_IMASK; - if (info->panel_info & LCDPANEL_ACTIVE) - ccr0 |= LCCR0_PAS; /* active mode */ - if ((info->panel_info & (LCDPANEL_DUAL | LCDPANEL_ACTIVE)) - == LCDPANEL_DUAL) - ccr0 |= LCCR0_SDS; /* dual panel */ - if (info->panel_info & LCDPANEL_MONOCHROME) - ccr0 |= LCCR0_CMS; - /* XXX - Zaurus C3000 */ - ccr0 |= LCCR0_LDDALT | - LCCR0_OUC | - LCCR0_CMDIM | - LCCR0_RDSTM; - - bus_space_write_4(iot, ioh, LCDC_LCCR0, ccr0); - - bus_space_write_4(iot, ioh, LCDC_LCCR1, - (info->panel_width - 1) - | ((info->hsync_pulse_width - 1) << 10) - | ((info->end_line_wait - 1) << 16) - | ((info->beg_line_wait - 1) << 24)); - - if (info->panel_info & LCDPANEL_DUAL) - lines = info->panel_height / 2 + info->extra_lines; - else - lines = info->panel_height + info->extra_lines; - - bus_space_write_4(iot, ioh, LCDC_LCCR2, - (lines - 1) - | (info->vsync_pulse_width << 10) - | (info->end_frame_wait << 16) - | (info->beg_frame_wait << 24)); - - bus_space_write_4(iot, ioh, LCDC_LCCR3, - (info->pixel_clock_div << 0) - | (info->ac_bias << 8) - | ((info->panel_info & - (LCDPANEL_VSP | LCDPANEL_HSP | LCDPANEL_PCP | LCDPANEL_OEP)) - << 20) - | (4 << 24) /* 16bpp */ - | ((info->panel_info & LCDPANEL_DPC) ? (1 << 27) : 0) - ); -} - -/* - * Initialize the LCD controller. - */ -void -pxa2x0_lcd_initialize(bus_space_tag_t iot, bus_space_handle_t ioh, - const struct lcd_panel_geometry *geom, void (*clkman)(u_int, int)) -{ - int nldd; - u_int32_t lccr0, lscr; - - /* Check if LCD is enabled before programming, it should not - * be enabled while it is being reprogrammed, therefore disable - * it first. - */ - lccr0 = bus_space_read_4(iot, ioh, LCDC_LCCR0); - if (lccr0 & LCCR0_ENB) { - lccr0 |= LCCR0_LDM; - bus_space_write_4(iot, ioh, LCDC_LCCR0, lccr0); - lccr0 = bus_space_read_4(iot, ioh, LCDC_LCCR0); /* paranoia */ - lccr0 |= LCCR0_DIS; - bus_space_write_4(iot, ioh, LCDC_LCCR0, lccr0); - do { - lscr = bus_space_read_4(iot, ioh, LCDC_LCSR); - } while (!(lscr & LCSR_LDD)); - } - - /* enable clock */ - (*clkman)(CKEN_LCD, 1); - - bus_space_write_4(iot, ioh, LCDC_LCCR0, LCCR0_IMASK); - - /* - * setup GP[77:58] for LCD - */ - /* Always use [FLP]CLK, ACBIAS */ - pxa2x0_gpio_set_function(74, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(75, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(76, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(77, GPIO_ALT_FN_2_OUT); - - if ((geom->panel_info & LCDPANEL_ACTIVE) || - ((geom->panel_info & (LCDPANEL_MONOCHROME|LCDPANEL_DUAL)) == - LCDPANEL_DUAL)) { - /* active and color dual panel need L_DD[15:0] */ - nldd = 16; - } else if ((geom->panel_info & LCDPANEL_DUAL) || - !(geom->panel_info & LCDPANEL_MONOCHROME)) { - /* dual or color need L_DD[7:0] */ - nldd = 8; - } else { - /* Otherwise just L_DD[3:0] */ - nldd = 4; - } - - while (nldd--) - pxa2x0_gpio_set_function(58 + nldd, GPIO_ALT_FN_2_OUT); - - pxa2x0_lcd_geometry(iot, ioh, geom); -} - -/* - * Common driver attachment code. - */ -void -pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *sc, - struct pxaip_attach_args *pxa, struct pxa2x0_wsscreen_descr *descr, - const struct lcd_panel_geometry *geom, int console) -{ - bus_space_tag_t iot; - bus_space_handle_t ioh; - int error; - - sc->n_screens = 0; - LIST_INIT(&sc->screens); - - /* map controller registers if not console */ - if (console != 0) { - iot = pxa2x0_lcd_console.iot; - ioh = pxa2x0_lcd_console.ioh; - } else { - iot = pxa->pxa_iot; - error = bus_space_map(iot, PXA2X0_LCDC_BASE, PXA2X0_LCDC_SIZE, - 0, &ioh); - if (error) { - printf(": failed to map registers %d", error); - return; - } - } - - sc->iot = iot; - sc->ioh = ioh; - sc->dma_tag = &pxa2x0_bus_dma_tag; - - sc->ih = pxa2x0_intr_establish(17, IPL_BIO, lcdintr, sc, - sc->dev.dv_xname); - if (sc->ih == NULL) - printf("%s: unable to establish interrupt at irq %d", - sc->dev.dv_xname, 17); - - sc->geometry = geom; - - if (console != 0) { - /* complete console attachment */ - pxa2x0_lcd_setup_console(sc, descr); - } else { - struct rasops_info dummy; - - pxa2x0_lcd_initialize(iot, ioh, geom, pxa2x0_clkman_config); - - /* - * Initialize a dummy rasops_info to compute fontsize and - * the screen size in chars. - */ - bzero(&dummy, sizeof(dummy)); - pxa2x0_lcd_setup_rasops(&dummy, descr, geom); - } -} - -/* - * Interrupt handler. - */ -int -lcdintr(void *arg) -{ - struct pxa2x0_lcd_softc *sc = arg; - bus_space_tag_t iot = sc->iot; - bus_space_handle_t ioh = sc->ioh; - - static uint32_t status; - - status = bus_space_read_4(iot, ioh, LCDC_LCSR); - /* Clear sticky status bits */ - bus_space_write_4(iot, ioh, LCDC_LCSR, status); - - return 1; -} - -/* - * Enable DMA to cause the display to be refreshed periodically. - * This brings the screen to life... - */ -void -pxa2x0_lcd_start_dma(bus_space_tag_t iot, bus_space_handle_t ioh, - struct pxa2x0_lcd_screen *scr) -{ - uint32_t tmp; - int val, save; - - save = disable_interrupts(PSR_I); - - switch (scr->depth) { - case 1: val = 0; break; - case 2: val = 1; break; - case 4: val = 2; break; - case 8: val = 3; break; - case 16: - /* FALLTHROUGH */ - default: - val = 4; break; - } - - tmp = bus_space_read_4(iot, ioh, LCDC_LCCR3); - bus_space_write_4(iot, ioh, LCDC_LCCR3, - (tmp & ~LCCR3_BPP) | (val << LCCR3_BPP_SHIFT)); - - bus_space_write_4(iot, ioh, LCDC_FDADR0, - scr->depth == 16 ? scr->dma_desc_pa : - scr->dma_desc_pa + 2 * sizeof (struct lcd_dma_descriptor)); - bus_space_write_4(iot, ioh, LCDC_FDADR1, - scr->dma_desc_pa + 1 * sizeof (struct lcd_dma_descriptor)); - - /* clear status */ - bus_space_write_4(iot, ioh, LCDC_LCSR, 0); - - delay(1000); /* ??? */ - - /* Enable LCDC */ - tmp = bus_space_read_4(iot, ioh, LCDC_LCCR0); - /*tmp &= ~LCCR0_SFM;*/ - bus_space_write_4(iot, ioh, LCDC_LCCR0, tmp | LCCR0_ENB); - - restore_interrupts(save); -} - -/* - * Disable screen refresh. - */ -void -pxa2x0_lcd_stop_dma(bus_space_tag_t iot, bus_space_handle_t ioh) -{ - - /* Stop LCD DMA after current frame */ - bus_space_write_4(iot, ioh, LCDC_LCCR0, - LCCR0_DIS | - bus_space_read_4(iot, ioh, LCDC_LCCR0)); - - /* wait for disabling done. - XXX: use interrupt. */ - while (LCCR0_ENB & - bus_space_read_4(iot, ioh, LCDC_LCCR0)) - ; - - bus_space_write_4(iot, ioh, LCDC_LCCR0, - ~LCCR0_DIS & - bus_space_read_4(iot, ioh, LCDC_LCCR0)); -} - -#define _rgb(r,g,b) (((r)<<11) | ((g)<<5) | b) -#define rgb(r,g,b) _rgb((r)>>1,g,(b)>>1) - -#define L 0x1f /* low intensity */ -#define H 0x3f /* high intensity */ - -static uint16_t basic_color_map[] = { - rgb( 0, 0, 0), /* black */ - rgb( L, 0, 0), /* red */ - rgb( 0, L, 0), /* green */ - rgb( L, L, 0), /* brown */ - rgb( 0, 0, L), /* blue */ - rgb( L, 0, L), /* magenta */ - rgb( 0, L, L), /* cyan */ - rgb( 0x31,0x31,0x31), /* white */ - - rgb( L, L, L), /* black */ - rgb( H, 0, 0), /* red */ - rgb( 0, H, 0), /* green */ - rgb( H, H, 0), /* brown */ - rgb( 0, 0, H), /* blue */ - rgb( H, 0, H), /* magenta */ - rgb( 0, H, H), /* cyan */ - rgb( H, H, H) -}; - -#undef H -#undef L - -static void -init_palette(uint16_t *buf, int depth) -{ - int i; - - /* convert RGB332 to RGB565 */ - switch (depth) { - case 8: - case 4: -#if 0 - for (i = 0; i <= 255; ++i) { - buf[i] = ((9 * ((i >> 5) & 0x07)) << 11) | - ((9 * ((i >> 2) & 0x07)) << 5) | - ((21 * (i & 0x03)) / 2); - } -#else - memcpy(buf, basic_color_map, sizeof basic_color_map); - for (i = 16; i < (1 << depth); ++i) - buf[i] = 0xffff; -#endif - break; - case 16: - /* palette is not needed */ - break; - default: - /* other depths are not supported */ - break; - } -} - -/* - * Create and initialize a new screen buffer. - */ -int -pxa2x0_lcd_new_screen(struct pxa2x0_lcd_softc *sc, - struct pxa2x0_lcd_screen *scr, int depth) -{ - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_dma_tag_t dma_tag; - const struct lcd_panel_geometry *geometry; - int width, height; - bus_size_t size; - int error, palette_size; - int busdma_flag = (cold ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK); - struct lcd_dma_descriptor *desc; - paddr_t buf_pa, desc_pa; - - if (sc != NULL) { - iot = sc->iot; - ioh = sc->ioh; - dma_tag = sc->dma_tag; - geometry = sc->geometry; - } else { - /* We are creating the console screen. */ - iot = pxa2x0_lcd_console.iot; - ioh = pxa2x0_lcd_console.ioh; - dma_tag = pxa2x0_lcd_console.dma_tag; - geometry = pxa2x0_lcd_console.geometry; - } - - width = geometry->panel_width; - height = geometry->panel_height; - palette_size = 0; - - switch (depth) { - case 1: - case 2: - case 4: - case 8: - palette_size = (1 << depth) * sizeof (uint16_t); - /* FALLTHROUGH */ - case 16: - size = roundup(width, 4) * depth / 8 * height; - break; - default: - printf("%s: Unknown depth (%d)\n", - sc != NULL ? sc->dev.dv_xname : "console", depth); - return (EINVAL); - } - - bzero(scr, sizeof *scr); - - scr->nsegs = 0; - scr->depth = depth; - scr->buf_size = size; - scr->buf_va = NULL; - size = roundup(size, 16) + 3 * sizeof (struct lcd_dma_descriptor) - + palette_size; - - error = bus_dmamem_alloc(dma_tag, size, 16, 0, - scr->segs, 1, &(scr->nsegs), busdma_flag); - if (error != 0 || scr->nsegs != 1) { - /* XXX: Actually we can handle nsegs > 1 case by means - of multiple DMA descriptors for a panel. It would - make code here a bit hairy */ - if (error == 0) - error = E2BIG; - goto bad; - } - - error = bus_dmamem_map(dma_tag, scr->segs, scr->nsegs, - size, (caddr_t *)&(scr->buf_va), busdma_flag | BUS_DMA_COHERENT); - if (error != 0) - goto bad; - - memset(scr->buf_va, 0, scr->buf_size); - - /* map memory for DMA */ - if (bus_dmamap_create(dma_tag, 1024 * 1024 * 2, 1, - 1024 * 1024 * 2, 0, busdma_flag, &scr->dma)) - goto bad; - error = bus_dmamap_load(dma_tag, scr->dma, - scr->buf_va, size, NULL, busdma_flag); - if (error != 0) { - goto bad; - } - - buf_pa = scr->segs[0].ds_addr; - desc_pa = buf_pa + roundup(size, PAGE_SIZE) - 3 * sizeof *desc; - - /* make descriptors at the top of mapped memory */ - desc = (struct lcd_dma_descriptor *) - ((caddr_t)(scr->buf_va) + roundup(size, PAGE_SIZE) - - 3 * sizeof *desc); - - desc[0].fdadr = desc_pa; - desc[0].fsadr = buf_pa; - desc[0].ldcmd = scr->buf_size; - - if (palette_size) { - init_palette((uint16_t *)((char *)desc - palette_size), depth); - - desc[2].fdadr = desc_pa; /* chain to panel 0 */ - desc[2].fsadr = desc_pa - palette_size; - desc[2].ldcmd = palette_size | LDCMD_PAL; - } - - if (geometry->panel_info & LCDPANEL_DUAL) { - /* Dual panel */ - desc[1].fdadr = desc_pa + sizeof *desc; - desc[1].fsadr = buf_pa + scr->buf_size / 2; - desc[0].ldcmd = desc[1].ldcmd = scr->buf_size / 2; - - } - -#if 0 - desc[0].ldcmd |= LDCMD_SOFINT; - desc[1].ldcmd |= LDCMD_SOFINT; -#endif - - scr->dma_desc = desc; - scr->dma_desc_pa = desc_pa; - scr->map_size = size; /* used when unmap this. */ - - if (sc != NULL) { - LIST_INSERT_HEAD(&(sc->screens), scr, link); - sc->n_screens++; - } - - return (0); - - bad: - if (scr->buf_va) - bus_dmamem_unmap(dma_tag, scr->buf_va, size); - if (scr->nsegs) - bus_dmamem_free(dma_tag, scr->segs, scr->nsegs); - return (error); -} - -/* - * Initialize rasops for a screen, as well as struct wsscreen_descr if this - * is the first screen creation. - */ -void -pxa2x0_lcd_setup_rasops(struct rasops_info *rinfo, - struct pxa2x0_wsscreen_descr *descr, - const struct lcd_panel_geometry *geom) -{ - - rinfo->ri_flg = descr->flags; - rinfo->ri_depth = descr->depth; - rinfo->ri_width = geom->panel_width; - rinfo->ri_height = geom->panel_height; - rinfo->ri_stride = rinfo->ri_width * rinfo->ri_depth / 8; -#ifdef notyet - rinfo->ri_wsfcookie = -1; /* XXX */ -#endif - - /* swap B and R */ - if (descr->depth == 16) { - rinfo->ri_rnum = 5; - rinfo->ri_rpos = 11; - rinfo->ri_gnum = 6; - rinfo->ri_gpos = 5; - rinfo->ri_bnum = 5; - rinfo->ri_bpos = 0; - } - - if (descr->c.nrows == 0) { - /* get rasops to compute screen size the first time */ - rasops_init(rinfo, 100, 100); - } else -#ifndef __zaurus__ - rasops_init(rinfo, descr->c.nrows, descr->c.ncols); -#else - /* XXX swap rows/cols for second call because of rotation */ - rasops_init(rinfo, descr->c.ncols, descr->c.nrows); -#endif - - descr->c.nrows = rinfo->ri_rows; - descr->c.ncols = rinfo->ri_cols; - descr->c.capabilities = rinfo->ri_caps; - descr->c.textops = &rinfo->ri_ops; -} - -/* - * Early console attachment. - * This initializes the LCD, then creates and displays a screen buffer. - * This screen will be accounted for in the softc when the lcd device attaches. - */ -int -pxa2x0_lcd_cnattach(struct pxa2x0_wsscreen_descr *descr, - const struct lcd_panel_geometry *geom, void (*clkman)(u_int, int)) -{ - struct rasops_info *ri; - long defattr; - int error; - - /* map controller registers */ - pxa2x0_lcd_console.iot = &pxa2x0_bs_tag; - error = bus_space_map(pxa2x0_lcd_console.iot, - PXA2X0_LCDC_BASE, PXA2X0_LCDC_SIZE, 0, &pxa2x0_lcd_console.ioh); - if (error != 0) - return (error); - - pxa2x0_lcd_console.dma_tag = &pxa2x0_bus_dma_tag; - pxa2x0_lcd_console.geometry = geom; - - pxa2x0_lcd_initialize(pxa2x0_lcd_console.iot, pxa2x0_lcd_console.ioh, - pxa2x0_lcd_console.geometry, clkman); - - error = pxa2x0_lcd_new_screen(NULL, &pxa2x0_lcd_console.scr, - descr->depth); - if (error != 0) - return (error); - - ri = &pxa2x0_lcd_console.scr.rinfo; - ri->ri_hw = (void *)&pxa2x0_lcd_console.scr; - ri->ri_bits = pxa2x0_lcd_console.scr.buf_va; - pxa2x0_lcd_setup_rasops(ri, descr, pxa2x0_lcd_console.geometry); - - /* assumes 16 bpp */ - ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); - - pxa2x0_lcd_start_dma(pxa2x0_lcd_console.iot, pxa2x0_lcd_console.ioh, - &pxa2x0_lcd_console.scr); - - wsdisplay_cnattach(&descr->c, ri, ri->ri_ccol, ri->ri_crow, defattr); - - return (0); -} - -/* - * Do the necessary accounting to bring the console variables in the softc. - */ -void -pxa2x0_lcd_setup_console(struct pxa2x0_lcd_softc *sc, - const struct pxa2x0_wsscreen_descr *descr) -{ - struct pxa2x0_lcd_screen *scr = &pxa2x0_lcd_console.scr; - - /* - * Register the console screen as if it had been created - * when the lcd device attached. - */ - LIST_INSERT_HEAD(&(sc->screens), &pxa2x0_lcd_console.scr, link); - sc->n_screens++; - sc->active = scr; -} - -/* - * wsdisplay accessops - */ - -int -pxa2x0_lcd_show_screen(void *v, void *cookie, int waitok, - void (*cb)(void *, int, int), void *cbarg) -{ - struct pxa2x0_lcd_softc *sc = v; - struct rasops_info *ri = cookie; - struct pxa2x0_lcd_screen *scr = ri->ri_hw, *old; - - old = sc->active; - if (old == scr) - return 0; - - if (old) - pxa2x0_lcd_stop_dma(sc->iot, sc->ioh); - - pxa2x0_lcd_start_dma(sc->iot, sc->ioh, scr); - - sc->active = scr; - return 0; -} - -int -pxa2x0_lcd_alloc_screen(void *v, const struct wsscreen_descr *_type, - void **cookiep, int *curxp, int *curyp, long *attrp) -{ - struct pxa2x0_lcd_softc *sc = v; - struct pxa2x0_lcd_screen *scr; - struct rasops_info *ri; - struct pxa2x0_wsscreen_descr *type = - (struct pxa2x0_wsscreen_descr *)_type; - int error; - - scr = malloc(sizeof *scr, M_DEVBUF, (cold ? M_NOWAIT : M_WAITOK)); - if (scr == NULL) - return (ENOMEM); - - error = pxa2x0_lcd_new_screen(sc, scr, type->depth); - if (error != 0) { - free(scr, M_DEVBUF, 0); - return (error); - } - - /* - * initialize raster operation for this screen. - */ - ri = &scr->rinfo; - ri->ri_hw = (void *)scr; - ri->ri_bits = scr->buf_va; - pxa2x0_lcd_setup_rasops(ri, type, sc->geometry); - - /* assumes 16 bpp */ - ri->ri_ops.alloc_attr(ri, 0, 0, 0, attrp); - - *cookiep = ri; - *curxp = 0; - *curyp = 0; - - return 0; -} - -void -pxa2x0_lcd_free_screen(void *v, void *cookie) -{ - struct pxa2x0_lcd_softc *sc = v; - struct rasops_info *ri = cookie; - struct pxa2x0_lcd_screen *scr = ri->ri_hw; - - LIST_REMOVE(scr, link); - sc->n_screens--; - if (scr == sc->active) { - /* at first, we need to stop LCD DMA */ - sc->active = NULL; - -#ifdef DEBUG - printf("lcd_free on active screen\n"); -#endif - - pxa2x0_lcd_stop_dma(sc->iot, sc->ioh); - } - - if (scr->buf_va) - bus_dmamem_unmap(sc->dma_tag, scr->buf_va, scr->map_size); - - if (scr->nsegs > 0) - bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs); - - free(scr, M_DEVBUF, 0); -} - -int -pxa2x0_lcd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ - struct pxa2x0_lcd_softc *sc = v; - struct wsdisplay_fbinfo *wsdisp_info; - struct pxa2x0_lcd_screen *scr = sc->active; /* ??? */ - - switch (cmd) { - case WSDISPLAYIO_GTYPE: - *(u_int *)data = WSDISPLAY_TYPE_PXALCD; /* XXX */ - break; - - case WSDISPLAYIO_GINFO: - wsdisp_info = (struct wsdisplay_fbinfo *)data; - - wsdisp_info->height = sc->geometry->panel_height; - wsdisp_info->width = sc->geometry->panel_width; - wsdisp_info->depth = 16; /* XXX */ - wsdisp_info->cmsize = 0; - break; - - case WSDISPLAYIO_GETSUPPORTEDDEPTH: - *(u_int *)data = WSDISPLAYIO_DEPTH_16; - break; - - case WSDISPLAYIO_GETCMAP: - case WSDISPLAYIO_PUTCMAP: - return EINVAL; /* XXX Colormap */ - - case WSDISPLAYIO_SVIDEO: - case WSDISPLAYIO_GVIDEO: - break; - - case WSDISPLAYIO_GCURPOS: - case WSDISPLAYIO_SCURPOS: - case WSDISPLAYIO_GCURMAX: - case WSDISPLAYIO_GCURSOR: - case WSDISPLAYIO_SCURSOR: - default: - return -1; /* not implemented */ - - case WSDISPLAYIO_LINEBYTES: - *(u_int *)data = scr->rinfo.ri_stride; - break; - } - return (0); -} - -paddr_t -pxa2x0_lcd_mmap(void *v, off_t offset, int prot) -{ - struct pxa2x0_lcd_softc *sc = v; - struct pxa2x0_lcd_screen *screen = sc->active; /* ??? */ - - if ((offset & PAGE_MASK) != 0) - return (-1); - - if (screen == NULL) - return (-1); - - if (offset < 0 || - offset >= screen->rinfo.ri_stride * screen->rinfo.ri_height) - return (-1); - - return (bus_dmamem_mmap(sc->dma_tag, screen->segs, screen->nsegs, - offset, prot, BUS_DMA_WAITOK | BUS_DMA_COHERENT)); -} - -int -pxa2x0_lcd_load_font(void *v, void *emulcookie, struct wsdisplay_font *font) -{ - struct pxa2x0_lcd_softc *sc = v; - struct pxa2x0_lcd_screen *screen = sc->active; - - if (screen == NULL) - return ENXIO; - - return rasops_load_font(&screen->rinfo, emulcookie, font); -} - -int -pxa2x0_lcd_list_font(void *v, struct wsdisplay_font *font) -{ - struct pxa2x0_lcd_softc *sc = v; - struct pxa2x0_lcd_screen *screen = sc->active; - - if (screen == NULL) - return ENXIO; - - return rasops_list_font(&screen->rinfo, font); -} - -void -pxa2x0_lcd_suspend(struct pxa2x0_lcd_softc *sc) -{ - - if (sc->active != NULL) { - pxa2x0_lcd_stop_dma(sc->iot, sc->ioh); - - pxa2x0_clkman_config(CKEN_LCD, 0); - } -} - -void -pxa2x0_lcd_resume(struct pxa2x0_lcd_softc *sc) -{ - - if (sc->active != NULL) { - pxa2x0_lcd_initialize(sc->iot, sc->ioh, sc->geometry, - pxa2x0_clkman_config); - pxa2x0_lcd_start_dma(sc->iot, sc->ioh, sc->active); - } -} diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.h b/sys/arch/arm/xscale/pxa2x0_lcd.h deleted file mode 100644 index a9823521b7e..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_lcd.h +++ /dev/null @@ -1,151 +0,0 @@ -/* $OpenBSD: pxa2x0_lcd.h,v 1.12 2013/10/21 10:36:10 miod Exp $ */ -/* $NetBSD: pxa2x0_lcd.h,v 1.2 2003/06/17 09:43:14 bsh Exp $ */ -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - - -#ifndef _ARM_XSCALE_PXA2X0_LCD_H -#define _ARM_XSCALE_PXA2X0_LCD_H - -#include <dev/rasops/rasops.h> -#include <machine/bus.h> - -/* LCD Controller */ - -struct lcd_dma_descriptor { - uint32_t fdadr; /* next frame descriptor */ - uint32_t fsadr; /* frame start address */ - uint32_t fidr; /* frame ID */ - uint32_t ldcmd; /* DMA command */ -#define LDCMD_PAL (1U<<26) /* Palette buffer */ -#define LDCMD_SOFINT (1U<<22) /* Start of Frame interrupt */ -#define LDCMD_EOFINT (1U<<21) /* End of Frame interrupt */ -}; - - -struct pxa2x0_lcd_screen { - LIST_ENTRY(pxa2x0_lcd_screen) link; - - /* Frame buffer */ - bus_dmamap_t dma; - bus_dma_segment_t segs[1]; - int nsegs; - size_t buf_size; - size_t map_size; - void *buf_va; - int depth; - - /* DMA frame descriptor */ - struct lcd_dma_descriptor *dma_desc; - paddr_t dma_desc_pa; - - /* rasterop */ - struct rasops_info rinfo; -}; - -struct pxa2x0_lcd_softc { - struct device dev; - /* control register */ - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_dma_tag_t dma_tag; - - const struct lcd_panel_geometry *geometry; - - int n_screens; - LIST_HEAD(, pxa2x0_lcd_screen) screens; - struct pxa2x0_lcd_screen *active; - - void *ih; /* interrupt handler */ -}; - -struct lcd_panel_geometry { - short panel_width; - short panel_height; - short extra_lines; - - short panel_info; -#define LCDPANEL_VSP (1<<0) /* L_FCLK pin is active low */ -#define LCDPANEL_HSP (1<<1) /* L_LCLK pin is active low */ -#define LCDPANEL_PCP (1<<2) /* use L_PCLK falling edge */ -#define LCDPANEL_OEP (1<<3) /* L_BIAS pin is active low */ -#define LCDPANEL_DPC (1<<4) /* double pixel clock mode */ - -#define LCDPANEL_DUAL (1<<5) /* Dual or single */ -#define LCDPANEL_SINGLE 0 -#define LCDPANEL_ACTIVE (1<<6) /* Active or Passive */ -#define LCDPANEL_PASSIVE 0 -#define LCDPANEL_MONOCHROME (1<<7) /* depth=1 */ - - short pixel_clock_div; /* pixel clock divider */ - short ac_bias; /* AC bias pin frequency */ - - short hsync_pulse_width; /* Horizontal sync pulse width */ - short beg_line_wait; /* beginning of line wait (BLW) */ - short end_line_wait; /* end of line pxel wait (ELW) */ - - short vsync_pulse_width; /* vertical sync pulse width */ - short beg_frame_wait; /* beginning of frame wait (BFW) */ - short end_frame_wait; /* end of frame wait (EFW) */ -}; - -/* - * we need bits-per-pixel value to configure wsdisplay screen - */ -struct pxa2x0_wsscreen_descr { - struct wsscreen_descr c; /* standard descriptor */ - int depth; /* bits per pixel */ - int flags; /* rasops flags */ -}; - -void pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *, - struct pxaip_attach_args *, struct pxa2x0_wsscreen_descr *, - const struct lcd_panel_geometry *, int); -int pxa2x0_lcd_cnattach(struct pxa2x0_wsscreen_descr *, - const struct lcd_panel_geometry *, void (*)(u_int, int)); - -int pxa2x0_lcd_alloc_screen(void *, const struct wsscreen_descr *, - void **, int *, int *, long *); -void pxa2x0_lcd_free_screen(void *, void *); -int pxa2x0_lcd_ioctl(void *, u_long, caddr_t, int, struct proc *); -int pxa2x0_lcd_load_font(void *, void *, struct wsdisplay_font *); -int pxa2x0_lcd_list_font(void *, struct wsdisplay_font *); -paddr_t pxa2x0_lcd_mmap(void *, off_t, int); -int pxa2x0_lcd_show_screen(void *, void *, int, void (*)(void *, int, int), - void *); - -void pxa2x0_lcd_power(int, void *); -void pxa2x0_lcd_suspend(struct pxa2x0_lcd_softc *); -void pxa2x0_lcd_resume(struct pxa2x0_lcd_softc *); - -#endif /* _ARM_XSCALE_PXA2X0_LCD_H */ diff --git a/sys/arch/arm/xscale/pxa2x0_mmc.c b/sys/arch/arm/xscale/pxa2x0_mmc.c deleted file mode 100644 index 26c4bdd9c02..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_mmc.c +++ /dev/null @@ -1,692 +0,0 @@ -/* $OpenBSD: pxa2x0_mmc.c,v 1.13 2016/05/05 11:01:08 kettenis Exp $ */ - -/* - * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * MMC/SD/SDIO controller driver for Intel PXA27x processors - * - * Power management is beyond control of the processor's SD/SDIO/MMC - * block, so this driver depends on the attachment driver to provide - * us with some callback functions via the "tag" member in our softc. - * Bus power management calls are then dispatched to the attachment - * driver. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/systm.h> - -#include <machine/bus.h> - -#include <arch/arm/xscale/pxa2x0_gpio.h> -#include <arch/arm/xscale/pxa2x0reg.h> -#include <arch/arm/xscale/pxa2x0var.h> -#include <arch/arm/xscale/pxammcvar.h> - -#include <dev/sdmmc/sdmmcchip.h> -#include <dev/sdmmc/sdmmcreg.h> -#include <dev/sdmmc/sdmmcvar.h> - -/* GPIO pins */ -#define PXAMMC_MMCLK 32 -#define PXAMMC_MMCMD 112 -#define PXAMMC_MMDAT0 92 -#define PXAMMC_MMDAT1 109 -#define PXAMMC_MMDAT2 110 -#define PXAMMC_MMDAT3 111 - -int pxammc_host_reset(sdmmc_chipset_handle_t); -u_int32_t pxammc_host_ocr(sdmmc_chipset_handle_t); -int pxammc_host_maxblklen(sdmmc_chipset_handle_t); -int pxammc_card_detect(sdmmc_chipset_handle_t); -int pxammc_bus_power(sdmmc_chipset_handle_t, u_int32_t); -int pxammc_bus_clock(sdmmc_chipset_handle_t, int, int); -void pxammc_exec_command(sdmmc_chipset_handle_t, struct sdmmc_command *); -void pxammc_clock_stop(struct pxammc_softc *); -void pxammc_clock_start(struct pxammc_softc *); -int pxammc_card_intr(void *); -int pxammc_intr(void *); -static inline void pxammc_intr_cmd(struct pxammc_softc *); -static inline void pxammc_intr_data(struct pxammc_softc *); -void pxammc_intr_done(struct pxammc_softc *); - -#define CSR_READ_1(sc, reg) \ - bus_space_read_1((sc)->sc_iot, (sc)->sc_ioh, (reg)) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -#define CSR_READ_4(sc, reg) \ - bus_space_read_4((sc)->sc_iot, (sc)->sc_ioh, (reg)) -#define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -#define CSR_SET_4(sc, reg, bits) \ - CSR_WRITE_4((sc), (reg), CSR_READ_4((sc), (reg)) | (bits)) -#define CSR_CLR_4(sc, reg, bits) \ - CSR_WRITE_4((sc), (reg), CSR_READ_4((sc), (reg)) & ~(bits)) - -struct sdmmc_chip_functions pxammc_functions = { - /* host controller reset */ - pxammc_host_reset, - /* host controller capabilities */ - pxammc_host_ocr, - pxammc_host_maxblklen, - /* card detection */ - pxammc_card_detect, - /* bus power and clock frequency */ - pxammc_bus_power, - pxammc_bus_clock, - NULL, - /* command execution */ - pxammc_exec_command -}; - -struct cfdriver pxammc_cd = { - NULL, "pxammc", DV_DULL -}; - -#ifdef SDMMC_DEBUG -int sdhcdebug = 0; /* XXX must be named sdhcdebug for sdmmc.c */ -#define DPRINTF(n,s) do { if ((n) <= sdhcdebug) printf s; } while (0) -#else -#define DPRINTF(n,s) do {} while (0) -#endif - -int -pxammc_match(void) -{ - return (cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X; -} - -void -pxammc_attach(struct pxammc_softc *sc, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - struct sdmmcbus_attach_args saa; - int s; - - /* Enable the clocks to the MMC controller. */ - pxa2x0_clkman_config(CKEN_MMC, 1); - - sc->sc_iot = pxa->pxa_sa.sa_iot; - if (bus_space_map(sc->sc_iot, PXA2X0_MMC_BASE, PXA2X0_MMC_SIZE, 0, - &sc->sc_ioh) != 0) { - printf(": can't map regs\n"); - goto fail; - } - - /* - * Establish the card detection and MMC interrupt handlers and - * mask all interrupts until we are prepared to handle them. - */ - s = splsdmmc(); - - pxa2x0_gpio_set_function(sc->sc_gpio_detect, GPIO_IN); - sc->sc_card_ih = pxa2x0_gpio_intr_establish(sc->sc_gpio_detect, - IST_EDGE_BOTH, IPL_SDMMC, pxammc_card_intr, sc, "mmccd"); - if (sc->sc_card_ih == NULL) { - splx(s); - printf(": can't establish card interrupt\n"); - goto fail; - } - pxa2x0_gpio_intr_mask(sc->sc_card_ih); - - sc->sc_ih = pxa2x0_intr_establish(PXA2X0_INT_MMC, IPL_SDMMC, - pxammc_intr, sc, sc->sc_dev.dv_xname); - if (sc->sc_ih == NULL) { - splx(s); - printf(": can't establish MMC interrupt\n"); - goto fail; - } - CSR_WRITE_4(sc, MMC_I_MASK, 0xffffffff); - - splx(s); - - printf(": MMC/SD/SDIO controller\n"); - - /* - * Configure the GPIO pins. In SD/MMC mode, all pins except - * MMCLK are bidirectional and the direction is controlled in - * hardware without our assistence. - */ - pxa2x0_gpio_set_function(PXAMMC_MMCLK, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(PXAMMC_MMCMD, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(PXAMMC_MMDAT0, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(PXAMMC_MMDAT1, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(PXAMMC_MMDAT2, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(PXAMMC_MMDAT3, GPIO_ALT_FN_1_IN); - - /* - * Reset the host controller and unmask normal interrupts. - */ - (void)pxammc_host_reset(sc); - - /* - * Attach the generic sdmmc bus driver. - */ - bzero(&saa, sizeof saa); - saa.saa_busname = "sdmmc"; - saa.sct = &pxammc_functions; - saa.sch = sc; - saa.flags = SMF_STOP_AFTER_MULTIPLE; - saa.max_xfer = 1; - - sc->sc_sdmmc = config_found(&sc->sc_dev, &saa, NULL); - if (sc->sc_sdmmc == NULL) { - printf("%s: can't attach bus\n", sc->sc_dev.dv_xname); - goto fail; - } - - /* Enable card detection interrupt. */ - pxa2x0_gpio_intr_unmask(sc->sc_card_ih); - return; - -fail: - if (sc->sc_ih != NULL) { - pxa2x0_intr_disestablish(sc->sc_ih); - sc->sc_ih = NULL; - } - if (sc->sc_card_ih != NULL) { - pxa2x0_gpio_intr_disestablish(sc->sc_card_ih); - sc->sc_card_ih = NULL; - } - if (sc->sc_ioh != 0) { - bus_space_unmap(sc->sc_iot, sc->sc_ioh, PXA2X0_MMC_SIZE); - sc->sc_ioh = 0; - } - pxa2x0_clkman_config(CKEN_MMC, 0); -} - -int -pxammc_host_reset(sdmmc_chipset_handle_t sch) -{ - struct pxammc_softc *sc = sch; - int s = splsdmmc(); - - /* Make sure to initialize the card before the next command. */ - CLR(sc->sc_flags, PMF_CARD_INITED); - - /* Disable SPI mode (we don't support SPI). */ - CSR_WRITE_4(sc, MMC_SPI, 0); - - /* Set response timeout to maximum. */ - CSR_WRITE_4(sc, MMC_RESTO, 0x7f); - - /* Enable all interrupts. */ - CSR_WRITE_4(sc, MMC_I_MASK, 0); - - splx(s); - return 0; -} - -int -pxammc_host_maxblklen(sdmmc_chipset_handle_t sch) -{ - return 2048; -} - -u_int32_t -pxammc_host_ocr(sdmmc_chipset_handle_t sch) -{ - struct pxammc_softc *sc = sch; - - if (sc->tag.get_ocr != NULL) - return sc->tag.get_ocr(sc->tag.cookie); - - DPRINTF(0,("%s: driver lacks get_ocr() function\n", - sc->sc_dev.dv_xname)); - return ENXIO; -} - -int -pxammc_card_detect(sdmmc_chipset_handle_t sch) -{ - struct pxammc_softc *sc = sch; - return !pxa2x0_gpio_get_bit(sc->sc_gpio_detect); -} - -int -pxammc_bus_power(sdmmc_chipset_handle_t sch, u_int32_t ocr) -{ - struct pxammc_softc *sc = sch; - - /* - * Bus power management is beyond control of the SD/SDIO/MMC - * block of the PXA2xx processors, so we have to hand this - * task off to the attachment driver. - */ - if (sc->tag.set_power != NULL) - return sc->tag.set_power(sc->tag.cookie, ocr); - - DPRINTF(0,("%s: driver lacks set_power() function\n", - sc->sc_dev.dv_xname)); - return ENXIO; -} - -int -pxammc_bus_clock(sdmmc_chipset_handle_t sch, int freq, int timing) -{ - struct pxammc_softc *sc = sch; - int actfreq = 19500; /* KHz */ - int div = 0; - int s; - - s = splsdmmc(); - - /* Stop the clock and wait for the interrupt. */ - pxammc_clock_stop(sc); - - /* Just stop the clock. */ - if (freq == 0) { - splx(s); - return 0; - } - - /* - * PXA27x Errata... - * - * <snip> - * E40. SDIO: SDIO Devices Not Working at 19.5 Mbps - * - * SD/SDIO controller can only support up to 9.75 Mbps data - * transfer rate for SDIO card. - * </snip> - * - * If we don't limit the frequency, CRC errors will be - * reported by the controller after we set the bus speed. - * XXX slow down incrementally. - */ - if (freq > 9750) - freq = 9750; - - /* - * Pick the smallest divider that produces a frequency not - * more than `freq' KHz. - */ - while (div < 7) { - if (actfreq <= freq) - break; - actfreq /= 2; - div++; - } - if (div == 7) { - splx(s); - printf("%s: unsupported bus frequency of %d KHz\n", - sc->sc_dev.dv_xname, freq); - return -1; - } - - DPRINTF(1,("pxammc_bus_clock freq=%d actfreq=%d div=%d\n", - freq, actfreq, div)); - sc->sc_clkdiv = div; - pxammc_clock_start(sc); - splx(s); - return 0; -} - -void -pxammc_exec_command(sdmmc_chipset_handle_t sch, - struct sdmmc_command *cmd) -{ - struct pxammc_softc *sc = sch; - u_int32_t cmdat; - int timo; - int s; - - DPRINTF(1,("%s: cmd %u arg=%#x data=%#x dlen=%d flags=%#x " - "proc=\"%s\"\n", sc->sc_dev.dv_xname, cmd->c_opcode, - cmd->c_arg, cmd->c_data, cmd->c_datalen, cmd->c_flags, - curproc ? curproc->p_comm : "")); - - s = splsdmmc(); - - /* Stop the bus clock (MMCLK). [15.8.3] */ - pxammc_clock_stop(sc); - - /* Set the command and argument. */ - CSR_WRITE_4(sc, MMC_CMD, cmd->c_opcode); - CSR_WRITE_4(sc, MMC_ARGH, (cmd->c_arg >> 16) & 0xffff); - CSR_WRITE_4(sc, MMC_ARGL, cmd->c_arg & 0xffff); - - /* Set response characteristics for this command. */ - if (!ISSET(cmd->c_flags, SCF_RSP_PRESENT)) - cmdat = CMDAT_RESPONSE_FORMAT_NO; - else if (ISSET(cmd->c_flags, SCF_RSP_136)) - cmdat = CMDAT_RESPONSE_FORMAT_R2; - else if (!ISSET(cmd->c_flags, SCF_RSP_CRC)) - cmdat = CMDAT_RESPONSE_FORMAT_R3; - else - cmdat = CMDAT_RESPONSE_FORMAT_R1; - - if (ISSET(cmd->c_flags, SCF_RSP_BSY)) - cmdat |= CMDAT_BUSY; - - if (!ISSET(cmd->c_flags, SCF_CMD_READ)) - cmdat |= CMDAT_WRITE; - - /* Fragment the data into proper blocks. */ - if (cmd->c_datalen > 0) { - int blklen = MIN(cmd->c_datalen, cmd->c_blklen); - int numblk = cmd->c_datalen / blklen; - - if (cmd->c_datalen % blklen > 0) { - /* XXX: Split this command. (1.7.4) */ - printf("%s: data not a multiple of %d bytes\n", - sc->sc_dev.dv_xname, blklen); - cmd->c_error = EINVAL; - splx(s); - return; - } - - CSR_WRITE_4(sc, MMC_BLKLEN, blklen); - CSR_WRITE_4(sc, MMC_NUMBLK, numblk); - - /* Enable data interrupts. */ - CSR_CLR_4(sc, MMC_I_MASK, - MMC_I_RXFIFO_RD_REQ | MMC_I_TXFIFO_WR_REQ | - MMC_I_DAT_ERR); - - cmd->c_resid = cmd->c_datalen; - cmd->c_buf = cmd->c_data; - - cmdat |= CMDAT_DATA_EN; - } else { - cmd->c_resid = 0; - cmd->c_buf = NULL; - } - - /* - * "After reset, the MMC card must be initialized by sending - * 80 clocks to it on the MMCLK signal." [15.4.3.2] - */ - if (!ISSET(sc->sc_flags, PMF_CARD_INITED)) { - DPRINTF(1,("%s: first command\n", sc->sc_dev.dv_xname)); - cmdat |= CMDAT_INIT; - SET(sc->sc_flags, PMF_CARD_INITED); - } - - /* Begin the transfer and start the bus clock. */ - CSR_WRITE_4(sc, MMC_CMDAT, cmdat); - pxammc_clock_start(sc); - - /* Wait for it to complete (in no more than 2 seconds). */ - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_END_CMD_RES | MMC_I_RES_ERR); - timo = 2; - sc->sc_cmd = cmd; - do { tsleep(sc, PWAIT, "mmcmd", hz); } - while (sc->sc_cmd == cmd && timo-- > 0); - - /* If it completed in time, SCF_ITSDONE is already set. */ - if (sc->sc_cmd == cmd) { - sc->sc_cmd = NULL; - cmd->c_error = ETIMEDOUT; - SET(cmd->c_flags, SCF_ITSDONE); - } - splx(s); -} - -void -pxammc_clock_stop(struct pxammc_softc *sc) -{ - if (ISSET(CSR_READ_4(sc, MMC_STAT), STAT_CLK_EN)) { - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_CLK_IS_OFF); - CSR_WRITE_4(sc, MMC_STRPCL, STRPCL_STOP); - while (ISSET(CSR_READ_4(sc, MMC_STAT), STAT_CLK_EN)) - tsleep(sc, PWAIT, "mmclk", 0); - } -} - -void -pxammc_clock_start(struct pxammc_softc *sc) -{ - CSR_WRITE_4(sc, MMC_CLKRT, sc->sc_clkdiv); - CSR_WRITE_4(sc, MMC_STRPCL, STRPCL_START); -} - -int -pxammc_card_intr(void *arg) -{ - struct pxammc_softc *sc = arg; - - DPRINTF(1,("%s: card intr\n", sc->sc_dev.dv_xname)); - - /* Scan for inserted or removed cards. */ - sdmmc_needs_discover(sc->sc_sdmmc); - - return 1; -} - -int -pxammc_intr(void *arg) -{ - struct pxammc_softc *sc = arg; - int status; -#ifdef DIAGNOSTIC - int wstatus; -#endif - -#define MMC_I_REG_STR "\20\001DATADONE\002PRGDONE\003ENDCMDRES" \ - "\004STOPCMD\005CLKISOFF\006RXFIFO\007TXFIFO" \ - "\011DATERR\012RESERR\014SDIO" - -#ifdef DIAGNOSTIC - wstatus = -#endif - status = CSR_READ_4(sc, MMC_I_REG) & ~CSR_READ_4(sc, MMC_I_MASK); - DPRINTF(1,("%s: intr %b\n", sc->sc_dev.dv_xname, status, - MMC_I_REG_STR)); - - /* - * Notify the process waiting in pxammc_clock_stop() when - * the clock has really stopped. - */ - if (ISSET(status, MMC_I_CLK_IS_OFF)) { - DPRINTF(2,("%s: clock is now off\n", sc->sc_dev.dv_xname)); - wakeup(sc); - CSR_SET_4(sc, MMC_I_MASK, MMC_I_CLK_IS_OFF); - CLR(status, MMC_I_CLK_IS_OFF); - } - - if (sc->sc_cmd == NULL) - goto end; - - if (ISSET(status, MMC_I_RES_ERR)) { - CSR_SET_4(sc, MMC_I_MASK, MMC_I_RES_ERR); - CLR(status, MMC_I_RES_ERR | MMC_I_END_CMD_RES); - sc->sc_cmd->c_error = ENOEXEC; - pxammc_intr_done(sc); - goto end; - } - - if (ISSET(status, MMC_I_END_CMD_RES)) { - pxammc_intr_cmd(sc); - CSR_SET_4(sc, MMC_I_MASK, MMC_I_END_CMD_RES); - CLR(status, MMC_I_END_CMD_RES); - /* ignore programming done condition */ - if (ISSET(status, MMC_I_PRG_DONE)) { - CSR_SET_4(sc, MMC_I_MASK, MMC_I_PRG_DONE); - CLR(status, MMC_I_PRG_DONE); - } - if (sc->sc_cmd == NULL) - goto end; - } - - if (ISSET(status, MMC_I_DAT_ERR)) { - sc->sc_cmd->c_error = EIO; - pxammc_intr_done(sc); - CSR_SET_4(sc, MMC_I_MASK, MMC_I_DAT_ERR); - CLR(status, MMC_I_DAT_ERR); - /* ignore transmission done condition */ - if (ISSET(status, MMC_I_DATA_TRAN_DONE)) { - CSR_SET_4(sc, MMC_I_MASK, MMC_I_DATA_TRAN_DONE); - CLR(status, MMC_I_DATA_TRAN_DONE); - } - goto end; - } - - if (ISSET(status, MMC_I_DATA_TRAN_DONE)) { - pxammc_intr_done(sc); - CSR_SET_4(sc, MMC_I_MASK, MMC_I_DATA_TRAN_DONE); - CLR(status, MMC_I_DATA_TRAN_DONE); - } - - if (ISSET(status, MMC_I_TXFIFO_WR_REQ | MMC_I_RXFIFO_RD_REQ)) { - pxammc_intr_data(sc); - CLR(status, MMC_I_TXFIFO_WR_REQ | MMC_I_RXFIFO_RD_REQ); - } - -end: - /* Avoid further unhandled interrupts. */ - if (status != 0) { -#ifdef DIAGNOSTIC - printf("%s: unhandled interrupt %b out of %b\n", - sc->sc_dev.dv_xname, status, MMC_I_REG_STR, - wstatus, MMC_I_REG_STR); -#endif - CSR_SET_4(sc, MMC_I_MASK, status); - } - - return 1; -} - -static inline void -pxammc_intr_cmd(struct pxammc_softc *sc) -{ - struct sdmmc_command *cmd = sc->sc_cmd; - u_int32_t status; - int i; - -#define MMC_STAT_STR "\20\001READ_TIME_OUT\002TIMEOUT_RESPONSE" \ - "\003CRC_WRITE_ERROR\004CRC_READ_ERROR" \ - "\005SPI_READ_ERROR_TOKEN\006RES_CRC_ERR" \ - "\007XMIT_FIFO_EMPTY\010RECV_FIFO_FULL" \ - "\011CLK_EN\012FLASH_ERR\013SPI_WR_ERR" \ - "\014DATA_TRAN_DONE\015PRG_DONE\016END_CMD_RES" \ - "\017RD_STALLED\020SDIO_INT\021SDIO_SUSPEND_ACK" - -#define STAT_ERR (STAT_READ_TIME_OUT | STAT_TIMEOUT_RESPONSE | \ - STAT_CRC_WRITE_ERROR | STAT_CRC_READ_ERROR | \ - STAT_SPI_READ_ERROR_TOKEN | STAT_RES_CRC_ERR) - - if (ISSET(cmd->c_flags, SCF_RSP_136)) { - for (i = 3; i >= 0; i--) { - u_int32_t h = CSR_READ_4(sc, MMC_RES) & 0xffff; - u_int32_t l = CSR_READ_4(sc, MMC_RES) & 0xffff; - cmd->c_resp[i] = (h << 16) | l; - } - cmd->c_error = 0; - } else if (ISSET(cmd->c_flags, SCF_RSP_PRESENT)) { - /* - * Grrr... The processor manual is not clear about - * the layout of the response FIFO. It just states - * that the FIFO is 16 bits wide, has a depth of 8, - * and that the CRC is not copied into the FIFO. - * - * A 16-bit word in the FIFO is filled from highest - * to lowest bit as the response comes in. The two - * start bits and the 6 command index bits are thus - * stored in the upper 8 bits of the first 16-bit - * word that we read back from the FIFO. - * - * Since the sdmmc(4) framework expects the host - * controller to discard the first 8 bits of the - * response, what we must do is discard the upper - * byte of the first 16-bit word. - */ - u_int32_t h = CSR_READ_4(sc, MMC_RES) & 0xffff; - u_int32_t m = CSR_READ_4(sc, MMC_RES) & 0xffff; - u_int32_t l = CSR_READ_4(sc, MMC_RES) & 0xffff; - cmd->c_resp[0] = h << 24 | m << 8 | l >> 8; - for (i = 1; i < 4; i++) - cmd->c_resp[i] = 0; - cmd->c_error = 0; - } - - status = CSR_READ_4(sc, MMC_STAT); - - if (!ISSET(cmd->c_flags, SCF_RSP_PRESENT)) - status &= ~STAT_TIMEOUT_RESPONSE; - - /* XXX only for R6, not for R2 */ - if (!ISSET(cmd->c_flags, SCF_RSP_IDX)) - status &= ~STAT_RES_CRC_ERR; - - if (ISSET(status, STAT_TIMEOUT_RESPONSE)) - cmd->c_error = ETIMEDOUT; - else if (ISSET(status, STAT_ERR)) - cmd->c_error = EIO; - - if (cmd->c_error || cmd->c_datalen < 1) - pxammc_intr_done(sc); -} - -static inline void -pxammc_intr_data(struct pxammc_softc *sc) -{ - struct sdmmc_command *cmd = sc->sc_cmd; - int n; - - n = MIN(32, cmd->c_resid); - cmd->c_resid -= n; - - DPRINTF(2,("%s: cmd %p resid %d\n", sc->sc_dev.dv_xname, - cmd, cmd->c_resid)); - - if (ISSET(cmd->c_flags, SCF_CMD_READ)) { - while (n-- > 0) - *cmd->c_buf++ = CSR_READ_1(sc, MMC_RXFIFO); - - if (cmd->c_resid > 0) - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_RXFIFO_RD_REQ); - else { - CSR_SET_4(sc, MMC_I_MASK, MMC_I_RXFIFO_RD_REQ); - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_DATA_TRAN_DONE); - } - } else { - int short_xfer = (n != 0 && n != 32); - - while (n-- > 0) - CSR_WRITE_1(sc, MMC_TXFIFO, *cmd->c_buf++); - if (short_xfer) - CSR_WRITE_4(sc, MMC_PRTBUF, 1); - - if (cmd->c_resid > 0) - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_TXFIFO_WR_REQ); - else { - CSR_SET_4(sc, MMC_I_MASK, MMC_I_TXFIFO_WR_REQ); - CSR_CLR_4(sc, MMC_I_MASK, MMC_I_DATA_TRAN_DONE); - } - } -} - -/* - * Wake up the process sleeping in pxammc_exec_command(). - */ -void -pxammc_intr_done(struct pxammc_softc *sc) -{ - DPRINTF(1,("%s: status %b\n", sc->sc_dev.dv_xname, - CSR_READ_4(sc, MMC_STAT), MMC_STAT_STR)); - - CSR_SET_4(sc, MMC_I_MASK, MMC_I_TXFIFO_WR_REQ | - MMC_I_RXFIFO_RD_REQ | MMC_I_DATA_TRAN_DONE | - MMC_I_END_CMD_RES | MMC_I_RES_ERR | MMC_I_DAT_ERR); - - SET(sc->sc_cmd->c_flags, SCF_ITSDONE); - sc->sc_cmd = NULL; - wakeup(sc); -} diff --git a/sys/arch/arm/xscale/pxa2x0_mutex.c b/sys/arch/arm/xscale/pxa2x0_mutex.c deleted file mode 100644 index 6952105a8d6..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_mutex.c +++ /dev/null @@ -1,78 +0,0 @@ -/* $OpenBSD: pxa2x0_mutex.c,v 1.2 2009/08/13 13:24:55 weingart Exp $ */ - -/* - * Copyright (c) 2004 Artur Grabowski <art@openbsd.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. 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 ``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/param.h> -#include <sys/mutex.h> -#include <sys/systm.h> - -#include <machine/intr.h> - -#ifdef MULTIPROCESSOR -#error This code needs work -#endif - -/* - * Single processor systems don't need any mutexes, but they need the spl - * raising semantics of the mutexes. - */ -void -mtx_init(struct mutex *mtx, int wantipl) -{ - mtx->mtx_oldipl = 0; - mtx->mtx_wantipl = wantipl; - mtx->mtx_lock = 0; -} - -void -mtx_enter(struct mutex *mtx) -{ - if (mtx->mtx_wantipl != IPL_NONE) - mtx->mtx_oldipl = _splraise(mtx->mtx_wantipl); - - MUTEX_ASSERT_UNLOCKED(mtx); - mtx->mtx_lock = 1; -} - -int -mtx_enter_try(struct mutex *mtx) -{ - if (mtx->mtx_wantipl != IPL_NONE) - mtx->mtx_oldipl = _splraise(mtx->mtx_wantipl); - - MUTEX_ASSERT_UNLOCKED(mtx); - mtx->mtx_lock = 1; - return 1; -} - -void -mtx_leave(struct mutex *mtx) -{ - MUTEX_ASSERT_LOCKED(mtx); - mtx->mtx_lock = 0; - if (mtx->mtx_wantipl != IPL_NONE) - splx(mtx->mtx_oldipl); -} diff --git a/sys/arch/arm/xscale/pxa2x0_ohci.c b/sys/arch/arm/xscale/pxa2x0_ohci.c deleted file mode 100644 index fd9db77c406..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_ohci.c +++ /dev/null @@ -1,233 +0,0 @@ -/* $OpenBSD: pxa2x0_ohci.c,v 1.26 2014/05/19 13:11:31 mpi Exp $ */ - -/* - * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/timeout.h> - -#include <machine/intr.h> -#include <machine/bus.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbdivar.h> -#include <dev/usb/usb_mem.h> - -#include <dev/usb/ohcireg.h> -#include <dev/usb/ohcivar.h> - -int pxaohci_match(struct device *, void *, void *); -void pxaohci_attach(struct device *, struct device *, void *); -int pxaohci_detach(struct device *, int); -int pxaohci_activate(struct device *, int); - -struct pxaohci_softc { - struct ohci_softc sc; - void *sc_ih; -}; - -void pxaohci_enable(struct pxaohci_softc *); -void pxaohci_disable(struct pxaohci_softc *); - -struct cfattach pxaohci_ca = { - sizeof (struct pxaohci_softc), pxaohci_match, pxaohci_attach, - pxaohci_detach, ohci_activate -}; - -int -pxaohci_match(struct device *parent, void *match, void *aux) -{ - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) != CPU_ID_PXA27X) - return (0); - - return (1); -} - -void -pxaohci_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxaohci_softc *sc = (struct pxaohci_softc *)self; - struct pxaip_attach_args *pxa = aux; - usbd_status r; - - sc->sc.iot = pxa->pxa_iot; - sc->sc.sc_bus.dmatag = pxa->pxa_dmat; - sc->sc_ih = NULL; - sc->sc.sc_size = 0; - - /* Map I/O space */ - if (bus_space_map(sc->sc.iot, PXA2X0_USBHC_BASE, PXA2X0_USBHC_SIZE, 0, - &sc->sc.ioh)) { - printf(": cannot map mem space\n"); - return; - } - sc->sc.sc_size = PXA2X0_USBHC_SIZE; - - /* XXX copied from ohci_pci.c. needed? */ - bus_space_barrier(sc->sc.iot, sc->sc.ioh, 0, sc->sc.sc_size, - BUS_SPACE_BARRIER_READ|BUS_SPACE_BARRIER_WRITE); - - /* start the usb clock */ - pxa2x0_clkman_config(CKEN_USBHC, 1); - pxaohci_enable(sc); - - /* Disable interrupts, so we don't get any spurious ones. */ - bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE, - OHCI_MIE); - - sc->sc_ih = pxa2x0_intr_establish(PXA2X0_INT_USBH1, IPL_USB, - ohci_intr, &sc->sc, sc->sc.sc_bus.bdev.dv_xname); - if (sc->sc_ih == NULL) { - printf(": unable to establish interrupt\n"); - pxaohci_disable(sc); - pxa2x0_clkman_config(CKEN_USBHC, 0); - bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); - sc->sc.sc_size = 0; - return; - } - - strlcpy(sc->sc.sc_vendor, "PXA27x", sizeof(sc->sc.sc_vendor)); - - if (ohci_checkrev(&sc->sc) != USBD_NORMAL_COMPLETION) - goto unsupported; - - r = ohci_init(&sc->sc); - if (r != USBD_NORMAL_COMPLETION) { - printf("%s: init failed, error=%d\n", - sc->sc.sc_bus.bdev.dv_xname, r); -unsupported: - pxa2x0_intr_disestablish(sc->sc_ih); - sc->sc_ih = NULL; - pxaohci_disable(sc); - pxa2x0_clkman_config(CKEN_USBHC, 0); - bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); - sc->sc.sc_size = 0; - return; - } - - config_found(self, &sc->sc.sc_bus, usbctlprint); -} - -int -pxaohci_detach(struct device *self, int flags) -{ - struct pxaohci_softc *sc = (struct pxaohci_softc *)self; - int rv; - - rv = ohci_detach(self, flags); - if (rv) - return (rv); - - if (sc->sc_ih != NULL) { - pxa2x0_intr_disestablish(sc->sc_ih); - sc->sc_ih = NULL; - } - - pxaohci_disable(sc); - - /* stop clock */ - pxa2x0_clkman_config(CKEN_USBHC, 0); - - if (sc->sc.sc_size) { - bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size); - sc->sc.sc_size = 0; - } - - return (0); -} - - -int -pxaohci_activate(struct device *self, int act) -{ - struct pxaohci_softc *sc = (struct pxaohci_softc *)self; - - switch (act) { - case DVACT_SUSPEND: - sc->sc.sc_bus.use_polling++; - ohci_activate((struct device *)&sc->sc, act); - pxa2x0_clkman_config(CKEN_USBHC, 0); - sc->sc.sc_bus.use_polling--; - break; - case DVACT_RESUME: - sc->sc.sc_bus.use_polling++; - pxa2x0_clkman_config(CKEN_USBHC, 1); - pxaohci_enable(sc); - ohci_activate((struct device *)&sc->sc, act); - sc->sc.sc_bus.use_polling--; - break; - } - return 0; -} - -void -pxaohci_enable(struct pxaohci_softc *sc) -{ - u_int32_t hr; - - /* Full host reset */ - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) | USBHC_HR_FHR); - - DELAY(USBHC_RST_WAIT); - - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) & ~(USBHC_HR_FHR)); - - /* Force system bus interface reset */ - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) | USBHC_HR_FSBIR); - - while (bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR) & \ - USBHC_HR_FSBIR) - DELAY(3); - - /* Enable the ports (physically only one, only enable that one?) */ - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) & ~(USBHC_HR_SSE)); - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) & ~(USBHC_HR_SSEP2)); -} - -void -pxaohci_disable(struct pxaohci_softc *sc) -{ - u_int32_t hr; - - /* Full host reset */ - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) | USBHC_HR_FHR); - - DELAY(USBHC_RST_WAIT); - - hr = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USBHC_HR); - bus_space_write_4(sc->sc.iot, sc->sc.ioh, USBHC_HR, - (hr & USBHC_HR_MASK) & ~(USBHC_HR_FHR)); -} diff --git a/sys/arch/arm/xscale/pxa2x0_pcic.c b/sys/arch/arm/xscale/pxa2x0_pcic.c deleted file mode 100644 index 530720f0c45..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_pcic.c +++ /dev/null @@ -1,515 +0,0 @@ -/* $OpenBSD: pxa2x0_pcic.c,v 1.20 2014/04/03 10:17:34 mpi Exp $ */ - -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/kthread.h> -#include <sys/malloc.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> -#include <machine/intr.h> - -#include <dev/pcmcia/pcmciareg.h> -#include <dev/pcmcia/pcmciavar.h> -#include <dev/pcmcia/pcmciachip.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> -#include <arm/xscale/pxapcicvar.h> - -int pxapcic_print(void *, const char *); -int pxapcic_submatch(struct device *, void *, void *); - -void pxapcic_create_event_thread(void *); -void pxapcic_event_thread(void *); -void pxapcic_event_process(struct pxapcic_socket *); -void pxapcic_attach_card(struct pxapcic_socket *); -void pxapcic_detach_card(struct pxapcic_socket *, int); -int pxapcic_intr(void *); - -int pxapcic_mem_alloc(pcmcia_chipset_handle_t, bus_size_t, - struct pcmcia_mem_handle *); -void pxapcic_mem_free(pcmcia_chipset_handle_t, - struct pcmcia_mem_handle *); -int pxapcic_mem_map(pcmcia_chipset_handle_t, int, bus_addr_t, - bus_size_t, struct pcmcia_mem_handle *, bus_size_t *, int *); -void pxapcic_mem_unmap(pcmcia_chipset_handle_t, int); - -int pxapcic_io_alloc(pcmcia_chipset_handle_t, bus_addr_t, - bus_size_t, bus_size_t, struct pcmcia_io_handle *); -void pxapcic_io_free(pcmcia_chipset_handle_t, - struct pcmcia_io_handle *); -int pxapcic_io_map(pcmcia_chipset_handle_t, int, - bus_addr_t, bus_size_t, struct pcmcia_io_handle *, int *); -void pxapcic_io_unmap(pcmcia_chipset_handle_t, int); - -void *pxapcic_intr_establish(pcmcia_chipset_handle_t, - struct pcmcia_function *, int, int (*)(void *), void *, char *); -void pxapcic_intr_disestablish(pcmcia_chipset_handle_t, void *); -const char *pxapcic_intr_string(pcmcia_chipset_handle_t, void *); - -void pxapcic_socket_setup(struct pxapcic_socket *); -void pxapcic_socket_enable(pcmcia_chipset_handle_t); -void pxapcic_socket_disable(pcmcia_chipset_handle_t); - -struct cfdriver pxapcic_cd = { - NULL, "pxapcic", DV_DULL -}; - -/* - * PCMCIA chipset methods - */ -struct pcmcia_chip_functions pxapcic_pcmcia_functions = { - pxapcic_mem_alloc, - pxapcic_mem_free, - pxapcic_mem_map, - pxapcic_mem_unmap, - - pxapcic_io_alloc, - pxapcic_io_free, - pxapcic_io_map, - pxapcic_io_unmap, - - pxapcic_intr_establish, - pxapcic_intr_disestablish, - pxapcic_intr_string, - - pxapcic_socket_enable, - pxapcic_socket_disable, -}; - -/* - * PCMCIA Helpers - */ - -int -pxapcic_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size, - struct pcmcia_mem_handle *pmh) -{ - struct pxapcic_socket *so = pch; - - /* All we need is the bus space tag */ - memset(pmh, 0, sizeof(*pmh)); - pmh->memt = so->sc->sc_iot; - return (0); -} - -void -pxapcic_mem_free(pcmcia_chipset_handle_t pch, struct pcmcia_mem_handle *pmh) -{ -} - -int -pxapcic_mem_map(pcmcia_chipset_handle_t pch, int kind, bus_addr_t card_addr, - bus_size_t size, struct pcmcia_mem_handle *pmh, bus_size_t *offsetp, - int *windowp) -{ - struct pxapcic_socket *so = pch; - int error; - bus_addr_t pa; - - pa = trunc_page(card_addr); - *offsetp = card_addr - pa; - size = round_page(card_addr + size) - pa; - pmh->realsize = size; - -#define PXA2X0_SOCKET_OFFSET (PXA2X0_PCMCIA_SLOT1-PXA2X0_PCMCIA_SLOT0) -#define PXAPCIC_ATTR_OFFSET 0x08000000 -#define PXAPCIC_COMMON_OFFSET 0x0C000000 - - pa += PXA2X0_PCMCIA_SLOT0; - pa += PXA2X0_SOCKET_OFFSET * so->socket; - - switch (kind & ~PCMCIA_WIDTH_MEM_MASK) { - case PCMCIA_MEM_ATTR: - pa += PXAPCIC_ATTR_OFFSET; - break; - case PCMCIA_MEM_COMMON: - pa += PXAPCIC_COMMON_OFFSET; - break; - default: - panic("pxapcic_mem_map: bogus kind"); - } - - error = bus_space_map(so->sc->sc_iot, pa, size, 0, &pmh->memh); - if (! error) - *windowp = (int)pmh->memh; - return (error); -} - -void -pxapcic_mem_unmap(pcmcia_chipset_handle_t pch, int window) -{ - struct pxapcic_socket *so = pch; - - bus_space_unmap(so->sc->sc_iot, (bus_addr_t)window, 4096); /* XXX */ -} - -int -pxapcic_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start, - bus_size_t size, bus_size_t align, struct pcmcia_io_handle *pih) -{ - struct pxapcic_socket *so = pch; - int error; - bus_addr_t pa; - - memset(pih, 0, sizeof(*pih)); - pih->iot = so->sc->sc_iot; - pih->addr = start; - pih->size = size; - - pa = pih->addr; - pa += PXA2X0_PCMCIA_SLOT0; - pa += PXA2X0_SOCKET_OFFSET * so->socket; - -#if 0 - printf("pxapcic_io_alloc: %x %x\n", (unsigned int)pa, - (unsigned int)size); -#endif - /* XXX Are we ignoring alignment constraints? */ - error = bus_space_map(so->sc->sc_iot, pa, size, 0, &pih->ioh); - - return (error); -} - -void -pxapcic_io_free(pcmcia_chipset_handle_t pch, struct pcmcia_io_handle *pih) -{ - struct pxapcic_socket *so = pch; - - bus_space_unmap(so->sc->sc_iot, pih->ioh, pih->size); -} - -int -pxapcic_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset, - bus_size_t size, struct pcmcia_io_handle *pih, int *windowp) -{ - return (0); -} - -void pxapcic_io_unmap(pcmcia_chipset_handle_t pch, int window) -{ -} - -void * -pxapcic_intr_establish(pcmcia_chipset_handle_t pch, - struct pcmcia_function *pf, int ipl, int (*fct)(void *), void *arg, - char *name) -{ - struct pxapcic_socket *so = pch; - /* XXX need to check if something should be done here */ - - return (pxa2x0_gpio_intr_establish(so->irqpin, IST_EDGE_FALLING, - ipl, fct, arg, name)); -} - -void -pxapcic_intr_disestablish(pcmcia_chipset_handle_t pch, void *ih) -{ - pxa2x0_gpio_intr_disestablish(ih); -} - -const char * -pxapcic_intr_string(pcmcia_chipset_handle_t pch, void *ih) -{ - return (pxa2x0_gpio_intr_string(ih)); -} - -void -pxapcic_socket_enable(pcmcia_chipset_handle_t pch) -{ - struct pxapcic_socket *so = pch; - int i; - - /* Power down the card and socket before setting the voltage. */ - so->pcictag->write(so, PXAPCIC_CARD_POWER, PXAPCIC_POWER_OFF); - so->pcictag->set_power(so, PXAPCIC_POWER_OFF); - - /* - * Wait 300ms until power fails (Tpf). Then, wait 100ms since - * we are changing Vcc (Toff). - */ - delay((300 + 100) * 1000); - - /* Power up the socket and card at appropriate voltage. */ - if (so->power_capability & PXAPCIC_POWER_5V) { - so->pcictag->set_power(so, PXAPCIC_POWER_5V); - so->pcictag->write(so, PXAPCIC_CARD_POWER, - PXAPCIC_POWER_5V); - } else { - so->pcictag->set_power(so, PXAPCIC_POWER_3V); - so->pcictag->write(so, PXAPCIC_CARD_POWER, - PXAPCIC_POWER_3V); - } - - /* - * Wait 100ms until power raise (Tpr) and 20ms to become - * stable (Tsu(Vcc)). - * - * Some machines require some more time to be settled - * (another 200ms is added here). - */ - delay((100 + 20 + 200) * 1000); - - /* Hold RESET at least 10us. */ - so->pcictag->write(so, PXAPCIC_CARD_RESET, 1); - delay(10); - /* XXX wrong, but lets TE-CF100 cards work for some reason. */ - delay(3000); - so->pcictag->write(so, PXAPCIC_CARD_RESET, 0); - - /* Wait 20ms as per PC Card standard (r2.01) section 4.3.6. */ - delay(20000); - - /* Wait for the card to become ready. */ - for (i = 0; i < 10000; i++) { - if (so->pcictag->read(so, PXAPCIC_CARD_READY)) - break; - delay(500); -#ifdef PCICDEBUG - if ((i>5000) && (i%100 == 99)) - printf("."); -#endif - } -} - -void -pxapcic_socket_disable(pcmcia_chipset_handle_t pch) -{ - struct pxapcic_socket *so = pch; - -#ifdef PCICDEBUG - printf("pxapcic_socket_disable: socket %d\n", so->socket); -#endif - - /* Power down the card and socket. */ - so->pcictag->write(so, PXAPCIC_CARD_POWER, PXAPCIC_POWER_OFF); - so->pcictag->set_power(so, PXAPCIC_POWER_OFF); -} - -/* - * Attachment and initialization - */ - -int -pxapcic_print(void *aux, const char *name) -{ - return (UNCONF); -} - -int -pxapcic_submatch(struct device *parent, void *match, void *aux) -{ - struct cfdata *cf = match; - - return ((*cf->cf_attach->ca_match)(parent, cf, aux)); -} - -void -pxapcic_attach(struct pxapcic_softc *sc, - void (*socket_setup_hook)(struct pxapcic_socket *)) -{ - struct pcmciabus_attach_args paa; - struct pxapcic_socket *so; - int i; - - printf(": %d slot%s\n", sc->sc_nslots, sc->sc_nslots==1 ? "" : "s"); - - if (bus_space_map(sc->sc_iot, PXA2X0_MEMCTL_BASE, PXA2X0_MEMCTL_SIZE, - 0, &sc->sc_memctl_ioh)) { - printf("%s: failed to map MEMCTL\n", sc->sc_dev.dv_xname); - return; - } - - /* Clear CIT (card present) and set NOS correctly. */ - bus_space_write_4(sc->sc_iot, sc->sc_memctl_ioh, MEMCTL_MECR, - sc->sc_nslots == 2 ? MECR_NOS : 0); - - /* zaurus: configure slot 1 first to make internal drive be wd0. */ - for (i = sc->sc_nslots-1; i >= 0; i--) { - so = &sc->sc_socket[i]; - so->sc = sc; - so->socket = i; - so->flags = 0; - - socket_setup_hook(so); - - paa.paa_busname = "pcmcia"; - paa.pct = (pcmcia_chipset_tag_t)&pxapcic_pcmcia_functions; - paa.pch = (pcmcia_chipset_handle_t)so; - paa.iobase = 0; - paa.iosize = 0x4000000; - - so->pcmcia = config_found_sm(&sc->sc_dev, &paa, - pxapcic_print, pxapcic_submatch); - - pxa2x0_gpio_set_function(sc->sc_irqpin[i], GPIO_IN); - pxa2x0_gpio_set_function(sc->sc_irqcfpin[i], GPIO_IN); - - /* Card slot interrupt */ - so->irq = pxa2x0_gpio_intr_establish(sc->sc_irqcfpin[i], - IST_EDGE_BOTH, IPL_BIO /* XXX */, pxapcic_intr, so, - sc->sc_dev.dv_xname); - - /* GPIO pin for interrupt */ - so->irqpin = sc->sc_irqpin[i]; - -#ifdef DO_CONFIG_PENDING - config_pending_incr(); -#endif - kthread_create_deferred(pxapcic_create_event_thread, so); - } -} - -/* - * Card slot interrupt handling - */ - -int -pxapcic_intr(void *arg) -{ - struct pxapcic_socket *so = arg; - - so->pcictag->clear_intr(so); - wakeup(so); - return (1); -} - -/* - * Event management - */ - -void -pxapcic_create_event_thread(void *arg) -{ - struct pxapcic_socket *sock = arg; - struct pxapcic_softc *sc = sock->sc; - char name[MAXCOMLEN+1]; - u_int cs; - - /* If there's a card there, attach it. */ - cs = sock->pcictag->read(sock, PXAPCIC_CARD_STATUS); - if (cs == PXAPCIC_CARD_VALID) - pxapcic_attach_card(sock); - - snprintf(name, sizeof name, "%s-%d", sc->sc_dev.dv_xname, sock->socket); - if (kthread_create(pxapcic_event_thread, sock, &sock->event_thread, - name)) - printf("%s: unable to create event thread for %s\n", - sc->sc_dev.dv_xname, sock->socket ? "1" : "0"); -#ifdef DO_CONFIG_PENDING - config_pending_decr(); -#endif -} - -void -pxapcic_event_thread(void *arg) -{ - struct pxapcic_socket *sock = arg; - u_int cs; - int present; - - while (sock->sc->sc_shutdown == 0) { - - (void) tsleep(sock, PWAIT, "pxapcicev", 0); - - /* sleep .25s to avoid chattering interrupts */ - (void) tsleep((caddr_t)sock, PWAIT, - "pxapcicss", hz/4); - - cs = sock->pcictag->read(sock, PXAPCIC_CARD_STATUS); - - present = sock->flags & PXAPCIC_FLAG_CARDP; - - if ((cs == PXAPCIC_CARD_VALID) == (present == 1)) - continue; /* state unchanged */ - - /* XXX Do both? */ - pxapcic_event_process(sock); - } - - sock->event_thread = NULL; - - /* In case parent is waiting for us to exit. */ - wakeup(sock->sc); - - kthread_exit(0); -} - -void -pxapcic_event_process(struct pxapcic_socket *sock) -{ - u_int cs; - - cs = sock->pcictag->read(sock, PXAPCIC_CARD_STATUS); - - if (cs == PXAPCIC_CARD_VALID) { - if (!(sock->flags & PXAPCIC_FLAG_CARDP)) - pxapcic_attach_card(sock); - } else { - if ((sock->flags & PXAPCIC_FLAG_CARDP)) - pxapcic_detach_card(sock, DETACH_FORCE); - } -} - -void -pxapcic_attach_card(struct pxapcic_socket *h) -{ - struct pxapcic_softc *sc = h->sc; - u_int32_t rv; - - if (h->flags & PXAPCIC_FLAG_CARDP) - panic("pcic_attach_card: already attached"); - h->flags |= PXAPCIC_FLAG_CARDP; - - /* Set CIT if any card is present. */ - rv = bus_space_read_4(sc->sc_iot, sc->sc_memctl_ioh, MEMCTL_MECR); - bus_space_write_4(sc->sc_iot, sc->sc_memctl_ioh, MEMCTL_MECR, - rv | MECR_CIT); - - /* call the MI attach function */ - pcmcia_card_attach(h->pcmcia); -} - -void -pxapcic_detach_card(struct pxapcic_socket *h, int flags) -{ - struct pxapcic_softc *sc = h->sc; - u_int32_t rv; - int i; - - if (h->flags & PXAPCIC_FLAG_CARDP) { - h->flags &= ~PXAPCIC_FLAG_CARDP; - - /* call the MI detach function */ - pcmcia_card_detach(h->pcmcia, flags); - } - - /* Clear CIT if no other card is present. */ - for (i = 0; i < sc->sc_nslots; i++) - if (sc->sc_socket[i].flags & PXAPCIC_FLAG_CARDP) - return; - rv = bus_space_read_4(sc->sc_iot, sc->sc_memctl_ioh, MEMCTL_MECR); - bus_space_write_4(sc->sc_iot, sc->sc_memctl_ioh, MEMCTL_MECR, - rv & ~MECR_CIT); -} diff --git a/sys/arch/arm/xscale/pxa2x0_space.c b/sys/arch/arm/xscale/pxa2x0_space.c deleted file mode 100644 index f7c3aae7ad3..00000000000 --- a/sys/arch/arm/xscale/pxa2x0_space.c +++ /dev/null @@ -1,263 +0,0 @@ -/* $OpenBSD: pxa2x0_space.c,v 1.5 2014/11/16 12:30:56 deraadt Exp $ */ -/* $NetBSD: pxa2x0_space.c,v 1.5 2004/06/07 19:45:22 nathanw Exp $ */ - -/* - * Copyright (c) 2001, 2002 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ -/* - * Copyright (c) 1997 Mark Brinicombe. - * Copyright (c) 1997 Causality Limited. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Ichiro FUKUHARA. - * - * 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 Mark Brinicombe. - * 4. The name of the company nor the name of the author may 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 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. - */ - -/* - * bus_space functions for Intel PXA2[51]0 application processor. - * Derived from i80321_space.c. - */ - -#include <sys/param.h> -#include <sys/systm.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bus.h> - -/* Prototypes for all the bus_space structure functions */ -bs_protos(pxa2x0); -bs_protos(generic); -bs_protos(generic_armv4); -bs_protos(bs_notimpl); - -struct bus_space pxa2x0_bs_tag = { - /* cookie */ - (void *) 0, - - /* mapping/unmapping */ - pxa2x0_bs_map, - pxa2x0_bs_unmap, - pxa2x0_bs_subregion, - - /* allocation/deallocation */ - pxa2x0_bs_alloc, /* not implemented */ - pxa2x0_bs_free, /* not implemented */ - - /* get kernel virtual address */ - pxa2x0_bs_vaddr, - - /* mmap */ - bs_notimpl_bs_mmap, - - /* barrier */ - pxa2x0_bs_barrier, - - /* read (single) */ - generic_bs_r_1, - generic_armv4_bs_r_2, - generic_bs_r_4, - bs_notimpl_bs_r_8, - - /* read multiple */ - generic_bs_rm_1, - generic_armv4_bs_rm_2, - generic_bs_rm_4, - bs_notimpl_bs_rm_8, - - /* read region */ - generic_bs_rr_1, - generic_armv4_bs_rr_2, - generic_bs_rr_4, - bs_notimpl_bs_rr_8, - - /* write (single) */ - generic_bs_w_1, - generic_armv4_bs_w_2, - generic_bs_w_4, - bs_notimpl_bs_w_8, - - /* write multiple */ - generic_bs_wm_1, - generic_armv4_bs_wm_2, - generic_bs_wm_4, - bs_notimpl_bs_wm_8, - - /* write region */ - generic_bs_wr_1, - generic_armv4_bs_wr_2, - generic_bs_wr_4, - bs_notimpl_bs_wr_8, - - /* set multiple */ - bs_notimpl_bs_sm_1, - bs_notimpl_bs_sm_2, - bs_notimpl_bs_sm_4, - bs_notimpl_bs_sm_8, - - /* set region */ - generic_bs_sr_1, - generic_armv4_bs_sr_2, - bs_notimpl_bs_sr_4, - bs_notimpl_bs_sr_8, - - /* copy */ - bs_notimpl_bs_c_1, - generic_armv4_bs_c_2, - bs_notimpl_bs_c_4, - bs_notimpl_bs_c_8, -}; - -int -pxa2x0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, - int flag, bus_space_handle_t *bshp) -{ - u_long startpa, endpa, pa; - vaddr_t va; - pt_entry_t *pte; - - if ((u_long)bpa > (u_long)KERNEL_BASE) { - /* Some IO registers (ex. UART ports for console) - are mapped to fixed address by board specific - routine. */ - *bshp = bpa; - return(0); - } - - startpa = trunc_page(bpa); - endpa = round_page(bpa + size); - - /* XXX use extent manager to check duplicate mapping */ - - va = uvm_km_valloc(kernel_map, endpa - startpa); - if (! va) - return(ENOMEM); - - *bshp = (bus_space_handle_t)(va + (bpa - startpa)); - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter_pa(va, pa, PROT_READ | PROT_WRITE); - if ((flag & BUS_SPACE_MAP_CACHEABLE) == 0) { - pte = vtopte(va); - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - /* XXX: pmap_kenter_pa() also does PTE_SYNC(). a bit of - * waste. - */ - } - } - pmap_update(pmap_kernel()); - - return(0); -} - -void -pxa2x0_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - - if (bsh > (u_long)KERNEL_BASE) - return; - - uvm_km_free(kernel_map, bsh, size); -} - - -int -pxa2x0_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t *nbshp) -{ - - *nbshp = bsh + offset; - return (0); -} - -void -pxa2x0_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} - -void * -pxa2x0_bs_vaddr(void *t, bus_space_handle_t bsh) -{ - - return ((void *)bsh); -} - - -int -pxa2x0_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, - bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, - bus_addr_t *bpap, bus_space_handle_t *bshp) -{ - - panic("pxa2x0_io_bs_alloc(): not implemented"); -} - -void -pxa2x0_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - - panic("pxa2x0_io_bs_free(): not implemented"); -} - diff --git a/sys/arch/arm/xscale/pxa2x0reg.h b/sys/arch/arm/xscale/pxa2x0reg.h deleted file mode 100644 index 9595049f156..00000000000 --- a/sys/arch/arm/xscale/pxa2x0reg.h +++ /dev/null @@ -1,895 +0,0 @@ -/* $OpenBSD: pxa2x0reg.h,v 1.31 2009/09/09 12:14:39 marex Exp $ */ -/* $NetBSD: pxa2x0reg.h,v 1.4 2003/06/11 20:43:01 scw Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - - -/* - * Intel PXA2[15]0 processor is XScale based integrated CPU - * - * Reference: - * Intel(r) PXA250 and PXA210 Application Processors - * Developer's Manual - * (278522-001.pdf) - * - * Intel PXA 27x Processor Family Developers Manual (280000-002) - */ -#ifndef _ARM_XSCALE_PXA2X0REG_H_ -#define _ARM_XSCALE_PXA2X0REG_H_ - -/* Borrow some register definitions from sa11x0 */ -#include <arm/sa11x0/sa11x0_reg.h> - -#ifndef _LOCORE -#include <sys/types.h> /* for uint32_t */ -#endif - -/* - * Chip select domains - */ -#define PXA2X0_CS0_START 0x00000000 -#define PXA2X0_CS1_START 0x04000000 -#define PXA2X0_CS2_START 0x08000000 -#define PXA2X0_CS3_START 0x0c000000 -#define PXA2X0_CS4_START 0x10000000 -#define PXA2X0_CS5_START 0x14000000 - -#define PXA2X0_PCMCIA_SLOT0 0x20000000 -#define PXA2X0_PCMCIA_SLOT1 0x30000000 - -#define PXA2X0_PERIPH_START 0x40000000 -/* #define PXA2X0_MEMCTL_START 0x48000000 */ -#define PXA2X0_PERIPH_END 0x480fffff - -#define PXA2X0_SDRAM0_START 0xa0000000 -#define PXA2X0_SDRAM1_START 0xa4000000 -#define PXA2X0_SDRAM2_START 0xa8000000 -#define PXA2X0_SDRAM3_START 0xac000000 -#define PXA2X0_SDRAM_BANKS 4 -#define PXA2X0_SDRAM_BANK_SIZE 0x04000000 - -/* - * Physical address of integrated peripherals - */ - -#define PXA2X0_DMAC_BASE 0x40000000 -#define PXA2X0_DMAC_SIZE 0x300 -#define PXA27X_DMAC_SIZE 0x0400 -#define PXA2X0_FFUART_BASE 0x40100000 /* Full Function UART */ -#define PXA2X0_BTUART_BASE 0x40200000 /* Bluetooth UART */ -#define PXA2X0_I2C_BASE 0x40300000 /* I2C Bus Interface Unit */ -#define PXA2X0_I2C_SIZE 0x16a4 -#define PXA2X0_I2S_BASE 0x40400000 /* Inter-IC Sound Controller */ -#define PXA2X0_I2S_SIZE 0x0084 -#define PXA2X0_AC97_BASE 0x40500000 /* AC '97 Controller */ -#define PXA2X0_AC97_SIZE 0x0600 -#define PXA2X0_USBDC_BASE 0x40600000 /* USB Client Controller */ -#define PXA2X0_USBDC_SIZE 0x0460 -#define PXA2X0_STUART_BASE 0x40700000 /* Standard UART */ -#define PXA2X0_ICP_BASE 0x40800000 -#define PXA2X0_RTC_BASE 0x40900000 -#define PXA2X0_RTC_SIZE 0x10 -#define PXA2X0_OST_BASE 0x40a00000 /* OS Timer */ -#define PXA2X0_OST_SIZE 0x24 -#define PXA2X0_PWM0_BASE 0x40b00000 -#define PXA2X0_PWM1_BASE 0x40c00000 -#define PXA2X0_INTCTL_BASE 0x40d00000 /* Interrupt controller */ -#define PXA2X0_INTCTL_SIZE 0x20 -#define PXA2X0_GPIO_BASE 0x40e00000 -#define PXA2X0_GPIO_SIZE 0x70 -#define PXA2X0_POWMAN_BASE 0x40f00000 /* Power management */ -#define PXA2X0_POWMAN_SIZE 0x1a4 /* incl. PI2C unit */ -#define PXA2X0_SSP_BASE 0x41000000 /* SSP serial port */ -#define PXA2X0_SSP1_BASE 0x41700000 /* PXA270 */ -#define PXA2X0_SSP2_BASE 0x41900000 /* PXA270 */ -#define PXA2X0_SSP_SIZE 0x40 -#define PXA2X0_MMC_BASE 0x41100000 /* MultiMediaCard/SD/SDIO */ -#define PXA2X0_MMC_SIZE 0x50 -#define PXA2X0_CLKMAN_BASE 0x41300000 /* Clock Manager */ -#define PXA2X0_CLKMAN_SIZE 12 -#define PXA2X0_LCDC_BASE 0x44000000 /* LCD Controller */ -#define PXA2X0_LCDC_SIZE 0x220 -#define PXA2X0_MEMCTL_BASE 0x48000000 /* Memory Controller */ -#define PXA2X0_MEMCTL_SIZE 0x84 -#define PXA2X0_USBHC_BASE 0x4c000000 /* USB Host Controller */ -#define PXA2X0_USBHC_SIZE 0x70 -#define PXA2X0_KPC_BASE 0x41500000 /* Keypad Controller */ -#define PXA2X0_KPC_SIZE 0x50 - -/* width of interrupt controller */ -#define ICU_LEN 32 /* but some are not used */ -#define ICU_INT_HWMASK 0xffffff0f -#define PXA2X0_IRQ_MIN 1 - -/* - * [0..1,15..16] are used as soft intrs by SI_TO_IRQBIT, - * and [4..6] are not likely to be used by us. - */ -#define PXA2X0_INT_USBH2 2 /* USB host (all other events) */ -#define PXA2X0_INT_USBH1 3 /* USB host (OHCI) */ -#define PXA2X0_INT_KPC 4 -#define PXA2X0_INT_OST 7 /* OS timers */ -#define PXA2X0_INT_GPIO0 8 -#define PXA2X0_INT_GPIO1 9 -#define PXA2X0_INT_GPION 10 /* IRQ from GPIO[2..80] */ -#define PXA2X0_INT_USB 11 -#define PXA2X0_INT_PMU 12 -#define PXA2X0_INT_I2S 13 -#define PXA2X0_INT_AC97 14 -#define PXA2X0_INT_LCD 17 -#define PXA2X0_INT_I2C 18 -#define PXA2X0_INT_ICP 19 -#define PXA2X0_INT_STUART 20 -#define PXA2X0_INT_BTUART 21 -#define PXA2X0_INT_FFUART 22 -#define PXA2X0_INT_MMC 23 -#define PXA2X0_INT_SSP 24 -#define PXA2X0_INT_DMA 25 -#define PXA2X0_INT_OST0 26 -#define PXA2X0_INT_OST1 27 -#define PXA2X0_INT_OST2 28 -#define PXA2X0_INT_OST3 29 -#define PXA2X0_INT_RTCHZ 30 -#define PXA2X0_INT_ALARM 31 /* RTC Alarm interrupt */ - -/* Interrupt Controller similar to SA11x0's, but not exactly the same. */ -#define INTCTL_ICIP 0x00 -#define INTCTL_ICMR 0x04 -#define INTCTL_ICLR 0x08 -#define INTCTL_ICFP 0x0c -#define INTCTL_ICPR 0x10 -#define INTCTL_ICCR 0x14 -#define ICCR_DIM (1<<0) - -/* DMAC */ -#define DMAC_N_CHANNELS 16 -#define DMAC_N_CHANNELS_PXA27X 32 -#define DMAC_N_PRIORITIES 3 -#define DMAC_N_PRIORITIES_PXA27X 4 - -#define DMAC_DCSR(n) ((n)*4) -#define DCSR_BUSERRINTR (1<<0) /* bus error interrupt */ -#define DCSR_STARTINR (1<<1) /* start interrupt */ -#define DCSR_ENDINTR (1<<2) /* end interrupt */ -#define DCSR_STOPSTATE (1<<3) /* channel is not running */ -#define DCSR_REQPEND (1<<8) /* request pending */ -#define DCSR_STOPIRQEN (1<<29) /* stop interrupt enable */ -#define DCSR_NODESCFETCH (1<<30) /* no-descriptor fetch mode */ -#define DCSR_RUN (1<<31) -#define DMAC_DINT 0x00f0 /* DMA interrupt */ -#define DMAC_DINT_MASK 0xffffu -#define DMAC_DRCMR(n) (0x100+(n)*4) /* Channel map register */ -#define DRCMR_CHLNUM 0x0f /* channel number */ -#define DRCMR_MAPVLD (1<<7) /* map valid */ -#define DMAC_DDADR(n) (0x0200+(n)*16) -#define DDADR_STOP (1<<0) -#define DMAC_DSADR(n) (0x0204+(n)*16) -#define DMAC_DTADR(n) (0x0208+(n)*16) -#define DMAC_DCMD(n) (0x020c+(n)*16) -#define DCMD_LENGTH_MASK 0x1fff -#define DCMD_WIDTH_SHIFT 14 -#define DCMD_WIDTH_0 (0<<DCMD_WIDTH_SHIFT) /* for mem-to-mem transfer*/ -#define DCMD_WIDTH_1 (1<<DCMD_WIDTH_SHIFT) -#define DCMD_WIDTH_2 (2<<DCMD_WIDTH_SHIFT) -#define DCMD_WIDTH_4 (3<<DCMD_WIDTH_SHIFT) -#define DCMD_SIZE_SHIFT 16 -#define DCMD_SIZE_8 (1<<DCMD_SIZE_SHIFT) -#define DCMD_SIZE_16 (2<<DCMD_SIZE_SHIFT) -#define DCMD_SIZE_32 (3<<DCMD_SIZE_SHIFT) -#define DCMD_LITTLE_ENDIAN (0<<18) -#define DCMD_ENDIRQEN (1<<21) -#define DCMD_STARTIRQEN (1<<22) -#define DCMD_FLOWTRG (1<<28) /* flow control by target */ -#define DCMD_FLOWSRC (1<<29) /* flow control by source */ -#define DCMD_INCTRGADDR (1<<30) /* increment target address */ -#define DCMD_INCSRCADDR (1<<31) /* increment source address */ - -#ifndef __ASSEMBLER__ -/* DMA descriptor */ -struct pxa2x0_dma_desc { - volatile uint32_t dd_ddadr; -#define DMAC_DESC_LAST 0x1 - volatile uint32_t dd_dsadr; - volatile uint32_t dd_dtadr; - volatile uint32_t dd_dcmd; /* command and length */ -}; -#endif - -/* UART */ -#define PXA2X0_COM_FREQ 14745600L - -/* I2C */ -#define I2C_IBMR 0x1680 /* Bus monitor register */ -#define I2C_IDBR 0x1688 /* Data buffer */ -#define I2C_ICR 0x1690 /* Control register */ -#define ICR_START (1<<0) -#define ICR_STOP (1<<1) -#define ICR_ACKNAK (1<<2) -#define ICR_TB (1<<3) -#define ICR_MA (1<<4) -#define ICR_SCLE (1<<5) /* PXA270? */ -#define ICR_IUE (1<<6) /* PXA270? */ -#define ICR_UR (1<<14) /* PXA270? */ -#define ICR_FM (1<<15) /* PXA270? */ -#define I2C_ISR 0x1698 /* Status register */ -#define ISR_ACKNAK (1<<1) -#define ISR_ITE (1<<6) -#define ISR_IRF (1<<7) -#define I2C_ISAR 0x16a0 /* Slave address */ - -/* Power Manager */ -#define POWMAN_PMCR 0x00 -#define POWMAN_PSSR 0x04 /* Sleep Status register */ -#define PSSR_SSS (1<<0) /* Software Sleep Status */ -#define PSSR_BFS (1<<1) /* Battery Fault Status */ -#define PSSR_VFS (1<<2) /* VCC Fault Status */ -#define PSSR_STS (1<<3) /* Standby Mode Status */ -#define PSSR_PH (1<<4) /* Peripheral Control Hold */ -#define PSSR_RDH (1<<5) /* Read Disable Hold */ -#define PSSR_OTGPH (1<<6) /* OTG Peripheral Control Hold */ -#define POWMAN_PSPR 0x08 -#define POWMAN_PWER 0x0c -#define POWMAN_PRER 0x10 -#define POWMAN_PFER 0x14 -#define POWMAN_PEDR 0x18 -#define POWMAN_PCFR 0x1c /* General Configuration register */ -#define PCFR_OPDE (1<<0) -#define PCFR_GPR_EN (1<<4) /* PXA270 */ -#define PCFR_PI2C_EN (1<<6) /* PXA270 */ -#define PCFR_GP_ROD (1<<8) /* PXA270 */ -#define PCFR_FVC (1<<10) /* PXA270 */ -#define POWMAN_PGSR0 0x20 /* GPIO Sleep State register */ -#define POWMAN_PGSR1 0x24 -#define POWMAN_PGSR2 0x28 -#define POWMAN_PGSR3 0x2c /* PXA270 */ -#define POWMAN_RCSR 0x30 /* Reset Controller Status register */ -#define RCSR_HWR (1<<0) -#define RCSR_WDR (1<<1) -#define RCSR_SMR (1<<2) -#define RCSR_GPR (1<<3) -#define POWMAN_PSLR 0x34 /* PXA270 */ -#define POWMAN_PKWR 0x50 /* PXA270 */ -#define POWMAN_PKSR 0x54 /* PXA270 */ - -/* Power Manager I2C unit */ -#define POWMAN_PIDBR 0x188 -#define POWMAN_PICR 0x190 -#define PICR_START ICR_START -#define PICR_STOP ICR_STOP -#define PICR_ACKNAK ICR_ACKNAK -#define PICR_TB ICR_TB -#define PICR_SCLE (1<<5) /* PXA270? */ -#define PICR_IUE (1<<6) /* PXA270? */ -#define PICR_UR (1<<14) /* PXA270? */ -#define POWMAN_PISR 0x198 -#define PISR_ACKNAK (1<<1) -#define PISR_ITE (1<<6) -#define PISR_IRF (1<<7) -#define POWMAN_PISAR 0x1a0 - -/* Clock Manager */ -#define CLKMAN_CCCR 0x00 /* Core Clock Configuration */ -#define CCCR_CPDIS (1<<31) /* PXA270 */ -#define CCCR_A (1<<25) /* PXA270 */ -#define CCCR_TURBO_X1 (2<<7) -#define CCCR_TURBO_X15 (3<<7) /* x 1.5 */ -#define CCCR_TURBO_X2 (4<<7) -#define CCCR_TURBO_X25 (5<<7) /* x 2.5 */ -#define CCCR_TURBO_X3 (6<<7) /* x 3.0 */ -/* PXA255 */ -#define CCCR_RUN_X1 (1<<5) -#define CCCR_RUN_X2 (2<<5) -#define CCCR_RUN_X4 (3<<5) -#define CCCR_MEM_X27 (1<<0) /* x27, 99.53MHz */ -#define CCCR_MEM_X32 (2<<0) /* x32, 117,96MHz */ -#define CCCR_MEM_X36 (3<<0) /* x26, 132.71MHz */ -#define CCCR_MEM_X40 (4<<0) /* x27, 99.53MHz */ -#define CCCR_MEM_X45 (5<<0) /* x27, 99.53MHz */ -#define CCCR_MEM_X9 (0x1f<<0) /* x9, 33.2MHz */ -/* PXA27x: L is the core run frequency to 13MHz oscillator ratio. */ -#define CCCR_RUN_X7 (7<<0) /* 91MHz, 91MHz mem, 91MHz LCD */ -#define CCCR_RUN_X8 (8<<0) /* 104MHz, 104MHz mem, 52MHz LCD */ -#define CCCR_RUN_X16 (16<<0) /* 208MHz, 104/208MHz mem, 104MHz LCD */ - -#define CLKMAN_CKEN 0x04 /* Clock Enable Register */ -#define CLKMAN_OSCC 0x08 /* Oscillator Configuration Register */ - -#define CCCR_N_SHIFT 7 -#define CCCR_N_MASK (0x07<<CCCR_N_SHIFT) -#define CCCR_M_SHIFT 5 -#define CCCR_M_MASK (0x03<<CCCR_M_SHIFT) -#define CCCR_L_MASK 0x1f - -#define CKEN_PWM0 (1<<0) -#define CKEN_PWM1 (1<<1) -#define CKEN_AC97 (1<<2) -#define CKEN_SSP (1<<3) -#define CKEN_STUART (1<<5) -#define CKEN_FFUART (1<<6) -#define CKEN_BTUART (1<<7) -#define CKEN_I2S (1<<8) -#define CKEN_USBHC (1<<10) -#define CKEN_USBDC (1<<11) -#define CKEN_MMC (1<<12) -#define CKEN_FICP (1<<13) -#define CKEN_I2C (1<<14) -#define CKEN_PI2C (1<<15) /* PXA270? */ -#define CKEN_LCD (1<<16) -#define CKEN_KEY (1<<19) /* PXA270? */ -#define CKEN_MEM (1<<22) /* PXA270? */ -#define CKEN_AC97CC (1<<31) /* PXA27x */ - -#define OSCC_OOK (1<<0) /* 32.768KHz oscillator status */ -#define OSCC_OON (1<<1) /* 32.768KHz oscillator */ - -/* - * RTC - */ -#define RTC_RCNR 0x0000 /* count register */ -#define RTC_RTAR 0x0004 /* alarm register */ -#define RTC_RTSR 0x0008 /* status register */ -#define RTSR_AL (1<<0) -#define RTSR_HZ (1<<1) -#define RTSR_ALE (1<<2) -#define RTC_RTTR 0x000c /* trim register */ -/* - * GPIO - */ -#define GPIO_GPLR0 0x00 /* Level reg [31:0] */ -#define GPIO_GPLR1 0x04 /* Level reg [63:32] */ -#define GPIO_GPLR2 0x08 /* Level reg [80:64] PXA 270 [95:64] */ - -#define GPIO_GPDR0 0x0c /* dir reg [31:0] */ -#define GPIO_GPDR1 0x10 /* dir reg [63:32] */ -#define GPIO_GPDR2 0x14 /* dir reg [80:64] PXA 270 [95:64] */ - -#define GPIO_GPSR0 0x18 /* set reg [31:0] */ -#define GPIO_GPSR1 0x1c /* set reg [63:32] */ -#define GPIO_GPSR2 0x20 /* set reg [80:64] PXA 270 [95:64] */ - -#define GPIO_GPCR0 0x24 /* clear reg [31:0] */ -#define GPIO_GPCR1 0x28 /* clear reg [63:32] */ -#define GPIO_GPCR2 0x2c /* clear reg [80:64] PXA 270 [95:64] */ - -#define GPIO_GPER0 0x30 /* rising edge [31:0] */ -#define GPIO_GPER1 0x34 /* rising edge [63:32] */ -#define GPIO_GPER2 0x38 /* rising edge [80:64] PXA 270 [95:64] */ - -#define GPIO_GRER0 0x30 /* rising edge [31:0] */ -#define GPIO_GRER1 0x34 /* rising edge [63:32] */ -#define GPIO_GRER2 0x38 /* rising edge [80:64] PXA 270 [95:64] */ - -#define GPIO_GFER0 0x3c /* falling edge [31:0] */ -#define GPIO_GFER1 0x40 /* falling edge [63:32] */ -#define GPIO_GFER2 0x44 /* falling edge [80:64] PXA 270 [95:64] */ - -#define GPIO_GEDR0 0x48 /* edge detect [31:0] */ -#define GPIO_GEDR1 0x4c /* edge detect [63:32] */ -#define GPIO_GEDR2 0x50 /* edge detect [80:64] PXA 270 [95:64] */ - -#define GPIO_GAFR0_L 0x54 /* alternate function [15:0] */ -#define GPIO_GAFR0_U 0x58 /* alternate function [31:16] */ -#define GPIO_GAFR1_L 0x5c /* alternate function [47:32] */ -#define GPIO_GAFR1_U 0x60 /* alternate function [63:48] */ -#define GPIO_GAFR2_L 0x64 /* alternate function [79:64] */ -#define GPIO_GAFR2_U 0x68 /* alternate function [80] PXA 270 [95:80] */ - -#define GPIO_GAFR3_L 0x6C /* alternate function PXA 270 [111:96] */ -#define GPIO_GAFR3_U 0x70 /* alternate function PXA 270 [120:112] */ - -#define GPIO_GPLR3 0x100 /* Level PXA 270 [120:96] */ -#define GPIO_GPDR3 0x10C /* dir reg PXA 270 [120:96] */ -#define GPIO_GPSR3 0x118 /* set reg PXA 270 [120:96] */ -#define GPIO_GPCR3 0x124 /* clear reg PXA 270 [120:96] */ -#define GPIO_GRER3 0x130 /* rising edge PXA 270 [120:96] */ -#define GPIO_GFER3 0x13c /* falling edge PXA 270 [120:96] */ -#define GPIO_GEDR3 0x148 /* edge detect PXA270 [120:96] */ - -#define GPIO_REG(r, pin) ((r) + \ - ((pin > 95) ? GPIO_GPLR3 : (((pin) / 32) * 4))) -#define GPIO_BANK(pin) ((pin) / 32) -#define GPIO_BIT(pin) (1u << ((pin) & 0x1f)) -#define GPIO_FN_REG(pin) (GPIO_GAFR0_L + (((pin) / 16) * 4)) -#define GPIO_FN_SHIFT(pin) ((pin & 0xf) * 2) - -#define GPIO_IN 0x00 /* Regular GPIO input pin */ -#define GPIO_OUT 0x10 /* Regular GPIO output pin */ -#define GPIO_ALT_FN_1_IN 0x01 /* Alternate function 1 input */ -#define GPIO_ALT_FN_1_OUT 0x11 /* Alternate function 1 output */ -#define GPIO_ALT_FN_2_IN 0x02 /* Alternate function 2 input */ -#define GPIO_ALT_FN_2_OUT 0x12 /* Alternate function 2 output */ -#define GPIO_ALT_FN_3_IN 0x03 /* Alternate function 3 input */ -#define GPIO_ALT_FN_3_OUT 0x13 /* Alternate function 3 output */ -#define GPIO_SET 0x20 /* Initial state is Set */ -#define GPIO_CLR 0x00 /* Initial state is Clear */ - -#define GPIO_FN_MASK 0x03 -#define GPIO_FN_IS_OUT(n) ((n) & GPIO_OUT) -#define GPIO_FN_IS_SET(n) ((n) & GPIO_SET) -#define GPIO_FN(n) ((n) & GPIO_FN_MASK) -#define GPIO_IS_GPIO(n) (GPIO_FN(n) == 0) -#define GPIO_IS_GPIO_IN(n) (((n) & (GPIO_FN_MASK|GPIO_OUT)) == GPIO_IN) -#define GPIO_IS_GPIO_OUT(n) (((n) & (GPIO_FN_MASK|GPIO_OUT)) == GPIO_OUT) - -#define GPIO_NPINS_25x 85 -#define GPIO_NPINS 121 - -/* - * memory controller - */ - -#define MEMCTL_MDCNFG 0x0000 -#define MDCNFG_DE0 (1<<0) -#define MDCNFG_DE1 (1<<1) -#define MDCNFD_DWID01_SHIFT 2 -#define MDCNFD_DCAC01_SHIFT 3 -#define MDCNFD_DRAC01_SHIFT 5 -#define MDCNFD_DNB01_SHIFT 7 -#define MDCNFG_DE2 (1<<16) -#define MDCNFG_DE3 (1<<17) -#define MDCNFD_DWID23_SHIFT 18 -#define MDCNFD_DCAC23_SHIFT 19 -#define MDCNFD_DRAC23_SHIFT 21 -#define MDCNFD_DNB23_SHIFT 23 - -#define MDCNFD_DWID_MASK 0x1 -#define MDCNFD_DCAC_MASK 0x3 -#define MDCNFD_DRAC_MASK 0x3 -#define MDCNFD_DNB_MASK 0x1 - -#define MEMCTL_MDREFR 0x04 /* refresh control register */ -#define MDREFR_DRI 0xfff -#define MDREFR_E0PIN (1<<12) -#define MDREFR_K0RUN (1<<13) /* SDCLK0 enable */ -#define MDREFR_K0DB2 (1<<14) /* SDCLK0 1/2 freq */ -#define MDREFR_E1PIN (1<<15) -#define MDREFR_K1RUN (1<<16) /* SDCLK1 enable */ -#define MDREFR_K1DB2 (1<<17) /* SDCLK1 1/2 freq */ -#define MDREFR_K2RUN (1<<18) /* SDCLK2 enable */ -#define MDREFR_K2DB2 (1<<19) /* SDCLK2 1/2 freq */ -#define MDREFR_APD (1<<20) /* Auto Power Down */ -#define MDREFR_SLFRSH (1<<22) /* Self Refresh */ -#define MDREFR_K0FREE (1<<23) /* SDCLK0 free run */ -#define MDREFR_K1FREE (1<<24) /* SDCLK1 free run */ -#define MDREFR_K2FREE (1<<25) /* SDCLK2 free run */ - -#define MEMCTL_MSC0 0x08 /* Asynchronous Static memory Control CS[01] */ -#define MEMCTL_MSC1 0x0c /* Asynchronous Static memory Control CS[23] */ -#define MEMCTL_MSC2 0x10 /* Asynchronous Static memory Control CS[45] */ -#define MSC_RBUFF_SHIFT 15 /* return data buffer */ -#define MSC_RBUFF (1<<MSC_RBUFF_SHIFT) -#define MSC_RRR_SHIFT 12 /* recovery time */ -#define MSC_RRR (7<<MSC_RRR_SHIFT) -#define MSC_RDN_SHIFT 8 /* ROM delay next access */ -#define MSC_RDN (0x0f<<MSC_RDN_SHIFT) -#define MSC_RDF_SHIFT 4 /* ROM delay first access*/ -#define MSC_RDF (0x0f<<MSC_RDF_SHIFT) -#define MSC_RBW_SHIFT 3 /* 32/16 bit bus */ -#define MSC_RBW (1<<MSC_RBW_SHIFT) -#define MSC_RT_SHIFT 0 /* type */ -#define MSC_RT (7<<MSC_RT_SHIFT) -#define MSC_RT_NONBURST 0 -#define MSC_RT_SRAM 1 -#define MSC_RT_BURST4 2 -#define MSC_RT_BURST8 3 -#define MSC_RT_VLIO 4 - -/* expansion memory timing configuration */ -#define MEMCTL_MCMEM(n) (0x28+4*(n)) -#define MEMCTL_MCATT(n) (0x30+4*(n)) -#define MEMCTL_MCIO(n) (0x38+4*(n)) - -#define MC_HOLD_SHIFT 14 -#define MC_ASST_SHIFT 7 -#define MC_SET_SHIFT 0 -#define MC_TIMING_VAL(hold,asst,set) (((hold)<<MC_HOLD_SHIFT)| \ - ((asst)<<MC_ASST_SHIFT)|((set)<<MC_SET_SHIFT)) - -#define MEMCTL_MECR 0x14 /* Expansion memory configuration */ -#define MECR_NOS (1<<0) /* Number of sockets */ -#define MECR_CIT (1<<1) /* Card-is-there */ - -#define MEMCTL_MDMRS 0x0040 - -#define MEMCTL_ARB_CNTRL 0x0048 /* System Bus Arbiter */ - -/* - * LCD Controller - */ -#define LCDC_LCCR0 0x000 /* Controller Control Register 0 */ -#define LCCR0_ENB (1U<<0) /* LCD Controller Enable */ -#define LCCR0_CMS (1U<<1) /* Color/Mono select */ -#define LCCR0_SDS (1U<<2) /* Single/Dual -panel */ -#define LCCR0_LDM (1U<<3) /* LCD Disable Done Mask */ -#define LCCR0_SFM (1U<<4) /* Start of Frame Mask */ -#define LCCR0_IUM (1U<<5) /* Input FIFO Underrun Mask */ -#define LCCR0_EFM (1U<<6) /* End of Frame Mask */ -#define LCCR0_PAS (1U<<7) /* Passive/Active Display select */ -#define LCCR0_DPD (1U<<9) /* Double-Pixel Data pin mode */ -#define LCCR0_DIS (1U<<10) /* LCD Disable */ -#define LCCR0_QDM (1U<<11) /* LCD Quick Disable Mask */ -#define LCCR0_BM (1U<<20) /* Branch Mask */ -#define LCCR0_OUM (1U<<21) /* Output FIFO Underrun Mask */ -/* PXA270 */ -#define LCCR0_LCDT (1U<<22) /* LCD Panel Type */ -#define LCCR0_RDSTM (1U<<23) /* Read Status Interrupt Mask */ -#define LCCR0_CMDIM (1U<<24) /* Command Interrupt Mask */ -#define LCCR0_OUC (1U<<25) /* Overlay Underlay Control */ -#define LCCR0_LDDALT (1U<<26) /* LDD Alternate Mapping Control Bit */ - -#define LCCR0_IMASK (LCCR0_LDM|LCCR0_SFM|LCCR0_IUM|LCCR0_EFM|LCCR0_QDM|LCCR0_BM|LCCR0_OUM) - - -#define LCDC_LCCR1 0x004 /* Controller Control Register 1 */ -#define LCDC_LCCR2 0x008 /* Controller Control Register 2 */ -#define LCDC_LCCR3 0x00c /* Controller Control Register 2 */ -#define LCCR3_BPP_SHIFT 24 /* Bits per pixel */ -#define LCCR3_BPP (0x07<<LCCR3_BPP_SHIFT) -#define LCDC_FBR0 0x020 /* DMA ch0 frame branch register */ -#define LCDC_FBR1 0x024 /* DMA ch1 frame branch register */ -#define LCDC_LCSR 0x038 /* controller status register */ -#define LCSR_LDD (1U<<0) /* LCD disable done */ -#define LCSR_SOF (1U<<1) /* Start of frame */ -#define LCDC_LIIDR 0x03c /* controller interrupt ID Register */ -#define LCDC_TRGBR 0x040 /* TMED RGB Speed Register */ -#define LCDC_TCR 0x044 /* TMED Control Register */ -#define LCDC_FDADR0 0x200 /* DMA ch0 frame descriptor address */ -#define LCDC_FSADR0 0x204 /* DMA ch0 frame source address */ -#define LCDC_FIDR0 0x208 /* DMA ch0 frame ID register */ -#define LCDC_LDCMD0 0x20c /* DMA ch0 command register */ -#define LCDC_FDADR1 0x210 /* DMA ch1 frame descriptor address */ -#define LCDC_FSADR1 0x214 /* DMA ch1 frame source address */ -#define LCDC_FIDR1 0x218 /* DMA ch1 frame ID register */ -#define LCDC_LDCMD1 0x21c /* DMA ch1 command register */ - -/* - * MMC/SD controller - */ -#define MMC_STRPCL 0x00 /* start/stop MMC clock */ -#define STRPCL_NOOP 0 -#define STRPCL_STOP 1 /* stop MMC clock */ -#define STRPCL_START 2 /* start MMC clock */ -#define MMC_STAT 0x04 /* status register */ -#define STAT_READ_TIME_OUT (1<<0) -#define STAT_TIMEOUT_RESPONSE (1<<1) -#define STAT_CRC_WRITE_ERROR (1<<2) -#define STAT_CRC_READ_ERROR (1<<3) -#define STAT_SPI_READ_ERROR_TOKEN (1<<4) -#define STAT_RES_CRC_ERR (1<<5) -#define STAT_XMIT_FIFO_EMPTY (1<<6) /* (PXA27x: reserved) */ -#define STAT_RECV_FIFO_FULL (1<<7) /* (PXA27x: reserved) */ -#define STAT_CLK_EN (1<<8) -#define STAT_DATA_TRAN_DONE (1<<11) -#define STAT_PRG_DONE (1<<12) -#define STAT_END_CMD_RES (1<<13) -#define MMC_CLKRT 0x08 /* MMC clock rate */ -#define CLKRT_20M 0 -#define CLKRT_10M 1 -#define CLKRT_5M 2 -#define CLKRT_2_5M 3 -#define CLKRT_1_25M 4 -#define CLKRT_625K 5 -#define CLKRT_312K 6 -#define MMC_SPI 0x0c /* SPI mode control */ -#define SPI_EN (1<<0) /* enable SPI mode */ -#define SPI_CRC_ON (1<<1) /* enable CRC generation */ -#define SPI_CS_EN (1<<2) /* Enable CS[01] */ -#define SPI_CS_ADDRESS (1<<3) /* CS0/CS1 */ -#define MMC_CMDAT 0x10 /* command/response/data */ -#define CMDAT_RESPONSE_FORMAT 0x03 -#define CMDAT_RESPONSE_FORMAT_NO 0 /* no response */ -#define CMDAT_RESPONSE_FORMAT_R1 1 /* R1, R1b, R4, R5, R5b, R6 */ -#define CMDAT_RESPONSE_FORMAT_R2 2 -#define CMDAT_RESPONSE_FORMAT_R3 3 -#define CMDAT_DATA_EN (1<<2) -#define CMDAT_WRITE (1<<3) /* 1=write 0=read operation */ -#define CMDAT_STREAM_BLOCK (1<<4) /* stream mode */ -#define CMDAT_BUSY (1<<5) /* busy signal is expected */ -#define CMDAT_INIT (1<<6) /* precede command with 80 clocks */ -#define CMDAT_MMC_DMA_EN (1<<7) /* DMA enable */ -#define MMC_RESTO 0x14 /* expected response time out */ -#define MMC_RDTO 0x18 /* expected data read time out */ -#define MMC_BLKLEN 0x1c /* block length of data transaction */ -#define MMC_NUMBLK 0x20 /* number of blocks (block mode) */ -#define MMC_PRTBUF 0x24 /* partial MMC_TXFIFO written */ -#define PRTBUF_BUF_PART_FULL (1<<0) /* buffer partially full */ -#define MMC_I_MASK 0x28 /* interrupt mask */ -#define MMC_I_REG 0x2c /* interrupt register */ -#define MMC_I_DATA_TRAN_DONE (1<<0) -#define MMC_I_PRG_DONE (1<<1) -#define MMC_I_END_CMD_RES (1<<2) -#define MMC_I_STOP_CMD (1<<3) -#define MMC_I_CLK_IS_OFF (1<<4) -#define MMC_I_RXFIFO_RD_REQ (1<<5) -#define MMC_I_TXFIFO_WR_REQ (1<<6) -#define MMC_I_DAT_ERR (1<<8) /* PXA27x */ -#define MMC_I_RES_ERR (1<<9) /* PXA27x */ -#define MMC_I_SDIO_INT (1<<11) /* PXA27x */ -#define MMC_CMD 0x30 /* index of current command */ -#define MMC_ARGH 0x34 /* MSW part of the current command arg */ -#define MMC_ARGL 0x38 /* LSW part of the current command arg */ -#define MMC_RES 0x3c /* response FIFO */ -#define MMC_RXFIFO 0x40 /* receive FIFO */ -#define MMC_TXFIFO 0x44 /* transmit FIFO */ - - -/* - * Inter-IC Sound (I2S) Controller - */ -#define I2S_SACR0 0x0000 /* Serial Audio Global Control */ -#define SACR0_ENB (1<<0) /* Enable I2S Function */ -#define SACR0_BCKD (1<<2) /* I/O Direction of I2S_BITCLK */ -#define SACR0_RST (1<<3) /* FIFO Reset */ -#define SACR0_EFWR (1<<4) /* Special-Purpose FIFO W/R Func */ -#define SACR0_STRF (1<<5) /* Select TX or RX FIFO */ -#define SACR0_TFTH_MASK (0xf<<8) /* Trans FIFO Intr/DMA Trig Thresh */ -#define SACR0_RFTH_MASK (0xf<<12) /* Recv FIFO Intr/DMA Trig Thresh */ -#define SACR0_SET_TFTH(x) (((x) & 0xf)<<8) -#define SACR0_SET_RFTH(x) (((x) & 0xf)<<12) -#define I2S_SACR1 0x0004 /* Serial Audio I2S/MSB-Justified Control */ -#define SACR1_AMSL (1<<0) /* Specify Alt Mode (I2S or MSB) */ -#define SACR1_DREC (1<<3) /* Disable Recording Func */ -#define SACR1_DRPL (1<<4) /* Disable Replay Func */ -#define SACR1_ENLBF (1<<5) /* Enable Interface Loopback Func */ -#define I2S_SASR0 0x000c /* Serial Audio I2S/MSB-Justified Status */ -#define SASR0_TNF (1<<0) /* Transmit FIFO Not Full */ -#define SASR0_RNE (1<<1) /* Recv FIFO Not Empty */ -#define SASR0_BSY (1<<2) /* I2S Busy */ -#define SASR0_TFS (1<<3) /* Trans FIFO Service Request */ -#define SASR0_RFS (1<<4) /* Recv FIFO Service Request */ -#define SASR0_TUR (1<<5) /* Trans FIFO Underrun */ -#define SASR0_ROR (1<<6) /* Recv FIFO Overrun */ -#define SASR0_I2SOFF (1<<7) /* I2S Controller Off */ -#define SASR0_TFL_MASK (0xf<<8) /* Trans FIFO Level */ -#define SASR0_RFL_MASK (0xf<<12) /* Recv FIFO Level */ -#define SASR0_GET_TFL(x) (((x) & 0xf) >> 8) -#define SASR0_GET_RFL(x) (((x) & 0xf) >> 12) -#define I2S_SAIMR 0x0014 /* Serial Audio Interrupt Mask */ -#define SAIMR_TFS (1<<3) /* Enable TX FIFO Service Req Intr */ -#define SAIMR_RFS (1<<4) /* Enable RX FIFO Service Req Intr */ -#define SAIMR_TUR (1<<5) /* Enable TX FIFO Underrun Intr */ -#define SAIMR_ROR (1<<6) /* Enable RX FIFO Overrun Intr */ -#define I2S_SAICR 0x0018 /* Serial Audio Interrupt Clear */ -#define SAICR_TUR (1<<5) /* Clear Intr and SASR0_TUR */ -#define SAICR_ROR (1<<6) /* Clear Intr and SASR0_ROR */ -#define I2S_SADIV 0x0060 /* Audio Clock Divider */ -#define SADIV_MASK 0x7f -#define SADIV_3_058MHz 0x0c /* 3.058 MHz */ -#define SADIV_2_836MHz 0x0d /* 2.836 MHz */ -#define SADIV_1_405MHz 0x1a /* 1.405 MHz */ -#define SADIV_1_026MHz 0x24 /* 1.026 MHz */ -#define SADIV_702_75kHz 0x34 /* 702.75 kHz */ -#define SADIV_513_25kHz 0x48 /* 513.25 kHz */ -#define I2S_SADR 0x0080 /* Serial Audio Data Register */ -#define SADR_DTL (0xffff<<0) /* Left Data Sample */ -#define SADR_DTH (0xffff<<16) /* Right Data Sample */ - -/* - * AC '97 Controller - */ -#define AC97_POCR 0x0000 /* PCM Out Control Register */ -#define POCR_FSRIE (1<<1) /* FIFO Service Request Intr Enable */ -#define POCR_FEIE (1<<3) /* FIFO Error Intr Enable */ -#define AC97_PCMICR 0x0004 /* PCM In Control Register */ -#define PCMICR_FSRIE (1<<1) /* FIFO Service Request Intr Enable */ -#define PCMICR_FEIE (1<<3) /* FIFO Error Intr Enable */ -#define AC97_MCCR 0x0008 /* Microphone In Control Register */ -#define MCCR_FSRIE (1<<1) /* FIFO Service Request Intr Enable */ -#define MCCR_FEIE (1<<3) /* FIFO Error Intr Enable */ -#define AC97_GCR 0x000c /* Global Control Register */ -#define GCR_GPI_IE (1<<0) /* Codec GPI Interrupt Enable */ -#define GCR_nCRST (1<<1) /* AC '97 Cold Reset */ -#define GCR_WRST (1<<2) /* AC '97 Warm Reset */ -#define GCR_ACOFF (1<<3) /* AC-Link Shut Off */ -#define GCR_PRES_IE (1<<4) /* Primary Resume Intr Enable */ -#define GCR_SRES_IE (1<<5) /* Secondary Resume Intr Enable */ -#define GCR_PRDY_IE (1<<8) /* Primary Ready Intr Enable */ -#define GCR_SRDY_IE (1<<9) /* Secondary Ready Intr Enable */ -#define GCR_SDONE_IE (1<<18) /* Status Done Intr Enable */ -#define GCR_CDONE_IE (1<<19) /* Command Done Intr Enable */ -#define GCR_nDMAEN (1<<24) /* DMA Enable (PXA27x) */ -#define AC97_POSR 0x0010 /* PCM Out Status Register */ -#define POSR_FSR (1<<2) /* FIFO Service Request */ -#define POSR_FIFOE (1<<4) /* FIFO Error */ -#define AC97_PCMISR 0x0014 /* PCM In Status Register */ -#define PCMISR_FSR (1<<2) /* FIFO Service Request */ -#define PCMISR_ECC (1<<3) /* DMA End of Chain Intr */ -#define PCMISR_FIFOE (1<<4) /* FIFO Error */ -#define AC97_MCSR 0x0018 /* Microphone In Status Register */ -#define MCSR_FSR (1<<2) /* FIFO Service Request */ -#define MCSR_ECC (1<<3) /* DMA End of Chain Intr */ -#define MCSR_FIFOE (1<<4) /* FIFO Error */ -#define AC97_GSR 0x001c /* Global Status Register */ -#define GSR_GSCI (1<<0) /* Codec GPI Status Change Intr */ -#define GSR_MIINT (1<<1) /* Modem-In Intr */ -#define GSR_MOINT (1<<2) /* Modem-Out Intr */ -#define GSR_ACOFFD (1<<3) /* AC-link Shut Off Done */ -#define GSR_PIINT (1<<5) /* PCM-In Intr */ -#define GSR_POINT (1<<6) /* PCM-Out Intr */ -#define GSR_MCINT (1<<7) /* Mic-In Intr */ -#define GSR_PCRDY (1<<8) /* Primay Codec Ready */ -#define GSR_SCRDY (1<<9) /* Secondary Codec Ready */ -#define GSR_PRESINT (1<<10) /* Primary Resume Intr */ -#define GSR_SRESINT (1<<11) /* Secondary Resume Intr */ -#define GSR_B1S12 (1<<12) /* Bit 1 of Slot 12 */ -#define GSR_B2S12 (1<<13) /* Bit 2 of Slot 12 */ -#define GSR_B3S12 (1<<14) /* Bit 3 of Slot 12 */ -#define GSR_RCS (1<<15) /* Read Completion Status */ -#define GSR_SDONE (1<<18) /* Status Done */ -#define GSR_CDONE (1<<19) /* Command Done */ -#define AC97_CAR 0x0020 /* Codec Access Register */ -#define CAR_CAIP (1<<0) /* Codec Access In Progress */ -/* 0x0024 to 0x003c is reserved */ -#define AC97_PCDR 0x0040 /* PCM Data Register */ -#define PCDR_PCML (0xffff<<0) /* PCM Left Channel Data */ -#define PCDR_PCMR (0xffff<<16) /* PCM Right Channel Data */ -/* 0x0044 to 0x005c is reserved */ -#define AC97_MCDR 0x0060 /* Microphone In Data Register */ -#define MCDR_MCDAT (0xffff<<0) /* Mic-In Data */ -/* 0x0064 to 0x00fc is reserved */ -#define AC97_MOCR 0x0100 /* Modem Out Control Register */ -#define MOCR_FSRIE (1<<1) /* FIFO Service Request Intr Enable */ -#define MOCR_FEIE (1<<3) /* FIFO Error Intr Enable */ -/* 0x0104 is reserved */ -#define AC97_MICR 0x0108 /* Modem In Control Register */ -#define MICR_FSRIE (1<<1) /* FIFO Service Request Intr Enable */ -#define MICR_FEIE (1<<3) /* FIFO Error Intr Enable */ -/* 0x010c is reserved */ -#define AC97_MOSR 0x0110 /* Modem Out Status Register */ -#define MOSR_FSR (1<<2) /* FIFO Service Request */ -#define MOSR_FIFOE (1<<2) /* FIFO Error */ -/* 0x0114 is reserved */ -#define AC97_MISR 0x0118 /* Modem In Status Register */ -#define MOSR_FSR (1<<2) /* FIFO Service Request */ -#define MOSR_EOC (1<<2) /* DMA End of Chain Intr */ -#define MOSR_FIFOE (1<<2) /* FIFO Error */ -/* 0x011c to 0x013c is reserved */ -#define AC97_MODR 0x0140 /* Modem Data Register */ -#define MODR_MODAT (0xffff<<0) /* Modem Data */ -/* 0x0144 to 0x01fc is reserved */ - -#define AC97_PRIAUDIO 0x0200 /* Primary Audio Codec Registers */ -#define AC97_SECAUDIO 0x0300 /* Secondary Audio Codec Registers */ -#define AC97_PRIMODEM 0x0400 /* Primary Modem Codec Registers */ -#define AC97_SECMODEM 0x0500 /* Secondary modem Codec Registers */ - -/* - * USB device controller differs between pxa255 and pxa27x, defined separately - */ - -/* - * USB Host Controller - */ -#define USBHC_STAT 0x0060 /* UHC Status Register */ -#define USBHC_STAT_RWUE (1<<7) /* HCI Remote Wake-Up Event */ -#define USBHC_STAT_HBA (1<<8) /* HCI Buffer Active */ -#define USBHC_STAT_HTA (1<<10) /* HCI Transfer Abort */ -#define USBHC_STAT_UPS1 (1<<11) /* USB Power Sense Port 1 */ -#define USBHC_STAT_UPS2 (1<<12) /* USB Power Sense Port 2 */ -#define USBHC_STAT_UPRI (1<<13) /* USB Port Resume Interrupt */ -#define USBHC_STAT_SBTAI (1<<14) /* System Bus Target Abort Interrupt */ -#define USBHC_STAT_SBMAI (1<<15) /* System Bus Master Abort Interrupt */ -#define USBHC_STAT_UPS3 (1<<16) /* USB Power Sense Port 3 */ -#define USBHC_STAT_MASK (USBHC_STAT_RWUE | USBHC_STAT_HBA | \ - USBHC_STAT_HTA | USBHC_STAT_UPS1 | USBHC_STAT_UPS2 | USBHC_STAT_UPRI | \ - USBHC_STAT_SBTAI | USBHC_STAT_SBMAI | USBHC_STAT_UPS3) -#define USBHC_HR 0x0064 /* UHC Reset Register */ -#define USBHC_HR_FSBIR (1<<0) /* Force System Bus Interface Reset */ -#define USBHC_HR_FHR (1<<1) /* Force Host Controller Reset */ -#define USBHC_HR_CGR (1<<2) /* Clock Generation Reset */ -#define USBHC_HR_SSDC (1<<3) /* Simulation Scale Down Clock */ -#define USBHC_HR_UIT (1<<4) /* USB Interrupt Test */ -#define USBHC_HR_SSE (1<<5) /* Sleep Standby Enable */ -#define USBHC_HR_PSPL (1<<6) /* Power Sense Polarity Low */ -#define USBHC_HR_PCPL (1<<7) /* Power Control Polarity Low */ -#define USBHC_HR_SSEP1 (1<<9) /* Sleep Standby Enable for Port 1 */ -#define USBHC_HR_SSEP2 (1<<10) /* Sleep Standby Enable for Port 2 */ -#define USBHC_HR_SSEP3 (1<<11) /* Sleep Standby Enable for Port 3 */ -#define USBHC_HR_MASK (USBHC_HR_FSBIR | USBHC_HR_FHR | \ - USBHC_HR_CGR | USBHC_HR_SSDC | USBHC_HR_UIT | USBHC_HR_SSE | \ - USBHC_HR_PSPL | USBHC_HR_PCPL | USBHC_HR_SSEP1 | USBHC_HR_SSEP2 | \ - USBHC_HR_SSEP3) -#define USBHC_HIE 0x0068 /* UHC Interrupt Enable Register */ -#define USBHC_HIE_RWIE (1<<7) /* HCI Remote Wake-Up */ -#define USBHC_HIE_HBAIE (1<<8) /* HCI Buffer Active */ -#define USBHC_HIE_TAIE (1<<10) /* HCI Interface Transfer Abort */ -#define USBHC_HIE_UPS1IE (1<<11) /* USB Power Sense Port 1 */ -#define USBHC_HIE_UPS2IE (1<<12) /* USB Power Sense Port 2 */ -#define USBHC_HIE_UPRIE (1<<13) /* USB Port Resume */ -#define USBHC_HIE_UPS3IE (1<<14) /* USB Power Sense Port 3 */ -#define USBHC_HIE_MASK (USBHC_HIE_RWIE | USBHC_HIE_HBAIE | \ - USBHC_HIE_TAIE | USBHC_HIE_UPS1IE | USBHC_HIE_UPS2IE | USBHC_HIE_UPRIE | \ - USBHC_HIE_UPS3IE) -#define USBHC_HIT 0x006C /* UHC Interrupt Test Register */ -#define USBHC_HIT_RWUT (1<<7) /* HCI Remote Wake-Up */ -#define USBHC_HIT_BAT (1<<8) /* HCI Buffer Active */ -#define USBHC_HIT_IRQT (1<<9) /* Normal OHC */ -#define USBHC_HIT_TAT (1<<10) /* HCI Interface Transfer Abort */ -#define USBHC_HIT_UPS1T (1<<11) /* USB Power Sense Port 1 */ -#define USBHC_HIT_UPS2T (1<<12) /* USB Power Sense Port 2 */ -#define USBHC_HIT_UPRT (1<<13) /* USB Port Resume */ -#define USBHC_HIT_STAT (1<<14) /* System Bus Target Abort */ -#define USBHC_HIT_SMAT (1<<15) /* System Bus Master Abort */ -#define USBHC_HIT_UPS3T (1<<16) /* USB Power Sense Port 3 */ -#define USBHC_HIT_MASK (USBHC_HIT_RWUT | USBHC_HIT_BAT | \ - USBHC_HIT_IRQT | USBHC_HIT_TAT | USBHC_HIT_UPS1T | USBHC_HIT_UPS2T | \ - USBHC_HIT_UPRT | USBHC_HIT_STAT | USBHC_HIT_SMAT | USBHC_HIT_UPS3T) -#define USBHC_RST_WAIT 10000 /* usecs to wait for reset */ - -/* OS Timer */ -#define OST_OSMR0 0x0000 /* Match 0 */ -#define OST_OSMR1 0x0004 /* Match 1 */ -#define OST_OSMR2 0x0008 /* Match 2 */ -#define OST_OSMR3 0x000c /* Match 3 */ -#define OST_OSCR0 0x0010 /* Counter 0 */ - -#define OST_OSCR4 0x0040 /* Counter 4 */ -#define OST_OMCR4 0x00c0 /* Counter 4 match control */ -#define OST_OSMR4 0x0080 /* Counter 4 match */ -#define OST_OSCR5 0x0044 /* Counter 5 */ -#define OST_OMCR5 0x00c4 /* Counter 5 match control */ -#define OST_OSMR5 0x0084 /* Counter 4 match */ - -#define OST_OSSR 0x0014 /* Status (all counters) */ -#define OST_OWER 0x0018 /* Watchdog Enable */ -#define OWER_WME (1<<0) -#define OST_OIER 0x001c /* Interrupt Enable */ -#define OIER_E3 (1<<3) - -/* Synchronous Serial Protocol (SSP) serial ports */ -#define SSP_SSCR0 0x00 -#define SSP_SSCR1 0x04 -#define SSP_SSSR 0x08 -#define SSSR_TNF (1<<2) -#define SSSR_RNE (1<<3) -#define SSP_SSDR 0x10 - -/* KPC */ -#define KPC_KPC 0x00 -#define KPC_MIE (1<<11) -#define KPC_ME (1<<12) -#define KPC_MS(n) ((n & 0xff) << 13) -#define KPC_IMKP (1<<21) -#define KPC_MI (1<<22) -#define KPC_MKCN(n) ((n & 0x7) << 23) -#define KPC_MKRN(n) ((n & 0x7) << 26) -#define KPC_ASACT (1<<29) -#define KPC_KPAS 0x20 -#define KPAS_CP (0xf<<0) -#define KPAS_RP (0xf<<4) -#define KPAS_MUKP (0x1f<<26) -#define KPAS_SO (1<<31) -#define KPC_KPKDI 0x48 - -#endif /* _ARM_XSCALE_PXA2X0REG_H_ */ diff --git a/sys/arch/arm/xscale/pxa2x0var.h b/sys/arch/arm/xscale/pxa2x0var.h deleted file mode 100644 index 018d4849dbb..00000000000 --- a/sys/arch/arm/xscale/pxa2x0var.h +++ /dev/null @@ -1,97 +0,0 @@ -/* $OpenBSD: pxa2x0var.h,v 1.5 2005/05/27 21:10:05 uwe Exp $ */ -/* $NetBSD: pxa2x0var.h,v 1.2 2003/06/05 13:48:28 scw Exp $ */ - -/* - * Copyright (c) 2002 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 for the NetBSD Project by - * Genetec Corporation. - * 4. The name of Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - - -#ifndef _ARM_XSCALE_PXA2X0VAR_H_ -#define _ARM_XSCALE_PXA2X0VAR_H_ - -#include <arm/sa11x0/sa11x0_var.h> - -/* PXA2X0's integrated peripheral bus. */ - -typedef int (* pxa2x0_irq_handler_t)(void *); - -struct pxaip_attach_args { - struct sa11x0_attach_args pxa_sa; - bus_dma_tag_t pxa_dmat; - int pxa_index; /* to specify device by index number */ - -#define pxa_iot pxa_sa.sa_iot -#define pxa_addr pxa_sa.sa_addr -#define pxa_size pxa_sa.sa_size -#define pxa_intr pxa_sa.sa_intr -}; - -#define cf_addr cf_loc[0] -#define cf_size cf_loc[1] -#define cf_intr cf_loc[2] -#define cf_index cf_loc[3] - - -extern struct bus_space pxa2x0_bs_tag; -extern struct arm32_bus_dma_tag pxa2x0_bus_dma_tag; -extern struct bus_space pxa2x0_a4x_bs_tag; - -/* misc. */ -extern void pxa2x0_fcs_init(void); -extern void pxa2x0_freq_change(int); -extern void pxa2x0_turbo_mode(int); -extern int pxa2x0_i2c_master_tx( int, uint8_t *, int ); - -/* - * Probe the memory controller to determine which SDRAM banks - * are populated, and what size SDRAM is present in each bank. - * - * This routine should be called from a port's initarm() - * function, with the first parameter set to the address - * of the memory controller's registers. - */ -extern void pxa2x0_probe_sdram(vaddr_t, paddr_t *, psize_t *); - -/* - * Configure one or more clock enables in the Clock Manager's - * CKEN register. - */ -extern void pxa2x0_clkman_config(u_int, int); - -/* - * Get/set the Real Time Clock's counter and alarm registers. - */ -extern void pxa2x0_rtc_setalarm(u_int32_t); -extern u_int32_t pxa2x0_rtc_getalarm(void); -extern u_int32_t pxa2x0_rtc_getsecs(void); - -#endif /* _ARM_XSCALE_PXA2X0VAR_H_ */ diff --git a/sys/arch/arm/xscale/pxammcvar.h b/sys/arch/arm/xscale/pxammcvar.h deleted file mode 100644 index e80ea71cf61..00000000000 --- a/sys/arch/arm/xscale/pxammcvar.h +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: pxammcvar.h,v 1.2 2009/09/03 21:40:29 marex Exp $ */ - -/* - * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <machine/bus.h> - -struct pxammc_tag { - void *cookie; - u_int32_t (*get_ocr)(void *); - int (*set_power)(void *, u_int32_t); -}; - -struct pxammc_softc { - struct device sc_dev; /* base device */ - struct pxammc_tag tag; /* attachment driver functions */ - bus_space_tag_t sc_iot; /* register space tag */ - bus_space_handle_t sc_ioh; /* register space handle */ - struct device *sc_sdmmc; /* generic sdmmc bus device */ - void *sc_card_ih; /* card interrupt handle */ - void *sc_ih; /* MMC interrupt handle */ - int sc_flags; /* driver state flags */ -#define PMF_CARD_INITED 0x0001 /* card init sequence sent */ - int sc_clkdiv; /* current clock divider */ - struct sdmmc_command * volatile sc_cmd; /* command in progress */ - int sc_gpio_detect; /* card detect GPIO */ -}; - -int pxammc_match(void); -void pxammc_attach(struct pxammc_softc *, void *); diff --git a/sys/arch/arm/xscale/pxapcicvar.h b/sys/arch/arm/xscale/pxapcicvar.h deleted file mode 100644 index a1bbe29dff5..00000000000 --- a/sys/arch/arm/xscale/pxapcicvar.h +++ /dev/null @@ -1,81 +0,0 @@ -/* $OpenBSD: pxapcicvar.h,v 1.7 2005/12/14 15:08:51 uwe Exp $ */ - -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -struct pxapcic_socket { - struct pxapcic_softc *sc; - int socket; /* socket number */ - struct device *pcmcia; - struct proc *event_thread; - - int flags; - int power_capability; /* PXAPCIC_POWER_3V | PXAPCIC_POWER_5V */ - - int irqpin; - void *irq; - - void *pcictag_cookie; /* opaque data for pcictag functions */ - struct pxapcic_tag *pcictag; -}; - -/* event */ -#define PXAPCIC_EVENT_INSERTION 0 -#define PXAPCIC_EVENT_REMOVAL 1 - -/* flags */ -#define PXAPCIC_FLAG_CARDD 0 -#define PXAPCIC_FLAG_CARDP 1 - -struct pxapcic_tag { - u_int (*read)(struct pxapcic_socket *, int); - void (*write)(struct pxapcic_socket *, int, u_int); - void (*set_power)(struct pxapcic_socket *, int); - void (*clear_intr)(struct pxapcic_socket *); - void *(*intr_establish)(struct pxapcic_socket *, int, - int (*)(void *), void *); - void (*intr_disestablish)(struct pxapcic_socket *, void *); - const char *(*intr_string)(struct pxapcic_socket *); -}; - -/* pcictag registers and their values */ -#define PXAPCIC_CARD_STATUS 0 -#define PXAPCIC_CARD_INVALID 0 -#define PXAPCIC_CARD_VALID 1 -#define PXAPCIC_CARD_READY 1 -#define PXAPCIC_CARD_POWER 2 -#define PXAPCIC_POWER_OFF 0 -#define PXAPCIC_POWER_3V 1 -#define PXAPCIC_POWER_5V 2 -#define PXAPCIC_CARD_RESET 3 - -struct pxapcic_softc { - struct device sc_dev; - struct pxapcic_socket sc_socket[2]; - - bus_space_tag_t sc_iot; - bus_space_handle_t sc_memctl_ioh; - - void *sc_irq; - int sc_shutdown; - int sc_nslots; - int sc_irqpin[2]; - int sc_irqcfpin[2]; -}; - -void pxapcic_attach(struct pxapcic_softc *, - void (*socket_setup_hook)(struct pxapcic_socket *)); -int pxapcic_intr(void *); diff --git a/sys/arch/zaurus/Makefile b/sys/arch/zaurus/Makefile deleted file mode 100644 index 2c51e8c73bd..00000000000 --- a/sys/arch/zaurus/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# $OpenBSD: Makefile,v 1.9 2016/05/31 18:37:04 tedu Exp $ - -S= ${.CURDIR}/../.. -KFILE= GENERIC -.if exists(conf/GENERIC.MP) -KFILE= GENERIC.MP -.endif -TDIRS= ${_arch} include -TAGS= ${.CURDIR}/tags - -NOPROG= -NOMAN= -NOOBJ= -SUBDIR= stand - -# config the fattest kernel we can find into a temporary dir -# to create a Makefile. Then use make to pull some variables -# out and push them into the sub-shell to expand the paths, -# and finally run ctags. -tags:: - TDIR=`mktemp -d /tmp/_tagXXXXXXXXXX` || exit 1; \ - eval "S=${S}" && \ - config -s ${S} -b $${TDIR} ${.CURDIR}/conf/${KFILE} && \ - eval "_arch=\"`make -V _arch -f $${TDIR}/Makefile`\"" && \ - eval "_mach=\"`make -V _mach -f $${TDIR}/Makefile`\"" && \ - eval "_machdir=\$S/arch/$${_mach}" && \ - eval "_archdir=\$S/arch/$${_arch}" && \ - eval "HFILES=\"`find $S \( -path $S/arch -o -path $S/stand -o -path $S/lib/libsa -o -path $S/lib/libkern/arch \) -prune -o -name '*.h'; find $${_machdir} $${_archdir} $S/lib/libkern/arch/$${_arch} \( -name boot -o -name stand \) -prune -o -name '*.h'`\"" && \ - eval "SFILES=\"`make -V SFILES -f $${TDIR}/Makefile`\"" && \ - eval "CFILES=\"`make -V CFILES -f $${TDIR}/Makefile`\"" && \ - eval "AFILES=\"`make -V AFILES -f $${TDIR}/Makefile`\"" && \ - ctags -wd -f ${TAGS} $${CFILES} $${HFILES} && \ - egrep "^[_A-Z]*ENTRY[_A-Z]*\(.*\)" $${SFILES} $${AFILES} | \ - sed "s;\\([^:]*\\):\\([^(]*\\)(\\([^, )]*\\)\\(.*\\);\\3 \\1 /^\\2(\\3\\4$$/;" \ - >> ${TAGS} && \ - sort -o ${TAGS} ${TAGS} && \ - rm -rf $${TDIR} - -links: - -for i in conf ${TDIRS}; do \ - (cd $$i && rm -f tags; ln -s tags tags); done - -obj: _SUBDIRUSE - -.include <bsd.prog.mk> diff --git a/sys/arch/zaurus/compile/.cvsignore b/sys/arch/zaurus/compile/.cvsignore deleted file mode 100644 index b72af3039e6..00000000000 --- a/sys/arch/zaurus/compile/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -GENERIC -RAMDISK diff --git a/sys/arch/zaurus/conf/GENERIC b/sys/arch/zaurus/conf/GENERIC deleted file mode 100644 index 4d68c6aedae..00000000000 --- a/sys/arch/zaurus/conf/GENERIC +++ /dev/null @@ -1,229 +0,0 @@ -# $OpenBSD: GENERIC,v 1.103 2016/06/28 04:41:37 jmatthew Exp $ -# -# For further information on compiling OpenBSD kernels, see the config(8) -# man page. -# -# For further information on hardware support for this architecture, see -# the intro(4) man page. For further information about kernel options -# for this architecture, see the options(4) man page. For an explanation -# of each device driver in this file see the section 4 man page for the -# device. - -machine zaurus arm -include "../../../conf/GENERIC" -maxusers 32 # estimated number of users - -options ARM32 -options PXAGPIO_HAS_GPION_INTRS - -makeoptions KERNEL_BASE_PHYS="0xa0200000" -makeoptions KERNEL_BASE_VIRT="0xc0200000" - -# CPU options -options CPU_XSCALE_PXA2X0 # Support the XScale core -#options XSCALE_CACHE_WRITE_THROUGH -options XSCALE_CACHE_WRITE_BACK -makeoptions CPUFLAGS="-mcpu=xscale" - -option WSDISPLAY_COMPAT_USL # VT handling -option WSDISPLAY_COMPAT_RAWKBD # provide raw scancodes; needed for X11 -option WSDISPLAY_DEFAULTSCREENS=2 # initial number of text consoles - -option USBVERBOSE - -config bsd swap generic - -# The main bus device -mainbus0 at root -cpu0 at mainbus? -pxaip0 at mainbus? - -pxaintc0 at pxaip? # interrupt controller -pxagpio0 at pxaip? # GPIO controller -pxadmac0 at pxaip? # DMA controller -pxaost0 at pxaip? addr 0x40a00000 size 0x20 - -# PCMCIA/CF socket and GPIO controllers -scoop0 at pxaip? -scoop1 at pxaip? - -# touch screen -zts0 at pxaip? -wsmouse* at zts? mux 0 - -# keyboard -zkbd0 at pxaip? -wskbd* at zkbd? mux 1 - -# USB controllers -pxaudc0 at pxaip? # USB Device Controller -ohci0 at pxaip? # Open Host Controller - -# USB function support -usbf* at pxaudc? # USB logical device -cdcef* at usbf? # CDC ethernet function - -# USB bus support -usb* at ohci? - -# USB devices -uhub* at usb? # USB Root Hub -uhub* at uhub? # USB Hub -ualea* at uhub? # Araneus Alea II TRNG -uonerng* at uhub? # Moonbase Otago OneRNG -umodem* at uhub? # USB Modems/Serial -ucom* at umodem? -uvisor* at uhub? # Handspring Visor -ucom* at uvisor? -uvscom* at uhub? # SUNTAC Slipper U VS-10U serial -ucom* at uvscom? -ubsa* at uhub? # Belkin serial adapter -ucom* at ubsa? -uftdi* at uhub? # FTDI FT8U100AX serial adapter -ucom* at uftdi? -uplcom* at uhub? # I/O DATA USB-RSAQ2 serial adapter -ucom* at uplcom? -umct* at uhub? # MCT USB-RS232 serial adapter -ucom* at umct? -uslcom* at uhub? # Silicon Laboratories CP210x serial -ucom* at uslcom? -uark* at uhub? # Arkmicro ARK3116 serial -ucom* at uark? -uipaq* at uhub? # iPAQ serial adapter -ucom* at uipaq? -uchcom* at uhub? # WinChipHead CH341/340 serial -ucom* at uchcom? -uaudio* at uhub? # USB Audio -audio* at uaudio? -umidi* at uhub? # USB MIDI -midi* at umidi? -ulpt* at uhub? # USB Printers -umass* at uhub? # USB Mass Storage devices -uhidev* at uhub? # Human Interface Devices -ums* at uhidev? # USB mouse -wsmouse* at ums? mux 0 -ukbd* at uhidev? # USB keyboard -wskbd* at ukbd? mux 1 -ucycom* at uhidev? # Cypress serial -ucom* at ucycom? -uslhcom* at uhidev? # Silicon Labs CP2110 USB HID UART -ucom* at uslhcom? -uhid* at uhidev? # USB generic HID support -upd* at uhidev? # USB Power Devices sensors -aue* at uhub? # ADMtek AN986 Pegasus Ethernet -atu* at uhub? # Atmel AT76C50x based 802.11b -axe* at uhub? # ASIX Electronics AX88172 USB Ethernet -axen* at uhub? # ASIX Electronics AX88179 USB Ethernet -cue* at uhub? # CATC USB-EL1201A based Ethernet -kue* at uhub? # Kawasaki KL5KUSB101B based Ethernet -smsc* at uhub? # SMSC LAN95xx Ethernet -cdce* at uhub? # CDC Ethernet -urndis* at uhub? # Remote NDIS devices -upl* at uhub? # Prolific PL2301/PL2302 host-to-host -ugl* at uhub? # Genesys Logic GL620A-USB host-to-host -udav* at uhub? # Davicom DM9601 based Ethernet -ural* at uhub? # Ralink RT2500USB -rum* at uhub? # Ralink RT2501USB/RT2601USB -run* at uhub? # Ralink RT2700U/RT2800U/RT3000U -zyd* at uhub? # Zydas ZD1211 -url* at uhub? # Realtek RTL8150L based adapters -ure* at uhub? # Realtek RTL8152 based adapters -wi* at uhub? # WaveLAN IEEE 802.11DS -udsbr* at uhub? # D-Link DSB-R100 radio -radio* at udsbr? # USB radio -ugen* at uhub? # USB Generic driver -udcf* at uhub? # Gude Expert mouseCLOCK -umbg* at uhub? # Meinberg Funkuhren USB5131 -uow* at uhub? # Maxim/Dallas DS2490 1-Wire adapter -onewire* at uow? -utwitch* at uhidev? # YUREX BBU sensor - -scsibus* at scsi? -sd* at scsibus? # SCSI disk drives -#st* at scsibus? # SCSI tape drives -cd* at scsibus? # SCSI CD-ROM drives -#ch* at scsibus? # SCSI autochangers -#uk* at scsibus? # unknown SCSI - -# integrated 16550 UARTs -options COM_PXA2X0 -com0 at pxaip? addr 0x40100000 intr 22 # Full Function UART -com1 at pxaip? addr 0x40200000 intr 21 # BlueTooth UART -com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA) - -# integrated PCMCIA/CF controller -pxapcic0 at pxaip? - -# PCMCIA bus support -pcmcia* at pxapcic? - -# PCMCIA (CF) devices -com* at pcmcia? # PCMCIA modems/serial ports -wi* at pcmcia? # WaveLAN IEEE 802.11DS -malo* at pcmcia? # Marvell 88W8385 -ne* at pcmcia? # PCMCIA based NE2000 ethernet -wdc* at pcmcia? # hard disk controller -#cfxga* at pcmcia? # VoyagerVGA frame buffer -#wsdisplay* at cfxga? - -# IDE hard drives -wd* at wdc? flags 0x0000 - -# Media Independent Interface (mii) drivers -exphy* at mii? # 3Com internal PHYs -inphy* at mii? # Intel 82555 PHYs -iophy* at mii? # Intel 82553 PHYs -icsphy* at mii? # ICS 1890 PHYs -lxtphy* at mii? # Level1 LXT970 PHYs -nsphy* at mii? # NS and compatible PHYs -nsphyter* at mii? # NS and compatible PHYs -qsphy* at mii? # Quality Semi QS6612 PHYs -sqphy* at mii? # Seeq 8x220 PHYs -rlphy* at mii? # Realtek 8139 internal PHYs -mtdphy* at mii? # Myson MTD972 PHYs -#dcphy* at mii? # Digital Clone PHYs -acphy* at mii? # Altima AC101 PHYs -amphy* at mii? # AMD 79C873 PHYs -tqphy* at mii? # TDK 78Q212x PHYs -bmtphy* at mii? # Broadcom 10/100 PHYs -#brgphy* at mii? # Broadcom Gigabit PHYs -eephy* at mii? # Marvell 88E1000 series PHY -#xmphy* at mii? # XaQti XMAC-II PHYs -nsgphy* at mii? # NS gigabit PHYs -urlphy* at mii? # Realtek RTL8150L internal PHY -rgephy* at mii? # Realtek 8169S/8110S PHY -#ciphy* at mii? # Cicada CS8201 10/100/1000 copper PHY -ukphy* at mii? # "unknown" PHYs - -lcd0 at pxaip? # LCD -wsdisplay* at lcd? console ? -zssp0 at pxaip? # ADC, touch screen, backlight -apm0 at pxaip? # APM emulation - -zaudio0 at pxaip? # Zaurus I2S/I2C sound -audio* at zaudio? -zrc0 at pxaip? # Zaurus remote control -wskbd* at zrc? mux 1 -flash0 at pxaip? # NAND flash memory - -pxammc0 at pxaip? # MMC/SD/SDIO controller -sdmmc* at pxammc? # SD/MMC bus - -# USB Video -uvideo* at uhub? -video* at uvideo? - -utvfu* at uhub? # Fushicai Audio-Video Grabber -video* at utvfu? -audio* at utvfu? - -# 1-Wire devices -option ONEWIREVERBOSE -owid* at onewire? # ID -owsbm* at onewire? # Smart Battery Monitor -owtemp* at onewire? # Temperature -owctr* at onewire? # Counter device - -# Pseudo-Devices -pseudo-device wsmux 2 # mouse & keyboard multiplexor -pseudo-device hotplug 1 # devices hot plugging diff --git a/sys/arch/zaurus/conf/Makefile.zaurus b/sys/arch/zaurus/conf/Makefile.zaurus deleted file mode 100644 index 29eb7b4dad7..00000000000 --- a/sys/arch/zaurus/conf/Makefile.zaurus +++ /dev/null @@ -1,175 +0,0 @@ -# $OpenBSD: Makefile.zaurus,v 1.55 2016/04/29 12:44:53 mpi Exp $ - -# For instructions on building kernels consult the config(8) and options(4) -# manual pages. -# -# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE -# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING -# DEBUG is set to -g by config if debugging is requested (config -g). -# PROF is set to -pg by config if profiling is requested (config -p). - -.include <bsd.own.mk> - -SIZE?= size -STRIP?= strip - -# source tree is located via $S relative to the compilation directory -.ifndef S -S!= cd ../../../..; pwd -.endif - -_machdir?= $S/arch/${_mach} -_archdir?= $S/arch/${_arch} - -INCLUDES= -nostdinc -I$S -I. -I$S/arch -CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP -CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \ - -Wno-main -Wno-uninitialized \ - -Wframe-larger-than=2047 - -CMACHFLAGS= -ffreestanding -msoft-float # -march=armv4 -mtune=strongarm -CMACHFLAGS+= -fno-builtin-printf -fno-builtin-snprintf \ - -fno-builtin-vsnprintf -fno-builtin-log \ - -fno-builtin-log2 -fno-builtin-malloc ${NOPIE_FLAGS} -.if ${IDENT:M-DNO_PROPOLICE} -CMACHFLAGS+= -fno-stack-protector -.endif - -COPTS?= -O2 -CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} -AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LINKFLAGS= -T ldscript --warn-common -nopie - -.if ${IDENT:M-DDDB_STRUCT} -DB_STRUCTINFO= db_structinfo.h -.else -DB_STRUCTINFO= -.endif - -HOSTCC?= ${CC} -HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} -HOSTED_CFLAGS= ${CFLAGS} -HOSTED_C= ${HOSTCC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< - -NORMAL_C_NOP= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< -NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< - -%OBJS - -%CFILES - -%SFILES - -# load lines for config "xxx" will be emitted as: -# xxx: ${SYSTEM_DEP} swapxxx.o -# ${SYSTEM_LD_HEAD} -# ${SYSTEM_LD} swapxxx.o -# ${SYSTEM_LD_TAIL} -SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o -SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} -SYSTEM_LD_HEAD= @rm -f $@ -SYSTEM_LD_HEAD+=; \ - cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ - sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \ - -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ldscript - -SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ - ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} -SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ - -DEBUG?= -.if ${DEBUG} == "-g" -STRIPFLAGS= -S -SYSTEM_LD_TAIL+=; \ - echo mv $@ $@.gdb; rm -f $@.gdb; mv $@ $@.gdb; \ - echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ - ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb -.else -LINKFLAGS+= -S -.endif - -%LOAD - -# cc's -MD puts the source and output paths in the dependency file; -# since those are temp files here we need to fix it up. It also -# puts the file in /tmp, so we use -MF to put it in the current -# directory as assym.P and then generate assym.d from it with a -# good target name -assym.h: $S/kern/genassym.sh Makefile \ - ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf - cat ${_archdir}/${_arch}/genassym.cf ${_machdir}/${_mach}/genassym.cf | \ - sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} -MF assym.P > assym.h.tmp - sed '1s/.*/assym.h: \\/' assym.P > assym.d - sort -u assym.h.tmp > assym.h - -param.c: $S/conf/param.c - rm -f param.c - cp $S/conf/param.c . - -param.o: param.c Makefile - ${NORMAL_C} - -mcount.o: $S/lib/libkern/mcount.c Makefile - ${NORMAL_C_NOP} - -ioconf.o: ioconf.c - ${NORMAL_C} - -vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} - sh $S/conf/newvers.sh - ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c - -clean:: - rm -f eddep *bsd *bsd.gdb tags *.[dio] [a-z]*.s \ - [Ee]rrs linterrs assym.h ${DB_STRUCTINFO} - -lint: - @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ - ${CFILES} ioconf.c param.c | \ - grep -v 'static function .* unused' - -depend: - @touch $@ - -tags: - @echo "see $S/kern/Makefile for tags" - -db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.pl - ${CC} ${CFLAGS} ${CPPFLAGS} -MT $@ -gstabs -c $S/ddb/db_structinfo.c - objdump -g db_structinfo.o | perl $S/ddb/parse_structinfo.pl > $@ - rm -f db_structinfo.o - -${_mach}_start.o: ${_machdir}/${_mach}/${_mach}_start.S -locore.o: ${_archdir}/${_arch}/locore.S assym.h -in_cksum_arm.o fiq_subr.o bcopyinout.o copystr.o sigcode.o: assym.h -vectors.o cpuswitch.o exception.o bcopy_page.o irq_dispatch.o: assym.h -zaurus_start.o: assym.h - -# The install target can be redefined by putting a -# install-kernel-${MACHINE_NAME} target into /etc/mk.conf -MACHINE_NAME!= uname -n -install: install-kernel-${MACHINE_NAME} -.if !target(install-kernel-${MACHINE_NAME}}) -install-kernel-${MACHINE_NAME}: - cmp -s bsd /bsd || ln -f /bsd /obsd - cp bsd /nbsd - mv /nbsd /bsd -.endif - -# pull in the dependency information -.if !empty(DB_STRUCTINFO) && !exists(${DB_STRUCTINFO}) - ${SYSTEM_OBJ}: ${DB_STRUCTINFO} -.endif -.ifnmake clean -. for o in ${SYSTEM_OBJ} assym.h ${DB_STRUCTINFO} -. if exists(${o:R}.d) -. include "${o:R}.d" -. elif exists($o) - .PHONY: $o -. endif -. endfor -.endif - -%RULES diff --git a/sys/arch/zaurus/conf/RAMDISK b/sys/arch/zaurus/conf/RAMDISK deleted file mode 100644 index 5fd3f586de2..00000000000 --- a/sys/arch/zaurus/conf/RAMDISK +++ /dev/null @@ -1,127 +0,0 @@ -# $OpenBSD: RAMDISK,v 1.54 2016/06/28 04:41:37 jmatthew Exp $ - -machine zaurus arm -maxusers 4 - -option TIMEZONE=0 -option DST=0 -option SMALL_KERNEL -option NO_PROPOLICE -option BOOT_CONFIG - -option MINIROOTSIZE=5120 -option RAMDISK_HOOKS - -option FFS -option CD9660 -option MSDOSFS -option INET6 -option EXT2FS -option CRYPTO - -option ARM32 -option PXAGPIO_HAS_GPION_INTRS - -makeoptions KERNEL_BASE_PHYS="0xa0200000" -makeoptions KERNEL_BASE_VIRT="0xc0200000" - -option CPU_XSCALE_PXA2X0 -#option XSCALE_CACHE_WRITE_THROUGH -option XSCALE_CACHE_WRITE_BACK -makeoptions CPUFLAGS="-mcpu=xscale" - -config bsd root on rd0a swap on rd0b - -mainbus0 at root -cpu0 at mainbus? -pxaip0 at mainbus? -pxaintc0 at pxaip? # interrupt controller -pxagpio0 at pxaip? -scoop0 at pxaip? -scoop1 at pxaip? -pxaost0 at pxaip? addr 0x40a00000 size 0x20 - -lcd0 at pxaip? -wsdisplay* at lcd? console ? -zssp0 at pxaip? # ADC, touch screen, backlight -zts0 at pxaip? # touch screen -wsmouse* at zts? mux 0 -zkbd0 at pxaip? -wskbd* at zkbd? mux 1 -pxaudc0 at pxaip? # USB Device Controller - -ohci0 at pxaip? -usbf* at pxaudc? # USB logical device -cdcef* at usbf? # CDC ethernet function -usb* at ohci? - -uhub* at usb? -uhub* at uhub? -uhidev* at uhub? -uhid* at uhidev? # USB Generic HID devices -ukbd* at uhidev? # USB HID Keyboard devices -wskbd* at ukbd? mux 1 -aue* at uhub? # ADMtek AN986 Pegasus Ethernet -axe* at uhub? # ASIX Electronics AX88172 USB Ethernet -axen* at uhub? # ASIX Electronics AX88179 USB Ethernet -cdce* at uhub? # CDC Ethernet -cue* at uhub? # CATC USB-EL1201A based Ethernet -kue* at uhub? # Kawasaki KL5KUSB101B based Ethernet -smsc* at uhub? # SMSC LAN95xx Ethernet -udav* at uhub? # Davicom DM9601 based Ethernet -ural* at uhub? # Ralink RT2500 -url* at uhub? # Realtek RTL8150L based adapters -ure* at uhub? # Realtek RTL8152 based adapters -wi* at uhub? # WaveLAN IEEE 802.11DS -upl* at uhub? # Prolific PL2301/PL2302 host-to-host -ugl* at uhub? # Genesys Logic GL620USB-A host-to-host -umass* at uhub? - -pxammc0 at pxaip? # MMC/SD/SDIO controller -sdmmc* at pxammc? # SD/MMC bus -softraid0 at root - -scsibus* at scsi? -sd* at scsibus? -cd* at scsibus? - -option COM_PXA2X0 -com0 at pxaip? addr 0x40100000 intr 22 # Full Function UART -com1 at pxaip? addr 0x40200000 intr 21 # BlueTooth UART -com2 at pxaip? addr 0x40700000 intr 20 # Standard UART (for IrDA) - -pxapcic0 at pxaip? -pcmcia* at pxapcic? -wi* at pcmcia? -ne* at pcmcia? -wdc* at pcmcia? -wd* at wdc? flags 0x0000 - -exphy* at mii? # 3Com internal PHYs -inphy* at mii? # Intel 82555 PHYs -iophy* at mii? # Intel 82553 PHYs -icsphy* at mii? # ICS 1890 PHYs -lxtphy* at mii? # Level1 LXT970 PHYs -nsphy* at mii? # NS and compatible PHYs -nsphyter* at mii? # NS and compatible PHYs -qsphy* at mii? # Quality Semi QS6612 PHYs -sqphy* at mii? # Seeq 8x220 PHYs -rlphy* at mii? # Realtek 8139 internal PHYs -mtdphy* at mii? # Myson MTD972 PHYs -acphy* at mii? # Altima AC101 PHYs -amphy* at mii? # AMD 79C873 PHYs -tqphy* at mii? # TDK 78Q212x PHYs -bmtphy* at mii? # Broadcom 10/100 PHYs -eephy* at mii? # Marvell 88E1000 series PHY -nsgphy* at mii? # NS gigabit PHYs -urlphy* at mii? # Realtek RTL8150L internal PHY -rgephy* at mii? # Realtek 8169S/8110S PHY -ukphy* at mii? # "unknown" PHYs - -apm0 at pxaip? # APM emulation - -pseudo-device wsmux 2 -pseudo-device loop 1 -pseudo-device bpfilter 1 -pseudo-device rd 1 -pseudo-device bio 1 diff --git a/sys/arch/zaurus/conf/files.zaurus b/sys/arch/zaurus/conf/files.zaurus deleted file mode 100644 index b805fb9ab7b..00000000000 --- a/sys/arch/zaurus/conf/files.zaurus +++ /dev/null @@ -1,120 +0,0 @@ -# $OpenBSD: files.zaurus,v 1.32 2016/01/08 15:54:13 jcs Exp $ -# -# First try for arm-specific configuration info -# - -maxpartitions 16 -maxusers 2 8 64 - -major {wd = 16} -major {sd = 24} -major {cd = 26} -major {rd = 18} - -file arch/arm/arm/conf.c - -file arch/zaurus/zaurus/zaurus_machdep.c - -# -# Machine-independent SCSI drivers -# -include "scsi/files.scsi" -include "dev/atapiscsi/files.atapiscsi" - -# CPU support and integrated peripherals -include "arch/arm/xscale/files.pxa2x0" - -# LCD frame buffer -attach lcd at pxaip with lcd_pxaip -file arch/zaurus/zaurus/zaurus_lcd.c lcd_pxaip - -# GPIO keyboard -device zkbd: wskbddev -attach zkbd at pxaip -file arch/zaurus/dev/zaurus_kbd.c zkbd - -# 16-bit GPIO controller -device scoop -attach scoop at pxaip -file arch/zaurus/dev/zaurus_scoop.c scoop - -# PCMCIA/CF socket controller -attach pxapcic at pxaip with pxapcic_scoop -file arch/zaurus/dev/scoop_pcic.c pxapcic_scoop - -# SD/MMC socket controller -attach pxammc at pxaip with pxammc_scoop -file arch/zaurus/dev/scoop_mmc.c pxammc_scoop - -# Dedicated SSP unit for ADC, touch screen, and backlight -device zssp -attach zssp at pxaip -file arch/zaurus/dev/zaurus_ssp.c zssp - -# Power manager and APM emulation -attach apm at pxaip with apm_pxaip -file arch/zaurus/dev/zaurus_apm.c apm_pxaip - -# Zaurus touchpad -device zts: wsmousedev -attach zts at pxaip -file arch/zaurus/dev/zts.c zts - -# Zaurus sound -device zaudio: audio, i2s, i2c -attach zaudio at pxaip -file arch/zaurus/dev/zaurus_audio.c zaudio - -# Zaurus remote control -device zrc: wskbddev -attach zrc at pxaip -file arch/zaurus/dev/zaurus_remote.c zrc - -# NAND flash pseudo-disk device (Xilinx NAND flash controller) -device flash: disk -attach flash at pxaip with flash_pxaip -file arch/zaurus/dev/zaurus_flash.c flash_pxaip - -# -# Machine-independent ATA drivers -# -include "dev/ata/files.ata" - -# Generic MD files -file arch/zaurus/zaurus/autoconf.c - -file arch/arm/arm/disksubr.c disk - -# ARM FPE -file arch/arm/fpe-arm/armfpe_glue.S armfpe -file arch/arm/fpe-arm/armfpe_init.c armfpe -file arch/arm/fpe-arm/armfpe.s armfpe - -# Include WSCONS stuff -include "dev/wscons/files.wscons" -include "dev/rasops/files.rasops" -include "dev/wsfont/files.wsfont" - -# -# Machine-independent HID support -# -include "dev/hid/files.hid" - -# Include USB stuff -include "dev/usb/files.usb" - -attach pxaudc at pxaip with pxaudc_zaurus -file arch/zaurus/dev/zaurus_udc.c pxaudc_zaurus - -# Media Independent Interface (mii) -include "dev/mii/files.mii" - -# -# Machine-independent SD/MMC drivers -# -include "dev/sdmmc/files.sdmmc" - -# -# Machine-independent 1-Wire drivers -# -include "dev/onewire/files.onewire" diff --git a/sys/arch/zaurus/dev/scoop_mmc.c b/sys/arch/zaurus/dev/scoop_mmc.c deleted file mode 100644 index 3af95d7a84d..00000000000 --- a/sys/arch/zaurus/dev/scoop_mmc.c +++ /dev/null @@ -1,82 +0,0 @@ -/* $OpenBSD: scoop_mmc.c,v 1.2 2009/09/03 21:40:29 marex Exp $ */ - -/* - * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* Attachment driver for pxammc(4) on Zaurus */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/systm.h> - -#include <dev/sdmmc/sdmmcreg.h> - -#include <machine/machine_reg.h> - -#include <arch/arm/xscale/pxammcvar.h> -#include <arch/zaurus/dev/zaurus_scoopvar.h> - -int scoop_mmc_match(struct device *, void *, void *); -void scoop_mmc_attach(struct device *, struct device *, void *); - -struct cfattach pxammc_scoop_ca = { - sizeof(struct pxammc_softc), scoop_mmc_match, - scoop_mmc_attach -}; - -u_int32_t scoop_mmc_get_ocr(void *); -int scoop_mmc_set_power(void *, u_int32_t); - -int -scoop_mmc_match(struct device *parent, void *match, void *aux) -{ - return pxammc_match(); -} - -void -scoop_mmc_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxammc_softc *sc = (struct pxammc_softc *)self; - - sc->tag.cookie = (void *)sc; - sc->tag.get_ocr = scoop_mmc_get_ocr; - sc->tag.set_power = scoop_mmc_set_power; - - sc->sc_gpio_detect = GPIO_MMC_DETECT; - - pxammc_attach(sc, aux); -} - -u_int32_t -scoop_mmc_get_ocr(void *cookie) -{ - return MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V; -} - -int -scoop_mmc_set_power(void *cookie, u_int32_t ocr) -{ - if (ISSET(ocr, MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V)) { - scoop_set_sdmmc_power(1); - return 0; - } else if (ocr != 0) { - printf("scoop_mmc_set_power: unsupported OCR (%#x)\n", ocr); - return EINVAL; - } else { - scoop_set_sdmmc_power(0); - return 0; - } -} diff --git a/sys/arch/zaurus/dev/scoop_pcic.c b/sys/arch/zaurus/dev/scoop_pcic.c deleted file mode 100644 index c0672c5e61c..00000000000 --- a/sys/arch/zaurus/dev/scoop_pcic.c +++ /dev/null @@ -1,253 +0,0 @@ -/* $OpenBSD: scoop_pcic.c,v 1.5 2014/05/08 21:17:01 miod Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> - -#include <uvm/uvm_extern.h> - -#include <arch/arm/xscale/pxa2x0var.h> -#include <arch/arm/xscale/pxapcicvar.h> - -#include <machine/machine_reg.h> -#include <machine/zaurus_var.h> - -#include <zaurus/dev/zaurus_scoopreg.h> - -int scoop_pcic_match(struct device *, void *, void *); -void scoop_pcic_attach(struct device *, struct device *, void *); -void scoop_pcic_socket_setup(struct pxapcic_socket *); - -struct cfattach pxapcic_scoop_ca = { - sizeof(struct pxapcic_softc), scoop_pcic_match, - scoop_pcic_attach -}; - -u_int scoop_pcic_read(struct pxapcic_socket *, int); -void scoop_pcic_write(struct pxapcic_socket *, int, u_int); -void scoop_pcic_set_power(struct pxapcic_socket *, int); -void scoop_pcic_clear_intr(struct pxapcic_socket *); - -struct pxapcic_tag scoop_pcic_functions = { - scoop_pcic_read, - scoop_pcic_write, - scoop_pcic_set_power, - scoop_pcic_clear_intr, - 0, /* intr_establish */ - 0, /* intr_disestablish */ - 0 /* intr_string */ -}; - -int -scoop_pcic_match(struct device *parent, void *cf, void *aux) -{ - return (ZAURUS_ISC860 || ZAURUS_ISC3000); -} - -void -scoop_pcic_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxapcic_softc *sc = (struct pxapcic_softc *)self; - struct pxaip_attach_args *pxa = aux; - - sc->sc_iot = pxa->pxa_iot; - - if (ZAURUS_ISC860) { - sc->sc_nslots = 1; - sc->sc_irqpin[0] = C860_CF0_IRQ; - sc->sc_irqcfpin[0] = C860_CF0_IRQ_PIN; - } else if (ZAURUS_ISC3000) { - sc->sc_nslots = 2; - sc->sc_irqpin[0] = C3000_CF0_IRQ; - sc->sc_irqcfpin[0] = C3000_CF0_IRQ_PIN; - sc->sc_irqpin[1] = C3000_CF1_IRQ; - sc->sc_irqcfpin[1] = C3000_CF1_IRQ_PIN; - } - - pxapcic_attach(sc, &scoop_pcic_socket_setup); -} - -void -scoop_pcic_socket_setup(struct pxapcic_socket *so) -{ - struct pxapcic_softc *sc; - bus_addr_t pa; - bus_size_t size = SCOOP_SIZE; - bus_space_tag_t iot; - bus_space_handle_t scooph; - int error; - - sc = so->sc; - iot = sc->sc_iot; - - if (so->socket == 0) - pa = C3000_SCOOP0_BASE; - else if (so->socket == 1) - pa = C3000_SCOOP1_BASE; - else - panic("%s: invalid CF slot %d", sc->sc_dev.dv_xname, - so->socket); - error = bus_space_map(iot, trunc_page(pa), round_page(size), - 0, &scooph); - if (error) - panic("%s: can't map memory %lx for scoop", - sc->sc_dev.dv_xname, pa); - scooph += pa - trunc_page(pa); - - bus_space_write_2(iot, scooph, SCOOP_IMR, - SCP_IMR_UNKN0 | SCP_IMR_UNKN1); - - /* setup */ - bus_space_write_2(iot, scooph, SCOOP_MCR, 0x0100); - bus_space_write_2(iot, scooph, SCOOP_CDR, 0x0000); - bus_space_write_2(iot, scooph, SCOOP_CPR, 0x0000); - bus_space_write_2(iot, scooph, SCOOP_IMR, 0x0000); - bus_space_write_2(iot, scooph, SCOOP_IRM, 0x00ff); - bus_space_write_2(iot, scooph, SCOOP_ISR, 0x0000); - bus_space_write_2(iot, scooph, SCOOP_IRM, 0x0000); - - /* C3000 */ - if (so->socket == 1) { - bus_space_write_2(iot, scooph, SCOOP_CPR, 0x80c1); - bus_space_write_2(iot, scooph, SCOOP_IMR, 0x00c4); - bus_space_write_2(iot, scooph, SCOOP_MCR, 0x0111); - } else { - bus_space_write_2(iot, scooph, SCOOP_CPR, - SCP_CPR_PWR|SCP_CPR_5V); - } - - bus_space_write_2(iot, scooph, SCOOP_IMR, 0x00ce); - bus_space_write_2(iot, scooph, SCOOP_MCR, 0x0111); - - /* C3000 */ - so->power_capability = PXAPCIC_POWER_3V; - if (so->socket == 0) - so->power_capability |= PXAPCIC_POWER_5V; - - so->pcictag_cookie = (void *)scooph; - so->pcictag = &scoop_pcic_functions; -} - -u_int -scoop_pcic_read(struct pxapcic_socket *so, int reg) -{ - bus_space_tag_t iot = so->sc->sc_iot; - bus_space_handle_t ioh = (bus_space_handle_t)so->pcictag_cookie; - u_int16_t csr; - - csr = bus_space_read_2(iot, ioh, SCOOP_CSR); - - switch (reg) { - case PXAPCIC_CARD_STATUS: - if (csr & SCP_CSR_MISSING) - return (PXAPCIC_CARD_INVALID); - else - return (PXAPCIC_CARD_VALID); - - case PXAPCIC_CARD_READY: - return ((bus_space_read_2(iot, ioh, SCOOP_CSR) & - SCP_CSR_READY) != 0); - - default: - panic("scoop_pcic_read: bogus register"); - } -} - -void -scoop_pcic_write(struct pxapcic_socket *so, int reg, u_int val) -{ - bus_space_tag_t iot = so->sc->sc_iot; - bus_space_handle_t ioh = (bus_space_handle_t)so->pcictag_cookie; - u_int16_t newval; - int s; - - s = splhigh(); - - switch (reg) { - case PXAPCIC_CARD_POWER: - newval = bus_space_read_2(iot, ioh, SCOOP_CPR); - newval &= ~(SCP_CPR_PWR | SCP_CPR_3V | SCP_CPR_5V); - - if (val == PXAPCIC_POWER_3V) - newval |= (SCP_CPR_PWR | SCP_CPR_3V); - else if (val == PXAPCIC_POWER_5V) - newval |= (SCP_CPR_PWR | SCP_CPR_5V); - - bus_space_write_2(iot, ioh, SCOOP_CPR, newval); - break; - - case PXAPCIC_CARD_RESET: - bus_space_write_2(iot, ioh, SCOOP_CCR, - val ? SCP_CCR_RESET : 0); - break; - - default: - panic("scoop_pcic_write: bogus register"); - } - - splx(s); -} - -void -scoop_pcic_set_power(struct pxapcic_socket *so, int pwr) -{ - bus_space_tag_t iot = so->sc->sc_iot; - bus_space_handle_t ioh = (bus_space_handle_t)so->pcictag_cookie; - u_int16_t reg; - int s; - - s = splhigh(); - - switch (pwr) { - case PXAPCIC_POWER_OFF: -#if 0 - /* XXX does this disable power to both sockets? */ - reg = bus_space_read_2(iot, ioh, SCOOP_GPWR); - bus_space_write_2(iot, ioh, SCOOP_GPWR, - reg & ~(1 << SCOOP0_CF_POWER_C3000)); -#endif - break; - - case PXAPCIC_POWER_3V: - case PXAPCIC_POWER_5V: - /* XXX */ - if (so->socket == 0) { - reg = bus_space_read_2(iot, ioh, SCOOP_GPWR); - bus_space_write_2(iot, ioh, SCOOP_GPWR, - reg | (1 << SCOOP0_CF_POWER_C3000)); - } - break; - - default: - splx(s); - panic("scoop_pcic_set_power: bogus power state"); - } - - splx(s); -} - -void -scoop_pcic_clear_intr(struct pxapcic_socket *so) -{ - bus_space_tag_t iot = so->sc->sc_iot; - bus_space_handle_t ioh = (bus_space_handle_t)so->pcictag_cookie; - - bus_space_write_2(iot, ioh, SCOOP_IRM, 0x00ff); - bus_space_write_2(iot, ioh, SCOOP_ISR, 0x0000); - bus_space_write_2(iot, ioh, SCOOP_IRM, 0x0000); -} diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c deleted file mode 100644 index a0c2e1685d6..00000000000 --- a/sys/arch/zaurus/dev/zaurus_apm.c +++ /dev/null @@ -1,731 +0,0 @@ -/* $OpenBSD: zaurus_apm.c,v 1.34 2015/09/28 18:36:36 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/timeout.h> -#include <sys/conf.h> -#include <sys/proc.h> -#include <sys/buf.h> -#include <sys/sysctl.h> -#include <sys/mutex.h> -#include <sys/reboot.h> -#include <sys/rwlock.h> -#include <dev/rndvar.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_apm.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <zaurus/dev/zaurus_scoopvar.h> -#include <zaurus/dev/zaurus_sspvar.h> -void zssp_init(void); /* XXX */ - -#include <zaurus/dev/zaurus_apm.h> - -#include <dev/wscons/wsdisplayvar.h> - -#include "wsdisplay.h" - -#if defined(APMDEBUG) -#define DPRINTF(x) printf x -#else -#define DPRINTF(x) /**/ -#endif - -struct zapm_softc { - struct pxa2x0_apm_softc sc; - struct timeout sc_poll; - struct timeval sc_lastbattchk; - int sc_suspended; - int sc_ac_on; - int sc_charging; - int sc_discharging; - int sc_batt_full; - int sc_batt_volt; - u_int sc_event; -}; - -int apm_match(struct device *, void *, void *); -void apm_attach(struct device *, struct device *, void *); -int apm_activate(struct device *, int); - -struct cfattach apm_pxaip_ca = { - sizeof (struct zapm_softc), apm_match, apm_attach, - NULL, apm_activate -}; -extern struct cfdriver apm_cd; - -/* MAX1111 command word */ -#define MAXCTRL_PD0 (1<<0) -#define MAXCTRL_PD1 (1<<1) -#define MAXCTRL_SGL (1<<2) -#define MAXCTRL_UNI (1<<3) -#define MAXCTRL_SEL_SHIFT 4 -#define MAXCTRL_STR (1<<7) - -/* MAX1111 ADC channels */ -#define BATT_THM 2 -#define BATT_AD 4 -#define JK_VAD 6 - -/* battery-related GPIO pins */ -#define GPIO_AC_IN_C3000 115 /* 0=AC connected */ -#define GPIO_CHRG_CO_C3000 101 /* 1=battery full */ -#define GPIO_BATT_COVER_C3000 90 /* 0=unlocked */ - -/* - * Battery-specific information - */ - -struct battery_threshold { - int bt_volt; - int bt_life; - int bt_state; -}; - -struct battery_info { - int bi_minutes; /* 100% life time */ - const struct battery_threshold *bi_thres; -}; - -const struct battery_threshold zaurus_battery_life_c3000[] = { -#if 0 - {224, 125, APM_BATT_HIGH}, /* XXX unverified */ -#endif - {194, 100, APM_BATT_HIGH}, - {188, 75, APM_BATT_HIGH}, - {184, 50, APM_BATT_HIGH}, - {180, 25, APM_BATT_LOW}, - {178, 5, APM_BATT_LOW}, - {0, 0, APM_BATT_CRITICAL}, -}; - -const struct battery_info zaurus_battery_c3000 = { - 180 /* minutes; pessimistic estimate */, - zaurus_battery_life_c3000 -}; - -const struct battery_info *zaurus_main_battery = &zaurus_battery_c3000; - -/* Restart charging this many times before accepting BATT_FULL. */ -#define MIN_BATT_FULL 2 - -/* Discharge 100 ms before reading the voltage if AC is connected. */ -#define DISCHARGE_TIMEOUT (hz / 10) - -/* Check battery voltage and "kick charging" every minute. */ -const struct timeval zapm_battchkrate = { 60, 0 }; - -/* Prototypes */ - -int zapm_acintr(void *); -int zapm_bcintr(void *); -int zapm_ac_on(void); -int max1111_adc_value(int); -int max1111_adc_value_avg(int, int); -#if 0 -int zapm_jkvad_voltage(void); -int zapm_batt_temp(void); -#endif -int zapm_batt_volt(void); -int zapm_batt_state(int); -int zapm_batt_life(int); -int zapm_batt_minutes(int); -void zapm_enable_charging(struct zapm_softc *, int); -int zapm_charge_complete(struct zapm_softc *); -void zapm_poll(void *); -int zapm_get_event(struct pxa2x0_apm_softc *, u_int *); -void zapm_power_info(struct pxa2x0_apm_softc *, struct apm_power_info *); -void zapm_suspend(struct pxa2x0_apm_softc *); -int zapm_resume(struct pxa2x0_apm_softc *); -void pxa2x0_setperf(int); -int pxa2x0_cpuspeed(int *); - - -int -apm_match(struct device *parent, void *match, void *aux) -{ - return (1); -} - -void -apm_attach(struct device *parent, struct device *self, void *aux) -{ - struct zapm_softc *sc = (struct zapm_softc *)self; - - pxa2x0_gpio_set_function(GPIO_AC_IN_C3000, GPIO_IN); - pxa2x0_gpio_set_function(GPIO_CHRG_CO_C3000, GPIO_IN); - pxa2x0_gpio_set_function(GPIO_BATT_COVER_C3000, GPIO_IN); - - (void)pxa2x0_gpio_intr_establish(GPIO_AC_IN_C3000, - IST_EDGE_BOTH, IPL_BIO, zapm_acintr, sc, "apm_ac"); - (void)pxa2x0_gpio_intr_establish(GPIO_BATT_COVER_C3000, - IST_EDGE_BOTH, IPL_BIO, zapm_bcintr, sc, "apm_bc"); - - sc->sc_event = APM_NOEVENT; - sc->sc.sc_get_event = zapm_get_event; - sc->sc.sc_power_info = zapm_power_info; - sc->sc.sc_suspend = zapm_suspend; - sc->sc.sc_resume = zapm_resume; - - timeout_set(&sc->sc_poll, &zapm_poll, sc); - - /* Get initial battery voltage. */ - zapm_enable_charging(sc, 0); - if (zapm_ac_on()) { - /* C3000: discharge 100 ms when AC is on. */ - scoop_discharge_battery(1); - delay(100000); - } - sc->sc_batt_volt = zapm_batt_volt(); - scoop_discharge_battery(0); - - pxa2x0_apm_attach_sub(&sc->sc); - - cpu_setperf = pxa2x0_setperf; - cpu_cpuspeed = pxa2x0_cpuspeed; -} - -int -apm_activate(struct device *self, int act) -{ - struct zapm_softc *sc = (struct zapm_softc *)self; - int ret = 0; - - switch (act) { - case DVACT_POWERDOWN: - zapm_enable_charging(sc, 0); - break; - } - - return (ret); -} - -int -zapm_acintr(void *v) -{ - zapm_poll(v); - return (1); -} - -int -zapm_bcintr(void *v) -{ - zapm_poll(v); - return (1); -} - -int -zapm_ac_on(void) -{ - return (!pxa2x0_gpio_get_bit(GPIO_AC_IN_C3000)); -} - -int -max1111_adc_value(int chan) -{ - - return ((int)zssp_ic_send(ZSSP_IC_MAX1111, MAXCTRL_PD0 | - MAXCTRL_PD1 | MAXCTRL_SGL | MAXCTRL_UNI | - (chan << MAXCTRL_SEL_SHIFT) | MAXCTRL_STR)); -} - -/* XXX simplify */ -int -max1111_adc_value_avg(int chan, int pause) -{ - int val[5]; - int i, j, k, x; - int sum = 0; - - for (i = 0; i < 5; i++) { - val[i] = max1111_adc_value(chan); - if (i != 4) - delay(pause * 1000); - } - - x = val[0]; - j = 0; - for (i = 1; i < 5; i++) { - if (x < val[i]) { - x = val[i]; - j = i; - } - } - - x = val[4]; - k = 4; - for (i = 3; i >= 0; i--) { - if (x > val[i]) { - x = val[i]; - k = i; - } - } - - for (i = 0; i < 5; i++) { - if (i == j || i == k) - continue; - sum += val[i]; - } - - return (sum / 3); -} - -#if 0 -/* - * Return the voltage available for charging. This will be zero, - * unless A/C power is connected. - */ -int -zapm_jkvad_voltage(void) -{ - - return (max1111_adc_value_avg(JK_VAD, 10)); -} - -int -zapm_batt_temp(void) -{ - int temp; - - scoop_battery_temp_adc(1); - delay(10000); - temp = max1111_adc_value_avg(BATT_THM, 1); - scoop_battery_temp_adc(0); - - return (temp); -} -#endif - -int -zapm_batt_volt(void) -{ - - return (max1111_adc_value_avg(BATT_AD, 10)); -} - -int -zapm_batt_state(int volt) -{ - const struct battery_threshold *bthr; - int i; - - bthr = zaurus_main_battery->bi_thres; - - for (i = 0; bthr[i].bt_volt > 0; i++) - if (bthr[i].bt_volt <= volt) - break; - - return (bthr[i].bt_state); -} - -int -zapm_batt_life(int volt) -{ - const struct battery_threshold *bthr; - int i; - - bthr = zaurus_main_battery->bi_thres; - - for (i = 0; bthr[i].bt_volt > 0; i++) - if (bthr[i].bt_volt <= volt) - break; - - if (i == 0) - return (bthr[i].bt_life); - - return (bthr[i].bt_life + - ((volt - bthr[i].bt_volt) * 100) / - (bthr[i-1].bt_volt - bthr[i].bt_volt) * - (bthr[i-1].bt_life - bthr[i].bt_life) / 100); -} - -int -zapm_batt_minutes(int life) -{ - - return (zaurus_main_battery->bi_minutes * life / 100); -} - -void -zapm_enable_charging(struct zapm_softc *sc, int enable) -{ - - scoop_discharge_battery(0); - scoop_charge_battery(enable, 0); - scoop_led_set(SCOOP_LED_ORANGE, enable); -} - -/* - * Return non-zero if the charge complete signal indicates that the - * battery is fully charged. Restart charging to clear this signal. - */ -int -zapm_charge_complete(struct zapm_softc *sc) -{ - - if (sc->sc_charging && sc->sc_batt_full < MIN_BATT_FULL) { - if (pxa2x0_gpio_get_bit(GPIO_CHRG_CO_C3000) != 0) { - if (++sc->sc_batt_full < MIN_BATT_FULL) { - DPRINTF(("battery almost full\n")); - zapm_enable_charging(sc, 0); - delay(15000); - zapm_enable_charging(sc, 1); - } - } else if (sc->sc_batt_full > 0) { - /* false alarm */ - sc->sc_batt_full = 0; - zapm_enable_charging(sc, 0); - delay(15000); - zapm_enable_charging(sc, 1); - } - } - - return (sc->sc_batt_full >= MIN_BATT_FULL); -} - -/* - * Poll power-management related GPIO inputs, update battery life - * in softc, and/or control battery charging. - */ -void -zapm_poll(void *v) -{ - struct zapm_softc *sc = v; - int ac_on; - int bc_lock; - int charging; - int volt; - int s; - - s = splhigh(); - - /* Check positition of battery compartment lock switch. */ - bc_lock = pxa2x0_gpio_get_bit(GPIO_BATT_COVER_C3000) ? 1 : 0; - - /* Stop discharging. */ - if (sc->sc_discharging) { - sc->sc_discharging = 0; - volt = zapm_batt_volt(); - ac_on = zapm_ac_on(); - charging = 0; - DPRINTF(("zapm_poll: discharge off volt %d\n", volt)); - } else { - ac_on = zapm_ac_on(); - charging = sc->sc_charging; - volt = sc->sc_batt_volt; - } - - /* Start or stop charging as necessary. */ - if (ac_on && bc_lock) { - if (charging) { - if (zapm_charge_complete(sc)) { - DPRINTF(("zapm_poll: batt full\n")); - charging = 0; - zapm_enable_charging(sc, 0); - } - } else if (!zapm_charge_complete(sc)) { - charging = 1; - volt = zapm_batt_volt(); - zapm_enable_charging(sc, 1); - DPRINTF(("zapm_poll: start charging volt %d\n", volt)); - } - } else { - if (charging) { - charging = 0; - zapm_enable_charging(sc, 0); - timerclear(&sc->sc_lastbattchk); - DPRINTF(("zapm_poll: stop charging\n")); - } - sc->sc_batt_full = 0; - } - - /* - * Restart charging once in a while. Discharge a few milliseconds - * before updating the voltage in our softc if A/C is connected. - */ - if (bc_lock && ratecheck(&sc->sc_lastbattchk, &zapm_battchkrate)) { - if (sc->sc_suspended) { - DPRINTF(("zapm_poll: suspended %lu %lu\n", - sc->sc_lastbattchk.tv_sec, - pxa2x0_rtc_getsecs())); - if (charging) { - zapm_enable_charging(sc, 0); - delay(15000); - zapm_enable_charging(sc, 1); - pxa2x0_rtc_setalarm(pxa2x0_rtc_getsecs() + - zapm_battchkrate.tv_sec + 1); - } - } else if (ac_on && sc->sc_batt_full == 0) { - DPRINTF(("zapm_poll: discharge on\n")); - if (charging) - zapm_enable_charging(sc, 0); - sc->sc_discharging = 1; - scoop_discharge_battery(1); - timeout_add(&sc->sc_poll, DISCHARGE_TIMEOUT); - } else if (!ac_on) { - volt = zapm_batt_volt(); - DPRINTF(("zapm_poll: volt %d\n", volt)); - } - } - - /* Update the cached power state in our softc. */ - if (ac_on != sc->sc_ac_on || charging != sc->sc_charging || - volt != sc->sc_batt_volt) { - sc->sc_ac_on = ac_on; - sc->sc_charging = charging; - sc->sc_batt_volt = volt; - if (sc->sc_event == APM_NOEVENT) - sc->sc_event = APM_POWER_CHANGE; - } - - /* Detect battery low conditions. */ - if (!ac_on) { - if (zapm_batt_life(volt) < 5) - sc->sc_event = APM_BATTERY_LOW; - if (zapm_batt_state(volt) == APM_BATT_CRITICAL) - sc->sc_event = APM_CRIT_SUSPEND_REQ; - } - -#ifdef APMDEBUG - if (sc->sc_event != APM_NOEVENT) - DPRINTF(("zapm_poll: power event %d\n", sc->sc_event)); -#endif - splx(s); -} - -/* - * apm_thread() calls this routine approximately once per second. - */ -int -zapm_get_event(struct pxa2x0_apm_softc *pxa_sc, u_int *typep) -{ - struct zapm_softc *sc = (struct zapm_softc *)pxa_sc; - int s; - - s = splsoftclock(); - - /* Don't interfere with discharging. */ - if (sc->sc_discharging) - *typep = sc->sc_event; - else if (sc->sc_event == APM_NOEVENT) { - zapm_poll(sc); - *typep = sc->sc_event; - } - sc->sc_event = APM_NOEVENT; - - splx(s); - return (*typep == APM_NOEVENT); -} - -/* - * Return power status to the generic APM driver. - */ -void -zapm_power_info(struct pxa2x0_apm_softc *pxa_sc, struct apm_power_info *power) -{ - struct zapm_softc *sc = (struct zapm_softc *)pxa_sc; - int s; - int ac_on; - int volt; - int charging; - - s = splsoftclock(); - ac_on = sc->sc_ac_on; - volt = sc->sc_batt_volt; - charging = sc->sc_charging; - splx(s); - - power->ac_state = ac_on ? APM_AC_ON : APM_AC_OFF; - if (charging) - power->battery_state = APM_BATT_CHARGING; - else - power->battery_state = zapm_batt_state(volt); - - power->battery_life = zapm_batt_life(volt); - power->minutes_left = zapm_batt_minutes(power->battery_life); -} - -/* - * Called before suspending when all ca_activate functions are done. - */ -void -zapm_suspend(struct pxa2x0_apm_softc *pxa_sc) -{ - struct zapm_softc *sc = (struct zapm_softc *)pxa_sc; - - config_suspend_all(DVACT_QUIESCE); - bufq_quiesce(); - - /* Poll in suspended mode and forget the discharge timeout. */ - sc->sc_suspended = 1; - timeout_del(&sc->sc_poll); - - /* Make sure charging is enabled and RTC alarm is set. */ - timerclear(&sc->sc_lastbattchk); - - zapm_poll(sc); - -#if 0 - pxa2x0_rtc_setalarm(pxa2x0_rtc_getsecs() + 5); -#endif - pxa2x0_wakeup_config(PXA2X0_WAKEUP_ALL, 1); -} - -/* - * Called after wake-up from suspend with interrupts still disabled, - * before any ca_activate functions are done. - */ -int -zapm_resume(struct pxa2x0_apm_softc *pxa_sc) -{ - struct zapm_softc *sc = (struct zapm_softc *)pxa_sc; - int a, b; - u_int wsrc; - int wakeup = 0; - - /* C3000 */ - a = pxa2x0_gpio_get_bit(97) ? 1 : 0; - b = pxa2x0_gpio_get_bit(96) ? 2 : 0; - - wsrc = pxa2x0_wakeup_status(); - - /* Resume only if the lid is not closed. */ - if ((a | b) != 3 && (wsrc & PXA2X0_WAKEUP_POWERON) != 0) { - int timeout = 100; /* 10 ms */ - /* C3000 */ - while (timeout-- > 0 && pxa2x0_gpio_get_bit(95) != 0) { - if (timeout == 0) { - wakeup = 1; - break; - } - delay(100); - } - } - - /* Initialize the SSP unit before using the MAX1111 again. */ - zssp_init(); - - zapm_poll(sc); - - if (wakeup) { - /* Resume normal polling. */ - sc->sc_suspended = 0; - - pxa2x0_rtc_setalarm(0); - } else { -#if 0 - DPRINTF(("zapm_resume: suspended %lu %lu\n", - sc->sc_lastbattchk.tv_sec, pxa2x0_rtc_getsecs())); - pxa2x0_rtc_setalarm(pxa2x0_rtc_getsecs() + 5); -#endif - } - - return (wakeup); -} - -void -zapm_poweroff(void) -{ - struct pxa2x0_apm_softc *sc; - int s; - - KASSERT(apm_cd.cd_ndevs > 0 && apm_cd.cd_devs[0] != NULL); - sc = apm_cd.cd_devs[0]; - -#if NWSDISPLAY > 0 - wsdisplay_suspend(); -#endif /* NWSDISPLAY > 0 */ - - s = splhigh(); - cold = 2; - config_suspend_all(DVACT_SUSPEND); - - suspend_randomness(); - - /* XXX - * Flag to disk drivers that they should "power down" the disk - * when we get to DVACT_POWERDOWN. - */ - boothowto |= RB_POWERDOWN; - config_suspend_all(DVACT_POWERDOWN); - boothowto &= ~RB_POWERDOWN; - - /* XXX enable charging during suspend */ - - /* XXX keep power LED state during suspend */ - - /* XXX do the same thing for GPIO 43 (BTTXD) */ - - /* XXX scoop power down */ - - /* XXX set PGSRn and GPDRn */ - - pxa2x0_wakeup_config(PXA2X0_WAKEUP_ALL, 1); - - do { - pxa2x0_apm_sleep(sc); - } while (!zapm_resume(sc)); - - zapm_restart(); - - /* NOTREACHED */ - cold = 0; - config_suspend_all(DVACT_RESUME); - splx(s); - - resume_randomness(NULL, 0); /* force RNG upper level reseed */ - bufq_restart(); - - config_suspend_all(DVACT_WAKEUP); - -#if NWSDISPLAY > 0 - wsdisplay_resume(); -#endif /* NWSDISPLAY > 0 */ -} - -/* - * Do a GPIO reset, immediately causing the processor to begin the normal - * boot sequence. See 2.7 Reset in the PXA27x Developer's Manual for the - * summary of effects of this kind of reset. - */ -void -zapm_restart(void) -{ - if (apm_cd.cd_ndevs > 0 && apm_cd.cd_devs[0] != NULL) { - struct pxa2x0_apm_softc *sc = apm_cd.cd_devs[0]; - int rv; - - /* - * Reduce the ROM Delay Next Access and ROM Delay First - * Access times for synchronous flash connected to nCS1. - */ - rv = bus_space_read_4(sc->sc_iot, sc->sc_memctl_ioh, - MEMCTL_MSC0); - if ((rv & 0xffff0000) == 0x7ff00000) - bus_space_write_4(sc->sc_iot, sc->sc_memctl_ioh, - MEMCTL_MSC0, (rv & 0xffff) | 0x7ee00000); - } - - /* External reset circuit presumably asserts nRESET_GPIO. */ - pxa2x0_gpio_set_function(89, GPIO_OUT | GPIO_SET); - delay(1000000); -} diff --git a/sys/arch/zaurus/dev/zaurus_apm.h b/sys/arch/zaurus/dev/zaurus_apm.h deleted file mode 100644 index 8310239a18c..00000000000 --- a/sys/arch/zaurus/dev/zaurus_apm.h +++ /dev/null @@ -1,20 +0,0 @@ -/* $OpenBSD: zaurus_apm.h,v 1.1 2005/04/11 03:21:03 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -void zapm_poweroff(void); -void zapm_restart(void); diff --git a/sys/arch/zaurus/dev/zaurus_audio.c b/sys/arch/zaurus/dev/zaurus_audio.c deleted file mode 100644 index 8d83c91a27d..00000000000 --- a/sys/arch/zaurus/dev/zaurus_audio.c +++ /dev/null @@ -1,792 +0,0 @@ -/* $OpenBSD: zaurus_audio.c,v 1.19 2015/05/11 06:46:21 ratchov Exp $ */ - -/* - * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * TODO: - * - record support - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/timeout.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/kernel.h> -#include <sys/fcntl.h> -#include <sys/audioio.h> - -#include <machine/intr.h> -#include <machine/bus.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_i2c.h> -#include <arm/xscale/pxa2x0_i2s.h> -#include <arm/xscale/pxa2x0_dmac.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <zaurus/dev/zaurus_scoopvar.h> -#include <dev/i2c/wm8750reg.h> -#include <dev/audio_if.h> - -#define WM8750_ADDRESS 0x1B -#define SPKR_VOLUME 112 - -#define wm8750_write(sc, reg, val) pxa2x0_i2c_write_2(&sc->sc_i2c, \ - WM8750_ADDRESS, (((reg) << 9) | ((val) & 0x1ff))) - -int zaudio_match(struct device *, void *, void *); -void zaudio_attach(struct device *, struct device *, void *); -int zaudio_detach(struct device *, int); -int zaudio_activate(struct device *, int); -void zaudio_pintr(void *); -void zaudio_rintr(void *); - -#define ZAUDIO_OP_SPKR 0 -#define ZAUDIO_OP_HP 1 - -#define ZAUDIO_JACK_STATE_OUT 0 -#define ZAUDIO_JACK_STATE_IN 1 -#define ZAUDIO_JACK_STATE_INS 2 -#define ZAUDIO_JACK_STATE_REM 3 - -/* GPIO pins */ -#define GPIO_HP_IN_C3000 116 - -struct zaudio_volume { - u_int8_t left; - u_int8_t right; -}; - -struct zaudio_softc { - struct device sc_dev; - - /* i2s device softc */ - /* NB: pxa2x0_i2s requires this to be the second struct member */ - struct pxa2x0_i2s_softc sc_i2s; - - /* i2c device softc */ - struct pxa2x0_i2c_softc sc_i2c; - - int sc_playing; - - struct zaudio_volume sc_volume[2]; - char sc_unmute[2]; - - int sc_state; - int sc_icount; - struct timeout sc_to; - void (*sc_pintr)(void *); - void *sc_parg; -}; - -struct cfattach zaudio_ca = { - sizeof(struct zaudio_softc), zaudio_match, zaudio_attach, - zaudio_detach, zaudio_activate -}; - -struct cfdriver zaudio_cd = { - NULL, "zaudio", DV_DULL -}; - -struct audio_device wm8750_device = { - "WM8750", - "1.0", - "wm" -}; - -void zaudio_init(struct zaudio_softc *); -int zaudio_jack_intr(void *); -void zaudio_jack(void *); -void zaudio_standby(struct zaudio_softc *); -void zaudio_update_volume(struct zaudio_softc *, int); -void zaudio_update_mutes(struct zaudio_softc *); -void zaudio_play_setup(struct zaudio_softc *); -int zaudio_open(void *, int); -void zaudio_close(void *); -int zaudio_query_encoding(void *, struct audio_encoding *); -int zaudio_set_params(void *, int, int, struct audio_params *, - struct audio_params *); -int zaudio_halt_output(void *); -int zaudio_halt_input(void *); -int zaudio_getdev(void *, struct audio_device *); -int zaudio_set_port(void *, struct mixer_ctrl *); -int zaudio_get_port(void *, struct mixer_ctrl *); -int zaudio_query_devinfo(void *, struct mixer_devinfo *); -int zaudio_get_props(void *); -int zaudio_start_output(void *, void *, int, void (*)(void *), void *); -int zaudio_start_input(void *, void *, int, void (*)(void *), void *); - -struct audio_hw_if wm8750_hw_if = { - zaudio_open, - zaudio_close, - NULL /* zaudio_drain */, - zaudio_query_encoding, - zaudio_set_params, - pxa2x0_i2s_round_blocksize, - NULL /* zaudio_commit_settings */, - NULL /* zaudio_init_output */, - NULL /* zaudio_init_input */, - zaudio_start_output, - zaudio_start_input, - zaudio_halt_output, - zaudio_halt_input, - NULL /* zaudio_speaker_ctl */, - zaudio_getdev, - NULL /* zaudio_setfd */, - zaudio_set_port, - zaudio_get_port, - zaudio_query_devinfo, - pxa2x0_i2s_allocm, - pxa2x0_i2s_freem, - pxa2x0_i2s_round_buffersize, - pxa2x0_i2s_mappage, - zaudio_get_props, - NULL /* zaudio_trigger_output */, - NULL /* zaudio_trigger_input */, - NULL -}; - -static const unsigned short playback_registers[][2] = { - /* Unmute DAC */ - { ADCDACCTL_REG, 0x000 }, - - /* 16 bit audio words */ - { AUDINT_REG, AUDINT_SET_FORMAT(2) }, - - /* Enable thermal protection, power */ - { ADCTL1_REG, ADCTL1_TSDEN | ADCTL1_SET_VSEL(3) }, - - /* Enable speaker driver, DAC oversampling */ - { ADCTL2_REG, ADCTL2_ROUT2INV | ADCTL2_DACOSR }, - - /* Set DAC voltage references */ - { PWRMGMT1_REG, PWRMGMT1_SET_VMIDSEL(1) | PWRMGMT1_VREF }, - - /* Direct DACs to output mixers */ - { LOUTMIX1_REG, LOUTMIX1_LD2LO }, - { ROUTMIX2_REG, ROUTMIX2_RD2RO }, - - /* End of list */ - { 0xffff, 0xffff } -}; - -int -zaudio_match(struct device *parent, void *match, void *aux) -{ - return (1); -} - -void -zaudio_attach(struct device *parent, struct device *self, void *aux) -{ - struct zaudio_softc *sc = (struct zaudio_softc *)self; - struct pxaip_attach_args *pxa = aux; - int err; - - sc->sc_i2s.sc_iot = pxa->pxa_iot; - sc->sc_i2s.sc_dmat = pxa->pxa_dmat; - sc->sc_i2s.sc_size = PXA2X0_I2S_SIZE; - if (pxa2x0_i2s_attach_sub(&sc->sc_i2s)) { - printf(": unable to attach I2S\n"); - goto fail_i2s; - } - - sc->sc_i2c.sc_iot = pxa->pxa_iot; - sc->sc_i2c.sc_size = PXA2X0_I2C_SIZE; - if (pxa2x0_i2c_attach_sub(&sc->sc_i2c)) { - printf(": unable to attach I2C\n"); - goto fail_i2c; - } - - /* Check for an I2C response from the wm8750 */ - pxa2x0_i2c_open(&sc->sc_i2c); - err = wm8750_write(sc, RESET_REG, 0); - pxa2x0_i2c_close(&sc->sc_i2c); - - if (err) { - printf(": codec failed to respond\n"); - goto fail_probe; - } - delay(100); - - /* Speaker on, headphones off by default. */ - sc->sc_volume[ZAUDIO_OP_SPKR].left = 240; - sc->sc_unmute[ZAUDIO_OP_SPKR] = 1; - sc->sc_volume[ZAUDIO_OP_HP].left = 180; - sc->sc_volume[ZAUDIO_OP_HP].right = 180; - sc->sc_unmute[ZAUDIO_OP_HP] = 0; - - /* Configure headphone jack state change handling. */ - timeout_set(&sc->sc_to, zaudio_jack, sc); - pxa2x0_gpio_set_function(GPIO_HP_IN_C3000, GPIO_IN); - (void)pxa2x0_gpio_intr_establish(GPIO_HP_IN_C3000, - IST_EDGE_BOTH, IPL_BIO, zaudio_jack_intr, sc, "hpjk"); - - zaudio_init(sc); - - printf(": I2C, I2S, WM8750 Audio\n"); - - audio_attach_mi(&wm8750_hw_if, sc, &sc->sc_dev); - - return; - -fail_probe: - pxa2x0_i2c_detach_sub(&sc->sc_i2c); -fail_i2c: - pxa2x0_i2s_detach_sub(&sc->sc_i2s); -fail_i2s: - ; -} - -int -zaudio_detach(struct device *self, int flags) -{ - struct zaudio_softc *sc = (struct zaudio_softc *)self; - - pxa2x0_i2c_detach_sub(&sc->sc_i2c); - pxa2x0_i2s_detach_sub(&sc->sc_i2s); - - return (0); -} - -int -zaudio_activate(struct device *self, int act) -{ - struct zaudio_softc *sc = (struct zaudio_softc *)self; - - switch (act) { - case DVACT_SUSPEND: - timeout_del(&sc->sc_to); - zaudio_standby(sc); - break; - case DVACT_RESUME: - pxa2x0_i2s_init(&sc->sc_i2s); - pxa2x0_i2c_init(&sc->sc_i2c); - zaudio_init(sc); - break; - } - return 0; -} - -void -zaudio_init(struct zaudio_softc *sc) -{ - pxa2x0_i2c_open(&sc->sc_i2c); - - /* Reset the codec */ - wm8750_write(sc, RESET_REG, 0); - delay(100); - - /* Switch to standby power only */ - wm8750_write(sc, PWRMGMT1_REG, PWRMGMT1_SET_VMIDSEL(2)); - wm8750_write(sc, PWRMGMT2_REG, 0); - - /* Configure digital interface for I2S */ - wm8750_write(sc, AUDINT_REG, AUDINT_SET_FORMAT(2)); - - /* Initialise volume levels */ - zaudio_update_volume(sc, ZAUDIO_OP_SPKR); - zaudio_update_volume(sc, ZAUDIO_OP_HP); - scoop_set_headphone(0); - - pxa2x0_i2c_close(&sc->sc_i2c); - - /* Assume that the jack state has changed. */ - zaudio_jack(sc); - -} - -int -zaudio_jack_intr(void *v) -{ - struct zaudio_softc *sc = v; - - if (!timeout_triggered(&sc->sc_to)) - zaudio_jack(sc); - - return (1); -} - -void -zaudio_jack(void *v) -{ - struct zaudio_softc *sc = v; - - switch (sc->sc_state) { - case ZAUDIO_JACK_STATE_OUT: - if (pxa2x0_gpio_get_bit(GPIO_HP_IN_C3000)) { - sc->sc_state = ZAUDIO_JACK_STATE_INS; - sc->sc_icount = 0; - } - break; - case ZAUDIO_JACK_STATE_INS: - if (sc->sc_icount++ > 2) { - if (pxa2x0_gpio_get_bit(GPIO_HP_IN_C3000)) { - sc->sc_state = ZAUDIO_JACK_STATE_IN; - sc->sc_unmute[ZAUDIO_OP_SPKR] = 0; - sc->sc_unmute[ZAUDIO_OP_HP] = 1; - goto update_mutes; - } else - sc->sc_state = ZAUDIO_JACK_STATE_OUT; - } - break; - case ZAUDIO_JACK_STATE_IN: - if (!pxa2x0_gpio_get_bit(GPIO_HP_IN_C3000)) { - sc->sc_state = ZAUDIO_JACK_STATE_REM; - sc->sc_icount = 0; - } - break; - case ZAUDIO_JACK_STATE_REM: - if (sc->sc_icount++ > 2) { - if (!pxa2x0_gpio_get_bit(GPIO_HP_IN_C3000)) { - sc->sc_state = ZAUDIO_JACK_STATE_OUT; - sc->sc_unmute[ZAUDIO_OP_SPKR] = 1; - sc->sc_unmute[ZAUDIO_OP_HP] = 0; - goto update_mutes; - } else - sc->sc_state = ZAUDIO_JACK_STATE_IN; - } - break; - } - - timeout_add(&sc->sc_to, hz/4); - return; - -update_mutes: - timeout_del(&sc->sc_to); - - if (sc->sc_playing) { - pxa2x0_i2c_open(&sc->sc_i2c); - zaudio_update_mutes(sc); - pxa2x0_i2c_close(&sc->sc_i2c); - } -} - -void -zaudio_standby(struct zaudio_softc *sc) -{ - pxa2x0_i2c_open(&sc->sc_i2c); - - /* Switch codec to standby power only */ - wm8750_write(sc, PWRMGMT1_REG, PWRMGMT1_SET_VMIDSEL(2)); - wm8750_write(sc, PWRMGMT2_REG, 0); - - scoop_set_headphone(0); - - pxa2x0_i2c_close(&sc->sc_i2c); -} - -void -zaudio_update_volume(struct zaudio_softc *sc, int output) -{ - switch(output) { - case ZAUDIO_OP_SPKR: - wm8750_write(sc, LOUT2VOL_REG, LOUT2VOL_LO2VU | LOUT2VOL_LO2ZC | - LOUT2VOL_SET_LOUT2VOL(sc->sc_volume[ZAUDIO_OP_SPKR - ].left >> 1)); - wm8750_write(sc, ROUT2VOL_REG, ROUT2VOL_RO2VU | ROUT2VOL_RO2ZC | - ROUT2VOL_SET_ROUT2VOL(sc->sc_volume[ZAUDIO_OP_SPKR - ].left >> 1)); - break; - case ZAUDIO_OP_HP: - wm8750_write(sc, LOUT1VOL_REG, LOUT1VOL_LO1VU | LOUT1VOL_LO1ZC | - LOUT1VOL_SET_LOUT1VOL(sc->sc_volume[ZAUDIO_OP_HP - ].left >> 1)); - wm8750_write(sc, ROUT1VOL_REG, ROUT1VOL_RO1VU | ROUT1VOL_RO1ZC | - ROUT1VOL_SET_ROUT1VOL(sc->sc_volume[ZAUDIO_OP_HP - ].right >> 1)); - break; - } -} - -void -zaudio_update_mutes(struct zaudio_softc *sc) -{ - unsigned short val; - - val = PWRMGMT2_DACL | PWRMGMT2_DACR; - - if (sc->sc_unmute[ZAUDIO_OP_SPKR]) - val |= PWRMGMT2_LOUT2 | PWRMGMT2_ROUT2; - - if (sc->sc_unmute[ZAUDIO_OP_HP]) - val |= PWRMGMT2_LOUT1 | PWRMGMT2_ROUT1; - - wm8750_write(sc, PWRMGMT2_REG, val); - - scoop_set_headphone(sc->sc_unmute[ZAUDIO_OP_HP]); -} - -void -zaudio_play_setup(struct zaudio_softc *sc) -{ - int i = 0; - - pxa2x0_i2c_open(&sc->sc_i2c); - - /* Program the codec with playback settings */ - while (playback_registers[i][0] != 0xffff) { - wm8750_write(sc, playback_registers[i][0], - playback_registers[i][1]); - i++; - } - zaudio_update_mutes(sc); - - pxa2x0_i2c_close(&sc->sc_i2c); -} - -int -zaudio_open(void *hdl, int flags) -{ - struct zaudio_softc *sc = hdl; - - /* can't record yet */ - if (flags & FREAD) - return (ENXIO); - - /* Power on the I2S bus and codec */ - pxa2x0_i2s_open(&sc->sc_i2s); - - return 0; -} - -void -zaudio_close(void *hdl) -{ - struct zaudio_softc *sc = hdl; - - /* Power off the I2S bus and codec */ - pxa2x0_i2s_close(&sc->sc_i2s); -} - -int -zaudio_query_encoding(void *hdl, struct audio_encoding *aep) -{ - switch (aep->index) { - case 0: - strlcpy(aep->name, AudioEslinear_le, sizeof(aep->name)); - aep->encoding = AUDIO_ENCODING_SLINEAR_LE; - aep->precision = 16; - aep->flags = 0; - break; - default: - return (EINVAL); - } - aep->bps = AUDIO_BPS(aep->precision); - aep->msb = 1; - return (0); -} - -int -zaudio_set_params(void *hdl, int setmode, int usemode, - struct audio_params *play, struct audio_params *rec) -{ - struct zaudio_softc *sc = hdl; - - if (setmode & AUMODE_PLAY) { - play->precision = 16; - play->channels = 2; - play->encoding = AUDIO_ENCODING_SLINEAR_LE; - play->bps = AUDIO_BPS(play->precision); - play->msb = 1; - - pxa2x0_i2s_setspeed(&sc->sc_i2s, &play->sample_rate); - } - -#if RECORD_XXX_NOT_YET - if (setmode & AUMODE_RECORD) { - rec->precision = 16; - rec->channels = 2; - rec->encoding = AUDIO_ENCODING_SLINEAR_LE; - rec->bps = AUDIO_BPS(rec->precision); - rec->msb = 1; - - pxa2x0_i2s_setspeed(sc, &rec->sample_rate); - } -#endif - - return (0); -} - -int -zaudio_halt_output(void *hdl) -{ - struct zaudio_softc *sc = hdl; - - /* XXX forcibly stop output DMA? */ - - mtx_enter(&audio_lock); - zaudio_standby(sc); - sc->sc_playing = 0; - mtx_leave(&audio_lock); - - return 0; -} - -int -zaudio_halt_input(void *hdl) -{ - /* struct zaudio_softc *sc = hdl; */ - - return 0; -} - -int -zaudio_getdev(void *hdl, struct audio_device *ret) -{ - /* struct zaudio_softc *sc = hdl; */ - - *ret = wm8750_device; - return 0; -} - -#define ZAUDIO_SPKR_LVL 0 -#define ZAUDIO_SPKR_MUTE 1 -#define ZAUDIO_HP_LVL 2 -#define ZAUDIO_HP_MUTE 3 -#define ZAUDIO_OUTPUT_CLASS 4 - -int -zaudio_set_port(void *hdl, struct mixer_ctrl *mc) -{ - struct zaudio_softc *sc = hdl; - int error = EINVAL, s; - - s = splbio(); - pxa2x0_i2c_open(&sc->sc_i2c); - - switch (mc->dev) { - case ZAUDIO_SPKR_LVL: - if (mc->type != AUDIO_MIXER_VALUE) - break; - if (mc->un.value.num_channels == 1) - sc->sc_volume[ZAUDIO_OP_SPKR].left = - mc->un.value.level[AUDIO_MIXER_LEVEL_MONO]; - else - break; - zaudio_update_volume(sc, ZAUDIO_OP_SPKR); - error = 0; - break; - case ZAUDIO_SPKR_MUTE: - if (mc->type != AUDIO_MIXER_ENUM) - break; - sc->sc_unmute[ZAUDIO_OP_SPKR] = mc->un.ord ? 1 : 0; - zaudio_update_mutes(sc); - error = 0; - break; - case ZAUDIO_HP_LVL: - if (mc->type != AUDIO_MIXER_VALUE) - break; - if (mc->un.value.num_channels == 1) { - sc->sc_volume[ZAUDIO_OP_HP].left = - mc->un.value.level[AUDIO_MIXER_LEVEL_MONO]; - sc->sc_volume[ZAUDIO_OP_HP].right = - mc->un.value.level[AUDIO_MIXER_LEVEL_MONO]; - } else if (mc->un.value.num_channels == 2) { - sc->sc_volume[ZAUDIO_OP_HP].left = - mc->un.value.level[AUDIO_MIXER_LEVEL_LEFT]; - sc->sc_volume[ZAUDIO_OP_HP].right = - mc->un.value.level[AUDIO_MIXER_LEVEL_RIGHT]; - } - else - break; - zaudio_update_volume(sc, ZAUDIO_OP_HP); - error = 0; - break; - case ZAUDIO_HP_MUTE: - if (mc->type != AUDIO_MIXER_ENUM) - break; - sc->sc_unmute[ZAUDIO_OP_HP] = mc->un.ord ? 1 : 0; - zaudio_update_mutes(sc); - error = 0; - break; - } - - pxa2x0_i2c_close(&sc->sc_i2c); - splx(s); - - return error; -} - -int -zaudio_get_port(void *hdl, struct mixer_ctrl *mc) -{ - struct zaudio_softc *sc = hdl; - int error = EINVAL; - - switch (mc->dev) { - case ZAUDIO_SPKR_LVL: - if (mc->type != AUDIO_MIXER_VALUE) - break; - if (mc->un.value.num_channels == 1) - mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = - sc->sc_volume[ZAUDIO_OP_SPKR].left; - else - break; - error = 0; - break; - case ZAUDIO_SPKR_MUTE: - if (mc->type != AUDIO_MIXER_ENUM) - break; - mc->un.ord = sc->sc_unmute[ZAUDIO_OP_SPKR] ? 1 : 0; - error = 0; - break; - case ZAUDIO_HP_LVL: - if (mc->type != AUDIO_MIXER_VALUE) - break; - if (mc->un.value.num_channels == 1) - mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = - sc->sc_volume[ZAUDIO_OP_HP].left; - else if (mc->un.value.num_channels == 2) { - mc->un.value.level[AUDIO_MIXER_LEVEL_LEFT] = - sc->sc_volume[ZAUDIO_OP_HP].left; - mc->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = - sc->sc_volume[ZAUDIO_OP_HP].right; - } - else - break; - error = 0; - break; - case ZAUDIO_HP_MUTE: - if (mc->type != AUDIO_MIXER_ENUM) - break; - mc->un.ord = sc->sc_unmute[ZAUDIO_OP_HP] ? 1 : 0; - error = 0; - break; - } - - return error; -} - -int -zaudio_query_devinfo(void *hdl, struct mixer_devinfo *di) -{ - /* struct zaudio_softc *sc = hdl; */ - - switch (di->index) { - case ZAUDIO_SPKR_LVL: - di->type = AUDIO_MIXER_VALUE; - di->mixer_class = ZAUDIO_OUTPUT_CLASS; - di->prev = AUDIO_MIXER_LAST; - di->next = ZAUDIO_SPKR_MUTE; - strlcpy(di->label.name, AudioNspeaker, - sizeof(di->label.name)); - strlcpy(di->un.v.units.name, AudioNvolume, - sizeof(di->un.v.units.name)); - di->un.v.num_channels = 1; - break; - case ZAUDIO_SPKR_MUTE: - di->type = AUDIO_MIXER_ENUM; - di->mixer_class = ZAUDIO_OUTPUT_CLASS; - di->prev = ZAUDIO_SPKR_LVL; - di->next = AUDIO_MIXER_LAST; - goto mute; - case ZAUDIO_HP_LVL: - di->type = AUDIO_MIXER_VALUE; - di->mixer_class = ZAUDIO_OUTPUT_CLASS; - di->prev = AUDIO_MIXER_LAST; - di->next = ZAUDIO_HP_MUTE; - strlcpy(di->label.name, AudioNheadphone, - sizeof(di->label.name)); - di->un.v.num_channels = 1; - strlcpy(di->un.v.units.name, AudioNvolume, - sizeof(di->un.v.units.name)); - break; - case ZAUDIO_HP_MUTE: - di->type = AUDIO_MIXER_ENUM; - di->mixer_class = ZAUDIO_OUTPUT_CLASS; - di->prev = ZAUDIO_HP_LVL; - di->next = AUDIO_MIXER_LAST; -mute: - strlcpy(di->label.name, AudioNmute, sizeof(di->label.name)); - di->un.e.num_mem = 2; - strlcpy(di->un.e.member[0].label.name, AudioNon, - sizeof(di->un.e.member[0].label.name)); - di->un.e.member[0].ord = 0; - strlcpy(di->un.e.member[1].label.name, AudioNoff, - sizeof(di->un.e.member[1].label.name)); - di->un.e.member[1].ord = 1; - break; - case ZAUDIO_OUTPUT_CLASS: - di->type = AUDIO_MIXER_CLASS; - di->mixer_class = ZAUDIO_OUTPUT_CLASS; - di->prev = AUDIO_MIXER_LAST; - di->next = AUDIO_MIXER_LAST; - strlcpy(di->label.name, AudioCoutputs, - sizeof(di->label.name)); - break; - default: - return ENXIO; - } - - return 0; -} - -int -zaudio_get_props(void *hdl) -{ - return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX; -} - -void -zaudio_pintr(void *hdl) -{ - struct zaudio_softc *sc = hdl; - - mtx_enter(&audio_lock); - sc->sc_pintr(sc->sc_parg); - mtx_leave(&audio_lock); -} - -/* - * called by interrupt code-path, don't lock - */ -int -zaudio_start_output(void *hdl, void *block, int bsize, void (*intr)(void *), - void *intrarg) -{ - struct zaudio_softc *sc = hdl; - int err; - - /* Power up codec if we are not already playing. */ - if (!sc->sc_playing) { - sc->sc_playing = 1; - zaudio_play_setup(sc); - } - - /* Start DMA via I2S */ - sc->sc_pintr = intr; - sc->sc_parg = intrarg; - err = pxa2x0_i2s_start_output(&sc->sc_i2s, block, bsize, zaudio_pintr, sc); - if (err) { - zaudio_standby(sc); - sc->sc_playing = 0; - } - return err; -} - -/* - * called by interrupt code-path, don't lock - */ -int -zaudio_start_input(void *hdl, void *block, int bsize, void (*intr)(void *), - void *intrarg) -{ - return ENXIO; -} diff --git a/sys/arch/zaurus/dev/zaurus_flash.c b/sys/arch/zaurus/dev/zaurus_flash.c deleted file mode 100644 index 32a12999e90..00000000000 --- a/sys/arch/zaurus/dev/zaurus_flash.c +++ /dev/null @@ -1,908 +0,0 @@ -/* $OpenBSD: zaurus_flash.c,v 1.14 2015/09/27 10:12:09 semarie Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * Samsung NAND flash controlled by some unspecified CPLD device. - */ - -#include <sys/param.h> -#include <sys/buf.h> -#include <sys/device.h> -#include <sys/disk.h> -#include <sys/disklabel.h> -#include <sys/kernel.h> -#include <sys/malloc.h> -#include <sys/systm.h> - -#include <dev/flashvar.h> -#include <dev/rndvar.h> - -#include <machine/zaurus_var.h> - -#include <arch/arm/xscale/pxa2x0var.h> - -#define DEBUG -#ifdef DEBUG -#define DPRINTF(x) printf x -#else -#define DPRINTF(x) -#endif - -/* CPLD register definitions */ -#define CPLD_REG_ECCLPLB 0x00 -#define CPLD_REG_ECCLPUB 0x04 -#define CPLD_REG_ECCCP 0x08 -#define CPLD_REG_ECCCNTR 0x0c -#define CPLD_REG_ECCCLRR 0x10 -#define CPLD_REG_FLASHIO 0x14 -#define CPLD_REG_FLASHCTL 0x18 -#define FLASHCTL_NCE0 (1<<0) -#define FLASHCTL_CLE (1<<1) -#define FLASHCTL_ALE (1<<2) -#define FLASHCTL_NWP (1<<3) -#define FLASHCTL_NCE1 (1<<4) -#define FLASHCTL_RYBY (1<<5) -#define FLASHCTL_NCE (FLASHCTL_NCE0|FLASHCTL_NCE1) - -/* CPLD register accesses */ -#define CPLD_READ(sc, r) \ - bus_space_read_1((sc)->sc_iot, (sc)->sc_ioh, (r)) -#define CPLD_WRITE(sc, r, v) \ - bus_space_write_1((sc)->sc_iot, (sc)->sc_ioh, (r), (v)) -#define CPLD_SET(sc, r, v) \ - CPLD_WRITE((sc), (r), CPLD_READ((sc), (r)) | (v)) -#define CPLD_CLR(sc, r, v) \ - CPLD_WRITE((sc), (r), CPLD_READ((sc), (r)) & ~(v)) -#define CPLD_SETORCLR(sc, r, m, v) \ - ((v) ? CPLD_SET((sc), (r), (m)) : CPLD_CLR((sc), (r), (m))) - -/* Offsets into OOB data. */ -#define OOB_JFFS2_ECC0 0 -#define OOB_JFFS2_ECC1 1 -#define OOB_JFFS2_ECC2 2 -#define OOB_JFFS2_ECC3 3 -#define OOB_JFFS2_ECC4 6 -#define OOB_JFFS2_ECC5 7 -#define OOB_LOGADDR_0_LO 8 -#define OOB_LOGADDR_0_HI 9 -#define OOB_LOGADDR_1_LO 10 -#define OOB_LOGADDR_1_HI 11 -#define OOB_LOGADDR_2_LO 12 -#define OOB_LOGADDR_2_HI 13 - -/* - * Structure for managing logical blocks in a partition; allocated on - * first use of each partition on a "safe" flash device. - */ -struct zflash_safe { - dev_t sp_dev; - u_long sp_pblks; /* physical block count */ - u_long sp_lblks; /* logical block count */ - u_int16_t *sp_phyuse; /* physical block usage */ - u_int *sp_logmap; /* logical to physical */ - u_int sp_pnext; /* next physical block */ -}; - -struct zflash_softc { - struct flash_softc sc_flash; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - int sc_ioobbadblk; - int sc_ioobpostbadblk; - struct zflash_safe *sc_safe[MAXPARTITIONS]; -}; - -int zflashmatch(struct device *, void *, void *); -void zflashattach(struct device *, struct device *, void *); -int zflashdetach(struct device *, int); - -u_int8_t zflash_reg8_read(void *, int); -int zflash_regx_read_page(void *, caddr_t, caddr_t); -void zflash_reg8_write(void *, int, u_int8_t); -int zflash_regx_write_page(void *, caddr_t, caddr_t); -void zflash_default_disklabel(void *, dev_t, struct disklabel *); -int zflash_safe_strategy(void *, struct buf *); - -int zflash_safe_start(struct zflash_softc *, dev_t); -void zflash_safe_stop(struct zflash_softc *, dev_t); - -struct cfattach flash_pxaip_ca = { - sizeof(struct zflash_softc), zflashmatch, zflashattach, - zflashdetach -}; - -struct flash_ctl_tag zflash_ctl_tag = { - zflash_reg8_read, - zflash_regx_read_page, - zflash_reg8_write, - zflash_regx_write_page, - zflash_default_disklabel, - zflash_safe_strategy -}; - -int -zflashmatch(struct device *parent, void *match, void *aux) -{ - /* XXX call flashprobe(), yet to be implemented */ - return ZAURUS_ISC3000; -} - -void -zflashattach(struct device *parent, struct device *self, void *aux) -{ - struct zflash_softc *sc = (struct zflash_softc *)self; - struct pxaip_attach_args *pxa = aux; - bus_addr_t addr = pxa->pxa_addr; - bus_size_t size = pxa->pxa_size; - - sc->sc_iot = pxa->pxa_iot; - - if ((int)addr == -1 || (int)size == 0) { - addr = 0x0c000000; - size = 0x00001000; - } - - if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) { - printf(": failed to map controller\n"); - return; - } - - /* Disable and write-protect the chip. */ - CPLD_WRITE(sc, CPLD_REG_FLASHCTL, FLASHCTL_NCE); - - flashattach(&sc->sc_flash, &zflash_ctl_tag, sc); - - switch (sc->sc_flash.sc_flashdev->id) { - case FLASH_DEVICE_SAMSUNG_K9F2808U0C: /* C3000 */ - sc->sc_ioobpostbadblk = 4; - sc->sc_ioobbadblk = 5; - break; - case FLASH_DEVICE_SAMSUNG_K9F1G08U0A: /* C3100 */ - sc->sc_ioobpostbadblk = 4; - sc->sc_ioobbadblk = 0; - break; - } -} - -int -zflashdetach(struct device *self, int flags) -{ - struct zflash_softc *sc = (struct zflash_softc *)self; - int part; - - for (part = 0; part < MAXPARTITIONS; part++) - zflash_safe_stop(sc, part); - - return (flashdetach(self, flags)); -} - -u_int8_t -zflash_reg8_read(void *arg, int reg) -{ - struct zflash_softc *sc = arg; - u_int8_t value; - - switch (reg) { - case FLASH_REG_DATA: - value = CPLD_READ(sc, CPLD_REG_FLASHIO); - break; - case FLASH_REG_READY: - value = (CPLD_READ(sc, CPLD_REG_FLASHCTL) & - FLASHCTL_RYBY) != 0; - break; - default: -#ifdef DIAGNOSTIC - printf("%s: read from pseudo-register %02x\n", - sc->sc_flash.sc_dev.dv_xname, reg); -#endif - value = 0; - break; - } - return value; -} - -void -zflash_reg8_write(void *arg, int reg, u_int8_t value) -{ - struct zflash_softc *sc = arg; - - switch (reg) { - case FLASH_REG_DATA: - case FLASH_REG_COL: - case FLASH_REG_ROW: - case FLASH_REG_CMD: - CPLD_WRITE(sc, CPLD_REG_FLASHIO, value); - break; - case FLASH_REG_ALE: - CPLD_SETORCLR(sc, CPLD_REG_FLASHCTL, FLASHCTL_ALE, value); - break; - case FLASH_REG_CLE: - CPLD_SETORCLR(sc, CPLD_REG_FLASHCTL, FLASHCTL_CLE, value); - break; - case FLASH_REG_CE: - CPLD_SETORCLR(sc, CPLD_REG_FLASHCTL, FLASHCTL_NCE, !value); - break; - case FLASH_REG_WP: - CPLD_SETORCLR(sc, CPLD_REG_FLASHCTL, FLASHCTL_NWP, !value); - break; -#ifdef DIAGNOSTIC - default: - printf("%s: write to pseudo-register %02x\n", - sc->sc_flash.sc_dev.dv_xname, reg); -#endif - } -} - -int -zflash_regx_read_page(void *arg, caddr_t data, caddr_t oob) -{ - struct zflash_softc *sc = arg; - - if (oob == NULL || sc->sc_flash.sc_flashdev->pagesize != 512) { - flash_reg8_read_page(&sc->sc_flash, data, oob); - return 0; - } - - flash_reg8_read_page(&sc->sc_flash, data, oob); - - oob[OOB_JFFS2_ECC0] = 0xff; - oob[OOB_JFFS2_ECC1] = 0xff; - oob[OOB_JFFS2_ECC2] = 0xff; - oob[OOB_JFFS2_ECC3] = 0xff; - oob[OOB_JFFS2_ECC4] = 0xff; - oob[OOB_JFFS2_ECC5] = 0xff; - return 0; -} - -int -zflash_regx_write_page(void *arg, caddr_t data, caddr_t oob) -{ - struct zflash_softc *sc = arg; - int i; - - if (oob == NULL || sc->sc_flash.sc_flashdev->pagesize != 512) { - flash_reg8_write_page(&sc->sc_flash, data, oob); - return 0; - } - - if (oob[OOB_JFFS2_ECC0] != 0xff || oob[OOB_JFFS2_ECC1] != 0xff || - oob[OOB_JFFS2_ECC2] != 0xff || oob[OOB_JFFS2_ECC3] != 0xff || - oob[OOB_JFFS2_ECC4] != 0xff || oob[OOB_JFFS2_ECC5] != 0xff) { -#ifdef DIAGNOSTIC - printf("%s: non-FF ECC bytes in OOB data\n", - sc->sc_flash.sc_dev.dv_xname); -#endif - return EINVAL; - } - - CPLD_WRITE(sc, CPLD_REG_ECCCLRR, 0x00); - for (i = 0; i < sc->sc_flash.sc_flashdev->pagesize / 2; i++) - flash_reg8_write(&sc->sc_flash, FLASH_REG_DATA, data[i]); - - oob[OOB_JFFS2_ECC0] = ~CPLD_READ(sc, CPLD_REG_ECCLPUB); - oob[OOB_JFFS2_ECC1] = ~CPLD_READ(sc, CPLD_REG_ECCLPLB); - oob[OOB_JFFS2_ECC2] = (~CPLD_READ(sc, CPLD_REG_ECCCP) << 2) | 0x03; - - if (CPLD_READ(sc, CPLD_REG_ECCCNTR) != 0) { - printf("%s: ECC failed\n", sc->sc_flash.sc_dev.dv_xname); - oob[OOB_JFFS2_ECC0] = 0xff; - oob[OOB_JFFS2_ECC1] = 0xff; - oob[OOB_JFFS2_ECC2] = 0xff; - return EIO; - } - - CPLD_WRITE(sc, CPLD_REG_ECCCLRR, 0x00); - for (; i < sc->sc_flash.sc_flashdev->pagesize; i++) - flash_reg8_write(&sc->sc_flash, FLASH_REG_DATA, data[i]); - - oob[OOB_JFFS2_ECC3] = ~CPLD_READ(sc, CPLD_REG_ECCLPUB); - oob[OOB_JFFS2_ECC4] = ~CPLD_READ(sc, CPLD_REG_ECCLPLB); - oob[OOB_JFFS2_ECC5] = (~CPLD_READ(sc, CPLD_REG_ECCCP) << 2) | 0x03; - - if (CPLD_READ(sc, CPLD_REG_ECCCNTR) != 0) { - printf("%s: ECC failed\n", sc->sc_flash.sc_dev.dv_xname); - oob[OOB_JFFS2_ECC0] = 0xff; - oob[OOB_JFFS2_ECC1] = 0xff; - oob[OOB_JFFS2_ECC2] = 0xff; - oob[OOB_JFFS2_ECC3] = 0xff; - oob[OOB_JFFS2_ECC4] = 0xff; - oob[OOB_JFFS2_ECC5] = 0xff; - return EIO; - } - - for (i = 0; i < sc->sc_flash.sc_flashdev->oobsize; i++) - flash_reg8_write(&sc->sc_flash, FLASH_REG_DATA, oob[i]); - - oob[OOB_JFFS2_ECC0] = 0xff; - oob[OOB_JFFS2_ECC1] = 0xff; - oob[OOB_JFFS2_ECC2] = 0xff; - oob[OOB_JFFS2_ECC3] = 0xff; - oob[OOB_JFFS2_ECC4] = 0xff; - oob[OOB_JFFS2_ECC5] = 0xff; - return 0; -} - -/* - * A default disklabel with only one RAW_PART spanning the whole - * device is passed to us. We add the partitions besides RAW_PART. - */ -void -zflash_default_disklabel(void *arg, dev_t dev, struct disklabel *lp) -{ - struct zflash_softc *sc = arg; - long bsize = sc->sc_flash.sc_flashdev->pagesize; - - switch (sc->sc_flash.sc_flashdev->id) { - case FLASH_DEVICE_SAMSUNG_K9F2808U0C: - DL_SETPSIZE(&lp->d_partitions[8], 7*1024*1024 / bsize); - DL_SETPSIZE(&lp->d_partitions[9], 5*1024*1024 / bsize); - DL_SETPSIZE(&lp->d_partitions[10], 4*1024*1024 / bsize); - break; - case FLASH_DEVICE_SAMSUNG_K9F1G08U0A: - DL_SETPSIZE(&lp->d_partitions[8], 7*1024*1024 / bsize); - DL_SETPSIZE(&lp->d_partitions[9], 32*1024*1024 / bsize); - DL_SETPSIZE(&lp->d_partitions[10], 89*1024*1024 / bsize); - break; - default: - return; - } - - /* The "smf" partition uses logical addressing. */ - DL_SETPOFFSET(&lp->d_partitions[8], 0); - lp->d_partitions[8].p_fstype = FS_OTHER; - - /* The "root" partition uses physical addressing. */ - DL_SETPSIZE(&lp->d_partitions[9], DL_GETPSIZE(&lp->d_partitions[8])); - lp->d_partitions[9].p_fstype = FS_OTHER; - - /* The "home" partition uses physical addressing. */ - DL_SETPOFFSET(&lp->d_partitions[10], - DL_GETPOFFSET(&lp->d_partitions[9]) + DL_GETPSIZE(&lp->d_partitions[9])); - lp->d_partitions[10].p_fstype = FS_OTHER; - lp->d_npartitions = MAXPARTITIONS; - - lp->d_version = 1; - /* Re-calculate the checksum. */ - lp->d_checksum = dkcksum(lp); -} - -/* - * Sharp's access strategy for bad blocks management and wear-leveling. - */ - -#define PHYUSE_STATUS(v) ((v) & 0x00ff) -#define P_BADBLOCK 0x0000 -#define P_POSTBADBLOCK 0x00f0 -#define P_NORMALBLOCK 0x00ff -#define PHYUSE_WRITTEN(v) ((v) & 0xff00) -#define P_DUST 0x0000 -#define P_LOGICAL 0x0100 -#define P_JFFS2 0x0300 - -void zflash_write_strategy(struct zflash_softc *, struct buf *, - struct zflash_safe *, u_int, u_int); -u_int zflash_safe_next_block(struct zflash_safe *); - -u_char zflash_oob_status_decode(u_char); -u_int16_t zflash_oob_status(struct zflash_softc *, u_char *); -u_int zflash_oob_logno(struct zflash_softc *, u_char *); -void zflash_oob_set_status(struct zflash_softc *, u_char *, u_int16_t); -void zflash_oob_set_logno(struct zflash_softc *, u_char *, u_int); - -int -zflash_safe_strategy(void *arg, struct buf *bp) -{ - struct zflash_softc *sc = arg; - struct zflash_safe *sp; - u_int logno; - u_int blkofs; - u_int blkno; - int error; - int part; - int i; - - /* Initialize logical blocks management on the fly. */ - /* XXX toss everything when the disklabel has changed. */ - if ((error = zflash_safe_start(sc, bp->b_dev)) != 0) { - bp->b_error = error; - bp->b_flags |= B_ERROR; - return 0; - } - - part = flashpart(bp->b_dev); - sp = sc->sc_safe[part]; - - logno = bp->b_blkno / (sc->sc_flash.sc_flashdev->blkpages * - sc->sc_flash.sc_flashdev->pagesize / DEV_BSIZE); - blkofs = bp->b_blkno % (sc->sc_flash.sc_flashdev->blkpages * - sc->sc_flash.sc_flashdev->pagesize / DEV_BSIZE); - - /* If exactly at end of logical flash, return EOF, else error. */ - if (logno == sp->sp_lblks && blkofs == 0) { - bp->b_resid = bp->b_bcount; - return 0; - } else if (logno >= sp->sp_lblks) { - bp->b_error = EINVAL; - bp->b_flags |= B_ERROR; - return 0; - } - - /* Writing is more complicated, so handle it separately. */ - if ((bp->b_flags & B_READ) == 0) { - flash_chip_enable(&sc->sc_flash); - zflash_write_strategy(sc, bp, sp, logno, blkofs); - flash_chip_disable(&sc->sc_flash); - return 0; - } - - /* Get the physical flash block number for this logical one. */ - blkno = sp->sp_logmap[logno]; - - /* Unused logical blocks read as all 0xff. */ - if ((bp->b_flags & B_READ) != 0 && blkno == UINT_MAX) { - for (i = 0; i < sc->sc_flash.sc_flashdev->pagesize; i++) - ((u_char *)bp->b_data)[i] = 0xff; - bp->b_resid = bp->b_bcount - - sc->sc_flash.sc_flashdev->pagesize; - return 0; - } - - /* Update the block number in the buffer with the physical one. */ - bp->b_blkno = blkno * (sc->sc_flash.sc_flashdev->blkpages * - sc->sc_flash.sc_flashdev->pagesize / DEV_BSIZE) + blkofs; - - /* Process the modified transfer buffer normally. */ - return 1; -} - -void -zflash_write_strategy(struct zflash_softc *sc, struct buf *bp, - struct zflash_safe *sp, u_int logno, u_int logofs) -{ - size_t bufsize; - u_char *buf = NULL; - size_t oobsize; - u_char *oob = NULL; - u_int oblkno; - u_int nblkno; - int error; - - /* Not efficient, but we always transfer one page for now. */ - if (bp->b_bcount < sc->sc_flash.sc_flashdev->pagesize) { - bp->b_error = EINVAL; - goto bad; - } - - /* Allocate a temporary buffer for one flash block. */ - bufsize = sc->sc_flash.sc_flashdev->blkpages * - sc->sc_flash.sc_flashdev->pagesize; - buf = (u_char *)malloc(bufsize, M_DEVBUF, M_NOWAIT); - if (buf == NULL) { - bp->b_error = ENOMEM; - goto bad; - } - - /* Allocate a temporary buffer for one spare area. */ - oobsize = sc->sc_flash.sc_flashdev->oobsize; - oob = (u_char *)malloc(oobsize, M_DEVBUF, M_NOWAIT); - if (oob == NULL) { - bp->b_error = ENOMEM; - goto bad; - } - - /* Read the old logical block into the temporary buffer. */ - oblkno = sp->sp_logmap[logno]; - if (oblkno != UINT_MAX) { - error = flash_chip_read_block(&sc->sc_flash, oblkno, buf); - if (error != 0) { - bp->b_error = error; - goto bad; - } - } else - /* Unused logical blocks read as all 0xff. */ - memset(buf, 0xff, bufsize); - - /* Transfer the page into the logical block buffer. */ - bcopy(bp->b_data, buf + logofs * sc->sc_flash.sc_flashdev->pagesize, - sc->sc_flash.sc_flashdev->pagesize); - - /* Generate OOB data for the spare area of this logical block. */ - memset(oob, 0xff, oobsize); - zflash_oob_set_status(sc, oob, P_NORMALBLOCK); - zflash_oob_set_logno(sc, oob, logno); - - while (1) { - /* Search for a free physical block. */ - nblkno = zflash_safe_next_block(sp); - if (nblkno == UINT_MAX) { - printf("%s: no spare block, giving up on logical" - " block %u\n", sc->sc_flash.sc_dev.dv_xname, - logno); - bp->b_error = ENOSPC; - goto bad; - } - -#if 0 - DPRINTF(("%s: moving logical block %u from physical %u to %u\n", - sc->sc_flash.sc_dev.dv_xname, logno, oblkno, nblkno)); -#endif - - /* Erase the free physical block. */ - if (flash_chip_erase_block(&sc->sc_flash, nblkno) != 0) { - printf("%s: can't erase block %u, retrying\n", - sc->sc_flash.sc_dev.dv_xname, nblkno); - sp->sp_phyuse[nblkno] = P_POSTBADBLOCK | P_DUST; - continue; - } - - /* Write the logical block to the free physical block. */ - if (flash_chip_write_block(&sc->sc_flash, nblkno, buf, oob)) { - printf("%s: can't write block %u, retrying\n", - sc->sc_flash.sc_dev.dv_xname, nblkno); - goto trynext; - } - - /* Yeah, we re-wrote that logical block! */ - break; - trynext: - sp->sp_phyuse[nblkno] = P_POSTBADBLOCK | P_DUST; - (void)flash_chip_erase_block(&sc->sc_flash, nblkno); - } - - /* Map the new physical block. */ - sp->sp_logmap[logno] = nblkno; - sp->sp_phyuse[nblkno] = PHYUSE_STATUS(sp->sp_phyuse[nblkno]) - | P_LOGICAL; - - /* Erase the old physical block. */ - if (oblkno != UINT_MAX) { - sp->sp_phyuse[oblkno] = PHYUSE_STATUS(sp->sp_phyuse[oblkno]) - | P_DUST; - error = flash_chip_erase_block(&sc->sc_flash, oblkno); - if (error != 0) { - printf("%s: can't erase old block %u\n", - sc->sc_flash.sc_dev.dv_xname, oblkno); - bp->b_error = error; - goto bad; - } - } - - bp->b_resid = bp->b_bcount - sc->sc_flash.sc_flashdev->pagesize; - free(oob, M_DEVBUF, oobsize); - free(buf, M_DEVBUF, bufsize); - return; -bad: - bp->b_flags |= B_ERROR; - free(oob, M_DEVBUF, oobsize); - free(buf, M_DEVBUF, bufsize); -} - -int -zflash_safe_start(struct zflash_softc *sc, dev_t dev) -{ - u_char oob[FLASH_MAXOOBSIZE]; - struct disklabel *lp = sc->sc_flash.sc_dk.dk_label; - struct zflash_safe *sp; - u_int16_t *phyuse; - u_int *logmap; - u_int blksect; - u_int blkno; - u_int logno; - u_int unusable; - int part; - - part = flashpart(dev); - if (sc->sc_safe[part] != NULL) - return 0; - - /* We can only handle so much OOB data here. */ - if (sc->sc_flash.sc_flashdev->oobsize > FLASH_MAXOOBSIZE) - return EIO; - - /* Safe partitions must start on a flash block boundary. */ - blksect = (sc->sc_flash.sc_flashdev->blkpages * - sc->sc_flash.sc_flashdev->pagesize) / lp->d_secsize; - if (DL_GETPOFFSET(&lp->d_partitions[part]) % blksect) - return EIO; - - sp = malloc(sizeof(*sp), M_DEVBUF, M_NOWAIT | M_ZERO); - if (sp == NULL) - return ENOMEM; - - sp->sp_dev = dev; - - sp->sp_pblks = DL_GETPSIZE(&lp->d_partitions[part]) / blksect; - sp->sp_lblks = sp->sp_pblks; - - /* Try to reserve a number of spare physical blocks. */ - switch (sc->sc_flash.sc_flashdev->id) { - case FLASH_DEVICE_SAMSUNG_K9F2808U0C: - sp->sp_lblks -= 24; /* C3000 */ - break; - case FLASH_DEVICE_SAMSUNG_K9F1G08U0A: - sp->sp_lblks -= 4; /* C3100 */ - break; - } - - DPRINTF(("pblks %lu lblks %lu\n", sp->sp_pblks, sp->sp_lblks)); - - /* Next physical block to use; randomize for wear-leveling. */ - sp->sp_pnext = arc4random_uniform(sp->sp_pblks); - - /* Allocate physical block usage map. */ - phyuse = (u_int16_t *)malloc(sp->sp_pblks * sizeof(u_int16_t), - M_DEVBUF, M_NOWAIT); - if (phyuse == NULL) { - free(sp, M_DEVBUF, 0); - return ENOMEM; - } - sp->sp_phyuse = phyuse; - - /* Allocate logical to physical block map. */ - logmap = (u_int *)malloc(sp->sp_lblks * sizeof(u_int), - M_DEVBUF, M_NOWAIT); - if (logmap == NULL) { - free(phyuse, M_DEVBUF, 0); - free(sp, M_DEVBUF, 0); - return ENOMEM; - } - sp->sp_logmap = logmap; - - /* Initialize the physical and logical block maps. */ - for (blkno = 0; blkno < sp->sp_pblks; blkno++) - phyuse[blkno] = P_BADBLOCK | P_DUST; - for (blkno = 0; blkno < sp->sp_lblks; blkno++) - logmap[blkno] = UINT_MAX; - - /* Update physical block usage map with real data. */ - unusable = 0; - flash_chip_enable(&sc->sc_flash); - for (blkno = 0; blkno < sp->sp_pblks; blkno++) { - long pageno; - - pageno = blkno * sc->sc_flash.sc_flashdev->blkpages; - if (flash_chip_read_oob(&sc->sc_flash, pageno, oob) != 0) { - DPRINTF(("blkno %u: can't read oob data\n", blkno)); - phyuse[blkno] = P_POSTBADBLOCK | P_DUST; - unusable++; - continue; - } - - phyuse[blkno] = zflash_oob_status(sc, oob); - if (PHYUSE_STATUS(phyuse[blkno]) != P_NORMALBLOCK) { - DPRINTF(("blkno %u: badblock status %x\n", blkno, - PHYUSE_STATUS(phyuse[blkno]))); - phyuse[blkno] |= P_DUST; - unusable++; - continue; - } - - logno = zflash_oob_logno(sc, oob); - if (logno == UINT_MAX) { - DPRINTF(("blkno %u: can't read logno\n", blkno)); - phyuse[blkno] |= P_JFFS2; - unusable++; - continue; - } - - if (logno == USHRT_MAX) { - phyuse[blkno] |= P_DUST; - /* Block is usable and available. */ - continue; - } - - if (logno >= sp->sp_lblks) { - DPRINTF(("blkno %u: logno %u too big\n", blkno, - logno)); - phyuse[blkno] |= P_JFFS2; - unusable++; - continue; - } - - if (logmap[logno] == UINT_MAX) { - phyuse[blkno] |= P_LOGICAL; - logmap[logno] = blkno; - } else { - /* Duplicate logical block! */ - DPRINTF(("blkno %u: duplicate logno %u\n", blkno, - logno)); - phyuse[blkno] |= P_DUST; - } - } - flash_chip_disable(&sc->sc_flash); - - if (unusable > 0) - printf("%s: %u unusable blocks\n", - sc->sc_flash.sc_dev.dv_xname, unusable); - - sc->sc_safe[part] = sp; - return 0; -} - -void -zflash_safe_stop(struct zflash_softc *sc, dev_t dev) -{ - struct zflash_safe *sp; - int part; - - part = flashpart(dev); - if (sc->sc_safe[part] == NULL) - return; - - sp = sc->sc_safe[part]; - free(sp->sp_phyuse, M_DEVBUF, 0); - free(sp->sp_logmap, M_DEVBUF, 0); - free(sp, M_DEVBUF, 0); - sc->sc_safe[part] = NULL; -} - -u_int -zflash_safe_next_block(struct zflash_safe *sp) -{ - u_int blkno; - - for (blkno = sp->sp_pnext; blkno < sp->sp_pblks; blkno++) - if (sp->sp_phyuse[blkno] == (P_NORMALBLOCK|P_DUST)) { - sp->sp_pnext = blkno + 1; - return blkno; - } - - for (blkno = 0; blkno < sp->sp_pnext; blkno++) - if (sp->sp_phyuse[blkno] == (P_NORMALBLOCK|P_DUST)) { - sp->sp_pnext = blkno + 1; - return blkno; - } - - return UINT_MAX; -} - -/* - * Correct single bit errors in the block's status byte. - */ -u_char -zflash_oob_status_decode(u_char status) -{ - u_char bit; - int count; - - /* Speed-up. */ - if (status == 0xff) - return 0xff; - - /* Count the number of bits set in the byte. */ - for (count = 0, bit = 0x01; bit != 0x00; bit <<= 1) - if ((status & bit) != 0) - count++; - - return (count > 6) ? 0xff : 0x00; -} - -/* - * Decode the block's status byte into a value for the phyuse map. - */ -u_int16_t -zflash_oob_status(struct zflash_softc *sc, u_char *oob) -{ - u_char status; - - status = zflash_oob_status_decode(oob[sc->sc_ioobbadblk]); - if (status != 0xff) - return P_BADBLOCK; - - status = zflash_oob_status_decode(oob[sc->sc_ioobpostbadblk]); - if (status != 0xff) - return P_POSTBADBLOCK; - - return P_NORMALBLOCK; -} - -/* - * Extract the 16-bit logical block number corresponding to a physical - * block from the physical block's OOB data. - */ -u_int -zflash_oob_logno(struct zflash_softc *sc, u_char *oob) -{ - int idx_lo, idx_hi; - u_int16_t word; - u_int16_t bit; - int parity; - - /* Find a matching pair of high and low bytes. */ - if (oob[OOB_LOGADDR_0_LO] == oob[OOB_LOGADDR_1_LO] && - oob[OOB_LOGADDR_0_HI] == oob[OOB_LOGADDR_1_HI]) { - idx_lo = OOB_LOGADDR_0_LO; - idx_hi = OOB_LOGADDR_0_HI; - } else if (oob[OOB_LOGADDR_1_LO] == oob[OOB_LOGADDR_2_LO] && - oob[OOB_LOGADDR_1_HI] == oob[OOB_LOGADDR_2_HI]) { - idx_lo = OOB_LOGADDR_1_LO; - idx_hi = OOB_LOGADDR_1_HI; - } else if (oob[OOB_LOGADDR_2_LO] == oob[OOB_LOGADDR_0_LO] && - oob[OOB_LOGADDR_2_HI] == oob[OOB_LOGADDR_0_HI]) { - idx_lo = OOB_LOGADDR_2_LO; - idx_hi = OOB_LOGADDR_2_HI; - } else - /* Block's OOB data may be invalid. */ - return UINT_MAX; - - word = ((u_int16_t)oob[idx_lo] << 0) | - ((u_int16_t)oob[idx_hi] << 8); - - /* Check for parity error in the logical block number. */ - for (parity = 0, bit = 0x0001; bit != 0x0000; bit <<= 1) - if ((word & bit) != 0) - parity++; - if ((parity & 1) != 0) - return UINT_MAX; - - /* No logical block number assigned to this block? */ - if (word == USHRT_MAX) - return word; - - /* Return the validated logical block number. */ - return (word & 0x07fe) >> 1; -} - -void -zflash_oob_set_status(struct zflash_softc *sc, u_char *oob, u_int16_t phyuse) -{ - switch (PHYUSE_STATUS(phyuse)) { - case P_NORMALBLOCK: - oob[sc->sc_ioobbadblk] = 0xff; - oob[sc->sc_ioobpostbadblk] = 0xff; - break; - case P_BADBLOCK: - oob[sc->sc_ioobbadblk] = 0x00; - oob[sc->sc_ioobpostbadblk] = 0x00; - break; - case P_POSTBADBLOCK: - oob[sc->sc_ioobbadblk] = 0xff; - oob[sc->sc_ioobpostbadblk] = 0x00; - break; - } -} - -void -zflash_oob_set_logno(struct zflash_softc *sc, u_char *oob, u_int logno) -{ - u_int16_t word; - u_int16_t bit; - u_char lo; - u_char hi; - int parity = 0; - - /* Why do we set the most significant bit? */ - word = ((logno & 0x03ff) << 1) | 0x1000; - - /* Calculate the parity. */ - for (bit = 0x0001; bit != 0x0000; bit <<= 1) - if ((word & bit) != 0) - parity++; - if ((parity & 1) != 0) - word |= 0x0001; - - lo = word & 0x00ff; - hi = (word & 0xff00) >> 8; - - oob[OOB_LOGADDR_0_LO] = lo; - oob[OOB_LOGADDR_0_HI] = hi; - oob[OOB_LOGADDR_1_LO] = lo; - oob[OOB_LOGADDR_1_HI] = hi; - oob[OOB_LOGADDR_2_LO] = lo; - oob[OOB_LOGADDR_2_HI] = hi; -} diff --git a/sys/arch/zaurus/dev/zaurus_kbd.c b/sys/arch/zaurus/dev/zaurus_kbd.c deleted file mode 100644 index a110b651304..00000000000 --- a/sys/arch/zaurus/dev/zaurus_kbd.c +++ /dev/null @@ -1,545 +0,0 @@ -/* $OpenBSD: zaurus_kbd.c,v 1.36 2014/07/11 08:18:31 guenther Exp $ */ -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/timeout.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/signalvar.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wskbdvar.h> -#include <dev/wscons/wsksymdef.h> -#include <dev/wscons/wsksymvar.h> - -#include <zaurus/dev/zaurus_kbdmap.h> - -#include "apm.h" - -const int -gpio_sense_pins_c3000[] = { - 12, - 17, - 91, - 34, - 36, - 38, - 39, - -1 -}; - -const int -gpio_strobe_pins_c3000[] = { - 88, - 23, - 24, - 25, - 26, - 27, - 52, - 103, - 107, - -1, - 108, - 114 -}; - -const int stuck_keys[] = { - 7, - 15, - 23, - 31 -}; - - -#define REP_DELAY1 400 -#define REP_DELAYN 100 - -struct zkbd_softc { - struct device sc_dev; - - const int *sc_sense_array; - const int *sc_strobe_array; - int sc_nsense; - int sc_nstrobe; - - short sc_onkey_pin; - short sc_sync_pin; - short sc_swa_pin; - short sc_swb_pin; - char *sc_okeystate; - char *sc_keystate; - char sc_hinge; /* 0=open, 1=nonsense, 2=backwards, 3=closed */ - char sc_maxkbdcol; - - struct timeout sc_roll_to; - - /* console stuff */ - int sc_polling; - int sc_pollUD; - int sc_pollkey; - - /* wskbd bits */ - struct device *sc_wskbddev; - int sc_rawkbd; -#ifdef WSDISPLAY_COMPAT_RAWKBD - const char *sc_xt_keymap; -#define MAXKEYS 20 -#endif -}; - -struct zkbd_softc *zkbd_dev; /* XXX */ - -int zkbd_match(struct device *, void *, void *); -void zkbd_attach(struct device *, struct device *, void *); -int zkbd_activate(struct device *, int); - -int zkbd_irq(void *v); -void zkbd_poll(void *v); -int zkbd_on(void *v); -int zkbd_sync(void *v); -int zkbd_hinge(void *v); - -int zkbd_modstate; - -struct cfattach zkbd_ca = { - sizeof(struct zkbd_softc), zkbd_match, zkbd_attach, NULL, - zkbd_activate -}; - -struct cfdriver zkbd_cd = { - NULL, "zkbd", DV_DULL -}; - -int zkbd_enable(void *, int); -void zkbd_set_leds(void *, int); -int zkbd_ioctl(void *, u_long, caddr_t, int, struct proc *); - -struct wskbd_accessops zkbd_accessops = { - zkbd_enable, - zkbd_set_leds, - zkbd_ioctl, -}; - -void zkbd_cngetc(void *, u_int *, int *); -void zkbd_cnpollc(void *, int); - -struct wskbd_consops zkbd_consops = { - zkbd_cngetc, - zkbd_cnpollc, -}; - -struct wskbd_mapdata zkbd_keymapdata = { - zkbd_keydesctab, - KB_US | KB_DEFAULT, -}; - - - -int -zkbd_match(struct device *parent, void *cf, void *aux) -{ - return 1; -} - - -void -zkbd_attach(struct device *parent, struct device *self, void *aux) -{ - struct zkbd_softc *sc = (struct zkbd_softc *)self; - struct wskbddev_attach_args a; - int pin, i; - extern int glass_console; - - zkbd_dev = sc; - sc->sc_polling = 0; -#ifdef WSDISPLAY_COMPAT_RAWKBD - sc->sc_rawkbd = 0; -#endif - /* Determine which system we are - XXX */ - - if (1 /* C3000 */) { - sc->sc_sense_array = gpio_sense_pins_c3000; - sc->sc_strobe_array = gpio_strobe_pins_c3000; - sc->sc_nsense = sizeof(gpio_sense_pins_c3000)/sizeof(int); - sc->sc_nstrobe = sizeof(gpio_strobe_pins_c3000)/sizeof(int); - sc->sc_maxkbdcol = 10; - sc->sc_onkey_pin = 95; - sc->sc_sync_pin = 16; - sc->sc_swa_pin = 97; - sc->sc_swb_pin = 96; -#ifdef WSDISPLAY_COMPAT_RAWKBD - sc->sc_xt_keymap = xt_keymap; -#endif - } /* XXX */ - - sc->sc_okeystate = malloc(sc->sc_nsense * sc->sc_nstrobe, - M_DEVBUF, M_NOWAIT | M_ZERO); - - sc->sc_keystate = malloc(sc->sc_nsense * sc->sc_nstrobe, - M_DEVBUF, M_NOWAIT | M_ZERO); - - /* set all the strobe bits */ - for (i = 0; i < sc->sc_nstrobe; i++) { - pin = sc->sc_strobe_array[i]; - if (pin == -1) { - continue; - } - pxa2x0_gpio_set_function(pin, GPIO_SET|GPIO_OUT); - } - /* set all the sense bits */ - for (i = 0; i < sc->sc_nsense; i++) { - pin = sc->sc_sense_array[i]; - if (pin == -1) { - continue; - } - pxa2x0_gpio_set_function(pin, GPIO_IN); - pxa2x0_gpio_intr_establish(pin, IST_EDGE_BOTH, IPL_TTY, - zkbd_irq, sc, sc->sc_dev.dv_xname); - } - pxa2x0_gpio_intr_establish(sc->sc_onkey_pin, IST_EDGE_BOTH, IPL_TTY, - zkbd_on, sc, sc->sc_dev.dv_xname); - pxa2x0_gpio_intr_establish(sc->sc_sync_pin, IST_EDGE_RISING, IPL_TTY, - zkbd_sync, sc, sc->sc_dev.dv_xname); - pxa2x0_gpio_intr_establish(sc->sc_swa_pin, IST_EDGE_BOTH, IPL_TTY, - zkbd_hinge, sc, sc->sc_dev.dv_xname); - pxa2x0_gpio_intr_establish(sc->sc_swb_pin, IST_EDGE_BOTH, IPL_TTY, - zkbd_hinge, sc, sc->sc_dev.dv_xname); - - if (glass_console) { - wskbd_cnattach(&zkbd_consops, sc, &zkbd_keymapdata); - a.console = 1; - } else { - a.console = 0; - } - - a.keymap = &zkbd_keymapdata; - a.accessops = &zkbd_accessops; - a.accesscookie = sc; - - printf("\n"); - - zkbd_hinge(sc); /* to initialize sc_hinge */ - - sc->sc_wskbddev = config_found(self, &a, wskbddevprint); - - timeout_set(&(sc->sc_roll_to), zkbd_poll, sc); -} - -/* XXX only deal with keys that can be pressed when display is open? */ -/* XXX are some not in the array? */ -/* handle keypress interrupt */ -int -zkbd_irq(void *v) -{ - zkbd_poll(v); - - return 1; -} - -void -zkbd_poll(void *v) -{ - struct zkbd_softc *sc = v; - int i, j, col, pin, type, keysdown = 0, s; - int stuck; - int keystate; -#ifdef WSDISPLAY_COMPAT_RAWKBD - int ncbuf = 0, c; - char cbuf[MAXKEYS * 2]; -#endif - - s = spltty(); - - /* discharge all */ - for (i = 0; i < sc->sc_nstrobe; i++) { - pin = sc->sc_strobe_array[i]; - if (pin != -1) { - pxa2x0_gpio_clear_bit(pin); - pxa2x0_gpio_set_dir(pin, GPIO_IN); - } - } - - delay (10); - for(col = 0; col < sc->sc_nstrobe; col++) { - if (sc->sc_strobe_array[i] == -1) - continue; - - pin = sc->sc_strobe_array[col]; - - /* activate_col */ - pxa2x0_gpio_set_bit(pin); - pxa2x0_gpio_set_dir(pin, GPIO_OUT); - - /* wait activate delay */ - delay(10); - - /* read row */ - for (i = 0; i < sc->sc_nsense; i++) { - int bit; - - if (sc->sc_sense_array[i] == -1) - continue; - - bit = pxa2x0_gpio_get_bit(sc->sc_sense_array[i]); - if (bit && sc->sc_hinge && col < sc->sc_maxkbdcol) - continue; - sc->sc_keystate[i + (col * sc->sc_nsense)] = bit; - } - - /* reset_col */ - pxa2x0_gpio_set_dir(pin, GPIO_IN); - /* wait discharge delay */ - delay(10); - } - /* charge all */ - for (i = 0; i < sc->sc_nstrobe; i++) { - pin = sc->sc_strobe_array[i]; - if (pin != -1) { - pxa2x0_gpio_set_bit(pin); - pxa2x0_gpio_set_dir(pin, GPIO_OUT); - } - } - - /* force the irqs to clear as we have just played with them. */ - for (i = 0; i < sc->sc_nsense; i++) - if (sc->sc_sense_array[i] != -1) - pxa2x0_gpio_clear_intr(sc->sc_sense_array[i]); - - /* process after resetting interrupt */ - - zkbd_modstate = ( - (sc->sc_keystate[84] ? (1 << 0) : 0) | /* shift */ - (sc->sc_keystate[93] ? (1 << 1) : 0) | /* Fn */ - (sc->sc_keystate[14] ? (1 << 2) : 0)); /* 'alt' */ - - for (i = 0; i < (sc->sc_nsense * sc->sc_nstrobe); i++) { - stuck = 0; - /* extend xt_keymap to do this faster. */ - /* ignore 'stuck' keys' */ - for (j = 0; j < sizeof(stuck_keys)/sizeof(stuck_keys[0]); j++) { - if (stuck_keys[j] == i) { - stuck = 1 ; - break; - } - } - if (stuck) - continue; - keystate = sc->sc_keystate[i]; - - keysdown |= keystate; /* if any keys held */ - -#ifdef WSDISPLAY_COMPAT_RAWKBD - if (sc->sc_polling == 0 && sc->sc_rawkbd) { - if ((keystate) || (sc->sc_okeystate[i] != keystate)) { - c = sc->sc_xt_keymap[i]; - if (c & 0x80) { - cbuf[ncbuf++] = 0xe0; - } - cbuf[ncbuf] = c & 0x7f; - if (!keystate) - cbuf[ncbuf] |= 0x80; - ncbuf++; - sc->sc_okeystate[i] = keystate; - } - } -#endif - - if ((!sc->sc_rawkbd) && (sc->sc_okeystate[i] != keystate)) { - - type = keystate ? WSCONS_EVENT_KEY_DOWN : - WSCONS_EVENT_KEY_UP; - - if (sc->sc_polling) { - sc->sc_pollkey = i; - sc->sc_pollUD = type; - } else { - wskbd_input(sc->sc_wskbddev, type, i); - } - - sc->sc_okeystate[i] = keystate; - } - } - -#ifdef WSDISPLAY_COMPAT_RAWKBD - if (sc->sc_polling == 0 && sc->sc_rawkbd) - wskbd_rawinput(sc->sc_wskbddev, cbuf, ncbuf); -#endif - if (keysdown) - timeout_add(&(sc->sc_roll_to), hz * REP_DELAYN / 1000 / 2); - else - timeout_del(&(sc->sc_roll_to)); /* always cancel? */ - - splx(s); -} - -#if NAPM > 0 -extern int allowpowerdown; -extern int apm_suspends; -static int zkbdondown; /* on key is pressed */ -static struct timeval zkbdontv = { 0, 0 }; /* last on key event */ -const struct timeval zkbdhalttv = { 3, 0 }; /* 3s for safe shutdown */ -const struct timeval zkbdsleeptv = { 0, 250000 }; /* .25s for suspend */ -extern int lid_suspend; -#endif - -int -zkbd_on(void *v) -{ -#if NAPM > 0 - struct zkbd_softc *sc = v; - int down = pxa2x0_gpio_get_bit(sc->sc_onkey_pin) ? 1 : 0; - - /* - * Change run mode depending on how long the key is held down. - * Ignore the key if it gets pressed while the lid is closed. - * - * Keys can bounce and we have to work around missed interrupts. - * Only the second edge is detected upon exit from sleep mode. - */ - if (down) { - if (sc->sc_hinge == 3) { - zkbdondown = 0; - } else { - microuptime(&zkbdontv); - zkbdondown = 1; - } - } else if (zkbdondown) { - if (ratecheck(&zkbdontv, &zkbdhalttv)) { - if (allowpowerdown == 1) { - allowpowerdown = 0; - prsignal(initprocess, SIGUSR2); - } - } else if (ratecheck(&zkbdontv, &zkbdsleeptv)) { - apm_suspends++; - } - zkbdondown = 0; - } -#endif - return 1; -} - -int -zkbd_sync(void *v) -{ - return 1; -} - -int -zkbd_hinge(void *v) -{ - struct zkbd_softc *sc = v; - int a = pxa2x0_gpio_get_bit(sc->sc_swa_pin) ? 1 : 0; - int b = pxa2x0_gpio_get_bit(sc->sc_swb_pin) ? 2 : 0; - extern void lcd_blank(int); - - sc->sc_hinge = a | b; - - if (sc->sc_hinge == 3) { -#if NAPM > 0 - if (lid_suspend) - apm_suspends++; -#endif - lcd_blank(1); - } else - lcd_blank(0); - - - return 1; -} - -int -zkbd_enable(void *v, int on) -{ - return 0; -} - -void -zkbd_set_leds(void *v, int on) -{ -} - -int -zkbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ -#ifdef WSDISPLAY_COMPAT_RAWKBD - struct zkbd_softc *sc = v; -#endif - - switch (cmd) { - - case WSKBDIO_GTYPE: - *(int *)data = WSKBD_TYPE_ZAURUS; - return 0; - case WSKBDIO_SETLEDS: - return 0; - case WSKBDIO_GETLEDS: - *(int *)data = 0; - return 0; -#ifdef WSDISPLAY_COMPAT_RAWKBD - case WSKBDIO_SETMODE: - sc->sc_rawkbd = *(int *)data == WSKBD_RAW; - return (0); -#endif - - } - /* kbdioctl(...); */ - - return -1; -} - -/* implement polling for zaurus_kbd */ -void -zkbd_cngetc(void *v, u_int *type, int *data) -{ - struct zkbd_softc *sc = zkbd_dev; - sc->sc_pollkey = -1; - sc->sc_pollUD = -1; - sc->sc_polling = 1; - while (sc->sc_pollkey == -1) { - zkbd_poll(zkbd_dev); - DELAY(10000); /* XXX */ - } - sc->sc_polling = 0; - *data = sc->sc_pollkey; - *type = sc->sc_pollUD; -} - -void -zkbd_cnpollc(void *v, int on) -{ -} - -int -zkbd_activate(struct device *self, int act) -{ - switch (act) { - case DVACT_SUSPEND: - zkbd_hinge(self); - break; - case DVACT_RESUME: - zkbd_hinge(self); - break; - } - return 0; -} diff --git a/sys/arch/zaurus/dev/zaurus_kbdmap.h b/sys/arch/zaurus/dev/zaurus_kbdmap.h deleted file mode 100644 index c5b699938e1..00000000000 --- a/sys/arch/zaurus/dev/zaurus_kbdmap.h +++ /dev/null @@ -1,197 +0,0 @@ -/* $OpenBSD: zaurus_kbdmap.h,v 1.19 2005/05/10 08:26:12 espie Exp $ */ - -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#define KC(n) KS_KEYCODE(n) -#include <dev/wscons/wskbdraw.h> - -static const keysym_t zkbd_keydesc_us[] = { - KC(0), KS_Control_L, - KC(2), KS_Tab, KS_Tab, KS_Caps_Lock, - KC(3), KS_Cmd_Screen1, KS_f2, /* Addr, */ - KC(4), KS_Cmd_Screen0, KS_f1, /* Cal, */ - KC(5), KS_Cmd_Screen2, KS_f3, /* Mail, */ - KC(6), KS_Cmd_Screen3, KS_f4, /* Home, */ - KC(8), KS_1, KS_exclam, - KC(9), KS_2, KS_quotedbl, - KC(10), KS_q, - KC(11), KS_w, KS_W, KS_asciicircum, - KC(12), KS_a, - KC(13), KS_z, - KC(14), KS_Cmd, KS_Alt_L, - KC(16), KS_Cmd_BrightnessDown, KS_3, KS_numbersign, - KC(17), KS_Cmd_BrightnessUp, KS_4, KS_dollar, - KC(18), KS_e, KS_E, KS_equal, - KC(19), KS_s, - KC(20), KS_d, KS_D, KS_grave, - KC(21), KS_x, - /* KC(22), ^/t (right japanese) */ - KC(24), KS_5, KS_percent, - KC(25), KS_r, KS_R, KS_plus, - KC(26), KS_t, KS_T, KS_bracketleft, - KC(27), KS_f, KS_F, KS_backslash, - KC(28), KS_c, - KC(29), KS_minus, KS_minus, KS_at, - KC(30), KS_Cmd_Debugger,KS_Escape, /* Cancel */ - KC(32), KS_6, KS_ampersand, - KC(33), KS_y, KS_Y, KS_bracketright, - KC(34), KS_g, KS_G, KS_semicolon, - KC(35), KS_v, - KC(36), KS_b, KS_B, KS_underscore, - KC(37), KS_space, - KC(38), KS_KP_Enter, /* ok */ - KC(40), KS_7, KS_apostrophe, - KC(41), KS_8, KS_parenleft, - KC(42), KS_u, KS_U, KS_braceleft, - KC(43), KS_h, KS_H, KS_colon, - KC(44), KS_n, - KC(45), KS_comma, KS_slash, KS_less, - KC(46), KS_Cmd_Screen4, KS_f5, /* Menu, */ - KC(48), KS_9, KS_parenright, - KC(49), KS_i, KS_I, KS_braceright, - KC(50), KS_j, KS_J, KS_asterisk, - KC(51), KS_m, - KC(52), KS_period, KS_question, KS_greater, - KC(54), KS_KP_Left, KS_KP_Left, KS_Home, /* left, */ - KC(56), KS_0, KS_asciitilde, - KC(57), KS_o, - KC(58), KS_k, - KC(59), KS_l, KS_L, KS_bar, - KC(61), KS_KP_Up, KS_KP_Up, KS_Prior, /* up, */ - KC(62), KS_KP_Down, KS_KP_Down, KS_Next, /* down, */ - KC(64), KS_Delete, KS_BackSpace, - KC(65), KS_p, - KC(68), KS_Return, - KC(70), KS_KP_Right, KS_KP_Right, KS_End, /* right, */ - KC(80), KS_KP_Right, /* OK, (ext) */ - KC(81), KS_KP_Down, /* tog left, */ - KC(83), KS_Shift_R, - KC(84), KS_Shift_L, - KC(88), KS_KP_Left, /* cancel (ext), */ - KC(89), KS_KP_Up, /* tog right, */ - KC(93), KS_Mode_switch /* Fn */ -}; - -#ifdef WSDISPLAY_COMPAT_RAWKBD -static const char xt_keymap[] = { - /* KC(0), */ RAWKEY_Control_L,/* KS_Control_L, */ - /* KC(1), */ RAWKEY_Null, /* NC */ - /* KC(2), */ RAWKEY_Tab, /* KS_Tab, KS_Tab, KS_Caps_Lock, */ - /* KC(3), */ RAWKEY_f2, /* KS_Cmd_Screen1, KS_f2, Addr, */ - /* KC(4), */ RAWKEY_f1, /* KS_Cmd_Screen0, KS_f1, Cal, */ - /* KC(5), */ RAWKEY_f3, /* KS_Cmd_Screen2, KS_f3, Mail, */ - /* KC(6), */ RAWKEY_f4, /* KS_Cmd_Screen3, KS_f4, Home, */ - /* KC(7), */ RAWKEY_Null, /* NC */ - /* KC(8), */ RAWKEY_1, /* KS_1, KS_exclam, */ - /* KC(9), */ RAWKEY_2, /* KS_2, KS_quotedbl, */ - /* KC(10), */ RAWKEY_q, /* KS_q, */ - /* KC(11), */ RAWKEY_w, /* KS_w, KS_W, KS_asciicircum, */ - /* KC(12), */ RAWKEY_a, /* KS_a, */ - /* KC(13), */ RAWKEY_z, /* KS_z, */ - /* KC(14), */ RAWKEY_Alt_L, /* KS_Cmd, KS_Alt_L, */ - /* KC(15), */ RAWKEY_Null, /* NC */ - /* KC(16), */ RAWKEY_3, /* KS_3, KS_numbersign, */ - /* KC(17), */ RAWKEY_4, /* KS_4, KS_dollar, */ - /* KC(18), */ RAWKEY_e, /* KS_e, KS_E, KS_equal, */ - /* KC(19), */ RAWKEY_s, /* KS_s, */ - /* KC(20), */ RAWKEY_d, /* KS_d, KS_D, KS_grave, */ - /* KC(21), */ RAWKEY_x, /* KS_x, */ - /* KC(22), */ RAWKEY_Null, /* ^/t (right japanese) */ - /* KC(23), */ RAWKEY_Null, /* NC */ - /* KC(24), */ RAWKEY_5, /* KS_5, KS_percent, */ - /* KC(25), */ RAWKEY_r, /* KS_r, KS_R, KS_plus, */ - /* KC(26), */ RAWKEY_t, /* KS_t, KS_T, KS_bracketleft, */ - /* KC(27), */ RAWKEY_f, /* KS_f, KS_F, KS_backslash, */ - /* KC(28), */ RAWKEY_c, /* KS_c, */ - /* KC(29), */ RAWKEY_minus, /* KS_minus, KS_minus, KS_at, */ - /* KC(30), */ RAWKEY_Escape, /* KS_Escape, Cancel */ - /* KC(31), */ RAWKEY_Null, /* NC */ - /* KC(32), */ RAWKEY_6, /* KS_6, KS_ampersand, */ - /* KC(33), */ RAWKEY_y, /* KS_y, KS_Y, KS_bracketright, */ - /* KC(34), */ RAWKEY_g, /* KS_g, KS_G, KS_semicolon, */ - /* KC(35), */ RAWKEY_v, /* KS_v, */ - /* KC(36), */ RAWKEY_b, /* KS_b, KS_B, KS_underscore, */ - /* KC(37), */ RAWKEY_space, /* KS_space, */ - /* KC(38), */ RAWKEY_KP_Enter, /* KS_KP_Enter, ok */ - /* KC(39), */ RAWKEY_Null, /* NC */ - /* KC(40), */ RAWKEY_7, /* KS_7, KS_apostrophe, */ - /* KC(41), */ RAWKEY_8, /* KS_8, KS_parenleft, */ - /* KC(42), */ RAWKEY_u, /* KS_u, KS_U, KS_braceleft, */ - /* KC(43), */ RAWKEY_h, /* KS_h, KS_H, KS_colon, */ - /* KC(44), */ RAWKEY_n, /* KS_n, */ - /* KC(45), */ RAWKEY_comma, /* KS_comma, KS_slash, KS_less, */ - /* KC(46), */ RAWKEY_f5, /* KS_Cmd_Screen4, KS_f5, Menu, */ - /* KC(47), */ RAWKEY_Null, /* NC */ - /* KC(48), */ RAWKEY_9, /* KS_9, KS_parenright, */ - /* KC(49), */ RAWKEY_i, /* KS_i, KS_I, KS_braceright, */ - /* KC(50), */ RAWKEY_j, /* KS_j, KS_J, KS_asterisk, */ - /* KC(51), */ RAWKEY_m, /* KS_m, */ - /* KC(52), */ RAWKEY_period, /* KS_period, KS_question, KS_greater, */ - /* KC(53), */ RAWKEY_Null, /* NC */ - /* KC(54), */ RAWKEY_Left, /* KS_KP_Left, left, */ - /* KC(55), */ RAWKEY_Null, /* NC */ - /* KC(56), */ RAWKEY_0, /* KS_0, KS_asciitilde, */ - /* KC(57), */ RAWKEY_o, /* KS_o, */ - /* KC(58), */ RAWKEY_k, /* KS_k, */ - /* KC(59), */ RAWKEY_l, /* KS_l, KS_L, KS_bar, */ - /* KC(60), */ RAWKEY_Null, /* NC */ - /* KC(61), */ RAWKEY_Up, /* KS_KP_Up, up, */ - /* KC(62), */ RAWKEY_Down, /* KS_KP_Down, down, */ - /* KC(63), */ RAWKEY_Null, /* NC */ - /* KC(64), */ RAWKEY_BackSpace, /* KS_Delete, KS_BackSpace, */ - /* KC(65), */ RAWKEY_p, /* KS_p, */ - /* KC(66), */ RAWKEY_Null, /* NC */ - /* KC(67), */ RAWKEY_Null, /* NC */ - /* KC(68), */ RAWKEY_Return, /* KS_Return, */ - /* KC(69), */ RAWKEY_Null, /* NC */ - /* KC(70), */ RAWKEY_Right, /* KS_KP_Right, right, */ - /* KC(71), */ RAWKEY_Null, /* NC */ - /* KC(72), */ RAWKEY_Null, /* NC */ - /* KC(73), */ RAWKEY_Null, /* NC */ - /* KC(74), */ RAWKEY_Null, /* NC */ - /* KC(75), */ RAWKEY_Null, /* NC */ - /* KC(76), */ RAWKEY_Null, /* NC */ - /* KC(77), */ RAWKEY_Null, /* NC */ - /* KC(78), */ RAWKEY_Null, /* NC */ - /* KC(79), */ RAWKEY_Null, /* NC */ - /* KC(80), */ RAWKEY_Right, /* KS_KP_Right, OK, (ext) */ - /* KC(81), */ RAWKEY_Down, /* KS_KP_Down, tog left, */ - /* KC(82), */ RAWKEY_Null, /* NC */ - /* KC(83), */ RAWKEY_Shift_R, /* KS_Shift_R, */ - /* KC(84), */ RAWKEY_Shift_L, /* KS_Shift_L, */ - /* KC(85), */ RAWKEY_Null, /* NC */ - /* KC(86), */ RAWKEY_Null, /* NC */ - /* KC(87), */ RAWKEY_Null, /* NC */ - /* KC(88), */ RAWKEY_Left, /* KS_KP_Left, cancel (ext), */ - /* KC(89), */ RAWKEY_Up, /* KS_KP_Up, tog right, */ - /* KC(90), */ RAWKEY_Null, /* NC */ - /* KC(91), */ RAWKEY_Null, /* NC */ - /* KC(92), */ RAWKEY_Null, /* NC */ - /* KC(93), */ RAWKEY_Alt_R, /* KS_Mode_switch Fn */ -}; -#endif - -#define KBD_MAP(name, base, map) \ - { name, base, sizeof(map)/sizeof(keysym_t), map } - -static const struct wscons_keydesc zkbd_keydesctab[] = { - KBD_MAP(KB_US, 0, zkbd_keydesc_us), - {0, 0, 0, 0} -}; - -#undef KBD_MAP -#undef KC diff --git a/sys/arch/zaurus/dev/zaurus_remote.c b/sys/arch/zaurus/dev/zaurus_remote.c deleted file mode 100644 index ae12c08b23c..00000000000 --- a/sys/arch/zaurus/dev/zaurus_remote.c +++ /dev/null @@ -1,374 +0,0 @@ -/* $OpenBSD: zaurus_remote.c,v 1.2 2014/01/26 17:48:08 miod Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/limits.h> -#include <sys/timeout.h> -#include <sys/systm.h> - -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wskbdraw.h> -#include <dev/wscons/wskbdvar.h> -#include <dev/wscons/wsksymdef.h> -#include <dev/wscons/wsksymvar.h> - -#include <machine/intr.h> -#include <machine/zaurus_var.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <zaurus/dev/zaurus_scoopvar.h> -#include <zaurus/dev/zaurus_sspvar.h> - -#define RESCAN_INTERVAL (hz/100) - -#define KEY_RELEASE 0 /* button release */ -#define KEY_VOL_DOWN 1 -#define KEY_MUTE 2 -#define KEY_REWIND 3 -#define KEY_VOL_UP 4 -#define KEY_FORWARD 5 -#define KEY_PLAY 6 -#define KEY_STOP 7 -#define KEY_EARPHONE 8 - -#ifdef DEBUG -static const char *zrc_keyname[] = { - "(release)", "volume down", "mute", "rewind", "volume up", - "forward", "play", "stop", "(earphone)" -}; -#endif - -struct zrc_akey { - int min; /* minimum ADC value or INT_MIN */ - int key; /* remote control key number */ -}; - -/* Values match the resistors in the CE-RH2 remote control. */ -static const struct zrc_akey zrc_akeytab_c3000[] = { - { 238, KEY_RELEASE }, - { 202, KEY_VOL_DOWN }, - { 168, KEY_MUTE }, - { 135, KEY_REWIND }, - { 105, KEY_VOL_UP }, - { 74, KEY_FORWARD }, - { 42, KEY_PLAY }, - { 12, KEY_STOP }, - { INT_MIN, KEY_EARPHONE } -}; - -static const struct zrc_akey *zrc_akeytab = zrc_akeytab_c3000; - -struct zrc_softc { - struct device sc_dev; - struct timeout sc_to; - void *sc_ih; - int sc_key; /* being scanned */ - int sc_scans; /* rescan counter */ - int sc_noise; /* discard if too noisy? */ - int sc_keydown; /* currently pressed key */ - struct device *sc_wskbddev; -#ifdef WSDISPLAY_COMPAT_RAWKBD - int sc_rawkbd; -#endif -}; - -int zrc_match(struct device *, void *, void *); -void zrc_attach(struct device *, struct device *, void *); - -int zrc_intr(void *); -void zrc_timeout(void *); -int zrc_scan(void); -void zrc_input(struct zrc_softc *, int, int); - -struct cfattach zrc_ca = { - sizeof(struct zrc_softc), zrc_match, zrc_attach -}; - -struct cfdriver zrc_cd = { - NULL, "zrc", DV_DULL -}; - -int zrc_enable(void *, int); -void zrc_set_leds(void *, int); -int zrc_ioctl(void *, u_long, caddr_t, int, struct proc *); - -struct wskbd_accessops zrc_accessops = { - zrc_enable, - zrc_set_leds, - zrc_ioctl, -}; - -#define KC(n) KS_KEYCODE(n) - -/* XXX what keys should be generated in translated mode? */ -static const keysym_t zrc_keydesc[] = { - KC(KEY_VOL_DOWN), KS_minus, - KC(KEY_MUTE), KS_m, - KC(KEY_REWIND), KS_b, - KC(KEY_VOL_UP), KS_plus, - KC(KEY_FORWARD), KS_f, - KC(KEY_PLAY), KS_p, - KC(KEY_STOP), KS_s, -}; - -#ifdef WSDISPLAY_COMPAT_RAWKBD -#define RAWKEY_AudioRewind 0xa0 -#define RAWKEY_AudioForward 0xa1 -#define RAWKEY_AudioPlay 0xa2 -#define RAWKEY_AudioStop 0xa3 -static const keysym_t zrc_xt_keymap[] = { - /* KC(KEY_RELEASE), */ RAWKEY_Null, - /* KC(KEY_VOL_DOWN), */ RAWKEY_AudioLower, - /* KC(KEY_MUTE), */ RAWKEY_AudioMute, - /* KC(KEY_REWIND), */ RAWKEY_AudioRewind, - /* KC(KEY_VOL_UP), */ RAWKEY_AudioRaise, - /* KC(KEY_FORWARD), */ RAWKEY_AudioForward, - /* KC(KEY_PLAY), */ RAWKEY_AudioPlay, - /* KC(KEY_STOP), */ RAWKEY_AudioStop, -}; -#endif - -static const struct wscons_keydesc zrc_keydesctab[] = { - {KB_US, 0, sizeof(zrc_keydesc)/sizeof(keysym_t), zrc_keydesc}, - {0, 0, 0, 0} -}; - -struct wskbd_mapdata zrc_keymapdata = { - zrc_keydesctab, KB_US | KB_DEFAULT -}; - - -int -zrc_match(struct device *parent, void *match, void *aux) -{ - return (ZAURUS_ISC3000); -} - -void -zrc_attach(struct device *parent, struct device *self, void *aux) -{ - struct zrc_softc *sc = (struct zrc_softc *)self; - struct wskbddev_attach_args a; - - /* Configure remote control interrupt handling. */ - timeout_set(&sc->sc_to, zrc_timeout, sc); - pxa2x0_gpio_set_function(C3000_RC_IRQ_PIN, GPIO_IN); - sc->sc_ih = pxa2x0_gpio_intr_establish(C3000_RC_IRQ_PIN, - IST_EDGE_BOTH, IPL_BIO, zrc_intr, sc, "zrc"); - - /* Enable the pullup while waiting for an interrupt. */ - scoop_akin_pullup(1); - - sc->sc_keydown = KEY_RELEASE; - - printf(": CE-RH2 remote control\n"); - - a.console = 0; - a.keymap = &zrc_keymapdata; - a.accessops = &zrc_accessops; - a.accesscookie = sc; - - sc->sc_wskbddev = config_found(self, &a, wskbddevprint); -} - -int -zrc_intr(void *v) -{ - struct zrc_softc *sc = v; - - /* just return if remote control isn't present */ - - pxa2x0_gpio_intr_mask(sc->sc_ih); - scoop_akin_pullup(0); - sc->sc_key = zrc_scan(); - sc->sc_scans = 0; - sc->sc_noise = 0; - timeout_add(&sc->sc_to, RESCAN_INTERVAL); - return (1); -} - -void -zrc_timeout(void *v) -{ - struct zrc_softc *sc = v; - int key; - - key = zrc_scan(); - switch (sc->sc_scans) { - case 0: - case 1: - case 2: - /* wait for a stable read */ - if (sc->sc_key == key) - sc->sc_scans++; - else { - sc->sc_key = key; - sc->sc_scans = 0; - sc->sc_noise++; - } - timeout_add(&sc->sc_to, RESCAN_INTERVAL); - break; - case 3: - /* generate key press event */ - if (sc->sc_key != key) { - key = sc->sc_key; - sc->sc_noise++; - } - sc->sc_scans++; - switch (key) { - case KEY_EARPHONE: - case KEY_RELEASE: - sc->sc_scans = 6; - break; - default: -#ifdef DEBUG - printf("%s pressed (%d noise)\n", zrc_keyname[key], - sc->sc_noise); -#endif - sc->sc_keydown = key; - sc->sc_noise = 0; - zrc_input(sc, key, 1); - break; - } - timeout_add(&sc->sc_to, RESCAN_INTERVAL); - break; - case 4: - case 5: - /* wait for key release, permit noise */ - if (sc->sc_key == key) { - if (sc->sc_scans == 5) - sc->sc_noise++; - sc->sc_scans = 4; - } else - sc->sc_scans++; - timeout_add(&sc->sc_to, RESCAN_INTERVAL); - break; - case 6: - /* generate key release event */ - if (sc->sc_keydown != KEY_RELEASE) { - zrc_input(sc, sc->sc_keydown, 0); -#ifdef DEBUG - printf("%s released (%d noise)\n", - zrc_keyname[sc->sc_keydown], sc->sc_noise); -#endif - sc->sc_keydown = KEY_RELEASE; - } - /* FALLTHROUGH */ - default: - /* unmask interrupt again */ - timeout_del(&sc->sc_to); - sc->sc_scans = 7; - scoop_akin_pullup(1); - pxa2x0_gpio_intr_unmask(sc->sc_ih); - } -} - -int -zrc_scan(void) -{ - int val; - int i; - -/* XXX MAX1111 command word - also appears in zaurus_apm.c */ -#define MAXCTRL_PD0 (1<<0) -#define MAXCTRL_PD1 (1<<1) -#define MAXCTRL_SGL (1<<2) -#define MAXCTRL_UNI (1<<3) -#define MAXCTRL_SEL_SHIFT 4 -#define MAXCTRL_STR (1<<7) - -#define C3000_ADCCH_ZRC 0 - val = zssp_read_max1111(MAXCTRL_PD0 | MAXCTRL_PD1 | MAXCTRL_SGL | - MAXCTRL_UNI | (C3000_ADCCH_ZRC << MAXCTRL_SEL_SHIFT) | - MAXCTRL_STR); - for (i = 0; zrc_akeytab[i].min != INT_MIN; i++) - if (val >= zrc_akeytab[i].min) - break; - return (zrc_akeytab[i].key); -} - -void -zrc_input(struct zrc_softc *sc, int key, int down) -{ - u_int type = down ? WSCONS_EVENT_KEY_DOWN : WSCONS_EVENT_KEY_UP; - int s; - - s = spltty(); - -#ifdef WSDISPLAY_COMPAT_RAWKBD - if (sc->sc_rawkbd) { - int c; - u_char cbuf[2]; - int ncbuf = 0; - - c = zrc_xt_keymap[key]; - if (c & 0x80) - cbuf[ncbuf++] = 0xe0; - cbuf[ncbuf] = c & 0x7f; - - if (!down) - cbuf[ncbuf] |= 0x80; - ncbuf++; - - wskbd_rawinput(sc->sc_wskbddev, cbuf, ncbuf); - } else -#endif - wskbd_input(sc->sc_wskbddev, type, key); - - splx(s); -} - -int -zrc_enable(void *v, int on) -{ - return (0); -} - -void -zrc_set_leds(void *v, int on) -{ -} - -int -zrc_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ -#ifdef WSDISPLAY_COMPAT_RAWKBD - struct zrc_softc *sc = v; -#endif - - switch (cmd) { - case WSKBDIO_GTYPE: - *(int *)data = WSKBD_TYPE_ZAURUS; - return (0); - case WSKBDIO_SETLEDS: - return (0); - case WSKBDIO_GETLEDS: - *(int *)data = 0; - return (0); -#ifdef WSDISPLAY_COMPAT_RAWKBD - case WSKBDIO_SETMODE: - sc->sc_rawkbd = *(int *)data == WSKBD_RAW; - return (0); -#endif - } - return (-1); -} diff --git a/sys/arch/zaurus/dev/zaurus_scoop.c b/sys/arch/zaurus/dev/zaurus_scoop.c deleted file mode 100644 index f14c644c22d..00000000000 --- a/sys/arch/zaurus/dev/zaurus_scoop.c +++ /dev/null @@ -1,472 +0,0 @@ -/* $OpenBSD: zaurus_scoop.c,v 1.21 2010/09/07 16:21:41 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/kernel.h> -#include <sys/systm.h> -#include <sys/conf.h> -#include <sys/disk.h> -#include <sys/timeout.h> -#include <sys/gpio.h> - -#include <machine/bus.h> - -#include <arm/xscale/pxa2x0var.h> - -#include <machine/machine_reg.h> -#include <machine/zaurus_var.h> - -#include <zaurus/dev/zaurus_scoopreg.h> -#include <zaurus/dev/zaurus_scoopvar.h> - -struct scoop_softc { - struct device sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - u_int16_t sc_gpwr; /* GPIO state before suspend */ - int sc_suspended; -}; - -int scoopmatch(struct device *, void *, void *); -void scoopattach(struct device *, struct device *, void *); -int scoop_activate(struct device *, int); - -struct cfattach scoop_ca = { - sizeof (struct scoop_softc), scoopmatch, scoopattach, NULL, - scoop_activate -}; - -struct cfdriver scoop_cd = { - NULL, "scoop", DV_DULL -}; - -enum card { - SD_CARD, - CF_CARD /* socket 0 (external) */ -}; - -int scoop_gpio_pin_read(struct scoop_softc *sc, int); -void scoop_gpio_pin_write(struct scoop_softc *sc, int, int); -void scoop_gpio_pin_ctl(struct scoop_softc *sc, int, int); -void scoop0_set_card_power(enum card, int); - -struct timeout scoop_checkdisk; -void scoop_timeout(void *); - -int -scoopmatch(struct device *parent, void *match, void *aux) -{ - struct cfdata *cf = match; - - /* - * Only C3000-like models are known to have two SCOOPs. - */ - if (ZAURUS_ISC3000) - return (cf->cf_unit < 2); - - return (cf->cf_unit == 0); -} - -void -scoopattach(struct device *parent, struct device *self, void *aux) -{ - struct pxaip_attach_args *pxa = aux; - struct scoop_softc *sc = (struct scoop_softc *)self; - bus_addr_t addr; - bus_size_t size; - - sc->sc_iot = pxa->pxa_iot; - - if (pxa->pxa_addr != -1) - addr = pxa->pxa_addr; - else if (sc->sc_dev.dv_unit == 0) - addr = C3000_SCOOP0_BASE; - else - addr = C3000_SCOOP1_BASE; - - size = pxa->pxa_size < SCOOP_SIZE ? SCOOP_SIZE : pxa->pxa_size; - - if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) { - printf(": failed to map %s\n", sc->sc_dev.dv_xname); - return; - } - - if (ZAURUS_ISC3000 && sc->sc_dev.dv_unit == 1) { - scoop_gpio_pin_ctl(sc, SCOOP1_AKIN_PULLUP, GPIO_PIN_OUTPUT); - scoop_gpio_pin_write(sc, SCOOP1_AKIN_PULLUP, GPIO_PIN_LOW); - } else if (!ZAURUS_ISC3000) { - scoop_gpio_pin_ctl(sc, SCOOP0_AKIN_PULLUP, GPIO_PIN_OUTPUT); - scoop_gpio_pin_write(sc, SCOOP0_AKIN_PULLUP, GPIO_PIN_LOW); - } - - if (sc->sc_dev.dv_unit == 0) - timeout_set(&scoop_checkdisk, scoop_timeout, sc); - - printf(": PCMCIA/GPIO controller\n"); -} - -int -scoop_gpio_pin_read(struct scoop_softc *sc, int pin) -{ - u_int16_t rv; - u_int16_t bit = (1 << pin); - - rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR); - return (rv & bit) != 0 ? 1 : 0; -} - -void -scoop_gpio_pin_write(struct scoop_softc *sc, int pin, int level) -{ - u_int16_t rv; - u_int16_t bit = (1 << pin); - int s; - - s = splhigh(); - rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - level == GPIO_PIN_LOW ? (rv & ~bit) : (rv | bit)); - splx(s); -} - -void -scoop_gpio_pin_ctl(struct scoop_softc *sc, int pin, int flags) -{ - u_int16_t rv; - u_int16_t bit = (1 << pin); - - rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR); - switch (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { - case GPIO_PIN_INPUT: - rv &= ~bit; - break; - case GPIO_PIN_OUTPUT: - rv |= bit; - break; - } - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPCR, rv); -} - -/* - * Turn the LCD background light and contrast signal on or off. - */ -void -scoop_set_backlight(int on, int cont) -{ - - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) { - /* C3000 */ - scoop_gpio_pin_write(scoop_cd.cd_devs[1], - SCOOP1_BACKLIGHT_CONT, !cont); - scoop_gpio_pin_write(scoop_cd.cd_devs[1], - SCOOP1_BACKLIGHT_ON, on); - } -#if 0 - else if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) { - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_BACKLIGHT_CONT, cont); - } -#endif -} - -/* - * Turn the infrared LED on or off (must be on while transmitting). - */ -void -scoop_set_irled(int on) -{ - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) - /* IR_ON is inverted */ - scoop_gpio_pin_write(scoop_cd.cd_devs[1], - SCOOP1_IR_ON, !on); -} - -/* - * Turn the green and orange LEDs on or off. If the orange LED is on, - * then it is wired to indicate if A/C is connected. The green LED has - * no such predefined function. - */ -void -scoop_led_set(int led, int on) -{ - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) { - if ((led & SCOOP_LED_GREEN) != 0) - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_LED_GREEN, on); - if (scoop_cd.cd_ndevs > 1 && (led & SCOOP_LED_ORANGE) != 0) - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_LED_ORANGE_C3000, on); - } -} - -/* - * Enable or disable the headphone output connection. - */ -void -scoop_set_headphone(int on) -{ - if (scoop_cd.cd_ndevs < 1 || scoop_cd.cd_devs[0] == NULL) - return; - - scoop_gpio_pin_ctl(scoop_cd.cd_devs[0], SCOOP0_MUTE_L, - GPIO_PIN_OUTPUT); - scoop_gpio_pin_ctl(scoop_cd.cd_devs[0], SCOOP0_MUTE_R, - GPIO_PIN_OUTPUT); - - if (on) { - scoop_gpio_pin_write(scoop_cd.cd_devs[0], SCOOP0_MUTE_L, - GPIO_PIN_HIGH); - scoop_gpio_pin_write(scoop_cd.cd_devs[0], SCOOP0_MUTE_R, - GPIO_PIN_HIGH); - } else { - scoop_gpio_pin_write(scoop_cd.cd_devs[0], SCOOP0_MUTE_L, - GPIO_PIN_LOW); - scoop_gpio_pin_write(scoop_cd.cd_devs[0], SCOOP0_MUTE_R, - GPIO_PIN_LOW); - } -} - -/* - * Enable or disable 3.3V power to the SD/MMC card slot. - */ -void -scoop_set_sdmmc_power(int on) -{ - scoop0_set_card_power(SD_CARD, on ? SCP_CPR_SD_3V : SCP_CPR_OFF); -} - -/* - * The Card Power Register of the first SCOOP unit controls the power - * for the first CompactFlash slot and the SD/MMC card slot as well. - */ -void -scoop0_set_card_power(enum card slot, int new_cpr) -{ - struct scoop_softc *sc = scoop_cd.cd_devs[0]; - u_int16_t cpr; - - cpr = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_CPR); - if (new_cpr & SCP_CPR_VOLTAGE_MSK) { - if (slot == CF_CARD) - cpr |= SCP_CPR_5V; - else if (slot == SD_CARD) - cpr |= SCP_CPR_SD_3V; - - scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 1); - if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V)) - delay(5000); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_CPR, - cpr | new_cpr); - } else { - if (slot == CF_CARD) - cpr &= ~SCP_CPR_5V; - else if (slot == SD_CARD) - cpr &= ~SCP_CPR_SD_3V; - - if (!ISSET(cpr, SCP_CPR_5V) && !ISSET(cpr, SCP_CPR_SD_3V)) { - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_CPR, - SCP_CPR_OFF); - delay(1000); - scoop_gpio_pin_write(sc, SCOOP0_CF_POWER_C3000, 0); - } else - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_CPR, - cpr | new_cpr); - } -} - -/* - * Turn on pullup resistor while not reading the remote control. - */ -void -scoop_akin_pullup(int enable) -{ - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) - scoop_gpio_pin_write(scoop_cd.cd_devs[1], - SCOOP1_AKIN_PULLUP, enable); - else - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_AKIN_PULLUP, enable); -} - -void -scoop_battery_temp_adc(int enable) -{ - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_ADC_TEMP_ON_C3000, enable); -} - -void -scoop_charge_battery(int enable, int voltage_high) -{ - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) { - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_JK_B_C3000, voltage_high); - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_CHARGE_OFF_C3000, !enable); - } -} - -void -scoop_discharge_battery(int enable) -{ - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) - scoop_gpio_pin_write(scoop_cd.cd_devs[0], - SCOOP0_JK_A_C3000, enable); -} - -/* XXX */ -void scoop_check_mcr(void); -void -scoop_check_mcr(void) -{ - struct scoop_softc *sc; - - /* C3000 */ - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) { - - sc = scoop_cd.cd_devs[0]; - if ((bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR) & - 0x100) == 0) - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR, - 0x0101); - - sc = scoop_cd.cd_devs[1]; - if ((bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR) & - 0x100) == 0) - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_MCR, - 0x0101); - } -} - -void -scoop_suspend(void) -{ - struct scoop_softc *sc; - u_int32_t rv; - - scoop_check_mcr(); - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) { - sc = scoop_cd.cd_devs[0]; - sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh, - SCOOP_GPWR); - /* C3000 */ - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - sc->sc_gpwr & ~((1<<SCOOP0_MUTE_L) | (1<<SCOOP0_MUTE_R) | - (1<<SCOOP0_JK_A_C3000) | (1<<SCOOP0_ADC_TEMP_ON_C3000) | - (1<<SCOOP0_LED_GREEN))); - } - - /* C3000 */ - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) { - sc = scoop_cd.cd_devs[1]; - sc->sc_gpwr = bus_space_read_2(sc->sc_iot, sc->sc_ioh, - SCOOP_GPWR); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - sc->sc_gpwr & ~((1<<SCOOP1_RESERVED_4) | - (1<<SCOOP1_RESERVED_5) | (1<<SCOOP1_RESERVED_6) | - (1<<SCOOP1_BACKLIGHT_CONT) | (1<<SCOOP1_BACKLIGHT_ON) | - (1<<SCOOP1_MIC_BIAS))); - rv = bus_space_read_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR); - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - rv | ((1<<SCOOP1_IR_ON) | (1<<SCOOP1_RESERVED_3))); - } -} - -void -scoop_resume(void) -{ - struct scoop_softc *sc; - - scoop_check_mcr(); - - if (scoop_cd.cd_ndevs > 0 && scoop_cd.cd_devs[0] != NULL) { - sc = scoop_cd.cd_devs[0]; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - sc->sc_gpwr); - } - - if (scoop_cd.cd_ndevs > 1 && scoop_cd.cd_devs[1] != NULL) { - sc = scoop_cd.cd_devs[1]; - bus_space_write_2(sc->sc_iot, sc->sc_ioh, SCOOP_GPWR, - sc->sc_gpwr); - } -} - -void -scoop_timeout(void *v) -{ - extern struct disklist_head disklist; - struct scoop_softc *sc = v; - static struct disk *dk; - static int state = 0; - - if (dk == NULL) { - TAILQ_FOREACH(dk, &disklist, dk_link) { - if (dk->dk_name && - strcmp(dk->dk_name, "wd0") == 0) - break; - } - } - - if (sc->sc_suspended) - state = -1; - else if (dk) { - int newstate = (dk->dk_busy ? 1 : 0); - - if (newstate != state) { - state = newstate; - scoop_led_set(SCOOP_LED_GREEN, newstate); - } - } - timeout_add(&scoop_checkdisk, hz/25); -} - -int -scoop_activate(struct device *self, int act) -{ - struct scoop_softc *sc = (struct scoop_softc *)self; - - switch (act) { - case DVACT_SUSPEND: - /* - * Nothing should use the scoop from this point on. - * No timeouts, no interrupts (even though interrupts - * are still enabled). scoop_timeout() respects the - * sc_suspended flag. - */ - if (sc->sc_dev.dv_unit == 0) { - sc->sc_suspended = 1; - scoop_suspend(); - } - break; - case DVACT_RESUME: - if (sc->sc_dev.dv_unit == 0) { - scoop_resume(); - sc->sc_suspended = 0; - } - break; - } - return 0; -} diff --git a/sys/arch/zaurus/dev/zaurus_scoopreg.h b/sys/arch/zaurus/dev/zaurus_scoopreg.h deleted file mode 100644 index b5a87619883..00000000000 --- a/sys/arch/zaurus/dev/zaurus_scoopreg.h +++ /dev/null @@ -1,83 +0,0 @@ -/* $OpenBSD: zaurus_scoopreg.h,v 1.8 2007/03/18 20:50:23 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#define SCOOP_SIZE 0x2c - -/* registers and values */ - -#define SCOOP_MCR 0x00 -#define SCP_MCR_IOCARD 0x0010 -#define SCOOP_CDR 0x04 /* card detect register */ -#define SCP_CDR_DETECT 0x0002 -#define SCOOP_CSR 0x08 /* card status register */ -#define SCP_CSR_READY 0x0002 -#define SCP_CSR_MISSING 0x0004 -#define SCP_CSR_WPROT 0x0008 -#define SCP_CSR_BVD1 0x0010 -#define SCP_CSR_BVD2 0x0020 -#define SCP_CSR_3V 0x0040 -#define SCP_CSR_PWR 0x0080 -#define SCOOP_CPR 0x0c /* card power register */ -#define SCP_CPR_OFF 0x0000 -#define SCP_CPR_3V 0x0001 /* 3V for CF card */ -#define SCP_CPR_5V 0x0002 /* 5V for CF card */ -#define SCP_CPR_SD_3V 0x0004 /* 3.3V for SD/MMC card */ -#define SCP_CPR_VOLTAGE_MSK 0x0007 -#define SCP_CPR_PWR 0x0080 -#define SCOOP_CCR 0x10 /* card control register */ -#define SCP_CCR_RESET 0x0080 -#define SCOOP_IRR 0x14 /* XXX for pcic: bit 0x4 role is? */ -#define SCOOP_IRM 0x14 -#define SCOOP_IMR 0x18 -#define SCP_IMR_READY 0x0002 -#define SCP_IMR_DETECT 0x0004 -#define SCP_IMR_WRPROT 0x0008 -#define SCP_IMR_STSCHG 0x0010 -#define SCP_IMR_BATWARN 0x0020 -#define SCP_IMR_UNKN0 0x0040 -#define SCP_IMR_UNKN1 0x0080 -#define SCOOP_ISR 0x1c -#define SCOOP_GPCR 0x20 /* GPIO pin direction (R/W) */ -#define SCOOP_GPWR 0x24 /* GPIO pin output level (R/W) */ -#define SCOOP_GPRR 0x28 /* GPIO pin input level (R) */ - -/* GPIO bits */ - -#define SCOOP0_LED_GREEN 1 -#define SCOOP0_JK_B_C3000 2 -#define SCOOP0_CHARGE_OFF_C3000 3 -#define SCOOP0_MUTE_L 4 -#define SCOOP0_MUTE_R 5 -#define SCOOP0_AKIN_PULLUP 6 -#define SCOOP0_CF_POWER_C3000 6 -#define SCOOP0_APM_ON 7 -#define SCOOP0_LED_ORANGE_C3000 7 -#define SCOOP0_BACKLIGHT_CONT 8 -#define SCOOP0_JK_A_C3000 8 -#define SCOOP0_MIC_BIAS 9 -#define SCOOP0_ADC_TEMP_ON_C3000 9 - -#define SCOOP1_IR_ON 1 -#define SCOOP1_AKIN_PULLUP 2 -#define SCOOP1_RESERVED_3 3 -#define SCOOP1_RESERVED_4 4 -#define SCOOP1_RESERVED_5 5 -#define SCOOP1_RESERVED_6 6 -#define SCOOP1_BACKLIGHT_CONT 7 -#define SCOOP1_BACKLIGHT_ON 8 -#define SCOOP1_MIC_BIAS 9 diff --git a/sys/arch/zaurus/dev/zaurus_scoopvar.h b/sys/arch/zaurus/dev/zaurus_scoopvar.h deleted file mode 100644 index 2f5d1c78851..00000000000 --- a/sys/arch/zaurus/dev/zaurus_scoopvar.h +++ /dev/null @@ -1,33 +0,0 @@ -/* $OpenBSD: zaurus_scoopvar.h,v 1.11 2007/03/18 20:50:23 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#define SCOOP_LED_GREEN (1<<0) -#define SCOOP_LED_ORANGE (1<<1) - -void scoop_set_backlight(int, int); -void scoop_set_irled(int); -void scoop_led_set(int, int); -void scoop_battery_temp_adc(int); -void scoop_charge_battery(int, int); -void scoop_discharge_battery(int); -void scoop_check_mcr(void); -void scoop_set_headphone(int); -void scoop_set_sdmmc_power(int); -void scoop_akin_pullup(int); -void scoop_suspend(void); -void scoop_resume(void); diff --git a/sys/arch/zaurus/dev/zaurus_ssp.c b/sys/arch/zaurus/dev/zaurus_ssp.c deleted file mode 100644 index 31282237ae2..00000000000 --- a/sys/arch/zaurus/dev/zaurus_ssp.c +++ /dev/null @@ -1,402 +0,0 @@ -/* $OpenBSD: zaurus_ssp.c,v 1.8 2010/09/07 16:21:41 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> - -#include <machine/bus.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <zaurus/dev/zaurus_sspvar.h> - -#define GPIO_ADS7846_CS_C3000 14 /* SSP SFRM */ -#define GPIO_MAX1111_CS_C3000 20 -#define GPIO_TG_CS_C3000 53 - -#define SSCR0_ADS7846_C3000 0x06ab -#define SSCR0_LZ9JG18 0x01ab -#define SSCR0_MAX1111 0x0387 - -struct zssp_softc { - struct device sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; -}; - -int zssp_match(struct device *, void *, void *); -void zssp_attach(struct device *, struct device *, void *); -void zssp_init(void); -int zssp_activate(struct device *, int); - -int zssp_read_max1111(u_int32_t); -u_int32_t zssp_read_ads7846(u_int32_t); -void zssp_write_lz9jg18(u_int32_t); - -struct cfattach zssp_ca = { - sizeof (struct zssp_softc), zssp_match, zssp_attach, NULL, - zssp_activate -}; - -struct cfdriver zssp_cd = { - NULL, "zssp", DV_DULL -}; - -int -zssp_match(struct device *parent, void *match, void *aux) -{ - return 1; -} - -void -zssp_attach(struct device *parent, struct device *self, void *aux) -{ - struct zssp_softc *sc = (struct zssp_softc *)self; - - sc->sc_iot = &pxa2x0_bs_tag; - if (bus_space_map(sc->sc_iot, PXA2X0_SSP1_BASE, PXA2X0_SSP_SIZE, - 0, &sc->sc_ioh)) { - printf(": can't map bus space\n"); - return; - } - - printf("\n"); - - zssp_init(); -} - -/* - * Initialize the dedicated SSP unit and disable all chip selects. - * This function is called with interrupts disabled. - */ -void -zssp_init(void) -{ - struct zssp_softc *sc; - - KASSERT(zssp_cd.cd_ndevs > 0 && zssp_cd.cd_devs[0] != NULL); - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - - pxa2x0_clkman_config(CKEN_SSP, 1); - - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, SSCR0_LZ9JG18); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR1, 0); - - pxa2x0_gpio_set_function(GPIO_ADS7846_CS_C3000, GPIO_OUT|GPIO_SET); - pxa2x0_gpio_set_function(GPIO_MAX1111_CS_C3000, GPIO_OUT|GPIO_SET); - pxa2x0_gpio_set_function(GPIO_TG_CS_C3000, GPIO_OUT|GPIO_SET); -} - -int -zssp_activate(struct device *self, int act) -{ - switch (act) { - case DVACT_SUSPEND: - break; - case DVACT_RESUME: - zssp_init(); - break; - } - return 0; -} - -/* - * Transmit a single data word to one of the ICs, keep the chip selected - * afterwards, and don't wait for data to be returned in SSDR. Interrupts - * must be held off until zssp_ic_stop() gets called. - */ -void -zssp_ic_start(int ic, u_int32_t data) -{ - struct zssp_softc *sc; - - KASSERT(zssp_cd.cd_ndevs > 0 && zssp_cd.cd_devs[0] != NULL); - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - - /* disable other ICs */ - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, 0); - if (ic != ZSSP_IC_ADS7846) - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); - if (ic != ZSSP_IC_LZ9JG18) - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - if (ic != ZSSP_IC_MAX1111) - pxa2x0_gpio_set_bit(GPIO_MAX1111_CS_C3000); - - /* activate the chosen one */ - switch (ic) { - case ZSSP_IC_ADS7846: - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, - SSCR0_ADS7846_C3000); - pxa2x0_gpio_clear_bit(GPIO_ADS7846_CS_C3000); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR, data); - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_TNF) != SSSR_TNF) - /* poll */; - break; - case ZSSP_IC_LZ9JG18: - pxa2x0_gpio_clear_bit(GPIO_TG_CS_C3000); - break; - case ZSSP_IC_MAX1111: - pxa2x0_gpio_clear_bit(GPIO_MAX1111_CS_C3000); - break; - } -} - -/* - * Read the last value from SSDR and deactivate all chip-selects. - */ -u_int32_t -zssp_ic_stop(int ic) -{ - struct zssp_softc *sc; - u_int32_t rv; - - KASSERT(zssp_cd.cd_ndevs > 0 && zssp_cd.cd_devs[0] != NULL); - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - - switch (ic) { - case ZSSP_IC_ADS7846: - /* read result of last command */ - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_RNE) != SSSR_RNE) - /* poll */; - rv = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR); - break; - case ZSSP_IC_LZ9JG18: - case ZSSP_IC_MAX1111: - /* last value received is irrelevant or undefined */ - default: - rv = 0; - break; - } - - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_MAX1111_CS_C3000); - - return (rv); -} - -/* - * Activate one of the chip-select lines, transmit one word value in - * each direction, and deactivate the chip-select again. - */ -u_int32_t -zssp_ic_send(int ic, u_int32_t data) -{ - - switch (ic) { - case ZSSP_IC_MAX1111: - return (zssp_read_max1111(data)); - case ZSSP_IC_ADS7846: - return (zssp_read_ads7846(data)); - case ZSSP_IC_LZ9JG18: - zssp_write_lz9jg18(data); - return 0; - default: - printf("zssp_ic_send: invalid IC %d\n", ic); - return 0; - } -} - -int -zssp_read_max1111(u_int32_t cmd) -{ - struct zssp_softc *sc; - int voltage[2]; - int i; - int s; - - KASSERT(zssp_cd.cd_ndevs > 0 && zssp_cd.cd_devs[0] != NULL); - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - - s = splhigh(); - - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, 0); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, SSCR0_MAX1111); - - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); - pxa2x0_gpio_clear_bit(GPIO_MAX1111_CS_C3000); - - delay(1); - - /* Send the command word and read a dummy word back. */ - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR, cmd); - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_TNF) != SSSR_TNF) - /* poll */; - /* XXX is this delay necessary? */ - delay(1); - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_RNE) != SSSR_RNE) - /* poll */; - i = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR); - - for (i = 0; i < 2; i++) { - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR, 0); - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_TNF) != SSSR_TNF) - /* poll */; - /* XXX again, is this delay necessary? */ - delay(1); - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_RNE) != SSSR_RNE) - /* poll */; - voltage[i] = bus_space_read_4(sc->sc_iot, sc->sc_ioh, - SSP_SSDR); - } - - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_MAX1111_CS_C3000); - - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, 0); - - /* XXX no idea what this means, but it's what Linux would do. */ - if ((voltage[0] & 0xc0) != 0 || (voltage[1] & 0x3f) != 0) - voltage[0] = -1; - else - voltage[0] = ((voltage[0] << 2) & 0xfc) | - ((voltage[1] >> 6) & 0x03); - - splx(s); - return voltage[0]; -} - -/* XXX - only does CS_ADS7846 */ -u_int32_t -zssp_read_ads7846(u_int32_t cmd) -{ - struct zssp_softc *sc; - - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - unsigned int cr0; - int s; - u_int32_t val; - - if (zssp_cd.cd_ndevs < 1 || zssp_cd.cd_devs[0] == NULL) { - printf("zssp_read_ads7846: not configured\n"); - return 0; - } - sc = (struct zssp_softc *)zssp_cd.cd_devs[0]; - - s = splhigh(); - if (1) { - cr0 = SSCR0_ADS7846_C3000; - } else { - cr0 = 0x00ab; - } - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, 0); - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSCR0, cr0); - - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_MAX1111_CS_C3000); - pxa2x0_gpio_clear_bit(GPIO_ADS7846_CS_C3000); - - bus_space_write_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR, cmd); - - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_TNF) != SSSR_TNF) - /* poll */; - - delay(1); - - while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSSR) - & SSSR_RNE) != SSSR_RNE) - /* poll */; - - val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SSP_SSDR); - - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); /* deselect */ - - splx(s); - - return val; -} - -void -zssp_write_lz9jg18(u_int32_t data) -{ - int s; - int sclk_pin, sclk_fn; - int sfrm_pin, sfrm_fn; - int txd_pin, txd_fn; - int rxd_pin, rxd_fn; - int i; - - /* XXX this creates a DAC command from a backlight duty value. */ - data = 0x40 | (data & 0x1f); - - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) { - /* C3000 */ - sclk_pin = 19; - sfrm_pin = 14; - txd_pin = 87; - rxd_pin = 86; - } else { - sclk_pin = 23; - sfrm_pin = 24; - txd_pin = 25; - rxd_pin = 26; - } - - s = splhigh(); - - sclk_fn = pxa2x0_gpio_get_function(sclk_pin); - sfrm_fn = pxa2x0_gpio_get_function(sfrm_pin); - txd_fn = pxa2x0_gpio_get_function(txd_pin); - rxd_fn = pxa2x0_gpio_get_function(rxd_pin); - - pxa2x0_gpio_set_function(sfrm_pin, GPIO_OUT | GPIO_SET); - pxa2x0_gpio_set_function(sclk_pin, GPIO_OUT | GPIO_CLR); - pxa2x0_gpio_set_function(txd_pin, GPIO_OUT | GPIO_CLR); - pxa2x0_gpio_set_function(rxd_pin, GPIO_IN); - - pxa2x0_gpio_set_bit(GPIO_MAX1111_CS_C3000); - pxa2x0_gpio_set_bit(GPIO_ADS7846_CS_C3000); - pxa2x0_gpio_clear_bit(GPIO_TG_CS_C3000); - - delay(10); - - for (i = 0; i < 8; i++) { - if (data & 0x80) - pxa2x0_gpio_set_bit(txd_pin); - else - pxa2x0_gpio_clear_bit(txd_pin); - delay(10); - pxa2x0_gpio_set_bit(sclk_pin); - delay(10); - pxa2x0_gpio_clear_bit(sclk_pin); - delay(10); - data <<= 1; - } - - pxa2x0_gpio_clear_bit(txd_pin); - pxa2x0_gpio_set_bit(GPIO_TG_CS_C3000); - - pxa2x0_gpio_set_function(sclk_pin, sclk_fn); - pxa2x0_gpio_set_function(sfrm_pin, sfrm_fn); - pxa2x0_gpio_set_function(txd_pin, txd_fn); - pxa2x0_gpio_set_function(rxd_pin, rxd_fn); - - splx(s); -} diff --git a/sys/arch/zaurus/dev/zaurus_sspvar.h b/sys/arch/zaurus/dev/zaurus_sspvar.h deleted file mode 100644 index 9bb4a36d28f..00000000000 --- a/sys/arch/zaurus/dev/zaurus_sspvar.h +++ /dev/null @@ -1,28 +0,0 @@ -/* $OpenBSD: zaurus_sspvar.h,v 1.3 2005/04/08 21:58:49 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#define ZSSP_IC_MAX1111 1 /* temperature/voltage ADC */ -#define ZSSP_IC_LZ9JG18 2 /* LCD backlight controller */ -#define ZSSP_IC_ADS7846 3 /* touch screen controller */ - -void zssp_ic_start(int, u_int32_t); -u_int32_t zssp_ic_send(int, u_int32_t); -u_int32_t zssp_ic_stop(int); - -int zssp_read_max1111(u_int32_t); -void zssp_write_lz9jg18(u_int32_t); diff --git a/sys/arch/zaurus/dev/zaurus_udc.c b/sys/arch/zaurus/dev/zaurus_udc.c deleted file mode 100644 index 7c2f7558b91..00000000000 --- a/sys/arch/zaurus/dev/zaurus_udc.c +++ /dev/null @@ -1,108 +0,0 @@ -/* $OpenBSD: zaurus_udc.c,v 1.3 2013/10/24 22:40:10 aalm Exp $ */ -/* - * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* Attachment driver for pxaudc(4) on Zaurus */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/systm.h> -#include <sys/timeout.h> - -#include <dev/sdmmc/sdmmcreg.h> -#include <machine/machine_reg.h> -#include <machine/zaurus_var.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbdivar.h> -#include <dev/usb/usbf.h> -#include <dev/usb/usbfvar.h> - -#include <arch/arm/xscale/pxa2x0_gpio.h> -#include <arch/arm/xscale/pxa27x_udc.h> - -int zaurus_udc_match(struct device *, void *, void *); -void zaurus_udc_attach(struct device *, struct device *, void *); -int zaurus_udc_detach(struct device *, int); -int zaurus_udc_activate(struct device *, int); -int zaurus_udc_is_host(void); - -struct cfattach pxaudc_zaurus_ca = { - sizeof(struct pxaudc_softc), - zaurus_udc_match, - zaurus_udc_attach, - zaurus_udc_detach, - zaurus_udc_activate -}; - -int -zaurus_udc_match(struct device *parent, void *match, void *aux) -{ - return pxaudc_match(); -} - -int -zaurus_udc_is_host(void) -{ - return !(pxa2x0_gpio_get_bit(GPIO_USB_DETECT) || - pxa2x0_gpio_get_bit(GPIO_USB_DEVICE)); -} - -void -zaurus_udc_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)self; - - - sc->sc_gpio_detect = GPIO_USB_DETECT; - sc->sc_gpio_pullup = GPIO_USB_PULLUP; - sc->sc_gpio_pullup_inv = 0; - sc->sc_is_host = zaurus_udc_is_host; - - /* Platform specific GPIO configuration */ - pxa2x0_gpio_set_function(GPIO_USB_DETECT, GPIO_IN); - pxa2x0_gpio_set_function(GPIO_USB_DEVICE, GPIO_IN); - pxa2x0_gpio_set_function(GPIO_USB_PULLUP, GPIO_OUT); - - pxa2x0_gpio_set_function(45, GPIO_OUT); - pxa2x0_gpio_set_function(40, GPIO_OUT); - pxa2x0_gpio_set_function(39, GPIO_IN); - pxa2x0_gpio_set_function(38, GPIO_IN); - pxa2x0_gpio_set_function(37, GPIO_OUT); - pxa2x0_gpio_set_function(36, GPIO_IN); - pxa2x0_gpio_set_function(34, GPIO_IN); - pxa2x0_gpio_set_function(89, GPIO_OUT); - pxa2x0_gpio_set_function(120, GPIO_OUT); - - pxaudc_attach(sc, aux); -} - -int -zaurus_udc_detach(struct device *self, int flags) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)self; - - return pxaudc_detach(sc, flags); -} - -int -zaurus_udc_activate(struct device *self, int act) -{ - struct pxaudc_softc *sc = (struct pxaudc_softc *)self; - - return pxaudc_activate(sc, act); -} diff --git a/sys/arch/zaurus/dev/zts.c b/sys/arch/zaurus/dev/zts.c deleted file mode 100644 index 7cf51ebeceb..00000000000 --- a/sys/arch/zaurus/dev/zts.c +++ /dev/null @@ -1,610 +0,0 @@ -/* $OpenBSD: zts.c,v 1.17 2016/06/05 20:15:54 bru Exp $ */ -/* - * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/device.h> -#include <sys/malloc.h> -#include <sys/timeout.h> -#include <sys/kernel.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0_gpio.h> - -#include <zaurus/dev/zaurus_sspvar.h> - -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wsmousevar.h> - -#include <dev/wscons/wsdisplayvar.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_lcd.h> - -#ifdef ZTS_DEBUG -#define DPRINTF(x) do { printf x; } while (0) -#else -#define DPRINTF(x) -#endif - -/* - * ADS784x touch screen controller - */ -#define ADSCTRL_PD0_SH 0 /* PD0 bit */ -#define ADSCTRL_PD1_SH 1 /* PD1 bit */ -#define ADSCTRL_DFR_SH 2 /* SER/DFR bit */ -#define ADSCTRL_MOD_SH 3 /* Mode bit */ -#define ADSCTRL_ADR_SH 4 /* Address setting */ -#define ADSCTRL_STS_SH 7 /* Start bit */ - -#define GPIO_TP_INT_C3K 11 -#define GPIO_HSYNC_C3K 22 - -#define POLL_TIMEOUT_RATE0 ((hz * 150)/1000) -#define POLL_TIMEOUT_RATE1 (hz / 100) /* XXX every tick */ - -#define CCNT_HS_400_VGA_C3K 6250 /* 15.024us */ - -struct tsscale { - int minx, maxx; - int miny, maxy; - int swapxy; - int resx, resy; -} zts_scale = { - /* C3000 */ - 209, 3620, 312, 3780, 0, 640, 480 -}; - -int zts_match(struct device *, void *, void *); -void zts_attach(struct device *, struct device *, void *); -int zts_activate(struct device *, int); -int zts_enable(void *); -void zts_disable(void *); -void zts_poll(void *); -int zts_irq(void *); -int zts_ioctl(void *, u_long, caddr_t, int, struct proc *); - -struct zts_softc { - struct device sc_dev; - struct timeout sc_ts_poll; - void *sc_gh; - int sc_enabled; - int sc_running; - int sc_buttons; /* button emulation ? */ - struct device *sc_wsmousedev; - int sc_oldx; - int sc_oldy; - int sc_rawmode; - - struct tsscale sc_tsscale; -}; - -struct cfattach zts_ca = { - sizeof(struct zts_softc), zts_match, zts_attach, NULL, - zts_activate -}; - -struct cfdriver zts_cd = { - NULL, "zts", DV_DULL -}; - -int -zts_match(struct device *parent, void *cf, void *aux) -{ - return 1; -} - -const struct wsmouse_accessops zts_accessops = { - zts_enable, - zts_ioctl, - zts_disable -}; - -void -zts_attach(struct device *parent, struct device *self, void *aux) -{ - struct zts_softc *sc = (struct zts_softc *)self; - struct wsmousedev_attach_args a; - - timeout_set(&sc->sc_ts_poll, zts_poll, sc); - - /* Initialize ADS7846 Difference Reference mode */ - (void)zssp_ic_send(ZSSP_IC_ADS7846, - (1<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH)); - delay(5000); - (void)zssp_ic_send(ZSSP_IC_ADS7846, - (3<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH)); - delay(5000); - (void)zssp_ic_send(ZSSP_IC_ADS7846, - (4<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH)); - delay(5000); - (void)zssp_ic_send(ZSSP_IC_ADS7846, - (5<<ADSCTRL_ADR_SH) | (1<<ADSCTRL_STS_SH)); - delay(5000); - - a.accessops = &zts_accessops; - a.accesscookie = sc; - printf("\n"); - - /* Copy the default scalue values to each softc */ - bcopy(&zts_scale, &sc->sc_tsscale, sizeof(sc->sc_tsscale)); - - sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint); -} - -int -zts_enable(void *v) -{ - struct zts_softc *sc = v; - - if (sc->sc_enabled) - return EBUSY; - - timeout_del(&sc->sc_ts_poll); - - pxa2x0_gpio_set_function(GPIO_TP_INT_C3K, GPIO_IN); - - /* XXX */ - if (sc->sc_gh == NULL) - sc->sc_gh = pxa2x0_gpio_intr_establish(GPIO_TP_INT_C3K, - IST_EDGE_FALLING, IPL_TTY, zts_irq, sc, - sc->sc_dev.dv_xname); - else - pxa2x0_gpio_intr_unmask(sc->sc_gh); - - /* enable interrupts */ - sc->sc_enabled = 1; - sc->sc_running = 1; - sc->sc_buttons = 0; - - return 0; -} - -void -zts_disable(void *v) -{ - struct zts_softc *sc = v; - - timeout_del(&sc->sc_ts_poll); - - if (sc->sc_gh != NULL) { -#if 0 - pxa2x0_gpio_intr_disestablish(sc->sc_gh); - sc->sc_gh = NULL; -#endif - } - - /* disable interrupts */ - sc->sc_enabled = 0; - sc->sc_running = 0; -} - -int -zts_activate(struct device *self, int act) -{ - struct zts_softc *sc = (struct zts_softc *)self; - - switch (act) { - case DVACT_SUSPEND: - if (sc->sc_enabled == 0) - break; - sc->sc_running = 0; -#if 0 - pxa2x0_gpio_intr_disestablish(sc->sc_gh); -#endif - timeout_del(&sc->sc_ts_poll); - - pxa2x0_gpio_intr_mask(sc->sc_gh); - - /* Turn off reference voltage but leave ADC on. */ - (void)zssp_ic_send(ZSSP_IC_ADS7846, (1 << ADSCTRL_PD1_SH) | - (1 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH)); - - pxa2x0_gpio_set_function(GPIO_TP_INT_C3K, - GPIO_OUT | GPIO_SET); - break; - - case DVACT_RESUME: - if (sc->sc_enabled == 0) - break; - pxa2x0_gpio_set_function(GPIO_TP_INT_C3K, GPIO_IN); - pxa2x0_gpio_intr_mask(sc->sc_gh); - - /* Enable automatic low power mode. */ - (void)zssp_ic_send(ZSSP_IC_ADS7846, - (4 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH)); - -#if 0 - sc->sc_gh = pxa2x0_gpio_intr_establish(GPIO_TP_INT_C3K, - IST_EDGE_FALLING, IPL_TTY, zts_irq, sc, - sc->sc_dev.dv_xname); -#else - pxa2x0_gpio_intr_unmask(sc->sc_gh); -#endif - sc->sc_running = 1; - break; - } - return 0; -} - -struct zts_pos { - int x; - int y; - int z; /* touch pressure */ -}; - -#define NSAMPLES 3 -struct zts_pos zts_samples[NSAMPLES]; -int ztsavgloaded = 0; - -int zts_readpos(struct zts_pos *); -void zts_avgpos(struct zts_pos *); - -#define HSYNC() \ - do { \ - while (pxa2x0_gpio_get_bit(GPIO_HSYNC_C3K) == 0); \ - while (pxa2x0_gpio_get_bit(GPIO_HSYNC_C3K) != 0); \ - } while (0) - -int pxa2x0_ccnt_enable(int); -u_int32_t pxa2x0_read_ccnt(void); -u_int32_t zts_sync_ads784x(int, int, u_int32_t); -void zts_sync_send(u_int32_t); - -int -pxa2x0_ccnt_enable(int on) -{ - u_int32_t rv; - - on = on ? 0x1 : 0x0; - __asm volatile("mrc p14, 0, %0, c0, c1, 0" : "=r" (rv)); - __asm volatile("mcr p14, 0, %0, c0, c1, 0" : : "r" (on)); - return ((int)(rv & 0x1)); -} - -u_int32_t -pxa2x0_read_ccnt(void) -{ - u_int32_t rv; - - __asm volatile("mrc p14, 0, %0, c1, c1, 0" : "=r" (rv)); - return (rv); -} - -/* - * Communicate synchronously with the ADS784x touch screen controller. - */ -u_int32_t -zts_sync_ads784x(int dorecv/* XXX */, int dosend/* XXX */, u_int32_t cmd) -{ - int ccen; - u_int32_t rv; - - /* XXX poll hsync only if LCD is enabled */ - - /* start clock counter */ - ccen = pxa2x0_ccnt_enable(1); - - HSYNC(); - - if (dorecv) - /* read SSDR and disable ADS784x */ - rv = zssp_ic_stop(ZSSP_IC_ADS7846); - else - rv = 0; - - if (dosend) - zts_sync_send(cmd); - - /* stop clock counter */ - pxa2x0_ccnt_enable(ccen); - - return (rv); -} - -void -zts_sync_send(u_int32_t cmd) -{ - u_int32_t tck; - u_int32_t a, b; - - /* XXX */ - tck = CCNT_HS_400_VGA_C3K - 151; - - /* send dummy command; discard SSDR */ - (void)zssp_ic_send(ZSSP_IC_ADS7846, cmd); - - /* wait for refresh */ - HSYNC(); - - /* wait after refresh */ - a = pxa2x0_read_ccnt(); - b = pxa2x0_read_ccnt(); - while ((b - a) < tck) - b = pxa2x0_read_ccnt(); - - /* send the actual command; keep ADS784x enabled */ - zssp_ic_start(ZSSP_IC_ADS7846, cmd); -} - -int -zts_readpos(struct zts_pos *pos) -{ - int cmd; - int t0, t1; - int down; - - /* XXX */ - pxa2x0_gpio_set_function(GPIO_HSYNC_C3K, GPIO_IN); - - /* check that pen is down */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (3 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - t0 = zssp_ic_send(ZSSP_IC_ADS7846, cmd); - down = !(t0 < 10); - if (down == 0) - goto out; - - /* Y */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (1 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - (void)zts_sync_ads784x(0, 1, cmd); - - /* Y */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (1 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - (void)zts_sync_ads784x(1, 1, cmd); - - /* X */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (5 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - pos->y = zts_sync_ads784x(1, 1, cmd); - - /* T0 */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (3 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - pos->x = zts_sync_ads784x(1, 1, cmd); - - /* T1 */ - cmd = (1 << ADSCTRL_PD0_SH) | (1 << ADSCTRL_PD1_SH) | - (4 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - - t0 = zts_sync_ads784x(1, 1, cmd); - t1 = zts_sync_ads784x(1, 0, cmd); - - /* check that pen is still down */ - /* XXX pressure sensitivity varies with X or what? */ - if (t0 == 0 || (pos->x * (t1 - t0) / t0) >= 15000) - down = 0; - pos->z = down; - -out: - /* Enable automatic low power mode. */ - cmd = (4 << ADSCTRL_ADR_SH) | (1 << ADSCTRL_STS_SH); - (void)zssp_ic_send(ZSSP_IC_ADS7846, cmd); - - return (down); -} - -#define NAVGSAMPLES (NSAMPLES < 3 ? NSAMPLES : 3) -void -zts_avgpos(struct zts_pos *pos) -{ - struct zts_pos *tpp = zts_samples; - int diff[NAVGSAMPLES]; - int mindiff, mindiffv; - int n; - int i; - static int tail; - - if (ztsavgloaded < NAVGSAMPLES) { - tpp[(tail + ztsavgloaded) % NSAMPLES] = *pos; - ztsavgloaded++; - return; - } - - tpp[tail] = *pos; - tail = (tail+1) % NSAMPLES; - - /* X */ - i = tail; - for (n = 0 ; n < NAVGSAMPLES; n++) { - int alt; - alt = (i+1) % NSAMPLES; - diff[n] = tpp[i].x - tpp[alt].x; - if (diff[n] < 0) - diff[n] = - diff[n]; /* ABS */ - i = alt; - } - mindiffv = diff[0]; - mindiff = 0; - for (n = 1; n < NAVGSAMPLES; n++) { - if (diff[n] < mindiffv) { - mindiffv = diff[n]; - mindiff = n; - } - } - pos->x = (tpp[(tail + mindiff) % NSAMPLES].x + - tpp[(tail + mindiff + 1) % NSAMPLES].x) / 2; - - /* Y */ - i = tail; - for (n = 0 ; n < NAVGSAMPLES; n++) { - int alt; - alt = (i+1) % NSAMPLES; - diff[n] = tpp[i].y - tpp[alt].y; - if (diff[n] < 0) - diff[n] = - diff[n]; /* ABS */ - i = alt; - } - mindiffv = diff[0]; - mindiff = 0; - for (n = 1; n < NAVGSAMPLES; n++) { - if (diff[n] < mindiffv) { - mindiffv = diff[n]; - mindiff = n; - } - } - pos->y = (tpp[(tail + mindiff) % NSAMPLES].y + - tpp[(tail + mindiff + 1) % NSAMPLES].y) / 2; -} - -void -zts_poll(void *v) -{ - int s; - - s = spltty(); - (void)zts_irq(v); - splx(s); -} - -#define TS_STABLE 8 -int -zts_irq(void *v) -{ - struct zts_softc *sc = v; - struct zts_pos tp; - int s; - int pindown; - int down; - extern int zkbd_modstate; - - if (!sc->sc_running) - return 0; - - s = splhigh(); - pindown = pxa2x0_gpio_get_bit(GPIO_TP_INT_C3K) ? 0 : 1; - if (pindown) { - pxa2x0_gpio_intr_mask(sc->sc_gh); - timeout_add(&sc->sc_ts_poll, POLL_TIMEOUT_RATE1); - } - - down = zts_readpos(&tp); - - if (!pindown) { - pxa2x0_gpio_intr_unmask(sc->sc_gh); - timeout_add(&sc->sc_ts_poll, POLL_TIMEOUT_RATE0); - ztsavgloaded = 0; - } - pxa2x0_gpio_clear_intr(GPIO_TP_INT_C3K); - splx(s); - - if (down) { - zts_avgpos(&tp); - if (!sc->sc_rawmode && - (sc->sc_tsscale.maxx - sc->sc_tsscale.minx) != 0 && - (sc->sc_tsscale.maxy - sc->sc_tsscale.miny) != 0) { - /* Scale down to the screen resolution. */ - tp.x = ((tp.x - sc->sc_tsscale.minx) * - sc->sc_tsscale.resx) / - (sc->sc_tsscale.maxx - sc->sc_tsscale.minx); - tp.y = ((tp.y - sc->sc_tsscale.miny) * - sc->sc_tsscale.resy) / - (sc->sc_tsscale.maxy - sc->sc_tsscale.miny); - } - } - - if (zkbd_modstate != 0 && down) { - if(zkbd_modstate & (1 << 1)) { - /* Fn */ - down = 2; - } - if(zkbd_modstate & (1 << 2)) { - /* 'Alt' */ - down = 4; - } - } - if (!down) { - /* x/y values are not reliable when pen is up */ - tp.x = sc->sc_oldx; - tp.y = sc->sc_oldy; - } - - if (down || sc->sc_buttons != down) { - DPRINTF(("%s: tp.z = %d, tp.x = %d, tp.y = %d\n", - sc->sc_dev.dv_xname, tp.z, tp.x, tp.y)); - - wsmouse_buttons(sc->sc_wsmousedev, down); - wsmouse_position(sc->sc_wsmousedev, tp.x, tp.y); - wsmouse_input_sync(sc->sc_wsmousedev); - sc->sc_buttons = down; - sc->sc_oldx = tp.x; - sc->sc_oldy = tp.y; - } - - return 1; -} - -int -zts_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ - int error = 0; - struct zts_softc *sc = v; - struct wsmouse_calibcoords *wsmc = (struct wsmouse_calibcoords *)data; - - DPRINTF(("zts_ioctl(%d, '%c', %d)\n", - IOCPARM_LEN(cmd), IOCGROUP(cmd), cmd & 0xff)); - - switch (cmd) { - case WSMOUSEIO_SCALIBCOORDS: - if (!(wsmc->minx >= 0 && wsmc->maxx >= 0 && - wsmc->miny >= 0 && wsmc->maxy >= 0 && - wsmc->resx >= 0 && wsmc->resy >= 0 && - wsmc->minx < 32768 && wsmc->maxx < 32768 && - wsmc->miny < 32768 && wsmc->maxy < 32768 && - (wsmc->maxx - wsmc->minx) != 0 && - (wsmc->maxy - wsmc->miny) != 0 && - wsmc->resx < 32768 && wsmc->resy < 32768 && - wsmc->swapxy >= 0 && wsmc->swapxy <= 1 && - wsmc->samplelen >= 0 && wsmc->samplelen <= 1)) - return (EINVAL); - - sc->sc_tsscale.minx = wsmc->minx; - sc->sc_tsscale.maxx = wsmc->maxx; - sc->sc_tsscale.miny = wsmc->miny; - sc->sc_tsscale.maxy = wsmc->maxy; - sc->sc_tsscale.swapxy = wsmc->swapxy; - sc->sc_tsscale.resx = wsmc->resx; - sc->sc_tsscale.resy = wsmc->resy; - sc->sc_rawmode = wsmc->samplelen; - break; - case WSMOUSEIO_GCALIBCOORDS: - wsmc->minx = sc->sc_tsscale.minx; - wsmc->maxx = sc->sc_tsscale.maxx; - wsmc->miny = sc->sc_tsscale.miny; - wsmc->maxy = sc->sc_tsscale.maxy; - wsmc->swapxy = sc->sc_tsscale.swapxy; - wsmc->resx = sc->sc_tsscale.resx; - wsmc->resy = sc->sc_tsscale.resy; - wsmc->samplelen = sc->sc_rawmode; - break; - case WSMOUSEIO_GTYPE: - *(u_int *)data = WSMOUSE_TYPE_TPANEL; - break; - default: - error = ENOTTY; - break; - } - - return (error); -} diff --git a/sys/arch/zaurus/include/_float.h b/sys/arch/zaurus/include/_float.h deleted file mode 100644 index 38fb9c08646..00000000000 --- a/sys/arch/zaurus/include/_float.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: _float.h,v 1.1 2012/06/26 16:12:45 deraadt Exp $ */ - -#include <arm/_float.h> diff --git a/sys/arch/zaurus/include/_types.h b/sys/arch/zaurus/include/_types.h deleted file mode 100644 index 62c4840fe0b..00000000000 --- a/sys/arch/zaurus/include/_types.h +++ /dev/null @@ -1,8 +0,0 @@ -/* $OpenBSD: _types.h,v 1.7 2012/11/05 19:39:34 miod Exp $ */ - -#ifndef _MACHINE__TYPES_H_ -#define _MACHINE__TYPES_H_ - -#include <arm/_types.h> - -#endif diff --git a/sys/arch/zaurus/include/apmvar.h b/sys/arch/zaurus/include/apmvar.h deleted file mode 100644 index e6d66f0d168..00000000000 --- a/sys/arch/zaurus/include/apmvar.h +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: apmvar.h,v 1.2 2010/02/02 06:19:28 kevlo Exp $ */ -#include <arm/apmvar.h> diff --git a/sys/arch/zaurus/include/asm.h b/sys/arch/zaurus/include/asm.h deleted file mode 100644 index f903110011e..00000000000 --- a/sys/arch/zaurus/include/asm.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: asm.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: asm.h,v 1.3 2001/11/25 15:55:54 thorpej Exp $ */ - -#include <arm/asm.h> diff --git a/sys/arch/zaurus/include/atomic.h b/sys/arch/zaurus/include/atomic.h deleted file mode 100644 index 2cdf06fcd23..00000000000 --- a/sys/arch/zaurus/include/atomic.h +++ /dev/null @@ -1,10 +0,0 @@ -/* $OpenBSD: atomic.h,v 1.5 2011/03/23 16:54:37 pirofti Exp $ */ - -/* Public Domain */ - -#ifndef _MACHINE_ATOMIC_H_ -#define _MACHINE_ATOMIC_H_ - -#include <arm/atomic.h> - -#endif /* _MACHINE_ATOMIC_H_ */ diff --git a/sys/arch/zaurus/include/bootconfig.h b/sys/arch/zaurus/include/bootconfig.h deleted file mode 100644 index 6e9e95dd59b..00000000000 --- a/sys/arch/zaurus/include/bootconfig.h +++ /dev/null @@ -1,67 +0,0 @@ -/* $OpenBSD: bootconfig.h,v 1.2 2011/09/20 22:02:13 miod Exp $ */ -/* $NetBSD: bootconfig.h,v 1.2 2001/06/21 22:08:28 chris Exp $ */ - -/* - * Copyright (c) 1994 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * 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 Mark Brinicombe - * for the NetBSD Project. - * 4. The name of the company nor the name of the author may 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 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. - * - * boot configuration structures - * - * Created : 12/09/94 - * - * Based on kate/boot/bootconfig.h - */ - -#if defined(_KERNEL) - -typedef struct _PhysMem { - u_int address; - u_int pages; -} PhysMem; - -#define DRAM_BLOCKS 1 - -typedef struct _BootConfig { - PhysMem dram[DRAM_BLOCKS]; - u_int dramblocks; -} BootConfig; - -extern BootConfig bootconfig; -#define MAX_BOOT_STRING 255 - -extern char *boot_args; -extern char *boot_file; -#endif /* _KERNEL */ - -/* End of bootconfig.h */ diff --git a/sys/arch/zaurus/include/bus.h b/sys/arch/zaurus/include/bus.h deleted file mode 100644 index 9f40a4cfa47..00000000000 --- a/sys/arch/zaurus/include/bus.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: bus.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: bus.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/bus.h> diff --git a/sys/arch/zaurus/include/cdefs.h b/sys/arch/zaurus/include/cdefs.h deleted file mode 100644 index 6b8c9457831..00000000000 --- a/sys/arch/zaurus/include/cdefs.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: cdefs.h,v 1.2 2005/11/24 20:46:49 deraadt Exp $ */ - -#include <arm/cdefs.h> diff --git a/sys/arch/zaurus/include/conf.h b/sys/arch/zaurus/include/conf.h deleted file mode 100644 index 87b4a7dda5d..00000000000 --- a/sys/arch/zaurus/include/conf.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $OpenBSD: conf.h,v 1.8 2011/03/23 16:54:37 pirofti Exp $ */ -/* $NetBSD: conf.h,v 1.8 2002/02/10 12:26:03 chris Exp $ */ - -#ifndef _MACHINE_CONF_H_ -#define _MACHINE_CONF_H_ - -#include <sys/conf.h> - -/* - * ZAURUS specific device includes go in here - */ - -#define CONF_HAVE_APM - -#include <arm/conf.h> - -#endif /* _MACHINE_CONF_H_ */ diff --git a/sys/arch/zaurus/include/cpu.h b/sys/arch/zaurus/include/cpu.h deleted file mode 100644 index b5b491a79f7..00000000000 --- a/sys/arch/zaurus/include/cpu.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: cpu.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: cpu.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/cpu.h> diff --git a/sys/arch/zaurus/include/db_machdep.h b/sys/arch/zaurus/include/db_machdep.h deleted file mode 100644 index 45324563408..00000000000 --- a/sys/arch/zaurus/include/db_machdep.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: db_machdep.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: db_machdep.h,v 1.3 2001/11/25 15:55:55 thorpej Exp $ */ - -#include <arm/db_machdep.h> diff --git a/sys/arch/zaurus/include/disklabel.h b/sys/arch/zaurus/include/disklabel.h deleted file mode 100644 index 0c0642c339a..00000000000 --- a/sys/arch/zaurus/include/disklabel.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: disklabel.h,v 1.2 2007/06/17 00:27:28 deraadt Exp $ */ - -#include <arm/disklabel.h> diff --git a/sys/arch/zaurus/include/endian.h b/sys/arch/zaurus/include/endian.h deleted file mode 100644 index 81a63fd780c..00000000000 --- a/sys/arch/zaurus/include/endian.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: endian.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: endian.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/endian.h> diff --git a/sys/arch/zaurus/include/exec.h b/sys/arch/zaurus/include/exec.h deleted file mode 100644 index d0fc20e447d..00000000000 --- a/sys/arch/zaurus/include/exec.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: exec.h,v 1.2 2006/10/02 17:45:33 miod Exp $ */ -/* public domain */ -#include <arm/exec.h> diff --git a/sys/arch/zaurus/include/fenv.h b/sys/arch/zaurus/include/fenv.h deleted file mode 100644 index 00c039216d2..00000000000 --- a/sys/arch/zaurus/include/fenv.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: fenv.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include <arm/fenv.h> diff --git a/sys/arch/zaurus/include/fp.h b/sys/arch/zaurus/include/fp.h deleted file mode 100644 index 2a8d6cc460c..00000000000 --- a/sys/arch/zaurus/include/fp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: fp.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: fp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/fp.h> diff --git a/sys/arch/zaurus/include/frame.h b/sys/arch/zaurus/include/frame.h deleted file mode 100644 index d96c1961dda..00000000000 --- a/sys/arch/zaurus/include/frame.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: frame.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: frame.h,v 1.1 2001/06/08 22:23:00 chris Exp $ */ - -#include <arm/frame.h> diff --git a/sys/arch/zaurus/include/ieee.h b/sys/arch/zaurus/include/ieee.h deleted file mode 100644 index ed711e4e217..00000000000 --- a/sys/arch/zaurus/include/ieee.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ieee.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: ieee.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/ieee.h> diff --git a/sys/arch/zaurus/include/ieeefp.h b/sys/arch/zaurus/include/ieeefp.h deleted file mode 100644 index 3b0165dc66a..00000000000 --- a/sys/arch/zaurus/include/ieeefp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ieeefp.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: ieeefp.h,v 1.3 2001/11/25 15:55:56 thorpej Exp $ */ - -#include <arm/ieeefp.h> diff --git a/sys/arch/zaurus/include/intr.h b/sys/arch/zaurus/include/intr.h deleted file mode 100644 index ba3253da140..00000000000 --- a/sys/arch/zaurus/include/intr.h +++ /dev/null @@ -1,109 +0,0 @@ -/* $OpenBSD: intr.h,v 1.12 2015/09/19 02:13:05 jsg Exp $ */ -/* $NetBSD: intr.h,v 1.12 2003/06/16 20:00:59 thorpej Exp $ */ - -/* - * Copyright (c) 2001, 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ - -#ifdef _KERNEL - -/* Interrupt priority "levels". */ -#define IPL_NONE 0 /* nothing */ -#define IPL_SOFT 1 /* generic software interrupts */ -#define IPL_SOFTCLOCK 2 /* software clock interrupt */ -#define IPL_SOFTNET 3 /* software network interrupt */ -#define IPL_BIO 4 /* block I/O */ -#define IPL_NET 5 /* network */ -#define IPL_SOFTTTY 6 /* software serial interrupt */ -#define IPL_TTY 7 /* terminals */ -#define IPL_VM 8 /* memory allocation */ -#define IPL_AUDIO 9 /* audio device */ -#define IPL_CLOCK 10 /* clock interrupt */ -#define IPL_STATCLOCK 11 /* statistics clock interrupt */ -#define IPL_SCHED 12 /* everything */ -#define IPL_HIGH 12 /* everything */ - -#define NIPL 13 - -/* Interrupt priority "flags". */ -#define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ - -/* Interrupt sharing types. */ -#define IST_NONE 0 /* none */ -#define IST_PULSE 1 /* pulsed */ -#define IST_EDGE 2 /* edge-triggered */ -#define IST_LEVEL 3 /* level-triggered */ - -#define IST_LEVEL_LOW IST_LEVEL -#define IST_LEVEL_HIGH 4 -#define IST_EDGE_FALLING IST_EDGE -#define IST_EDGE_RISING 5 -#define IST_EDGE_BOTH 6 - -#ifndef _LOCORE - -#include <sys/device.h> -#include <sys/queue.h> - -#define splhigh() _splraise(IPL_HIGH) -#define splsoft() _splraise(IPL_SOFT) -#define splsoftclock() _splraise(IPL_SOFTCLOCK) -#define splsoftnet() _splraise(IPL_SOFTNET) -#define splbio() _splraise(IPL_BIO) -#define splnet() _splraise(IPL_NET) -#define spltty() _splraise(IPL_TTY) -#define splvm() _splraise(IPL_VM) -#define splaudio() _splraise(IPL_AUDIO) -#define splclock() _splraise(IPL_CLOCK) -#define splstatclock() _splraise(IPL_STATCLOCK) -#define splserial() _splraise(IPL_SERIAL) - -#define spl0() _spllower(IPL_NONE) - -#define splsched() splhigh() -#define spllock() splhigh() - -void intr_barrier(void *); - -#endif /* ! _LOCORE */ - -#include <arm/xscale/pxa2x0_intr.h> - -#endif /* _KERNEL */ - -#endif /* _MACHINE_INTR_H_ */ - diff --git a/sys/arch/zaurus/include/limits.h b/sys/arch/zaurus/include/limits.h deleted file mode 100644 index c3a60dbab4e..00000000000 --- a/sys/arch/zaurus/include/limits.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: limits.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: limits.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/limits.h> diff --git a/sys/arch/zaurus/include/loadfile_machdep.h b/sys/arch/zaurus/include/loadfile_machdep.h deleted file mode 100644 index ae23c457f0c..00000000000 --- a/sys/arch/zaurus/include/loadfile_machdep.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: loadfile_machdep.h,v 1.4 2015/07/17 20:44:39 miod Exp $ */ -/* $NetBSD: loadfile_machdep.h,v 1.1 1999/04/29 03:17:12 tsubai Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas. - * - * 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. - */ - -#define BOOT_ELF -#define ELFSIZE 32 - -#define LOAD_KERNEL LOAD_ALL -#define COUNT_KERNEL COUNT_ALL - -#define LOADADDR(a) ((((u_long)(a)) + offset)&0xfffffff) -#define ALIGNENTRY(a) ((u_long)(a)) -#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) -#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) -#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) -#define WARN(a) (void)(printf a, \ - printf((errno ? ": %s\n" : "\n"), \ - strerror(errno))) -#define PROGRESS(a) (void) printf a -#define ALLOC(a) alloc(a) -#define FREE(a, b) free(a, b) - -void run_loadfile(u_long *, int); diff --git a/sys/arch/zaurus/include/lock.h b/sys/arch/zaurus/include/lock.h deleted file mode 100644 index 8d51954acb2..00000000000 --- a/sys/arch/zaurus/include/lock.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: lock.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: lock.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/lock.h> diff --git a/sys/arch/zaurus/include/machine_reg.h b/sys/arch/zaurus/include/machine_reg.h deleted file mode 100644 index f679a87ccb8..00000000000 --- a/sys/arch/zaurus/include/machine_reg.h +++ /dev/null @@ -1,84 +0,0 @@ -/* $OpenBSD: machine_reg.h,v 1.4 2015/12/24 05:50:15 mmcc Exp $ */ -/* $NetBSD: lubbock_reg.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -#ifndef _ZAURUS_REG_H -#define _ZAURUS_REG_H - -#include <arm/xscale/pxa2x0reg.h> - -/* - * Logical mapping for onboard/integrated peripherals - */ -#define ZAURUS_IO_AREA_VBASE 0xfd000000 -#define ZAURUS_GPIO_VBASE 0xfd000000 -#define ZAURUS_CLKMAN_VBASE 0xfd100000 -#define ZAURUS_INTCTL_VBASE 0xfd200000 -#define ZAURUS_SCOOP0_VBASE 0xfd300000 -#define ZAURUS_SCOOP1_VBASE 0xfd400000 -#define ZAURUS_VBASE_FREE 0xfd500000 -/* FFUART, BTUART and/or STUART are mapped to this area when - used for console or kgdb port */ - -#define ioreg_read(a) (*(volatile unsigned *)(a)) -#define ioreg_write(a,v) (*(volatile unsigned *)(a)=(v)) - -#define ioreg16_read(a) (*(volatile uint16_t *)(a)) -#define ioreg16_write(a,v) (*(volatile uint16_t *)(a)=(v)) - -#define ioreg8_read(a) (*(volatile uint8_t *)(a)) -#define ioreg8_write(a,v) (*(volatile uint8_t *)(a)=(v)) - -/* - * Magic numbers for the C860 (PXA255) and C3000 (PXA27x). - */ - -/* physical addresses of companion chips */ -#define C3000_SCOOP0_BASE 0x10800000 /* XXX same as C860 */ -#define C3000_SCOOP1_BASE 0x08800040 - -/* processor IRQ numbers */ -#define C860_CF0_IRQ 17 -#define C3000_CF0_IRQ 105 -#define C3000_CF1_IRQ 106 - -/* processor GPIO pins */ -#define C860_CF0_IRQ_PIN 14 -#define C3000_RC_IRQ_PIN 13 /* remote control */ -#define C3000_CF0_IRQ_PIN 94 -#define C3000_CF1_IRQ_PIN 93 -#define GPIO_USB_DEVICE 35 /* indicate connection type */ -#define GPIO_USB_DETECT 41 /* connection interrupt */ -#define GPIO_USB_PULLUP 45 /* show/hide device presence */ -#define GPIO_HP_IN_C3000 116 /* headphone jack */ -#define GPIO_MMC_DETECT 9 /* card detect */ - -#endif /* _ZAURUS_REG_H */ diff --git a/sys/arch/zaurus/include/mutex.h b/sys/arch/zaurus/include/mutex.h deleted file mode 100644 index 8f734b03a83..00000000000 --- a/sys/arch/zaurus/include/mutex.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: mutex.h,v 1.2 2007/12/05 16:08:06 deraadt Exp $ */ -/* public domain */ -#include <arm/mutex.h> diff --git a/sys/arch/zaurus/include/param.h b/sys/arch/zaurus/include/param.h deleted file mode 100644 index e7a26920266..00000000000 --- a/sys/arch/zaurus/include/param.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: param.h,v 1.6 2013/03/23 16:12:28 deraadt Exp $ */ - -/* - * Copyright (c) 1994,1995 Mark Brinicombe. - * 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 the RiscBSD team. - * 4. The name "RiscBSD" nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY RISCBSD ``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 RISCBSD 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. - */ - -#ifndef _MACHINE_PARAM_H_ -#define _MACHINE_PARAM_H_ - -#include <arm/param.h> - -#define _MACHINE zaurus -#define MACHINE "zaurus" - -#ifndef MSGBUFSIZE -#define MSGBUFSIZE (1 * PAGE_SIZE) -#endif - -#endif /* _MACHINE_PARAM_H_ */ diff --git a/sys/arch/zaurus/include/pcb.h b/sys/arch/zaurus/include/pcb.h deleted file mode 100644 index 63455769a68..00000000000 --- a/sys/arch/zaurus/include/pcb.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pcb.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: pcb.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/pcb.h> diff --git a/sys/arch/zaurus/include/pio.h b/sys/arch/zaurus/include/pio.h deleted file mode 100644 index e34d5fecf16..00000000000 --- a/sys/arch/zaurus/include/pio.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pio.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: pio.h,v 1.3 2001/12/07 23:09:33 chris Exp $ */ - -#include <arm/pio.h> diff --git a/sys/arch/zaurus/include/pmap.h b/sys/arch/zaurus/include/pmap.h deleted file mode 100644 index fd34a3faf73..00000000000 --- a/sys/arch/zaurus/include/pmap.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: pmap.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: pmap.h,v 1.2 2001/11/23 17:29:01 thorpej Exp $ */ - -#include <arm/pmap.h> diff --git a/sys/arch/zaurus/include/proc.h b/sys/arch/zaurus/include/proc.h deleted file mode 100644 index e9eea6e2344..00000000000 --- a/sys/arch/zaurus/include/proc.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: proc.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: proc.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/proc.h> diff --git a/sys/arch/zaurus/include/profile.h b/sys/arch/zaurus/include/profile.h deleted file mode 100644 index 00ae54f7809..00000000000 --- a/sys/arch/zaurus/include/profile.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: profile.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: profile.h,v 1.3 2001/11/25 15:55:57 thorpej Exp $ */ - -#include <arm/profile.h> diff --git a/sys/arch/zaurus/include/ptrace.h b/sys/arch/zaurus/include/ptrace.h deleted file mode 100644 index 3bfe7543665..00000000000 --- a/sys/arch/zaurus/include/ptrace.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: ptrace.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: ptrace.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/ptrace.h> diff --git a/sys/arch/zaurus/include/reg.h b/sys/arch/zaurus/include/reg.h deleted file mode 100644 index fc06d65ede7..00000000000 --- a/sys/arch/zaurus/include/reg.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: reg.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: reg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/reg.h> diff --git a/sys/arch/zaurus/include/reloc.h b/sys/arch/zaurus/include/reloc.h deleted file mode 100644 index 3443c31ae4b..00000000000 --- a/sys/arch/zaurus/include/reloc.h +++ /dev/null @@ -1,2 +0,0 @@ -/* $OpenBSD: reloc.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -#include <arm/reloc.h> diff --git a/sys/arch/zaurus/include/setjmp.h b/sys/arch/zaurus/include/setjmp.h deleted file mode 100644 index 2dc2a0d57be..00000000000 --- a/sys/arch/zaurus/include/setjmp.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: setjmp.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: setjmp.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/setjmp.h> diff --git a/sys/arch/zaurus/include/signal.h b/sys/arch/zaurus/include/signal.h deleted file mode 100644 index eb777b91da0..00000000000 --- a/sys/arch/zaurus/include/signal.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: signal.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: signal.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/signal.h> diff --git a/sys/arch/zaurus/include/spinlock.h b/sys/arch/zaurus/include/spinlock.h deleted file mode 100644 index 76c99ed16d7..00000000000 --- a/sys/arch/zaurus/include/spinlock.h +++ /dev/null @@ -1,7 +0,0 @@ - -/* $OpenBSD: spinlock.h,v 1.4 2011/03/23 16:54:37 pirofti Exp $ */ -#ifndef _MACHINE_SPINLOCK_H_ -#define _MACHINE_SPINLOCK_H_ -#include <arm/spinlock.h> -#endif /* _MACHINE_SPINLOCK_H_ */ - diff --git a/sys/arch/zaurus/include/stdarg.h b/sys/arch/zaurus/include/stdarg.h deleted file mode 100644 index c7626e16c9b..00000000000 --- a/sys/arch/zaurus/include/stdarg.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: stdarg.h,v 1.2 2005/01/02 19:43:07 drahn Exp $ */ -/* $NetBSD: stdarg.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/stdarg.h> diff --git a/sys/arch/zaurus/include/sysarch.h b/sys/arch/zaurus/include/sysarch.h deleted file mode 100644 index 3fcdaf85729..00000000000 --- a/sys/arch/zaurus/include/sysarch.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: sysarch.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: sysarch.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/sysarch.h> diff --git a/sys/arch/zaurus/include/tcb.h b/sys/arch/zaurus/include/tcb.h deleted file mode 100644 index 2f01dd6f598..00000000000 --- a/sys/arch/zaurus/include/tcb.h +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: tcb.h,v 1.2 2013/06/01 21:20:54 jasper Exp $ */ -/* public domain */ -#include <arm/tcb.h> diff --git a/sys/arch/zaurus/include/trap.h b/sys/arch/zaurus/include/trap.h deleted file mode 100644 index bbcaa1b8aa4..00000000000 --- a/sys/arch/zaurus/include/trap.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $OpenBSD: trap.h,v 1.1 2004/12/31 00:04:35 drahn Exp $ */ -/* $NetBSD: trap.h,v 1.3 2001/11/25 15:55:58 thorpej Exp $ */ - -#include <arm/trap.h> diff --git a/sys/arch/zaurus/include/vmparam.h b/sys/arch/zaurus/include/vmparam.h deleted file mode 100644 index 14bce788891..00000000000 --- a/sys/arch/zaurus/include/vmparam.h +++ /dev/null @@ -1,84 +0,0 @@ -/* $OpenBSD: vmparam.h,v 1.8 2015/06/24 21:35:01 miod Exp $ */ -/* $NetBSD: vmparam.h,v 1.23 2003/05/22 05:47:07 thorpej Exp $ */ - -/* - * Copyright (c) 1988 The Regents of the University of California. - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. - */ - -#ifndef _MACHINE_VMPARAM_H_ -#define _MACHINE_VMPARAM_H_ - -#define ARM_KERNEL_BASE 0xc0000000U - -#include <arm/vmparam.h> - -#ifdef _KERNEL -/* - * Address space constants - */ - -/* - * The line between user space and kernel space - * Mappings >= KERNEL_BASE are constant across all processes - */ -#define KERNEL_BASE ARM_KERNEL_BASE - -#define VM_KERNEL_SPACE_SIZE 0x10000000 - -/* - * Override the default pager_map size, there's not enough KVA. - */ -#define PAGER_MAP_SIZE (4 * 1024 * 1024) - -/* - * Size of User Raw I/O map - */ - -#define USRIOSIZE 300 - -/* virtual sizes (bytes) for various kernel submaps */ - -#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) - -/* - * max number of non-contig chunks of physical RAM you can have - */ - -#define VM_PHYSSEG_MAX 1 -#define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM - -/* - * this indicates that we can't add RAM to the VM system after the - * vm system is init'd. - */ - -#define VM_PHYSSEG_NOADD - -#endif /* _KERNEL */ - -#endif /* _MACHINE_VMPARAM_H_ */ diff --git a/sys/arch/zaurus/include/zaurus_var.h b/sys/arch/zaurus/include/zaurus_var.h deleted file mode 100644 index a0a8c78bd6f..00000000000 --- a/sys/arch/zaurus/include/zaurus_var.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $OpenBSD: zaurus_var.h,v 1.5 2008/11/25 14:55:44 drahn Exp $ */ -/* $NetBSD: lubbock_var.h,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -#ifndef _EVBARM_ZAURUS_VAR_H -#define _EVBARM_ZAURUS_VAR_H - -#include <sys/conf.h> -#include <sys/device.h> - -#include <machine/bus.h> -#include <machine/machine_reg.h> - -#ifdef _KERNEL - -#define ZAURUS_C860 0xC0860 -#define ZAURUS_C3000 0xC3000 - -extern int zaurusmod; - -#define ZAURUS_ISC860 (zaurusmod == ZAURUS_C860) -#define ZAURUS_ISC3000 (zaurusmod == ZAURUS_C3000) - -#endif - -#endif /* _EVBARM_ZAURUS_VAR_H */ diff --git a/sys/arch/zaurus/stand/Makefile b/sys/arch/zaurus/stand/Makefile deleted file mode 100644 index b2552b72449..00000000000 --- a/sys/arch/zaurus/stand/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $OpenBSD: Makefile,v 1.6 2005/11/04 01:02:31 uwe Exp $ - -SUBDIR= zboot - -.if ${MACHINE} == "zaurus" -SUBDIR+= zbsdmod -.endif - -.include <bsd.subdir.mk> diff --git a/sys/arch/zaurus/stand/Makefile.inc b/sys/arch/zaurus/stand/Makefile.inc deleted file mode 100644 index 0027bf96033..00000000000 --- a/sys/arch/zaurus/stand/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $OpenBSD: Makefile.inc,v 1.2 2005/11/04 01:02:31 uwe Exp $ - -BINDIR= /usr/mdec diff --git a/sys/arch/zaurus/stand/zboot/Makefile b/sys/arch/zaurus/stand/zboot/Makefile deleted file mode 100644 index 10c590513c5..00000000000 --- a/sys/arch/zaurus/stand/zboot/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -# $OpenBSD: Makefile,v 1.18 2016/07/30 03:25:49 guenther Exp $ - -MAN= boot.8 -MANSUBDIR=zaurus - -.if ${MACHINE} == "zaurus" -PROG= zboot -LDFLAGS+=-nostdlib -Bstatic -nopie -znorelro -INSTALL_STRIP= - -SRCS= crt0.c - -S= ${.CURDIR}/../../../.. - -CLEANFILES+= arm machine -.if !make(libdep) && !make(sadep) && !make(salibdir) && !make(obj) -.BEGIN: - @([ X$(S) = X -o -h arm ] || ln -s $(S)/arch/arm/include arm) - @([ X$(S) = X -o -h machine ] || ln -s $(S)/arch/zaurus/include machine) -.endif - -# stand/boot -SRCS+= boot.c cmd.c vars.c bootarg.c conf.c - -# libsa -SRCS+= close.c closeall.c cons.c ctime.c disklabel.c dkcksum.c fstat.c \ - lseek.c memcmp.c memcpy.c memset.c open.c printf.c read.c \ - readdir.c snprintf.c stat.c strerror.c strtol.c ufs.c - -.PATH: ${S}/lib/libkern/arch/arm ${S}/lib/libkern -SRCS+= getchar.c putchar.c strcmp.c strlcpy.c strlen.c strncmp.c strncpy.c \ - write.c ashrdi3.c divsi3.S divdi3.c moddi3.c qdivrem.c - -# local overrides and additions -SRCS+= alloc.c devopen.c diskprobe.c exec.c exit.c loadfile.c \ - machdep.c termios.c unixcons.c unixdev.c unixsys.S - -.PATH: ${S}/stand/boot -.PATH: ${S}/lib/libsa - -${PROG}: ${OBJS} ${LIBSA} - ${LD} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBSA} - -.else -NOPROG= -.endif - -.include <bsd.prog.mk> - -AFLAGS+=-D_LOCORE -CPPFLAGS+=-D_STANDALONE -CPPFLAGS+=-I${S}/stand/boot -I${S}/lib/libsa -I. -I${.CURDIR} -I${S} -CFLAGS+=-fno-stack-protector -fno-builtin -fpack-struct -fno-pie -AFLAGS+= -fno-pie diff --git a/sys/arch/zaurus/stand/zboot/alloc.c b/sys/arch/zaurus/stand/zboot/alloc.c deleted file mode 100644 index d6f34e0dff5..00000000000 --- a/sys/arch/zaurus/stand/zboot/alloc.c +++ /dev/null @@ -1,234 +0,0 @@ -/* $OpenBSD: alloc.c,v 1.3 2016/03/14 23:08:05 krw Exp $ */ -/* $NetBSD: alloc.c,v 1.6 1997/02/04 18:36:33 thorpej Exp $ */ - -/* - * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved. - * Copyright (c) 1996 - * Matthias Drochner. All rights reserved. - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * The Mach Operating System project at Carnegie-Mellon University. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. - * - * @(#)alloc.c 8.1 (Berkeley) 6/11/93 - * - * - * Copyright (c) 1989, 1990, 1991 Carnegie Mellon University - * All Rights Reserved. - * - * Author: Alessandro Forin - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -/* - * Dynamic memory allocator. - * - * Compile options: - * - * ALLOC_TRACE enable tracing of allocations/deallocations - * - * ALLOC_FIRST_FIT use a first-fit allocation algorithm, rather than - * the default best-fit algorithm. - * - * HEAP_LIMIT heap limit address (defaults to "no limit"). - * - * HEAP_START start address of heap (defaults to '&end'). - * - * DEBUG enable debugging sanity checks. - */ - -#include <sys/param.h> - -/* - * Each block actually has ALIGN(unsigned) + ALIGN(size) bytes allocated - * to it, as follows: - * - * 0 ... (sizeof(unsigned) - 1) - * allocated or unallocated: holds size of user-data part of block. - * - * sizeof(unsigned) ... (ALIGN(sizeof(unsigned)) - 1) - * allocated: unused - * unallocated: depends on packing of struct fl - * - * ALIGN(sizeof(unsigned)) ... (ALIGN(sizeof(unsigned)) + ALIGN(data size) - 1) - * allocated: user data - * unallocated: depends on packing of struct fl - * - * 'next' is only used when the block is unallocated (i.e. on the free list). - * However, note that ALIGN(sizeof(unsigned)) + ALIGN(data size) must - * be at least 'sizeof(struct fl)', so that blocks can be used as structures - * when on the free list. - */ - -#include <lib/libsa/stand.h> - -struct fl { - unsigned size; - struct fl *next; -} *freelist = NULL; - -static char heap[4 * 1024 * 1024]; -#define HEAP_START (heap) -#define HEAP_LIMIT (&heap[sizeof(heap)]) - -#ifdef HEAP_START -static char *top = (char *)HEAP_START; -#else -extern char end[]; -static char *top = end; -#endif - -void * -alloc(unsigned int size) -{ - struct fl **f = &freelist, **bestf = NULL; -#ifndef ALLOC_FIRST_FIT - unsigned bestsize = 0xffffffff; /* greater than any real size */ -#endif - char *help; - int failed; - -#ifdef ALLOC_TRACE - printf("alloc(%u)", size); -#endif - -#ifdef ALLOC_FIRST_FIT - while (*f != NULL && (*f)->size < size) - f = &((*f)->next); - bestf = f; - failed = (*bestf == NULL); -#else - /* scan freelist */ - while (*f) { - if ((*f)->size >= size) { - if ((*f)->size == size) /* exact match */ - goto found; - - if ((*f)->size < bestsize) { - /* keep best fit */ - bestf = f; - bestsize = (*f)->size; - } - } - f = &((*f)->next); - } - - /* no match in freelist if bestsize unchanged */ - failed = (bestsize == 0xffffffff); -#endif - - if (failed) { /* nothing found */ - /* - * allocate from heap, keep chunk len in - * first word - */ - help = top; - - /* make _sure_ the region can hold a struct fl. */ - if (size < ALIGN(sizeof (struct fl *))) - size = ALIGN(sizeof (struct fl *)); - top += ALIGN(sizeof(unsigned)) + ALIGN(size); -#ifdef HEAP_LIMIT - if (top > (char *)HEAP_LIMIT) - panic("heap full (0x%lx+%u)", help, size); -#endif - *(unsigned *)help = ALIGN(size); -#ifdef ALLOC_TRACE - printf("=%p\n", help + ALIGN(sizeof(unsigned))); -#endif - return(help + ALIGN(sizeof(unsigned))); - } - - /* we take the best fit */ - f = bestf; - -#ifndef ALLOC_FIRST_FIT -found: -#endif - /* remove from freelist */ - help = (char *)*f; - *f = (*f)->next; -#ifdef ALLOC_TRACE - printf("=%p (origsize %u)\n", help + ALIGN(sizeof(unsigned)), - *(unsigned *)help); -#endif - return(help + ALIGN(sizeof(unsigned))); -} - -void -free(void *ptr, unsigned int size) -{ - struct fl *f; - - if (ptr == NULL) - return; - - f = (struct fl *)((char *)ptr - ALIGN(sizeof(unsigned))); - -#ifdef ALLOC_TRACE - printf("free(%p, %u) (origsize %u)\n", ptr, size, f->size); -#endif -#ifdef DEBUG - if (size > f->size) - printf("free %u bytes @%p, should be <=%u\n", - size, ptr, f->size); -#ifdef HEAP_START - if (ptr < (void *)HEAP_START) -#else - if (ptr < (void *)end) -#endif - printf("free: %lx before start of heap.\n", (u_long)ptr); - -#ifdef HEAP_LIMIT - if (ptr > (void *)HEAP_LIMIT) - printf("free: %lx beyond end of heap.\n", (u_long)ptr); -#endif -#endif /* DEBUG */ - /* put into freelist */ - f->next = freelist; - freelist = f; -} diff --git a/sys/arch/zaurus/stand/zboot/boot.8 b/sys/arch/zaurus/stand/zboot/boot.8 deleted file mode 100644 index 8bd43f33fe3..00000000000 --- a/sys/arch/zaurus/stand/zboot/boot.8 +++ /dev/null @@ -1,387 +0,0 @@ -.\" $OpenBSD: boot.8,v 1.14 2015/11/01 21:26:48 jmc Exp $ -.\" -.\" Copyright (c) 1997-2001 Michael Shalayeff -.\" 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 HIS RELATIVES 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 MIND, 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. -.\" -.\" -.Dd $Mdocdate: November 1 2015 $ -.Dt BOOT 8 zaurus -.Os -.Sh NAME -.Nm boot , -.Nm boot.conf -.Nd zaurus-specific second-stage bootstrap -.Sh DESCRIPTION -The main purpose of this program is to load the system kernel while dealing -with the peculiarities of the zaurus machine. -.Pp -As described in -.Xr boot_zaurus 8 , -this program is loaded by the primary bootstrap loader and provides a -convenient way to load the kernel. -This program acts as an enhanced boot monitor for zaurus systems, providing -a common interface for the kernel to start from. -.Pp -Basic operations include: -.Pp -.Bl -bullet -compact -.It -Detecting and switching between multiple consoles. -.It -Loading kernels from any device supported by the primary bootstrap loader. -.\" .It -.\" Loading kernels compressed by -.\" .Xr gzip 1 . -.It -Passing system parameters queried from the primary bootstrap loader to the -kernel. -.It -Providing an interactive command line. -.El -.Pp -The sequence of its operation is as follows: initialization, -parsing the configuration file, then an interactive command line. -While at the command line you have 5 seconds to type any commands, if needed. -If time expires, the kernel will be loaded according to -the current variable settings (see the -.Nm set -command). -Each time a kernel load fails, the timeout is increased by one second. -The sequence of -.Nm -operations is as follows: -.Bl -enum -.It -Probe for console devices, which includes the (default) LCD+Keyboard -console -.Pq Li cn0 -and up to three serial consoles -.Pf ( Li com0 -through -.Li com2 ) -connected to the serial ports. -Display messages to the default console about the devices found. -.\" .It -.\" Detect memory. -.\" Conventional memory is detected by querying the BIOS. -.\" Extended memory is detected by probing page-by-page through the address -.\" space, rather than asking the BIOS; many BIOS's cannot report larger than -.\" 64M of memory. -.\" All memory found is reported to the default console device. -.It -Probe for disk devices, and select the first disk with an i386-compatible -MBR and a valid -.Ox -primary partition. -.It -If the file -.Pa /etc/boot.conf -exists on the root filesystem on the selected disk, open and parse it. -Lines beginning with the -.Sq # -character, -as well as whitespace at the beginning of lines, -are ignored. -The file may contain any commands -.Nm -accepts at the interactive prompt. -Though default settings usually suffice, they can be changed here. -.\" XXX CHECK_SKIP_CONF is not defined... -.\" .Pp -.\" .Pa boot.conf -.\" processing can be skipped by holding down either Control key as -.\" .Nm -.\" starts. -.It -The header line -.Pp -.Dl >> OpenBSD/zaurus BOOT [x.xx] -.Pp -is displayed to the active console, where -.Ar x.xx -is the version number of the -.Nm -program, followed by the -.Pp -.Dl boot> -.Pp -prompt, which means you are in interactive mode and may enter commands. -If you do not, -.Nm -will proceed to load the kernel with the current parameters after the -timeout period has expired. -.El -.Pp -By default, -.Nm -attempts to load the kernel executable -.Pa /bsd . -If it fails to find the kernel and no alternative kernel image has -been specified, the system will be unable to boot. -.Sh COMMANDS -The following commands are accepted at the -.Nm -prompt: -.Bl -tag -width shorten -.It boot Op Ar image Op Fl acds -Boots the kernel image specified by -.Ar image -with any options given. -Image specification consists of a pair -.Ar device : Ns Ar filename ; -either or both can be omitted (`:' is not needed if both are omitted), -in which case values from -.Nm -variables will be used. -.Pp -When selecting the -.Ar device -to boot from, -.Nm -makes no distinction between SCSI and IDE type drives; -they are detected as -.Sq hd -devices. -Therefore, to boot kernel -.Pa /bsd -from slice -.Sq a -on the first hard drive -.Pq irrespective of device type , -specify -.Dq boot hd0a:/bsd . -.Pp -.Em Note: -Normally, the internal hard disk is designated by the -.Ar device -name -.Sq hd0 . -If a CF hard disk is present in the socket when the system starts, -the internal hard disk is instead designated by the prefix -.Sq hd1 , -and -.Sq hd0 -will access the CF hard disk. -.Bl -tag -width _a_ -.It Fl a -Causes the kernel to ask for the -.Nm root -device to use. -.It Fl c -Causes the kernel to go into -.Xr boot_config 8 -before performing -.Xr autoconf 4 -procedures. -.It Fl d -Causes the kernel to drop into -.Xr ddb 4 -at the earliest convenient point. -.It Fl s -Causes the kernel to boot single-user. -.El -.It clear -Clears the console screen. -This is useful if your bootstrap console doesn't scroll the screen -automatically when the cursor is in the bottom line. -.It echo Op Ar args -Displays -.Ar args -on the console device. -.It help -Prints a list of available commands and machine dependent -commands, if any. -.It ls Op Ar directory -Prints contents of the specified -.Ar directory -in long format including: attributes and file type, owner, group, -size, filename. -.It reboot -.\" Reboots the machine by initiating a warm boot procedure. -Returns control to the primary bootstrap loader. -.It set Op Ar varname Op Ar value -If invoked without arguments, prints a list of variables and their values. -If only -.Ar varname -is specified, displays contents of that variable. -If -.Ar varname -and -.Ar value -are both specified, sets that variable to the given value. -Variables include: -.Pp -.Bl -tag -compact -width boothow -.It Nm addr -Address at which to load the kernel. -.It Nm debug -Debug flag if -.Nm -was compiled with DEBUG defined. -.It Nm device -Boot device name (e.g., -.\" .Li fd0a , -.Li hd0a ) . -.It Nm howto -Options to pass to the loaded kernel. -.It Nm image -File name containing the kernel image. -.It Nm timeout -Number of seconds boot will wait for human intervention before -booting the default kernel image. -.It Nm tty -Active console device name (e.g., -.Li cn0 , -.Li com0 , -.Li com1 ) . -.El -.It stty Op Ar device Op Ar speed -Displays or sets the -.Ar speed -for a console -.Ar device . -If changing the baudrate for the currently active console, -.Nm -offers you five seconds of grace time before committing the change -to allow you to change your terminal's speed to match. -If changing speed -.Em not -for the active console, the baudrate is set for the -.Em next -time you switch to a serial console. -.Pp -The default baudrate is 9600bps. -.It time -Displays system time and date. -.El -.Sh UPDATING BOOTBLOCKS -Since the bootblocks actually live in a Linux flash filesystem, a -rather obtuse method must currently be used to upgrade them. -.Pp -.Bl -enum -offset indent -compact -.It -Place -.Pa zboot -and -.Pa zbsdmod.o -onto an MS-DOS filesystem on a CF card, and then insert into the Zaurus. -.It -Remove power from the Zaurus. -.It -Unplug the battery. -.It -Start holding down the -.Sq b -and -.Sq d -keys. -.It -Wait 30 seconds, then re-insert the battery and power up the Zaurus. -.It -When you see text start to appear on the Zaurus, release the -.Sq b -and -.Sq d -keys. -.It -Login as root and perform the following steps: -.Bd -literal -offset indent -# mount /dev/mtdblock2 /tmp -# cp /mnt/cf/z* /tmp/home/etc/rc.d -# reboot -.Ed -.Pp -An SD card with an MS-DOS filesystem may be used instead, in which case -the Linux pathname will be -.Pa /mnt/card -instead of -.Pa /mnt/cf . -.El -.Sh FILES -.Bl -tag -width /usr/mdec/zbsdmod.o -compact -.It Pa /usr/mdec/zbsdmod.o -kernel module for the primary bootstrap loader that must be -loaded before the system bootstrap -.It Pa /usr/mdec/zboot -system bootstrap -.It Pa /etc/boot.conf -system bootstrap's startup file -.It Pa /bsd -kernel image -.It Pa /bsd.rd -kernel image for installation/recovery -.El -.Sh EXAMPLES -Boot the default kernel: -.Pp -.Dl boot> boot -.Pp -Remove the 5 second pause at boot-time permanently, causing -.Nm -to load the kernel immediately without prompting: -.Pp -.Dl # echo \&"boot\&" > /etc/boot.conf -.Pp -Use serial console. -A null modem cable should connect the specified serial port to a terminal. -Useful for debugging. -.Pp -.Dl boot> set tty com0 -.Pp -Invoke the serial console at every boot: -.Pp -.Dl # echo \&"set tty com0\&" > /etc/boot.conf -.Pp -Boot the kernel named -.Pa /bsd -from the second hard disk in -.Dq User Kernel Configuration -mode (see -.Xr boot_config 8 ) . -This mechanism allows for the explicit enabling and disabling of devices -during the current boot sequence, as well as the modification -of device parameters. -Once booted, such changes can be made permanent by using -.Xr config 8 Ns 's -.Fl e -option. -.Pp -.Dl boot> boot hd1a:/bsd -c -.Sh SEE ALSO -.\" .Xr gzip 1 , -.Xr autoconf 4 , -.Xr ddb 4 , -.Xr boot_config 8 , -.Xr boot_zaurus 8 , -.Xr fdisk 8 , -.\" .Xr installboot 8 , -.Xr reboot 8 -.Sh HISTORY -This program was written by Michael Shalayeff for -.Ox 2.1 , -and adapted to zaurus by Uwe Stuehler for -.Ox 3.7 . -.Sh BUGS -Non-IDE disks cannot be used to load /etc/boot.conf or -the kernel from them. diff --git a/sys/arch/zaurus/stand/zboot/compat_linux.h b/sys/arch/zaurus/stand/zboot/compat_linux.h deleted file mode 100644 index dc6c79cc93a..00000000000 --- a/sys/arch/zaurus/stand/zboot/compat_linux.h +++ /dev/null @@ -1,149 +0,0 @@ -/* $OpenBSD: compat_linux.h,v 1.10 2016/03/02 15:14:44 naddy Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* This file must be included late, for redefinitions to take effect. */ - -#ifndef _LOCORE - -#define INT_LIMIT(x) (~((x)1 << (sizeof(x)*8 - 1))) -#define OFFSET_MAX INT_LIMIT(long long) -#define OFFT_OFFSET_MAX INT_LIMIT(long) - -#undef O_RDONLY -#undef O_WRONLY -#undef O_RDWR -#undef SEEK_SET -#undef SEEK_CUR - -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define SEEK_SET 0 -#define SEEK_CUR 1 - -#define LINUX_EOVERFLOW 75 - -struct linux_stat { - unsigned short lst_dev; - unsigned short pad1; - unsigned long lst_ino; - unsigned short lst_mode; - unsigned short lst_nlink; - unsigned short lst_uid; - unsigned short lst_gid; - unsigned short lst_rdev; - unsigned short pad2; - long lst_size; - unsigned long lst_blksize; - unsigned long lst_blocks; - long lst_atime; - unsigned long unused1; - long lst_mtime; - unsigned long unused2; - long lst_ctime; - unsigned long unused3; - unsigned long unused4; - unsigned long unused5; -}; - -struct termios { - unsigned long c_iflag; - unsigned long c_oflag; - unsigned long c_cflag; - unsigned long c_lflag; - unsigned char c_line; - unsigned char c_cc[19]; -}; - -#define IGNBRK 0x0000001 -#define BRKINT 0x0000002 -#define PARMRK 0x0000008 -#define ISTRIP 0x0000020 -#define INLCR 0x0000040 -#define IGNCR 0x0000080 -#define ICRNL 0x0000100 -#define IXON 0x0000400 -#define IMAXBEL 0x0002000 - -#define OPOST 0x0000001 - -#define ISIG 0x00000001 -#define ICANON 0x00000002 -#define ECHO 0x00000008 -#define ECHONL 0x00000040 -#define IEXTEN 0x00008000 - -#define CBAUD 0x0000100f -#define B0 0x00000000 -#define B50 0x00000001 -#define B75 0x00000002 -#define B110 0x00000003 -#define B134 0x00000004 -#define B150 0x00000005 -#define B200 0x00000006 -#define B300 0x00000007 -#define B600 0x00000008 -#define B1200 0x00000009 -#define B1800 0x0000000a -#define B2400 0x0000000b -#define B4800 0x0000000c -#define B9600 0x0000000d -#define B19200 0x0000000e -#define B38400 0x0000000f -#define B57600 0x00001001 -#define B115200 0x00001002 -#define B230400 0x00001003 - -#define CSIZE 0x00000030 -#define PARENB 0x00000100 -#define CS8 0x00000030 - -#define TIOCGETA (('T' << 8) | 1) -#define TIOCSETA (('T' << 8) | 2) -#define TIOCSETAW (('T' << 8) | 3) -#define TIOCSETAF (('T' << 8) | 4) - -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -typedef unsigned int speed_t; - -void cfmakeraw(struct termios *); -int cfsetspeed(struct termios *, speed_t); -int tcgetattr(int, struct termios *); -int tcsetattr(int, int, struct termios *); - -#endif /* !_LOCORE */ - -/* linux/asm/unistd.h */ -#define __NR_SYSCALL_BASE 0x900000 -#define __NR_exit (__NR_SYSCALL_BASE+1) -#define __NR_read (__NR_SYSCALL_BASE+3) -#define __NR_write (__NR_SYSCALL_BASE+4) -#define __NR_open (__NR_SYSCALL_BASE+5) -#define __NR_close (__NR_SYSCALL_BASE+6) -#define __NR_time (__NR_SYSCALL_BASE+13) -#define __NR_lseek32 (__NR_SYSCALL_BASE+19) -#define __NR_ioctl (__NR_SYSCALL_BASE+54) -#define __NR_stat (__NR_SYSCALL_BASE+106) -#define __NR_syscall (__NR_SYSCALL_BASE+113) -#define __NR_select (__NR_SYSCALL_BASE+142) - -#undef SYS_select -#define SYS_select __NR_select diff --git a/sys/arch/zaurus/stand/zboot/conf.c b/sys/arch/zaurus/stand/zboot/conf.c deleted file mode 100644 index fae16527e06..00000000000 --- a/sys/arch/zaurus/stand/zboot/conf.c +++ /dev/null @@ -1,102 +0,0 @@ -/* $OpenBSD: conf.c,v 1.9 2014/07/20 19:33:54 tobias Exp $ */ - -/* - * Copyright (c) 1996 Michael Shalayeff - * 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 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. - * - */ - -#include <sys/param.h> -#include <sys/types.h> -#include <netinet/in.h> -#include <libsa.h> -#include <lib/libsa/ufs.h> -#ifdef notdef -#include <lib/libsa/cd9660.h> -#include <lib/libsa/fat.h> -#include <lib/libsa/nfs.h> -#include <lib/libsa/tftp.h> -#include <lib/libsa/netif.h> -#endif -#include "unixdev.h" -#include <dev/cons.h> - -const char version[] = "2.10"; -int debug = 1; - -void (*zaurus_probe1[])(void) = { - cninit -}; -void (*zaurus_probe2[])(void) = { - diskprobe -}; - -struct zaurus_boot_probes probe_list[] = { - { "probing", zaurus_probe1, nitems(zaurus_probe1) }, - { "disk", zaurus_probe2, nitems(zaurus_probe2) } -}; -int nibprobes = nitems(probe_list); - - -void (*sa_cleanup)(void) = NULL; - -struct fs_ops file_system[] = { - { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, - ufs_stat, ufs_readdir }, -#ifdef notdef - { fat_open, fat_close, fat_read, fat_write, fat_seek, - fat_stat, fat_readdir }, - { nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, - nfs_stat, nfs_readdir }, - { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek, - cd9660_stat, cd9660_readdir }, -#endif -#ifdef _TEST - { null_open, null_close, null_read, null_write, null_seek, - null_stat, null_readdir } -#endif -}; -int nfsys = nitems(file_system); - -struct devsw devsw[] = { - { "UNIX", unixstrategy, unixopen, unixclose, unixioctl }, -#if 0 - { "TFTP", tftpstrategy, tftpopen, tftpclose, tftpioctl }, -#endif -}; -int ndevs = nitems(devsw); - -#ifdef notdef -struct netif_driver *netif_drivers[] = { - NULL -}; -int n_netif_drivers = nitems(netif_drivers); -#endif - -struct consdev constab[] = { - { cn_probe, cn_init, cn_getc, cn_putc }, - { com_probe, com_init, com_getc, com_putc }, - { NULL } -}; -struct consdev *cn_tab = constab; diff --git a/sys/arch/zaurus/stand/zboot/crt0.c b/sys/arch/zaurus/stand/zboot/crt0.c deleted file mode 100644 index 189bff0bd51..00000000000 --- a/sys/arch/zaurus/stand/zboot/crt0.c +++ /dev/null @@ -1,25 +0,0 @@ -/* $OpenBSD: crt0.c,v 1.1 2005/04/16 17:22:44 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -void _start(void) asm("_start"); - -void -_start(void) -{ - boot(0); -} diff --git a/sys/arch/zaurus/stand/zboot/devopen.c b/sys/arch/zaurus/stand/zboot/devopen.c deleted file mode 100644 index 70eb707c4c6..00000000000 --- a/sys/arch/zaurus/stand/zboot/devopen.c +++ /dev/null @@ -1,126 +0,0 @@ -/* $OpenBSD: devopen.c,v 1.12 2014/07/13 09:26:08 jasper Exp $ */ - -/* - * Copyright (c) 1996-1999 Michael Shalayeff - * 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 HIS RELATIVES 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 MIND, 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/param.h> -#include <sys/disklabel.h> -#include <dev/cons.h> -#include "libsa.h" -#include <stand/boot/cmd.h> - -/* XXX use slot for 'rd' for 'hd' pseudo-device */ -const char bdevs[][4] = { - "wd", "", "fd", "", "sd", "st", "cd", "", - "", "", "", "", "", "", "", "", "", "hd", "" - -}; -const int nbdevs = nitems(bdevs); - -const char cdevs[][4] = { - "cn", "", "", "", "", "", "", "", - "", "", "", "", "com" -}; -const int ncdevs = nitems(cdevs); - -/* pass dev_t to the open routines */ -int -devopen(struct open_file *f, const char *fname, char **file) -{ - struct devsw *dp = devsw; - register int i, rc = 1; - - *file = (char *)fname; - -#ifdef DEBUG - if (debug) - printf("devopen:"); -#endif - - for (i = 0; i < ndevs && rc != 0; dp++, i++) { -#ifdef DEBUG - if (debug) - printf(" %s: ", dp->dv_name); -#endif - if ((rc = (*dp->dv_open)(f, file)) == 0) { - f->f_dev = dp; - return 0; - } -#ifdef DEBUG - else if (debug) - printf("%d", rc); -#endif - - } -#ifdef DEBUG - if (debug) - putchar('\n'); -#endif - - if ((f->f_flags & F_NODEV) == 0) - f->f_dev = dp; - - return rc; -} - -void -devboot(dev_t bootdev, char *p) -{ - dev_t unit = 0; /* XXX */ - - *p++ = 'h'; - *p++ = 'd'; - *p++ = '0' + unit; - *p++ = 'a'; - *p = '\0'; -} - -char ttyname_buf[8]; - -char * -ttyname(int fd) -{ - snprintf(ttyname_buf, sizeof ttyname_buf, "%s%d", - cdevs[major(cn_tab->cn_dev)], minor(cn_tab->cn_dev)); - - return ttyname_buf; -} - -dev_t -ttydev(char *name) -{ - int i, unit = -1; - char *no = name + strlen(name) - 1; - - while (no >= name && *no >= '0' && *no <= '9') - unit = (unit < 0 ? 0 : (unit * 10)) + *no-- - '0'; - if (no < name || unit < 0) - return NODEV; - for (i = 0; i < ncdevs; i++) - if (strncmp(name, cdevs[i], no - name + 1) == 0) - return (makedev(i, unit)); - return NODEV; -} diff --git a/sys/arch/zaurus/stand/zboot/disk.h b/sys/arch/zaurus/stand/zboot/disk.h deleted file mode 100644 index 9308972b483..00000000000 --- a/sys/arch/zaurus/stand/zboot/disk.h +++ /dev/null @@ -1,92 +0,0 @@ -/* $OpenBSD: disk.h,v 1.1 2005/05/24 20:38:20 uwe Exp $ */ - -/* - * Copyright (c) 1997 Tobias Weingartner - * 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 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. - * - */ - -#ifndef _DISKPROBE_H -#define _DISKPROBE_H - -#include <sys/queue.h> - -/* XXX snatched from <i386/biosdev.h> */ -#if 1 -/* Info about disk from the bios, plus the mapping from - * BIOS numbers to BSD major (driver?) number. - * - * Also, do not bother with BIOSN*() macros, just parcel - * the info out, and use it like this. This makes for less - * of a dependance on BIOSN*() macros having to be the same - * across /boot, /bsd, and userland. - */ -#define BOOTARG_DISKINFO 1 -typedef struct _bios_diskinfo { - /* BIOS section */ - int bios_number; /* BIOS number of drive (or -1) */ - u_int bios_cylinders; /* BIOS cylinders */ - u_int bios_heads; /* BIOS heads */ - u_int bios_sectors; /* BIOS sectors */ - int bios_edd; /* EDD support */ - - /* BSD section */ - dev_t bsd_dev; /* BSD device */ - - /* Checksum section */ - u_int32_t checksum; /* Checksum for drive */ - - /* Misc. flags */ - u_int32_t flags; -#define BDI_INVALID 0x00000001 /* I/O error during checksumming */ -#define BDI_GOODLABEL 0x00000002 /* Had SCSI or ST506/ESDI disklabel */ -#define BDI_BADLABEL 0x00000004 /* Had another disklabel */ -#define BDI_EL_TORITO 0x00000008 /* 2,048-byte sectors */ -#define BDI_PICKED 0x80000000 /* kernel-only: cksum matched */ - -} bios_diskinfo_t; - -#define BOOTARG_CKSUMLEN 3 /* u_int32_t */ -#endif /* 1 */ - -/* All the info on a disk we've found */ -struct diskinfo { - bios_diskinfo_t bios_info; - struct disklabel disklabel; - - dev_t bsddev, bootdev; - - TAILQ_ENTRY(diskinfo) list; -}; -TAILQ_HEAD(disklist_lh, diskinfo); - -/* diskprobe.c */ -struct diskinfo *dkdevice(dev_t, dev_t); -void bios_devpath(int, int, char *); -char *bios_getdiskinfo(int, bios_diskinfo_t *); -int bios_getdospart(bios_diskinfo_t *); -char *bios_getdisklabel(bios_diskinfo_t *, struct disklabel *); -void dump_diskinfo(void); - -#endif /* _DISKPROBE_H */ diff --git a/sys/arch/zaurus/stand/zboot/diskprobe.c b/sys/arch/zaurus/stand/zboot/diskprobe.c deleted file mode 100644 index 8abd24f805e..00000000000 --- a/sys/arch/zaurus/stand/zboot/diskprobe.c +++ /dev/null @@ -1,317 +0,0 @@ -/* $OpenBSD: diskprobe.c,v 1.5 2014/07/12 21:03:38 tedu Exp $ */ - -/* - * Copyright (c) 1997 Tobias Weingartner - * 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 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. - * - */ - -/* We want the disk type names from disklabel.h */ -#undef DKTYPENAMES - -#include <sys/param.h> -#include <sys/queue.h> -#include <sys/reboot.h> -#include <sys/disklabel.h> -#include <stand/boot/bootarg.h> -#if 0 -#include <machine/biosvar.h> -#endif -#include <lib/libz/zlib.h> -#include "disk.h" -#if 0 -#include "biosdev.h" -#endif -#include "libsa.h" - -#define MAX_CKSUMLEN MAXBSIZE / DEV_BSIZE /* Max # of blks to cksum */ - -/* Disk spin-up wait timeout. */ -static u_int timeout = 10; - -/* Local Prototypes */ -static void hardprobe(void); - -/* List of disk devices we found/probed */ -struct disklist_lh disklist; - -/* - * Probe for all hard disks. - */ -static void -hardprobe(void) -{ - struct diskinfo *dip; - int i, order[] = { 0x80, 0x82 }; /* XXX probe disks in this order */ - u_int bsdunit, type; - u_int scsi = 0, ide = 0; - u_int disk = 0; - - /* Hard disks */ - for (i = 0; i < sizeof(order) / sizeof(order[0]); i++) { - dip = alloc(sizeof(struct diskinfo)); - bzero(dip, sizeof(*dip)); - - if (bios_getdiskinfo(order[i], &dip->bios_info) != NULL) { - free(dip, 0); - continue; - } - - printf("hd%u", disk++); - - /* Try to find the label, to figure out device type. */ - if (bios_getdisklabel(&dip->bios_info, &dip->disklabel) - == NULL) { - printf("*"); - bsdunit = ide++; - type = 0; /* XXX let it be IDE */ - } else { - /* Best guess */ - switch (dip->disklabel.d_type) { - case DTYPE_SCSI: - type = 4; - bsdunit = scsi++; - dip->bios_info.flags |= BDI_GOODLABEL; - break; - - case DTYPE_ESDI: - case DTYPE_ST506: - type = 0; - bsdunit = ide++; - dip->bios_info.flags |= BDI_GOODLABEL; - break; - - default: - dip->bios_info.flags |= BDI_BADLABEL; - type = 0; /* XXX Suggest IDE */ - bsdunit = ide++; - } - } - - dip->bios_info.checksum = 0; /* just in case */ - /* Fill out best we can. */ - dip->bios_info.bsd_dev = - MAKEBOOTDEV(type, 0, 0, bsdunit, RAW_PART); - - /* Add to queue of disks. */ - TAILQ_INSERT_TAIL(&disklist, dip, list); - - printf(" "); - } -} - -/* Probe for all BIOS supported disks */ -u_int32_t bios_cksumlen; -void -diskprobe(void) -{ - struct diskinfo *dip; - int i; - - /* These get passed to kernel */ - bios_diskinfo_t *bios_diskinfo; - - /* Init stuff */ - TAILQ_INIT(&disklist); - - /* Do probes */ - hardprobe(); - -#if 0 - /* Checksumming of hard disks */ - for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; ) - ; - bios_cksumlen = i; - - /* Get space for passing bios_diskinfo stuff to kernel */ - for (i = 0, dip = TAILQ_FIRST(&disklist); dip; - dip = TAILQ_NEXT(dip, list)) - i++; - bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t)); - - /* Copy out the bios_diskinfo stuff */ - for (i = 0, dip = TAILQ_FIRST(&disklist); dip; - dip = TAILQ_NEXT(dip, list)) - bios_diskinfo[i++] = dip->bios_info; - - bios_diskinfo[i++].bios_number = -1; - /* Register for kernel use */ - addbootarg(BOOTARG_CKSUMLEN, sizeof(u_int32_t), &bios_cksumlen); - addbootarg(BOOTARG_DISKINFO, i * sizeof(bios_diskinfo_t), - bios_diskinfo); -#endif -} - -/* - * Find info on the disk given by major + unit number. - */ -struct diskinfo * -dkdevice(dev_t maj, dev_t unit) -{ - struct diskinfo *dip; - - for (dip = TAILQ_FIRST(&disklist); dip; - dip = TAILQ_NEXT(dip, list)) { - /* XXX skip non-matching entries according to maj. */ - - if (unit-- == 0) - return dip; - } - - return NULL; -} - -/* - * Find the Linux device path that corresponds to the given "BIOS" disk, - * where 0x80 corresponds to /dev/hda, 0x81 to /dev/hdb, and so on. - */ -void -bios_devpath(int dev, int part, char *p) -{ - *p++ = '/'; - *p++ = 'd'; - *p++ = 'e'; - *p++ = 'v'; - *p++ = '/'; - if ((dev & 0x80) != 0) - *p++ = 'h'; - else - *p++ = 'f'; - *p++ = 'd'; - *p++ = 'a' + (dev & 0x7f); - if (part != -1) - *p++ = '1' + part; - *p = '\0'; -} - -/* - * Fill out a bios_diskinfo_t for this device. - */ -char * -bios_getdiskinfo(int dev, bios_diskinfo_t *bdi) -{ - static char path[PATH_MAX]; - struct linux_stat sb; - char *p; - - bzero(bdi, sizeof *bdi); - bdi->bios_number = -1; - - bios_devpath(dev, -1, path); - - if (ustat(path, &sb) != 0) - return "no device node"; - - bdi->bios_number = dev; - - if (bios_getdospart(bdi) < 0) - return "no OpenBSD partition"; - - return 0; -} - -int -bios_getdospart(bios_diskinfo_t *bdi) -{ - char path[PATH_MAX]; - char buf[DEV_BSIZE]; - struct dos_partition *dp; - int fd; - u_int part; - size_t rsize; - - bios_devpath(bdi->bios_number, -1, path); - - /* - * Give disk devices some time to become ready when the first open - * fails. Even when open succeeds the disk is sometimes not ready. - */ - if ((fd = uopen(path, O_RDONLY)) == -1 && errno == ENXIO) { - int t; - - while (fd == -1 && timeout > 0) { - timeout--; - sleep(1); - fd = uopen(path, O_RDONLY); - } - if (fd != -1) - sleep(2); - } - if (fd == -1) - return -1; - - /* Read the disk's MBR. */ - if (unixstrategy((void *)fd, F_READ, DOSBBSECTOR, - DEV_BSIZE, buf, &rsize) != 0 || rsize != DEV_BSIZE) { - uclose(fd); - errno = EIO; - return -1; - } - - /* Find OpenBSD primary partition in the disk's MBR. */ - dp = (struct dos_partition *)&buf[DOSPARTOFF]; - for (part = 0; part < NDOSPART; part++) - if (dp[part].dp_typ == DOSPTYP_OPENBSD) - break; - if (part == NDOSPART) { - uclose(fd); - errno = ERDLAB; - return -1; - } - uclose(fd); - - return part; -} - -char * -bios_getdisklabel(bios_diskinfo_t *bdi, struct disklabel *label) -{ - char path[PATH_MAX]; - char buf[DEV_BSIZE]; - int part; - int fd; - size_t rsize; - - part = bios_getdospart(bdi); - if (part < 0) - return "no OpenBSD partition"; - - bios_devpath(bdi->bios_number, part, path); - - /* Test if the OpenBSD partition has a valid disklabel. */ - if ((fd = uopen(path, O_RDONLY)) != -1) { - char *msg = "failed to read disklabel"; - - if (unixstrategy((void *)fd, F_READ, LABELSECTOR, - DEV_BSIZE, buf, &rsize) == 0 && rsize == DEV_BSIZE) - msg = getdisklabel(buf, label); - uclose(fd); - /* Don't wait for other disks if this label is ok. */ - if (msg == NULL) - timeout = 0; - return (msg); - } - - return "failed to open partition"; -} diff --git a/sys/arch/zaurus/stand/zboot/exec.c b/sys/arch/zaurus/stand/zboot/exec.c deleted file mode 100644 index d256f6e386b..00000000000 --- a/sys/arch/zaurus/stand/zboot/exec.c +++ /dev/null @@ -1,26 +0,0 @@ -/* $OpenBSD: exec.c,v 1.2 2005/01/10 21:10:57 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include "libsa.h" -#include <lib/libsa/loadfile.h> - -void -run_loadfile(u_long *marks, int howto) -{ - panic("run_loadfile"); -} diff --git a/sys/arch/zaurus/stand/zboot/exit.c b/sys/arch/zaurus/stand/zboot/exit.c deleted file mode 100644 index a64edf462f4..00000000000 --- a/sys/arch/zaurus/stand/zboot/exit.c +++ /dev/null @@ -1,71 +0,0 @@ -/* $OpenBSD: exit.c,v 1.5 2011/04/07 15:12:03 drahn Exp $ */ -/* $NetBSD: exit.c,v 1.11 1996/12/01 20:22:19 pk Exp $ */ - -/*- - * Copyright (c) 1993 John Brezak - * 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. - */ - -#include <sys/stdarg.h> - -#include "libsa.h" - -/* unixcons.c */ -extern struct termios tioc; -extern int tioc_valid; -extern __dead void uexit(int); - -__dead void -panic(const char *fmt, ...) -{ - extern void closeall(void); - va_list ap; - static int paniced; - - if (!paniced) { - paniced = 1; - closeall(); - } - - va_start(ap, fmt); - vprintf(fmt, ap); - printf("\n"); - va_end(ap); -#if 0 - _rtt(); -#else - uexit(0); -#endif - /*NOTREACHED*/ -} - -void -exit(void) -{ - if (tioc_valid) - (void)tcsetattr(0, TCSADRAIN, &tioc); - uexit(0); -} diff --git a/sys/arch/zaurus/stand/zboot/libsa.h b/sys/arch/zaurus/stand/zboot/libsa.h deleted file mode 100644 index b0c4064eeeb..00000000000 --- a/sys/arch/zaurus/stand/zboot/libsa.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: libsa.h,v 1.3 2005/05/24 20:38:20 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <lib/libsa/stand.h> - -#include "compat_linux.h" - -#define EXEC_ELF - -#define DEFAULT_KERNEL_ADDRESS 0xa0200000 - -struct zaurus_boot_probes { - char *name; - void (**probes)(void); - int count; -}; - -void diskprobe(void); - -extern const char bdevs[][4]; -extern const int nbdevs; - -extern struct zaurus_boot_probes probe_list[]; -extern int nibprobes; -#if 0 -extern void (*devboot_p)(dev_t, char *); -#endif - -extern int debug; diff --git a/sys/arch/zaurus/stand/zboot/loadfile.c b/sys/arch/zaurus/stand/zboot/loadfile.c deleted file mode 100644 index b7551c9cc89..00000000000 --- a/sys/arch/zaurus/stand/zboot/loadfile.c +++ /dev/null @@ -1,431 +0,0 @@ -/* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */ -/* $OpenBSD: loadfile.c,v 1.6 2013/10/17 15:54:11 deraadt Exp $ */ - -/*- - * Copyright (c) 1997 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center and by Christos Zoulas. - * - * 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. - */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. - * - * @(#)boot.c 8.1 (Berkeley) 6/10/93 - */ - -#ifdef _STANDALONE -#include <lib/libkern/libkern.h> -#include <lib/libsa/stand.h> -#else -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <err.h> -#endif - -#include <sys/param.h> -#include <sys/exec.h> - -#include "compat_linux.h" -#include "pathnames.h" -#include <lib/libsa/loadfile.h> -#include <stand/boot/cmd.h> - -#define BOOT_ZBOOT - -#ifdef BOOT_ELF -#include <sys/exec_elf.h> -static int elf_exec(int, Elf_Ehdr *, u_long *, int); -#endif -#ifdef BOOT_ZBOOT -#include <dev/cons.h> /* XXX */ -static int zboot_exec(int, u_long *, int); -#endif - -/* - * Open 'filename', read in program and and return 0 if ok 1 on error. - * Fill in marks - */ -int -loadfile(const char *fname, u_long *marks, int flags) -{ - union { -#ifdef BOOT_ELF - Elf_Ehdr elf; -#endif - } hdr; - ssize_t nr; - int fd, rval; - - /* Open the file. */ - if ((fd = open(fname, 0)) < 0) { - WARN(("open %s", fname ? fname : "<default>")); - return -1; - } - - /* Read the exec header. */ - if ((nr = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) { - WARN(("read header")); - goto err; - } - -#ifdef BOOT_ELF - if (memcmp(hdr.elf.e_ident, ELFMAG, SELFMAG) == 0 && - hdr.elf.e_ident[EI_CLASS] == ELFCLASS) { -#ifdef BOOT_ZBOOT - rval = zboot_exec(fd, marks, flags); -#else - rval = elf_exec(fd, &hdr.elf, marks, flags); -#endif - } else -#endif - { - rval = 1; - errno = EFTYPE; - WARN(("%s", fname ? fname : "<default>")); - } - - if (rval == 0) { - PROGRESS(("=0x%lx\n", marks[MARK_END] - marks[MARK_START])); - return fd; - } -err: - (void)close(fd); - return -1; -} - -#ifdef BOOT_ELF -static int -elf_exec(int fd, Elf_Ehdr *elf, u_long *marks, int flags) -{ - Elf_Shdr *shp; - Elf_Phdr *phdr; - Elf_Off off; - int i; - size_t sz; - int first; - int havesyms; - paddr_t minp = ~0, maxp = 0, pos = 0; - paddr_t offset = marks[MARK_START], shpp, elfp; - - sz = elf->e_phnum * sizeof(Elf_Phdr); - phdr = ALLOC(sz); - - if (lseek(fd, elf->e_phoff, SEEK_SET) == -1) { - WARN(("lseek phdr")); - FREE(phdr, sz); - return 1; - } - if (read(fd, phdr, sz) != sz) { - WARN(("read program headers")); - FREE(phdr, sz); - return 1; - } - - for (first = 1, i = 0; i < elf->e_phnum; i++) { - - if (phdr[i].p_type != PT_LOAD || - (phdr[i].p_flags & (PF_W|PF_R|PF_X)) == 0) - continue; - -#define IS_TEXT(p) (p.p_flags & PF_X) -#define IS_DATA(p) ((p.p_flags & PF_X) == 0) -#define IS_BSS(p) (p.p_filesz < p.p_memsz) - /* - * XXX: Assume first address is lowest - */ - if ((IS_TEXT(phdr[i]) && (flags & LOAD_TEXT)) || - (IS_DATA(phdr[i]) && (flags & LOAD_DATA))) { - - /* Read in segment. */ - PROGRESS(("%s%lu", first ? "" : "+", - (u_long)phdr[i].p_filesz)); - - if (lseek(fd, phdr[i].p_offset, SEEK_SET) == -1) { - WARN(("lseek text")); - FREE(phdr, sz); - return 1; - } - if (READ(fd, phdr[i].p_vaddr, phdr[i].p_filesz) != - phdr[i].p_filesz) { - WARN(("read text")); - FREE(phdr, sz); - return 1; - } - first = 0; - - } - if ((IS_TEXT(phdr[i]) && (flags & (LOAD_TEXT|COUNT_TEXT))) || - (IS_DATA(phdr[i]) && (flags & (LOAD_DATA|COUNT_TEXT)))) { - pos = phdr[i].p_vaddr; - if (minp > pos) - minp = pos; - pos += phdr[i].p_filesz; - if (maxp < pos) - maxp = pos; - } - - /* Zero out bss. */ - if (IS_BSS(phdr[i]) && (flags & LOAD_BSS)) { - PROGRESS(("+%lu", - (u_long)(phdr[i].p_memsz - phdr[i].p_filesz))); - BZERO((phdr[i].p_vaddr + phdr[i].p_filesz), - phdr[i].p_memsz - phdr[i].p_filesz); - } - if (IS_BSS(phdr[i]) && (flags & (LOAD_BSS|COUNT_BSS))) { - pos += phdr[i].p_memsz - phdr[i].p_filesz; - if (maxp < pos) - maxp = pos; - } - } - FREE(phdr, sz); - - /* - * Copy the ELF and section headers. - */ - elfp = maxp = roundup(maxp, sizeof(long)); - if (flags & (LOAD_HDR|COUNT_HDR)) - maxp += sizeof(Elf_Ehdr); - - if (flags & (LOAD_SYM|COUNT_SYM)) { - if (lseek(fd, elf->e_shoff, SEEK_SET) == -1) { - WARN(("lseek section headers")); - return 1; - } - sz = elf->e_shnum * sizeof(Elf_Shdr); - shp = ALLOC(sz); - - if (read(fd, shp, sz) != sz) { - WARN(("read section headers")); - return 1; - } - - shpp = maxp; - maxp += roundup(sz, sizeof(long)); - - /* - * Now load the symbol sections themselves. Make sure the - * sections are aligned. Don't bother with string tables if - * there are no symbol sections. - */ - off = roundup((sizeof(Elf_Ehdr) + sz), sizeof(long)); - - for (havesyms = i = 0; i < elf->e_shnum; i++) - if (shp[i].sh_type == SHT_SYMTAB) - havesyms = 1; - - for (first = 1, i = 0; i < elf->e_shnum; i++) { - if (shp[i].sh_type == SHT_SYMTAB || - shp[i].sh_type == SHT_STRTAB) { - if (havesyms && (flags & LOAD_SYM)) { - PROGRESS(("%s%ld", first ? " [" : "+", - (u_long)shp[i].sh_size)); - if (lseek(fd, shp[i].sh_offset, - SEEK_SET) == -1) { - WARN(("lseek symbols")); - FREE(shp, sz); - return 1; - } - if (READ(fd, maxp, shp[i].sh_size) != - shp[i].sh_size) { - WARN(("read symbols")); - FREE(shp, sz); - return 1; - } - } - maxp += roundup(shp[i].sh_size, - sizeof(long)); - shp[i].sh_offset = off; - off += roundup(shp[i].sh_size, sizeof(long)); - first = 0; - } - } - if (flags & LOAD_SYM) { - BCOPY(shp, shpp, sz); - - if (havesyms && first == 0) - PROGRESS(("]")); - } - FREE(shp, sz); - } - - /* - * Frob the copied ELF header to give information relative - * to elfp. - */ - if (flags & LOAD_HDR) { - elf->e_phoff = 0; - elf->e_shoff = sizeof(Elf_Ehdr); - elf->e_phentsize = 0; - elf->e_phnum = 0; - BCOPY(elf, elfp, sizeof(*elf)); - } - - marks[MARK_START] = LOADADDR(minp); - marks[MARK_ENTRY] = LOADADDR(elf->e_entry); - marks[MARK_NSYM] = 1; /* XXX: Kernel needs >= 0 */ - marks[MARK_SYM] = LOADADDR(elfp); - marks[MARK_END] = LOADADDR(maxp); - return 0; -} -#endif /* BOOT_ELF */ - -#ifdef BOOT_ZBOOT -static int -zboot_exec(int fd, u_long *marks, int flags) -{ - char buf[512]; - char *p; - int tofd; - int sz; - int i; - - /* XXX cheating here by assuming that Xboot() was called before. */ - - tofd = uopen(_PATH_ZBOOT, O_WRONLY); - if (tofd == -1) { - printf("%s: can't open (errno %d)\n", _PATH_ZBOOT, errno); - return 1; - } - - p = cmd.path; - for (; *p != '\0'; p++) - if (*p == ':') { - strlcpy(buf, p+1, sizeof(buf)); - break; - } - if (*p == '\0') - strlcpy(buf, cmd.path, sizeof(buf)); - - p = buf; - for (; *p == '/'; p++) - ; - - sz = strlen(p); - if (uwrite(tofd, p, sz) != sz) { - printf("zboot_exec: argument write error\n"); - goto err; - } - - buf[0] = ' '; - buf[1] = '-'; - if (uwrite(tofd, buf, 2) != 2) { - printf("zboot_exec: argument write error\n"); - goto err; - } - - i = (cmd.argc > 1 && cmd.argv[1][0] != '-') ? 2 : 1; - for (; i < cmd.argc; i++) { - p = cmd.argv[i]; - if (*p == '-') - p++; - sz = strlen(p); - if (uwrite(tofd, p, sz) != sz) { - printf("zboot_exec: argument write error\n"); - goto err; - } - } - - /* Select UART unit for serial console. */ - if (cn_tab && major(cn_tab->cn_dev) == 12) { - buf[0] = '0' + minor(cn_tab->cn_dev); - if (uwrite(tofd, buf, 1) != 1) { - printf("zboot_exec: argument write error\n"); - goto err; - } - } - - /* Commit boot arguments. */ - uclose(tofd); - - tofd = uopen(_PATH_ZBOOT, O_WRONLY); - if (tofd == -1) { - printf("%s: can't open (errno %d)\n", _PATH_ZBOOT, errno); - return 1; - } - - if (lseek(fd, 0, SEEK_SET) != 0) { - printf("%s: seek error\n", _PATH_ZBOOT); - goto err; - } - - while ((sz = read(fd, buf, sizeof(buf))) == sizeof(buf)) { - if ((sz = uwrite(tofd, buf, sz)) != sizeof(buf)) { - printf("%s: write error\n", _PATH_ZBOOT); - goto err; - } - } - - if (sz < 0) { - printf("zboot_exec: read error\n"); - goto err; - } - - if (sz >= 0 && uwrite(tofd, buf, sz) != sz) { - printf("zboot_exec: write error\n"); - goto err; - } - - uclose(tofd); - return 0; - -err: - uclose(tofd); - return 1; -} -#endif /* BOOT_ZBOOT */ diff --git a/sys/arch/zaurus/stand/zboot/machdep.c b/sys/arch/zaurus/stand/zboot/machdep.c deleted file mode 100644 index e0a38d66eee..00000000000 --- a/sys/arch/zaurus/stand/zboot/machdep.c +++ /dev/null @@ -1,53 +0,0 @@ -/* $OpenBSD: machdep.c,v 1.4 2005/05/24 20:38:20 uwe Exp $ */ - -/* - * Copyright (c) 2004 Tom Cosgrove - * Copyright (c) 1997-1999 Michael Shalayeff - * 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 HIS RELATIVES 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 MIND, 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 "libsa.h" - -char _alloc_heap[4 * 1024 * 1024]; - -void -machdep(void) -{ - int i, j; - struct zaurus_boot_probes *pr; - - /* - * The list of probe routines is now in conf.c. - */ - for (i = 0; i < nibprobes; i++) { - pr = &probe_list[i]; - if (pr != NULL) { - printf("%s: ", pr->name); - - for (j = 0; j < pr->count; j++) - (*(pr->probes)[j])(); - printf("\n"); - } - } -} diff --git a/sys/arch/zaurus/stand/zboot/pathnames.h b/sys/arch/zaurus/stand/zboot/pathnames.h deleted file mode 100644 index 2c80cd92958..00000000000 --- a/sys/arch/zaurus/stand/zboot/pathnames.h +++ /dev/null @@ -1,19 +0,0 @@ -/* $OpenBSD: pathnames.h,v 1.3 2005/01/14 08:10:16 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#define _PATH_ZBOOT "/proc/zboot" diff --git a/sys/arch/zaurus/stand/zboot/termios.c b/sys/arch/zaurus/stand/zboot/termios.c deleted file mode 100644 index e35d760be25..00000000000 --- a/sys/arch/zaurus/stand/zboot/termios.c +++ /dev/null @@ -1,100 +0,0 @@ -/* $OpenBSD: termios.c,v 1.3 2016/03/02 15:14:44 naddy Exp $ */ - -/*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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. - */ - -#include "libsa.h" - -/* Linux-specific line speed handling from linux_termios.c */ - -static speed_t linux_speeds[] = { - 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, - 9600, 19200, 38400, 57600, 115200, 230400 -}; - -static const int linux_spmasks[] = { - B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, - B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400 -}; - -int -cfsetspeed(struct termios *t, speed_t speed) -{ - int mask; - int i; - - mask = B9600; /* XXX default value should this be 0? */ - for (i = 0; i < sizeof (linux_speeds) / sizeof (speed_t); i++) { - if (speed == linux_speeds[i]) { - mask = linux_spmasks[i]; - break; - } - } - t->c_cflag &= ~CBAUD; - t->c_cflag |= mask; - - return (0); -} - -void -cfmakeraw(struct termios *t) -{ - t->c_iflag &= ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); - t->c_oflag &= ~OPOST; - t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - t->c_cflag &= ~(CSIZE|PARENB); - t->c_cflag |= CS8; -} - -int -tcgetattr(int fd, struct termios *t) -{ - return (uioctl(fd, TIOCGETA, t)); -} - -/* This function differs slightly from tcsetattr() in libc. */ -int -tcsetattr(int fd, int action, struct termios *t) -{ - switch (action) { - case TCSANOW: - action = TIOCSETA; - break; - case TCSADRAIN: - action = TIOCSETAW; - break; - case TCSAFLUSH: - action = TIOCSETAF; - break; - default: - errno = EINVAL; - return (-1); - } - return (uioctl(fd, action, t)); -} diff --git a/sys/arch/zaurus/stand/zboot/unixcons.c b/sys/arch/zaurus/stand/zboot/unixcons.c deleted file mode 100644 index c6502ac41f8..00000000000 --- a/sys/arch/zaurus/stand/zboot/unixcons.c +++ /dev/null @@ -1,231 +0,0 @@ -/* $OpenBSD: unixcons.c,v 1.2 2008/01/23 16:37:57 jsing Exp $ */ - -/* - * Copyright (c) 1997-1999 Michael Shalayeff - * 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 HIS RELATIVES 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 MIND, 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/types.h> -#include <dev/cons.h> -#include "libsa.h" -#include "unixdev.h" - -struct termios tioc; -int tioc_valid = 0; - -#define NCOM 3 -const char *compath[NCOM] = { - "/dev/ttyS0", /* com0 */ - "/dev/ttyS2", /* com1 */ - "/dev/ttyS1" /* com2 */ -}; - -int com_fd = -1; /* open serial port */ -int com_speed = 9600; /* default speed is 9600 baud */ - -/* Local prototypes */ -void common_putc(dev_t, int); -int common_getc(dev_t); - - -void -common_putc(dev_t dev, int c) -{ - /* Always send to stdout. */ - (void)uwrite(1, &c, 1); - - /* Copy to serial if open. */ - if (com_fd != -1) - (void)uwrite(com_fd, &c, 1); -} - -int -common_getc(dev_t dev) -{ - struct timeval tv; - fd_set fdset; - int fd, nfds, n; - char c; - - while (1) { - tv.tv_sec = 0; - tv.tv_usec = 10000; - FD_ZERO(&fdset); - - /* Always read from stdin. */ - fd = 0; - nfds = 1; - FD_SET(fd, &fdset); - - /* Read from serial if open. */ - if (com_fd != -1) { - nfds = com_fd+1; - FD_SET(com_fd, &fdset); - } - - n = uselect(nfds, &fdset, NULL, NULL, &tv); - if ((dev & 0x80) != 0) - return (n > 0); - - if (n > 0) - break; - } - - for (fd = 0; fd < nfds; fd++) - if (FD_ISSET(fd, &fdset)) - break; - - return (uread(fd, &c, 1) < 1 ? -1 : c); -} - - -void -cn_probe(struct consdev *cn) -{ - cn->cn_pri = CN_MIDPRI; - cn->cn_dev = makedev(0,0); - printf("cn%d ", minor(cn->cn_dev)); -} - -void -cn_init(struct consdev *cn) -{ - struct termios t; - - if (!tioc_valid && tcgetattr(0, &t) == 0) { - tioc = t; - tioc_valid = 1; - cfmakeraw(&t); - (void)tcsetattr(0, TCSAFLUSH, &t); - } -} - -void -cn_putc(dev_t dev, int c) -{ - common_putc(dev, c); -} - -int -cn_getc(dev_t dev) -{ - return (common_getc(dev)); -} - - -void -com_probe(struct consdev *cn) -{ - int i; - struct linux_stat sb; - - for (i = 0; i < NCOM; i++) { - if (ustat(compath[i], &sb) != 0) - continue; - printf("com%d ", i); - } - - cn->cn_pri = CN_LOWPRI; - /* XXX from arm/conf.c */ - cn->cn_dev = makedev(12, 0); -} - -void -com_init(struct consdev *cn) -{ - struct termios t; - int unit = minor(cn->cn_dev); - - if (unit >= NCOM) - return; - - if (com_fd != -1) - uclose(com_fd); - - com_fd = uopen(compath[unit], O_RDWR); - if (com_fd == -1) - return; - - if (tcgetattr(com_fd, &t) == 0) { - cfmakeraw(&t); - cfsetspeed(&t, (speed_t)com_speed); - (void)tcsetattr(com_fd, TCSAFLUSH, &t); - } -} - -void -com_putc(dev_t dev, int c) -{ - common_putc(dev, c); -} - -int -com_getc(dev_t dev) -{ - return (common_getc(dev)); -} - - -int -cnspeed(dev_t dev, int sp) -{ - if (major(dev) == 12) /* comN */ - return (comspeed(dev, sp)); - - /* cn0 or anything else */ - return (9600); -} - -/* call with sp == 0 to query the current speed */ -int -comspeed(dev_t dev, int sp) -{ - struct termios t; - - if (sp <= 0) - return (com_speed); - - /* check if the new speed is a valid baud rate */ - if (cfsetspeed(&t, (speed_t)sp) != 0) - sp = com_speed; - - if (cn_tab && cn_tab->cn_dev == dev && com_speed != sp) { - printf("com%d: changing speed to %d baud in 5 seconds, " - "change your terminal to match!\n\a", - minor(dev), sp); - sleep(5); - if (com_fd != -1 && tcgetattr(com_fd, &t) == 0) { - (void)cfsetspeed(&t, (speed_t)sp); - (void)tcsetattr(com_fd, TCSAFLUSH, &t); - } - printf("\n"); - } - - if (com_speed != sp) { - printf("com%d: %d baud\n", minor(dev), sp); - com_speed = sp; - } - - return (com_speed); -} diff --git a/sys/arch/zaurus/stand/zboot/unixdev.c b/sys/arch/zaurus/stand/zboot/unixdev.c deleted file mode 100644 index a3a0ade2376..00000000000 --- a/sys/arch/zaurus/stand/zboot/unixdev.c +++ /dev/null @@ -1,223 +0,0 @@ -/* $OpenBSD: unixdev.c,v 1.8 2015/09/18 13:40:45 miod Exp $ */ - -/* - * Copyright (c) 1996-1998 Michael Shalayeff - * 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 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. - * - */ - -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/disklabel.h> -#include <sys/syscall.h> -#include <sys/time.h> -#define open uopen -#include <sys/fcntl.h> -#include <dev/cons.h> -#undef open -#include "disk.h" -#include "libsa.h" -#include "unixdev.h" - -int -unixstrategy(void *devdata, int rw, daddr32_t blk, size_t size, void *buf, - size_t *rsize) -{ - int rc = 0; - off_t off; - -#ifdef UNIX_DEBUG - printf("unixstrategy: %s %d bytes @ %d\n", - (rw==F_READ?"reading":"writing"), size, blk); -#endif - - off = (off_t)blk * DEV_BSIZE; - if ((rc = ulseek((int)devdata, off, SEEK_SET)) >= 0) - rc = (rw==F_READ) ? uread((int)devdata, buf, size) : - uwrite((int)devdata, buf, size); - - if (rc >= 0) { - *rsize = (size_t)rc; - rc = 0; - } else - rc = errno; - - return rc; -} - -int -unixopen(struct open_file *f, ...) -{ - va_list ap; - char path[PATH_MAX]; - char *cp, **file; - dev_t maj, unit, part, bsd_dev; - struct diskinfo *dip; - - va_start(ap, f); - cp = *(file = va_arg(ap, char **)); - va_end(ap); - -#ifdef UNIX_DEBUG - if (debug) - printf("unixopen: %s\n", cp); -#endif - - f->f_devdata = NULL; - /* Search for device specification. */ - if (strlen(cp) < 4) - return ENOENT; - cp += 2; - if (cp[2] != ':') { - if (cp[3] != ':') - return ENOENT; - else - cp++; - } - - for (maj = 0; - maj < nbdevs && strncmp(*file, bdevs[maj], cp - *file) != 0; - maj++) - ; - if (maj >= nbdevs) { - printf("Unknown device: "); - for (cp = *file; *cp != ':'; cp++) - putchar(*cp); - putchar('\n'); - return EADAPT; - } - - /* Get unit. */ - if ('0' <= *cp && *cp <= '9') - unit = *cp++ - '0'; - else { - printf("Bad unit number\n"); - return EUNIT; - } - - /* Get partition. */ - if ('a' <= *cp && *cp <= 'p') - part = *cp++ - 'a'; - else { - printf("Bad partition id\n"); - return EPART; - } - - cp++; /* skip ':' */ - if (*cp != 0) - *file = cp; - else - f->f_flags |= F_RAW; - - /* Find device. */ - dip = dkdevice(maj, unit); - if (dip == (struct diskinfo *)NULL) - return ENOENT; - - /* Fix up bootdev. */ - bsd_dev = dip->bios_info.bsd_dev; - dip->bsddev = MAKEBOOTDEV(B_TYPE(bsd_dev), B_ADAPTOR(bsd_dev), - B_CONTROLLER(bsd_dev), unit, part); - dip->bootdev = MAKEBOOTDEV(B_TYPE(bsd_dev), B_ADAPTOR(bsd_dev), - B_CONTROLLER(bsd_dev), B_UNIT(bsd_dev), part); - - /* Try for disklabel again (might be removable media). */ - if (dip->bios_info.flags & BDI_BADLABEL) { - const char *st = bios_getdisklabel(&dip->bios_info, - &dip->disklabel); -#ifdef UNIX_DEBUG - if (debug && st) - printf("%s\n", st); -#endif - if (!st) { - dip->bios_info.flags &= ~BDI_BADLABEL; - dip->bios_info.flags |= BDI_GOODLABEL; - } else - return ERDLAB; - } - - part = bios_getdospart(&dip->bios_info); - bios_devpath(dip->bios_info.bios_number, part, path); - f->f_devdata = (void *)uopen(path, O_RDONLY); - if ((int)f->f_devdata == -1) - return errno; - - return 0; -} - -int -unixclose(struct open_file *f) -{ - return uclose((int)f->f_devdata); -} - -int -unixioctl(struct open_file *f, u_long cmd, void *data) -{ - return uioctl((int)f->f_devdata, cmd, data); -} - -off_t -ulseek(int fd, off_t off, int wh) -{ - extern long ulseek32(int, long, int); - off_t r; - - /* XXX only SEEK_SET is used, so anything else can fail for now. */ - - if (wh == SEEK_SET) { - if (ulseek32(fd, 0, SEEK_SET) != 0) - return -1; - while (off > OFFT_OFFSET_MAX) { - off -= OFFT_OFFSET_MAX; - if (ulseek32(fd, OFFT_OFFSET_MAX, SEEK_CUR) < 0 && - errno != LINUX_EOVERFLOW) - return -1; - } - r = ulseek32(fd, (long)off, SEEK_CUR); - if (r == -1 && errno == LINUX_EOVERFLOW) - r = off; - } else - r = ulseek32(fd, (long)off, wh); - - return r; -} - -time_t -getsecs(void) -{ - return (time_t)syscall(__NR_time, NULL); -} - -unsigned int -sleep(unsigned int seconds) -{ - unsigned int start; - - start = getsecs(); - while (getsecs() - start < seconds) - ; - - return (0); -} diff --git a/sys/arch/zaurus/stand/zboot/unixdev.h b/sys/arch/zaurus/stand/zboot/unixdev.h deleted file mode 100644 index 59935b8a746..00000000000 --- a/sys/arch/zaurus/stand/zboot/unixdev.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $OpenBSD: unixdev.h,v 1.2 2011/03/13 00:13:53 deraadt Exp $ */ - -/* - * Copyright (c) 1996 Michael Shalayeff - * 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 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. - * - */ - -/* unixdev.c */ -int unixstrategy(void *, int, daddr32_t, size_t, void *, size_t *); -int unixopen(struct open_file *, ...); -int unixclose(struct open_file *); -int unixioctl(struct open_file *, u_long, void *); - -/* unixcons.c */ -void cn_probe(struct consdev *); -void cn_init(struct consdev *); -void cn_putc(dev_t, int); -int cn_getc(dev_t); -void com_probe(struct consdev *); -void com_init(struct consdev *); -void com_putc(dev_t, int); -int com_getc(dev_t); -int comspeed(dev_t, int); - -/* unixsys.S */ -int uopen(const char *, int, ...); -int uread(int, void *, size_t); -int uwrite(int, void *, size_t); -int uioctl(int, u_long, char *); -int uclose(int); -off_t ulseek(int, off_t, int); -void uexit(int) __attribute__((noreturn)); -int uselect(int, fd_set *, fd_set *, fd_set *, struct timeval *); -int syscall(int, ...); -int __syscall(quad_t, ...); diff --git a/sys/arch/zaurus/stand/zboot/unixsys.S b/sys/arch/zaurus/stand/zboot/unixsys.S deleted file mode 100644 index eb8a6284f9c..00000000000 --- a/sys/arch/zaurus/stand/zboot/unixsys.S +++ /dev/null @@ -1,75 +0,0 @@ -/* $OpenBSD: unixsys.S,v 1.6 2005/05/24 20:38:20 uwe Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <machine/asm.h> - -#include "compat_linux.h" - - .text - -#define RSYSCALL(x) \ - ENTRY(u##x); \ - swi __NR_##x; \ - b 1f - -RSYSCALL(exit) -RSYSCALL(read) -RSYSCALL(write) -RSYSCALL(open) -RSYSCALL(close) -RSYSCALL(lseek32) -RSYSCALL(ioctl) -RSYSCALL(stat) - -1: - cmn r0, #4096 - movcc pc, lr - rsb r0, r0, #0 - ldr r1, .Lerrno /* XXX clobbers arg1 */ - str r0, [r1] - mvn r0, #0 - mov pc, lr - -.Lerrno: - .word errno - -/* XXX only works for up to four arguments. */ -ENTRY(syscall) - swi __NR_syscall - b 1b - -ENTRY(uselect) - str r4, [sp, #-4]! - ldr r4, [sp, #4] - swi __NR_select - ldr r4, [sp], #4 - cmn r0, #4096 - movcc pc, lr - rsb r0, r0, #0 - str r1, [sp, #-4]! - ldr r1, .Lerrno - str r0, [r1] - ldr r1, [sp], #4 - mvn r0, #0 - mov pc, lr - -.data - - .global errno -errno: - .word 0 diff --git a/sys/arch/zaurus/stand/zbsdmod/Makefile b/sys/arch/zaurus/stand/zbsdmod/Makefile deleted file mode 100644 index eabe11a9e0a..00000000000 --- a/sys/arch/zaurus/stand/zbsdmod/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# $OpenBSD: Makefile,v 1.6 2016/07/30 03:25:49 guenther Exp $ - -OBJS= zbsdmod.o -SRCS= zbsdmod.c -NOMAN= - -all: ${OBJS} - -clean: - rm -f zbsdmod.o - -.include <bsd.prog.mk> - -afterinstall: - ${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 644 \ - ${OBJS} ${DESTDIR}${BINDIR} - -CFLAGS= -fno-stack-protector -Wall -CFLAGS+= -DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\" -CPPFLAGS= -I${.CURDIR}/../include -fno-pie -LDFLAGS+= -nopie -znorelro diff --git a/sys/arch/zaurus/stand/zbsdmod/compat_linux.h b/sys/arch/zaurus/stand/zbsdmod/compat_linux.h deleted file mode 100644 index 6aa373aa748..00000000000 --- a/sys/arch/zaurus/stand/zbsdmod/compat_linux.h +++ /dev/null @@ -1,135 +0,0 @@ -/* $OpenBSD: compat_linux.h,v 1.8 2011/03/13 00:13:53 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#if 0 - -/* Define these unconditionally to get the .modinfo section. */ -#undef __KERNEL__ -#undef MODULE -#define __KERNEL__ -#define MODULE - -/* Standard headers for Linux LKMs */ -#include <linux/kernel.h> -#include <linux/modsetver.h> -#include <linux/module.h> - -/* - * Include Linux 2.4.x headers. - */ -#include <linux/elf.h> -#include <linux/errno.h> -#include <linux/fs.h> -#include <linux/pagemap.h> -#include <linux/file.h> -#include <linux/slab.h> -#include <asm/mach/map.h> - -#else - -/* - * Declare the things that we need from the Linux headers. - */ - -#define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)-1000L) - -#define MKDEV(ma,mi) ((ma)<<8 | (mi)) - -#define S_IFBLK 0060000 -#define S_IFCHR 0020000 - -struct file; -struct inode; - -typedef long loff_t; - -/* BSD headers */ -#include <sys/types.h> -#include <sys/exec_elf.h> -#include <errno.h> - -struct file_operations { - struct module *owner; - void (*llseek) (void); - ssize_t (*read) (struct file *, char *, size_t, loff_t *); - ssize_t (*write) (struct file *, const char *, size_t, loff_t *); - void (*readdir) (void); - void (*poll) (void); - void (*ioctl) (void); - void (*mmap) (void); - int (*open) (struct inode *, struct file *); - void (*flush) (void); - int (*release) (struct inode *, struct file *); - void (*fsync) (void); - void (*fasync) (void); - void (*lock) (void); - void (*readv) (void); - void (*writev) (void); - void (*sendpage) (void); - void (*get_unmapped_area)(void); -#ifdef MAGIC_ROM_PTR - void (*romptr) (void); -#endif /* MAGIC_ROM_PTR */ -}; - -extern struct file * open_exec(const char *); -extern void fput(struct file *); -extern int kernel_read(struct file *, unsigned long, char *, unsigned long); -extern int memcmp(const void *, const void *, size_t); -extern int register_chrdev(unsigned int, const char *, struct file_operations *); -extern int unregister_chrdev(unsigned int, const char *); -extern void printk(const char *, ...) - __attribute__((__format__(printf, 1, 2))); -extern void *memcpy(void *, const void *, size_t); - -/* Linux LKM support */ -static const char __module_kernel_version[] __attribute__((section(".modinfo"))) = -"kernel_version=" UTS_RELEASE; -#if 1 /* def MODVERSIONS */ -static const char __module_using_checksums[] __attribute__((section(".modinfo"))) = -"using_checksums=1"; -#endif - -/* procfs support */ -struct proc_dir_entry { - unsigned short low_ino; - unsigned short namelen; - const char *name; - unsigned short mode; - unsigned short nlink; - unsigned short uid; - unsigned short gid; - unsigned long size; - void *proc_iops; /* inode operations */ - struct file_operations * proc_fops; - void *get_info; - struct module *owner; - struct proc_dir_entry *next, *parent, *subdir; - void *data; - void *read_proc; - void *write_proc; - volatile int count; - int deleted; - unsigned short rdev; -}; -extern struct proc_dir_entry proc_root; -extern struct proc_dir_entry *proc_mknod(const char*, unsigned short, - struct proc_dir_entry*, unsigned short); -extern void remove_proc_entry(const char *, struct proc_dir_entry *); - -#endif diff --git a/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c b/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c deleted file mode 100644 index 0cc12e4d533..00000000000 --- a/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c +++ /dev/null @@ -1,363 +0,0 @@ -/* $OpenBSD: zbsdmod.c,v 1.12 2016/03/14 23:08:05 krw Exp $ */ - -/* - * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - * - * Zaurus OpenBSD bootstrap loader. - */ - -#include "compat_linux.h" - -#define BOOTARGS_BUFSIZ 256 -#define BOOTARGS_MAGIC 0x4f425344 - -#define ZBOOTDEV_MAJOR 99 -#define ZBOOTDEV_MODE 0222 -#define ZBOOTDEV_NAME "zboot" -#define ZBOOTMOD_NAME "zbsdmod" - -/* Prototypes */ -void elf32bsdboot(void); -int init_module(void); -void cleanup_module(void); - -ssize_t zbsdmod_write(struct file *, const char *, size_t, loff_t *); -int zbsdmod_open(struct inode *, struct file *); -int zbsdmod_close(struct inode *, struct file *); - -static struct file_operations fops = { - 0, /* struct module *owner */ - 0, /* lseek */ - 0, /* read */ - zbsdmod_write, /* write */ - 0, /* readdir */ - 0, /* poll */ - 0, /* ioctl */ - 0, /* mmap */ - zbsdmod_open, /* open */ - 0, /* flush */ - zbsdmod_close, /* release */ - 0, /* sync */ - 0, /* async */ - 0, /* check media change */ - 0, /* revalidate */ - 0, /* lock */ -}; - -static int isopen; -static loff_t position; - -/* Outcast local variables to avoid stack usage in elf32bsdboot(). */ -static int cpsr; -static unsigned int sz; -static int i; -static vaddr_t minv, maxv, posv; -static vaddr_t elfv, shpv; -static int *addr; -static vaddr_t *esymp; -static Elf_Shdr *shp; -static Elf_Off off; -static int havesyms; - -/* The maximum size of a kernel image is restricted to 5MB. */ -static int bsdimage[1310720]; /* XXX use kmalloc() */ -static char bootargs[BOOTARGS_BUFSIZ]; - -/* - * Boot the loaded BSD kernel image, or return if an error is found. - * Part of this routine is borrowed from sys/lib/libsa/loadfile.c. - */ -void -elf32bsdboot(void) -{ - -#define elf ((Elf32_Ehdr *)bsdimage) -#define phdr ((Elf32_Phdr *)((char *)elf + elf->e_phoff)) - - if (memcmp(elf->e_ident, ELFMAG, SELFMAG) != 0 || - elf->e_ident[EI_CLASS] != ELFCLASS32) - return; - - minv = (vaddr_t)~0; - maxv = (vaddr_t)0; - posv = (vaddr_t)0; - esymp = 0; - - /* - * Get min and max addresses used by the loaded kernel. - */ - for (i = 0; i < elf->e_phnum; i++) { - - if (phdr[i].p_type != PT_LOAD || - (phdr[i].p_flags & (PF_W|PF_R|PF_X)) == 0) - continue; - -#define IS_TEXT(p) (p.p_flags & PF_X) -#define IS_DATA(p) ((p.p_flags & PF_X) == 0) -#define IS_BSS(p) (p.p_filesz < p.p_memsz) - /* - * XXX: Assume first address is lowest - */ - if (IS_TEXT(phdr[i]) || IS_DATA(phdr[i])) { - posv = phdr[i].p_vaddr; - if (minv > posv) - minv = posv; - posv += phdr[i].p_filesz; - if (maxv < posv) - maxv = posv; - } - if (IS_DATA(phdr[i]) && IS_BSS(phdr[i])) { - posv += phdr[i].p_memsz; - if (maxv < posv) - maxv = posv; - } - /* - * 'esym' is the first word in the .data section, - * and marks the end of the symbol table. - */ - if (IS_DATA(phdr[i]) && !IS_BSS(phdr[i])) - esymp = (vaddr_t *)phdr[i].p_vaddr; - } - - __asm__ volatile ("mrs %0, cpsr" : "=r" (cpsr)); - cpsr |= 0xc0; /* set FI */ - __asm__ volatile ("msr cpsr_c, %0" :: "r" (cpsr)); - - /* - * Copy the boot arguments. - */ - sz = BOOTARGS_BUFSIZ; - while (sz > 0) { - sz--; - ((char *)minv - BOOTARGS_BUFSIZ)[sz] = bootargs[sz]; - } - - /* - * Set up pointers to copied ELF and section headers. - */ -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - elfv = maxv = roundup(maxv, sizeof(long)); - maxv += sizeof(Elf_Ehdr); - - sz = elf->e_shnum * sizeof(Elf_Shdr); - shp = (Elf_Shdr *)((vaddr_t)elf + elf->e_shoff); - shpv = maxv; - maxv += roundup(sz, sizeof(long)); - - /* - * Now load the symbol sections themselves. Make sure the - * sections are aligned, and offsets are relative to the - * copied ELF header. Don't bother with string tables if - * there are no symbol sections. - */ - off = roundup((sizeof(Elf_Ehdr) + sz), sizeof(long)); - for (havesyms = i = 0; i < elf->e_shnum; i++) - if (shp[i].sh_type == SHT_SYMTAB) - havesyms = 1; - for (i = 0; i < elf->e_shnum; i++) { - if (shp[i].sh_type == SHT_SYMTAB || - shp[i].sh_type == SHT_STRTAB) { - if (havesyms) { - sz = shp[i].sh_size; - while (sz > 0) { - sz--; - ((char *)maxv)[sz] = - ((char *)elf + - shp[i].sh_offset)[sz]; - } - } - maxv += roundup(shp[i].sh_size, sizeof(long)); - shp[i].sh_offset = off; - off += roundup(shp[i].sh_size, sizeof(long)); - } - } - - /* - * Copy the ELF and section headers. - */ - sz = sizeof(Elf_Ehdr); - while (sz > 0) { - sz--; - ((char *)elfv)[sz] = ((char *)elf)[sz]; - } - sz = elf->e_shnum * sizeof(Elf_Shdr); - while (sz > 0) { - sz--; - ((char *)shpv)[sz] = ((char *)shp)[sz]; - } - - /* - * Frob the copied ELF header to give information relative - * to elfv. - */ - ((Elf_Ehdr *)elfv)->e_phoff = 0; - ((Elf_Ehdr *)elfv)->e_shoff = sizeof(Elf_Ehdr); - ((Elf_Ehdr *)elfv)->e_phentsize = 0; - ((Elf_Ehdr *)elfv)->e_phnum = 0; - - /* - * Tell locore.S where the symbol table ends, and arrange - * to skip esym when loading the data section. - */ - if (esymp != 0) - *esymp = (vaddr_t)maxv; - for (i = 0; esymp != 0 && i < elf->e_phnum; i++) { - if (phdr[i].p_type != PT_LOAD || - (phdr[i].p_flags & (PF_W|PF_R|PF_X)) == 0) - continue; - if (phdr[i].p_vaddr == (vaddr_t)esymp) { - phdr[i].p_vaddr = (vaddr_t)((char *)phdr[i].p_vaddr + sizeof(long)); - phdr[i].p_offset = (vaddr_t)((char *)phdr[i].p_offset + sizeof(long)); - phdr[i].p_filesz -= sizeof(long); - break; - } - } - - /* - * Load text and data. - */ - for (i = 0; i < elf->e_phnum; i++) { - - if (phdr[i].p_type != PT_LOAD || - (phdr[i].p_flags & (PF_W|PF_R|PF_X)) == 0) - continue; - - if (IS_TEXT(phdr[i]) || IS_DATA(phdr[i])) { - sz = phdr[i].p_filesz; - while (sz > 0) { - sz--; - ((char *)phdr[i].p_vaddr)[sz] = - (((char *)elf) + phdr[i].p_offset)[sz]; - } - } - } - - addr = (int *)(elf->e_entry); - __asm__ volatile ( - "mov r0, %0;" - "mov r2, #0;" - "mov r1, #(0x00000010 | 0x00000020);" - "mcr 15, 0, r1, c1, c0, 0;" - "mcr 15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */;" - "mov pc, r0" :: "r"(addr) : "r0","r1","r2"); -} - -/* - * Initialize the LKM. - */ -int -init_module() -{ - struct proc_dir_entry *entry; - int rc; - - rc = register_chrdev(ZBOOTDEV_MAJOR, ZBOOTDEV_NAME, &fops); - if (rc != 0) { - printk("%s: register_chrdev(%d, ...): error %d\n", - ZBOOTMOD_NAME, ZBOOTDEV_MAJOR, -rc); - return 1; - } - - entry = proc_mknod(ZBOOTDEV_NAME, ZBOOTDEV_MODE | S_IFCHR, - &proc_root, MKDEV(ZBOOTDEV_MAJOR, 0)); - if (entry == NULL) { - (void)unregister_chrdev(ZBOOTDEV_MAJOR, ZBOOTDEV_NAME); - return 1; - } - - printk("%s: OpenBSD/" MACHINE " bootstrap device is %d,0\n", - ZBOOTMOD_NAME, ZBOOTDEV_MAJOR); - - return 0; -} - -/* - * Cleanup - undo whatever init_module did. - */ -void -cleanup_module() -{ - - (void)unregister_chrdev(ZBOOTDEV_MAJOR, ZBOOTDEV_NAME); - remove_proc_entry(ZBOOTDEV_NAME, &proc_root); - - printk("%s: OpenBSD/" MACHINE " bootstrap device unloaded\n", - ZBOOTMOD_NAME); -} - - -ssize_t -zbsdmod_write(struct file *f, const char *buf, size_t len, loff_t *offp) -{ - - if (len < 1) - return 0; - - if (*offp + len >= sizeof(bsdimage)) - return EFBIG; - - memcpy(((char *)bsdimage) + *offp, buf, len); - - *offp += len; - if (*offp > position) - position = *offp; - - return len; -} - -int -zbsdmod_open(struct inode *ino, struct file *f) -{ - - /* XXX superuser check */ - - if (isopen) - return -EBUSY; - - isopen = 1; - position = 0; - - return 0; -} - -int -zbsdmod_close(struct inode *ino, struct file *f) -{ - - if (isopen) { - if (position > 0) { - printk("%s: loaded %ld bytes\n", ZBOOTDEV_NAME, - position); - - if (position < BOOTARGS_BUFSIZ) { - *(int *)bootargs = BOOTARGS_MAGIC; - bootargs[position + sizeof(int)] = '\0'; - memcpy(bootargs + sizeof(int), bsdimage, - position); - } else { -#ifndef _TEST - elf32bsdboot(); - printk("%s: boot failed\n", ZBOOTDEV_NAME); -#else - printk("/* boot() */\n"); -#endif - } - } - isopen = 0; - return 0; - } - - return -EBUSY; -} diff --git a/sys/arch/zaurus/zaurus/autoconf.c b/sys/arch/zaurus/zaurus/autoconf.c deleted file mode 100644 index d71f98470e7..00000000000 --- a/sys/arch/zaurus/zaurus/autoconf.c +++ /dev/null @@ -1,147 +0,0 @@ -/* $OpenBSD: autoconf.c,v 1.16 2016/06/08 17:24:44 tedu Exp $ */ -/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ - -/* - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * 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 Mark Brinicombe for - * the NetBSD project. - * 4. The name of the company nor the name of the author may 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 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. - * - * RiscBSD kernel project - * - * autoconf.c - * - * Autoconfiguration functions - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/reboot.h> -#include <sys/disklabel.h> -#include <sys/device.h> -#include <sys/conf.h> -#include <sys/kernel.h> -#include <sys/timeout.h> -#include <sys/malloc.h> - -#include <uvm/uvm_extern.h> - -#include <machine/bootconfig.h> -#include <machine/intr.h> -#include <dev/cons.h> - -struct device *bootdv = NULL; - -void dumpconf(void); - -/* - * Now that we are fully operational, we can checksum the - * disks, and using some heuristics, hopefully are able to - * always determine the correct root disk. - */ -void -diskconf() -{ - extern struct timeout scoop_checkdisk; - dev_t tmpdev; - -#if 0 - /* - * Configure root, swap, and dump area. This is - * currently done by running the same checksum - * algorithm over all known disks, as was done in - * /boot. Then we basically fixup the *dev vars - * from the info we gleaned from this. - */ - dkcsumattach(); -#endif - - /* - * XXX - * zaurus bootblocks currently pass in "bsd" instead of - * "device:bsd", or any such thing, making this a real pain. - */ - if (bootdv == NULL) - bootdv = parsedisk("wd0a", strlen("wd0a"), 0, &tmpdev); - if (bootdv == NULL) - printf("boot device: lookup '%s' failed.\n", boot_file); - else - printf("boot device: %s\n", bootdv->dv_xname); - - setroot(bootdv, 0, RB_USERREQ); - dumpconf(); - - timeout_add(&scoop_checkdisk, hz/25); -} - -void -device_register(struct device *dev, void *aux) -{ -} - -/* - * void cpu_configure() - * - * Configure all the root devices - * The root devices are expected to configure their own children - */ -void -cpu_configure(void) -{ - softintr_init(); - - /* - * Since various PCI interrupts could be routed via the ICU - * (for PCI devices in the bridge) we need to set up the ICU - * now so that these interrupts can be established correctly - * i.e. This is a hack. - */ - - config_rootfound("mainbus", NULL); - - /* - * We can not know which is our root disk, defer - * until we can checksum blocks to figure it out. - */ - cold = 0; - - /* Time to start taking interrupts so lets open the flood gates .... */ - (void)spl0(); - -} - -struct nam2blk nam2blk[] = { - { "wd", 16 }, - { "sd", 24 }, - { "cd", 26 }, - { "rd", 18 }, - { "vnd", 19 }, - { NULL, -1 } -}; diff --git a/sys/arch/zaurus/zaurus/genassym.cf b/sys/arch/zaurus/zaurus/genassym.cf deleted file mode 100644 index 679dcad021f..00000000000 --- a/sys/arch/zaurus/zaurus/genassym.cf +++ /dev/null @@ -1 +0,0 @@ -# $OpenBSD: genassym.cf,v 1.1 2010/04/26 22:11:38 deraadt Exp $ diff --git a/sys/arch/zaurus/zaurus/zaurus_lcd.c b/sys/arch/zaurus/zaurus/zaurus_lcd.c deleted file mode 100644 index 18220260ca1..00000000000 --- a/sys/arch/zaurus/zaurus/zaurus_lcd.c +++ /dev/null @@ -1,416 +0,0 @@ -/* $OpenBSD: zaurus_lcd.c,v 1.28 2013/12/06 21:03:05 deraadt Exp $ */ -/* $NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - */ - -/* - * LCD driver for Sharp Zaurus (based on the Intel Lubbock driver). - * - * Controlling LCD is almost completely done through PXA2X0's - * integrated LCD controller. Codes for it is arm/xscale/pxa2x0_lcd.c. - * - * Codes in this file provide platform specific things including: - * LCD on/off switch and backlight brightness - * LCD panel geometry - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/conf.h> -#include <sys/uio.h> -#include <sys/malloc.h> - -#include <dev/cons.h> -#include <dev/wscons/wsconsio.h> -#include <dev/wscons/wsdisplayvar.h> -#include <dev/wscons/wscons_callbacks.h> - -#include <machine/bus.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0_lcd.h> - -#include <zaurus/dev/zaurus_scoopvar.h> -#include <zaurus/dev/zaurus_sspvar.h> - -#include <dev/rasops/rasops.h> - -int lcd_match(struct device *, void *, void *); -void lcd_attach(struct device *, struct device *, void *); -int lcd_activate(struct device *, int); -int lcd_cnattach(void (*)(u_int, int)); - -/* - * wsdisplay glue - */ -struct pxa2x0_wsscreen_descr -lcd_bpp16_screen = { - { - "std" - }, - 16, /* bits per pixel */ - RI_ROTATE_CW /* quarter clockwise rotation */ -}; - -static const struct wsscreen_descr *lcd_scr_descr[] = { - &lcd_bpp16_screen.c -}; - -const struct wsscreen_list lcd_screen_list = { - sizeof lcd_scr_descr / sizeof lcd_scr_descr[0], lcd_scr_descr -}; - -int lcd_ioctl(void *, u_long, caddr_t, int, struct proc *); -int lcd_show_screen(void *, void *, int, - void (*)(void *, int, int), void *); -void lcd_burner(void *, u_int, u_int); - -int lcd_param(struct pxa2x0_lcd_softc *, u_long, struct wsdisplay_param *); - -const struct wsdisplay_accessops lcd_accessops = { - .ioctl = lcd_ioctl, - .mmap = pxa2x0_lcd_mmap, - .alloc_screen = pxa2x0_lcd_alloc_screen, - .free_screen = pxa2x0_lcd_free_screen, - .show_screen = lcd_show_screen, - .load_font = pxa2x0_lcd_load_font, - .list_font = pxa2x0_lcd_list_font, - .burn_screen = lcd_burner -}; - -struct cfattach lcd_pxaip_ca = { - sizeof (struct pxa2x0_lcd_softc), lcd_match, lcd_attach, NULL, - lcd_activate -}; - -struct cfdriver lcd_cd = { - NULL, "lcd", DV_DULL -}; - -#define CURRENT_DISPLAY &sharp_zaurus_C3000 - -const struct lcd_panel_geometry sharp_zaurus_C3000 = -{ - 480, /* Width */ - 640, /* Height */ - 0, /* No extra lines */ - - LCDPANEL_ACTIVE | LCDPANEL_VSP | LCDPANEL_HSP, - 1, /* clock divider */ - 0, /* AC bias pin freq */ - - 0x28, /* horizontal sync pulse width */ - 0x2e, /* BLW */ - 0x7d, /* ELW */ - - 2, /* vertical sync pulse width */ - 1, /* BFW */ - 0, /* EFW */ -}; - -struct sharp_lcd_backlight { - int duty; /* LZ9JG18 DAC value */ - int cont; /* BACKLIGHT_CONT signal */ - int on; /* BACKLIGHT_ON signal */ -}; - -#define CURRENT_BACKLIGHT sharp_zaurus_C3000_bl - -const struct sharp_lcd_backlight sharp_zaurus_C3000_bl[] = { - { 0x00, 0, 0 }, /* 0: Off */ - { 0x00, 0, 1 }, /* 1: 0% */ - { 0x01, 0, 1 }, /* 2: 20% */ - { 0x07, 0, 1 }, /* 3: 40% */ - { 0x01, 1, 1 }, /* 4: 60% */ - { 0x07, 1, 1 }, /* 5: 80% */ - { 0x11, 1, 1 }, /* 6: 100% */ - { -1, -1, -1 } /* 7: Invalid */ -}; - -int lcd_max_brightness(void); -int lcd_get_brightness(void); -void lcd_set_brightness(int); -void lcd_set_brightness_internal(int); -int lcd_get_backlight(void); -void lcd_set_backlight(int); -void lcd_blank(int); - -int -lcd_match(struct device *parent, void *cf, void *aux) -{ - return 1; -} - -void -lcd_attach(struct device *parent, struct device *self, void *aux) -{ - struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *)self; - struct wsemuldisplaydev_attach_args aa; - extern int glass_console; - - printf("\n"); - - pxa2x0_lcd_attach_sub(sc, aux, &lcd_bpp16_screen, CURRENT_DISPLAY, - glass_console); - - aa.console = glass_console; - aa.scrdata = &lcd_screen_list; - aa.accessops = &lcd_accessops; - aa.accesscookie = sc; - aa.defaultscreens = 0; - - (void)config_found(self, &aa, wsemuldisplaydevprint); - - /* Start with approximately 40% of full brightness. */ - lcd_set_brightness(3); -} - -int -lcd_cnattach(void (*clkman)(u_int, int)) -{ - return - (pxa2x0_lcd_cnattach(&lcd_bpp16_screen, CURRENT_DISPLAY, clkman)); -} - -/* - * wsdisplay accessops overrides - */ - -int -lcd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) -{ - struct pxa2x0_lcd_softc *sc = v; - int res = EINVAL; - - switch (cmd) { - case WSDISPLAYIO_GETPARAM: - case WSDISPLAYIO_SETPARAM: - res = lcd_param(sc, cmd, (struct wsdisplay_param *)data); - break; - } - - if (res == EINVAL) - res = pxa2x0_lcd_ioctl(v, cmd, data, flag, p); - - return res; -} - -void -lcd_burner(void *v, u_int on, u_int flags) -{ - - lcd_set_brightness(on ? lcd_get_brightness() : 0); -} - -int -lcd_show_screen(void *v, void *cookie, int waitok, - void (*cb)(void *, int, int), void *cbarg) -{ - int rc; - - if ((rc = pxa2x0_lcd_show_screen(v, cookie, waitok, cb, cbarg)) != 0) - return (rc); - - /* Turn on LCD */ - lcd_burner(v, 1, 0); - - return (0); -} - -/* - * wsdisplay I/O controls - */ - -int -lcd_param(struct pxa2x0_lcd_softc *sc, u_long cmd, - struct wsdisplay_param *dp) -{ - int res = EINVAL; - - switch (dp->param) { - case WSDISPLAYIO_PARAM_BACKLIGHT: - if (cmd == WSDISPLAYIO_GETPARAM) { - dp->min = 0; - dp->max = 1; - dp->curval = lcd_get_backlight(); - res = 0; - } else if (cmd == WSDISPLAYIO_SETPARAM) { - lcd_set_backlight(dp->curval); - res = 0; - } - break; - - case WSDISPLAYIO_PARAM_CONTRAST: - /* unsupported */ - res = ENOTTY; - break; - - case WSDISPLAYIO_PARAM_BRIGHTNESS: - if (cmd == WSDISPLAYIO_GETPARAM) { - dp->min = 1; - dp->max = lcd_max_brightness(); - dp->curval = lcd_get_brightness(); - res = 0; - } else if (cmd == WSDISPLAYIO_SETPARAM) { - lcd_set_brightness(dp->curval); - res = 0; - } - break; - } - - return res; -} - -/* - * LCD backlight - */ - -static int lcdbrightnesscurval = 1; -static int lcdislit = 1; -static int lcdisblank = 0; - -int -lcd_max_brightness(void) -{ - int i; - - for (i = 0; CURRENT_BACKLIGHT[i].duty != -1; i++) - ; - return i - 1; -} - -int -lcd_get_brightness(void) -{ - - return lcdbrightnesscurval; -} - -void -lcd_set_brightness(int newval) -{ - int max; - - max = lcd_max_brightness(); - if (newval < 0) - newval = 0; - else if (newval > max) - newval = max; - - if (lcd_get_backlight() && !lcdisblank) - lcd_set_brightness_internal(newval); - - if (newval > 0) - lcdbrightnesscurval = newval; -} - -void -lcd_set_brightness_internal(int newval) -{ - static int curval = 1; - int i; - - /* - * It appears that the C3000 backlight can draw too much power if we - * switch it from a low to a high brightness. Increasing brightness - * in steps avoids this issue. - */ - if (newval > curval) { - for (i = curval + 1; i <= newval; i++) { - (void)zssp_ic_send(ZSSP_IC_LZ9JG18, - CURRENT_BACKLIGHT[i].duty); - scoop_set_backlight(CURRENT_BACKLIGHT[i].on, - CURRENT_BACKLIGHT[i].cont); - delay(5000); - } - } else { - (void)zssp_ic_send(ZSSP_IC_LZ9JG18, - CURRENT_BACKLIGHT[newval].duty); - scoop_set_backlight(CURRENT_BACKLIGHT[newval].on, - CURRENT_BACKLIGHT[newval].cont); - } - - curval = newval; -} - -int -lcd_get_backlight(void) -{ - - return lcdislit; -} - -void -lcd_set_backlight(int on) -{ - - if (!on) { - lcd_set_brightness(0); - lcdislit = 0; - } else { - lcdislit = 1; - lcd_set_brightness(lcd_get_brightness()); - } -} - -void -lcd_blank(int blank) -{ - - if (blank) { - lcd_set_brightness(0); - lcdisblank = 1; - } else { - lcdisblank = 0; - lcd_set_brightness(lcd_get_brightness()); - } -} - -int -lcd_activate(struct device *self, int act) -{ - struct pxa2x0_lcd_softc *sc = (struct pxa2x0_lcd_softc *)self; - int ret = 0; - - switch (act) { - case DVACT_SUSPEND: - lcd_set_brightness(0); - pxa2x0_lcd_suspend(sc); - break; - case DVACT_RESUME: - pxa2x0_lcd_resume(sc); - lcd_set_brightness(lcd_get_brightness()); - break; - default: - ret = config_activate_children(self, act); - break; - } - return (ret); -} diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c deleted file mode 100644 index 8c3b6ea9a80..00000000000 --- a/sys/arch/zaurus/zaurus/zaurus_machdep.c +++ /dev/null @@ -1,1334 +0,0 @@ -/* $OpenBSD: zaurus_machdep.c,v 1.61 2016/08/14 13:29:22 jsg Exp $ */ -/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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. - * - * Machine dependant functions for kernel setup for - * Intel DBPXA250 evaluation board (a.k.a. Lubbock). - * Based on iq80310_machhdep.c - */ -/* - * Copyright (c) 2001 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -/* - * Copyright (c) 1997,1998 Mark Brinicombe. - * Copyright (c) 1997,1998 Causality Limited. - * 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 Mark Brinicombe - * for the NetBSD Project. - * 4. The name of the company nor the name of the author may 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 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. - * - * Machine dependant functions for kernel setup for Intel IQ80310 evaluation - * boards using RedBoot firmware. - */ - -/* - * DIP switches: - * - * S19: no-dot: set RB_KDB. enter kgdb session. - * S20: no-dot: set RB_SINGLE. don't go multi user mode. - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/exec.h> -#include <sys/proc.h> -#include <sys/msgbuf.h> -#include <sys/reboot.h> -#include <sys/termios.h> -#include <sys/kcore.h> - -#include <uvm/uvm_extern.h> - -#include <sys/conf.h> -#include <sys/queue.h> -#include <dev/cons.h> -#include <sys/socket.h> - -#include <machine/db_machdep.h> -#include <ddb/db_sym.h> -#include <ddb/db_extern.h> -#ifdef KGDB -#include <sys/kgdb.h> -#endif - -#include <net/if.h> - -#include <machine/bootconfig.h> -#include <machine/bus.h> -#include <machine/cpu.h> -#include <machine/frame.h> -#include <arm/kcore.h> -#include <arm/undefined.h> -#include <arm/machdep.h> - -#include <arm/xscale/pxa2x0reg.h> -#include <arm/xscale/pxa2x0var.h> -#include <arm/xscale/pxa2x0_gpio.h> -#include <machine/machine_reg.h> -#include <machine/zaurus_var.h> - -#include <zaurus/dev/zaurus_scoopreg.h> - -#include "apm.h" -#if NAPM > 0 -#include <zaurus/dev/zaurus_apm.h> -#endif - -#include "wsdisplay.h" - -/* Kernel text starts 2MB in from the bottom of the kernel address space. */ -#define KERNEL_TEXT_BASE (KERNEL_BASE + 0x00200000) -#define KERNEL_VM_BASE (KERNEL_BASE + 0x04000000) -#define KERNEL_VM_SIZE VM_KERNEL_SPACE_SIZE - -/* - * Address to call from cpu_reset() to reset the machine. - * This is machine architecture dependant as it varies depending - * on where the ROM appears when you turn the MMU off. - */ - -u_int cpu_reset_address = 0; - -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - -int zaurusmod; - -BootConfig bootconfig; /* Boot config storage */ -char *boot_args = NULL; -char *boot_file = NULL; - -paddr_t physical_start; -paddr_t physical_freestart; -paddr_t physical_freeend; -paddr_t physical_end; -u_int free_pages; -int physmem = 0; - -/*int debug_flags;*/ -#ifndef PMAP_STATIC_L1S -int max_processes = 64; /* Default number */ -#endif /* !PMAP_STATIC_L1S */ - -/* Physical and virtual addresses for some global pages */ -pv_addr_t systempage; -pv_addr_t irqstack; -pv_addr_t undstack; -pv_addr_t abtstack; -extern pv_addr_t kernelstack; -pv_addr_t minidataclean; - -paddr_t msgbufphys; - -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - -#ifdef PMAP_DEBUG -extern int pmap_debug_level; -#endif - -#define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ -#define KERNEL_PT_KERNEL 1 /* Page table for mapping kernel */ -#define KERNEL_PT_KERNEL_NUM 32 -#define KERNEL_PT_VMDATA (KERNEL_PT_KERNEL+KERNEL_PT_KERNEL_NUM) - /* Page tables for mapping kernel VM */ -#define KERNEL_PT_VMDATA_NUM 8 /* start with 32MB of KVM */ -#define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM) - -pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; - -extern struct user *proc0paddr; - -/* - * safepri is a safe priority for sleep to set for a spin-wait - * during autoconfiguration or after a panic. - */ -int safepri = 0; - -/* Prototypes */ - -#define BOOT_STRING_MAGIC 0x4f425344 - -char bootargs[MAX_BOOT_STRING]; -void process_kernel_args(char *); - -void consinit(void); -void early_clkman(u_int, int); -void kgdb_port_init(void); -void change_clock(uint32_t v); - -bs_protos(bs_notimpl); - -#include "com.h" -#if NCOM > 0 -#include <dev/ic/comvar.h> -#include <dev/ic/comreg.h> -#endif - -#ifndef CONSPEED -#define CONSPEED B9600 /* What RedBoot uses */ -#endif -#ifndef CONMODE -#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ -#endif - -int comcnspeed = CONSPEED; -int comcnmode = CONMODE; - - -/* - * void boot(int howto) - * - * Reboots the system - * - * Deal with any syncing, unmounting, dumping and shutdown hooks, - * then reset the CPU. - */ -__dead void -boot(int howto) -{ - extern int lid_suspend; - - if ((howto & RB_POWERDOWN) != 0) - lid_suspend = 0; - - if (cold) { - if ((howto & RB_USERREQ) == 0) - howto |= RB_HALT; - goto haltsys; - } - - /* - * If RB_NOSYNC was not specified sync the discs. - * Note: Unless cold is set to 1 here, syslogd will die during the - * unmount. It looks like syslogd is getting woken up only to find - * that it cannot page part of the binary in as the filesystem has - * been unmounted. - */ - if ((howto & RB_NOSYNC) == 0) - bootsync(howto); - - if_downall(); - - uvm_shutdown(); - splhigh(); - cold = 1; - - if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) - dumpsys(); - -haltsys: - config_suspend_all(DVACT_POWERDOWN); - - /* Make sure IRQ's are disabled */ - IRQdisable; - - if ((howto & RB_HALT) != 0) { -#if NAPM > 0 - if ((howto & RB_POWERDOWN) != 0) { - - printf("\nAttempting to power down...\n"); - delay(6000000); - zapm_poweroff(); - } -#endif - - printf("The operating system has halted.\n"); - printf("Please press any key to reboot.\n\n"); - cnpollc(1); - cngetc(); - cnpollc(0); - } - - printf("rebooting...\n"); - delay(6000000); -#if NAPM > 0 - zapm_restart(); -#endif - printf("reboot failed; spinning\n"); - for (;;) ; - /* NOTREACHED */ -} - -static __inline -pd_entry_t * -read_ttb(void) -{ - long ttb; - - __asm volatile("mrc p15, 0, %0, c2, c0, 0" : "=r" (ttb)); - - - return (pd_entry_t *)(ttb & ~((1<<14)-1)); -} - -/* - * Mapping table for core kernel memory. These areas are mapped in - * init time at fixed virtual address with section mappings. - */ -struct l1_sec_map { - vaddr_t va; - vaddr_t pa; - vsize_t size; - int flags; -} l1_sec_table[] = { - { - ZAURUS_GPIO_VBASE, - PXA2X0_GPIO_BASE, - PXA2X0_GPIO_SIZE, - PTE_NOCACHE, - }, - { - ZAURUS_CLKMAN_VBASE, - PXA2X0_CLKMAN_BASE, - PXA2X0_CLKMAN_SIZE, - PTE_NOCACHE, - }, - { - ZAURUS_INTCTL_VBASE, - PXA2X0_INTCTL_BASE, - PXA2X0_INTCTL_SIZE, - PTE_NOCACHE, - }, - { - ZAURUS_SCOOP0_VBASE, - C3000_SCOOP0_BASE, - SCOOP_SIZE, - PTE_NOCACHE, - }, - { - ZAURUS_SCOOP1_VBASE, - trunc_page(C3000_SCOOP1_BASE), - round_page(SCOOP_SIZE), - PTE_NOCACHE, - }, - {0, 0, 0, 0,} -}; - -static void -map_io_area(paddr_t pagedir) -{ - int loop; - - /* - * Map devices we can map w/ section mappings. - */ - loop = 0; - while (l1_sec_table[loop].size) { - vsize_t sz; - -#define VERBOSE_INIT_ARM -#ifdef VERBOSE_INIT_ARM - printf("%08lx -> %08lx @ %08lx\n", l1_sec_table[loop].pa, - l1_sec_table[loop].pa + l1_sec_table[loop].size - 1, - l1_sec_table[loop].va); -#endif - for (sz = 0; sz < l1_sec_table[loop].size; sz += L1_S_SIZE) - pmap_map_section(pagedir, l1_sec_table[loop].va + sz, - l1_sec_table[loop].pa + sz, - PROT_READ | PROT_WRITE, - l1_sec_table[loop].flags); - ++loop; - } -} - -/* - * simple memory mapping function used in early bootstrap stage - * before pmap is initialized. - * size and cacheability are ignored and map one section with nocache. - */ -static vaddr_t section_free = ZAURUS_VBASE_FREE; - -static int -bootstrap_bs_map(void *t, bus_addr_t bpa, bus_size_t size, - int flags, bus_space_handle_t *bshp) -{ - u_long startpa; - vaddr_t va; - pd_entry_t *pagedir = read_ttb(); - /* This assumes PA==VA for page directory */ - - va = section_free; - section_free += L1_S_SIZE; - - startpa = trunc_page(bpa); - pmap_map_section((vaddr_t)pagedir, va, startpa, - PROT_READ | PROT_WRITE, PTE_NOCACHE); - cpu_tlb_flushD(); - - *bshp = (bus_space_handle_t)(va + (bpa - startpa)); - - return(0); -} - -static void -copy_io_area_map(pd_entry_t *new_pd) -{ - pd_entry_t *cur_pd = read_ttb(); - vaddr_t va; - - for (va = ZAURUS_IO_AREA_VBASE; - (cur_pd[va>>L1_S_SHIFT] & L1_TYPE_MASK) == L1_TYPE_S; - va += L1_S_SIZE) { - - new_pd[va>>L1_S_SHIFT] = cur_pd[va>>L1_S_SHIFT]; - if (va == (0 - L1_S_SIZE)) - break; /* STUPID */ - - } -} - -/* XXX tidy up! */ -void green_on(int virt); -void -green_on(int virt) -{ - /* clobber green led p */ - volatile u_int16_t *p; - if (virt) - p = (u_int16_t *)(ZAURUS_SCOOP0_VBASE+SCOOP_GPWR); - else - p = (u_int16_t *)(C3000_SCOOP0_BASE+SCOOP_GPWR); - - *p = *p | (1<<SCOOP0_LED_GREEN); -} -void irda_on(int virt); -void -irda_on(int virt) -{ - /* clobber IrDA led p */ - volatile u_int16_t *p; - /* XXX scoop1 registers are not page-aligned! */ - int ofs = C3000_SCOOP1_BASE - trunc_page(C3000_SCOOP1_BASE); - - if (virt) - p = (u_int16_t *)(ZAURUS_SCOOP1_VBASE+ofs+SCOOP_GPWR); - else - p = (u_int16_t *)(C3000_SCOOP1_BASE+SCOOP_GPWR); - - *p = *p & ~(1<<SCOOP1_IR_ON); -} - -#if 0 -void sysprobe(void); -void -sysprobe(void) -{ - u_int32_t *p; - - p = (void *)0x48000014; /* MECR */ - printf("MECR %x\n", *p); - - p = (void *)0x48000028; /* MCMEM0 */ - printf("MCMEM0 %x\n", *p); - p = (void *)0x4800002C; /* MCMEM1 */ - printf("MCMEM1 %x\n", *p); - - p = (void *)0x48000030; /* MCATTx */ - printf("MCATT0 %x\n", *p); - p = (void *)0x48000034; /* MCATTx */ - printf("MCATT1 %x\n", *p); - - p = (void *)0x48000038; /* MCIOx */ - printf("MCIO0 %x\n", *p); - p = (void *)0x4800003C; /* MCIOx */ - printf("MCIO1 %x\n", *p); -} -#endif - -/* - * u_int initarm(...) - * - * Initial entry point on startup. This gets called before main() is - * entered. - * It should be responsible for setting up everything that must be - * in place when main is called. - * This includes - * Taking a copy of the boot configuration structure. - * Initialising the physical console so characters can be printed. - * Setting up page tables for the kernel - * Relocating the kernel to the bottom of physical memory - */ -u_int -initarm(void *arg0, void *arg1, void *arg2) -{ - extern vaddr_t xscale_cache_clean_addr; - extern cpu_kcore_hdr_t cpu_kcore_hdr; - int loop; - int loop1; - u_int l1pagetable; - pv_addr_t kernel_l1pt; - paddr_t memstart; - psize_t memsize; - extern u_int32_t esym; /* &_end if no symbols are loaded */ - -#if 0 - int led_data = 0; -#endif -#ifdef DIAGNOSTIC - extern vsize_t xscale_minidata_clean_size; /* used in KASSERT */ -#endif - /* early bus_space_map support */ - struct bus_space tmp_bs_tag; - int (*map_func_save)(void *, bus_addr_t, bus_size_t, int, - bus_space_handle_t *); - - -#if 0 - /* XXX */ - /* start 32.768KHz OSC */ - ioreg_write(PXA2X0_CLKMAN_BASE + 0x08, 2); -#endif - - /* - * Heads up ... Setup the CPU / MMU / TLB functions - */ - if (set_cpufuncs()) - panic("cpu not recognized!"); - - /* Get ready for splfoo() */ - pxa2x0_intr_bootstrap(PXA2X0_INTCTL_BASE); - -#if 0 - /* Calibrate the delay loop. */ -#endif - - /* - * Okay, RedBoot has provided us with the following memory map: - * - * Physical Address Range Description - * ----------------------- ---------------------------------- - * 0x00000000 - 0x01ffffff flash Memory (32MB) - * 0x04000000 - 0x05ffffff Application flash Memory (32MB) - * 0x08000000 - 0x080000ff I/O baseboard registers - * 0x0a000000 - 0x0a0fffff SRAM (1MB) - * 0x0c000000 - 0x0c0fffff Ethernet Controller - * 0x0e000000 - 0x0e0fffff Ethernet Controller (Attribute) - * 0x10000000 - 0x103fffff SA-1111 Companion Chip - * 0x14000000 - 0x17ffffff Expansion Card (64MB) - * 0x40000000 - 0x480fffff Processor Registers - * 0xa0000000 - 0xa3ffffff SDRAM Bank 0 (64MB) - * - * - * Virtual Address Range X C B Description - * ----------------------- - - - ---------------------------------- - * 0x00000000 - 0x00003fff N Y Y SDRAM - * 0x00004000 - 0x000fffff N Y N Boot ROM - * 0x00100000 - 0x01ffffff N N N Application Flash - * 0x04000000 - 0x05ffffff N N N Exp Application Flash - * 0x08000000 - 0x080fffff N N N I/O baseboard registers - * 0x0a000000 - 0x0a0fffff N N N SRAM - * 0x40000000 - 0x480fffff N N N Processor Registers - * 0xa0000000 - 0xa000ffff N Y N RedBoot SDRAM - * 0xa0017000 - 0xa3ffffff Y Y Y SDRAM - * 0xc0000000 - 0xcfffffff Y Y Y Cache Flush Region - * (done by this routine) - * 0xfd000000 - 0xfd0000ff N N N I/O baseboard registers - * 0xfd100000 - 0xfd2fffff N N N Processor Registers. - * 0xfd200000 - 0xfd2fffff N N N 0x10800000 registers - * - * The first level page table is at 0xa0004000. There are also - * 2 second-level tables at 0xa0008000 and 0xa0008400. - * - */ - - { - /* - * Tweak RedBoot's pagetable so that we can access to - * some registers at same VA before and after installing - * our page table. - */ - paddr_t ttb = (paddr_t)read_ttb(); - - map_io_area(ttb); - cpu_tlb_flushD(); - } - - /* - * Examine the boot args string for options we need to know about - * now. - */ - /* XXX should really be done after setting up the console, but we - * XXX need to parse the console selection flags right now. */ - process_kernel_args((char *)0xa0200000 - MAX_BOOT_STRING - 1); - - /* - * This test will work for now but has to be revised when support - * for other models is added. - */ - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) - zaurusmod = ZAURUS_C3000; - else - zaurusmod = ZAURUS_C860; - - /* setup GPIO for BTUART, in case bootloader doesn't take care of it */ - pxa2x0_gpio_bootstrap(ZAURUS_GPIO_VBASE); -#if 0 - pxa2x0_gpio_set_function(42, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(43, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(44, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(45, GPIO_ALT_FN_2_OUT); - - /* FFUART */ - pxa2x0_gpio_set_function(34, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(39, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(35, GPIO_ALT_FN_1_IN); - pxa2x0_gpio_set_function(40, GPIO_ALT_FN_2_OUT); - pxa2x0_gpio_set_function(41, GPIO_ALT_FN_2_OUT); - - /* STUART */ - pxa2x0_gpio_set_function(46, GPIO_ALT_FN_2_IN); - pxa2x0_gpio_set_function(47, GPIO_ALT_FN_1_OUT); -#endif - - /* tell com to drive STUART in slow infrared mode */ - comsiraddr = (bus_addr_t)PXA2X0_STUART_BASE; - -#if 1 - /* turn on clock to UART block. - XXX this should not be necessary, consinit() will do it */ - early_clkman(CKEN_FFUART | CKEN_BTUART | CKEN_STUART, 1); -#endif - - green_on(0); - - /* - * Temporarily replace bus_space_map() functions so that - * console devices can get mapped. - * - * Note that this relies upon the fact that both regular - * and a4x bus_space tags use the same map function. - */ - tmp_bs_tag = pxa2x0_bs_tag; - tmp_bs_tag.bs_map = bootstrap_bs_map; - map_func_save = pxa2x0_bs_tag.bs_map; - pxa2x0_a4x_bs_tag.bs_map = pxa2x0_bs_tag.bs_map = bootstrap_bs_map; - - /* setup a serial console for very early boot */ - consinit(); -#ifdef KGDB - kgdb_port_init(); -#endif - - /* Talk to the user */ - printf("\nOpenBSD/zaurus booting ...\n"); - - { - /* XXX - all Zaurus have this for now, fix memory sizing */ - memstart = 0xa0000000; - memsize = 0x04000000; /* 64MB */ - } - -#if 0 - { - volatile int *p; - char *membase; - char *memmax; - int chunksize = 0x02000000; - printf("probing memory"); - - membase = (char *)0xa0000000; - memmax = (char *)0xc0000000; - for (p = (int *)membase; - p < (int *)memmax; - p = (int *) (((char *)p) + chunksize)) { - printf ("cbase %p\n", p); - p[0] = 0x12345678; - p[1] = 0x12345678; - if ((p[0] != 0x12345678) || (p[1] != 0x12345678)) - break; - } - memsize = ((char *)p) - membase; - - printf("probing memory done found memsize %d\n", memsize); - } -#else -#endif - -#define DEBUG -#ifdef DEBUG - printf("initarm: Configuring system ...\n"); -#endif - - /* Fake bootconfig structure for the benefit of pmap.c */ - /* XXX must make the memory description h/w independant */ - bootconfig.dramblocks = 1; - bootconfig.dram[0].address = memstart; - bootconfig.dram[0].pages = memsize / PAGE_SIZE; - - /* - * Set up the variables that define the availablilty of - * physical memory. For now, we're going to set - * physical_freestart to 0xa0200000 (where the kernel - * was loaded), and allocate the memory we need downwards. - * If we get too close to the page tables that RedBoot - * set up, we will panic. We will update physical_freestart - * and physical_freeend later to reflect what pmap_bootstrap() - * wants to see. - * - * XXX pmap_bootstrap() needs an enema. - */ - physical_start = bootconfig.dram[0].address; - physical_end = physical_start + (bootconfig.dram[0].pages * PAGE_SIZE); - - physical_freestart = 0xa0009000UL; - physical_freeend = 0xa0200000UL; - - physmem = (physical_end - physical_start) / PAGE_SIZE; - -#ifdef DEBUG - /* Tell the user about the memory */ - printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem, - physical_start, physical_end - 1); -#endif - - /* - * Okay, the kernel starts 2MB in from the bottom of physical - * memory. We are going to allocate our bootstrap pages downwards - * from there. - * - * We need to allocate some fixed page tables to get the kernel - * going. We allocate one page directory and a number of page - * tables and store the physical addresses in the kernel_pt_table - * array. - * - * The kernel page directory must be on a 16K boundary. The page - * tables must be on 4K bounaries. What we do is allocate the - * page directory on the first 16K boundary that we encounter, and - * the page tables on 4K boundaries otherwise. Since we allocate - * at least 3 L2 page tables, we are guaranteed to encounter at - * least one 16K aligned region. - */ - -#ifdef VERBOSE_INIT_ARM - printf("Allocating page tables\n"); -#endif - - free_pages = (physical_freeend - physical_freestart) / PAGE_SIZE; - -#ifdef VERBOSE_INIT_ARM - printf("freestart = 0x%08lx, free_pages = %d (0x%08x)\n", - physical_freestart, free_pages, free_pages); -#endif - - /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_pa, (np)); \ - (var).pv_va = KERNEL_BASE + (var).pv_pa - physical_start; - -#define alloc_pages(var, np) \ - physical_freeend -= ((np) * PAGE_SIZE); \ - if (physical_freeend < physical_freestart) \ - panic("initarm: out of memory"); \ - (var) = physical_freeend; \ - free_pages -= (np); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - - loop1 = 0; - kernel_l1pt.pv_pa = 0; - for (loop = 0; loop <= NUM_KERNEL_PTS; ++loop) { - /* Are we 16KB aligned for an L1 ? */ - if (((physical_freeend - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) == 0 - && kernel_l1pt.pv_pa == 0) { - valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - } else { - valloc_pages(kernel_pt_table[loop1], - L2_TABLE_SIZE / PAGE_SIZE); - ++loop1; - } - } - - /* This should never be able to happen but better confirm that. */ - if (!kernel_l1pt.pv_pa || (kernel_l1pt.pv_pa & (L1_TABLE_SIZE-1)) != 0) - panic("initarm: Failed to align the kernel page directory"); - - /* - * Allocate a page for the system page mapped to V0x00000000 - * This page will just contain the system vectors and can be - * shared by all processes. - */ - alloc_pages(systempage.pv_pa, 1); - - /* Allocate stacks for all modes */ - valloc_pages(irqstack, IRQ_STACK_SIZE); - valloc_pages(abtstack, ABT_STACK_SIZE); - valloc_pages(undstack, UND_STACK_SIZE); - valloc_pages(kernelstack, UPAGES); - - /* Allocate enough pages for cleaning the Mini-Data cache. */ - KASSERT(xscale_minidata_clean_size <= PAGE_SIZE); - valloc_pages(minidataclean, 1); - -#ifdef VERBOSE_INIT_ARM - printf("IRQ stack: p0x%08lx v0x%08lx\n", irqstack.pv_pa, - irqstack.pv_va); - printf("ABT stack: p0x%08lx v0x%08lx\n", abtstack.pv_pa, - abtstack.pv_va); - printf("UND stack: p0x%08lx v0x%08lx\n", undstack.pv_pa, - undstack.pv_va); - printf("SVC stack: p0x%08lx v0x%08lx\n", kernelstack.pv_pa, - kernelstack.pv_va); -#endif - - /* - * XXX Defer this to later so that we can reclaim the memory - * XXX used by the RedBoot page tables. - */ - alloc_pages(msgbufphys, round_page(MSGBUFSIZE) / PAGE_SIZE); - - /* - * Ok we have allocated physical pages for the primary kernel - * page tables - */ - -#ifdef VERBOSE_INIT_ARM - printf("Creating L1 page table at 0x%08lx\n", kernel_l1pt.pv_pa); -#endif - - /* - * Now we start construction of the L1 page table - * We start by mapping the L2 page tables into the L1. - * This means that we can replace L1 mappings later on if necessary - */ - l1pagetable = kernel_l1pt.pv_pa; - - /* Map the L2 pages tables in the L1 page table */ - pmap_link_l2pt(l1pagetable, 0x00000000, - &kernel_pt_table[KERNEL_PT_SYS]); - - for (loop = 0; loop < KERNEL_PT_KERNEL_NUM; loop++) - pmap_link_l2pt(l1pagetable, KERNEL_BASE + loop * 0x00400000, - &kernel_pt_table[KERNEL_PT_KERNEL + loop]); - - for (loop = 0; loop < KERNEL_PT_VMDATA_NUM; loop++) - pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00400000, - &kernel_pt_table[KERNEL_PT_VMDATA + loop]); - - /* update the top of the kernel VM */ - pmap_curmaxkvaddr = - KERNEL_VM_BASE + (KERNEL_PT_VMDATA_NUM * 0x00400000); - -#ifdef VERBOSE_INIT_ARM - printf("Mapping kernel\n"); -#endif - - /* Now we fill in the L2 pagetable for the kernel static code/data - * and the symbol table. */ - { - extern char etext[]; - size_t textsize = (u_int32_t) etext - KERNEL_TEXT_BASE; - size_t totalsize = esym - KERNEL_TEXT_BASE; - u_int logical; - - textsize = (textsize + PGOFSET) & ~PGOFSET; - totalsize = (totalsize + PGOFSET) & ~PGOFSET; - - logical = 0x00200000; /* offset of kernel in RAM */ - - /* Update dump information */ - cpu_kcore_hdr.kernelbase = KERNEL_BASE; - cpu_kcore_hdr.kerneloffs = logical; - cpu_kcore_hdr.staticsize = totalsize; - - logical += pmap_map_chunk(l1pagetable, KERNEL_BASE + logical, - physical_start + logical, textsize, - PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, KERNEL_BASE + logical, - physical_start + logical, totalsize - textsize, - PROT_READ | PROT_WRITE, PTE_CACHE); - } - -#ifdef VERBOSE_INIT_ARM - printf("Constructing L2 page tables\n"); -#endif - - /* Map the stack pages */ - pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, - IRQ_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, abtstack.pv_va, abtstack.pv_pa, - ABT_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, undstack.pv_va, undstack.pv_pa, - UND_STACK_SIZE * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - pmap_map_chunk(l1pagetable, kernelstack.pv_va, kernelstack.pv_pa, - UPAGES * PAGE_SIZE, PROT_READ | PROT_WRITE, PTE_CACHE); - - pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, - L1_TABLE_SIZE, PROT_READ | PROT_WRITE, PTE_PAGETABLE); - - for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { - pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, - kernel_pt_table[loop].pv_pa, L2_TABLE_SIZE, - PROT_READ | PROT_WRITE, PTE_PAGETABLE); - } - - /* Map the Mini-Data cache clean area. */ - xscale_setup_minidata(l1pagetable, minidataclean.pv_va, - minidataclean.pv_pa); - - /* Map the vector page. */ -#if 1 - /* MULTI-ICE requires that page 0 is NC/NB so that it can download the - * cache-clean code there. */ - pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa, - PROT_READ | PROT_WRITE, PTE_NOCACHE); -#else - pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa, - PROT_READ | PROT_WRITE, PTE_CACHE); -#endif - - /* - * map integrated peripherals at same address in l1pagetable - * so that we can continue to use console. - */ - copy_io_area_map((pd_entry_t *)l1pagetable); - - /* - * Give the XScale global cache clean code an appropriately - * sized chunk of unmapped VA space starting at 0xff000000 - * (our device mappings end before this address). - */ - xscale_cache_clean_addr = 0xff000000U; - - /* - * Now we have the real page tables in place so we can switch to them. - * Once this is done we will be running with the REAL kernel page - * tables. - */ - - /* - * Update the physical_freestart/physical_freeend/free_pages - * variables. - */ - { - physical_freestart = physical_start + - (((esym + PGOFSET) & ~PGOFSET) - KERNEL_BASE); - physical_freeend = physical_end; - free_pages = - (physical_freeend - physical_freestart) / PAGE_SIZE; - } - - /* be a client to all domains */ - cpu_domains(0x55555555); - /* Switch tables */ -#ifdef VERBOSE_INIT_ARM - printf("freestart = 0x%08lx, free_pages = %d (0x%x)\n", - physical_freestart, free_pages, free_pages); - printf("switching to new L1 page table @%#lx...", kernel_l1pt.pv_pa); -#endif - - /* set new intc register address so that splfoo() doesn't - touch illegal address. */ - pxa2x0_intr_bootstrap(ZAURUS_INTCTL_VBASE); - - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); - setttb(kernel_l1pt.pv_pa); - cpu_tlb_flushID(); - cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)); - - /* - * Moved from cpu_startup() as data_abort_handler() references - * this during uvm init - */ - proc0paddr = (struct user *)kernelstack.pv_va; - proc0.p_addr = proc0paddr; - -#ifdef VERBOSE_INIT_ARM - printf("bootstrap done.\n"); -#endif - - arm32_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); - - /* - * Pages were allocated during the secondary bootstrap for the - * stacks for different CPU modes. - * We must now set the r13 registers in the different CPU modes to - * point to these stacks. - * Since the ARM stacks use STMFD etc. we must set r13 to the top end - * of the stack memory. - */ -#ifdef VERBOSE_INIT_ARM - printf("init subsystems: stacks "); -#endif - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - /* - * Well we should set a data abort handler. - * Once things get going this will change as we will need a proper - * handler. - * Until then we will use a handler that just panics but tells us - * why. - * Initialisation of the vectors will just panic on a data abort. - * This just fills in a slightly better one. - */ -#ifdef VERBOSE_INIT_ARM - printf("vectors "); -#endif - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; - - /* Initialise the undefined instruction handlers */ -#ifdef VERBOSE_INIT_ARM - printf("undefined "); -#endif - undefined_init(); - - /* Load memory into UVM. */ -#ifdef VERBOSE_INIT_ARM - printf("page "); -#endif - uvm_setpagesize(); /* initialize PAGE_SIZE-dependent variables */ - uvm_page_physload(atop(physical_freestart), atop(physical_freeend), - atop(physical_freestart), atop(physical_freeend), 0); - - /* Boot strap pmap telling it where the kernel page table is */ -#ifdef VERBOSE_INIT_ARM - printf("pmap "); -#endif - pmap_bootstrap((pd_entry_t *)kernel_l1pt.pv_va, KERNEL_VM_BASE, - KERNEL_VM_BASE + KERNEL_VM_SIZE); - - /* Update dump information */ - cpu_kcore_hdr.pmap_kernel_l1 = (u_int32_t)pmap_kernel()->pm_l1; - cpu_kcore_hdr.pmap_kernel_l2 = (u_int32_t)&(pmap_kernel()->pm_l2); - -#ifdef KGDB - if (boothowto & RB_KDB) { - kgdb_debug_init = 1; - kgdb_connect(1); - } -#endif - - /* - * Restore proper bus_space operation, now that pmap is initialized. - */ - pxa2x0_a4x_bs_tag.bs_map = pxa2x0_bs_tag.bs_map = map_func_save; - -#ifdef DDB - db_machine_init(); - - /* Firmware doesn't load symbols. */ - ddb_init(); - - if (boothowto & RB_KDB) - Debugger(); -#endif - - cpu_setup(); - - /* We return the new stack pointer address */ - return(kernelstack.pv_va + USPACE_SVC_STACK_TOP); -} - -const char *console = "glass"; - -void -process_kernel_args(char *args) -{ - char *cp = args; - - if (cp == NULL || *(int *)cp != BOOT_STRING_MAGIC) { - boothowto = RB_AUTOBOOT; - return; - } - - /* Eat the cookie */ - *(int *)cp = 0; - cp += sizeof(int); - - boothowto = 0; - - /* Make a local copy of the bootargs */ - strncpy(bootargs, cp, MAX_BOOT_STRING - sizeof(int)); - - cp = bootargs; - boot_file = bootargs; - - /* Skip the kernel image filename */ - while (*cp != ' ' && *cp != 0) - ++cp; - - if (*cp != 0) - *cp++ = 0; - - while (*cp == ' ') - ++cp; - - boot_args = cp; - - printf("bootfile: %s\n", boot_file); - printf("bootargs: %s\n", boot_args); - - /* Setup pointer to boot flags */ - while (*cp != '-') - if (*cp++ == '\0') - return; - - for (;*++cp;) { - int fl; - - fl = 0; - switch(*cp) { - case 'a': - fl |= RB_ASKNAME; - break; - case 'c': - fl |= RB_CONFIG; - break; - case 'd': - fl |= RB_KDB; - break; - case 's': - fl |= RB_SINGLE; - break; - /* XXX undocumented console switching flags */ - case '0': - console = "ffuart"; - break; - case '1': - console = "btuart"; - break; - case '2': - console = "stuart"; - break; - default: - printf("unknown option `%c'\n", *cp); - break; - } - boothowto |= fl; - } -} - -#ifdef KGDB -#ifndef KGDB_DEVNAME -#define KGDB_DEVNAME "ffuart" -#endif -const char kgdb_devname[] = KGDB_DEVNAME; - -#if (NCOM > 0) -#ifndef KGDB_DEVMODE -#define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ -#endif -int comkgdbmode = KGDB_DEVMODE; -#endif /* NCOM */ - -#endif /* KGDB */ - -void -consinit(void) -{ -#if NCOM > 0 - static int consinit_called = 0; - paddr_t paddr; - u_int cken = 0; - - if (consinit_called != 0) - return; - - consinit_called = 1; - -#ifdef KGDB - if (strcmp(kgdb_devname, console) == 0) { - /* port is reserved for kgdb */ - } else -#endif - if (strcmp(console, "ffuart") == 0) { - paddr = PXA2X0_FFUART_BASE; - cken = CKEN_FFUART; - } else if (strcmp(console, "btuart") == 0) { - paddr = PXA2X0_BTUART_BASE; - cken = CKEN_BTUART; - } else if (strcmp(console, "stuart") == 0) { - paddr = PXA2X0_STUART_BASE; - cken = CKEN_STUART; - irda_on(0); - } - if (cken != 0 && comcnattach(&pxa2x0_a4x_bs_tag, paddr, comcnspeed, - PXA2X0_COM_FREQ, comcnmode) == 0) { - early_clkman(cken, 1); - } -#endif /* NCOM */ -} - -#ifdef KGDB -void -kgdb_port_init(void) -{ -#if (NCOM > 0) && defined(COM_PXA2X0) - paddr_t paddr; - u_int cken; - - if (strcmp(kgdb_devname, "ffuart") == 0) { - paddr = PXA2X0_FFUART_BASE; - cken = CKEN_FFUART; - } else if (strcmp(kgdb_devname, "btuart") == 0) { - paddr = PXA2X0_BTUART_BASE; - cken = CKEN_BTUART; - } else if (strcmp(kgdb_devname, "stuart") == 0) { - paddr = PXA2X0_STUART_BASE; - cken = CKEN_STUART; - irda_on(0); - } else - return; - - if (com_kgdb_attach_pxa2x0(&pxa2x0_a4x_bs_tag, paddr, - kgdb_rate, PXA2X0_COM_FREQ, COM_TYPE_PXA2x0, comkgdbmode) == 0) { - early_clkman(cken, 1); - } -#endif -} -#endif - -/* same as pxa2x0_clkman, but before autoconf */ -void -early_clkman(u_int clk, int enable) -{ - u_int32_t rv; - - rv = ioreg_read(ZAURUS_CLKMAN_VBASE + CLKMAN_CKEN); - if (enable) - rv |= clk; - else - rv &= ~clk; - ioreg_write(ZAURUS_CLKMAN_VBASE + CLKMAN_CKEN, rv); -} - -int glass_console = 0; - -void -board_startup(void) -{ - extern int lcd_cnattach(void (*)(u_int, int)); - extern bus_addr_t comconsaddr; - -#if NWSDISPLAY > 0 - /* - * Try to attach the display console now that VM services - * are available. - */ - - if ((cputype & ~CPU_ID_XSCALE_COREREV_MASK) == CPU_ID_PXA27X) { - if (strcmp(console, "glass") == 0) { - printf("attempting to switch console to lcd screen\n"); - glass_console = 1; - } - if (glass_console == 1 && lcd_cnattach(early_clkman) == 0) { - /* - * Kill the existing serial console. - * XXX need to bus_space_unmap resources and disable - * clocks... - */ - comconsaddr = 0; - - /* - * Display the copyright notice again on the new console - */ - extern const char copyright[]; - printf("%s\n", copyright); - } - } -#endif - - if (boothowto & RB_CONFIG) { -#ifdef BOOT_CONFIG - user_config(); -#else - printf("kernel does not support -c; continuing..\n"); -#endif - } -} diff --git a/sys/arch/zaurus/zaurus/zaurus_start.S b/sys/arch/zaurus/zaurus/zaurus_start.S deleted file mode 100644 index 8727992471f..00000000000 --- a/sys/arch/zaurus/zaurus/zaurus_start.S +++ /dev/null @@ -1,178 +0,0 @@ -/* $OpenBSD: zaurus_start.S,v 1.4 2016/04/25 04:46:57 jsg Exp $ */ -/* $NetBSD: lubbock_start.S,v 1.1 2003/06/18 10:51:15 bsh Exp $ */ - -/* - * Copyright (c) 2002, 2003 Genetec Corporation. All rights reserved. - * Written by Hiroyuki Bessho for Genetec Corporation. - * - * 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 Genetec Corporation may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``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 GENETEC CORPORATION - * 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 <machine/asm.h> -#include <arm/sysreg.h> -#include <arm/armreg.h> -#include <arm/pte.h> - -#undef DOMAIN_CLIENT /* XXX */ -#include "assym.h" - -#ifndef SDRAM_START -#define SDRAM_START 0xa0000000 -#endif - -/* - * CPWAIT -- Canonical method to wait for CP15 update. - * NOTE: Clobbers the specified temp reg. - * copied from arm/arm/cpufunc_asm_xscale.S - * XXX: better be in a common header file. - */ -#define CPWAIT_BRANCH \ - sub pc, pc, #4 - -#define CPWAIT(tmp) \ - mrc CP15_TTBR0(tmp) /* arbitrary read of CP15 */ ;\ - mov tmp, tmp /* wait for it to complete */ ;\ - CPWAIT_BRANCH /* branch to next insn */ - -/* - * Kernel start routine for DBPXA250 (Lubbock) - * this code is excuted at the very first after the kernel is loaded - * by RedBoot. - */ - .text - - .global _C_LABEL(zaurus_start) -_C_LABEL(zaurus_start): - /* Are we running on ROM ? */ - cmp pc, #0x06000000 - bhi zaurus_start_ram - - /* move me to RAM - * XXX: we can use memcpy if it is PIC - */ - ldr r1, Lcopy_size - adr r0, _C_LABEL(zaurus_start) - add r1, r1, #3 - mov r1, r1, LSR #2 - mov r2, #SDRAM_START - add r2, r2, #0x00200000 - mov r4, r2 - -5: ldr r3,[r0],#4 - str r3,[r2],#4 - subs r1,r1,#1 - bhi 5b - - cmp pc, r5 - /* Jump to RAM */ - ldr r0, Lstart_off - - blo 1f - /* if we were running out of virtual mapped space, disable mmu */ - mov r2, #0 - mov r1, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr 15, 0, r1, c1, c0, 0 - mcrne 15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ - -1: - add pc, r4, r0 - -Lcopy_size: .word _edata-_C_LABEL(zaurus_start) -Lstart_off: .word zaurus_start_ram-_C_LABEL(zaurus_start) - -zaurus_start_ram: - /* - * Kernel is loaded in SDRAM (0xa0200000..), and is expected to run - * in VA 0xc0200000.. - */ - - mrc CP15_TTBR0(r0) /* get ttb prepared by redboot */ - adr r4, mmu_init_table2 - -#define BUILD_STARTUP_PAGETABLE -#ifdef BUILD_STARTUP_PAGETABLE - mrc CP15_SCTLR(r2) - mov r2, #0 - tst r2, #CPU_CONTROL_MMU_ENABLE /* we already have a page table? */ - bne 3f - - /* build page table from scratch */ - ldr r0, Lstartup_pagetable - adr r4, mmu_init_table - b 3f - -2: - str r3, [r0, r2] - add r2, r2, #4 - add r3, r3, #(L1_S_SIZE) - adds r1, r1, #-1 - bhi 2b -3: - ldmia r4!, {r1,r2,r3} /* # of sections, PA|attr, VA */ - cmp r1, #0 - bne 2b -#endif - - mcr CP15_TTBR0(r0) /* Set TTB */ - mcr CP15_TLBIALL(r0) /* Flush TLB */ - - /* Set the Domain Access register. Very important! */ - mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) - mcr CP15_DACR(r0) - - /* Enable MMU */ - mrc CP15_SCTLR(r0) - orr r0, r0, #CPU_CONTROL_MMU_ENABLE - mcr CP15_SCTLR(r0) - CPWAIT(r0) - - /* Jump to kernel code in TRUE VA */ - adr r0, Lstart - ldr pc, [r0] - -Lstart: - .word start - -#define MMU_INIT(va,pa,n_sec,attr) \ - .word n_sec ; \ - .word 4*((va)>>L1_S_SHIFT) ; \ - .word (pa)|(attr) ; - -#ifdef BUILD_STARTUP_PAGETABLE -#ifndef STARTUP_PAGETABLE_ADDR -#define STARTUP_PAGETABLE_ADDR 0xa0004000 -#endif -Lstartup_pagetable: .word STARTUP_PAGETABLE_ADDR -mmu_init_table: - /* fill all table VA==PA */ - MMU_INIT(0x00000000, 0x00000000, 1<<(32-L1_S_SHIFT), L1_TYPE_S|L1_S_AP(AP_KRW)) - /* map SDRAM VA==PA, WT cacheable */ - MMU_INIT(SDRAM_START, SDRAM_START, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#endif -mmu_init_table2: - /* map VA 0xc0000000..0xc3ffffff to PA 0xa0000000..0xa3ffffff */ - MMU_INIT(0xc0000000, SDRAM_START, 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) - - .word 0 /* end of table */ diff --git a/sys/dev/microcode/atmel/Makefile b/sys/dev/microcode/atmel/Makefile index 3288d05ee55..4d68d04536a 100644 --- a/sys/dev/microcode/atmel/Makefile +++ b/sys/dev/microcode/atmel/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.22 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.23 2016/09/03 13:37:44 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= atu-intersil-int atu-intersil-ext \ atu-rfmd-int atu-rfmd-ext \ diff --git a/sys/dev/microcode/kue/Makefile b/sys/dev/microcode/kue/Makefile index f4525e26531..7fe9c0e1bf9 100644 --- a/sys/dev/microcode/kue/Makefile +++ b/sys/dev/microcode/kue/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.15 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.16 2016/09/03 13:37:44 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= kue diff --git a/sys/dev/microcode/rum/Makefile b/sys/dev/microcode/rum/Makefile index 994274d4e27..377048b3765 100644 --- a/sys/dev/microcode/rum/Makefile +++ b/sys/dev/microcode/rum/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.15 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.16 2016/09/03 13:37:45 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= rum-rt2573 run-rt2870 run-rt3071 diff --git a/sys/dev/microcode/symbol/Makefile b/sys/dev/microcode/symbol/Makefile index 16bfb8fbe74..54b3109d2a3 100644 --- a/sys/dev/microcode/symbol/Makefile +++ b/sys/dev/microcode/symbol/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.12 2016/09/01 10:40:38 tedu Exp $ +# $OpenBSD: Makefile,v 1.13 2016/09/03 13:37:45 guenther Exp $ NOPROG= NOMAN= @@ -8,7 +8,7 @@ CC=${HOSTCC} .if (${MACHINE} == "i386") || (${MACHINE} == "amd64") || \ (${MACHINE} == "macppc") || \ (${MACHINE} == "sparc64") || (${MACHINE} == "hppa") || \ - (${MACHINE} == "sgi") || (${MACHINE} == "zaurus") + (${MACHINE} == "sgi") afterinstall: ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ diff --git a/sys/dev/microcode/tusb3410/Makefile b/sys/dev/microcode/tusb3410/Makefile index 9909aa2cd89..071e880d020 100644 --- a/sys/dev/microcode/tusb3410/Makefile +++ b/sys/dev/microcode/tusb3410/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.10 2016/09/03 13:37:45 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= tusb3410 diff --git a/sys/dev/microcode/udl/Makefile b/sys/dev/microcode/udl/Makefile index 67939419450..75787277e54 100644 --- a/sys/dev/microcode/udl/Makefile +++ b/sys/dev/microcode/udl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2016/09/03 13:37:45 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= udl_huffman diff --git a/sys/dev/microcode/zydas/Makefile b/sys/dev/microcode/zydas/Makefile index 7da7e298363..e6b129b86b3 100644 --- a/sys/dev/microcode/zydas/Makefile +++ b/sys/dev/microcode/zydas/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.15 2016/09/03 13:37:45 guenther Exp $ NOPROG= NOMAN= @@ -11,7 +11,7 @@ CC=${HOSTCC} ${MACHINE} == "hppa" || ${MACHINE} == "i386" || \ ${MACHINE} == "landisk" || ${MACHINE} == "loongson" || \ ${MACHINE} == "octeon" || ${MACHINE} == "sgi" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus") + ${MACHINE} == "sparc64") FIRM= zd1211 zd1211b diff --git a/sys/dev/usb/files.usb b/sys/dev/usb/files.usb index 4448282c06f..efa13748f09 100644 --- a/sys/dev/usb/files.usb +++ b/sys/dev/usb/files.usb @@ -1,4 +1,4 @@ -# $OpenBSD: files.usb,v 1.129 2016/06/27 11:42:47 jmatthew Exp $ +# $OpenBSD: files.usb,v 1.130 2016/09/03 13:37:45 guenther Exp $ # $NetBSD: files.usb,v 1.16 2000/02/14 20:29:54 augustss Exp $ # # Config file and device description for machine-independent USB code. @@ -10,7 +10,7 @@ attach usb at usbus file dev/usb/usb.c usb needs-flag file dev/usb/usbdi.c usb file dev/usb/usbdi_util.c usb -file dev/usb/usb_mem.c usb | usbf +file dev/usb/usb_mem.c usb file dev/usb/usb_subr.c usb file dev/usb/usb_quirks.c usb @@ -412,17 +412,6 @@ device umb: ifnet, ifmedia attach umb at uhub file dev/usb/if_umb.c umb -# USB logical device -device usbf {} -attach usbf at usbdev -file dev/usb/usbf.c usbf needs-flag -file dev/usb/usbf_subr.c usbf - -# Communication Device Class Ethernet function -device cdcef {} -attach cdcef at usbf -file dev/usb/if_cdcef.c cdcef - # Atheros AR5005UG/AR5005UX device uath: ether, ifnet, ifmedia, wlan, firmload attach uath at uhub diff --git a/sys/dev/usb/if_cdcef.c b/sys/dev/usb/if_cdcef.c deleted file mode 100644 index be6a73487e8..00000000000 --- a/sys/dev/usb/if_cdcef.c +++ /dev/null @@ -1,557 +0,0 @@ -/* $OpenBSD: if_cdcef.c,v 1.43 2016/04/13 11:03:37 mpi Exp $ */ - -/* - * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * USB Communication Device Class Ethernet Emulation Model function driver - * (counterpart of the host-side cdce(4) driver) - */ -#include <bpfilter.h> - - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/socket.h> -#include <sys/systm.h> -#include <sys/mbuf.h> -#include <sys/timeout.h> - -#include <net/if.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbf.h> -#include <dev/usb/usbcdc.h> - -#if NBPFILTER > 0 -#include <net/bpf.h> -#endif - -#include <netinet/in.h> -#include <netinet/if_ether.h> - - -#define CDCEF_VENDOR_ID 0x0001 -#define CDCEF_PRODUCT_ID 0x0001 -#define CDCEF_DEVICE_CODE 0x0100 -#define CDCEF_VENDOR_STRING "OpenBSD.org" -#define CDCEF_PRODUCT_STRING "CDC Ethernet Emulation" -#define CDCEF_SERIAL_STRING "1.00" - -#define CDCEF_BUFSZ 1600 - - -struct cdcef_softc { - struct usbf_function sc_dev; - struct usbf_config *sc_config; - struct usbf_interface *sc_iface; - struct usbf_endpoint *sc_ep_in; - struct usbf_endpoint *sc_ep_out; - struct usbf_pipe *sc_pipe_in; - struct usbf_pipe *sc_pipe_out; - struct usbf_xfer *sc_xfer_in; - struct usbf_xfer *sc_xfer_out; - void *sc_buffer_in; - void *sc_buffer_out; - - struct timeout start_to; - - struct mbuf *sc_xmit_mbuf; - - struct arpcom sc_arpcom; -#define GET_IFP(sc) (&(sc)->sc_arpcom.ac_if) - - int sc_rxeof_errors; - int sc_listening; -}; - -int cdcef_match(struct device *, void *, void *); -void cdcef_attach(struct device *, struct device *, void *); - -usbf_status cdcef_do_request(struct usbf_function *, - usb_device_request_t *, void **); - -void cdcef_start(struct ifnet *); - -void cdcef_txeof(struct usbf_xfer *, void *, - usbf_status); -void cdcef_rxeof(struct usbf_xfer *, void *, - usbf_status); -int cdcef_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -void cdcef_watchdog(struct ifnet *ifp); -void cdcef_init(struct cdcef_softc *); -void cdcef_stop(struct cdcef_softc *); -int cdcef_encap(struct cdcef_softc *sc, struct mbuf *m, int idx); -struct mbuf * cdcef_newbuf(void); -void cdcef_start_timeout (void *); - -struct cfattach cdcef_ca = { - sizeof(struct cdcef_softc), cdcef_match, cdcef_attach -}; - -struct cfdriver cdcef_cd = { - NULL, "cdcef", DV_IFNET -}; - -struct usbf_function_methods cdcef_methods = { - NULL, /* set_config */ - cdcef_do_request -}; - -#ifndef CDCEF_DEBUG -#define DPRINTF(x) do {} while (0) -#else -#define DPRINTF(x) printf x -#endif - -#define DEVNAME(sc) ((sc)->sc_dev.bdev.dv_xname) - -/* - * USB function match/attach/detach - */ - -int -cdcef_match(struct device *parent, void *match, void *aux) -{ - return UMATCH_GENERIC; -} - -void -cdcef_attach(struct device *parent, struct device *self, void *aux) -{ - struct cdcef_softc *sc = (struct cdcef_softc *)self; - struct usbf_attach_arg *uaa = aux; - struct usbf_device *dev = uaa->device; - struct ifnet *ifp = GET_IFP(sc); - usbf_status err; - struct usb_cdc_union_descriptor udesc; - int s; - - - /* Set the device identification according to the function. */ - usbf_devinfo_setup(dev, UDCLASS_IN_INTERFACE, 0, 0, CDCEF_VENDOR_ID, - CDCEF_PRODUCT_ID, CDCEF_DEVICE_CODE, CDCEF_VENDOR_STRING, - CDCEF_PRODUCT_STRING, CDCEF_SERIAL_STRING); - - /* Fill in the fields needed by the parent device. */ - sc->sc_dev.methods = &cdcef_methods; - - /* timeout to start delayed transfers */ - timeout_set(&sc->start_to, cdcef_start_timeout, sc); - - /* - * Build descriptors according to the device class specification. - */ - err = usbf_add_config(dev, &sc->sc_config); - if (err) { - printf(": usbf_add_config failed\n"); - return; - } - err = usbf_add_interface(sc->sc_config, UICLASS_CDC, - UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, 0, NULL, - &sc->sc_iface); - if (err) { - printf(": usbf_add_interface failed\n"); - return; - } - /* XXX don't use hard-coded values 128 and 16. */ - err = usbf_add_endpoint(sc->sc_iface, UE_DIR_IN | 2, UE_BULK, - 64, 16, &sc->sc_ep_in) || - usbf_add_endpoint(sc->sc_iface, UE_DIR_OUT | 1, UE_BULK, - 64, 16, &sc->sc_ep_out); - if (err) { - printf(": usbf_add_endpoint failed\n"); - return; - } - - /* Append a CDC union descriptor. */ - bzero(&udesc, sizeof udesc); - udesc.bLength = sizeof udesc; - udesc.bDescriptorType = UDESC_CS_INTERFACE; - udesc.bDescriptorSubtype = UDESCSUB_CDC_UNION; - udesc.bSlaveInterface[0] = usbf_interface_number(sc->sc_iface); - err = usbf_add_config_desc(sc->sc_config, - (usb_descriptor_t *)&udesc, NULL); - if (err) { - printf(": usbf_add_config_desc failed\n"); - return; - } - - /* - * Close the configuration and build permanent descriptors. - */ - err = usbf_end_config(sc->sc_config); - if (err) { - printf(": usbf_end_config failed\n"); - return; - } - - /* Preallocate xfers and data buffers. */ - sc->sc_xfer_in = usbf_alloc_xfer(dev); - sc->sc_xfer_out = usbf_alloc_xfer(dev); - sc->sc_buffer_in = usbf_alloc_buffer(sc->sc_xfer_in, - CDCEF_BUFSZ); - sc->sc_buffer_out = usbf_alloc_buffer(sc->sc_xfer_out, - CDCEF_BUFSZ); - if (sc->sc_buffer_in == NULL || sc->sc_buffer_out == NULL) { - printf(": usbf_alloc_buffer failed\n"); - return; - } - - /* Open the bulk pipes. */ - err = usbf_open_pipe(sc->sc_iface, - usbf_endpoint_address(sc->sc_ep_out), &sc->sc_pipe_out) || - usbf_open_pipe(sc->sc_iface, - usbf_endpoint_address(sc->sc_ep_in), &sc->sc_pipe_in); - if (err) { - printf(": usbf_open_pipe failed\n"); - return; - } - - /* Get ready to receive packets. */ - usbf_setup_xfer(sc->sc_xfer_out, sc->sc_pipe_out, sc, - sc->sc_buffer_out, CDCEF_BUFSZ, USBD_SHORT_XFER_OK, 0, cdcef_rxeof); - err = usbf_transfer(sc->sc_xfer_out); - if (err && err != USBF_IN_PROGRESS) { - printf(": usbf_transfer failed\n"); - return; - } - - s = splnet(); - - ether_fakeaddr(ifp); - printf(": address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr)); - - ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = cdcef_ioctl; - ifp->if_start = cdcef_start; - ifp->if_watchdog = cdcef_watchdog; - strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ); - - if_attach(ifp); - ether_ifattach(ifp); - - splx(s); -} - -usbf_status -cdcef_do_request(struct usbf_function *fun, usb_device_request_t *req, - void **data) -{ - printf("cdcef_do_request\n"); - return USBF_STALLED; -} - -void -cdcef_start(struct ifnet *ifp) -{ - struct cdcef_softc *sc = ifp->if_softc; - struct mbuf *m_head = NULL; - - if (ifq_is_oactive(&ifp->if_snd)) - return; - - m_head = ifq_deq_begin(&ifp->if_snd); - if (m_head == NULL) { - return; - } - - if (sc->sc_listening == 0 || m_head->m_pkthdr.len > CDCEF_BUFSZ) { - /* - * drop packet because receiver is not listening, - * or if packet is larger than xmit buffer - */ - ifq_deq_commit(&ifp->if_snd, m_head); - m_freem(m_head); - return; - } - - if (cdcef_encap(sc, m_head, 0)) { - ifq_deq_rollback(&ifp->if_snd, m_head); - ifq_set_oactive(&ifp->if_snd); - return; - } - - ifq_deq_commit(&ifp->if_snd, m_head); - -#if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m_head, BPF_DIRECTION_OUT); -#endif - - ifq_set_oactive(&ifp->if_snd); - - ifp->if_timer = 6; -} - -void -cdcef_txeof(struct usbf_xfer *xfer, void *priv, - usbf_status err) -{ - struct cdcef_softc *sc = priv; - struct ifnet *ifp = GET_IFP(sc); - int s; - - s = splnet(); -#if 0 - printf("cdcef_txeof: xfer=%p, priv=%p, %s\n", xfer, priv, - usbf_errstr(err)); -#endif - - ifp->if_timer = 0; - ifq_clr_oactive(&ifp->if_snd); - - if (sc->sc_xmit_mbuf != NULL) { - m_freem(sc->sc_xmit_mbuf); - sc->sc_xmit_mbuf = NULL; - } - - if (err) - ifp->if_oerrors++; - else - ifp->if_opackets++; - - if (IFQ_IS_EMPTY(&ifp->if_snd) == 0) - timeout_add(&sc->start_to, 1); /* XXX */ - - splx(s); -} -void -cdcef_start_timeout (void *v) -{ - struct cdcef_softc *sc = v; - struct ifnet *ifp = GET_IFP(sc); - int s; - - s = splnet(); - cdcef_start(ifp); - splx(s); -} - - -void -cdcef_rxeof(struct usbf_xfer *xfer, void *priv, - usbf_status status) -{ - struct cdcef_softc *sc = priv; - int total_len = 0; - struct ifnet *ifp = GET_IFP(sc); - struct mbuf_list ml = MBUF_LIST_INITIALIZER(); - struct mbuf *m = NULL; - - - int s; - -#if 0 - printf("cdcef_rxeof: xfer=%p, priv=%p, %s\n", xfer, priv, - usbf_errstr(status)); -#endif - - if (status != USBF_NORMAL_COMPLETION) { - if (status == USBF_NOT_STARTED || status == USBF_CANCELLED) - return; - if (sc->sc_rxeof_errors == 0) - printf("%s: usb error on rx: %s\n", - DEVNAME(sc), usbf_errstr(status)); - /* XXX - no stalls on client */ - if (sc->sc_rxeof_errors++ > 10) { - printf("%s: too many errors, disabling\n", - DEVNAME(sc)); - } - goto done; - } - sc->sc_rxeof_errors = 0; - - /* upon first incoming packet we know the host is listening */ - if (sc->sc_listening == 0) { - sc->sc_listening = 1; - } - - - usbf_get_xfer_status(xfer, NULL, NULL, &total_len, NULL); - - /* total_len -= 4; Strip off CRC added for Zaurus - XXX*/ - if (total_len <= 1) - goto done; - - if (total_len < sizeof(struct ether_header)) { - ifp->if_ierrors++; - goto done; - } - - if (ifp->if_flags & IFF_RUNNING) { - m = cdcef_newbuf(); - if (m == NULL) { - /* message? */ - ifp->if_ierrors++; - goto done; - } - - m->m_pkthdr.len = m->m_len = total_len; - bcopy(sc->sc_buffer_out, mtod(m, char *), total_len); - - ml_enqueue(&ml, m); - } - - s = splnet(); - if_input(ifp, &ml); - splx(s); -done: - /* Setup another xfer. */ - usbf_setup_xfer(xfer, sc->sc_pipe_out, sc, sc->sc_buffer_out, - CDCEF_BUFSZ, USBD_SHORT_XFER_OK, 0, cdcef_rxeof); - - status = usbf_transfer(xfer); - if (status && status != USBF_IN_PROGRESS) { - printf("%s: usbf_transfer failed\n", DEVNAME(sc)); - return; - } -} - -struct mbuf * -cdcef_newbuf(void) -{ - struct mbuf *m; - - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) - return (NULL); - - MCLGET(m, M_DONTWAIT); - if (!(m->m_flags & M_EXT)) { - m_freem(m); - return (NULL); - } - - m->m_len = m->m_pkthdr.len = MCLBYTES; - m_adj(m, ETHER_ALIGN); - - return (m); -} - -int -cdcef_ioctl(struct ifnet *ifp, u_long command, caddr_t data) -{ - struct cdcef_softc *sc = ifp->if_softc; - int s, error = 0; - - s = splnet(); - - switch (command) { - case SIOCSIFADDR: - ifp->if_flags |= IFF_UP; - if (!(ifp->if_flags & IFF_RUNNING)) - cdcef_init(sc); - break; - - case SIOCSIFFLAGS: - if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) - error = ENETRESET; - else - cdcef_init(sc); - } else { - if (ifp->if_flags & IFF_RUNNING) - cdcef_stop(sc); - } - break; - - default: - error = ether_ioctl(ifp, &sc->sc_arpcom, command, data); - } - - if (error == ENETRESET) - error = 0; - - splx(s); - return (error); -} - -void -cdcef_watchdog(struct ifnet *ifp) -{ - struct cdcef_softc *sc = ifp->if_softc; - int s; - - ifp->if_oerrors++; - printf("%s: watchdog timeout\n", DEVNAME(sc)); - - s = splusb(); - ifp->if_timer = 0; - ifq_clr_oactive(&ifp->if_snd); - - /* cancel receive pipe? */ - usbf_abort_pipe(sc->sc_pipe_in); /* in is tx pipe */ - splx(s); -} - -void -cdcef_init(struct cdcef_softc *sc) -{ - struct ifnet *ifp = GET_IFP(sc); - int s; - - s = splnet(); - - ifp->if_flags |= IFF_RUNNING; - ifq_clr_oactive(&ifp->if_snd); - - splx(s); -} - -int -cdcef_encap(struct cdcef_softc *sc, struct mbuf *m, int idx) -{ - usbf_status err; - - m_copydata(m, 0, m->m_pkthdr.len, sc->sc_buffer_in); - /* NO CRC */ - - usbf_setup_xfer(sc->sc_xfer_in, sc->sc_pipe_in, sc, sc->sc_buffer_in, - m->m_pkthdr.len, USBD_FORCE_SHORT_XFER | USBD_NO_COPY, - 10000, cdcef_txeof); - - err = usbf_transfer(sc->sc_xfer_in); - if (err && err != USBD_IN_PROGRESS) { - printf("encap error\n"); - cdcef_stop(sc); - return (EIO); - } - sc->sc_xmit_mbuf = m; - - return (0); -} - - -void -cdcef_stop(struct cdcef_softc *sc) -{ - struct ifnet *ifp = GET_IFP(sc); - - ifp->if_timer = 0; - ifp->if_flags &= ~IFF_RUNNING; - ifq_clr_oactive(&ifp->if_snd); - - /* cancel receive pipe? */ - - if (sc->sc_xmit_mbuf != NULL) { - m_freem(sc->sc_xmit_mbuf); - sc->sc_xmit_mbuf = NULL; - } -} diff --git a/sys/dev/usb/usbf.c b/sys/dev/usb/usbf.c deleted file mode 100644 index 75099d48965..00000000000 --- a/sys/dev/usb/usbf.c +++ /dev/null @@ -1,708 +0,0 @@ -/* $OpenBSD: usbf.c,v 1.16 2013/11/18 20:21:51 deraadt Exp $ */ - -/* - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * USB 2.0 logical device driver - * - * Specification non-comformities: - * - * - not all Standard Device Requests are supported (see 9.4) - * - USB 2.0 devices (device_descriptor.bcdUSB >= 0x0200) must support - * the other_speed requests but we do not - * - * Missing functionality: - * - * - isochronous pipes/transfers - * - clever, automatic endpoint address assignment to make optimal use - * of available hardware endpoints - * - alternate settings for interfaces are unsupported - */ - -/* - * The source code below is marked an can be split into a number of pieces - * (in that order): - * - * - USB logical device match/attach/detach - * - USB device tasks - * - Bus event handling - * - Device request handling - * - * Stylistic issues: - * - * - "endpoint number" and "endpoint address" are sometimes confused in - * this source code, OTOH the endpoint number is just the address, aside - * from the direction bit that is added to the number to form a unique - * endpoint address - */ - -#include <sys/param.h> -#include <sys/device.h> -#include <sys/kthread.h> -#include <sys/timeout.h> -#include <sys/malloc.h> -#include <sys/systm.h> - -#include <machine/bus.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbdivar.h> -#include <dev/usb/usbf.h> -#include <dev/usb/usbfvar.h> - -#ifndef USBF_DEBUG -#define DPRINTF(l, x) do {} while (0) -#else -int usbfdebug = 0; -#define DPRINTF(l, x) if ((l) <= usbfdebug) printf x; else {} -#endif - -struct usbf_softc { - struct device sc_dev; /* base device */ - struct usbf_bus *sc_bus; /* USB device controller */ - struct usbf_port sc_port; /* dummy port for function */ - struct proc *sc_proc; /* task thread */ - TAILQ_HEAD(,usbf_task) sc_tskq; /* task queue head */ - int sc_dying; - - u_int8_t *sc_hs_config; -}; - -#define DEVNAME(sc) ((sc)->sc_dev.dv_xname) - -int usbf_match(struct device *, void *, void *); -void usbf_attach(struct device *, struct device *, void *); -void usbf_create_thread(void *); -void usbf_task_thread(void *); - -usbf_status usbf_get_descriptor(struct usbf_device *, usb_device_request_t *, - void **); -void usbf_set_address(struct usbf_device *, u_int8_t); -usbf_status usbf_set_config(struct usbf_device *, u_int8_t); - -#ifdef USBF_DEBUG -void usbf_dump_request(struct usbf_device *, usb_device_request_t *); -#endif - -struct cfattach usbf_ca = { - sizeof(struct usbf_softc), usbf_match, usbf_attach -}; - -struct cfdriver usbf_cd = { - NULL, "usbf", DV_DULL -}; - -static const char * const usbrev_str[] = USBREV_STR; - -int -usbf_match(struct device *parent, void *match, void *aux) -{ - return UMATCH_GENERIC; -} - -void -usbf_attach(struct device *parent, struct device *self, void *aux) -{ - struct usbf_softc *sc = (struct usbf_softc *)self; - int usbrev; - int speed; - usbf_status err; - - /* Continue to set up the bus struct. */ - sc->sc_bus = aux; - sc->sc_bus->usbfctl = sc; - - usbrev = sc->sc_bus->usbrev; - printf(": USB revision %s", usbrev_str[usbrev]); - switch (usbrev) { - case USBREV_2_0: - speed = USB_SPEED_HIGH; - break; - case USBREV_1_1: - case USBREV_1_0: - speed = USB_SPEED_FULL; - break; - default: - printf(", not supported\n"); - sc->sc_dying = 1; - return; - } - printf("\n"); - - /* Initialize the usbf struct. */ - TAILQ_INIT(&sc->sc_tskq); - - /* Establish the software interrupt. */ - if (usbf_softintr_establish(sc->sc_bus)) { - printf("%s: can't establish softintr\n", DEVNAME(sc)); - sc->sc_dying = 1; - return; - } - - /* Attach the function driver. */ - err = usbf_new_device(self, sc->sc_bus, 0, speed, 0, &sc->sc_port); - if (err) { - printf("%s: usbf_new_device failed, %s\n", DEVNAME(sc), - usbf_errstr(err)); - sc->sc_dying = 1; - return; - } - - /* Create a process context for asynchronous tasks. */ - config_pending_incr(); - kthread_create_deferred(usbf_create_thread, sc); -} - -/* - * USB device tasks - */ - -/* - * Add a task to be performed by the task thread. This function can be - * called from any context and the task function will be executed in a - * process context ASAP. - */ -void -usbf_add_task(struct usbf_device *dev, struct usbf_task *task) -{ - struct usbf_softc *sc = dev->bus->usbfctl; - int s; - - s = splusb(); - if (!task->onqueue) { - DPRINTF(1,("usbf_add_task: task=%p, proc=%s\n", - task, sc->sc_bus->intr_context ? "(null)" : - curproc->p_comm)); - TAILQ_INSERT_TAIL(&sc->sc_tskq, task, next); - task->onqueue = 1; - } else { - DPRINTF(0,("usbf_add_task: task=%p on q, proc=%s\n", - task, sc->sc_bus->intr_context ? "(null)" : - curproc->p_comm)); - } - wakeup(&sc->sc_tskq); - splx(s); -} - -void -usbf_rem_task(struct usbf_device *dev, struct usbf_task *task) -{ - struct usbf_softc *sc = dev->bus->usbfctl; - int s; - - s = splusb(); - if (task->onqueue) { - DPRINTF(1,("usbf_rem_task: task=%p\n", task)); - TAILQ_REMOVE(&sc->sc_tskq, task, next); - task->onqueue = 0; - - } else { - DPRINTF(0,("usbf_rem_task: task=%p not on q", task)); - } - splx(s); -} - -/* - * Called from the kernel proper when it can create threads. - */ -void -usbf_create_thread(void *arg) -{ - struct usbf_softc *sc = arg; - - if (kthread_create(usbf_task_thread, sc, &sc->sc_proc, - DEVNAME(sc)) != 0) { - printf("%s: can't create task thread\n", DEVNAME(sc)); - return; - } - config_pending_decr(); -} - -/* - * Process context for USB function tasks. - */ -void -usbf_task_thread(void *arg) -{ - struct usbf_softc *sc = arg; - struct usbf_task *task; - int s; - - DPRINTF(0,("usbf_task_thread: start (pid %d)\n", curproc->p_pid)); - - s = splusb(); - while (!sc->sc_dying) { - task = TAILQ_FIRST(&sc->sc_tskq); - if (task == NULL) { - tsleep(&sc->sc_tskq, PWAIT, "usbtsk", 0); - task = TAILQ_FIRST(&sc->sc_tskq); - } - DPRINTF(1,("usbf_task_thread: woke up task=%p\n", task)); - if (task != NULL) { - TAILQ_REMOVE(&sc->sc_tskq, task, next); - task->onqueue = 0; - splx(s); - task->fun(task->arg); - s = splusb(); - DPRINTF(1,("usbf_task_thread: done task=%p\n", task)); - } - } - splx(s); - - DPRINTF(0,("usbf_task_thread: exit\n")); - kthread_exit(0); -} - -/* - * Bus event handling - */ - -void -usbf_host_reset(struct usbf_bus *bus) -{ - struct usbf_device *dev = bus->usbfctl->sc_port.device; - - DPRINTF(0,("usbf_host_reset\n")); - - /* Change device state from any state backe to Default. */ - (void)usbf_set_config(dev, USB_UNCONFIG_NO); - dev->address = 0; -} - -/* - * Device request handling - */ - -usbf_status -usbf_get_descriptor(struct usbf_device *dev, usb_device_request_t *req, - void **data) -{ - u_int8_t type = UGETW(req->wValue) >> 8; - u_int8_t index = UGETW(req->wValue) & 0xff; - usb_device_descriptor_t *dd; - usb_config_descriptor_t *cd; - usb_string_descriptor_t *sd; - struct usbf_softc *sc; - - switch (type) { - case UDESC_DEVICE: - dd = usbf_device_descriptor(dev); - *data = dd; - USETW(req->wLength, MIN(UGETW(req->wLength), dd->bLength)); - return USBF_NORMAL_COMPLETION; - - case UDESC_DEVICE_QUALIFIER: { - static usb_device_qualifier_t dq; - - dd = usbf_device_descriptor(dev); - bzero(&dq, sizeof dq); - dq.bLength = USB_DEVICE_QUALIFIER_SIZE; - dq.bDescriptorType = UDESC_DEVICE_QUALIFIER; - USETW(dq.bcdUSB, 0x0200); - dq.bDeviceClass = dd->bDeviceClass; - dq.bDeviceSubClass = dd->bDeviceSubClass; - dq.bDeviceProtocol = dd->bDeviceProtocol; - dq.bMaxPacketSize0 = dd->bMaxPacketSize; - dq.bNumConfigurations = dd->bNumConfigurations; - *data = &dq; - USETW(req->wLength, MIN(UGETW(req->wLength), dq.bLength)); - return USBF_NORMAL_COMPLETION; - } - - case UDESC_CONFIG: - cd = usbf_config_descriptor(dev, index); - if (cd == NULL) - return USBF_INVAL; - *data = cd; - USETW(req->wLength, MIN(UGETW(req->wLength), - UGETW(cd->wTotalLength))); - return USBF_NORMAL_COMPLETION; - - /* XXX */ - case UDESC_OTHER_SPEED_CONFIGURATION: - cd = usbf_config_descriptor(dev, index); - if (cd == NULL) - return USBF_INVAL; - sc = dev->bus->usbfctl; - if (sc->sc_hs_config == NULL) { - /* XXX should allocate more dynamically */ - sc->sc_hs_config = - (u_int8_t *)malloc(65536, M_USB, M_NOWAIT); - } - if (sc->sc_hs_config == NULL) - return USBF_INVAL; - bcopy(cd, sc->sc_hs_config, UGETW(cd->wTotalLength)); - *data = sc->sc_hs_config; - ((usb_config_descriptor_t *)sc->sc_hs_config)->bDescriptorType = - UDESC_OTHER_SPEED_CONFIGURATION; - USETW(req->wLength, MIN(UGETW(req->wLength), - UGETW(cd->wTotalLength))); - return USBF_NORMAL_COMPLETION; - - case UDESC_STRING: - sd = usbf_string_descriptor(dev, index); - if (sd == NULL) - return USBF_INVAL; - *data = sd; - USETW(req->wLength, MIN(UGETW(req->wLength), sd->bLength)); - return USBF_NORMAL_COMPLETION; - - default: - DPRINTF(0,("usbf_get_descriptor: unknown descriptor type=%u\n", - type)); - return USBF_INVAL; - } -} - -/* - * Change device state from Default to Address, or change the device address - * if the device is not currently in the Default state. - */ -void -usbf_set_address(struct usbf_device *dev, u_int8_t address) -{ - DPRINTF(0,("usbf_set_address: dev=%p, %u -> %u\n", dev, - dev->address, address)); - dev->address = address; -} - -/* - * If the device was in the Addressed state (dev->config == NULL) before, it - * will be in the Configured state upon successful return from this routine. - */ -usbf_status -usbf_set_config(struct usbf_device *dev, u_int8_t new) -{ - struct usbf_config *cfg = dev->config; - struct usbf_function *fun = dev->function; - usbf_status err = USBF_NORMAL_COMPLETION; - u_int8_t old = cfg ? cfg->uc_cdesc->bConfigurationValue : - USB_UNCONFIG_NO; - - if (old == new) - return USBF_NORMAL_COMPLETION; - - DPRINTF(0,("usbf_set_config: dev=%p, %u -> %u\n", dev, old, new)); - - /* - * Resetting the device state to Unconfigured must always succeed. - * This happens typically when the host resets the bus. - */ - if (new == USB_UNCONFIG_NO) { - if (dev->function->methods->set_config) - err = fun->methods->set_config(fun, NULL); - if (err) { - DPRINTF(0,("usbf_set_config: %s\n", usbf_errstr(err))); - } - dev->config = NULL; - return USBF_NORMAL_COMPLETION; - } - - /* - * Changing the device configuration may fail. The function - * may decline to set the new configuration. - */ - SIMPLEQ_FOREACH(cfg, &dev->configs, next) { - if (cfg->uc_cdesc->bConfigurationValue == new) { - if (dev->function->methods->set_config) - err = fun->methods->set_config(fun, cfg); - if (!err) - dev->config = cfg; - return err; - } - } - return USBF_INVAL; -} - -/* - * Handle device requests coming in via endpoint 0 pipe. - */ -void -usbf_do_request(struct usbf_xfer *xfer, void *priv, - usbf_status err) -{ - struct usbf_device *dev = xfer->pipe->device; - usb_device_request_t *req = xfer->buffer; - struct usbf_config *cfg; - void *data = NULL; - u_int16_t value; - u_int16_t index; - - if (err) { - DPRINTF(0,("usbf_do_request: receive failed, %s\n", - usbf_errstr(err))); - return; - } - -#ifdef USBF_DEBUG - if (usbfdebug >= 0) - usbf_dump_request(dev, req); -#endif - -#define C(x,y) ((x) | ((y) << 8)) - switch (C(req->bRequest, req->bmRequestType)) { - - case C(UR_SET_ADDRESS, UT_WRITE_DEVICE): - /* Change device state from Default to Address. */ - usbf_set_address(dev, UGETW(req->wValue)); - break; - - case C(UR_SET_CONFIG, UT_WRITE_DEVICE): - /* Change device state from Address to Configured. */ - printf("set config activated\n"); - err = usbf_set_config(dev, UGETW(req->wValue) & 0xff); - break; - - case C(UR_GET_CONFIG, UT_READ_DEVICE): - { /* XXX */ - if ((cfg = dev->config) == NULL) { - static u_int8_t zero = 0; - data = &zero; - } else - data = &cfg->uc_cdesc->bConfigurationValue; - USETW(req->wLength, MIN(UGETW(req->wLength), 1)); - } - break; - - case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE): - err = usbf_get_descriptor(dev, req, &data); - break; - - case C(UR_GET_STATUS, UT_READ_DEVICE): - DPRINTF(1,("usbf_do_request: UR_GET_STATUS %d\n", - UGETW(req->wLength))); - data = &dev->status; - USETW(req->wLength, MIN(UGETW(req->wLength), - sizeof dev->status)); - break; - - case C(UR_GET_STATUS, UT_READ_ENDPOINT): { - //u_int8_t addr = UGETW(req->wIndex) & 0xff; - static u_int16_t status = 0; - - data = &status; - USETW(req->wLength, MIN(UGETW(req->wLength), sizeof status)); - break; - } - - case C(UR_SET_FEATURE, UT_WRITE_ENDPOINT): - value = UGETW(req->wValue); - index = UGETW(req->wIndex); - if ((cfg = dev->config) == NULL) - err = USBF_STALLED; - else - err = usbf_set_endpoint_feature(cfg, index, value); - break; - - case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT): - value = UGETW(req->wValue); - index = UGETW(req->wIndex); - if ((cfg = dev->config) == NULL) - err = USBF_STALLED; - else - err = usbf_clear_endpoint_feature(cfg, index, value); - break; - - /* Alternate settings for interfaces are unsupported. */ - case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE): - if (UGETW(req->wValue) != 0) - err = USBF_STALLED; - break; - case C(UR_GET_INTERFACE, UT_READ_INTERFACE): { - static u_int8_t zero = 0; - data = &zero; - USETW(req->wLength, MIN(UGETW(req->wLength), 1)); - break; - } - - default: { - struct usbf_function *fun = dev->function; - - if (fun == NULL) - err = USBF_STALLED; - else - /* XXX change prototype for this method to remove - * XXX the data argument. */ - err = fun->methods->do_request(fun, req, &data); - } - } - - if (err) { - DPRINTF(0,("usbf_do_request: request=%#x, type=%#x " - "failed, %s\n", req->bRequest, req->bmRequestType, - usbf_errstr(err))); - usbf_stall_pipe(dev->default_pipe); - } else if (UGETW(req->wLength) > 0) { - if (data == NULL) { - DPRINTF(0,("usbf_do_request: no data, " - "sending ZLP\n")); - USETW(req->wLength, 0); - } - /* Transfer IN data in response to the request. */ - usbf_setup_xfer(dev->data_xfer, dev->default_pipe, - NULL, data, UGETW(req->wLength), 0, 0, NULL); - err = usbf_transfer(dev->data_xfer); - if (err && err != USBF_IN_PROGRESS) { - DPRINTF(0,("usbf_do_request: data xfer=%p, %s\n", - xfer, usbf_errstr(err))); - } - } - - /* Schedule another request transfer. */ - usbf_setup_default_xfer(dev->default_xfer, dev->default_pipe, - NULL, &dev->def_req, 0, 0, usbf_do_request); - err = usbf_transfer(dev->default_xfer); - if (err && err != USBF_IN_PROGRESS) { - DPRINTF(0,("usbf_do_request: ctrl xfer=%p, %s\n", xfer, - usbf_errstr(err))); - } -} - -#ifdef USBF_DEBUG -struct usb_enum_str { - int code; - const char * const str; -}; - -static const struct usb_enum_str usb_request_str[] = { - { UR_GET_STATUS, "GET STATUS" }, - { UR_CLEAR_FEATURE, "CLEAR FEATURE" }, - { UR_SET_FEATURE, "SET FEATURE" }, - { UR_SET_ADDRESS, "SET ADDRESS" }, - { UR_GET_DESCRIPTOR, "GET DESCRIPTOR" }, - { UR_SET_DESCRIPTOR, "SET DESCRIPTOR" }, - { UR_GET_CONFIG, "GET CONFIG" }, - { UR_SET_CONFIG, "SET CONFIG" }, - { UR_GET_INTERFACE, "GET INTERFACE" }, - { UR_SET_INTERFACE, "SET INTERFACE" }, - { UR_SYNCH_FRAME, "SYNCH FRAME" }, - { 0, NULL } -}; - -static const struct usb_enum_str usb_request_type_str[] = { - { UT_READ_DEVICE, "Read Device" }, - { UT_READ_INTERFACE, "Read Interface" }, - { UT_READ_ENDPOINT, "Read Endpoint" }, - { UT_WRITE_DEVICE, "Write Device" }, - { UT_WRITE_INTERFACE, "Write Interface" }, - { UT_WRITE_ENDPOINT, "Write Endpoint" }, - { UT_READ_CLASS_DEVICE, "Read Class Device" }, - { UT_READ_CLASS_INTERFACE, "Read Class Interface" }, - { UT_READ_CLASS_OTHER, "Read Class Other" }, - { UT_READ_CLASS_ENDPOINT, "Read Class Endpoint" }, - { UT_WRITE_CLASS_DEVICE, "Write Class Device" }, - { UT_WRITE_CLASS_INTERFACE, "Write Class Interface" }, - { UT_WRITE_CLASS_OTHER, "Write Class Other" }, - { UT_WRITE_CLASS_ENDPOINT, "Write Class Endpoint" }, - { UT_READ_VENDOR_DEVICE, "Read Vendor Device" }, - { UT_READ_VENDOR_INTERFACE, "Read Vendor Interface" }, - { UT_READ_VENDOR_OTHER, "Read Vendor Other" }, - { UT_READ_VENDOR_ENDPOINT, "Read Vendor Endpoint" }, - { UT_WRITE_VENDOR_DEVICE, "Write Vendor Device" }, - { UT_WRITE_VENDOR_INTERFACE, "Write Vendor Interface" }, - { UT_WRITE_VENDOR_OTHER, "Write Vendor Other" }, - { UT_WRITE_VENDOR_ENDPOINT, "Write Vendor Endpoint" }, - { 0, NULL } -}; - -static const struct usb_enum_str usb_request_desc_str[] = { - { UDESC_DEVICE, "Device" }, - { UDESC_CONFIG, "Configuration" }, - { UDESC_STRING, "String" }, - { UDESC_INTERFACE, "Interface" }, - { UDESC_ENDPOINT, "Endpoint" }, - { UDESC_DEVICE_QUALIFIER, "Device Qualifier" }, - { UDESC_OTHER_SPEED_CONFIGURATION, "Other Speed Configuration" }, - { UDESC_INTERFACE_POWER, "Interface Power" }, - { UDESC_OTG, "OTG" }, - { UDESC_CS_DEVICE, "Class-specific Device" }, - { UDESC_CS_CONFIG, "Class-specific Configuration" }, - { UDESC_CS_STRING, "Class-specific String" }, - { UDESC_CS_INTERFACE, "Class-specific Interface" }, - { UDESC_CS_ENDPOINT, "Class-specific Endpoint" }, - { UDESC_HUB, "Hub" }, - { 0, NULL } -}; - -static const char * -usb_enum_string(const struct usb_enum_str *tab, int code) -{ - static char buf[16]; - - while (tab->str != NULL) { - if (tab->code == code) - return tab->str; - tab++; - } - - (void)snprintf(buf, sizeof buf, "0x%02x", code); - return buf; -} - -static const char * -usbf_request_code_string(usb_device_request_t *req) -{ - static char buf[32]; - - (void)snprintf(buf, sizeof buf, "%s", - usb_enum_string(usb_request_str, req->bRequest)); - return buf; -} - -static const char * -usbf_request_type_string(usb_device_request_t *req) -{ - static char buf[32]; - - (void)snprintf(buf, sizeof buf, "%s", - usb_enum_string(usb_request_type_str, req->bmRequestType)); - return buf; -} - -static const char * -usbf_request_desc_string(usb_device_request_t *req) -{ - static char buf[32]; - u_int8_t type = UGETW(req->wValue) >> 8; - u_int8_t index = UGETW(req->wValue) & 0xff; - - (void)snprintf(buf, sizeof buf, "%s/%u", - usb_enum_string(usb_request_desc_str, type), index); - return buf; -} - -void -usbf_dump_request(struct usbf_device *dev, usb_device_request_t *req) -{ - struct usbf_softc *sc = dev->bus->usbfctl; - - printf("%s: %s request %s\n", - DEVNAME(sc), usbf_request_type_string(req), - usbf_request_code_string(req)); - - if (req->bRequest == UR_GET_DESCRIPTOR) - printf("%s: VALUE: 0x%04x (%s)\n", DEVNAME(sc), - UGETW(req->wValue), usbf_request_desc_string(req)); - else - printf("%s: VALUE: 0x%04x\n", DEVNAME(sc), - UGETW(req->wValue)); - - printf("%s: INDEX: 0x%04x\n", DEVNAME(sc), UGETW(req->wIndex)); - printf("%s: LENGTH: 0x%04x\n", DEVNAME(sc), UGETW(req->wLength)); -} -#endif diff --git a/sys/dev/usb/usbf.h b/sys/dev/usb/usbf.h deleted file mode 100644 index 23c4f8abc71..00000000000 --- a/sys/dev/usb/usbf.h +++ /dev/null @@ -1,170 +0,0 @@ -/* $OpenBSD: usbf.h,v 1.4 2013/04/15 09:23:02 mglocker Exp $ */ - -/* - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * USB function driver interface data structures and subroutines - */ - -#ifndef _USBF_H_ -#define _USBF_H_ - -struct usbf_function; -struct usbf_bus; -struct usbf_device; -struct usbf_config; -struct usbf_interface; -struct usbf_endpoint; -struct usbf_pipe; -struct usbf_xfer; - -/* - * Return codes for many of the function driver interface routines - */ -typedef enum { /* keep in sync with USBF_ERROR_STRS */ - USBF_NORMAL_COMPLETION = 0, /* must be 0 */ - USBF_IN_PROGRESS, /* 1 */ - /* errors */ - USBF_NOT_STARTED, /* 2 */ - USBF_INVAL, /* 3 */ - USBF_NOMEM, /* 4 */ - USBF_CANCELLED, /* 5 */ - USBF_BAD_ADDRESS, /* 6 */ - USBF_IOERROR, /* 7 */ - USBF_TIMEOUT, /* 8 */ - USBF_SHORT_XFER, /* 9 */ - USBF_STALLED, /* 10 */ - USBF_ERROR_MAX /* must be last */ -} usbf_status; -#define USBF_ERROR_STRS { /* keep in sync with enum usbf_status */ \ - "NORMAL_COMPLETION", /* 0 */ \ - "IN_PROGRESS", /* 1 */ \ - "NOT_STARTED", /* 2 */ \ - "INVAL", /* 3 */ \ - "NOMEM", /* 4 */ \ - "CANCELLED", /* 5 */ \ - "BAD_ADDRESS", /* 6 */ \ - "IOERROR", /* 7 */ \ - "TIMEOUT", /* 8 */ \ - "SHORT_XFER", /* 9 */ \ - "STALLED", /* 10 */ \ -}; - -typedef void (*usbf_callback)(struct usbf_xfer *, void *, usbf_status); - -/* - * Attach USB function at the logical device. - */ -struct usbf_attach_arg { - struct usbf_device *device; -}; - -struct usbf_function_methods { - usbf_status (*set_config)(struct usbf_function *, struct usbf_config *); - usbf_status (*do_request)(struct usbf_function *, - usb_device_request_t *req, void **data); -}; - -struct usbf_function { - struct device bdev; /* base device */ - /* filled in by function driver */ - struct usbf_function_methods *methods; -}; - -#define USBF_EMPTY_STRING_ID (USB_LANGUAGE_TABLE+1) -#define USBF_STRING_ID_MIN (USB_LANGUAGE_TABLE+2) -#define USBF_STRING_ID_MAX 255 - -/* - * USB function driver interface - */ - -/* global */ -const char *usbf_errstr(usbf_status); - -/* device */ -void usbf_devinfo_setup(struct usbf_device *, u_int8_t, u_int8_t, - u_int8_t, u_int16_t, u_int16_t, u_int16_t, const char *, - const char *, const char *); -char *usbf_devinfo_alloc(struct usbf_device *); -void usbf_devinfo_free(char *); -usb_device_descriptor_t *usbf_device_descriptor(struct usbf_device *); -usb_string_descriptor_t *usbf_string_descriptor(struct usbf_device *, u_int8_t); -usb_config_descriptor_t *usbf_config_descriptor(struct usbf_device *, u_int8_t); - -/* configuration */ -u_int8_t usbf_add_string(struct usbf_device *, const char *); -usbf_status usbf_add_config(struct usbf_device *, struct usbf_config **); -usbf_status usbf_add_config_desc(struct usbf_config *, usb_descriptor_t *, - usb_descriptor_t **); -usbf_status usbf_add_interface(struct usbf_config *, u_int8_t, u_int8_t, - u_int8_t, const char *, struct usbf_interface **); -usbf_status usbf_add_endpoint(struct usbf_interface *, u_int8_t, - u_int8_t, u_int16_t, u_int8_t, struct usbf_endpoint **); -usbf_status usbf_end_config(struct usbf_config *); -struct usbf_endpoint *usbf_config_endpoint(struct usbf_config *, u_int8_t); - -/* interface */ -int usbf_interface_number(struct usbf_interface *); -struct usbf_endpoint *usbf_iface_endpoint(struct usbf_interface *, u_int8_t); - -/* endpoint */ -u_int8_t usbf_endpoint_address(struct usbf_endpoint *); -u_int8_t usbf_endpoint_attributes(struct usbf_endpoint *); -#define usbf_endpoint_index(e) UE_GET_ADDR(usbf_endpoint_address((e))) -#define usbf_endpoint_dir(e) UE_GET_DIR(usbf_endpoint_address((e))) -#define usbf_endpoint_type(e) UE_GET_XFERTYPE(usbf_endpoint_attributes((e))) - -/* pipe */ -usbf_status usbf_open_pipe(struct usbf_interface *, u_int8_t, - struct usbf_pipe **); -void usbf_abort_pipe(struct usbf_pipe *); -void usbf_close_pipe(struct usbf_pipe *); -void usbf_stall_pipe(struct usbf_pipe *); - -/* transfer */ -struct usbf_xfer *usbf_alloc_xfer(struct usbf_device *); -void usbf_free_xfer(struct usbf_xfer *); -void *usbf_alloc_buffer(struct usbf_xfer *, u_int32_t); -void usbf_free_buffer(struct usbf_xfer *); -void usbf_setup_xfer(struct usbf_xfer *, struct usbf_pipe *, - void *, void *, u_int32_t, u_int16_t, - u_int32_t, usbf_callback); -void usbf_setup_default_xfer(struct usbf_xfer *, struct usbf_pipe *, - void *, usb_device_request_t *, u_int16_t, - u_int32_t, usbf_callback); -void usbf_get_xfer_status(struct usbf_xfer *, void **, - void **, u_int32_t *, usbf_status *); -usbf_status usbf_transfer(struct usbf_xfer *); - -/* - * The usbf_task structure describes a task to be perfomed in process - * context, i.e. the USB device's task thread. This is normally used by - * USB function drivers that need to perform tasks in a process context. - */ -struct usbf_task { - TAILQ_ENTRY(usbf_task) next; - void (*fun)(void *); - void *arg; - char onqueue; -}; - -void usbf_add_task(struct usbf_device *, struct usbf_task *); -void usbf_rem_task(struct usbf_device *, struct usbf_task *); -#define usbf_init_task(t, f, a) ((t)->fun=(f), (t)->arg=(a), (t)->onqueue=0) - -#endif diff --git a/sys/dev/usb/usbf_subr.c b/sys/dev/usb/usbf_subr.c deleted file mode 100644 index 9cbf2385f8a..00000000000 --- a/sys/dev/usb/usbf_subr.c +++ /dev/null @@ -1,1082 +0,0 @@ -/* $OpenBSD: usbf_subr.c,v 1.20 2014/08/10 11:18:57 mpi Exp $ */ - -/* - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * USB function driver interface subroutines - */ - -#include <sys/param.h> -#include <sys/malloc.h> -#include <sys/systm.h> -#include <sys/timeout.h> - -#include <machine/bus.h> - -#include <dev/usb/usb.h> -#include <dev/usb/usbdi.h> -#include <dev/usb/usbdivar.h> -#include <dev/usb/usb_mem.h> -#include <dev/usb/usbf.h> -#include <dev/usb/usbfvar.h> - -#ifndef USBF_DEBUG -#define DPRINTF(l, x) do {} while (0) -#else -extern int usbfdebug; -#define DPRINTF(l, x) if ((l) <= usbfdebug) printf x; else {} -#endif - -void *usbf_realloc(void **, size_t *, size_t); -size_t usbf_get_string(struct usbf_device *, u_int8_t, char *, size_t); -usbf_status usbf_open_pipe_ival(struct usbf_interface *, u_int8_t, - struct usbf_pipe **, int); -usbf_status usbf_setup_pipe(struct usbf_device *, struct usbf_interface *, - struct usbf_endpoint *, int, - struct usbf_pipe **); -void usbf_start_next(struct usbf_pipe *); -void usbf_set_endpoint_halt(struct usbf_endpoint *); -void usbf_clear_endpoint_halt(struct usbf_endpoint *); - -static const char * const usbf_error_strs[] = USBF_ERROR_STRS; - -const char * -usbf_errstr(usbf_status err) -{ - static char buffer[5]; - - if (err < USBF_ERROR_MAX) - return usbf_error_strs[err]; - - snprintf(buffer, sizeof buffer, "%d", err); - return buffer; -} - -void * -usbf_realloc(void **pp, size_t *sizep, size_t newsize) -{ - void *p; - size_t oldsize; - - if (newsize == 0) { - if (*sizep > 0) - free(*pp, M_USB, 0); - *pp = NULL; - *sizep = 0; - return NULL; - } - - p = malloc(newsize, M_USB, M_NOWAIT); - if (p == NULL) - return NULL; - - oldsize = MIN(*sizep, newsize); - if (oldsize > 0) - bcopy(*pp, p, oldsize); -#if 0 - /* XXX must leak for now; something unknown has a pointer */ - if (*pp != NULL) - free(*pp, M_USB, 0); -#endif - *pp = p; - *sizep = newsize; - return p; -} - -/* - * Attach a function driver. - */ -static usbf_status -usbf_probe_and_attach(struct device *parent, struct usbf_device *dev, int port) -{ - struct usbf_attach_arg uaa; - struct device *dv; - - KASSERT(dev->function == NULL); - - bzero(&uaa, sizeof uaa); - uaa.device = dev; - - /* - * The softc structure of a USB function driver must begin with a - * "struct usbf_function" member (instead of USBBASEDEV), which must - * be initialized in the function driver's attach routine. Also, it - * should use usbf_devinfo_setup() to set the device identification. - */ - dv = config_found_sm(parent, &uaa, NULL, NULL); - if (dv != NULL) { - dev->function = (struct usbf_function *)dv; - return USBF_NORMAL_COMPLETION; - } - - /* - * We failed to attach a function driver for this device, but the - * device can still function as a generic USB device without any - * interfaces. - */ - return USBF_NORMAL_COMPLETION; -} - -static void -usbf_remove_device(struct usbf_device *dev, struct usbf_port *up) -{ - KASSERT(dev != NULL && dev == up->device); - - if (dev->function != NULL) - config_detach((struct device *)dev->function, DETACH_FORCE); - if (dev->default_pipe != NULL) - usbf_close_pipe(dev->default_pipe); - up->device = NULL; - free(dev, M_USB, 0); -} - -usbf_status -usbf_new_device(struct device *parent, struct usbf_bus *bus, int depth, - int speed, int port, struct usbf_port *up) -{ - struct usbf_device *dev; - usb_device_descriptor_t *ud; - usbf_status err; - -#ifdef DIAGNOSTIC - KASSERT(up->device == NULL); -#endif - - dev = malloc(sizeof(*dev), M_USB, M_NOWAIT | M_ZERO); - if (dev == NULL) - return USBF_NOMEM; - - dev->bus = bus; - dev->string_id = USBF_STRING_ID_MIN; - SIMPLEQ_INIT(&dev->configs); - - /* Initialize device status. */ - USETW(dev->status.wStatus, UDS_SELF_POWERED); - - /* - * Initialize device descriptor. The function driver for this - * device (attached below) must complete the device descriptor. - */ - ud = &dev->ddesc; - ud->bLength = USB_DEVICE_DESCRIPTOR_SIZE; - ud->bDescriptorType = UDESC_DEVICE; - ud->bMaxPacketSize = bus->ep0_maxp; - if (bus->usbrev >= USBREV_2_0) - USETW(ud->bcdUSB, 0x0200); - else - USETW(ud->bcdUSB, 0x0101); - - /* Set up the default endpoint handle and descriptor. */ - dev->def_ep.edesc = &dev->def_ep_desc; - dev->def_ep_desc.bLength = USB_ENDPOINT_DESCRIPTOR_SIZE; - dev->def_ep_desc.bDescriptorType = UDESC_ENDPOINT; - dev->def_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT; - dev->def_ep_desc.bmAttributes = UE_CONTROL; - USETW(dev->def_ep_desc.wMaxPacketSize, ud->bMaxPacketSize); - dev->def_ep_desc.bInterval = 0; - - /* Establish the default pipe. */ - err = usbf_setup_pipe(dev, NULL, &dev->def_ep, 0, - &dev->default_pipe); - if (err) { - free(dev, M_USB, 0); - return err; - } - - /* Preallocate xfers for default pipe. */ - dev->default_xfer = usbf_alloc_xfer(dev); - dev->data_xfer = usbf_alloc_xfer(dev); - if (dev->default_xfer == NULL || dev->data_xfer == NULL) { - if (dev->default_xfer != NULL) - usbf_free_xfer(dev->default_xfer); - usbf_close_pipe(dev->default_pipe); - free(dev, M_USB, 0); - return USBF_NOMEM; - } - - /* Insert device request xfer. */ - usbf_setup_default_xfer(dev->default_xfer, dev->default_pipe, - NULL, &dev->def_req, 0, 0, usbf_do_request); - err = usbf_transfer(dev->default_xfer); - if (err && err != USBF_IN_PROGRESS) { - usbf_free_xfer(dev->default_xfer); - usbf_free_xfer(dev->data_xfer); - usbf_close_pipe(dev->default_pipe); - free(dev, M_USB, 0); - return err; - } - - /* Associate the upstream port with the device. */ - bzero(up, sizeof *up); - up->portno = port; - up->device = dev; - - /* Attach function driver. */ - err = usbf_probe_and_attach(parent, dev, port); - if (err) - usbf_remove_device(dev, up); - return err; -} - -/* - * Should be called by the function driver in its attach routine to change - * the default device identification according to the particular function. - */ -void -usbf_devinfo_setup(struct usbf_device *dev, u_int8_t devclass, - u_int8_t subclass, u_int8_t proto, u_int16_t vendor, u_int16_t product, - u_int16_t device, const char *manf, const char *prod, const char *ser) -{ - usb_device_descriptor_t *dd; - - dd = usbf_device_descriptor(dev); - dd->bDeviceClass = devclass; - dd->bDeviceSubClass = subclass; - dd->bDeviceProtocol = proto; - if (vendor != 0) - USETW(dd->idVendor, vendor); - if (product != 0) - USETW(dd->idProduct, product); - if (device != 0) - USETW(dd->bcdDevice, device); - if (manf != NULL) - dd->iManufacturer = usbf_add_string(dev, manf); - if (prod != NULL) - dd->iProduct = usbf_add_string(dev, prod); - if (ser != NULL) - dd->iSerialNumber = usbf_add_string(dev, ser); -} - -char * -usbf_devinfo_alloc(struct usbf_device *dev) -{ - char manf[40]; - char prod[40]; - usb_device_descriptor_t *dd; - size_t len; - char *devinfo; - - dd = usbf_device_descriptor(dev); - usbf_get_string(dev, dd->iManufacturer, manf, sizeof manf); - usbf_get_string(dev, dd->iProduct, prod, sizeof prod); - - len = strlen(manf) + strlen(prod) + 32; - devinfo = malloc(len, M_USB, M_NOWAIT); - if (devinfo == NULL) - return NULL; - - snprintf(devinfo, len, "%s %s, rev %d.%02d/%d.%02d", manf, prod, - (UGETW(dd->bcdUSB)>>8) & 0xff, UGETW(dd->bcdUSB) & 0xff, - (UGETW(dd->bcdDevice)>>8) & 0xff, UGETW(dd->bcdDevice) & 0xff); - return devinfo; -} - -void -usbf_devinfo_free(char *devinfo) -{ - if (devinfo != NULL) - free(devinfo, M_USB, 0); -} - -/* - * Add a string descriptor to a logical device and return the string's id. - * - * If there is not enough memory available for the new string descriptor, or - * if there is no unused string id left, return the id of the empty string - * instead of failing. - */ -u_int8_t -usbf_add_string(struct usbf_device *dev, const char *string) -{ - usb_string_descriptor_t *sd; - size_t oldsize; - size_t newsize; - size_t len, i; - u_int8_t id; - - if (string == NULL || *string == '\0' || - dev->string_id == USBF_STRING_ID_MAX) - return USBF_EMPTY_STRING_ID; - - if ((len = strlen(string)) >= USB_MAX_STRING_LEN) - len = USB_MAX_STRING_LEN - 1; - - oldsize = dev->sdesc_size; - newsize = oldsize + 2 + 2 * len; - - sd = usbf_realloc((void **)&dev->sdesc, &dev->sdesc_size, - newsize); - if (sd == NULL) - return USBF_EMPTY_STRING_ID; - - sd = (usb_string_descriptor_t *)((char *)sd + oldsize); - sd->bLength = newsize - oldsize; - sd->bDescriptorType = UDESC_STRING; - for (i = 0; string[i] != '\0' && i < len; i++) - USETW(sd->bString[i], string[i]); - - id = dev->string_id++; - return id; -} - -usb_string_descriptor_t * -usbf_string_descriptor(struct usbf_device *dev, u_int8_t id) -{ - static usb_string_descriptor_t sd0; - static usb_string_descriptor_t sd1; - usb_string_descriptor_t *sd; - - /* handle the special string ids */ - switch (id) { - case USB_LANGUAGE_TABLE: - sd0.bLength = 4; - sd0.bDescriptorType = UDESC_STRING; - USETW(sd0.bString[0], 0x0409 /* en_US */); - return &sd0; - - case USBF_EMPTY_STRING_ID: - sd1.bLength = 2; - sd1.bDescriptorType = UDESC_STRING; - return &sd0; - } - - /* check if the string id is valid */ - if (id > dev->string_id) - return NULL; - - /* seek and return the descriptor of a non-empty string */ - id -= USBF_STRING_ID_MIN; - sd = dev->sdesc; - while (id-- > 0) - sd = (usb_string_descriptor_t *)((char *)sd + sd->bLength); - return sd; -} - -size_t -usbf_get_string(struct usbf_device *dev, u_int8_t id, char *s, size_t size) -{ - usb_string_descriptor_t *sd = NULL; - size_t i, len; - - if (id != USB_LANGUAGE_TABLE) - sd = usbf_string_descriptor(dev, id); - - if (sd == NULL) { - if (size > 0) - *s = '\0'; - return 0; - } - - len = (sd->bLength - 2) / 2; - if (size < 1) - return len; - - for (i = 0; i < (size - 1) && i < len; i++) - s[i] = UGETW(sd->bString[i]) & 0xff; - s[i] = '\0'; - return len; -} - -/* - * Add a new device configuration to an existing USB logical device. - * The new configuration initially has zero interfaces. - */ -usbf_status -usbf_add_config(struct usbf_device *dev, struct usbf_config **ucp) -{ - struct usbf_config *uc; - usb_config_descriptor_t *cd; - - uc = malloc(sizeof *uc, M_USB, M_NOWAIT | M_ZERO); - if (uc == NULL) - return USBF_NOMEM; - - cd = malloc(sizeof *cd, M_USB, M_NOWAIT | M_ZERO); - if (cd == NULL) { - free(uc, M_USB, 0); - return USBF_NOMEM; - } - - uc->uc_device = dev; - uc->uc_cdesc = cd; - uc->uc_cdesc_size = sizeof *cd; - SIMPLEQ_INIT(&uc->iface_head); - - cd->bLength = USB_CONFIG_DESCRIPTOR_SIZE; - cd->bDescriptorType = UDESC_CONFIG; - USETW(cd->wTotalLength, USB_CONFIG_DESCRIPTOR_SIZE); - cd->bConfigurationValue = USB_UNCONFIG_NO + 1 + - dev->ddesc.bNumConfigurations; - cd->iConfiguration = 0; - cd->bmAttributes = UC_BUS_POWERED | UC_SELF_POWERED; -#if 0 - cd->bMaxPower = 100 / UC_POWER_FACTOR; /* 100 mA */ -#else - cd->bMaxPower = 0; /* XXX 0 mA */ -#endif - - SIMPLEQ_INSERT_TAIL(&dev->configs, uc, next); - dev->ddesc.bNumConfigurations++; - - if (ucp != NULL) - *ucp = uc; - return USBF_NORMAL_COMPLETION; -} - -/* - * Allocate memory for a new descriptor at the end of the existing - * device configuration descriptor. - */ -usbf_status -usbf_add_config_desc(struct usbf_config *uc, usb_descriptor_t *d, - usb_descriptor_t **dp) -{ - usb_config_descriptor_t *cd; - size_t oldsize; - size_t newsize; - - oldsize = uc->uc_cdesc_size; - newsize = oldsize + d->bLength; - if (d->bLength < sizeof(usb_descriptor_t) || newsize > 65535) - return USBF_INVAL; - - cd = usbf_realloc((void **)&uc->uc_cdesc, &uc->uc_cdesc_size, - newsize); - if (cd == NULL) - return USBF_NOMEM; - - bcopy(d, (char *)cd + oldsize, d->bLength); - USETW(cd->wTotalLength, newsize); - if (dp != NULL) - *dp = (usb_descriptor_t *)((char *)cd + oldsize); - return USBF_NORMAL_COMPLETION; -} - -usbf_status -usbf_add_interface(struct usbf_config *uc, u_int8_t bInterfaceClass, - u_int8_t bInterfaceSubClass, u_int8_t bInterfaceProtocol, - const char *string, struct usbf_interface **uip) -{ - struct usbf_interface *ui; - usb_interface_descriptor_t *id; - - if (uc->uc_closed) - return USBF_INVAL; - - ui = malloc(sizeof *ui, M_USB, M_NOWAIT | M_ZERO); - if (ui == NULL) - return USBF_NOMEM; - - id = malloc(sizeof *id, M_USB, M_NOWAIT | M_ZERO); - if (id == NULL) { - free(ui, M_USB, 0); - return USBF_NOMEM; - } - - ui->config = uc; - ui->idesc = id; - LIST_INIT(&ui->pipes); - SIMPLEQ_INIT(&ui->endpoint_head); - - id->bLength = USB_INTERFACE_DESCRIPTOR_SIZE; - id->bDescriptorType = UDESC_INTERFACE; - id->bInterfaceNumber = uc->uc_cdesc->bNumInterface; - id->bInterfaceClass = bInterfaceClass; - id->bInterfaceSubClass = bInterfaceSubClass; - id->bInterfaceProtocol = bInterfaceProtocol; - id->iInterface = 0; /*usbf_add_string(uc->uc_device, string);*/ /* XXX */ - - SIMPLEQ_INSERT_TAIL(&uc->iface_head, ui, next); - uc->uc_cdesc->bNumInterface++; - - *uip = ui; - return USBF_NORMAL_COMPLETION; -} - -usbf_status -usbf_add_endpoint(struct usbf_interface *ui, u_int8_t bEndpointAddress, - u_int8_t bmAttributes, u_int16_t wMaxPacketSize, u_int8_t bInterval, - struct usbf_endpoint **uep) -{ - struct usbf_endpoint *ue; - usb_endpoint_descriptor_t *ed; - - if (ui->config->uc_closed) - return USBF_INVAL; - - ue = malloc(sizeof *ue, M_USB, M_NOWAIT | M_ZERO); - if (ue == NULL) - return USBF_NOMEM; - - ed = malloc(sizeof *ed, M_USB, M_NOWAIT | M_ZERO); - if (ed == NULL) { - free(ue, M_USB, 0); - return USBF_NOMEM; - } - - ue->iface = ui; - ue->edesc = ed; - - ed->bLength = USB_ENDPOINT_DESCRIPTOR_SIZE; - ed->bDescriptorType = UDESC_ENDPOINT; - ed->bEndpointAddress = bEndpointAddress; - ed->bmAttributes = bmAttributes; - USETW(ed->wMaxPacketSize, wMaxPacketSize); - ed->bInterval = bInterval; - - SIMPLEQ_INSERT_TAIL(&ui->endpoint_head, ue, next); - ui->idesc->bNumEndpoints++; - - *uep = ue; - return USBF_NORMAL_COMPLETION; -} - -/* - * Close the configuration, thereby combining all descriptors and creating - * the real USB configuration descriptor that can be sent to the USB host. - */ -usbf_status -usbf_end_config(struct usbf_config *uc) -{ - struct usbf_interface *ui; - struct usbf_endpoint *ue; - usb_descriptor_t *d; - usbf_status err = USBF_NORMAL_COMPLETION; - - if (uc->uc_closed) - return USBF_INVAL; - - SIMPLEQ_FOREACH(ui, &uc->iface_head, next) { - err = usbf_add_config_desc(uc, - (usb_descriptor_t *)ui->idesc, &d); - if (err) - break; - - free(ui->idesc, M_USB, 0); - ui->idesc = (usb_interface_descriptor_t *)d; - - SIMPLEQ_FOREACH(ue, &ui->endpoint_head, next) { - err = usbf_add_config_desc(uc, - (usb_descriptor_t *)ue->edesc, &d); - if (err) - break; - - free(ue->edesc, M_USB, 0); - ue->edesc = (usb_endpoint_descriptor_t *)d; - } - } - - uc->uc_closed = 1; - return err; -} - -usb_device_descriptor_t * -usbf_device_descriptor(struct usbf_device *dev) -{ - return &dev->ddesc; -} - -usb_config_descriptor_t * -usbf_config_descriptor(struct usbf_device *dev, u_int8_t index) -{ - struct usbf_config *uc; - - SIMPLEQ_FOREACH(uc, &dev->configs, next) { - if (index-- == 0) - return uc->uc_cdesc; - } - return NULL; -} - -int -usbf_interface_number(struct usbf_interface *iface) -{ - return iface->idesc->bInterfaceNumber; -} - -u_int8_t -usbf_endpoint_address(struct usbf_endpoint *endpoint) -{ - return endpoint->edesc->bEndpointAddress; -} - -u_int8_t -usbf_endpoint_attributes(struct usbf_endpoint *endpoint) -{ - return endpoint->edesc->bmAttributes; -} - -usbf_status -usbf_open_pipe(struct usbf_interface *iface, u_int8_t address, - struct usbf_pipe **pipe) -{ - return usbf_open_pipe_ival(iface, address, pipe, 0); -} - -usbf_status -usbf_open_pipe_ival(struct usbf_interface *iface, u_int8_t address, - struct usbf_pipe **pipe, int ival) -{ - struct usbf_endpoint *ep; - struct usbf_pipe *p; - usbf_status err; - - ep = usbf_iface_endpoint(iface, address); - if (ep == NULL) - return USBF_BAD_ADDRESS; - - err = usbf_setup_pipe(iface->config->uc_device, iface, ep, - ival, &p); - if (err) - return err; - LIST_INSERT_HEAD(&iface->pipes, p, next); - *pipe = p; - return USBF_NORMAL_COMPLETION; -} - -usbf_status -usbf_setup_pipe(struct usbf_device *dev, struct usbf_interface *iface, - struct usbf_endpoint *ep, int ival, struct usbf_pipe **pipe) -{ - struct usbf_pipe *p; - usbf_status err; - - p = malloc(dev->bus->pipe_size, M_USB, M_NOWAIT); - if (p == NULL) - return USBF_NOMEM; - - p->device = dev; - p->iface = iface; - p->endpoint = ep; - ep->refcnt++; - p->running = 0; - p->refcnt = 1; - p->repeat = 0; - p->interval = ival; - p->methods = NULL; /* set by bus driver in open_pipe() */ - SIMPLEQ_INIT(&p->queue); - err = dev->bus->methods->open_pipe(p); - if (err) { - free(p, M_USB, 0); - return err; - } - *pipe = p; - return USBF_NORMAL_COMPLETION; -} - -/* Dequeue all pipe operations. */ -void -usbf_abort_pipe(struct usbf_pipe *pipe) -{ - struct usbf_xfer *xfer; - int s; - - s = splusb(); - pipe->repeat = 0; - pipe->aborting = 1; - - while ((xfer = SIMPLEQ_FIRST(&pipe->queue)) != NULL) { - DPRINTF(0,("usbf_abort_pipe: pipe=%p, xfer=%p\n", pipe, - xfer)); - /* Make the DC abort it (and invoke the callback). */ - pipe->methods->abort(xfer); - } - - pipe->aborting = 0; - splx(s); -} - -/* Abort all pipe operations and close the pipe. */ -void -usbf_close_pipe(struct usbf_pipe *pipe) -{ - usbf_abort_pipe(pipe); - pipe->methods->close(pipe); - pipe->endpoint->refcnt--; - free(pipe, M_USB, 0); -} - -void -usbf_stall_pipe(struct usbf_pipe *pipe) -{ - DPRINTF(0,("usbf_stall_pipe not implemented\n")); -} - -struct usbf_endpoint * -usbf_iface_endpoint(struct usbf_interface *iface, u_int8_t address) -{ - struct usbf_endpoint *ep; - - SIMPLEQ_FOREACH(ep, &iface->endpoint_head, next) { - if (ep->edesc->bEndpointAddress == address) - return ep; - } - return NULL; -} - -struct usbf_endpoint * -usbf_config_endpoint(struct usbf_config *cfg, u_int8_t address) -{ - struct usbf_interface *iface; - struct usbf_endpoint *ep; - - SIMPLEQ_FOREACH(iface, &cfg->iface_head, next) { - SIMPLEQ_FOREACH(ep, &iface->endpoint_head, next) { - if (ep->edesc->bEndpointAddress == address) - return ep; - } - } - return NULL; -} - -void -usbf_set_endpoint_halt(struct usbf_endpoint *endpoint) -{ -} - -void -usbf_clear_endpoint_halt(struct usbf_endpoint *endpoint) -{ -} - -usbf_status -usbf_set_endpoint_feature(struct usbf_config *cfg, u_int8_t address, - u_int16_t value) -{ - struct usbf_endpoint *ep; - - DPRINTF(0,("usbf_set_endpoint_feature: cfg=%p address=%#x" - " value=%#x\n", cfg, address, value)); - - ep = usbf_config_endpoint(cfg, address); - if (ep == NULL) - return USBF_BAD_ADDRESS; - - switch (value) { - case UF_ENDPOINT_HALT: - usbf_set_endpoint_halt(ep); - return USBF_NORMAL_COMPLETION; - default: - /* unsupported feature, send STALL in data/status phase */ - return USBF_STALLED; - } -} - -usbf_status -usbf_clear_endpoint_feature(struct usbf_config *cfg, u_int8_t address, - u_int16_t value) -{ - struct usbf_endpoint *ep; - - DPRINTF(0,("usbf_clear_endpoint_feature: cfg=%p address=%#x" - " value=%#x\n", cfg, address, value)); - - ep = usbf_config_endpoint(cfg, address); - if (ep == NULL) - return USBF_BAD_ADDRESS; - - switch (value) { - case UF_ENDPOINT_HALT: - usbf_clear_endpoint_halt(ep); - return USBF_NORMAL_COMPLETION; - default: - /* unsupported feature, send STALL in data/status phase */ - return USBF_STALLED; - } -} - -struct usbf_xfer * -usbf_alloc_xfer(struct usbf_device *dev) -{ - struct usbf_xfer *xfer; - - /* allocate zero-filled buffer */ - xfer = dev->bus->methods->allocx(dev->bus); - if (xfer == NULL) - return NULL; - xfer->device = dev; - timeout_set(&xfer->timeout_handle, NULL, NULL); - DPRINTF(1,("usbf_alloc_xfer() = %p\n", xfer)); - return xfer; -} - -void -usbf_free_xfer(struct usbf_xfer *xfer) -{ - DPRINTF(1,("usbf_free_xfer: %p\n", xfer)); - if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) - usbf_free_buffer(xfer); - xfer->device->bus->methods->freex(xfer->device->bus, xfer); -} - -usbf_status -usbf_allocmem(struct usbf_bus *bus, size_t size, size_t align, struct usb_dma *p) -{ - struct usbd_bus dbus; - usbd_status err; - - /* XXX bad idea, fix usb_mem.c instead! */ - dbus.dmatag = bus->dmatag; - err = usb_allocmem(&dbus, size, align, p); - return err ? USBF_NOMEM : USBF_NORMAL_COMPLETION; -} - -void -usbf_freemem(struct usbf_bus *bus, struct usb_dma *p) -{ - usb_freemem((struct usbd_bus *)NULL, p); -} - -void * -usbf_alloc_buffer(struct usbf_xfer *xfer, u_int32_t size) -{ - struct usbf_bus *bus = xfer->device->bus; - usbf_status err; - -#ifdef DIAGNOSTIC - if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) - printf("xfer %p already has a buffer\n", xfer); -#endif - - err = bus->methods->allocm(bus, &xfer->dmabuf, size); - if (err) - return NULL; - - xfer->rqflags |= URQ_DEV_DMABUF; - return KERNADDR(&xfer->dmabuf, 0); -} - -void -usbf_free_buffer(struct usbf_xfer *xfer) -{ -#ifdef DIAGNOSTIC - if (!(xfer->rqflags & URQ_DEV_DMABUF)) { - printf("usbf_free_buffer: no buffer\n"); - return; - } -#endif - xfer->rqflags &= ~URQ_DEV_DMABUF; - xfer->device->bus->methods->freem(xfer->device->bus, &xfer->dmabuf); -} - -#ifdef USBF_DEBUG -/* - * The dump format is similar to Linux' Gadget driver so that we can - * easily compare traces. - */ -static void -usbf_dump_buffer(struct usbf_xfer *xfer) -{ - struct device *dev = (struct device *)xfer->pipe->device->bus->usbfctl; - struct usbf_endpoint *ep = xfer->pipe->endpoint; - int index = usbf_endpoint_index(ep); - int dir = usbf_endpoint_dir(ep); - u_char *p = xfer->buffer; - u_int i; - - printf("%s: ep%d-%s, length=%u, %s", dev->dv_xname, index, - (xfer->rqflags & URQ_REQUEST) ? "setup" : - (index == 0 ? "in" : (dir == UE_DIR_IN ? "in" : "out")), - xfer->length, usbf_errstr(xfer->status)); - - for (i = 0; i < xfer->length; i++) { - if ((i % 16) == 0) - printf("\n%4x:", i); - else if ((i % 8) == 0) - printf(" "); - printf(" %02x", p[i]); - } - printf("\n"); -} -#endif - -void -usbf_setup_xfer(struct usbf_xfer *xfer, struct usbf_pipe *pipe, - void *priv, void *buffer, u_int32_t length, - u_int16_t flags, u_int32_t timeout, usbf_callback callback) -{ - xfer->pipe = pipe; - xfer->priv = priv; - xfer->buffer = buffer; - xfer->length = length; - xfer->actlen = 0; - xfer->flags = flags; - xfer->timeout = timeout; - xfer->status = USBF_NOT_STARTED; - xfer->callback = callback; - xfer->rqflags &= ~URQ_REQUEST; -} - -void -usbf_setup_default_xfer(struct usbf_xfer *xfer, struct usbf_pipe *pipe, - void *priv, usb_device_request_t *req, u_int16_t flags, - u_int32_t timeout, usbf_callback callback) -{ - xfer->pipe = pipe; - xfer->priv = priv; - xfer->buffer = req; - xfer->length = sizeof *req; - xfer->actlen = 0; - xfer->flags = flags; - xfer->timeout = timeout; - xfer->status = USBF_NOT_STARTED; - xfer->callback = callback; - xfer->rqflags |= URQ_REQUEST; -} - -void -usbf_get_xfer_status(struct usbf_xfer *xfer, void **priv, - void **buffer, u_int32_t *actlen, usbf_status *status) -{ - if (priv != NULL) - *priv = xfer->priv; - if (buffer != NULL) - *buffer = xfer->buffer; - if (actlen != NULL) - *actlen = xfer->actlen; - if (status != NULL) - *status = xfer->status; -} - -usbf_status -usbf_transfer(struct usbf_xfer *xfer) -{ - struct usbf_pipe *pipe = xfer->pipe; - usbf_status err; - - err = pipe->methods->transfer(xfer); - if (err != USBF_IN_PROGRESS && err) { - if (xfer->rqflags & URQ_AUTO_DMABUF) { - usbf_free_buffer(xfer); - xfer->rqflags &= ~URQ_AUTO_DMABUF; - } - } - return err; -} - -usbf_status -usbf_insert_transfer(struct usbf_xfer *xfer) -{ - struct usbf_pipe *pipe = xfer->pipe; - usbf_status err; - int s; - - DPRINTF(1,("usbf_insert_transfer: xfer=%p pipe=%p running=%d\n", - xfer, pipe, pipe->running)); - - s = splusb(); - SIMPLEQ_INSERT_TAIL(&pipe->queue, xfer, next); - if (pipe->running) - err = USBF_IN_PROGRESS; - else { - pipe->running = 1; - err = USBF_NORMAL_COMPLETION; - } - splx(s); - return err; -} - -void -usbf_start_next(struct usbf_pipe *pipe) -{ - struct usbf_xfer *xfer; - usbf_status err; - - SPLUSBCHECK; - - /* Get next request in queue. */ - xfer = SIMPLEQ_FIRST(&pipe->queue); - if (xfer == NULL) - pipe->running = 0; - else { - err = pipe->methods->start(xfer); - if (err != USBF_IN_PROGRESS) { - printf("usbf_start_next: %s\n", usbf_errstr(err)); - pipe->running = 0; - /* XXX do what? */ - } - } -} - -/* Called at splusb() */ -void -usbf_transfer_complete(struct usbf_xfer *xfer) -{ - struct usbf_pipe *pipe = xfer->pipe; - int repeat = pipe->repeat; - - SPLUSBCHECK; - DPRINTF(1,("usbf_transfer_complete: xfer=%p pipe=%p running=%d\n", - xfer, pipe, pipe->running)); -#ifdef USBF_DEBUG - if (usbfdebug > 0) - usbf_dump_buffer(xfer); -#endif - - if (!repeat) { - /* Remove request from queue. */ - KASSERT(SIMPLEQ_FIRST(&pipe->queue) == xfer); - SIMPLEQ_REMOVE_HEAD(&pipe->queue, next); - } - - if (xfer->status == USBF_NORMAL_COMPLETION && - xfer->actlen < xfer->length && - !(xfer->flags & USBD_SHORT_XFER_OK)) { - DPRINTF(0,("usbf_transfer_complete: short xfer=%p %u<%u\n", - xfer, xfer->actlen, xfer->length)); - xfer->status = USBF_SHORT_XFER; - } - - if (xfer->callback != NULL) - xfer->callback(xfer, xfer->priv, xfer->status); - - pipe->methods->done(xfer); - - if (xfer->flags & USBD_SYNCHRONOUS) - wakeup(xfer); - - if (!repeat) { - if (xfer->status != USBF_NORMAL_COMPLETION && - pipe->iface != NULL) /* not control pipe */ - pipe->running = 0; - else - usbf_start_next(pipe); - } -} - -/* - * Software interrupts - */ - -usbf_status -usbf_softintr_establish(struct usbf_bus *bus) -{ - KASSERT(bus->soft == NULL); - - bus->soft = softintr_establish(IPL_SOFTUSB, - bus->methods->soft_intr, bus); - if (bus->soft == NULL) - return USBF_INVAL; - - return USBF_NORMAL_COMPLETION; -} - -void -usbf_schedsoftintr(struct usbf_bus *bus) -{ - softintr_schedule(bus->soft); -} diff --git a/sys/dev/usb/usbfvar.h b/sys/dev/usb/usbfvar.h deleted file mode 100644 index 7fc72e3176e..00000000000 --- a/sys/dev/usb/usbfvar.h +++ /dev/null @@ -1,169 +0,0 @@ -/* $OpenBSD: usbfvar.h,v 1.8 2013/04/15 09:23:02 mglocker Exp $ */ - -/* - * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -/* - * USB function driver interface - * - * This file is to be included only by the logical device driver and the - * USB device controller (DC) driver. - */ - -/*** structures corresponding to USB protocol components ***/ - -struct usbf_endpoint { - struct usbf_interface *iface; - usb_endpoint_descriptor_t *edesc; - int halted; /* UF_ENDPOINT_HALT set */ - int refcnt; - SIMPLEQ_ENTRY(usbf_endpoint) next; -}; - -struct usbf_interface { - struct usbf_config *config; - usb_interface_descriptor_t *idesc; - LIST_HEAD(, usbf_pipe) pipes; - SIMPLEQ_HEAD(, usbf_endpoint) endpoint_head; - SIMPLEQ_ENTRY(usbf_interface) next; -}; - -struct usbf_config { - struct usbf_device *uc_device; - usb_config_descriptor_t *uc_cdesc; - size_t uc_cdesc_size; - int uc_closed; - SIMPLEQ_HEAD(, usbf_interface) iface_head; - SIMPLEQ_ENTRY(usbf_config) next; -}; - -struct usbf_device { - struct device bdev; /* base device */ - struct usbf_bus *bus; /* device controller */ - struct usbf_function *function; /* function driver */ - struct usbf_pipe *default_pipe; /* pipe 0 (device control) */ - struct usbf_xfer *default_xfer; /* device request xfer */ - struct usbf_xfer *data_xfer; /* request response xfer */ - int address; /* assigned by host (or 0) */ - struct usbf_config *config; /* set by host (or NULL) */ - usb_status_t status; /* device status */ - usb_device_request_t def_req; /* device request buffer */ - struct usbf_endpoint def_ep; /* for pipe 0 */ - usb_endpoint_descriptor_t def_ep_desc; /* for pipe 0 */ - usb_device_descriptor_t ddesc; /* device descriptor */ - usb_string_descriptor_t *sdesc; /* string descriptors */ - size_t sdesc_size; /* size of ud_sdesc */ - uByte string_id; /* next string id */ - SIMPLEQ_HEAD(, usbf_config) configs; -}; - -/*** software control structures ***/ - -struct usbf_pipe_methods { - usbf_status (*transfer)(struct usbf_xfer *); - usbf_status (*start)(struct usbf_xfer *); - void (*abort)(struct usbf_xfer *); - void (*done)(struct usbf_xfer *); - void (*close)(struct usbf_pipe *); -}; - -struct usbf_bus_methods { - usbf_status (*open_pipe)(struct usbf_pipe *); - void (*soft_intr)(void *); - usbf_status (*allocm)(struct usbf_bus *, struct usb_dma *, - u_int32_t); - void (*freem)(struct usbf_bus *, struct usb_dma *); - struct usbf_xfer *(*allocx)(struct usbf_bus *); - void (*freex)(struct usbf_bus *, struct usbf_xfer *); -}; - -struct usbf_softc; - -struct usbf_bus { - /* Filled by DC driver */ - struct device bdev; /* base device */ - struct usbf_bus_methods *methods; - size_t pipe_size; /* size of pipe struct */ - u_int8_t ep0_maxp; /* packet size for EP0 */ - int usbrev; /* as in struct usbd_bus */ - /* Filled by usbf driver */ - struct usbf_softc *usbfctl; - int intr_context; - void *soft; /* soft interrupt cookie */ - bus_dma_tag_t dmatag; /* DMA tag */ -}; - -struct usbf_port { - usb_port_status_t status; - u_int8_t portno; - struct usbf_device *device; /* connected function */ -}; - -struct usbf_pipe { - struct usbf_device *device; - struct usbf_interface *iface; /* unless default pipe */ - struct usbf_endpoint *endpoint; - int refcnt; - int running; - int aborting; - SIMPLEQ_HEAD(, usbf_xfer) queue; - LIST_ENTRY(usbf_pipe) next; - - char repeat; - int interval; - - /* Filled by DC driver. */ - struct usbf_pipe_methods *methods; -}; - -struct usbf_xfer { - struct usbf_pipe *pipe; - void *priv; - void *buffer; - u_int32_t length; - u_int32_t actlen; - u_int16_t flags; - u_int32_t timeout; - usbf_status status; - usbf_callback callback; - SIMPLEQ_ENTRY(usbf_xfer) next; - - /* for memory management */ - struct usbf_device *device; - int rqflags; - struct usb_dma dmabuf; - - struct timeout timeout_handle; -}; - - -/* usbf.c */ -void usbf_host_reset(struct usbf_bus *); -void usbf_do_request(struct usbf_xfer *, void *, usbf_status); - -/* usbf_subr.c */ -usbf_status usbf_new_device(struct device *, struct usbf_bus *, int, int, int, - struct usbf_port *); -usbf_status usbf_set_endpoint_feature(struct usbf_config *, u_int8_t, - u_int16_t); -usbf_status usbf_clear_endpoint_feature(struct usbf_config *, u_int8_t, - u_int16_t); -usbf_status usbf_insert_transfer(struct usbf_xfer *xfer); -void usbf_transfer_complete(struct usbf_xfer *xfer); -usbf_status usbf_allocmem(struct usbf_bus *, size_t, size_t, struct usb_dma *); -void usbf_freemem(struct usbf_bus *, struct usb_dma *); -usbf_status usbf_softintr_establish(struct usbf_bus *); -void usbf_schedsoftintr(struct usbf_bus *); diff --git a/sys/kern/Makefile b/sys/kern/Makefile index 66112e5ef1e..7b9ea74dead 100644 --- a/sys/kern/Makefile +++ b/sys/kern/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.46 2016/09/01 09:21:08 tedu Exp $ +# $OpenBSD: Makefile,v 1.47 2016/09/03 13:37:45 guenther Exp $ # Makefile for kernel tags files, init_sysent, etc. ARCH= alpha amd64 armv7 \ hppa i386 landisk loongson \ luna88k macppc octeon sgi socppc \ - sparc64 zaurus + sparc64 all: @echo "Doing nothing. Did you want make syscalls?" diff --git a/usr.bin/calendar/calendars/calendar.openbsd b/usr.bin/calendar/calendars/calendar.openbsd index 2823e23c43f..208b23bcca8 100644 --- a/usr.bin/calendar/calendars/calendar.openbsd +++ b/usr.bin/calendar/calendars/calendar.openbsd @@ -1,7 +1,7 @@ /* * OpenBSD-related dates to celebrate * - * $OpenBSD: calendar.openbsd,v 1.37 2016/03/11 20:20:26 jmc Exp $ + * $OpenBSD: calendar.openbsd,v 1.38 2016/09/03 13:37:45 guenther Exp $ */ #ifndef _calendar_openbsd_ @@ -80,6 +80,8 @@ Aug 16 IPX network stack added to OpenBSD, from FreeBSD, 1996 Aug 17 c2k1-2: Sparc64 hackathon, Washington D.C., 12 developers, 2001 Aug 17 OpenBSD/sparc64 port is added, from NetBSD, 2001 Aug 28 k2k6: IPSec hackathon, Schloss Kransberg, Germany, 14 developers, 2006 +Sep 01 Support for the sparc (32bit) architecture removed, 2016 +Sep 03 Support for the zaurus architecture removed, 2016 Sep 16 s2k11: General hackathon, Ljubljana, Slovenia, 25 developers, 2011 Sep 17 n2k12: Network hackathon, Starnberg, Germany, 23 developers, 2012 Sep 19 j2k10: Mini-hackathon, Sakae Mura, Nagano, Japan, 19 developers, 2010 diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 4a3e6607ac3..219eb0a2390 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.193 2016/08/31 22:24:44 florian Exp $ +# $OpenBSD: Makefile,v 1.194 2016/09/03 13:37:46 guenther Exp $ .include <bsd.own.mk> @@ -19,7 +19,7 @@ SUBDIR= ac accton acme-client acpidump adduser amd apm apmd arp \ snmpctl snmpd spamdb syslogc syslogd sysmerge tcpdrop tcpdump \ tftp-proxy tftpd tokenadm tokeninit traceroute trpt \ unbound usbdevs user vmd vmctl vipw watchdogd wsconscfg \ - wsfontload wsmoused zdump zic ztsscale + wsfontload wsmoused zdump zic .if (${YP:L} == "yes") SUBDIR+=ypbind ypldap yppoll ypset ypserv diff --git a/usr.sbin/apm/Makefile b/usr.sbin/apm/Makefile index 6abc167465b..88e6d996929 100644 --- a/usr.sbin/apm/Makefile +++ b/usr.sbin/apm/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.16 2016/09/01 09:59:40 deraadt Exp $ +# $OpenBSD: Makefile,v 1.17 2016/09/03 13:37:46 guenther Exp $ .if (${MACHINE} == "amd64") || (${MACHINE} == "i386") || \ (${MACHINE} == "loongson") || (${MACHINE} == "macppc") || \ - (${MACHINE} == "sparc64") || (${MACHINE} == "zaurus") + (${MACHINE} == "sparc64") SRCS= apm.c apmsubr.c @@ -18,6 +18,6 @@ NOPROG=yes .endif MAN= apm.8 -MANSUBDIR=amd64 i386 loongson macppc sparc64 zaurus +MANSUBDIR=amd64 i386 loongson macppc sparc64 .include <bsd.prog.mk> diff --git a/usr.sbin/apmd/Makefile b/usr.sbin/apmd/Makefile index c68f009dd2c..f5aa15cbad6 100644 --- a/usr.sbin/apmd/Makefile +++ b/usr.sbin/apmd/Makefile @@ -1,9 +1,8 @@ -# $OpenBSD: Makefile,v 1.12 2016/09/01 10:14:42 tedu Exp $ +# $OpenBSD: Makefile,v 1.13 2016/09/03 13:37:46 guenther Exp $ .if (${MACHINE} == "amd64") || (${MACHINE} == "i386") || \ (${MACHINE} == "loongson") || (${MACHINE} == "macppc") || \ - (${MACHINE} == "sparc64") || \ - (${MACHINE} == "zaurus") + (${MACHINE} == "sparc64") SRCS= apmd.c apmsubr.c @@ -13,6 +12,6 @@ NOPROG=yes .endif MAN= apmd.8 -MANSUBDIR=amd64 i386 loongson macppc sparc64 zaurus +MANSUBDIR=amd64 i386 loongson macppc sparc64 .include <bsd.prog.mk> diff --git a/usr.sbin/hotplugd/Makefile b/usr.sbin/hotplugd/Makefile index 718660209b8..33dac9a622c 100644 --- a/usr.sbin/hotplugd/Makefile +++ b/usr.sbin/hotplugd/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.18 2016/08/10 14:27:17 deraadt Exp $ +# $OpenBSD: Makefile,v 1.19 2016/09/03 13:37:46 guenther Exp $ .if ${MACHINE} == "alpha" || ${MACHINE} == "amd64" || \ ${MACHINE} == "armv7" || ${MACHINE} == "hppa" || \ ${MACHINE} == "i386" || ${MACHINE} == "landisk" || \ ${MACHINE} == "loongson" || ${MACHINE} == "macppc" || \ ${MACHINE} == "sgi" || ${MACHINE} == "socppc" || \ - ${MACHINE} == "sparc64" || ${MACHINE} == "zaurus" + ${MACHINE} == "sparc64" PROG= hotplugd SRCS= hotplugd.c diff --git a/usr.sbin/wsfontload/Makefile b/usr.sbin/wsfontload/Makefile index 30c3ac8e6c7..9e5c4d706ff 100644 --- a/usr.sbin/wsfontload/Makefile +++ b/usr.sbin/wsfontload/Makefile @@ -1,8 +1,7 @@ -# $OpenBSD: Makefile,v 1.14 2013/03/25 17:22:12 deraadt Exp $ +# $OpenBSD: Makefile,v 1.15 2016/09/03 13:37:46 guenther Exp $ .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" || \ - ${MACHINE} == "alpha" || ${MACHINE} == "hppa" || \ - ${MACHINE} == "zaurus" + ${MACHINE} == "alpha" || ${MACHINE} == "hppa" PROG= wsfontload SRCS= wsfontload.c diff --git a/usr.sbin/ztsscale/Makefile b/usr.sbin/ztsscale/Makefile deleted file mode 100644 index 06136fadfb6..00000000000 --- a/usr.sbin/ztsscale/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $OpenBSD: Makefile,v 1.4 2011/07/08 22:34:05 martynas Exp $ - -.if ${MACHINE} == "zaurus" -SRCS= ztsscale.c - -PROG= ztsscale -.else -NOPROG=yes -.endif - -MAN= ztsscale.8 -MANSUBDIR=zaurus - -.include <bsd.prog.mk> diff --git a/usr.sbin/ztsscale/message.xbm b/usr.sbin/ztsscale/message.xbm deleted file mode 100644 index 3e87c9d9a75..00000000000 --- a/usr.sbin/ztsscale/message.xbm +++ /dev/null @@ -1,136 +0,0 @@ -/* $OpenBSD: message.xbm,v 1.5 2005/04/28 17:01:40 uwe Exp $ */ - -/* This file is placed in the public domain. */ - -/* "TOUCH SCREEN CALIBRATION" */ -#define title_width 342 -#define title_height 14 -static unsigned char title_bits[] = { - 0xff, 0x0f, 0x7c, 0xf0, 0xf1, 0x81, 0x6f, 0x7e, 0x1f, 0x00, 0x00, 0xbe, - 0x01, 0xbf, 0xfc, 0x0f, 0xfe, 0x8f, 0xff, 0xe7, 0xe1, 0x03, 0x00, 0xc0, - 0x2f, 0xfe, 0x80, 0x7f, 0x80, 0xff, 0xf8, 0x1f, 0xfc, 0x07, 0xfe, 0xc0, - 0xff, 0xc7, 0xff, 0x80, 0x0f, 0x1e, 0x3e, 0xff, 0x0f, 0xfe, 0xf1, 0xf1, - 0xe1, 0x7f, 0x7e, 0x1f, 0x00, 0x00, 0xff, 0x81, 0xff, 0xfc, 0x3f, 0xfe, - 0x8f, 0xff, 0xe7, 0xe1, 0x03, 0x00, 0xe0, 0x3f, 0xfe, 0x80, 0x7f, 0x80, - 0xff, 0xf8, 0x7f, 0xfc, 0x1f, 0xfe, 0xc0, 0xff, 0xc7, 0xff, 0xc0, 0x3f, - 0x1e, 0x3e, 0x63, 0x8c, 0x83, 0x63, 0xc0, 0x70, 0x70, 0x18, 0x0c, 0x00, - 0xc0, 0xe1, 0xe1, 0xe1, 0x60, 0x38, 0x18, 0x0c, 0x06, 0xc7, 0x83, 0x01, - 0x00, 0x78, 0x38, 0xb0, 0x01, 0x0c, 0x00, 0x0c, 0xc0, 0xe0, 0x30, 0x38, - 0xb0, 0xc1, 0x39, 0x06, 0x0c, 0x70, 0x70, 0x3c, 0x18, 0x63, 0x8c, 0x01, - 0x63, 0xc0, 0x38, 0x60, 0x18, 0x0c, 0x00, 0xc0, 0xc1, 0x61, 0xc0, 0x60, - 0x70, 0x18, 0x0c, 0x06, 0xc7, 0x83, 0x01, 0x00, 0x18, 0x30, 0xb0, 0x01, - 0x0c, 0x00, 0x0c, 0xc0, 0xc0, 0x30, 0x30, 0xb0, 0xc1, 0x39, 0x06, 0x0c, - 0x30, 0x60, 0x3c, 0x18, 0x63, 0xcc, 0x01, 0x67, 0xc0, 0x38, 0x60, 0x18, - 0x0c, 0x00, 0xc0, 0xc1, 0x71, 0xc0, 0x60, 0x60, 0x18, 0x0d, 0x46, 0xc7, - 0x87, 0x01, 0x00, 0x1c, 0x30, 0xb0, 0x01, 0x0c, 0x00, 0x0c, 0xc0, 0xc0, - 0x30, 0x30, 0x98, 0xc1, 0x39, 0x06, 0x0c, 0x38, 0xe0, 0x7c, 0x18, 0x63, - 0xcc, 0x00, 0x66, 0xc0, 0x18, 0x00, 0x18, 0x0e, 0x00, 0x80, 0x03, 0x30, - 0x00, 0x60, 0x38, 0x98, 0x01, 0xee, 0xc0, 0x8e, 0x01, 0x00, 0x0c, 0x00, - 0x18, 0x03, 0x0c, 0x00, 0x0c, 0xc0, 0x70, 0x30, 0x38, 0x98, 0xc1, 0x39, - 0x06, 0x0c, 0x18, 0xc0, 0xec, 0x18, 0x60, 0xc0, 0x00, 0x66, 0xc0, 0x18, - 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x3f, 0x30, 0x00, 0xe0, 0x3f, 0xf8, 0x01, - 0xfe, 0xc0, 0x8c, 0x01, 0x00, 0x0c, 0x00, 0x18, 0x03, 0x0c, 0x00, 0x0c, - 0xc0, 0x3f, 0xf0, 0x1f, 0x18, 0x03, 0x38, 0x00, 0x0c, 0x18, 0xc0, 0xcc, - 0x18, 0x60, 0xc0, 0x00, 0x66, 0xc0, 0x18, 0x00, 0xf8, 0x0f, 0x00, 0x00, - 0xfc, 0x30, 0x00, 0xe0, 0x0f, 0xf8, 0x01, 0xfe, 0xc0, 0x98, 0x01, 0x00, - 0x0c, 0x00, 0x18, 0x07, 0x0c, 0x00, 0x0c, 0xc0, 0x7f, 0xf0, 0x0f, 0x0c, - 0x03, 0x38, 0x00, 0x0c, 0x18, 0xc0, 0x8c, 0x19, 0x60, 0xc0, 0x00, 0x66, - 0xc0, 0x18, 0x00, 0x18, 0x0c, 0x00, 0x00, 0xf0, 0x31, 0x00, 0xe0, 0x0f, - 0x98, 0x01, 0xc6, 0xc0, 0xb8, 0x01, 0x00, 0x0c, 0x00, 0x1c, 0x07, 0x0c, - 0x06, 0x0c, 0xc0, 0xf0, 0xf0, 0x07, 0x1c, 0x07, 0x38, 0x00, 0x0c, 0x18, - 0xc0, 0x8c, 0x1b, 0x60, 0xc0, 0x01, 0x66, 0xc0, 0x18, 0x00, 0x18, 0x0c, - 0x00, 0x80, 0xc0, 0x31, 0x00, 0x60, 0x1c, 0x18, 0x18, 0x06, 0xc4, 0xb0, - 0x01, 0x00, 0x0c, 0x00, 0xfc, 0x07, 0x0c, 0x06, 0x0c, 0xc0, 0xc0, 0x30, - 0x0e, 0xfc, 0x07, 0x38, 0x00, 0x0c, 0x38, 0xc0, 0x0c, 0x1b, 0x60, 0x80, - 0x01, 0xe3, 0xe0, 0x38, 0x00, 0x18, 0x0c, 0x00, 0xc0, 0x81, 0x71, 0x00, - 0x60, 0x38, 0x18, 0x18, 0x06, 0xc6, 0xe0, 0x01, 0x00, 0x1c, 0x00, 0xfe, - 0x0f, 0x0c, 0x06, 0x0c, 0xc0, 0xc0, 0x30, 0x38, 0xfe, 0x0f, 0x38, 0x00, - 0x0c, 0x30, 0x60, 0x0c, 0x1e, 0x60, 0x80, 0x83, 0xc3, 0x71, 0x78, 0x70, - 0x18, 0x0c, 0x00, 0xc0, 0x81, 0xe1, 0xc0, 0x61, 0x70, 0x18, 0x18, 0x06, - 0xc6, 0xe0, 0x01, 0x00, 0x38, 0x70, 0x06, 0x0c, 0x0c, 0x06, 0x0c, 0xc0, - 0xc0, 0x30, 0x30, 0x06, 0x0e, 0x38, 0x00, 0x0c, 0x70, 0x70, 0x0c, 0x1e, - 0xfe, 0x07, 0xff, 0x81, 0x7f, 0xf0, 0x7f, 0x7e, 0x1f, 0x00, 0xc0, 0xff, - 0xc1, 0xff, 0xfc, 0xe1, 0xff, 0x9f, 0xff, 0xe7, 0xc3, 0x01, 0x00, 0xf0, - 0xbf, 0x1f, 0xbf, 0xff, 0x87, 0xff, 0xf8, 0xff, 0xfc, 0xf0, 0x9f, 0x3f, - 0xff, 0xc1, 0xff, 0xe0, 0x3f, 0x3e, 0x1c, 0xfe, 0x07, 0xfe, 0x00, 0x1f, - 0xe0, 0x3f, 0x7e, 0x1f, 0x00, 0xc0, 0xff, 0x80, 0x7f, 0xfc, 0xe1, 0xff, - 0x9f, 0xff, 0xe7, 0xc3, 0x01, 0x00, 0xe0, 0x9f, 0x1f, 0xbf, 0xff, 0x87, - 0xff, 0xf8, 0x7f, 0xfc, 0xe0, 0x9f, 0x3f, 0xff, 0xc1, 0xff, 0xc0, 0x1f, - 0x3e, 0x1c }; - -/* "Press on the cross hairs please..." */ -#define message_width 280 -#define message_height 12 -static unsigned char message_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x0c, 0x00, 0x00, - 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xec, 0x78, - 0xf8, 0xf0, 0x00, 0xf0, 0xf8, 0x01, 0xf0, 0xe3, 0xc3, 0x03, 0x80, 0xc7, - 0x8e, 0x07, 0x0f, 0x1f, 0x00, 0x1f, 0x1f, 0x0e, 0x76, 0x7c, 0x00, 0x77, - 0x30, 0x78, 0x78, 0xf0, 0xf1, 0x00, 0x00, 0x00, 0x44, 0x5c, 0xcc, 0xc8, - 0xd8, 0x00, 0x98, 0x31, 0x01, 0x60, 0x60, 0x62, 0x06, 0xc0, 0x86, 0xcb, - 0x8c, 0x8d, 0x09, 0x00, 0x13, 0x19, 0x0a, 0x2e, 0x26, 0x00, 0xce, 0x10, - 0xcc, 0xc8, 0x98, 0x98, 0x01, 0x00, 0x00, 0x7c, 0x08, 0x94, 0x18, 0x18, - 0x00, 0x18, 0x13, 0x01, 0x60, 0x60, 0xa4, 0x04, 0x20, 0x0c, 0xc1, 0x98, - 0x81, 0x03, 0x00, 0x13, 0x10, 0x08, 0x04, 0x0e, 0x00, 0x84, 0x30, 0x94, - 0xd1, 0x30, 0x28, 0x03, 0x00, 0x00, 0x06, 0x08, 0xee, 0xf4, 0xe8, 0x01, - 0x08, 0x12, 0x01, 0x20, 0x20, 0x72, 0x07, 0x20, 0x80, 0x40, 0x90, 0x1e, - 0x1d, 0x00, 0x11, 0x1f, 0x0c, 0x04, 0x74, 0x00, 0x84, 0x10, 0xee, 0xd8, - 0xe8, 0xdd, 0x02, 0x00, 0x00, 0x04, 0x08, 0x0c, 0x8c, 0x89, 0x01, 0x18, - 0x13, 0x01, 0x60, 0x22, 0x62, 0x00, 0x60, 0x84, 0xc0, 0x98, 0x98, 0x11, - 0x00, 0x31, 0x31, 0x08, 0x04, 0x46, 0x00, 0xc4, 0x30, 0x0c, 0x88, 0x08, - 0x19, 0x00, 0x00, 0x00, 0x1f, 0x7e, 0xfc, 0xfd, 0xf8, 0x00, 0xf0, 0xb9, - 0x03, 0xc0, 0x73, 0xe7, 0x0f, 0xc0, 0xc7, 0x87, 0x8f, 0x8f, 0x1f, 0x80, - 0x3b, 0x3f, 0x7f, 0x3f, 0x7e, 0x00, 0x7e, 0xfc, 0xf8, 0xfd, 0xf9, 0xf1, - 0x63, 0xc0, 0xc0, 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x80, 0x00, 0x04, 0x00, 0x80, 0x80, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, - 0x10, 0x08, 0x08, 0x00, 0x00, 0x04, 0x80, 0x20, 0x10, 0x00, 0x40, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - -/* "Not accurate enough. Try again..." */ -#define error_width 272 -#define error_height 11 -static unsigned char error_bits[] = { - 0xe3, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x3f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x6d, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x38, 0x7c, 0x00, - 0x78, 0x60, 0x61, 0x99, 0x31, 0xe3, 0xe0, 0x83, 0x01, 0x80, 0x43, 0x07, - 0xc7, 0x0c, 0x1b, 0x0d, 0x00, 0x80, 0x6d, 0x76, 0xe7, 0x00, 0x3c, 0xd8, - 0x38, 0x38, 0xe8, 0x00, 0x00, 0x00, 0x4a, 0xfc, 0x7c, 0x00, 0xf8, 0xf8, - 0xf1, 0x99, 0xf3, 0xf3, 0xe3, 0xe3, 0x03, 0xc0, 0xc7, 0x87, 0xcf, 0x9c, - 0x1f, 0x1f, 0x00, 0x80, 0x6d, 0x7e, 0xe7, 0x00, 0x7c, 0xfc, 0xfc, 0x38, - 0xf8, 0x00, 0x00, 0x00, 0x5a, 0x86, 0x08, 0x00, 0x80, 0x08, 0x09, 0x11, - 0x63, 0x00, 0x63, 0x20, 0x04, 0x60, 0xc8, 0xc8, 0x98, 0xd8, 0x08, 0x11, - 0x00, 0x00, 0x0c, 0x0c, 0x46, 0x00, 0x40, 0x46, 0xc0, 0x20, 0x18, 0x01, - 0x00, 0x00, 0x52, 0x82, 0x08, 0x00, 0xf8, 0x08, 0x08, 0x10, 0x23, 0xe0, - 0x63, 0xf0, 0x07, 0xe0, 0xcf, 0x48, 0x90, 0x58, 0x08, 0x11, 0x00, 0x00, - 0x0c, 0x04, 0x24, 0x00, 0x7c, 0x42, 0xf8, 0x20, 0x18, 0x01, 0x00, 0x00, - 0x62, 0x86, 0x08, 0x00, 0x8c, 0x08, 0x08, 0x10, 0x23, 0x10, 0x63, 0x30, - 0x00, 0x60, 0xc0, 0xc8, 0x98, 0xd8, 0x08, 0x11, 0x00, 0x00, 0x0c, 0x04, - 0x2c, 0x00, 0x46, 0x46, 0xc4, 0x20, 0x18, 0x01, 0x00, 0x00, 0x67, 0xfc, - 0xf8, 0x00, 0xfc, 0xf9, 0xf9, 0xf1, 0xf3, 0xf1, 0xc3, 0xe7, 0x07, 0xc0, - 0xcf, 0x8c, 0x8f, 0x9f, 0x8f, 0x39, 0x06, 0x00, 0x1e, 0x3e, 0x18, 0x00, - 0xfe, 0x7c, 0xfc, 0xf8, 0x99, 0x61, 0x60, 0xc0, 0x47, 0x38, 0x70, 0x00, - 0xb8, 0xf1, 0xe0, 0xe0, 0xf3, 0xe1, 0x82, 0xc1, 0x03, 0x80, 0xc7, 0x0c, - 0x07, 0x1f, 0x8b, 0x39, 0x04, 0x00, 0x1e, 0x3e, 0x18, 0x00, 0xdc, 0x58, - 0xb8, 0xf8, 0x99, 0x61, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 }; diff --git a/usr.sbin/ztsscale/ztsscale.8 b/usr.sbin/ztsscale/ztsscale.8 deleted file mode 100644 index 6a3eac87615..00000000000 --- a/usr.sbin/ztsscale/ztsscale.8 +++ /dev/null @@ -1,67 +0,0 @@ -.\" $OpenBSD: ztsscale.8,v 1.6 2007/05/31 19:20:31 jmc Exp $ -.\" -.\" Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, 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. -.\" -.Dd $Mdocdate: May 31 2007 $ -.Dt ZTSSCALE 8 zaurus -.Os -.Sh NAME -.Nm ztsscale -.Nd Zaurus touch screen calibration tool -.Sh SYNOPSIS -.Nm ztsscale -.Sh DESCRIPTION -The Zaurus -.Xr lcd 4 -screen and -.Xr zts 4 -touch point scanning logic is poorly -aligned and requires calibration. -.Nm -is used interactively (and at installation time) to calculate both -the scaling and offset values which will make the pointer act at -the indicated location on the screen. -.Pp -When run as root from the raw console, -.Nm -temporarily takes over the Zaurus -.Xr wsdisplay 4 -attached to the -.Xr lcd 4 , -and prompts for five crosshairs to be touched. -.Pp -When good deviations are calculated from the selections made at these -points, -.Nm -will exit and provide on standard output -a result like the following: -.Pp -.Dl mouse.scale=200,3400,312,3672,0,640,480 -.Pp -This result should be placed into -.Pa /etc/wsconsctl.conf -for future use, or can be immediately applied using: -.Pp -.Dl # wsconsctl mouse.scale=200,3400,312,3672,0,640,480 -.Sh SEE ALSO -.Xr lcd 4 , -.Xr zts 4 , -.Xr wsconsctl.conf 5 , -.Xr wsconsctl 8 -.Sh HISTORY -The -.Nm -command appeared in -.Ox 3.8 . diff --git a/usr.sbin/ztsscale/ztsscale.c b/usr.sbin/ztsscale/ztsscale.c deleted file mode 100644 index ef5e268fbe5..00000000000 --- a/usr.sbin/ztsscale/ztsscale.c +++ /dev/null @@ -1,299 +0,0 @@ -/* $OpenBSD: ztsscale.c,v 1.19 2015/08/20 22:39:30 deraadt Exp $ */ - -/* - * Copyright (c) 2005 Matthieu Herrb - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, 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. - */ - -#include <sys/types.h> -#include <sys/mman.h> -#include <sys/ioctl.h> -#include <machine/cpu.h> -#include <dev/wscons/wsconsio.h> - -#include <err.h> -#include <fcntl.h> -#include <math.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include "message.xbm" - -#define TITLE_Y 64 -#define MESSAGE_Y 128 - -#define WIDTH 640 -#define HEIGHT 480 -#define BLACK 0x0 -#define RED 0xf000 -#define WHITE 0xffff - -#define ADDR(x,y) (HEIGHT*(x)+(y)) - -u_short *mapaddr, *save; -int orawmode = -1; -int fd, mfd; -int xc[] = { 25, 25, 320, 615, 615 }; -int yc[] = { 25, 455, 240, 25, 455 }; - -struct wsmouse_calibcoords wmcoords; - -void bitmap(u_short *, u_short, u_char[], int, int, int); -void cross(u_short *, int, int); -void wait_event(int, int *, int *); -void save_screen(void); -void restore_screen(void); -void cleanup(void); -void sighandler(int); -int main(int, char *[]); -__dead void usage(void); - -void -bitmap(u_short *fb, u_short pixel, u_char bits[], int width, int height, - int y) -{ - int i, j; - int x; - -#define BITADDR(x, y) ((width + 7)/8*(y) + (x)/8) -#define BITMASK(x) (1 << ((x) % 8)) - - for (i = 0; i < height; i++) { - x = (WIDTH - width)/2; - for (j = 0; j < width; j++) - if (bits[BITADDR(j, i)] & BITMASK(j)) - fb[ADDR(x + j, HEIGHT - y - i)] = pixel; - } -} - -void -cross(u_short *fb, int x, int y) -{ - int i; - - y = HEIGHT - y; - for (i = x - 20; i <= x + 20; i++) - fb[ADDR(i, y)] = BLACK; - for (i = y - 20; i <= y + 20; i++) - fb[ADDR(x, i)] = BLACK; -} - -void -wait_event(int mfd, int *x, int *y) -{ - int down; - ssize_t len; - struct wscons_event evbuf; - - down = 0; - *x = *y = -1; - while (down || *x == -1 || *y == -1) { - len = read(mfd, &evbuf, sizeof(evbuf)); - if (len != sizeof(evbuf)) - break; - switch (evbuf.type) { - case WSCONS_EVENT_MOUSE_DOWN: - down = 1; - break; - case WSCONS_EVENT_MOUSE_UP: - down = 0; - break; - case WSCONS_EVENT_MOUSE_ABSOLUTE_X: - if (down) - *x = evbuf.value; - break; - case WSCONS_EVENT_MOUSE_ABSOLUTE_Y: - if (down) - *y = evbuf.value; - break; - } - } -} - -void -save_screen(void) -{ - int mode = WSDISPLAYIO_MODE_DUMBFB; - - if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) == -1) - warn("ioctl SMODE"); - mapaddr = mmap(0, WIDTH*HEIGHT*sizeof(short), - PROT_READ|PROT_WRITE, MAP_SHARED, fd, (off_t)0); - if (mapaddr == MAP_FAILED) - err(2, "mmap"); - save = malloc(WIDTH*HEIGHT*sizeof(u_short)); - if (save == NULL) - err(2, "malloc"); - memcpy(save, mapaddr, WIDTH*HEIGHT*sizeof(u_short)); -} - -void -restore_screen(void) -{ - int mode = WSDISPLAYIO_MODE_EMUL; - - memcpy(mapaddr, save, WIDTH*HEIGHT*sizeof(u_short)); - if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) == -1) - warn("ioctl SMODE"); -} - -void -cleanup(void) -{ - - restore_screen(); - - wmcoords.samplelen = orawmode; - if (wmcoords.samplelen != -1 && - ioctl(mfd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) < 0) - err(1, "WSMOUSEIO_SCALIBCOORDS"); - - close(mfd); -} - -/* ARGSUSED */ -void -sighandler(int sig) -{ - - cleanup(); - _exit(2); -} - -/*ARGSUSED*/ -int -main(int argc, char *argv[]) -{ - int i, x[5], y[5]; - double a, a1, a2, b, b1, b2, xerr, yerr; - struct ztsscale { - int ts_minx; - int ts_maxx; - int ts_miny; - int ts_maxy; - int ts_swapxy; - } ts; - - if (argc != 1) - usage(); - - fd = open("/dev/ttyC0", O_RDWR); - if (fd < 0) - err(2, "open /dev/ttyC0"); - save_screen(); - - mfd = open("/dev/wsmouse", O_RDWR); - if (mfd < 0) { - restore_screen(); - err(2, "open /dev/wsmouse"); - } - - if (ioctl(mfd, WSMOUSEIO_GCALIBCOORDS, &wmcoords) < 0) { - restore_screen(); - err(1, "WSMOUSEIO_GCALIBCOORDS"); - } - - /* Save the old rawmode value then switch rawmode on */ - orawmode = wmcoords.samplelen; - wmcoords.samplelen = 1; - - if (ioctl(mfd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) < 0) { - restore_screen(); - err(1, "WSMOUSEIO_SCALIBCOORDS"); - } - -again: - signal(SIGINT, sighandler); - for (i = 0; i < 5; i++) { - memset(mapaddr, WHITE, WIDTH*HEIGHT*sizeof(u_short)); - bitmap(mapaddr, BLACK, title_bits, title_width, - title_height, TITLE_Y); - bitmap(mapaddr, BLACK, message_bits, message_width, - message_height, MESSAGE_Y); - cross(mapaddr, xc[i], yc[i]); - /* printf("waiting for event\n"); */ - wait_event(mfd, &x[i], &y[i]); - } - - bzero(&ts, sizeof(ts)); - - /* get touch pad resolution to screen resolution ratio */ - a1 = (double)(x[4] - x[0])/(double)(xc[4] - xc[0]); - a2 = (double)(x[3] - x[1])/(double)(xc[3] - xc[1]); - /* get the minimum pad position on the X-axis */ - b1 = x[0] - a1*xc[0]; - b2 = x[1] - a2*xc[1]; - /* use the average ratio and average minimum position */ - a = (a1+a2)/2.0; - b = (b1+b2)/2.0; - xerr = a*WIDTH/2+b - x[2]; - if (fabs(xerr) > (a*WIDTH+b)*.01) { -#ifdef DEBUG - fprintf(stderr, "X error (%.2f) too high, try again\n", - fabs(xerr)); -#endif - goto err; - } - - ts.ts_minx = (int)(b+0.5); - ts.ts_maxx = (int)(a*WIDTH+b+0.5); - - /* get touch pad resolution to screen resolution ratio */ - a1 = (double)(y[4] - y[0])/(double)(yc[4] - yc[0]); - a2 = (double)(y[3] - y[1])/(double)(yc[3] - yc[1]); - /* get the minimum pad position on the Y-axis */ - b1 = y[0] - a1*yc[0]; - b2 = y[1] - a2*yc[1]; - /* use the average ratio and average minimum position */ - a = (a1+a2)/2.0; - b = (b1+b2)/2.0; - yerr = a*HEIGHT/2+b - y[2]; - if (fabs(yerr) > (a*HEIGHT+b)*.01) { -#ifdef DEBUG - fprintf(stderr, "Y error (%.2f) too high, try again\n", - fabs(yerr)); -#endif - goto err; - } - - ts.ts_miny = (int)(b+0.5); - ts.ts_maxy = (int)(a*HEIGHT+b+0.5); - - cleanup(); - - (void)printf("mouse.scale=%d,%d,%d,%d,%d,%d,%d\n", ts.ts_minx, ts.ts_maxx, - ts.ts_miny, ts.ts_maxy, ts.ts_swapxy, WIDTH, HEIGHT); - return 0; - -err: - memset(mapaddr, WHITE, WIDTH*HEIGHT*sizeof(u_short)); - bitmap(mapaddr, BLACK, title_bits, title_width, title_height, - TITLE_Y); - bitmap(mapaddr, RED, error_bits, error_width, error_height, - MESSAGE_Y); - sleep(2); - goto again; -} - -__dead void -usage(void) -{ - extern char *__progname; - - (void)fprintf(stderr, "usage: %s\n", __progname); - exit(2); -} |