From nobody Fri Apr 26 15:15:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1657675590380148.01729661665252; Tue, 12 Jul 2022 18:26:30 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 9AF382D70D; Wed, 13 Jul 2022 01:26:26 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 74D722DABA for ; Wed, 13 Jul 2022 01:26:11 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Tue, 12 Jul 2022 18:26:11 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.gmail.com with ESMTPSA id q20-20020a17090676d400b0072a815f3344sm4343286ejn.137.2022.07.12.18.26.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jul 2022 18:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-transfer-encoding; bh=v4Rd1XDpST8nb//mVpnghVcFAOkiEzT5OD+/gZkpxKw=; b=NWJBE7A27rlsGZbUwq4v+aFjdLyMj6vxNciGnkNej2AYWQyxTxanEIZVied4ZzSSuL kVBf1kJhk1RJCRf0DQiGsWNoSPIWQcUte0aYeRhzjSOtQ4YzK0eIgIlFaoji1bdarncI lIGVHoM0qUFDuDMjBvNJPnSf5lf0NT5oG8Ai9HC4vOdkL9oLazg2Kf7Edc0jWZAEX6I+ OuJ2cgj4nHUy8Ym5c9oURj1HvJBlVg8IseANJzaubJ5JACNTEhtBVWg0doHWx9hyZdN+ eYiHTVEVb4K3XVwHqzwpw4zX/Jhet5hoh+0sDrifB2xJ15wI8uMsU/Xaek6VEzJcGHjW IpWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-transfer-encoding; bh=v4Rd1XDpST8nb//mVpnghVcFAOkiEzT5OD+/gZkpxKw=; b=KYrgutWz16RjtUEhv9EacACh8lF9XP/hnGPPKNwsy+U2EJEctCzDs1EiqshOoBDpSU r96DmhXTYIgXBFC/kVWfllRQYMhIbCPmeZacYxg8cPLm8KFNPVzxcI8j83/moCNXQgRX mTP3yzbQ+ODDzhBu2RfJaUBJV5c0pDUdNLY/r1xOnjNTs30PF0uZ68Kk7MQSzWjk1ZP5 p9e6HuEgUNQBI4bNXUUDXm9jDRJVTRAewXS6IrBW5Fb3jcOiBmyz7Q+rfwq9UyhRNuAg WmkarU6c/5wjvRZNdu8XBwcWFvKalHuay5iYvncw0LMRpP3ZN9ma1FkKm061ChHD3Io/ tKWg== X-Gm-Message-State: AJIora9cfiNlTxz/VKYYhHSt3GlDsoJhvcYLDP0p8gd/1n/q3AuIrJib Y8Ml8ESbhGnv5+PYMuX4YqD0w6lBwwJN6A== X-Google-Smtp-Source: AGRyM1tDABD/OeHxNE6KR6rcjmOQpr9Bxipes6du1tfap4eCyhIBTprE+KE21Qo+Zb1Qx21HrE0ZXA== X-Received: by 2002:a17:907:b08:b0:72b:1c60:4411 with SMTP id h8-20020a1709070b0800b0072b1c604411mr881799ejl.587.1657675571121; Tue, 12 Jul 2022 18:26:11 -0700 (PDT) Message-ID: <6345ae79-d99c-99ca-7fef-02218ec9eb52@gmail.com> Date: Wed, 13 Jul 2022 03:25:17 +0200 MIME-Version: 1.0 From: Petr Cvek To: seabios@seabios.org Message-ID-Hash: LWAXJJTZUENDVWSU564PL4CAUCATLNCX X-Message-ID-Hash: LWAXJJTZUENDVWSU564PL4CAUCATLNCX X-MailFrom: petrcvekcz@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.5rc1 Precedence: list Subject: [SeaBIOS] [PATCH] timer: Configure timer1 to a standard settings List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657675591814100001 Content-Type: text/plain; charset="utf-8" ASPI2DOS.SYS and KEYB.COM from Win 98 SE installation CD (and most likely other DOS versions too) depend on I/O port 0x61 bit 4 to be toggled. This requires timer 1 (I/O 0x41, legacy DRAM refresh) to be correctly set. Also Intel ICH7 Family Datasheet, chapter 5.8 states: Programming the counter to anything other than Mode 2 will result in undefined behavior for the REF_TOGGLE bit. Failing to have the timer 1 configured indeed causes affected OSes to freeze during the boot. Signed-off-by: Petr Cvek --- src/hw/timer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hw/timer.c b/src/hw/timer.c index b6f102e..b272f44 100644 --- a/src/hw/timer.c +++ b/src/hw/timer.c @@ -280,4 +280,10 @@ pit_setup(void) // maximum count of 0000H =3D 18.2Hz outb(0x0, PORT_PIT_COUNTER0); outb(0x0, PORT_PIT_COUNTER0); + + // timer1: binary count, 16bit count, mode 2 + outb(PM_SEL_TIMER1|PM_ACCESS_WORD|PM_MODE2|PM_CNT_BINARY, PORT_PIT_MOD= E); + // maximum count of 0012H =3D 66.3kHz + outb(0x12, PORT_PIT_COUNTER1); + outb(0x0, PORT_PIT_COUNTER1); } --=20 2.37.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org