Subject: ACPI attachments and pcppi(4) split-up
To: None <tech-kern@netbsd.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 03/22/2005 23:52:46
--s/l3CgOIzMHHjg/5
Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g"
Content-Disposition: inline


--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi folks,

Yesterday, Juan Romero Pardines committed an ACPI attachment routine for
pcppi(4), but as I pointed to him later, it just can't work.  The reason
for that is the fact that pcppi(4) actually uses two ISA resources, the
PPI port itself, and the TIMER1 port for pitch control.

Those two resources appear as two different ACPI devices, therefore two
(obviously co-operating) drivers are needed.

I rather quickly came up with a mechanism to allow that.  The positive
side is that we're one (or rather two, with that patch) more device
closer to an isa(4)-free system.

On the negative side, it means that people following -current will have
to make sure they add the attimer device to their kernel config if they
want to keep being able to set the pitch of the console beep.

The other pitfall is if you configure the pcppi device to be attached on
acpi and the attimer device to be attached on isa, you will lose the
ability to set the picth, because the patch uses config_defer() in
pcppi_attach() to find an attimer device, which will only work if the
said device is a "brother" of the pcppi device or if it was attached
already.  I don't see this as a critical issue.

Comments?  I plan on committing this on Friday evening or on Saturday
morning.  With some more patching of all the kernel configs that include
pcppi(4) support, of course.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="attimer.diff"
Content-Transfer-Encoding: quoted-printable

Index: distrib/sets/lists/man/mi
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/distrib/sets/lists/man/mi,v
retrieving revision 1.769
diff -u -r1.769 mi
--- distrib/sets/lists/man/mi	18 Mar 2005 11:11:50 -0000	1.769
+++ distrib/sets/lists/man/mi	22 Mar 2005 22:31:16 -0000
@@ -655,6 +655,7 @@
 ./usr/share/man/cat4/ate.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ath.0			man-sys-catman		.cat
 ./usr/share/man/cat4/atppc.0			man-sys-catman		.cat
+./usr/share/man/cat4/attimer.0			man-sys-catman		.cat
 ./usr/share/man/cat4/atu.0			man-sys-catman		.cat
 ./usr/share/man/cat4/atw.0			man-sys-catman		.cat
 ./usr/share/man/cat4/auacer.0			man-sys-catman		.cat
@@ -2854,6 +2855,7 @@
 ./usr/share/man/man4/ate.4			man-sys-man		.man
 ./usr/share/man/man4/ath.4			man-sys-man		.man
 ./usr/share/man/man4/atppc.4			man-sys-man		.man
+./usr/share/man/man4/attimer.4			man-sys-man		.man
 ./usr/share/man/man4/atu.4			man-sys-man		.man
 ./usr/share/man/man4/atw.4			man-sys-man		.man
 ./usr/share/man/man4/auacer.4			man-sys-man		.man
Index: share/man/man4/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/share/man/man4/Makefile,v
retrieving revision 1.351
diff -u -r1.351 Makefile
--- share/man/man4/Makefile	18 Mar 2005 11:11:51 -0000	1.351
+++ share/man/man4/Makefile	22 Mar 2005 22:31:16 -0000
@@ -3,7 +3,7 @@
=20
 MAN=3D	aac.4 acardide.4 aceride.4 acphy.4 adc.4 adv.4 \
 	adw.4 agp.4 agr.4 ahb.4 ahc.4 ahd.4 amdpm.4 amhphy.4 amr.4 \
-	an.4 aria.4 artsata.4 ata.4 atalk.4 ath.4 atppc.4 atw.4 \
+	an.4 aria.4 artsata.4 ata.4 atalk.4 ath.4 atppc.4 attimer.4 atw.4 \
 	auacer.4 audio.4 audiocs.4 auich.4 auixp.4 autri.4 auvia.4 awi.4 \
 	bba.4 bce.4 be.4 bge.4 bha.4 bktr.4 bpf.4 bmtphy.4 \
 	brgphy.4 bridge.4 cac.4 cardbus.4 ccd.4 cd.4 \
Index: share/man/man4/pcppi.4
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/share/man/man4/pcppi.4,v
retrieving revision 1.9
diff -u -r1.9 pcppi.4
--- share/man/man4/pcppi.4	21 Mar 2005 19:57:44 -0000	1.9
+++ share/man/man4/pcppi.4	22 Mar 2005 22:31:16 -0000
@@ -24,12 +24,12 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 21, 2005
+.Dd March 22, 2005
 .Os
 .Dt PCPPI 4
 .Sh NAME
 .Nm pcppi
