From nobody Thu Jan 30 21:48:45 2025 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 (78.46.105.101 [78.46.105.101]) by mx.zohomail.com with SMTPS id 1737478775205411.092143486592; Tue, 21 Jan 2025 08:59:35 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id A04A420FFC; Tue, 21 Jan 2025 16:59:30 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 3774E20CC4 for ; Tue, 21 Jan 2025 16:59:17 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Tue, 21 Jan 2025 08:59:16 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f6e66f0df0sm17502597b3.102.2025.01.21.08.59.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jan 2025 08:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737478756; x=1738083556; darn=seabios.org; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=YfxbpX4E/nhXAP+toaorUvQ4YE9t7/BexRHxpvBkiKI=; b=Ver7HJGjNxoFFlqbIMiUnRxBMu4CFQPR02KplDtXqKl1V+YKzdIqSylleQQSA0C5x8 fWUumpu2tUjUUPUwxVxPP77cBmxx/Ak2YRADZNCkVyCh0NGFbRYjjAxYhIO8/JKhWE7H gaHz/YdO1bYwymvCgc2vD5b+mNuajYUdpKUTKmmVcYYVDye+iLRnfzmdIutTtGsjBq++ YCoK2yy7lCH5Pno2Le4JjqSfZy/4OOrx8RlEc7cv8jed6tTcV2RtYaoq9J+vzoKZavdI XJVlNzDRooSBw7epO85vupHxVI+KKbkh+isAWAoLpdoqn9cc/rgLzGRQC8yzIj+8hW40 VnFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737478756; x=1738083556; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=YfxbpX4E/nhXAP+toaorUvQ4YE9t7/BexRHxpvBkiKI=; b=ULatXBt0ZUeo2F/WOjRCi/fagA6TMMMLSYRleCIyRFDYL+SdhEcN1VtxQkioKce+Sl SWdbDQDDfGP8L5LJmoOMqlX791Jc2yNQ0lCXNQyqqpTwmyMoj8sS6Gd8q/SUgbu5YR5f A3l/2aEjwU9GeWh60lfAyEBiusi2ZGX6c/3wQ6+WquuNa22uFdh4u+KoSyXFTMu0vp9Q uNIuNekTGpUMRdlNolcIedpll6THQ48ORpq5nES7px24lR5i1E/gtt8EOxdBkge78gtm +2naZdsnfuCsJvLo9hwMwGpckJX2nq4UXbuStkXTHGRB/l5YRTF0zetujyUUOWnpt1GC cpRQ== X-Gm-Message-State: AOJu0Yx7X+vMB0fxnNzRp50xD+WilL+f+s5lUJCNMyuQ9Ye4Dh78jhN1 RtS8BUJccJPUvOqugcv1PYPnj2nV7wpcuB6jiVoCiN3O0+tAYr7QpGl1/Fz7 X-Gm-Gg: ASbGncvdAhWc1KGeiZITa8nvz6sysGFd2gaTmV9upJorwxGU30SzyTP4nYi0YzKh4CZ QS52aCh/Wpq17CLhYl5Uy6rLGXjnXXfQ6mIj+WGJR950o3SYcV31yRxGmVFN2i9rSa2juv9EgHc J0oYT87F3stdXPclzLTbenHAPrwyCrwB3rWqcKjRldaaE7sGAQ4P7pFnwZhDhlvNPtOPYJF59SH bLekc0jPRi9n2Q04lFqai1LvcRCq5qjhIoBhHRdBR9CYFwGtCIzaMXL/pZZNGzRYrYE+rC8qpzH SzW4pnEUcoaTNUPQq4d/ X-Google-Smtp-Source: AGHT+IEojLuNkxR29wJ0mxoIURMnxDALE3YsMbOWZxBnrfve8IoaOtU2qsq7PSmHGnSSHS33Zd6uow== X-Received: by 2002:a05:690c:6b83:b0:6ef:7290:d482 with SMTP id 00721157ae682-6f6eb686864mr137173687b3.22.1737478755780; Tue, 21 Jan 2025 08:59:15 -0800 (PST) Message-ID: Date: Tue, 21 Jan 2025 11:59:14 -0500 MIME-Version: 1.0 To: seabios@seabios.org Content-Language: en-US From: Christopher Lentocha Message-ID-Hash: UONIWJSPO55WJALI65J3VZEWEKG2RGTD X-Message-ID-Hash: UONIWJSPO55WJALI65J3VZEWEKG2RGTD X-MailFrom: christopherericlentocha@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.6b1 Precedence: list Subject: [SeaBIOS] [PATCH] Fix AHCI Disk Detection when using EDK2 CSM 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: 1737478776453019000 Content-Type: text/plain; charset="utf-8"; format="flowed" For whatever reason, when you compile SeaBIOS in Csm16 mode, and use it under EDK2's OvmfPkg, the ATA_CMD_IDENTIFY_PACKET_DEVICE command doesn't work properly, therefore, SeaBIOS detects the "SATA HARDDISK" as a "SATA CDROM" device, in QEMU. Despite the Tianocore developers seem to have removed support for Csm16 some time ago, if we decide to remove Csm16 mode in SeaBIOS in favor of that, at least we have the last commit of Csm16 working properly and not half-broken. In order to fix this bug, I decided to add another command, that command being ATA_CMD_DEVICE_RESET, right before the ATA_CMD_IDENTIFY_PACKET_DEVICE command is called. Signed-off-by: Christopher Lentocha Reviewed-by: Gerd Hoffmann --- src/hw/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hw/ahci.c b/src/hw/ahci.c index 4f0f640..e0864fa 100644 --- a/src/hw/ahci.c +++ b/src/hw/ahci.c @@ -484,7 +484,8 @@ static int ahci_port_setup(struct ahci_port_s *port) /* start device */ cmd |=3D PORT_CMD_START; ahci_port_writel(ctrl, pnr, PORT_CMD, cmd); - + sata_prep_simple(&port->cmd->fis, ATA_CMD_DEVICE_RESET); + ahci_command(port, 0, 0, buffer, sizeof(buffer)); sata_prep_simple(&port->cmd->fis, ATA_CMD_IDENTIFY_PACKET_DEVICE); rc =3D ahci_command(port, 0, 0, buffer, sizeof(buffer)); if (rc =3D=3D 0) { --=20 2.38.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org