From nobody Thu Jan 27 19:02:19 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E578019845D5; Thu, 27 Jan 2022 19:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jl9241D5yz4Vnj; Thu, 27 Jan 2022 19:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643310140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FsVj/WZ9mOp9fPTGdIwxYWiQmaGk+/bIDmt0feYrg4=; b=Z8z/6yiWdNUolieUAVGO8mi4/oMvpitmlXrEX8oNJiYWAS36LJETNFJb1O8q4uGpLSVZkj rT+SIdNQG5jadp40CMPCPnLU63G72WqHdTwutoe28QyjlF9FymfvqOqCnHIGRCC2TEjfWM o82gc23s2QzIblPyHLj0rXXzumxVt38yW6qc7BKiuyUTrvWePgQp585VVjzoc+pwrlFEQK e7PoZnyFw5N8cjScf1RaqWkUcrMzAOc212V7zanE6JXUO3MZNstUvmAvsGCwGj0OZehO+c ojDPxIv3VtHF6Qu+xhCYFgbWhUyUOQJcnjDztHakkQfQD/m8bEz7b0Jig76O/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 044AE1C2A0; Thu, 27 Jan 2022 19:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20RJ2JCw016537; Thu, 27 Jan 2022 19:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RJ2JcV016536; Thu, 27 Jan 2022 19:02:19 GMT (envelope-from git) Date: Thu, 27 Jan 2022 19:02:19 GMT Message-Id: <202201271902.20RJ2JcV016536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ac4643ef7865 - main - Remove terasic drivers used on the Cambridge BERI tablet. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac4643ef786553e7d61cace456ef865920689669 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643310140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FsVj/WZ9mOp9fPTGdIwxYWiQmaGk+/bIDmt0feYrg4=; b=apu5bTbJQDa0lzD+rXd17Ee/MdPe8qEjC+Hzn2U2NgUQW3BZBI88upIcCbb1VBcGtmaqpJ 1EqjN7n+cFqiNU3CJ7uG7HFredth1NqFe1dVqkN/qLVj65YL6xapAWsDcHbAt63aN3YZ0H +scgEnTuTQkXo96BuTQ9Q6HcpD5sM+Y5M2jxzucsj3d51ueSDOvG2e6AYpBqcP9oWPV2mo Zs9SaG6n/6yAuO5833Jr6V4zJaM5lSKw33F5Kg5Tok32G7wrMHTRgTuQJrwQeasKfBncWn m8LXpqfd4xHDrgmoUMOrFQgclQMnbp8U8Nqe3oi3C2/kdqxSadIOWnx5UKvG4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643310140; a=rsa-sha256; cv=none; b=rDEvC9/q9ZFrIQAvGsvqkWfUCxWcEZevNOOjf+2WPzFTNkB86DMz34jsi4+8C4C++0BJ8s zhXPp3heSuR0ITm79/DVlyq1bSlYxBBX6HyEkDR+b209m9/CKjamgQUxQUnhMf5lEWBWDE ULkOSNfESrRsE5b5H9CMEKhCix6Qy44p50VOKbxashgm/BS5iItYboHSiB5K5Tx9I4pOuP MzGYVyoXAnNBMyAOwuGRVhRpK+ayjL3fhjlKqAwulNKnOJYBtcJRNwGR17CB9Amu9N623O Fd6D81UwkeWeYGXgHXvzxmfhdOLb3qqAidZhUidt8PHkJQLzNli9Vh/4OM0nAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ac4643ef786553e7d61cace456ef865920689669 commit ac4643ef786553e7d61cace456ef865920689669 Author: John Baldwin AuthorDate: 2022-01-27 19:00:48 +0000 Commit: John Baldwin CommitDate: 2022-01-27 19:01:51 +0000 Remove terasic drivers used on the Cambridge BERI tablet. Reviewed by: brooks Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D34057 --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 1 - share/man/man4/terasic_mtl.4 | 131 ------- sys/dev/terasic/de4led/terasic_de4led.c | 192 ----------- sys/dev/terasic/de4led/terasic_de4led.h | 79 ----- sys/dev/terasic/de4led/terasic_de4led_fdt.c | 123 ------- sys/dev/terasic/de4led/terasic_de4led_nexus.c | 112 ------ sys/dev/terasic/mtl/terasic_mtl.c | 134 -------- sys/dev/terasic/mtl/terasic_mtl.h | 235 ------------- sys/dev/terasic/mtl/terasic_mtl_fdt.c | 217 ------------ sys/dev/terasic/mtl/terasic_mtl_nexus.c | 208 ----------- sys/dev/terasic/mtl/terasic_mtl_pixel.c | 161 --------- sys/dev/terasic/mtl/terasic_mtl_reg.c | 296 ---------------- sys/dev/terasic/mtl/terasic_mtl_syscons.c | 476 -------------------------- sys/dev/terasic/mtl/terasic_mtl_text.c | 196 ----------- sys/dev/terasic/mtl/terasic_mtl_vt.c | 133 ------- 16 files changed, 3 insertions(+), 2694 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f6856e775936..dc065d970478 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -52,6 +52,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20220127: terasic_mtl.4 removed +OLD_FILES+=usr/share/man/man4/terasic_mtl.4.gz + # 20211229: libc++ moved to /lib MOVED_LIBS+=usr/lib/libc++.so.1 diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 7b64bad84536..23582e95c79b 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -546,7 +546,6 @@ MAN= aac.4 \ tcp.4 \ tcp_bbr.4 \ tdfx.4 \ - terasic_mtl.4 \ termios.4 \ textdump.4 \ ti.4 \ diff --git a/share/man/man4/terasic_mtl.4 b/share/man/man4/terasic_mtl.4 deleted file mode 100644 index 757efd16bfee..000000000000 --- a/share/man/man4/terasic_mtl.4 +++ /dev/null @@ -1,131 +0,0 @@ -.\"- -.\" Copyright (c) 2012 Robert N. M. Watson -.\" All rights reserved. -.\" -.\" This software was developed by SRI International and the University of -.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) -.\" ("CTSRD"), as part of the DARPA CRASH research programme. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd August 18, 2012 -.Dt TERASIC_MTL 4 -.Os -.Sh NAME -.Nm terasic_mtl -.Nd driver for the Terasic/Cambridge Multi-Touch LCD device -.Sh SYNOPSIS -.Cd "device terasic_mtl" -.Pp -In -.Pa /boot/device.hints : -.Cd hint.terasic_mtl.0.at="nexus0" -.Cd hint.terasic_mtl.0.reg_maddr=0x70400000 -.Cd hint.terasic_mtl.0.reg_msize=0x1000 -.Cd hint.terasic_mtl.0.pixel_maddr=0x70000000 -.Cd hint.terasic_mtl.0.pixel_msize=0x177000 -.Cd hint.terasic_mtl.0.text_maddr=0x70177000 -.Cd hint.terasic_mtl.0.text_msize=0x2000 -.Sh DESCRIPTION -The -.Nm -device driver provides support for the Terasic Multi-Touch LCD combined as -controlled by a University of Cambridge's IP Core. -Three device nodes are instantiated, representing various services supported -by the device: -.Bl -tag -width terasic_pixelX -.It terasic_regX -Memory-mapped register interface, including touch screen input. -.It terasic_pixelX -Memory-mapped pixel-oriented frame buffer. -.It terasic_textX -Memory-mapped text-oriented frame buffer. -.El -.Pp -.Nm -devices are also attached to the -.Xr syscons 4 -framework, which implements a VT-compatible terminal connected to the -.Xr tty 4 -framework. -.Li ttyvX -device nodes may be added to -.Xr ttys 5 -in order to launch -.Xr login 1 -sessions at boot. -.Pp -Register, text, and pixel devices may be accessed using -.Xr read 2 -and -.Xr write 2 -system calls, and also memory mapped using -.Xr mmap 2 . -.Sh SEE ALSO -.Xr login 1 , -.Xr ioctl 2 , -.Xr mmap 2 , -.Xr poll 2 , -.Xr read 2 , -.Xr write 2 , -.Xr syscons 4 , -.Xr tty 4 , -.Xr ttys 5 -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 10.0 . -.Sh AUTHORS -The -.Nm -device driver and this manual page were -developed by SRI International and the University of Cambridge Computer -Laboratory under DARPA/AFRL contract -.Pq FA8750-10-C-0237 -.Pq Do CTSRD Dc , -as part of the DARPA CRASH research programme. -This device driver was written by -.An Robert N. M. Watson . -.Sh BUGS -The -.Xr syscons 4 -attachment does not support the hardware cursor feature. -.Pp -A more structured interface to control registers using the -.Xr ioctl 2 -system call, would sometimes be preferable to memory mapping. -For touch screen input, it would be highly desirable to offer a streaming -interface whose events can be managed using -.Xr poll 2 -and related system calls, with the kernel performing polling rather than the -userspace application. -.Pp -.Nm -supports only a -.Li nexus -bus attachment, which is appropriate for system-on-chip busses such as -Altera's Avalon bus. -If the IP core is configured off of another bus type, then additional bus -attachments will be required. diff --git a/sys/dev/terasic/de4led/terasic_de4led.c b/sys/dev/terasic/de4led/terasic_de4led.c deleted file mode 100644 index ee99bd541233..000000000000 --- a/sys/dev/terasic/de4led/terasic_de4led.c +++ /dev/null @@ -1,192 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -devclass_t terasic_de4led_devclass; - -static void -terasic_de4led_update(struct terasic_de4led_softc *sc) -{ - - TERASIC_DE4LED_LOCK_ASSERT(sc); - - bus_write_1(sc->tdl_res, TERASIC_DE4LED_OFF_LED, sc->tdl_bits); -} - -static void -led_update(struct terasic_de4led_softc *sc, int bit, int onoff) -{ - - TERASIC_DE4LED_LOCK(sc); - TERASIC_DE4LED_SETLED(sc, bit, onoff); - terasic_de4led_update(sc); - TERASIC_DE4LED_UNLOCK(sc); -} - -static void -led_0(void *arg, int onoff) -{ - - led_update(arg, 0, onoff); -} - -static void -led_1(void *arg, int onoff) -{ - - led_update(arg, 1, onoff); -} - -static void -led_2(void *arg, int onoff) -{ - - led_update(arg, 2, onoff); -} - -static void -led_3(void *arg, int onoff) -{ - - led_update(arg, 3, onoff); -} - -static void -led_4(void *arg, int onoff) -{ - - led_update(arg, 4, onoff); -} - -static void -led_5(void *arg, int onoff) -{ - - led_update(arg, 5, onoff); -} - -static void -led_6(void *arg, int onoff) -{ - - led_update(arg, 6, onoff); -} - -static void -led_7(void *arg, int onoff) -{ - - led_update(arg, 7, onoff); -} - -void -terasic_de4led_attach(struct terasic_de4led_softc *sc) -{ - const char *cmd; - - TERASIC_DE4LED_LOCK_INIT(sc); - - /* - * Clear the LED array before we start. - */ - TERASIC_DE4LED_LOCK(sc); - TERASIC_DE4LED_CLEARBAR(sc); - terasic_de4led_update(sc); - TERASIC_DE4LED_UNLOCK(sc); - - /* - * Register the LED array with led(4). - */ - sc->tdl_leds[0] = led_create(led_0, sc, "de4led_0"); - sc->tdl_leds[1] = led_create(led_1, sc, "de4led_1"); - sc->tdl_leds[2] = led_create(led_2, sc, "de4led_2"); - sc->tdl_leds[3] = led_create(led_3, sc, "de4led_3"); - sc->tdl_leds[4] = led_create(led_4, sc, "de4led_4"); - sc->tdl_leds[5] = led_create(led_5, sc, "de4led_5"); - sc->tdl_leds[6] = led_create(led_6, sc, "de4led_6"); - sc->tdl_leds[7] = led_create(led_7, sc, "de4led_7"); - - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_0_cmd", &cmd) == 0) - led_set("de4led_0", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_1_cmd", &cmd) == 0) - led_set("de4led_1", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_2_cmd", &cmd) == 0) - led_set("de4led_2", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_3_cmd", &cmd) == 0) - led_set("de4led_3", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_4_cmd", &cmd) == 0) - led_set("de4led_4", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_5_cmd", &cmd) == 0) - led_set("de4led_5", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_6_cmd", &cmd) == 0) - led_set("de4led_6", cmd); - if (resource_string_value(device_get_name(sc->tdl_dev), - sc->tdl_unit, "de4led_7_cmd", &cmd) == 0) - led_set("de4led_7", cmd); -} - -void -terasic_de4led_detach(struct terasic_de4led_softc *sc) -{ - int i; - - for (i = 0; i < 8; i++) { - led_destroy(sc->tdl_leds[i]); - sc->tdl_leds[i] = NULL; - } - TERASIC_DE4LED_LOCK(sc); - TERASIC_DE4LED_CLEARBAR(sc); - terasic_de4led_update(sc); - TERASIC_DE4LED_UNLOCK(sc); - TERASIC_DE4LED_LOCK_DESTROY(sc); -} diff --git a/sys/dev/terasic/de4led/terasic_de4led.h b/sys/dev/terasic/de4led/terasic_de4led.h deleted file mode 100644 index 873a531ff3e1..000000000000 --- a/sys/dev/terasic/de4led/terasic_de4led.h +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _DEV_TERASIC_DE4LED_H_ -#define _DEV_TERASIC_DE4LED_H_ - -#define TERASIC_DE4LED_NUMLEDS 8 -struct terasic_de4led_softc { - device_t tdl_dev; - int tdl_unit; - struct resource *tdl_res; - int tdl_rid; - struct mtx tdl_lock; - uint8_t tdl_bits; - struct cdev *tdl_leds[TERASIC_DE4LED_NUMLEDS]; -}; - -#define TERASIC_DE4LED_LOCK(sc) mtx_lock(&(sc)->tdl_lock) -#define TERASIC_DE4LED_LOCK_ASSERT(sc) mtx_assert(&(sc)->tdl_lock, MA_OWNED) -#define TERASIC_DE4LED_LOCK_DESTROY(sc) mtx_destroy(&(sc)->tdl_lock) -#define TERASIC_DE4LED_LOCK_INIT(sc) mtx_init(&(sc)->tdl_lock, \ - "terasic_de4led", NULL, MTX_DEF) -#define TERASIC_DE4LED_UNLOCK(sc) mtx_unlock(&(sc)->tdl_lock) - -/* - * Setting and clearing LEDs. tdl_bits is in the bit order preferred for I/O. - * The LED elements are labelled 1..8 on the DE-4, so bit 0 is LED 1, and so - * on. - */ -#define TERASIC_DE4LED_CLEARBAR(sc) do { \ - (sc)->tdl_bits = 0; \ -} while (0) -#define TERASIC_DE4LED_SETLED(sc, led, onoff) do { \ - (sc)->tdl_bits &= ~(1 << (led)); \ - (sc)->tdl_bits |= ((onoff != 0) ? 1 : 0) << (led); \ -} while (0) - -/* - * Only one offset matters for this device -- 0. - */ -#define TERASIC_DE4LED_OFF_LED 0 - -void terasic_de4led_attach(struct terasic_de4led_softc *sc); -void terasic_de4led_detach(struct terasic_de4led_softc *sc); - -extern devclass_t terasic_de4led_devclass; - -#endif /* _DEV_TERASIC_DE4LED_H_ */ diff --git a/sys/dev/terasic/de4led/terasic_de4led_fdt.c b/sys/dev/terasic/de4led/terasic_de4led_fdt.c deleted file mode 100644 index d8473f7d0fbf..000000000000 --- a/sys/dev/terasic/de4led/terasic_de4led_fdt.c +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -/* - * Nexus bus attachment for the 8-element LED on the Terasic DE-4 FPGA board, - * which is hooked up to the processor via a memory-mapped Avalon bus. - */ -static int -terasic_de4led_fdt_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_is_compatible(dev, "sri-cambridge,de4led")) { - device_set_desc(dev, "Terasic DE4 8-element LED"); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); -} - -static int -terasic_de4led_fdt_attach(device_t dev) -{ - struct terasic_de4led_softc *sc; - - sc = device_get_softc(dev); - sc->tdl_dev = dev; - sc->tdl_unit = device_get_unit(dev); - sc->tdl_rid = 0; - sc->tdl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->tdl_rid, RF_ACTIVE); - if (sc->tdl_res == NULL) { - device_printf(dev, "couldn't map memory\n"); - return (ENXIO); - } - terasic_de4led_attach(sc); - return (0); -} - -static int -terasic_de4led_fdt_detach(device_t dev) -{ - struct terasic_de4led_softc *sc; - - sc = device_get_softc(dev); - KASSERT(sc->tdl_res != NULL, ("%s: resources not allocated", - __func__)); - terasic_de4led_detach(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->tdl_rid, sc->tdl_res); - return (0); -} - -static device_method_t terasic_de4led_fdt_methods[] = { - DEVMETHOD(device_probe, terasic_de4led_fdt_probe), - DEVMETHOD(device_attach, terasic_de4led_fdt_attach), - DEVMETHOD(device_detach, terasic_de4led_fdt_detach), - { 0, 0 } -}; - -static driver_t terasic_de4led_fdt_driver = { - "terasic_de4led", - terasic_de4led_fdt_methods, - sizeof(struct terasic_de4led_softc), -}; - -DRIVER_MODULE(terasic_de4led, simplebus, terasic_de4led_fdt_driver, - terasic_de4led_devclass, 0, 0); diff --git a/sys/dev/terasic/de4led/terasic_de4led_nexus.c b/sys/dev/terasic/de4led/terasic_de4led_nexus.c deleted file mode 100644 index 33ea2377cc03..000000000000 --- a/sys/dev/terasic/de4led/terasic_de4led_nexus.c +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -/* - * Nexus bus attachment for the 8-element LED on the Terasic DE-4 FPGA board, - * which is hooked up to the processor via a memory-mapped Avalon bus. - */ -static int -terasic_de4led_nexus_probe(device_t dev) -{ - - device_set_desc(dev, "Terasic DE4 8-element LED"); - return (BUS_PROBE_NOWILDCARD); -} - -static int -terasic_de4led_nexus_attach(device_t dev) -{ - struct terasic_de4led_softc *sc; - - sc = device_get_softc(dev); - sc->tdl_dev = dev; - sc->tdl_unit = device_get_unit(dev); - sc->tdl_rid = 0; - sc->tdl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->tdl_rid, RF_ACTIVE); - if (sc->tdl_res == NULL) { - device_printf(dev, "couldn't map memory\n"); - return (ENXIO); - } - terasic_de4led_attach(sc); - return (0); -} - -static int -terasic_de4led_nexus_detach(device_t dev) -{ - struct terasic_de4led_softc *sc; - - sc = device_get_softc(dev); - KASSERT(sc->tdl_res != NULL, ("%s: resources not allocated", - __func__)); - terasic_de4led_detach(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->tdl_rid, sc->tdl_res); - return (0); -} - -static device_method_t terasic_de4led_nexus_methods[] = { - DEVMETHOD(device_probe, terasic_de4led_nexus_probe), - DEVMETHOD(device_attach, terasic_de4led_nexus_attach), - DEVMETHOD(device_detach, terasic_de4led_nexus_detach), - { 0, 0 } -}; - -static driver_t terasic_de4led_nexus_driver = { - "terasic_de4led", - terasic_de4led_nexus_methods, - sizeof(struct terasic_de4led_softc), -}; - -DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, - terasic_de4led_devclass, 0, 0); diff --git a/sys/dev/terasic/mtl/terasic_mtl.c b/sys/dev/terasic/mtl/terasic_mtl.c deleted file mode 100644 index 10e3b413ca96..000000000000 --- a/sys/dev/terasic/mtl/terasic_mtl.c +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include "opt_syscons.h" - -#include -#include -#include -#include -#include /* struct vt_mode */ -#include -#include /* video_adapter_t */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -/* - * Device driver for the Terasic Multitouch LCD (MTL). Three separate - * sub-drivers that support, respectively, access to device control registers, - * the pixel frame buffer, and the text frame buffer. The pixel frame buffer - * is hooked up to vt(4), and the text frame buffer to syscons(4). - * - * Eventually, the frame buffer control registers and touch screen input FIFO - * will end up being separate sub-drivers as well. - * - * Note: sub-driver detach routines must check whether or not they have - * attached as they may be called even if the attach routine hasn't been, on - * an error. - */ - -devclass_t terasic_mtl_devclass; - -int -terasic_mtl_attach(struct terasic_mtl_softc *sc) -{ - int error; - - error = terasic_mtl_reg_attach(sc); - if (error) - goto error; - error = terasic_mtl_pixel_attach(sc); - if (error) - goto error; - error = terasic_mtl_text_attach(sc); - if (error) - goto error; - /* - * XXXRW: Once we've attached syscons or vt, we can't detach it, so do - * it last. - */ -#if defined(DEV_VT) - terasic_mtl_reg_pixel_endian_set(sc, BYTE_ORDER == BIG_ENDIAN); - error = terasic_mtl_fbd_attach(sc); - if (error) - goto error; - terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_OPAQUE); - terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); - terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); -#endif -#if defined(DEV_SC) - error = terasic_mtl_syscons_attach(sc); - if (error) - goto error; - terasic_mtl_blend_pixel_set(sc, TERASIC_MTL_ALPHA_TRANSPARENT); - terasic_mtl_blend_textfg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); - terasic_mtl_blend_textbg_set(sc, TERASIC_MTL_ALPHA_OPAQUE); -#endif - terasic_mtl_blend_default_set(sc, TERASIC_MTL_COLOR_BLACK); - return (0); -error: - terasic_mtl_text_detach(sc); - terasic_mtl_pixel_detach(sc); - terasic_mtl_reg_detach(sc); - return (error); -} - -void -terasic_mtl_detach(struct terasic_mtl_softc *sc) -{ - - /* XXXRW: syscons and vt can't detach, but try anyway, only to panic. */ -#if defined(DEV_SC) - terasic_mtl_syscons_detach(sc); -#endif -#if defined(DEV_VT) - terasic_mtl_fbd_detach(sc); -#endif - - /* All other aspects of the driver can detach just fine. */ - terasic_mtl_text_detach(sc); - terasic_mtl_pixel_detach(sc); - terasic_mtl_reg_detach(sc); -} diff --git a/sys/dev/terasic/mtl/terasic_mtl.h b/sys/dev/terasic/mtl/terasic_mtl.h deleted file mode 100644 index 2ab6de00b7a0..000000000000 --- a/sys/dev/terasic/mtl/terasic_mtl.h +++ /dev/null @@ -1,235 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2012 Robert N. M. Watson - * All rights reserved. - * - * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) - * ("CTSRD"), as part of the DARPA CRASH research programme. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _DEV_TERASIC_MTL_H_ -#define _DEV_TERASIC_MTL_H_ - -#include "opt_syscons.h" - -struct terasic_mtl_softc { -#if defined(DEV_SC) - /* - * syscons requires that its video_adapter_t be at the front of the - * softc, so place syscons fields first, which we otherwise would - * probably not do. - */ - video_adapter_t mtl_va; -#endif - - /* - * Bus-related fields. - */ - device_t mtl_dev; - int mtl_unit; - - /* - * The MTL driver doesn't require a lot of synchronisation; however, - * the lock is used to protect read-modify-write operations on MTL - * registers. - */ - struct mtx mtl_lock; - - /* - * Control register device -- mappable from userspace. - */ - struct cdev *mtl_reg_cdev; - struct resource *mtl_reg_res; - int mtl_reg_rid; - - /* - * Graphics frame buffer device -- mappable from userspace, and used - * by the vt framebuffer interface. - */ - struct cdev *mtl_pixel_cdev; - struct resource *mtl_pixel_res; - int mtl_pixel_rid; - - /* - * Text frame buffer device -- mappable from userspace, and syscons - * hookup. - */ - struct cdev *mtl_text_cdev; - struct resource *mtl_text_res; - int mtl_text_rid; - uint16_t *mtl_text_soft; - - /* - * Framebuffer hookup for vt(4). - */ - struct fb_info mtl_fb_info; -}; - -#define TERASIC_MTL_LOCK(sc) mtx_lock(&(sc)->mtl_lock) -#define TERASIC_MTL_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtl_lock, MA_OWNED) -#define TERASIC_MTL_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtl_lock) -#define TERASIC_MTL_LOCK_INIT(sc) mtx_init(&(sc)->mtl_lock, \ - "terasic_mtl", NULL, MTX_DEF) -#define TERASIC_MTL_UNLOCK(sc) mtx_unlock(&(sc)->mtl_lock) - -/* - * Constant properties of the MTL text frame buffer. - */ -#define TERASIC_MTL_COLS 100 -#define TERASIC_MTL_ROWS 40 - -/* - * MTL control register offsets. - */ -#define TERASIC_MTL_OFF_BLEND 0 -#define TERASIC_MTL_OFF_TEXTCURSOR 4 -#define TERASIC_MTL_OFF_TEXTFRAMEBUFADDR 8 -#define TERASIC_MTL_OFF_TOUCHPOINT_X1 12 -#define TERASIC_MTL_OFF_TOUCHPOINT_Y1 16 -#define TERASIC_MTL_OFF_TOUCHPOINT_X2 20 *** 1850 LINES SKIPPED ***