-.Nd PC (ISA) control and timer port driver
+.Nd PC (ISA) control port driver
 .Sh SYNOPSIS
 .Cd "pcppi*   at acpi?"
 .Cd "pcppi*   at isa?"
@@ -50,7 +50,12 @@
 (which was implemented by the 8255
 .Dq PPI
 in the XT, hence the name of this driver)
-at IO address 0x61 and the first 8253 timer at 0x40-0x43.
+at IO address 0x61.
+.Pp
+When associated with an
+.Xr attimer 4
+device, it is possible to change the pitch of the sounds emitted through
+.Nm .
 .Pp
 The
 .Nm
@@ -71,6 +76,7 @@
 because the PC keyboard hardware doesn't provide this.
 .Sh SEE ALSO
 .Xr acpi 4 ,
+.Xr attimer 4 ,
 .Xr isa 4 ,
 .Xr midi 4 ,
 .Xr pckbd 4 ,
--- /dev/null	Tue Mar 22 03:30:26 2005
+++ share/man/man4/attimer.4	Tue Mar 22 23:26:23 2005
@@ -0,0 +1,65 @@
+.\" $NetBSD$
+.\"
+.\"  Copyright (c) 2005 The NetBSD Foundation.
+.\"  All rights reserved.
+.\"
+.\"  This code is derived from software contributed to the NetBSD Foundati=
on
+.\"   by Quentin Garnier.
+.\"
+.\"  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 distributio=
n.
+.\"  3. All advertising materials mentioning features or use of this softw=
are
+.\"     must display the following acknowledgement:
+.\"         This product includes software developed by the NetBSD
+.\"         Foundation, Inc. and its contributors.
+.\"  4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBU=
TORS
+.\"  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT L=
IMITED
+.\"  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTI=
CULAR
+.\"  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBU=
TORS
+.\"  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 BUSIN=
ESS
+.\"  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN
+.\"  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS=
E)
+.\"  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O=
F THE
+.\"  POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd March 22, 2005
+.Os
+.Dt ATTIMER 4
+.Sh NAME
+.Nm attimer
+.Nd AT Timer (8253) driver
+.Sh SYNOPSIS
+.Cd "attimer*	at acpi?"
+.Cd "attimer0	at isa?"
+.Sh DESCRIPTION
+The
+.Nm
+driver handles the so-called AT Timer device, initially found as chip
+model 8253.
+It is used as the main counter for the clock on the i386 port,
+but also offers control over the pitch of the PC speaker.
+.Pp
+The
+.Nm
+driver currently only implements the access to the ISA register
+.Dq TIMER1
+which controls the pitch of the PC speaker,
+and should be configured along with
+.Xr pcppi 4
+to be of any actual use.
+.Sh SEE ALSO
+.Xr acpi 4 ,
+.Xr isa 4 ,
+.Xr pcppi 4
Index: sys/conf/files
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/conf/files,v
retrieving revision 1.713
diff -u -r1.713 files
--- sys/conf/files	18 Mar 2005 11:11:50 -0000	1.713
+++ sys/conf/files	22 Mar 2005 22:32:46 -0000
@@ -708,6 +708,9 @@
 device	pckbc: pckbport
 file	dev/ic/pckbc.c			pckbc			needs-flag
=20
+device	attimer
+file	dev/ic/attimer.c		attimer			needs-flag
+
 # Cirrus Logic CD240[01] 4-port Multi-Protocol Communications Controller
 #
 device	clmpcc: tty
Index: sys/dev/acpi/files.acpi
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/dev/acpi/files.acpi,v
retrieving revision 1.30
diff -u -r1.30 files.acpi
--- sys/dev/acpi/files.acpi	21 Mar 2005 14:06:46 -0000	1.30
+++ sys/dev/acpi/files.acpi	22 Mar 2005 22:32:46 -0000
@@ -76,3 +76,7 @@
 # AT-style speaker sound
 attach	pcppi at acpi with pcppi_acpi
 file	dev/acpi/pcppi_acpi.c		pcppi_acpi
