From patchwork Tue Oct 4 16:42:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 1686026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) 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=) 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=10dVET6c; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mhk6C3bdDz1yqj for ; Wed, 5 Oct 2022 03:43:15 +1100 (AEDT) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zd57EEE/p9+ezOcXV9EOh0UorUlsv3otcFfdm7rTdEI=; b=10dVET6cHveQVX XXEgZB1DTtGVRo+PeNyEOL8aJF/4FIbhGIaGqVdpVe9NOZgHveNgnnE5Y7B9LAl5DmU6zs7JfjTbV /SrBVUVxSQcMZpNZejFxTt38g57bfQtNzOYzMLYAdOnNDtl39hk/cwrbTGv/9DdYTs/rBpHj6TJ2b FjvB6b7TYbbtwg3a/9bU4BVKKA/uTrRbfQYSOWzJXd32aOHorYgV89w4g9PwcdYg81I3HFCHzEN7H J6K+Xx0Fjn6YdVE6lvl0nZI2rVnxKfTMPIJrDTLpsCZKCjkYiAJuSSRd1PwrzuwGGVkv72+SuKVE5 zZ5LM7tOIZOEdQqBh8dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofl0U-00AE1L-7t; Tue, 04 Oct 2022 16:42:58 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofl0O-00ADz3-Fg for opensbi@lists.infradead.org; Tue, 04 Oct 2022 16:42:55 +0000 Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=phil.lan) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ofl0K-0003ZF-79; Tue, 04 Oct 2022 18:42:48 +0200 From: Heiko Stuebner To: opensbi@lists.infradead.org Cc: guoren@kernel.org, cmuellner@linux.com, philipp.tomsich@vrull.eu, samuel@sholland.org, atishp@atishpatra.org, Heiko Stuebner Subject: [PATCH v5 4/5] platform: generic: add extensions_init handler and platform-override Date: Tue, 4 Oct 2022 18:42:26 +0200 Message-Id: <20221004164227.1381825-5-heiko@sntech.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221004164227.1381825-1-heiko@sntech.de> References: <20221004164227.1381825-1-heiko@sntech.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_094252_576947_C517A544 X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Init of non-standard extensions is a platform-specific thing, so allow generic platforms to do this via a platform-override. Signed-off-by: Heiko Stuebner --- platform/generic/include/platform_override.h | 3 +++ platform/generic/platform.c | 10 ++++++++++ 2 files changed, 13 insertions(+) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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 Init of non-standard extensions is a platform-specific thing, so allow generic platforms to do this via a platform-override. Signed-off-by: Heiko Stuebner Reviewed-by: Anup Patel --- platform/generic/include/platform_override.h | 3 +++ platform/generic/platform.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/platform/generic/include/platform_override.h b/platform/generic/include/platform_override.h index e55da25..7f1558d 100644 --- a/platform/generic/include/platform_override.h +++ b/platform/generic/include/platform_override.h @@ -10,6 +10,7 @@ #ifndef __PLATFORM_OVERRIDE_H__ #define __PLATFORM_OVERRIDE_H__ +#include #include #include @@ -22,6 +23,8 @@ struct platform_override { void (*early_exit)(const struct fdt_match *match); void (*final_exit)(const struct fdt_match *match); int (*fdt_fixup)(void *fdt, const struct fdt_match *match); + int (*extensions_init)(const struct fdt_match *match, + struct sbi_hart_features *hfeatures); int (*vendor_ext_check)(long extid, const struct fdt_match *match); int (*vendor_ext_provider)(long extid, long funcid, const struct sbi_trap_regs *regs, diff --git a/platform/generic/platform.c b/platform/generic/platform.c index bf51aba..595b0fd 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -204,6 +204,15 @@ static void generic_final_exit(void) generic_plat->final_exit(generic_plat_match); } +static int generic_extensions_init(struct sbi_hart_features *hfeatures) +{ + if (generic_plat && generic_plat->extensions_init) + return generic_plat->extensions_init(generic_plat_match, + hfeatures); + + return 0; +} + static int generic_domains_init(void) { return fdt_domains_populate(fdt_get_address()); @@ -257,6 +266,7 @@ const struct sbi_platform_operations platform_ops = { .final_init = generic_final_init, .early_exit = generic_early_exit, .final_exit = generic_final_exit, + .extensions_init = generic_extensions_init, .domains_init = generic_domains_init, .console_init = generic_console_init, .irqchip_init = fdt_irqchip_init,