From patchwork Wed Dec 2 10:26:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 5124 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8318D3F336 for ; Wed, 2 Dec 2026 11:28:05 +0100 (CET) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-49a4e506dddsf634090f8f.1 for ; Wed, 02 Dec 2026 02:28:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1796207285; cv=pass; d=google.com; s=arc-20260327; b=D4F+AshSlECHfg303B/GBt3TNoQGkdtwShJxpPpws4YqpZvbYFKWOLR9oYqcTF0AUm 2eLteQ4dKYrcukjAiy3Ax09AwGHneGktlznzqi/r+fz1lQNfYEq7eNeND6B26xo4UzFV aYfDx1fcXJIcCwBNvB2JMJvG2ASgaf6sAZuPPUYWnIE4h/UB1g6/v53ocWA7mCpy0+wR u0ux3q4SdilWoy8MEzCJpwYQw4PA6atm30jo1NizNs9V63XANIyCbW4cu3DyIyeiluRU pWF04Q8ETEpmXEW49y14Uv101kAW5Anjo5M8UkjLPbVCOsnRdQQ7xx+iKqCS+t7u6yGq J/Zg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=iKw4CT3Flrw2xOy3bNL7VMgP8XgYhdq9b6NY/tNcAJU=; fh=BxcQfvgsY4/ybZZUAQ8y53Uyh90ZSN1yTaYNGSlG2ms=; b=PSuTZGV85+owvOaeeH8Pu45pdjZF0o59aNA4xxEUGxy/QZ/TQ9FWV2pY0gqOUrrH9r vWUqjg+rrFRPseR2sMPuv8zEdrU6eRhbBNPQRgcmq9D94GjgFqGdPekKR8v7u/mhRLzm ldmyMZtQ/bHCdRlqe1KApRuUBQKgcFgodi8o9g76AmGaFKXuTDHIPEINF2RmPjkyggQZ A4uZw9nav+6ZcPnxBSscNmb2AjrFORL5JbpQA0PLBoEfTUSVChnGgyyoNfX8uDN6KJEa H6EMp+u8EiddC1UDf8k5+lCGp9/sSj2dMVbjIX1MCUW6jznTCYrTEqHFxr7RLA/1nGMh 3Sig==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IlBGsJBX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1796207285; x=1796812085; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-type :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to:content-type; bh=iKw4CT3Flrw2xOy3bNL7VMgP8XgYhdq9b6NY/tNcAJU=; b=miEIJqXk1y3Xpn8rYtFyY1JUgDescqcKET+9ZdZxC9w+/krvQHxk2DldeFV+86k1ui mWDt9Jq2xmzfdrmcMil/Z4EQvTGTrKdXZujP1LX9w7oF+oarPFzw1e2hBf7twWhBUlQK OuFBCLwBbHTl08QyvEoKgW7tdaKrC91k/XqUE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207285; x=1796812085; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :content-type:x-original-authentication-results:x-original-sender :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-gg:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iKw4CT3Flrw2xOy3bNL7VMgP8XgYhdq9b6NY/tNcAJU=; b=167Akg1ZB7k0Lpq2pBMmni+BoC/Hf3zZq+lUj+fgG5f2bxdKoBLXTCBWWhCUaqMRrA fIAq2FEc+ydyc7sbKXo9NIhM1e0mRXHismuduzEodS29F5caMXZnpInqPLKo0LvbIN5Q jxP9lIzVVJsdL4k1SSsBwbyH2+vWo94f9xqU76uexSG4XRpuuJbUFQ+Xqwk7xjaCoteH mgQj0TQR0F6dtpQc+pyv+kZsik9DRjpXjjNuDZcKDHVoOw9BbiqP5+RsNleImvFhZdVs e0TNnCW+Cf+YG/pdEPwc74IR8/uLRv/fiR3GKCz61l9BcqtOL9Nn90Oq/joOmfkW7N1D 1jfw== X-Forwarded-Encrypted: i=2; AL+hErEhmpLO0v4fH+PwOwiKyFL2+nnfV1R1ZcJruRjWx+2O0zmnq1VsvlwpdeLNwuiEIKD6PQI9JHKst+gp56iY@patchwork.amarulasolutions.com X-Gm-Message-State: APuU4Z/yYyFWh310okgZ5V7XHUubZn9PmBGbRhqhVxY2hxLjcE6XHeyV qKtNJJTObzKL29f/TjRrwttLQB9mAiY3s91C+uoZyPjmBcMxkg7kgWgOyG39i41LVNfAvw== X-Received: by 2002:a05:600c:154c:b0:4ad:5ec2:d3b3 with SMTP id 5b1f17b1804b1-4bb887f43d8mr770076355e9.1.1796207285144; Wed, 02 Dec 2026 02:28:05 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com; h="ATskLddw6TiRSpb6KENVoZunAuZ9HWW1AbjgSAf3yoQJhvgF3g==" Received: by 2002:a05:600d:82c8:b0:4bb:666c:6faf with SMTP id 5b1f17b1804b1-4bb88f1942als79287525e9.0.-pod-prod-00-eu; Wed, 02 Dec 2026 02:28:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFpivB8aaiKI7ZjzyQW5lolqCrc0UfCWlBd5MPIx4L45rPPpYa/HHvnsA8SEMFUG4NUqQ1ra/Li3jB/Y8ss@amarulasolutions.com X-Received: by 2002:a05:600c:41c3:b0:4bb:6a60:56fd with SMTP id 5b1f17b1804b1-4bb860f6a6emr588399195e9.1.1796207283893; Wed, 02 Dec 2026 02:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796207283; cv=none; d=google.com; s=arc-20260327; b=kj1wtqIGSSw5UCP+xPhVlxK6Q+wJmbtzHsNTzr/gH0Nci5iefVzjGc6ldHejyr3ROU HOXVChrnL9uWGadEQsY/rDtHRzfjd0sxFGAFIlxJDjVl1vABf5gLoBwdVr0E9JrTo7Ye q3qUIKPo8hiamnyq6DD0zPIfdoz8jaHxYOlk+GJbNSR8R/uYCF/c6B40et9TnLJ9fL54 rPMxnj/k7eOe4EsLq+SzdKKvPEp959WE1CJuSp3aIPsJIHhtBWfOA7rN0cLDey4Ggs2C xacoatgj3qXudlV0iPe0HhbQSx3VtaYA6vrApJbCEvCKv09wVFCbcyM64xqwk3EybreQ fRtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gQvHJG//p2n/R6jCoEOTdx7IVV8MCPiepPvYPEPDPEo=; fh=bH7ARtK4b9C1chD+m6XqaTEmInBtJ359lv8qZO6eOww=; b=FZyIlsy1LT431F81j8v1eIgPmy/5m07PvJ8Rr+h8merlKjm0kK6wQasy3kBKIn5hea OT6Fdq/OtnyTwWUVu2RVjrd2qhFaAgCeeugcwBa+6YM8A301wSOaTt8Eo/++DGSLaYPM cFC9JWr03JeMBQFFjJbQUEnEmbF0v8ZSbnQ7NJ+2b9cJgOYwmV7zoq9aN0UkzJhYHxpW x8Mxk/Bi/Ha3azilP98GGsuSglPJWepvkias8TmJVabF1iTrFCh9ykDTAGfKYhhrcH1r +2FOVfRDEU82T44h0guRj7j5C5kFcF+GBi6NXHCgd2zQb9gy5eUCoWHqB7U7A3u5ZQa6 PrKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IlBGsJBX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-4bc6a79df2asor1527800f8f.2.2026.12.02.02.28.03 for (Google Transport Security); Wed, 02 Dec 2026 02:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AL+hErEvczg58AJSwM7DRTr/c4hW3n/nHqrlfl9m0oTmzRLCkMwF9AEbbe2F7uIe/hnPHbhAhO9LG/c7VQTfp7Rm@amarulasolutions.com X-Gm-Gg: AZFdTZd1Zg19dsHjkjGMeKyi3HZR0mpe7/hvq5UQ8YK63vGIn2EGlNLEEpxPClKlHkL aRBeAPlchk9vAxi/BQgAY5Bv1sYMCwe8pFaYYCiGI2yPj+Ym8E2yfIXge6jeYaoA7S+UOx37ott LZNaYxnHiptsgVOyergJuQo2eH/i48veI9+MONoVmtCIMsubaIHcvJhIwxVoiH+vJkukoLgBE5m vEnEN21Hzfef7778QAzXFnspNqXLqSbMMGUoFTMX3117l5sdPF2m22gvEESS2mvHX/dHHJBLLvC 1srzH1fvD052SV9vS3MIWhZ6x/jMIlUcJJQtKF0RaueYTcpaONQr0v5Q3dHo4gCf5q1YLGzQHRN pVu8C3yuZynT4Z0UG+xAdPqBe0ayUSbabZvlXq6o9ejzmAMHLIkrUuWabyVEnArzsnFCV4+KxWq b2GpDpi2mYXEaptp60S9/R9KOcW1pPw2Rc+Zwo3y2qLbu7yfUkomk3Ajm6L7dL5TS2F2+FS+yli f2wm7XShANz788xjXn5lYm1PD7zN0Mayg5VP7mNuzxltT/fpCoEV1Nsqq+sQ1d8JSYXKTtVvHT+ VIhExl2Y9CrPHZfi/QbaiXGK+AOTG1GbPSBPOsUuoDXJpqd1YFD4N+kahB9z9nKeR9l0fwhPUV7 wgHr4eytR/L7jRf/dp/d/tb9gmmW7PlumiUvJE7pFsg== X-Received: by 2002:a05:600c:3547:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4bb8880b88fmr782556285e9.10.1796207283490; Wed, 02 Dec 2026 02:28:03 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:6962:3ebc:7df:e6bf]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbbaeb1e4csm366823865e9.13.2026.12.02.02.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 02:28:03 -0800 (PST) From: Dario Binacchi To: u-boot@lists.u-boot-project.org Cc: Heiko Schocher , linux-amarula@amarulasolutions.com, Peng Fan , simon.holesch@bshg.com, Marek Vasut , Valeriy.Yatsenko@bshg.com, Leonhard Hesse , michael@amarulasolutions.com, Miquel Raynal , Dario Binacchi , Fabio Estevam , "NXP i.MX U-Boot Team" , Stefano Babic , Tom Rini Subject: [PATCH v3 24/26] imx8mn_bsh_smm_s2/pro: support simple frame-buffer Date: Wed, 2 Dec 2026 11:26:35 +0100 Message-ID: <20261202102716.572884-25-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261202102716.572884-1-dario.binacchi@amarulasolutions.com> References: <20261202102716.572884-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IlBGsJBX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If you want to pass the frame-buffer to the kernel, the video output is initialized by U-Boot, and kept by the kernel. The commit modifies the device tree to be passed to the kernel just before launching it, to prevent the kernel from reinitializing hardware that has already been configured by the bootloader. Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- (no changes since v2) Changes in v2: - Drop the custom boot-on properties added to the Linux device tree - Drop the #if guard around smm_s2_setup_simplefb() - Fix the style of a comment board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c | 72 +++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c b/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c index c4a85c4aa440..902d5304249a 100644 --- a/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c +++ b/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c @@ -5,6 +5,8 @@ #include #include +#include +#include int board_late_init(void) { @@ -15,3 +17,73 @@ int board_late_init(void) return 0; } + +static void smm_s2_setup_simplefb(void *blob) +{ +#define DT_BLK_CTRL_NODE_PATH "/soc@0/bus@32c00000/blk-ctrl@32e28000" +#define DT_GPC_NODE_PATH "/soc@0/bus@30000000/gpc@303a0000" +#define DT_LCDIF_NODE_PATH "/soc@0/bus@32c00000/lcdif@32e00000" + + struct dt_addprop { + const char *node; + const char *prop; + const u32 *val; + int len; + } dt_addprops[] = { + {"/regulator-3v3-O2", "regulator-boot-on", NULL, 0}, + {"/regulator-3v3-O3", "regulator-boot-on", NULL, 0}, + }; + const char *dt_delprops[][2] = { + {DT_BLK_CTRL_NODE_PATH, "assigned-clock-rates"}, + /* pgc_dispmix */ + {DT_GPC_NODE_PATH "/pgc/power-domain@3", "assigned-clock-rates"}, + {DT_LCDIF_NODE_PATH, "assigned-clock-rates"}, + }; + int i, ret, offset; + + ret = fdt_simplefb_enable_and_mem_rsv(blob); + if (ret) { + printf("Failed to enable framebuffer DTS node\n"); + return; + } + + for (i = 0; i < ARRAY_SIZE(dt_addprops); i++) { + const char *node = dt_addprops[i].node; + const char *prop = dt_addprops[i].prop; + const void *val = dt_addprops[i].val; + const int len = dt_addprops[i].len; + + ret = fdt_find_and_setprop(blob, node, prop, val, len, 1); + if (ret < 0) + printf("Failed to add property %s:%s, err=%s\n", node, prop, + fdt_strerror(ret)); + else + debug("Add property %s:%s\n", node, prop); + } + + for (i = 0; i < ARRAY_SIZE(dt_delprops); i++) { + const char *node = dt_delprops[i][0]; + const char *prop = dt_delprops[i][1]; + + offset = fdt_path_offset(blob, node); + if (offset < 0) { + printf("Missing node %s\n", node); + continue; + } + + ret = fdt_delprop(blob, offset, prop); + if (ret < 0) + printf("Failed to delete property %s:%s\n", node, prop); + else + debug("Delete property %s:%s\n", node, prop); + } +} + +int ft_board_setup(void *blob, struct bd_info *bd) +{ + if (IS_ENABLED(CONFIG_OF_LIBFDT) && IS_ENABLED(CONFIG_FDT_SIMPLEFB) && + IS_ENABLED(CONFIG_VIDEO)) + smm_s2_setup_simplefb(blob); + + return 0; +}