+
+# AT Timer
+attach	attimer at acpi with attimer_acpi
+file	dev/acpi/attimer_acpi.c		attimer_acpi
Index: sys/dev/isa/files.isa
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/dev/isa/files.isa,v
retrieving revision 1.137
diff -u -r1.137 files.isa
--- sys/dev/isa/files.isa	27 Feb 2005 00:27:17 -0000	1.137
+++ sys/dev/isa/files.isa	22 Mar 2005 22:32:46 -0000
@@ -451,7 +451,7 @@
 attach	rtii at isa
 file	dev/isa/radiotrack2.c		rtii
=20
-# PC PPI + TIMER 1 (speaker interface)
+# PC PPI (speaker interface)
 device	pcppi {}
 attach	pcppi at isa
 file	dev/isa/pcppi.c			pcppi			needs-flag
@@ -461,6 +461,10 @@
 attach	midi at pcppi with midi_pcppi: midisyn
 file	dev/isa/midi_pcppi.c		midi_pcppi
=20
+# AT Timer (TIMER 1)
+attach	attimer at isa with attimer_isa
+file	dev/isa/attimer_isa.c		attimer_isa
+
 #
 # Environmental monitors
 #
Index: sys/dev/isa/pcppi.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/dev/isa/pcppi.c,v
retrieving revision 1.15
diff -u -r1.15 pcppi.c
--- sys/dev/isa/pcppi.c	21 Mar 2005 14:05:18 -0000	1.15
+++ sys/dev/isa/pcppi.c	22 Mar 2005 22:32:47 -0000
@@ -30,6 +30,8 @@
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: pcppi.c,v 1.15 2005/03/21 14:05:18 xtraeme Exp=
 $");
=20
+#include "attimer.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/callout.h>
@@ -40,13 +42,13 @@
=20
 #include <machine/bus.h>
=20
+#include <dev/ic/attimervar.h>
+
 #include <dev/isa/isareg.h>
 #include <dev/isa/isavar.h>
 #include <dev/isa/pcppireg.h>
 #include <dev/isa/pcppivar.h>
=20
-#include <dev/ic/i8253reg.h>
-
 #include "pckbd.h"
 #if NPCKBD > 0
 #include <dev/pckbport/pckbdvar.h>
@@ -62,14 +64,18 @@
=20
 static void pcppi_bell_stop(void*);
=20
+#if NATTIMER > 0
+static void pcppi_attach_speaker(struct device *);
+#endif
+
 #define PCPPIPRI (PZERO - 1)
