Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C6C6C77B7C for ; Wed, 2 Jul 2025 13:27:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D38710E6FF; Wed, 2 Jul 2025 13:27:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="uZf9ps3A"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/orayg3z"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="uZf9ps3A"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/orayg3z"; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF8E010E6FD for ; Wed, 2 Jul 2025 13:27:39 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 24B491F445; Wed, 2 Jul 2025 13:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1751462858; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V6KswnGqRNZjEz3fP2Vz+Twx0qaAMbPv4a0n3/Lcqhs=; b=uZf9ps3A1ugPBRPhlwKjpvyF+Vg8sHIGas2UzXoYrlQXPcKtXS2e58z54NSvlw9YQTWESz h5Qwdx9t+WJCWmiBTXQ0xVhz3mukvkiAVWQkrT6TJ13gemHqwxU1T/KY+K9dUXys+ch8Fm 2phx5RV6165M1pcNCkxdqz3Tn4P1EvA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1751462858; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V6KswnGqRNZjEz3fP2Vz+Twx0qaAMbPv4a0n3/Lcqhs=; b=/orayg3zqHcT/9Lu3TI7RAag00Mkrt7drBsa5ufBV8T1K0bbCtI8dT1uD3izvho+Hw9Gg2 DiBNh1Vs9IjdyoDw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=uZf9ps3A; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/orayg3z" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1751462858; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V6KswnGqRNZjEz3fP2Vz+Twx0qaAMbPv4a0n3/Lcqhs=; b=uZf9ps3A1ugPBRPhlwKjpvyF+Vg8sHIGas2UzXoYrlQXPcKtXS2e58z54NSvlw9YQTWESz h5Qwdx9t+WJCWmiBTXQ0xVhz3mukvkiAVWQkrT6TJ13gemHqwxU1T/KY+K9dUXys+ch8Fm 2phx5RV6165M1pcNCkxdqz3Tn4P1EvA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1751462858; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V6KswnGqRNZjEz3fP2Vz+Twx0qaAMbPv4a0n3/Lcqhs=; b=/orayg3zqHcT/9Lu3TI7RAag00Mkrt7drBsa5ufBV8T1K0bbCtI8dT1uD3izvho+Hw9Gg2 DiBNh1Vs9IjdyoDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F15291369C; Wed, 2 Jul 2025 13:27:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id TchwOckzZWj0MAAAD6G6ig (envelope-from ); Wed, 02 Jul 2025 13:27:37 +0000 From: Thomas Zimmermann To: airlied@redhat.com, jfalempe@redhat.com Cc: dri-devel@lists.freedesktop.org, Thomas Zimmermann Subject: [PATCH 00/10] drm/ast: Split POST code per hardware gen Date: Wed, 2 Jul 2025 15:12:48 +0200 Message-ID: <20250702132431.249329-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.50.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Queue-Id: 24B491F445 X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the POST code for each hardware generation into a separate source file. Split some functions per gen, as necessary. Makes the code more maintainable. Support for future hardware generations can now be added easily in a new source file without interfering with existing code. Gen3 and Gen5 share their POST code with earlier hardware generations. The other generations have individual POST. Patch 1 makes the few shared cross-gen helpers available. Patches 2 to 5 move individual POST functionality into separate files, split by hardware generation and addresses some coding-style issues. Patches 6 and 7 fix the use of struct ast_dramstruct to be less of a blackbox. It's used for DRAM initialization in Gen1 and Gen2 hardware. Patch 8 splits up default settings for various registers. This brings up an issue with Gen7, which likely uses outdated values from Gen1. Patches 9 and 10 attempt to fix the default settings for Gen7. It's done separately from the rest, so it can be bisected and reverted easily, if necessary. Tested on AST2600 (Gen7) and AST2500 (Gen6). Thomas Zimmermann (10): drm/ast: Declare helpers for POST in header drm/ast: Move Gen7+ POST code to separate source file drm/ast: Move Gen6+ POST code to separate source file drm/ast: Move Gen4+ POST code to separate source file drm/ast: Move Gen2+ and Gen1 POST code to separate source files drm/ast: Move struct ast_dramstruct to ast_post.h drm/ast: Handle known struct ast_dramstruct with helpers drm/ast: Split ast_set_def_ext_reg() by chip generation drm/ast: Gen7: Disable VGASR0[1] as on Gen4+ drm/ast: Gen7: Switch default registers to gen4+ state drivers/gpu/drm/ast/Makefile | 5 + drivers/gpu/drm/ast/ast_2000.c | 149 ++ drivers/gpu/drm/ast/ast_2100.c | 348 +++++ drivers/gpu/drm/ast/ast_2300.c | 1328 ++++++++++++++++ drivers/gpu/drm/ast/ast_2500.c | 569 +++++++ drivers/gpu/drm/ast/ast_2600.c | 49 + drivers/gpu/drm/ast/ast_dram_tables.h | 207 --- drivers/gpu/drm/ast/ast_drv.c | 2 +- drivers/gpu/drm/ast/ast_drv.h | 17 +- drivers/gpu/drm/ast/ast_post.c | 2027 +------------------------ drivers/gpu/drm/ast/ast_post.h | 50 + 11 files changed, 2536 insertions(+), 2215 deletions(-) create mode 100644 drivers/gpu/drm/ast/ast_2000.c create mode 100644 drivers/gpu/drm/ast/ast_2100.c create mode 100644 drivers/gpu/drm/ast/ast_2300.c create mode 100644 drivers/gpu/drm/ast/ast_2500.c create mode 100644 drivers/gpu/drm/ast/ast_2600.c delete mode 100644 drivers/gpu/drm/ast/ast_dram_tables.h create mode 100644 drivers/gpu/drm/ast/ast_post.h -- 2.50.0