From patchwork Wed Sep 2 15:04:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Monin?= X-Patchwork-Id: 2296770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gMacEDP7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=TvcJQFgr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hZmH25TNxz1xwZ for ; Thu, 03 Sep 2026 01:04:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=t4k+45aCcKhNuePICpGYz7FT6KkldFQ6reqg2YRaebE=; b=gMacEDP7o2/xS1 s0axLWwJzJfCbyt5CbBIQEfMuFcF4WbsL7AW9mmlvVGmrxjpX524xehIplheTOEUdpKBm1SpgLHeZ FNUTZN9kmC6ByIrdOIR8PJONH9huXPAM88lBDKwHF3UAv0OQLa6E5xXzHxdNnCi97TnPKGdHKHlxl 6ktkc+T31KfyQSAdZTn38a0O5BU6P1fRzKBjpkM1pnGpK/UAiYD7RFNG7XgafhbR2a3k+UGv5L1oZ 1CN1aZ5DfitubUUESpd51FgHfOakAET4pAmMwPorhZrR9Gf15kdn2hSrMN1xU5K4T6vyFOrLPifY9 buWvkiSxCkIm13s8oTqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1mVx-0000000F2iJ-4BGN; Wed, 02 Sep 2026 15:04:37 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1mVu-0000000F2hu-1CXH for opensbi@lists.infradead.org; Wed, 02 Sep 2026 15:04:36 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 060594E414CD; Wed, 2 Sep 2026 15:04:30 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C4D186053C; Wed, 2 Sep 2026 15:04:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7E53E11C7931C; Wed, 2 Sep 2026 17:04:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1788361465; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=iKKlNpVLjkMLT4C+bDyVGRSn9JyU716Ofq+8tgAtUDA=; b=TvcJQFgrBIyJaiu82TvIPS8l6VBagd9gCMqzohFOCaY6aVQxBok+YN/pp6tV0qElf1x/1C s69WTNzOBSufGuOhfBIZlsmIC+PlfprPvy8+jmfwfbeMrHyT6u1W6ciCRqYD5fdWOWWet6 Jvm5jNR3KsISu99Hk/QBSkNyyznNYy8E5VYdnhzEuVf2rkcagEFJEtgZ0AelLWdurOjqqP JJBkdZV53kmUspJH3sweeanNYVQLQcqdAYLS7qvVJgl5gUqOfv1zp3w4iaOJ6KYJaoGunm z2m4vKoZyGumEtIcFUWOrWJBFZzIST7wDlrnl+I1AiJGil8dcGfKgQd9EcnhAg== From: =?utf-8?q?Beno=C3=AEt_Monin?= Date: Wed, 02 Sep 2026 17:04:07 +0200 Subject: [PATCH] platform: generic: metanoia/mt2824: configure PMA for DSP memory regions MIME-Version: 1.0 Message-Id: <20260902-mt2824-pma-v1-1-ada8f836365d@bootlin.com> X-B4-Tracking: v=1; b=H4sIAOY6mGoC/yXMQQ5AMBBA0avIrDWpSTXqKmJBDUZSpEUk4u6K5 Vv8f0EgzxSgTC7wdHDgZY7I0gTs2MwDCe6iASVqaSQKt2GBSqyuEb00VhmdW0UGYrB66vn8ZlX 9O+ztRHZ7D3DfD8/xXSJuAAAA X-Change-ID: 20260902-mt2824-pma-f09c4965c4e9 To: opensbi@lists.infradead.org Cc: Anup Patel , =?utf-8?b?UmFuZG9scGggU2hlbmctS2FpIExp?= =?utf-8?b?bijmnpfogZblh7Ep?= , Jun Chang , Thomas Petazzoni , =?utf-8?q?Beno=C3=AEt_Mon?= =?utf-8?q?in?= X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260902_080434_491118_8EAD69EF X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__Set_up_the_memory_attribute_for_the_XO?= =?unknown-8bit?q?R_RAM=2C_MRAS_memory=2C?= =?unknown-8bit?q?_and_RSC_table_used_by_the_DSPs_as_non-cacheable_and_buffer?= =?unknown-8bit?q?able_during_final?= =?unknown-8bit?q?_init=2E_Signed-off-by=3A_Beno=C3=AEt_Monin_=3Cbenoit=2Emon?= =?unknown-8bit?q?in=40bootlin=2Ecom=3E_---_platform/generic/metanoia/mt2824?= =?unknown-8bit?q?/mt2824=2Ec?= =?unknown-8bit?q?_=7C_47_+++++++++++++++++++++++++++++++_1_file_changed=2C_4?= =?unknown-8bit?q?7_insertions=28+=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-2=2E1_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_SPF=5FHELO=5FPASS__________SPF=3A_HELO_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_-1=2E9_BAYES=5F00_______________BODY=3A_Bayes_spam_probabi?= =?unknown-8bit?q?lity_is_0_to_1=25?= =?unknown-8bit?q?_=5Bscore=3A_0=2E0000=5D?= =?unknown-8bit?q?_-0=2E0_DMARC=5FPASS_____________DMARC_pass_policy?= X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Set up the memory attribute for the XOR RAM, MRAS memory, and RSC table used by the DSPs as non-cacheable and bufferable during final init. Signed-off-by: Benoît Monin Reviewed-by: Anup Patel --- platform/generic/metanoia/mt2824/mt2824.c | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) --- base-commit: 35511bc6ee1c9c17b6a89b44c52e2044bb51b979 change-id: 20260902-mt2824-pma-f09c4965c4e9 Best regards, -- Benoît Monin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com diff --git a/platform/generic/metanoia/mt2824/mt2824.c b/platform/generic/metanoia/mt2824/mt2824.c index a34304b9..970e15e7 100644 --- a/platform/generic/metanoia/mt2824/mt2824.c +++ b/platform/generic/metanoia/mt2824/mt2824.c @@ -6,13 +6,60 @@ * Jun Chang */ +#include #include #include #include +#include + +#define MT2824_XOR_RAM_BASE 0x00100000ULL +#define MT2824_XOR_RAM_SIZE 0x00040000ULL + +#define MT2824_MRAS_MEM_BASE 0x60000000ULL +#define MT2824_MRAS_MEM_SIZE 0x20000000ULL + +#define MT2824_RSCTABLE_BASE 0x81000000ULL +#define MT2824_RSCTABLE_SIZE 0x00010000ULL + +static const struct andes_pma_region metanoia_mt2824_pma_regions[] = { + { + .pa = MT2824_XOR_RAM_BASE, + .size = MT2824_XOR_RAM_SIZE, + .flags = ANDES_PMACFG_ETYP_NAPOT | + ANDES_PMACFG_MTYP_MEM_NON_CACHE_BUF, + }, + { + .pa = MT2824_MRAS_MEM_BASE, + .size = MT2824_MRAS_MEM_SIZE, + .flags = ANDES_PMACFG_ETYP_NAPOT | + ANDES_PMACFG_MTYP_MEM_NON_CACHE_BUF, + }, + { + .pa = MT2824_RSCTABLE_BASE, + .size = MT2824_RSCTABLE_SIZE, + .flags = ANDES_PMACFG_ETYP_NAPOT | + ANDES_PMACFG_MTYP_MEM_NON_CACHE_BUF, + }, +}; + +static int metanoia_mt2824_final_init(bool cold_boot) +{ + void *fdt = fdt_get_address_rw(); + int rc; + + /* Set the DSP memory regions attributes */ + rc = andes_pma_setup_regions(fdt, metanoia_mt2824_pma_regions, + array_size(metanoia_mt2824_pma_regions)); + if (rc) + return rc; + + return generic_final_init(cold_boot); +} static int metanoia_mt2824_platform_init(const void *fdt, int nodeoff, const struct fdt_match *match) { + generic_platform_ops.final_init = metanoia_mt2824_final_init; generic_platform_ops.extensions_init = andes_pmu_extensions_init; generic_platform_ops.pmu_init = andes_pmu_init; generic_platform_ops.vendor_ext_provider = andes_sbi_vendor_ext_provider;