From nobody Sat Aug 15 10:42:41 2026 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=jablonski.xyz Return-Path: Received: from coreboot.org (mail.coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1785250769650394.70266874966626; Tue, 28 Jul 2026 07:59:29 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 84FA054E480; Tue, 28 Jul 2026 14:59:23 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (fout-a2-smtp.messagingengine.com [103.168.172.145]) by coreboot.org (Postfix) with ESMTP id 7BE1154E475 for ; Tue, 28 Jul 2026 14:54:46 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mailfout.phl.internal (Postfix) with ESMTP id 50BD6EC01F1; Tue, 28 Jul 2026 10:54:45 -0400 (EDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by phl-compute-05.internal (MEProxy); Tue, 28 Jul 2026 10:54:45 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) 28 Jul 2026 10:54:44 -0400 (EDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by chomposaur (OpenSMTPD) with ESMTPA id 76fde7ce; Tue, 28 Jul 2026 14:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jablonski.xyz; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1785250485; x= 1785336885; bh=sRb0jhPUrxyLiX69o0NBqM2YrSNXPqPkmOMz0EFl0XQ=; b=V GT2kUu2VXrnE0JnH2z+TKDagCUYS7t5tpmoCPcwEnkjzW1L7Q9BUJEKzRA/4/34g zXj4VDjsqWXHqSD+UqzlJsi3PuWdV058uv+ZGVBkkn+n94qdJZ0xY6Pp6eOYcFp/ V9n0Y2EkApB+iIV4OHuJgIOrs8hBiA6C3+GGzuTJHOl5ihx1FRxPXZpWHv9Ty+ss eI92rwH8oBinihQ2l87ttZVVCokrd0Pqj1vmFJ1JqCx0Bq1QaD7w7w1PSFkMCkDO JAgE5p9yesdH1OZQKDpdfWKsTrXeV+JigcVExiiZ99s5ghVMANNDqhFk0nZfBXcM WmTJp74ODsk52LyTYYBuQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1785250485; x=1785336885; bh=s Rb0jhPUrxyLiX69o0NBqM2YrSNXPqPkmOMz0EFl0XQ=; b=PiBd1kpx3Jh9XLTCg N3WDMMWuYqo00/DeCCWL6yjdqkjWBoX6zhcT9mRTV/qmfW7cHoBpQVUZP4PC0V+v 993oP/58hkNMeh0gaiqkt5Itp2HlDfdBwIXVqY5K8bdpvfuVlt6IwcPoiiFynuAy RJMll45wkzMpDcp3ad5A/WaX7qX0GBgsfz3XF3A02ojbPypveEfVMSeeU5XgfeTd rmF7PFeLZVR89gLxJKSnV1ywmgtXaokj1gbKEqbs5xxyedk7GZaaPKLb2LWsHWli ghzoDGHa46MtouCsVBxjWg8zNw36yUtv3/y1++QVmGNbPbuY8Nbvfp2wbRjTE6tl 5sqmA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGVhrHEa+0mVmChf9EAIP4SrWd0g4rJLx+2Wgga6vPrkCFDuSzdX5Ef6+8aOupRvj Fri5T+JYzBUDe9yV9wz9uWALXVdAMXwjdRTOU20lmBhoKo3hVaUdUmeXMLlSRpo8nq49UD ykDJyKT7rQwihR0Hz2kkrOgxcSMwpE4K5apxdd4RElUnAL/hJTf76YHXTn3vPsuHM/3jWU ie/Z169vM65qzrqgTBWVHrl9h5pyBdV1ex010KhPDpMZ580LEqqk21tV+Xa1ilfR4YhK0O hEd+4cw94mxHk1LVr2cjjh4HzE3gRVK4u3yZeMmi3eOSTTte+3VW1tsvhjxVHlm6CBQbrT nvB4U6XjKNTKPFtmybu2VX2jqkXxrY1etHBmn7n4rNxIVrg1nI7JX+8V2e+wI8gRSQ/4gP +dg0zVmdgbNKRyc4CAWXqqUbLsFE7bvmcViLfjpPHrSfaWcfQwVOUWudfA6Wm/4GKsW9+5 5cpvy/OUtadCKC9kNPRNqI0mwVQ6BsxDXJPpmFe7U0TIZDpae+vgPRpEpLCz0v9JL54TT7 H5MSWfSQO0Lt0Wlbo46T+IKCUCi/RNIRp4KpLXYLh3KSXt0nZWOi8Xtkwel4sT0Vj5mJlE uxnDBTOXP1Of5DPvA86jKHLNzytjo3VpdGf3pKbk3YdCmOo3+tvreVKl2bag X-ME-Proxy: Feedback-ID: ib26944c1:Fastmail From: Chad Jablonski To: seabios@seabios.org Date: Tue, 28 Jul 2026 10:54:35 -0400 Message-ID: <20260728145436.1613730-2-chad@jablonski.xyz> In-Reply-To: <20260728145436.1613730-1-chad@jablonski.xyz> References: <20260728145436.1613730-1-chad@jablonski.xyz> MIME-Version: 1.0 X-Spam-Level: *** Message-ID-Hash: A4T7STNGCBSTW6AC5ZM3J4JGYCVOWWVO X-Message-ID-Hash: A4T7STNGCBSTW6AC5ZM3J4JGYCVOWWVO X-MailFrom: chad@jablonski.xyz X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header Cc: BALATON Zoltan , Gerd Hoffmann , Chad Jablonski X-Mailman-Version: 3.3.11b1 Precedence: list Subject: [SeaBIOS] [PATCH v2 1/2] atiext: Implement ATI tables in atiext.c 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 (found 2 invalid signatures) X-ZM-MESSAGEID: 1785250770668158500 Content-Type: text/plain; charset="utf-8" From: Kevin O'Connor Move the definitions in ati-tables.S to atiext.c . Signed-off-by: Kevin O'Connor Signed-off-by: Chad Jablonski --- vgasrc/ati-tables.S | 43 -------------------------------- vgasrc/atiext.c | 61 +++++++++++++++++++++++++++++++++++++++++++++ vgasrc/vgaentry.S | 6 ++++- 3 files changed, 66 insertions(+), 44 deletions(-) delete mode 100644 vgasrc/ati-tables.S diff --git a/vgasrc/ati-tables.S b/vgasrc/ati-tables.S deleted file mode 100644 index cdbde2fa..00000000 --- a/vgasrc/ati-tables.S +++ /dev/null @@ -1,43 +0,0 @@ -// -// Fake ati bios tables. -// -// aty128fb and radeonfb try to gather informations from these tables, -// so add some stuff here to make the drivers happy. Specifically -// radeonfb needs the pll information, otherwise it'll crash with a -// division by zero ... -// - .org 0x48 - .word _ati_main - - // main info - .org 0x50 -_ati_main: - .org 0x50 + 0x30 - .word _ati_pll - .org 0x50 + 0x50 - .word _ati_connector - - // pll info - .org 0x100 -_ati_pll: - .word 0 // ??? (not used by radeonfb) - .word 0 - .word 0 - .word 0 - .word 23000 // sclk - .word 23000 // mclk - .word 0 - .word 2700 // ref_clk - .word 4 // ref_div - .long 12000 // ppll_min - .long 35000 // ppll_max - - // connector info - .org 0x140 -_ati_connector: - .byte 0x10 // one chip - .byte 0x01 // one connector - .word 0x3000 // type DVI-I - .word 0 // end of list - - .org 0x200 diff --git a/vgasrc/atiext.c b/vgasrc/atiext.c index 69dfd46e..f003eea8 100644 --- a/vgasrc/atiext.c +++ b/vgasrc/atiext.c @@ -338,6 +338,65 @@ static void ati_i2c_edid_rage128(void) dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid"); } =20 +/**************************************************************** + * Fake ati bios tables + ****************************************************************/ + +// aty128fb and radeonfb try to gather informations from these tables, +// so add some stuff here to make the drivers happy. Specifically +// radeonfb needs the pll information, otherwise it'll crash with a +// division by zero ... +struct ati_main_table_s { + u8 pad_0[48]; + u16 pll_table; + u8 pad_50[30]; + u16 connector_table; + u8 pad_82[94]; +} PACKED; + +struct ati_pll_table_s { + u8 pad_0[8]; + u16 sclk; + u16 mclk; + u8 pad_12[2]; + u16 ref_clk; + u16 ref_div; + u32 ppll_min; + u32 ppll_max; + u8 pad_26[38]; +} PACKED; + +struct ati_connector_table_s { + u8 num_chip; + u8 num_connector; + u16 flags; + u16 next; +} PACKED; + +extern u16 _rom_header_ati_table_anchor; +static struct ati_main_table_s ati_main_table VAR16 __aligned(16); +static struct ati_pll_table_s ati_pll_table VAR16 __aligned(16) =3D { + .sclk =3D 23000, + .mclk =3D 23000, + .ref_clk =3D 2700, + .ref_div =3D 4, + .ppll_min =3D 12000, + .ppll_max =3D 35000, +}; +static struct ati_connector_table_s ati_connector_table VAR16 __aligned(16= ) =3D { + .num_chip =3D 0x10, + .num_connector =3D 1, + .flags =3D 0x3000, +}; + +static void +ati_table_setup(void) +{ + SET_VGA(ati_main_table.pll_table, (u32)&ati_pll_table); + SET_VGA(ati_main_table.connector_table, (u32)&ati_connector_table); + SET_VGA(_rom_header_ati_table_anchor, (u32)&ati_main_table); +} + /**************************************************************** * init ****************************************************************/ @@ -379,6 +438,8 @@ ati_setup(void) SET_VGA(VBE_total_memory, totalmem); SET_VGA(ati_io_addr, io_addr); =20 + ati_table_setup(); + // Validate modes struct generic_svga_mode *m =3D svga_modes; unsigned int mcount =3D GET_GLOBAL(svga_mcount); diff --git a/vgasrc/vgaentry.S b/vgasrc/vgaentry.S index f9624fce..14e557a1 100644 --- a/vgasrc/vgaentry.S +++ b/vgasrc/vgaentry.S @@ -41,7 +41,11 @@ _rom_header_signature: .asciz "IBM" =20 #if CONFIG_VGA_ATI -#include "ati-tables.S" + .org 0x48 + .global _rom_header_ati_table_anchor +_rom_header_ati_table_anchor: + .word 0 + .align 16 #endif =20 /**************************************************************** --=20 2.54.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org From nobody Sat Aug 15 10:42:41 2026 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=jablonski.xyz Return-Path: Received: from coreboot.org (mail.coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 178525095980890.16676182913227; Tue, 28 Jul 2026 08:02:39 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 18B3F54E477; Tue, 28 Jul 2026 15:02:28 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) by coreboot.org (Postfix) with ESMTP id D6DC754E471 for ; Tue, 28 Jul 2026 14:54:46 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mailfhigh.phl.internal (Postfix) with ESMTP id 06A351400141; Tue, 28 Jul 2026 10:54:46 -0400 (EDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by phl-compute-04.internal (MEProxy); Tue, 28 Jul 2026 10:54:46 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) 28 Jul 2026 10:54:45 -0400 (EDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by chomposaur (OpenSMTPD) with ESMTPA id 3c036ba5; Tue, 28 Jul 2026 14:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jablonski.xyz; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1785250486; x= 1785336886; bh=+/jGnjWtIHwWJ7UkPM9N0MGTIXDjpXVoXt5jbrAYWmI=; b=X cSObsrvPQNxhfMV6dQlOESUagzztIoqH+HC7ffcFoUYP4x0a1tjmGdA6y6lWAe8b 20RBalAWuEhoneQ83iiORycCmDi2E1jKhyNAuuYvG8uriwhXLv3W12TKl+FmYOcV W1J6zQ6PxpfdMscU4QU9BIzzhs6YPusOcKYdgw3aXQc7JK9yp96pwknh0Zm7DRHa ltyKSXvrSea2U2e4c8IA9H7nn2HZhkNsQx+2AK13VmPyy5CF8WYN0i94XOi+zf/g 1PRkKmQ3gh130fbvLwuowpe0JZ109aOq+Vu6+qgr5JtOInySFEc+5+bsqYL1tzN6 BqOEsy/s4iYL03DpLK4mQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1785250486; x=1785336886; bh=+ /jGnjWtIHwWJ7UkPM9N0MGTIXDjpXVoXt5jbrAYWmI=; b=nxozfC9tZY6ZpkYom vW9ViD1+kRyVjuF8/kkGTCthFa1Bu7TZ+1izZWmVCKvywjvQDdrlJ1uOhHBtJduY T6pe9TyePDui+ceSZTaAc2sOJgv6GdfZTqnVdeIIYgQCpYKK/YFyN1MAE7At5h6A aKxf1WI/U19hPHhkHbuy2Hvn22GnDZWcMl5pbheAzkn6V7Tah4DZAPoa4KbvDUUB VPeFpq6EA8w8UsSEPcM1QedAXuoG7VPGVw/uoY6Ao3qfRkgtiy1di6qkosaUzJHu YjpOIY89/I3ZjV44BQz/r7Z3bZsOu+DaTDdwSYoBcLD2sCBv7qaoQsQwsTqVfzhV OcAtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFeyaZhp11HNPmlcBpKk+tddj3NWQb3+uIDKRITpwiFJ9Zxmm4rFSxYFt3VPVJq/+ 6u9idYRs6skZrRtDPOGnLevLAiwM+JEO3PPGYD90VrOZu3fT3zl6I+ZeWNQsm+H9ywE/KM 0AF+Q0WzMgG+TrEU8ESQfowM0XnwUJiMGZe1oErulshYxoELrtmtdY5eq+vOfLWA4IwCp7 J9HqbLw/VCBNGsH7C1+lyERApkSdq45zbhz8cCp/3+5nMwtJmr/rZDzjsX+SDdD0E7pI7p w1H5Y1CDOaJ67AGqpU0IdN8+paeKoG9pVGiBo42EruR0QC6MMdZxl1k33B82YgqamEmHOW 7tPc10c5BY3jHeWulmoNakZXCZ1Lo8IDe6hkOyR6IKsmI2aEPd3jez+BPuKmVlQe8dHu9A R68jxSdwNTDy2TVlTfjaUYJRlRPwZhqzmGX31OBtrJcxKgtgoC6DYxVh/KYtBsMWQsF5vB kg+M5Nx1pMT2LUBD2qKcQ8CHa2/0om1o1GCIcjDssuKsQL+3XLh92YMUmpB/0kb9jv05jK QiiBk2LVnnACE0ZhCmA9DSV6azNMO9Fgx5qf0zVZ/8tcGs9dyJaOJypIWCtftuPaeCcbeC VSDvIicg0Wm/XKh+9gnmD8Alr+d/5mAlqj6AYGznsx4EYl20Dht1FJgASRdw X-ME-Proxy: Feedback-ID: ib26944c1:Fastmail From: Chad Jablonski To: seabios@seabios.org Date: Tue, 28 Jul 2026 10:54:36 -0400 Message-ID: <20260728145436.1613730-3-chad@jablonski.xyz> In-Reply-To: <20260728145436.1613730-1-chad@jablonski.xyz> References: <20260728145436.1613730-1-chad@jablonski.xyz> MIME-Version: 1.0 X-Spam-Level: *** Message-ID-Hash: TXRRSQRGQR47YXSHMDO6RCG2ECQOGFSW X-Message-ID-Hash: TXRRSQRGQR47YXSHMDO6RCG2ECQOGFSW X-MailFrom: chad@jablonski.xyz X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header Cc: BALATON Zoltan , Gerd Hoffmann , Chad Jablonski X-Mailman-Version: 3.3.11b1 Precedence: list Subject: [SeaBIOS] [PATCH v2 2/2] atiext: Fix bios tables for radeon KMS driver 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 (found 2 invalid signatures) X-ZM-MESSAGEID: 1785250960762158500 Content-Type: text/plain; charset="utf-8" This fixes two issues when running ati-vga with model=3Drv100 under QEMU using a KMS driver. First, the radeon KMS driver does an additional check when looking up COMBI= OS table entries. It checks a header size field to validate that the entry falls in the header region. Prior to this patch that size field is zero which causes the driver to fallback to another method (CLOCK_CNTL registers) also resulting in bad values and a division by zero. Second, the connector info section needs a non-zero value in the DDC type field. Zero causes the radeon driver to fail to initialize the DDC bus and then no connectors are found. DDC_DVI (0x2) is used here so that the GPIO_DVI_DDC register is used for the radeon. From what I have seen r128 drivers ignore this field entirely. Tested on Debian Squeeze (Linux 2.6.32) and Debian Trixie (Linux 6.12.94). Signed-off-by: Chad Jablonski Reviewed-by: Paul Menzel --- vgasrc/atiext.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vgasrc/atiext.c b/vgasrc/atiext.c index f003eea8..073408ba 100644 --- a/vgasrc/atiext.c +++ b/vgasrc/atiext.c @@ -347,7 +347,9 @@ static void ati_i2c_edid_rage128(void) // radeonfb needs the pll information, otherwise it'll crash with a // division by zero ... struct ati_main_table_s { - u8 pad_0[48]; + u8 pad_0[6]; + u8 size; + u8 pad_7[41]; u16 pll_table; u8 pad_50[30]; u16 connector_table; @@ -374,7 +376,9 @@ struct ati_connector_table_s { } PACKED; =20 extern u16 _rom_header_ati_table_anchor; -static struct ati_main_table_s ati_main_table VAR16 __aligned(16); +static struct ati_main_table_s ati_main_table VAR16 __aligned(16) =3D { + .size =3D sizeof(struct ati_main_table_s), +}; static struct ati_pll_table_s ati_pll_table VAR16 __aligned(16) =3D { .sclk =3D 23000, .mclk =3D 23000, @@ -386,7 +390,7 @@ static struct ati_pll_table_s ati_pll_table VAR16 __ali= gned(16) =3D { static struct ati_connector_table_s ati_connector_table VAR16 __aligned(16= ) =3D { .num_chip =3D 0x10, .num_connector =3D 1, - .flags =3D 0x3000, + .flags =3D 0x3200, // type DVI-I and use DVI DDC }; =20 static void --=20 2.54.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org