=20
 int
 pcppi_match(struct device *parent, struct cfdata *match, void *aux)
 {
 	struct isa_attach_args *ia =3D aux;
-	bus_space_handle_t ppi_ioh, pit1_ioh;
-	int have_pit1, have_ppi, rv;
+	bus_space_handle_t ppi_ioh;
+	int have_ppi, rv;
 	u_int8_t v, nv;
=20
 	if (ISA_DIRECT_CONFIG(ia))
@@ -94,11 +100,8 @@
 		return (0);
=20
 	rv =3D 0;
-	have_pit1 =3D have_ppi =3D 0;
+	have_ppi =3D 0;
=20
-	if (bus_space_map(ia->ia_iot, IO_TIMER1, 4, 0, &pit1_ioh))
-		goto lose;
-	have_pit1 =3D 1;
 	if (bus_space_map(ia->ia_iot, IO_PPI, 1, 0, &ppi_ioh))
 		goto lose;
 	have_ppi =3D 1;
@@ -131,8 +134,6 @@
 	 */
=20
 lose:
-	if (have_pit1)
-		bus_space_unmap(ia->ia_iot, pit1_ioh, 4);
 	if (have_ppi)
 		bus_space_unmap(ia->ia_iot, ppi_ioh, 1);
 	if (rv) {
@@ -156,8 +157,7 @@
=20
         sc->sc_iot =3D iot =3D ia->ia_iot;
=20
-        if (bus_space_map(iot, IO_TIMER1, 4, 0, &sc->sc_pit1_ioh) ||
-	    bus_space_map(iot, IO_PPI, 1, 0, &sc->sc_ppi_ioh))
+        if (bus_space_map(iot, IO_PPI, 1, 0, &sc->sc_ppi_ioh))
                 panic("pcppi_attach: couldn't map");
=20
         printf("\n");
@@ -178,18 +178,36 @@
 	/* Provide a beeper for the PC Keyboard, if there isn't one already. */
 	pckbd_hookup_bell(pcppi_pckbd_bell, sc);
 #endif
+#if NATTIMER > 0
+	config_defer((struct device *)sc, pcppi_attach_speaker);
+#endif
=20
 	pa.pa_cookie =3D sc;
 	while (config_found((struct device *)sc, &pa, 0));
 }
=20
+#if NATTIMER > 0
+static void
+pcppi_attach_speaker(struct device *self)
+{
+	struct pcppi_softc *sc =3D (struct pcppi_softc *)self;
+
+	if ((sc->sc_timer =3D attimer_attach_speaker()) =3D=3D NULL)
+		aprint_error("%s: could not find any available timer\n",
+		    sc->sc_dv.dv_xname);
+	else
+		aprint_normal("%s: attached to %s\n", sc->sc_dv.dv_xname,
+		    sc->sc_timer->sc_dev.dv_xname);
+}
+#endif
+
 void
 pcppi_bell(pcppi_tag_t self, int pitch, int period, int slp)
 {
 	struct pcppi_softc *sc =3D self;
-	int s1, s2;
+	int s;
=20
-	s1 =3D spltty(); /* ??? */
+	s =3D spltty(); /* ??? */
 	if (sc->sc_bellactive) {
 		if (sc->sc_timeout) {
 			sc->sc_timeout =3D 0;
@@ -201,18 +219,14 @@
 	if (pitch =3D=3D 0 || period =3D=3D 0) {
 		pcppi_bell_stop(sc);
 		sc->sc_bellpitch =3D 0;
-		splx(s1);
+		splx(s);
 		return;
 	}
 	if (!sc->sc_bellactive || sc->sc_bellpitch !=3D pitch) {
-		s2 =3D splhigh();
-		bus_space_write_1(sc->sc_iot, sc->sc_pit1_ioh, TIMER_MODE,
-		    TIMER_SEL2 | TIMER_16BIT | TIMER_SQWAVE);
-		bus_space_write_1(sc->sc_iot, sc->sc_pit1_ioh, TIMER_CNTR2,
-		    TIMER_DIV(pitch) % 256);
-		bus_space_write_1(sc->sc_iot, sc->sc_pit1_ioh, TIMER_CNTR2,
-		    TIMER_DIV(pitch) / 256);
-		splx(s2);
+#if NATTIMER > 0
+		if (sc->sc_timer !=3D NULL)
+			attimer_set_pitch(sc->sc_timer, pitch);
+#endif
 		/* enable speaker */
 		bus_space_write_1(sc->sc_iot, sc->sc_ppi_ioh, 0,
 			bus_space_read_1(sc->sc_iot, sc->sc_ppi_ioh, 0)
@@ -233,7 +247,7 @@
 			sc->sc_slp =3D 0;
 		}
 	}
-	splx(s1);
+	splx(s);
 }
=20
 static void
Index: sys/dev/isa/pcppivar.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/dev/isa/pcppivar.h,v
retrieving revision 1.5
diff -u -r1.5 pcppivar.h
--- sys/dev/isa/pcppivar.h	21 Mar 2005 14:05:18 -0000	1.5
+++ sys/dev/isa/pcppivar.h	22 Mar 2005 22:32:47 -0000
@@ -40,7 +40,8 @@
         struct device sc_dv; =20
=20
         bus_space_tag_t sc_iot;
-        bus_space_handle_t sc_ppi_ioh, sc_pit1_ioh;
+        bus_space_handle_t sc_ppi_ioh;
+        struct attimer_softc *sc_timer;
        =20
         struct callout sc_bell_ch;
=20
--- /dev/null	Tue Mar 22 03:30:26 2005
+++ sys/dev/acpi/attimer_acpi.c	Tue Mar 22 23:07:29 2005
@@ -0,0 +1,154 @@
+/* $NetBSD$ */
+
+/*
+ * Copyright (c) 2005 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Juan Romero Pardines <xtraeme@NetBSD.org> and Quentin Garnier.
+ *
+ * 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 NetBSD
+ *      Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTO=
RS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIM=
ITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU=
LAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTO=
RS
+ * 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) 2002 Jared D. McNeill <jmcneill@invisible.ca>
+ * 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 BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTI=
ES
+ * 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.
+ */
+
+/*
+ * ACPI attimer(4) attachment based on lpt_acpi.c by Jared D. McNeill.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/ioctl.h>
+#include <sys/device.h>
+#include <sys/proc.h>
+
+#include <machine/bus.h>
+
+#include <dev/acpi/acpica.h>
+#include <dev/acpi/acpireg.h>
+#include <dev/acpi/acpivar.h>
+
+#include <dev/ic/attimervar.h>
+
+static int	attimer_acpi_match(struct device *, struct cfdata *, void *);
+static void	attimer_acpi_attach(struct device *, struct device *, void *);
+
+CFATTACH_DECL(attimer_acpi, sizeof(struct attimer_softc), attimer_acpi_mat=
ch,
+    attimer_acpi_attach, NULL, NULL);
+
+/*
+ * Supported device IDs
+ */
+
+static const char * const attimer_acpi_ids[] =3D {
+	"PNP0100",	/* AT Timer */
+	NULL
+};
+
+/*
+ * attimer_acpi_match: autoconf(9) match routine
+ */
+static int
+attimer_acpi_match(struct device *parent, struct cfdata *match, void *aux)
+{
+	struct acpi_attach_args *aa =3D aux;
+
+	if (aa->aa_node->ad_type !=3D ACPI_TYPE_DEVICE)
+		return 0;
+
+	return acpi_match_hid(aa->aa_node->ad_devinfo, attimer_acpi_ids);
+}
+
+/*
+ * attimer_acpi_attach: autoconf(9) attach routine
+ */
+static void
+attimer_acpi_attach(struct device *parent, struct device *self, void *aux)
+{
+	struct attimer_softc *sc =3D (struct attimer_softc *)self;
+	struct acpi_attach_args *aa =3D aux;
+	struct acpi_resources res;
+	struct acpi_io *io;
+	ACPI_STATUS rv;
+
+	printf(": AT Timer\n");
+
+	/* parse resources */
+	rv =3D acpi_resource_parse(&sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
+	    &res, &acpi_resource_parse_ops_default);
+	if (ACPI_FAILURE(rv))
+		return;
+
+	/* find our i/o registers */
+	io =3D acpi_res_io(&res, 0);
+	if (io =3D=3D NULL) {
+		printf("%s: unable to find i/o register resource\n",
+		    sc->sc_dev.dv_xname);
+		goto out;
+	}
+
+	sc->sc_iot =3D aa->aa_iot;
+	if (bus_space_map(sc->sc_iot, io->ar_base, io->ar_length,
+		    0, &sc->sc_ioh)) {
+		printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
+		goto out;
+	}
+
+	attimer_attach(sc);
+
+ out:
+	acpi_resource_cleanup(&res);
+}
--- /dev/null	Tue Mar 22 03:30:26 2005
+++ sys/dev/ic/attimer.c	Tue Mar 22 23:04:20 2005
@@ -0,0 +1,107 @@
+/*	$NetBSD$	*/
+
+/*
+ *  Copyright (c) 2005 The NetBSD Foundation.
+ *  All rights reserved.
+ *
+ *  This code is derived from software contributed to the NetBSD Foundation
+ *   by Quentin Garnier.
+ *
+ *  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 softwa=
re
+ *     must display the following acknowledgement:
+ *         This product includes software developed by the NetBSD
+ *         Foundation, Inc. and its contributors.
+ *  4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUT=
ORS
+ *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LI=
MITED
+ *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC=
ULAR
+ *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUT=
ORS
+ *  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 BUSINE=
SS
+ *  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.
+ */
+
+/*
+ * AT Timer
+ *
+ * This code only allows control over the pitch of the speaker (pcppi(4)).
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+
+#include <machine/bus.h>
+
+#include <dev/isa/isareg.h>
+
+#include <dev/ic/attimervar.h>
+#include <dev/ic/i8253reg.h>
+
+extern struct cfdriver attimer_cd;
+
+void
+attimer_attach(struct attimer_softc *sc)
+{
+	sc->sc_flags |=3D ATT_CONFIGURED;
+}
+
+/*
+ * This is slightly artificial.  While the code looks fine, I can't help
+ * but pray I'll get the attimer object associated to the pcppi object
+ * that calls the routine.
+ *
+ * There's not much at risk here, as there's about no chance to have a
+ * computer with more than one pcppi/attimer accessible.
+ */
+
+struct attimer_softc *
+attimer_attach_speaker()
+{
+	int i;
+	struct attimer_softc *sc;
+
+	for (i =3D 0; i < attimer_cd.cd_ndevs; i++)
+		if (attimer_cd.cd_devs[i] !=3D NULL) {
+			sc =3D (struct attimer_softc *)attimer_cd.cd_devs[i];
+			if ((sc->sc_flags & ATT_CONFIGURED) &&
+			    !(sc->sc_flags & ATT_ATTACHED)) {
+				sc->sc_flags |=3D ATT_ATTACHED;
+				return sc;
+			}
+		}
+	return NULL;
+}
+
+void
+attimer_set_pitch(struct attimer_softc *sc, int pitch)
+{
+	int s;
+	s =3D splhigh();
+	bus_space_write_1(sc->sc_iot, sc->sc_ioh, TIMER_MODE,
+	    TIMER_SEL2 | TIMER_16BIT | TIMER_SQWAVE);
+	bus_space_write_1(sc->sc_iot, sc->sc_ioh, TIMER_CNTR2,
+	    TIMER_DIV(pitch) % 256);
+	bus_space_write_1(sc->sc_iot, sc->sc_ioh, TIMER_CNTR2,
+	    TIMER_DIV(pitch) / 256);
+	splx(s);
+}
--- /dev/null	Tue Mar 22 03:30:26 2005
+++ sys/dev/ic/attimervar.h	Tue Mar 22 23:01:00 2005
@@ -0,0 +1,50 @@
+/*	$NetBSD$	*/
+
+/*
+ *  Copyright (c) 2005 The NetBSD Foundation.
+ *  All rights reserved.
+ *
+ *  This code is derived from software contributed to the NetBSD Foundation
+ *   by Quentin Garnier.
+ *
+ *  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 softwa=
re
+ *     must display the following acknowledgement:
+ *         This product includes software developed by the NetBSD
+ *         Foundation, Inc. and its contributors.
+ *  4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUT=
ORS
+ *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LI=
MITED
+ *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC=
ULAR
+ *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUT=
ORS
+ *  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 BUSINE=
SS
+ *  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.
+ */
+
+struct attimer_softc {
+	struct device sc_dev;
+	uint32_t sc_flags;
+#define ATT_ATTACHED	0x01
+#define ATT_CONFIGURED	0x02
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_ioh;
+};
+
+void			attimer_attach(struct attimer_softc *);
+struct attimer_softc	*attimer_attach_speaker(void);
+void			attimer_set_pitch(struct attimer_softc *, int);
--- /dev/null	Tue Mar 22 03:30:26 2005
+++ sys/dev/isa/attimer_isa.c	Tue Mar 22 23:06:03 2005
@@ -0,0 +1,150 @@
+/*	$NetBSD$	*/
+
+/*
+ *  Copyright (c) 2005 The NetBSD Foundation.
+ *  All rights reserved.
+ *
+ *  This code is derived from software contributed to the NetBSD Foundation
+ *   by Quentin Garnier.
+ *
+ *  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 softwa=
re
+ *     must display the following acknowledgement:
+ *         This product includes software developed by the NetBSD
+ *         Foundation, Inc. and its contributors.
+ *  4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUT=
ORS
+ *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LI=
MITED
+ *  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC=
ULAR
+ *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUT=
ORS
+ *  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 BUSINE=
SS
+ *  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) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * 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.
+ */
+
+/*
+ * ISA attachment for attimer(4)
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/ioctl.h>
+#include <sys/device.h>
+#include <sys/proc.h>
+
+#include <machine/bus.h>
+
+#include <dev/ic/attimervar.h>
+
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+
+static int	attimer_isa_match(struct device *, struct cfdata *, void *);
+static void	attimer_isa_attach(struct device *, struct device *, void *);
+
+CFATTACH_DECL(attimer_isa, sizeof(struct attimer_softc),
+    attimer_isa_match, attimer_isa_attach, NULL, NULL);
+
+static int
+attimer_isa_match(struct device *parent, struct cfdata *match, void *aux)
+{
+	struct isa_attach_args *ia =3D aux;
+	bus_space_handle_t att_ioh;
+
+	if (ISA_DIRECT_CONFIG(ia))
+		return (0);
+
+	/* If values are hardwired to something that they can't be, punt. */
+	if (ia->ia_nio < 1 ||
+	    (ia->ia_io[0].ir_addr !=3D ISA_UNKNOWN_PORT &&
+	    ia->ia_io[0].ir_addr !=3D IO_TIMER1))
+		return (0);
+
+	if (ia->ia_niomem > 0 &&
+	    (ia->ia_iomem[0].ir_addr !=3D ISA_UNKNOWN_IOMEM))
+		return (0);
+
+	if (ia->ia_nirq > 0 &&
+	    (ia->ia_irq[0].ir_irq !=3D ISA_UNKNOWN_IRQ))
+		return (0);
+
+	if (ia->ia_ndrq > 0 &&
+	    (ia->ia_drq[0].ir_drq !=3D ISA_UNKNOWN_DRQ))
+		return (0);
+
+	if (bus_space_map(ia->ia_iot, IO_TIMER1, 4, 0, &att_ioh))
+		return 0;
+	bus_space_unmap(ia->ia_iot, att_ioh, 4);
+
+	ia->ia_io[0].ir_addr =3D IO_TIMER1;
+	ia->ia_io[0].ir_size =3D 4;
+	ia->ia_nio =3D 1;
+
+	ia->ia_niomem =3D 0;
+	ia->ia_nirq =3D 0;
+	ia->ia_ndrq =3D 0;
+
+	return 1;
+}
+
+static void
+attimer_isa_attach(struct device *parent, struct device *self, void *aux)
+{
+	struct attimer_softc *sc =3D (struct attimer_softc *)self;
+	struct isa_attach_args *ia =3D aux;
+
+	sc->sc_iot =3D ia->ia_iot;
+
+	aprint_normal(": AT Timer\n");
+
+	if (bus_space_map(sc->sc_iot, IO_TIMER1, 4, 0, &sc->sc_ioh) !=3D 0)
+		aprint_error("%s: could not map registers\n",
+		    sc->sc_dev.dv_xname);
+	else
+		attimer_attach(sc);
+}
Index: sys/arch/i386/conf/GENERIC
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.662
diff -u -r1.662 GENERIC
--- sys/arch/i386/conf/GENERIC	21 Mar 2005 14:15:27 -0000	1.662
+++ sys/arch/i386/conf/GENERIC	22 Mar 2005 22:35:57 -0000
@@ -479,6 +479,7 @@
 wskbd*		at pckbd? console ?
 wsmouse*	at pms? mux 0
=20
+attimer0	at isa?
 pcppi0		at isa?
 sysbeep0	at pcppi?
=20
Index: sys/arch/i386/conf/GENERIC.MPACPI
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC.MPACPI,v
retrieving revision 1.23
diff -u -r1.23 GENERIC.MPACPI
--- sys/arch/i386/conf/GENERIC.MPACPI	21 Mar 2005 18:10:15 -0000	1.23
+++ sys/arch/i386/conf/GENERIC.MPACPI	22 Mar 2005 22:36:15 -0000
@@ -301,6 +301,7 @@
 acpitz* 	at acpi?		# ACPI Thermal Zone
=20
 # Mainboard devices
+attimer*	at acpi?		# AT Timer
 com* 		at acpi?		# Serial communications interface
 fdc* 		at acpi?		# Floppy disk controller
 joy*		at acpi?		# Joystick/Game port
@@ -455,6 +456,7 @@
 wskbd*		at pckbd? console ?
 wsmouse*	at pms? mux 0
=20
+attimer0	at isa?
 pcppi0		at isa?
 sysbeep0	at pcppi?
=20

--2fHTh5uZTiUOsy+g--

--s/l3CgOIzMHHjg/5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQkChvtgoQloHrPnoAQLZPwgAv3DichOflnf+84bawdyxoK0ULVHSOM9Q
8dp4rMRkW+c3bMDYbzII4j5/ERHO5A8+6Uwdw84EZXcwGzammjP9ZPRruY++O8xt
T6krzWzSrV9CErb8fn7EBuI5RFYG9fLNpW7e6Inx0BX5WTihM/vTrEalD+nlmd4d
6Rzsu9SScdI8k+v4p7u90ci9cHX8Br+3zWfrptNaLoBCR19tK5HiTNvaWW+yOh4t
EyVQrDC6WfjbBUg3ljKETHhaAcA88zNOZTnoKDEJhdcMXGcV53wuK9RDN/zzle7a
Rg/wB46AVP5Ofc7g6jxHma6l+hRLJaXRlJ5rB+Sl+MSkAsMFEdAMgg==
=6K7V
-----END PGP SIGNATURE-----

--s/l3CgOIzMHHjg/5--