From patchwork Tue Sep 3 15:30:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3373 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 242E43F1F3 for ; Tue, 3 Sep 2024 17:31:05 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42bb5950d1asf61945815e9.2 for ; Tue, 03 Sep 2024 08:31:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377465; cv=pass; d=google.com; s=arc-20240605; b=R+4vXYQTXuGnzye0DT0UurSAiJTRgKHvLLasEf3QxIpuJ0SsJC8qYv8PXlL1F+cxoU xkfQXALzrxtX58AeJA6OYU8SNtdr4dzS4JDeezVNFjr4l1APPi6Tyl9gaJMuCLEZOZs+ TqoWMrigGe8UQ8D6ftRflQlV47X01UfVygdUciqwM2XSdX5eDV3mizLlPraz8GLtdWRA XGbQvImPp5r1X2zKPGgmbH+47yvTAtP17p+yBtxdtCsQWQf4+ylNsjOnu7M2/3bee6iA 5ukVFvdT6iE9+NNxkZp+qG+rY2CDF8DUtjhmAWMrAaXGNFoCqi0pF7KN93GyHX0kGt9R 67Jg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:to :from:dkim-signature; bh=xblviIT/WPvwubo1pGbcNmLEU88wwTkV/I5WUrxc7pM=; fh=jPqxAwNxRTNJiiVfsaNew6JEeEc890l4hWnznnANkrI=; b=GlgNnWZ3vrtWiRr/6KYKRTkqFFQixiBK8c2a2NtZNKYRwtASO97JR4Tl9PNtmcHa8z nF+3pU9lAF8bVADqMT7HqdewSXloeRrwVn3g9zdVcJ4PsHALsrcN5rJlQLDhiipb0KQN tlmcRH97vcwHmxqZ7zmsNd6ZCw9R0DHq89DrpJKR5bG0bv/ahT0/zk8AIwJw0FY71yHc iZ0GZXwzXeXXittmp77KoFndWcyiCog99HHudSH5OvlcyREL4Y7M2v0dZRseHe8Bnj7P 6pWbfK4Dpu20x9NDzk1+p52CwvEx/pjYSa3EYfgDDtcl6xm+gBG7ysjDH7c+RY6PtvdI htiw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Tb/srg/G"; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377464; x=1725982264; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:to:from:from :to:cc:subject:date:message-id:reply-to; bh=xblviIT/WPvwubo1pGbcNmLEU88wwTkV/I5WUrxc7pM=; b=D3ZWyTLtXE0SVEnAklPQGH8EYNgP3hVL65ZrSf1DYI8ZpplW6NLdhnSl6LzlU3LEog gxQUmU1PX/PTPZqQ9Mnm4CyDfqGu+sbTsIfyTfMqDcmM2I0jkDxfIL/gKOIdMsXnqXp7 QErYvyznPRN86pGNke1cyuS7zbbh1HYTJ8tac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377465; x=1725982265; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:to:from:x-beenthere:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xblviIT/WPvwubo1pGbcNmLEU88wwTkV/I5WUrxc7pM=; b=PrQpA0mSjjla8OB3+7+tvpYLFc+1M3PvoAH4eripv/LJ3osiKP3wRSKuYPGce9VArz 1GEnyC+KlXlRTWcFoqaOtU6mO4oi/VVCF5zHfrqJvmrqEzN1Im7VB650Hwk/fV4QRLFC wTmhCinjXWs7WQ9TQhkSp5eJ1CRFwP5nbeL0Hgf9WzGA4aRdvoVvgIZEyK1elf0OD8ZJ s805QG8is6/rrITki0taeDBMUfJ73zUxt8PaYyntm3j32cD0D8RvAnwNJC2GuhMhsxgz KGDDy+6TFl1RR+NHHyLDmAnQo9poyqo2++FRtM1TFc7x4IXttgeiESNusHOwGGCGam1Q 2Grg== X-Forwarded-Encrypted: i=2; AJvYcCXFlXyB4nuTelqcRpCM08wNU6V0yTmmLhRdCbPKQ+F1Z3B3Ewn9nBfiQdvS5y8JEWe2IKyu/w4lcwO5jo79@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx8/bZaq2KFSvBjHNrYpxU1E8+gsM+lgCEDYdIFEi4FeleIboBC XO7b7tZWjnYagfwEVkP3fKCYYlZ7pIV0dmADnubc45RIW4/rluCP73MO+B2hviulng== X-Google-Smtp-Source: AGHT+IFEYO6kMnuI80vXR1mMiF12EdAnF69cswmYmbhRDb/3/CXr5/H35LjVLbgPwA5LiZXSxISkRg== X-Received: by 2002:a05:600c:4f42:b0:426:6b14:1839 with SMTP id 5b1f17b1804b1-42bb0136dadmr169038505e9.0.1725377464540; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3590:b0:427:9669:d780 with SMTP id 5b1f17b1804b1-42bb28398bfls1304455e9.0.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:03 -0700 (PDT) X-Received: by 2002:a05:600c:1d8b:b0:42b:892a:3296 with SMTP id 5b1f17b1804b1-42bb020d4eemr146177225e9.37.1725377462975; Tue, 03 Sep 2024 08:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377462; cv=none; d=google.com; s=arc-20160816; b=uRMFwDSHoVQ8mAwvay8uYISOqeg67DlyWwumdlCLnYa0h3khbINoOOyUCSjdaSWBq0 YzswXMJQMdgVsmfw5DtQnW9RcQoiTK0nimEgFmdCmRm9bzUeFggL5m695K4VGG8WFws+ UXiIxY/mhxNAE4JnbkbXYdJ25Qd2+qRX26DQ9k+m1U2zpng7tix/bmFxJC4wsHZSfMxv EgLF0lIx6PllG4Eq249jBRPIUZlZ2LJZPftIs5LG44PMsHxMpA5D25pzTGMu5JCLknlx 8bi1Pb3Az7aikYgmfeCCR8UYzVN3SRlsGH8CSxAni+9ngEkAVY837HroIcZvBcy+E4Mp LF1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:dkim-signature; bh=/JG1v401FFHy3BRmgsxC2pPyQqhHicxf8qoeqtOnH7k=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=VS8D8TlGdot8h2vwHddYeWmkGKn+fphPnuj0Hc5ELymfVacACf7f5wbQAWg0wX9d7c 4Yen3nwSDOze3nuWJlWZaTGHmV5ViQUaZGkqCbJP3D693j5CmLrDO/OGTPKhu0VwLYbb IfdbqAeR/jsS+hjQWjcI7aopEZNgC2ezsMa6nH+kfE5GloSpS0KesTOM+w8OqJRr8A1N 1xmX9DdjyENcr+A4LbHt1CO102dbQRDtD4XhvaupDdxSbhwSUcBwqryaqWedtKk8SZFL rXv00zvJfMyohhV4dyHLzgWsfAJ2MAyYEw6126wFpnkLp8oA1qwWre9HdJ7FbVlXGhn7 rZYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Tb/srg/G"; 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=pass 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 5b1f17b1804b1-42bb70b981asor4104665e9.13.2024.09.03.08.31.02 for (Google Transport Security); Tue, 03 Sep 2024 08:31:02 -0700 (PDT) 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-Received: by 2002:a05:600c:474c:b0:429:c674:d9de with SMTP id 5b1f17b1804b1-42bb01ad776mr155656815e9.2.1725377462237; Tue, 03 Sep 2024 08:31:02 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:01 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 01/29] clk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present for gate and mux Date: Tue, 3 Sep 2024 17:30:32 +0200 Message-ID: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 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="Tb/srg/G"; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Gate and mux does not have .set_rate operation, but they could have CLK_SET_PARENT_RATE flag set. In that case it's usually possible to find a parent up the tree which is capable of setting the rate (div, pll, etc). Add clk_generic_set_rate to allow them to trasverse the clock tree. Signed-off-by: Michael Trimarchi --- drivers/clk/clk-gate.c | 1 + drivers/clk/clk-mux.c | 2 +- drivers/clk/clk-uclass.c | 20 ++++++++++++++++++++ drivers/clk/clk.c | 9 +++++++++ include/clk.h | 9 +++++++++ include/linux/clk-provider.h | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index bf1c6a93b468..bd0d3d44ac8c 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -115,6 +115,7 @@ const struct clk_ops clk_gate_ops = { .enable = clk_gate_enable, .disable = clk_gate_disable, .get_rate = clk_generic_get_rate, + .set_rate = clk_generic_set_rate, }; struct clk *clk_register_gate(struct device *dev, const char *name, diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 62477e15d27a..4feb8e8c821d 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -150,13 +150,13 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent) #else writel(reg, mux->reg); #endif - return 0; } const struct clk_ops clk_mux_ops = { .get_rate = clk_generic_get_rate, .set_parent = clk_mux_set_parent, + .set_rate = clk_generic_set_rate, }; struct clk *clk_hw_register_mux_table(struct device *dev, const char *name, diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index c48a62ba099b..7d2c82e3bee4 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -515,6 +515,26 @@ ulong clk_get_parent_rate(struct clk *clk) return pclk->rate; } +ulong clk_set_parent_rate(struct clk *clk, ulong rate) +{ + const struct clk_ops *ops; + struct clk *pclk; + + debug("%s(clk=%p)\n", __func__, clk); + if (!clk_valid(clk)) + return 0; + + pclk = clk_get_parent(clk); + if (IS_ERR(pclk)) + return -ENODEV; + + ops = clk_dev_ops(pclk->dev); + if (!ops->set_rate) + return -ENOSYS; + + return clk_set_rate(pclk, rate); +} + ulong clk_round_rate(struct clk *clk, ulong rate) { const struct clk_ops *ops; diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index b8c2e8d531b9..67c6b23231ff 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -13,6 +13,7 @@ #include #include #include +#include int clk_register(struct clk *clk, const char *drv_name, const char *name, const char *parent_name) @@ -60,6 +61,14 @@ ulong clk_generic_get_rate(struct clk *clk) return clk_get_parent_rate(clk); } +ulong clk_generic_set_rate(struct clk *clk, ulong rate) +{ + if (clk->flags & CLK_SET_RATE_PARENT) + return clk_set_parent_rate(clk, rate); + + return clk_get_parent_rate(clk); +} + const char *clk_hw_get_name(const struct clk *hw) { assert(hw); diff --git a/include/clk.h b/include/clk.h index af23e4f34753..1900377eddb3 100644 --- a/include/clk.h +++ b/include/clk.h @@ -452,6 +452,15 @@ struct clk *clk_get_parent(struct clk *clk); */ ulong clk_get_parent_rate(struct clk *clk); +/** + * clk_set_parent_rate() - Set parent of current clock rate. + * @clk: A clock struct that was previously successfully requested by + * clk_request/get_by_*(). + * + * Return: clock rate in Hz, or -ve error code. + */ +ulong clk_set_parent_rate(struct clk *clk, ulong rate); + /** * clk_round_rate() - Adjust a rate to the exact rate a clock can provide * @clk: A clock struct that was previously successfully requested by diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 59f9c241b846..459fa2d15ceb 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -253,6 +253,7 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name, const char *clk_hw_get_name(const struct clk *hw); ulong clk_generic_get_rate(struct clk *clk); +ulong clk_generic_set_rate(struct clk *clk, ulong rate); struct clk *dev_get_clk_ptr(struct udevice *dev); From patchwork Tue Sep 3 15:30:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3374 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 244C83F1F3 for ; Tue, 3 Sep 2024 17:31:07 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5334824e68dsf1141676e87.3 for ; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377466; cv=pass; d=google.com; s=arc-20240605; b=V+joKUecg/sIILrqq4oCzMrRU9fBQHTZ07KbTCl0Nn77UFFlGoFo0YOam7D43tk4fQ 3GJ1KGc5hPo6e13IUxQskLuaCndOCOypO00CVFoe2xuX9fMZRf37cQkNO/QaYM96sUZ/ 3kbgJotsOQFrGLP/OKjzDDR+ocr+ctz06gT3fiS6b9wXTovEV/GLg3VSbqMRaIPoBytM A3yqYdn0a032XHjBiLFpTbS4bWIPFOomLAsqwDgVjJpJTxQfvlQpfc3M3DQRZTmh6GGJ PnQ8UY+IXH2O09dcrhva3CoCVne+q03fOqGELETiEKF/gd+kiv6cKul+esNE6QpUiKEY gWkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; fh=yIQbi1EE53MXpSEh2XOfx+H4bofhj8Y7TSHREB9HBkg=; b=UFeCu3xpIYM3wqJuL7YnI4Dbr6iElAap1lF1fjPDUCgQcefvToWXEwdylq9simtXul 5tsy1txKKDkEG/8apl6lfTmFbJsYO6u0yrzcdkg6VT6X8uwSaigh0tM7/5BGWfOuPksW /Hw0y7izbib58phkwKDtLobAgU4OfETzcjmf2aQmYA8Xuv3xTDQrs3MFJVvztFSBMPcb fbokq+5aQW0hbe4uel/xU6mOUv1Ylhvab3kYf83O6m4ZivQL+gZdXKduk61+YqvQ8lLW 82dy1XsmT3K6TKR9ne3jUeJ3rq9IfIBAtkg808LTxbCPLvBjvTK1lw115eafJaevFg4A ZsWA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lSRbd+VZ; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377466; x=1725982266; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; b=kL7aUcfC9sTd1iEkeYWJWt4PdljwW1OxiGUTTLBrK/BLwDqDYXj8xzbKinITFZ1cwY ufO1zvFq/8j31EFOQbait/j+xnftVsQLYKnfG11arxD09DUhjtlaYb6CxThCUbV1aiP9 /pWeD2LWsR0FSUMkJqJlQped0JvHWTKjRL9xc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377466; x=1725982266; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qD6MhRxhmPO8rTf7aAEqSp06zF31DIO3ajypcBua6gQ=; b=lSiLxE++Hl7Uy9WyoDA7CqKuOO5PcFaEO2Q8V38WjIDytkl3VIU88I3XC7PRHGCRCb rpkEWYRGhdz0jNWtU7GdCDG9m5KfEq2103Q3PbItGmA8cMbrb7BrS8LsBGVTTa5dpZu2 OJ4ewlnwBgybqHJS1TOB7In5C9/0o1qOKHa4R+yaIOHhKYh6no9RkHF+BJmdAZZyd8TK SgbYSgGoEuB5lSac3nkvIcC491/zyP8kamxa1QXScPRlBKu3HLi1QKtkL+09AlRky9Vn NTH5tz9JrMM2/8xQCzmhhzfjbmCPmmsTjDu+exFuUi0j/9/JmnDlsTZRsU62GvLj1nai YVTA== X-Forwarded-Encrypted: i=2; AJvYcCUsWF4xN6fPN4NuoQRjGqroaGeY7wAHxeuW7kILz6sgN0XBQNMghkmfbrRin2EHtgG146Moxim1w0SI/0LY@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yw3AimIu3DJ0PEY4k3tS4ok/OhHjY3LIol/OhUsbW9rXZ72X4+J Wrb+pcsqysZR4aZ0zB21iLgE3jmPSTzB2ZOoaaaxMPjw9LQamXtFiNyyrbd6l19Bjw== X-Google-Smtp-Source: AGHT+IHBhoaPCSH06qWxl6oKTtDnhEX+JdLjoFCEK0rIm/AUCbYX4RKS4BXGal2vKDDjtX8bfsRtdQ== X-Received: by 2002:ac2:4c41:0:b0:533:4191:fa47 with SMTP id 2adb3069b0e04-53546b69167mr8489268e87.47.1725377466222; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:2351:b0:533:48c9:754e with SMTP id 2adb3069b0e04-5353d814aa2ls186660e87.2.-pod-prod-06-eu; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) X-Received: by 2002:a05:6512:3d92:b0:52e:9762:2ba4 with SMTP id 2adb3069b0e04-53546b293eemr10901070e87.25.1725377464194; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377464; cv=none; d=google.com; s=arc-20160816; b=JABwTSK4EP5DlsBMGnnYFe7vagGzi12hOew76GV7eJ60ChjMrWSocfy1Oe9OHjBXDD sYbPjufFGWxpvhKGbXGvBL7ALm11uIRizSI83ioriXiyN5HgTuzfgnXxfiTI1ZL4t7qh WsQc8DuYER42rBhh6LhuwbuAqW2zX4rEjPda+wrcVJBq8aetGXekiI4Wl4cAMLo/KYzX mRlbC6v6R/h932546t8Z9R4nwNWyERcEOekVxQVW7GJSolXjGU5lLCDCWx7eviMe4K3M hM9dMj2mePAN9wolU5WY4Fqal6VqSR5i1K0M4IFiCzGQsLnU/T3U/gsJsc0Q+0HJ72bw lUVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=z+vH7JnBUdCxbHSNHeYAv/LSH/K9w1Cmau7Y6C7/Mx0=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=MPnBNiFueeMJOh/uImZRAZmiPhm0G2BzcP8zvhn0qx0ZNyoKpxkDc5tY9FEEEhXuDS GY//2zgMJluJHKkOZ1tjZda/BrHK+kKEggoqKNqcUlpLPw346TVl8wnY9tLeJFR3DSCY Sdvvi345r4DTEeAvw2JpqwKPRNOHYODWuVBuL5+/uwlx3uwRO8MLSJxKHiIzZ97w8mvz MhiUUGGE7jvigABYKTQFQb2+BAyclYIHYBW2BraOBVIYF4tEUPYilU+KoecIVS/0FG2m d9JdyqZM8TQt2mhupQIZ1D2Nea2pG1kghrrvsLpGpzsjM9Zu0k7O/ApSZtOqobk82an2 Qt8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lSRbd+VZ; 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=pass 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 2adb3069b0e04-535406e3f01sor3533652e87.0.2024.09.03.08.31.04 for (Google Transport Security); Tue, 03 Sep 2024 08:31:04 -0700 (PDT) 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-Received: by 2002:a05:6512:138e:b0:530:ea6a:de42 with SMTP id 2adb3069b0e04-53546b2a186mr8654993e87.26.1725377463199; Tue, 03 Sep 2024 08:31:03 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:02 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 02/29] clk: imx8mn: Prevent clock critical path from disabling during reparent and set_rate Date: Tue, 3 Sep 2024 17:30:33 +0200 Message-ID: <20240903153100.918077-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=lSRbd+VZ; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi This commit ensures that critical clock paths are not disabled during reparent and set_rate operations within the clock framework, paving the way for the inclusion of new features. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 8911e342f18b..e089012477a6 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -27,10 +27,18 @@ static const char * const imx8mn_a53_sels[] = {"clock-osc-24m", "arm_pll_out", " "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m", "audio_pll1_out", "sys_pll3_out", }; +static const char * const imx8mn_noc_sels[] = {"osc_24m", "sys_pll1_800m", "sys_pll3_out", + "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out", + "video_pll_out", "audio_pll2_out", }; + static const char * const imx8mn_ahb_sels[] = {"clock-osc-24m", "sys_pll1_133m", "sys_pll1_800m", "sys_pll1_400m", "sys_pll2_125m", "sys_pll3_out", "audio_pll1_out", "video_pll_out", }; +static const char * const imx8mn_main_axi_sels[] = {"osc_24m", "sys_pll2_333m", "sys_pll1_800m", + "sys_pll2_250m", "sys_pll2_1000m", "audio_pll1_out", + "video_pll_out", "sys_pll1_100m",}; + static const char * const imx8mn_enet_axi_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll1_800m", "sys_pll2_250m", "sys_pll2_200m", "audio_pll1_out", "video_pll_out", "sys_pll3_out", }; @@ -65,6 +73,9 @@ static const char * const imx8mn_usdhc2_sels[] = {"clock-osc-24m", "sys_pll1_400 "sys_pll2_500m", "sys_pll3_out", "sys_pll1_266m", "audio_pll2_out", "sys_pll1_100m", }; +static const char * const imx8mn_gic_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", + "sys_pll2_100m", "sys_pll1_800m", "clk_ext2", + "clk_ext4", "audio_pll2_out" }; #if CONFIG_IS_ENABLED(DM_SPI) static const char * const imx8mn_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", @@ -284,15 +295,18 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_IPG_ROOT, imx_clk_divider2("ipg_root", "ahb", base + 0x9080, 0, 1)); + /* BUS */ + clk_dm(IMX8MN_CLK_MAIN_AXI, + imx8m_clk_composite_critical("main_axi", imx8mn_main_axi_sels, base + 0x8800)); clk_dm(IMX8MN_CLK_ENET_AXI, - imx8m_clk_composite("enet_axi", imx8mn_enet_axi_sels, - base + 0x8880)); + imx8m_clk_composite("enet_axi", imx8mn_enet_axi_sels, base + 0x8880)); clk_dm(IMX8MN_CLK_NAND_USDHC_BUS, - imx8m_clk_composite_critical("nand_usdhc_bus", - imx8mn_nand_usdhc_sels, + imx8m_clk_composite_critical("nand_usdhc_bus", imx8mn_nand_usdhc_sels, base + 0x8900)); clk_dm(IMX8MN_CLK_USB_BUS, imx8m_clk_composite("usb_bus", imx8mn_usb_bus_sels, base + 0x8b80)); + clk_dm(IMX8MN_CLK_NOC, + imx8m_clk_composite_critical("noc", imx8mn_noc_sels, base + 0x8d00)); /* IP */ clk_dm(IMX8MN_CLK_USDHC1, @@ -387,7 +401,8 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_PWM4_ROOT, imx_clk_gate4("pwm4_root_clk", "pwm4", base + 0x42b0, 0)); #endif - + clk_dm(IMX8MN_CLK_GIC, + imx8m_clk_composite_critical("gic", imx8mn_gic_sels, base + 0xb200)); #if CONFIG_IS_ENABLED(DM_SPI) clk_dm(IMX8MN_CLK_ECSPI1, imx8m_clk_composite("ecspi1", imx8mn_ecspi1_sels, base + 0xb280)); From patchwork Tue Sep 3 15:30:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3375 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A03E03F228 for ; Tue, 3 Sep 2024 17:31:07 +0200 (CEST) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5343d2af7easf4996653e87.0 for ; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377467; cv=pass; d=google.com; s=arc-20240605; b=IioK3QFYWwXUeGfioJsRCj+WcdchYzhlSCnx/ohj79PCVxzLuZa21z5BbgQD3NKJCb 1lEcDrrX2QIFmcs6TpEVUG3Bp77kBhVGtn3oTSH16f+DeupAKZYOVJvtMFcxOsVTPoDX xtr0QR3sRY3/BTlyrAcsntVqXl7E6JEnJzhGOWGqtiyPP8qsk58lR2V+fSgbyLXHz3qt d9jEWLHqzZXLzdnLw2P/AOK4A4LZaEfacEwXMigPrwt77z4JpixWoD1PF/XqxVJGNeqo OVKXhlNz/CSzH/+GPhXSdsnHz41QUux/axlrIdIRoFxzmsoMv3oot+TidPyw+SL+TEeG zzkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=FrXBIv97q4vE3yaXHAQ60FgMBVSGB9SS/gXweDthaSQ=; fh=B9rID+1wEE2Rvt/Yz126YsW8iHzWAg5xMcqFqKStGo4=; b=UgCD+OsTHCO6+0xjvP28U63ft5EI5AwQ/c6MWq73PXjqYvqTE1B/rLUIAMKG6WhDn5 rxL++v/1lShdVhoOQD/NKeTyWLJxy0EKF/uRY0OPbYU7u9UHUJGqSQ7QHy4AjyBLna0r tNifXjsyIxWbcx1ikZFteqEgRFFrVbbE6F8nhvyBIgbAXGFCk8PS7c3b7I1ZPyaZA9V5 +lJE5aUbZllBVy83Yic4yGtjBxDqOWytInI4yds2EPtogJANjhWFcKmtp9Qnedy3rPPw 0MZ3i3kjzjD7WsITtse5YRIg85L9ZJeo0IQxTjo8w+mluxgkUvsyixiIDQzXJyKoj+PP 9w1Q==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q9aMJSqy; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377467; x=1725982267; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FrXBIv97q4vE3yaXHAQ60FgMBVSGB9SS/gXweDthaSQ=; b=AMbqZfVvw5dRUA1MWiBkDADmO6UyiQlBPskDvVwVAc0F0WYG3M4svBNLsuy9X/ATy2 0mu7gm8WeyV4prkrUWxWHsJxyNHWXK72ZORsTeft3U1t/z3FknMJzd4PLaE2m9KWg3/t LHcg24fHfMZA2SH6UUy5zMe9FqqTc+VWbkRW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377467; x=1725982267; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FrXBIv97q4vE3yaXHAQ60FgMBVSGB9SS/gXweDthaSQ=; b=ISCZO5+ERU3kosq088cet6L7GtuXRXi7mzDh7JkmolgbIMl0LbDq0ZOfk3uF5Myw/b VZ27fdOiMJvcxbtbmoGTB3Jz4oQ4vBGZFVsMRKDb+mEfNnGydsXn4nhtCTcxvFDRI7Yc SBTiLIzXzo0W3zOUXi99ZlwTYMKGnK6UXjATCurn9H10nYbgKHyeCukawurwymj7gLco 8/kNqvG5IwOSx+Vv/ahsk2rsCLYbcaH/qOMSUG9Sa2TwuCoOngIyPBTciMr1A7uiKLJk c+cE45/QA+gULLYoR1mgqB1DQVceA1FhKzgG9nLq3wyaSycMhOTW6D6v4qZSkYTnVWCa 4qFQ== X-Forwarded-Encrypted: i=2; AJvYcCXCAjQurUbq78dNIWU8qLWUfdd1ypxTTF0YX/bwenKfOEEhW4BlP0t10NVtFFrlrGNm+1Lsh4xTBExz2zUa@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwTJ6xtuyqkPzU3ptkpSCxOT5F+4DHrJ/vnPg1T4sXfzzIsaBYX RVHuWDdlU001RjOLGgtYm9X9r9QAiidAy5uLjPnxB9bm7jSsZODdf0SRZxTFeTrxhw== X-Google-Smtp-Source: AGHT+IG8wN3cJ6dlt/o1BERJmDjKZyD94wMymSe0rbBAML5Wmqycuy6is5+ez+G5ZFq1RI1KVcBY2w== X-Received: by 2002:a05:6512:6c4:b0:534:5453:ecc8 with SMTP id 2adb3069b0e04-53546bb0365mr7597682e87.52.1725377466690; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b8a:b0:428:e09e:e808 with SMTP id 5b1f17b1804b1-42c93ac12f0ls239185e9.0.-pod-prod-01-eu; Tue, 03 Sep 2024 08:31:05 -0700 (PDT) X-Received: by 2002:a05:600c:1ca1:b0:426:6667:bbbe with SMTP id 5b1f17b1804b1-42c82f531efmr56211495e9.9.1725377464911; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377464; cv=none; d=google.com; s=arc-20160816; b=YxvDNNHzMJFjdXmO6papmnraeQq3GYggC0ol6Cx7LvMvByo83Xh74Jecg2THrciiL1 o+TSTDe0WUiwTx+f8uMH/cHRTd2DGefWDqFiezQmf56rUVHtHmWMA6CoJHWu6JnxIuRi mRyILBb3ng1cwUsYgGTTYWfgwx3IVVMHEuz0kuYmgxHbS7ENt5O1P9qAocxp09PlY96o vVZnjkIfTFb7hP2lfum5QpDpHHkxKcKYMbIvDP+GKo8+x9hQydx7HhlbfpTcDfCe6Luy tr75OkoTBy9efZX3KqJTS+MXu4YayVd1dq0m4ijedNOJ/eo5AGndtRy7bFTOw4fiC7Gd lIHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=jDWptbH9w/9zBY+KHy9Xv9lgS/KNlcO7NFqasYaIoQ0=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=glhSdtGOHt1FsfSDChYVme0aL2oP3AcrXoYnEgioEQgrxIpwq9MdkDgodT4xvWUvKC fR3fizY62RbmB4EBqAF2oABLzIT+X5OarZ7qze54SnCKVA/twvpHMUOhSKl2oo38kkRj f8uixthMiLXt6RKEnm0hTzHmI/7gVsbV8Jus33G3wOTPgYjHDwueqkftNC3xncnYrmx6 myfeBq1bLBE9n6Q4Lt3JZ3fBgtUGEt2tMU1uvv4XTz1Sm2qFFvmnrxXU8J4PRAhBV8cc 2kyUiOydLjC9HL8WXeSCkiKcgTvkIiYK3JpqqMYUXsMj0ihko9KQzsexvq6S5dwkIVTS Bb8w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q9aMJSqy; 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=pass 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 5b1f17b1804b1-42bb70b7710sor33465655e9.13.2024.09.03.08.31.04 for (Google Transport Security); Tue, 03 Sep 2024 08:31:04 -0700 (PDT) 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-Received: by 2002:a05:600c:3b1e:b0:426:62df:bdf0 with SMTP id 5b1f17b1804b1-42c82f5318fmr47146925e9.10.1725377464072; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:03 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 03/29] clk: imx8mm: Prevent clock critical path from disabling during reparent and set_rate Date: Tue, 3 Sep 2024 17:30:34 +0200 Message-ID: <20240903153100.918077-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=q9aMJSqy; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi This commit ensures that critical clock paths are not disabled during reparent and set_rate operations within the clock framework, paving the way for the inclusion of new features. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mm.c | 58 ++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index e538f047b310..685e7df0e568 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -25,11 +25,23 @@ static const char * const imx8mm_a53_sels[] = {"clock-osc-24m", "arm_pll_out", " "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m", "audio_pll1_out", "sys_pll3_out", }; +#ifndef CONFIG_SPL_BUILD +static const char * const imx8mm_noc_sels[] = {"clock-osc-24m", "sys_pll1_800m", "sys_pll3_out", + "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out", + "video_pll1_out", "audio_pll2_out", }; + +static const char * const imx8mm_noc_apb_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll3_out", + "sys_pll2_333m", "sys_pll2_200m", "sys_pll1_800m", + "audio_pll1_out", "video_pll1_out", }; + static const char * const imx8mm_ahb_sels[] = {"clock-osc-24m", "sys_pll1_133m", "sys_pll1_800m", "sys_pll1_400m", "sys_pll2_125m", "sys_pll3_out", "audio_pll1_out", "video_pll1_out", }; -#ifndef CONFIG_SPL_BUILD +static const char * const imx8mm_main_axi_sels[] = {"clock-osc-24m", "sys_pll2_333m", "sys_pll1_800m", + "sys_pll2_250m", "sys_pll2_1000m", "audio_pll1_out", + "video_pll1_out", "sys_pll1_100m",}; + static const char * const imx8mm_enet_axi_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll1_800m", "sys_pll2_250m", "sys_pll2_200m", "audio_pll1_out", "video_pll1_out", "sys_pll3_out", }; @@ -45,6 +57,10 @@ static const char * const imx8mm_enet_timer_sels[] = {"clock-osc-24m", "sys_pll2 static const char * const imx8mm_enet_phy_sels[] = {"clock-osc-24m", "sys_pll2_50m", "sys_pll2_125m", "sys_pll2_200m", "sys_pll2_500m", "video_pll1_out", "audio_pll2_out", }; + +static const char * const imx8mm_dram_apb_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", + "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", + "sys_pll2_250m", "audio_pll2_out", }; #endif static const char * const imx8mm_nand_usdhc_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll1_800m", @@ -133,6 +149,10 @@ static const char * const imx8mm_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 "sys_pll2_100m", "sys_pll2_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", }; +static const char * const imx8mm_gic_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", + "sys_pll2_100m", "sys_pll1_800m", "clk_ext2", + "clk_ext4", "audio_pll2_out" }; + #if CONFIG_IS_ENABLED(DM_SPI) static const char * const imx8mm_ecspi1_sels[] = {"clock-osc-24m", "sys_pll2_200m", "sys_pll1_40m", "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out", @@ -281,18 +301,30 @@ static int imx8mm_clk_probe(struct udevice *dev) imx_clk_divider2("arm_a53_div", "arm_a53_cg", base + 0x8000, 0, 3)); - clk_dm(IMX8MM_CLK_AHB, - imx8m_clk_composite_critical("ahb", imx8mm_ahb_sels, - base + 0x9000)); clk_dm(IMX8MM_CLK_IPG_ROOT, imx_clk_divider2("ipg_root", "ahb", base + 0x9080, 0, 1)); - clk_dm(IMX8MM_CLK_NAND_USDHC_BUS, - imx8m_clk_composite_critical("nand_usdhc_bus", - imx8mm_nand_usdhc_sels, - base + 0x8900)); - clk_dm(IMX8MM_CLK_USB_BUS, - imx8m_clk_composite("usb_bus", imx8mm_usb_bus_sels, base + 0x8b80)); +#ifndef CONFIG_SPL_BUILD + /* BUS */ + clk_dm(IMX8MM_CLK_MAIN_AXI, imx8m_clk_composite_critical("main_axi", + imx8mm_main_axi_sels, base + 0x8800)); + clk_dm(IMX8MM_CLK_ENET_AXI, imx8m_clk_composite("enet_axi", + imx8mm_enet_axi_sels, base + 0x8880)); + clk_dm(IMX8MM_CLK_NOC, imx8m_clk_composite_critical("noc", + imx8mm_noc_sels, base + 0x8d00)); + clk_dm(IMX8MM_CLK_NOC_APB, imx8m_clk_composite_critical("noc_apb", + imx8mm_noc_apb_sels, base + 0x8d80)); + clk_dm(IMX8MM_CLK_AHB, imx8m_clk_composite_critical("ahb", + imx8mm_ahb_sels, base + 0x9000)); + clk_dm(IMX8MM_CLK_DRAM_APB, imx8m_clk_composite_critical("dram_apb", + imx8mm_dram_apb_sels, base + 0xa080)); +#endif + + clk_dm(IMX8MM_CLK_NAND_USDHC_BUS, imx8m_clk_composite_critical("nand_usdhc_bus", + imx8mm_nand_usdhc_sels, base + 0x8900)); + + clk_dm(IMX8MM_CLK_USB_BUS, imx8m_clk_composite("usb_bus", + imx8mm_usb_bus_sels, base + 0x8b80)); /* IP */ #if CONFIG_IS_ENABLED(PCIE_DW_IMX) @@ -356,9 +388,6 @@ static int imx8mm_clk_probe(struct udevice *dev) /* clks not needed in SPL stage */ #ifndef CONFIG_SPL_BUILD - clk_dm(IMX8MM_CLK_ENET_AXI, - imx8m_clk_composite("enet_axi", imx8mm_enet_axi_sels, - base + 0x8880)); clk_dm(IMX8MM_CLK_ENET_REF, imx8m_clk_composite("enet_ref", imx8mm_enet_ref_sels, base + 0xa980)); @@ -394,6 +423,9 @@ static int imx8mm_clk_probe(struct udevice *dev) imx_clk_gate4("pcie1_root_clk", "pcie1_ctrl", base + 0x4250, 0)); #endif + clk_dm(IMX8MM_CLK_GIC, imx8m_clk_composite_critical("gic", + imx8mm_gic_sels, base + 0xb200)); + #if CONFIG_IS_ENABLED(DM_SPI) clk_dm(IMX8MM_CLK_ECSPI1, imx8m_clk_composite("ecspi1", imx8mm_ecspi1_sels, base + 0xb280)); From patchwork Tue Sep 3 15:30:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3376 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AC2FC3F360 for ; Tue, 3 Sep 2024 17:31:07 +0200 (CEST) Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3756212a589sf954702f8f.2 for ; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377467; cv=pass; d=google.com; s=arc-20240605; b=kM8rHxnRWlDIv/Ea2537+u6hoTuoHP+WS0nE29Mu8DHr1V9tHVi4/UNVWcCLgpCiSw azMJpsz8s29u7BJdi6WoMKQetwwTcfhsRSFFmbQi8Df81stkdADnE8sffosTekuYBk60 EodK0hqgoQil9gzhSTn7i2Ej65E3Qf5tGudF+q9uEEXj53eXFeECcDTJhRIlGb9yaMg0 WfhHobe33HyZDTsJCoPEYCXsu+Q4+GZiDeWq3QNWAl46RHHh65UdaABXLbxc0qRe1XpY LTSEBI4S02HeJysSJoFLqkiXUzsZLOwFnV4MphD2T34uZOQg+OZ+hVhQS1c81j3sG6jg ET5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=YwFgVMjqqjKX2FVYa+KaulKqAVPw91S+t0CLFvgIXIY=; fh=KGIdBcsCBLfw8D5gwhErfIb/xhWP4w1Ozkm/qlwefr0=; b=aedOYSflnSXISqM/DbyRevaf8WeQN8YkcgYOkiGlk3jtk6YU2+l1owkyVp7dwqSgvx XRB5dIVBVZkpISM8OwKZLIGKW9mqzCvZ1m8IM+3LMWcteEhDrXs07YZW4lziXTsrfsd6 HgebzIl+U4ux8v44FPKWDQW+6MIN2ERdMjun3ET5OF8lo0xF0X0P6AR1syc5stsycvYX BdFLfOdVNYkJJNh5MD+G05pScJkv50QGmDnx/OZGwBBo0vc3hrKGSm2OsRncRCMDS8dQ t0vl1K0+6we86RMTkQcwQy9/OYTj6+4i3GorZlOPjZhS3n9ct+Xkvppy8pkZkK5jrHw0 6uOg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="rxeSfF/B"; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377467; x=1725982267; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=YwFgVMjqqjKX2FVYa+KaulKqAVPw91S+t0CLFvgIXIY=; b=V1em/nnDtsCxQjd6igy8O7Mz9Bv76lsLaGcZu/S3t7v3Qh8KGZS4GnJkZGR0h4rW/q VQAm1atVLTAce3emT/hTJcv4b/kOk6CwgoxyDKDc63NhybWxJyq9Q7rXHf+31K6zg0vf Ds/ZMIlstx7QdNa7cdLFdDTRRVg7BxMEL+8nA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377467; x=1725982267; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YwFgVMjqqjKX2FVYa+KaulKqAVPw91S+t0CLFvgIXIY=; b=UqRJsMAnnr58lcDAUYWi8fCK10xPWGqXlhrSrduxy6U7N0+RAJekx8JUf3cVFM/86f pmO63Qtn28IAqQuTFtTroSUOnGRpygy5nCq5bYGpICD1sTHyD+Ezhd/FhNR2nRoEwOcm vrTv8lPU4xS7t60aMavS/3y4M+A4rbniVetPyQ8TGGAgHvaae6IeCR88vucFivkNG/o9 UQ0o7FWa6jpv6luAbv6DWhwDN2iOluyQY9vhczTyQJK7aSbkL4LE5xl0i1ogy5BymJDK tp0P1qRBCE/BsESo/XQpkv24l5G8JMz1UDNpJpFtStYz4vbgNhekwZttMc9mV10Zro4h Ud2g== X-Forwarded-Encrypted: i=2; AJvYcCVxNZYkl0oIurv1xq6TabUNyrQyJNQT6qMSx556JQ8YPtv4a157tHzFgQxAMkRLnGxofSuvQUxDXaniWSRa@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyZx25k8tjrKTYLD4K46BWSLLWwijEHKFGmIGSr/5WjMIuXAjEu cNkHfJtq4b4IwFYkF5IH1wkXdz093M9lscbaIcs0pCBhI+NUye20QCMAJfDp/VH52g== X-Google-Smtp-Source: AGHT+IExX69yz0AByMvyRl6sT04xqDoOd0BIFjH4z5l6FqVX+QaEuALgqoXCw6uGBArRkUsAwm2UEw== X-Received: by 2002:adf:fecd:0:b0:374:bf18:6092 with SMTP id ffacd0b85a97d-374bf1866a6mr9095268f8f.38.1725377467120; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6000:440a:b0:376:46c1:d33f with SMTP id ffacd0b85a97d-37646c1d737ls385528f8f.2.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) X-Received: by 2002:a05:600c:6b13:b0:42b:ac3d:3abc with SMTP id 5b1f17b1804b1-42bb01edd45mr149898255e9.24.1725377465505; Tue, 03 Sep 2024 08:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377465; cv=none; d=google.com; s=arc-20160816; b=GY0EaTuQbYI/UqIcJW1oRpat+kVGXmHBdEsny0Y1/pyF83w9gEp7vL7L77AmtqvqS1 w++PSq2+7fuGdaYEqznsffZdjpmomIHnry8sDyINnQg52kBJINoPAkM16YuB9dhEVphb UtQ0+XKg9T5qQlLwjMbizpDLA+/wlMVERZgmAug/VuPcrr8ONVAo272Di3a23eQuvc3B ZetNeJcDsYie7Fh8hCV8EqwPR2w3jWYA1l8D16s/1VOrsKaVHPfzD/vX4NVGlK8EMUtV xq58J3C4LQfqqSn17NTnvZoAz87AxCY+zLJglbB5RKpmqHiRpT4fA1MRXylZPSzEdV5z 10Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=naTm3Opt6jf0xEq0yickJe+E/Y+IqsC0GJnFWRLLBUU=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=KjoFhbXW15eeX1JQiH0ZPIid02n7NPMx2GD3vaIxrs2AE+Zc4uqyzM3PzCqv58sz4i 0Yak1nzcWmX+giQJRkJybJse92GcAsCHxfP0e13H4CokQCAHlhivjppCSJPXCYp/NSgF QGTI/UsSw7sDUFs0xhSqcVgd65eJyIl2Pq+ZCvp9bOYFwrWT5BdU/GU28DdmvDhZFcRT ZfQmSfI7h3rM/FXSTxOqz89W7QsbVKnx6/nQioDCjSvwge0KVKl2YUKAOUhvf+tMczKd G+rLT3VfwKdUoM5zq5aHxBQ09nHBfe5OS6eGLYB1cMHtJI8FBNy8cfS+WadccouhLOzq 7M5A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="rxeSfF/B"; 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=pass 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 5b1f17b1804b1-42bb70add8dsor15932515e9.8.2024.09.03.08.31.05 for (Google Transport Security); Tue, 03 Sep 2024 08:31:05 -0700 (PDT) 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-Received: by 2002:a05:600c:1c83:b0:426:59fe:ac27 with SMTP id 5b1f17b1804b1-42bb01edc2amr145378515e9.26.1725377464803; Tue, 03 Sep 2024 08:31:04 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:04 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 04/29] clk: clk-uclass: Print clk name in clk_enable/clk_disable Date: Tue, 3 Sep 2024 17:30:35 +0200 Message-ID: <20240903153100.918077-4-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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="rxeSfF/B"; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Print clk name in clk_enable and clk_disable. Make sense to know what clock get disabled/enabled before a system crash or system hang. Signed-off-by: Michael Trimarchi --- drivers/clk/clk-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 7d2c82e3bee4..4c2ca9909469 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -629,7 +629,7 @@ int clk_enable(struct clk *clk) struct clk *clkp = NULL; int ret; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); @@ -690,7 +690,7 @@ int clk_disable(struct clk *clk) struct clk *clkp = NULL; int ret; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p name=%s)\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); From patchwork Tue Sep 3 15:30:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3377 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7A4663FA49 for ; Tue, 3 Sep 2024 17:31:08 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42bb5950d1asf61947015e9.2 for ; Tue, 03 Sep 2024 08:31:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377468; cv=pass; d=google.com; s=arc-20240605; b=LRGKlLeQm5zVfLo7Li9FroXoLa/x+fPtEBjHyrbihVdDGj9bLmz8wywwzsb/aZL/xk SpUMXfDKaCaidWlbNgpK38b4rDOTAiATHgvBO0zdyxHi8CjwbSJgrxAhuQKhu3N9C3Pb bL2CmG5elyZWsArEx2fTio+X4V+WTuiJxjworLDURE9X3+3Nw36TwFL4SjaGCPeCOIXo 22fnBw+IaRYFLj0kO6KU1c+KkZrTsjwDTPxy7a6+Ob1GqVMa5nuft+Z9Pz1uPNePB9m/ sY4I1mORYUNIaiPCL/cvn4HN9rSYzQLFyFBWNxo4LF8ENv/gOl6uQVPEFg8Ygm6Iza/8 r1TA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=3cbXJCzhgmZMFX6CdOZO/HaMhXvnRkZctjE0kNj1+x4=; fh=z/bSuNkNfQvXZUDf0YZNnof+1SZ/1CtVqaoMZpznaoE=; b=aufDtkt7wMXdJj0TNE7/znx0yM2WFpMoOQlqA0JZn9Ex9nuMGRdnk20un6ZVuIPcTv Pl3q8/lo+swJ2Bs9I5fj2zxOpbjmD7SWK6z4Erdj58oC0Y8Mjq23KcsJR6Z/cQmLjTL5 rtZoq2T/2IAoOq8cy5td7b/APwn8oOE9f0PSCG129wfL9jijdkN8ax0sO1aA1y9klbFy BW+mD954tK9S15qReSrVZOWd3f9S2iA+cEpBl4nR7XE7Q8U9i5/lsDXtQexM9379p4CU 1weQSaUNVKcfkWO9qLxoJhd4UoB7fMeuE2O6pNYEUpGgA7TshNypPHI8200A2F707BD4 KLZA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dM3eWFj1; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377468; x=1725982268; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3cbXJCzhgmZMFX6CdOZO/HaMhXvnRkZctjE0kNj1+x4=; b=Q5re/M+vcO3wjLDQEMEbQFD5JxZz3JTLmEJGuoMjR8R6LezOz4el1RvoECsd997AhI FgdBjqV5GNi6iqSEhySwqZH8ZJb5MkJDrwGHzoDp6Pu9ROLPTvM/ULUUUPk9obcsDdvQ LfYskE/vulReSu03A63w+sU4XwsEA+fghOEk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377468; x=1725982268; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3cbXJCzhgmZMFX6CdOZO/HaMhXvnRkZctjE0kNj1+x4=; b=gLYLZ7T4wPH7wK9q9MEAUvX50K5rEq0cSJzbj2PtEqoCFzsb6UT3HgZrVapy5Cdu2z gbcIPXjG/4UqxXyC/0tC4cPf8MvrdXtyBY/dcNr7dwHz7w0qO7yNFjmCJnrE/bCwgW6i Al2hllsGnGXSERbzkru1opmryTR7NfUSJek7yzrAr2Uugj1673FnmHMoakAgShqAqKw+ fZDmlOfp9KyCK1OzxZvU4E0uDe0z4lplD91z7JtS/Pt5eXefmFUfs/f5sza3OqTzk1TS spFBiVDp0kBGHeDi7wnhLbBvT2yTPfXpbBPrzdDRCEFclxqfOCrSefXCqb29A4KTCbSD 57WQ== X-Forwarded-Encrypted: i=2; AJvYcCXVnDTVZi8/VwQuj9M2HJqfWo8Ipnkd1e6bRBEJkDmR3uC6KrsMCX9l9Bfxh/afTwDHKOXwdADubqVniRfV@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxiWgH+zW/mYPajwFSdcyOLKU5igAhDqhOG43H2FNWzgoKemApr 1NhjqMqeGDYuwhkUcfWk/HvxaC3f0c/RUtJlXc3hU/tJK++zadTwi2Axd0Or3KEjog== X-Google-Smtp-Source: AGHT+IEclw/FJZAQA50/i8L9e4dMVx2TGEmwJG3+8Gh1KYzmlFwtSvEy8HsR87slsYa1rn/0+VE0xQ== X-Received: by 2002:a05:600c:4fd3:b0:426:5e1c:1ac2 with SMTP id 5b1f17b1804b1-42bb01ad75dmr164436255e9.8.1725377468074; Tue, 03 Sep 2024 08:31:08 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:426:7318:c5a0 with SMTP id 5b1f17b1804b1-42bb2a0f33cls1304935e9.2.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) X-Received: by 2002:a05:600c:3b8e:b0:428:d31:ef25 with SMTP id 5b1f17b1804b1-42bb01b91dbmr156947015e9.12.1725377466257; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377466; cv=none; d=google.com; s=arc-20160816; b=kxNqkMYLXrMAHYJboNYJsmfocJSXOBEdLuDeT2U4Qp5PopMpO7HlQx9mlahWxahyrd 8b1SYgon0HDYU4AydVVWxsaC9PQ/90ZtZIDkwaXGqRs+WXgngV62AIDXIts+dr4ndXSl 74zcfa+7gljCsIjlux49RMrI0mdWX1NNesw0unZLKe8qY96BBuZ7hDzsFqs3rtQAkIxV U4Pl2PN+QX6Gri/OXbPGtdWRKnsyhmLW/PkIM3Af+OtoIc+CqjX//G86FtxEYk6LtSym 6sWtLguDzYyF0rI8l3doDzTS01ygDgaZ3tzKsQ8vX9id1H/wcT1MZUMs9Ihgbn3YVtTS xvIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=lvYIhATKa8CPAeak+8bmtlwFxaGBD71PECtAMFCv/Bg=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=FEd3GCh7NuGkLrwJqI5oZ2PJ1lrQv6vLE6K7e3lxU3T/8Rdi/n/RbdHJ4j7lpEy3pZ BeGVxoEgVeyD3XOJLTvqg+s+SvaL5MpZYX9ED2uqdiDF4A2oJizexlisw78FCn1v2V48 //O7bv9w8bWS6etjX7danlJo2/Wvrzre/KWtR8r9AmRbpfYE/Gx/BgH+A5VOjuP5czq8 BOL8OWimkT7Z+jOxr1+vtGW39HFhXbWZiXxZbbhLS5n6cbmmkHSQ/q8dKV/GJ21mihqE lJG6af+Q1L3aLqRh1/XRivvOrH7HAU7zsfmv8nNHvpQBPidMZ83qwakAMy5eVyu7PHaQ 2p9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dM3eWFj1; 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=pass 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 5b1f17b1804b1-42c8e41b1f9sor3571605e9.7.2024.09.03.08.31.06 for (Google Transport Security); Tue, 03 Sep 2024 08:31:06 -0700 (PDT) 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-Received: by 2002:a5d:5c87:0:b0:374:c8eb:9b18 with SMTP id ffacd0b85a97d-374c8eb9b69mr5257085f8f.24.1725377465651; Tue, 03 Sep 2024 08:31:05 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:05 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 05/29] clk: clk-uclass: Implement CLK_OPS_PARENT_ENABLE Date: Tue, 3 Sep 2024 17:30:36 +0200 Message-ID: <20240903153100.918077-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=dM3eWFj1; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi There are scenario that we need to enable the new parent clock before reparent, or we need to do the same with clk_set_rate. The patch cover those scenario Signed-off-by: Michael Trimarchi --- drivers/clk/clk-uclass.c | 47 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 4c2ca9909469..fdce69cb48e0 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -582,7 +582,9 @@ static void clk_clean_rate_cache(struct clk *clk) ulong clk_set_rate(struct clk *clk, ulong rate) { const struct clk_ops *ops; + struct clk *pclk; struct clk *clkp; + ulong ret; debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate); if (!clk_valid(clk)) @@ -597,11 +599,37 @@ ulong clk_set_rate(struct clk *clk, ulong rate) /* Clean up cached rates for us and all child clocks */ clk_clean_rate_cache(clkp); - return ops->set_rate(clk, rate); + if (clk->flags & CLK_SET_RATE_UNGATE) { + ret = clk_enable(clk); + if (ret) + return ret; + } + + pclk = clk_get_parent(clk); + if (pclk) { + if (clk->flags & CLK_OPS_PARENT_ENABLE) { + ret = clk_enable(pclk); + if (ret) + goto out; + } + } + + ret = ops->set_rate(clk, rate); + + if (pclk && clk->flags & CLK_OPS_PARENT_ENABLE) + clk_disable(pclk); + +out: + if (clk->flags & CLK_SET_RATE_UNGATE) + clk_disable(clk); + + return ret; } int clk_set_parent(struct clk *clk, struct clk *parent) { + struct clk *old_parent; + const struct clk_ops *ops; int ret; @@ -613,6 +641,15 @@ int clk_set_parent(struct clk *clk, struct clk *parent) if (!ops->set_parent) return -ENOSYS; + if (clk->enable_count) + clk_enable(parent); + + old_parent = clk_get_parent(clk); + if (clk->flags & CLK_OPS_PARENT_ENABLE) { + clk_enable(old_parent); + clk_enable(parent); + } + ret = ops->set_parent(clk, parent); if (ret) return ret; @@ -620,6 +657,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent) if (CONFIG_IS_ENABLED(CLK_CCF)) ret = device_reparent(clk->dev, parent->dev); + if (clk->flags & CLK_OPS_PARENT_ENABLE) { + clk_disable(parent); + clk_disable(old_parent); + } + + if (clk->enable_count) + clk_disable(old_parent); + return ret; } From patchwork Tue Sep 3 15:30:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3378 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A99BA3F1F3 for ; Tue, 3 Sep 2024 17:31:09 +0200 (CEST) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2f3ea8692a4sf53495261fa.1 for ; Tue, 03 Sep 2024 08:31:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377469; cv=pass; d=google.com; s=arc-20240605; b=DvmNyFmItxEManYH3YagSwka5jc2CkI0uoDVOaTfDTpuB3D+t+5YIR5/qkUv0MMg5k tCX5hQgJag0lzqBL8MImRQcm2N+awlwadMKXPr3T7ZlwOYkAVdHjHtZD+HoqFAvh8K2v Nv0pw75HofWPlSWAACXEripSwKKRS0WlbR2YV20+1NcqgMBmtcB5zp+MKQFY07g9Z6aU F3rfSGkn+7OYImL5i5R9VT9s1zHvdRQpdtoD1kKeqKTeVrmZ8arZLYPM2UMD75w1tUMd fEg4kd9eZnIvzIuDtx0YlTqFwjjBFi0XXFrcZ9KeAe9TvRTDqVxo0x+Z3Kii3voStyR2 njfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=iauPY9f+ryFjjIZe7ja1zCS0TWL1H1KiJvL7+a/i6eo=; fh=BSBKPbyHw8d/kuQEtIaylv104X78zncumwxF1RCel14=; b=E+Tp7Rb1Y+M02knFwMjvbOPvzOolvI1EYsroNXxgfOw6935/qiTytBcBloGDGJlxDa FkSLAMLIUNElzq3uckFEWsamrkrg4a/8NhroPH2vEVorepzOoveTokPty74Kt2YfUzv2 pw21iB2Mlj9MRaFl+73VqRuMXrXmx6OrgX1E289IqQm8N5wG7uFUDsTSts7RfwP7ZiFQ vWCJxGNHKeTlZGfMimWgxDqsCGSRQw8AmbmpEPK1JMz2VP5zViB7jCzBcKXpBZMUiaKf rETDY8wR4oaCTOAoS4ebkgM/rfKFqP1CU0uJzS/aNzL2Bvw9Q/vfpjpexUj9dxoZCw36 l0mQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ClBnuTKE; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377469; x=1725982269; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=iauPY9f+ryFjjIZe7ja1zCS0TWL1H1KiJvL7+a/i6eo=; b=WiiZcoSb4KLYPY9ZPC3hsEIzJka29+lRxBs3LpFKXNUWE4o76TqDbjZw2Xoyf2EBAr AiOcJ3M3776r2bqhksKmmxggH1MeR1NpWRnkvQ5BWtYoJy7ZIpno4BCzReevVCxGCZim x58UdBLnslSFvkzLg7xusOOfgjRzvlvhSDlfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377469; x=1725982269; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iauPY9f+ryFjjIZe7ja1zCS0TWL1H1KiJvL7+a/i6eo=; b=KTJv8fBUGk73DEJuDIOmVeSPNfsu84uETA/BhgJ8Oak3W525fDLzA1s595+b6UyIUA DJbqrn7dCNan43vVjKb4o6HYySTi1NEYknm3ldQp2oC4zP+P1Z9SSvpjDGom6rg9IzmO Z4AGGzVM+lvMCmQhxPd/0hy+9GKPw0Zlehq+UH7jP4E00Ro1nyAOprcpj6nfLT12pKtH C9LeMi6ZcreNMm782X0HqVdF98E/VMUkJosFLoG6YFoNb68FVxj7nZ3plkfPkcdcfUIu Wgg/zBWFW2eC6lmUL84sZ2XkvfpIoxSvP1S5iLsAV1yvIjKhuf4bpzJfIoOeOAhJcila IdDw== X-Forwarded-Encrypted: i=2; AJvYcCXKkuk2axeyeTi7djYyownAMvPM6gQ/Dv2RQOjvQ+ZU+W/IHdtHy/UXIDVQIYWZZ3+f3BJ+4S2IWrfZWMEY@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yyk2sXto34moHzbYwG6BS8UQ0Zkympbg1bjR3sOvEwU4duybUbn 7MVt7mCC+ALSC/eyscRKGc/yxiMPiAIy88vZ5/gkDq4qLxnYR7RmqEUFCSSrPPTGLw== X-Google-Smtp-Source: AGHT+IGB9HfvwlGgrHQIt6CpdRFgBdcVShdMbgtTCdpkYlmEYDOtYrYHmp3w+7D53HmuqzVBrS30rQ== X-Received: by 2002:a05:651c:1a0c:b0:2ef:2ef5:ae98 with SMTP id 38308e7fff4ca-2f636a7fec3mr42627891fa.34.1725377469001; Tue, 03 Sep 2024 08:31:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a2e:2a46:0:b0:2ef:2594:c65c with SMTP id 38308e7fff4ca-2f610aa7c8als514351fa.2.-pod-prod-01-eu; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) X-Received: by 2002:a2e:a7c1:0:b0:2f3:d82b:1955 with SMTP id 38308e7fff4ca-2f636a2be54mr48501661fa.25.1725377467113; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377467; cv=none; d=google.com; s=arc-20160816; b=qOCeilKOBScBzmXj2PbAPtfRWOjFVsrQ+dCXEmJV9bmDz+BjD4q29yR6Mj0Iyyv4Y9 KGt0LXEpFE3bjnw2cuP/UAj9ZfcMdiKl2mewCXU0tkC0sR3q2wh6fUY/Kkg/FZgSdBlr D7VaZyLUkiI6sA4M+lxSSJo0uCzbdTw5PoJY7P6WQfh4ivHKMBcdXRVN164fG2KCfoVp 99wHsuGA0ebX95RqNeKJILNmMqITrYL1i89/kB0lFRbM1Up8BpLY8pOWr2EMBk7FV87Y uHXDd+PJyFr5PtE0g+wgAPobgpGrEUIDNtihDiXKswtLE83hytVFdQjhSQREcOO/4HgQ WWPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=MJb8L3BBTTjtu/5QlLxxiEltpkrooBUgYXQnQgVtbv0=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=taD8YuJGvyHzNUtv9gWX70o2m4fXSTnkjd23HmFvwE1sTjJ1S4Zoc8iXM874rJ7+qU /dIjrRlvNRIGlW4vnVP9OS12JkWFBBxLXihQHvmu7IoU/SJDo3ggGB6URkVDE6AFn+jp PqmMx+JD5Ybuu+o3bl9eGIP12yY9nyLDZoYwbpbo8s4W43nqKvvj/pj3yzdftmwQYE5O Tki0/i5oSXrI3I9vhPTdTm871J4MZjGjb3P6TlT5zvlMQsqjkuuAwHdRn4iP+k72cqnb WAT9VWvleLJ8EwHYRuj9feHrgKTT+O/wIBJbmQ1xo7SpvXzwzMZwqTNwEkKRawBotGuX K5Uw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ClBnuTKE; 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=pass 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 5b1f17b1804b1-42bb709bf58sor45719845e9.9.2024.09.03.08.31.07 for (Google Transport Security); Tue, 03 Sep 2024 08:31:07 -0700 (PDT) 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-Received: by 2002:a05:600c:19cb:b0:426:6696:9e50 with SMTP id 5b1f17b1804b1-42c82f53598mr46386845e9.14.1725377466457; Tue, 03 Sep 2024 08:31:06 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:06 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 06/29] clk: imx8mm: Mark IMX8MM_SYS_PLL2 and IMX8MM_SYS_PLL3 as enabled Date: Tue, 3 Sep 2024 17:30:37 +0200 Message-ID: <20240903153100.918077-6-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=ClBnuTKE; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Both clock are enabled by the bootloader and we need to increase their reference count to avoid disable during reparent operation. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c index 685e7df0e568..275f1196865b 100644 --- a/drivers/clk/imx/clk-imx8mm.c +++ b/drivers/clk/imx/clk-imx8mm.c @@ -170,6 +170,8 @@ static const char * const imx8mm_ecspi3_sels[] = {"clock-osc-24m", "sys_pll2_200 static int imx8mm_clk_probe(struct udevice *dev) { void __iomem *base; + struct clk *clk; + int ret; base = (void *)ANATOP_BASE_ADDR; @@ -448,6 +450,13 @@ static int imx8mm_clk_probe(struct udevice *dev) clk_dm(IMX8MM_CLK_QSPI_ROOT, imx_clk_gate4("qspi_root_clk", "qspi", base + 0x42f0, 0)); #endif + ret = clk_get_by_id(IMX8MM_SYS_PLL2, &clk); + if (!ret) + clk_enable(clk); + + ret = clk_get_by_id(IMX8MM_SYS_PLL3, &clk); + if (!ret) + clk_enable(clk); return 0; } From patchwork Tue Sep 3 15:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3379 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C8E1D3F228 for ; Tue, 3 Sep 2024 17:31:10 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-5334656d5c3sf5602320e87.1 for ; Tue, 03 Sep 2024 08:31:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377470; cv=pass; d=google.com; s=arc-20240605; b=jb8gUM2EYnCzobZLog28pTNUYVWNucSWuF/QAiNKeeT0pLM5ykZ00rocxoebWMTSPh yUn+Rlya46pwcCyYi0BIoD+i90TGOScqEoBXgMZ0wc6Se3QFCPX+TsM7CnzoQJ9TWeRI xJCZgayOLBJN9tVd5M+VX2Nnzd/MZzZ7dX+LnUW0c2lVvFtFworxlLFTN/YFBte1TgC2 1BrkO3B4gHuKg2U4NBkS1f5Hgef2p7DwwkH9I0UsdfajZo49URwty1sgpv0bIvewYpPT H5zJKXDeiNfftvnUycivAzUvSGgOMR9+HGiP/KycMflzhMIoWfGqp/vdYxzmRFiDhdP4 DVpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=iieuy0uPnv0ybZtqO7U7MYXCZZ7LXWmhQvzZ6mr1/uM=; fh=tY8lDxGVG/aCQ+lnCJA74HVC9l62GLRAGD5IkqqDZwU=; b=R1zM0/2Zqn5XaP1vt4h7HDT8pDUNAlYl6eFsYGhf2XyRdBNZIxRtIMS2t2uxGSuLeX +ABol6XsQInM7eM4dnQL5+GeWEwHR31bEuLVtopOA/zrGdi8G2+yrOV/7WDNcFFS4yV0 mtDMmn/Ux7b0hTmdtts13XYMDyWjUyJIgFJTIT2HlTSMlW+O37ydczJ8vrz74EnXRcXo yfd9518t7wpizdhCX0L2PfySWbttMCf8bdrMmFNxApp7FLo4aJTz4HGFpUcUC0sfB12D TsULJh6l66xnA8NNw6quEDCxqBM+TZ/SOQYTP4csJr9roykzOs+pzhcMU7CE7qiMu+gm orLQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TixEND1k; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377470; x=1725982270; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=iieuy0uPnv0ybZtqO7U7MYXCZZ7LXWmhQvzZ6mr1/uM=; b=UEeujy0JoedXrIGNu4dY+9ujB92i2e7X+9UhcoZiPBGXO9c89EbN8FOAcZL0uKtJai CdiPKo1gKcI+TPSV9ZYV78YsRuZRNfB+93zesR+y8FsE6hWlX1qHyCxJxYnZWzIYGNWA r4YA4RnneX9YqsNLip/Rha96VpF+Grjtej+r4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377470; x=1725982270; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iieuy0uPnv0ybZtqO7U7MYXCZZ7LXWmhQvzZ6mr1/uM=; b=E3CgfT93Cw0rn03OhwyDfACnk+iqJXsDfeWzHerwLRgPcwIERYrJsb0uv0uhPLqX5E 7U5W091uL8QSdsPii9+6ma5GC09UyrfMll0t0UbEEbChUNvWIWTc+msBIU4ghWrSE2u9 Am7AKrA1JqpAm1a5UOJRMg2wW9ksO9FYWshtIODGZj+PjqZilre0D3nuPRbujnysy0y5 zwaRC/TaJWGAnwwCiu1hBRcLHCm2BMFaW9xmfcQHyyrpER9OnABR/pRUnnXaFTcd8gFi +O4rXwcKxnHofEzPYvK/3xnaQ+f5fs03xis+RpmMjFDNmOYftdTc2bLLUnc5HBCeWzIV EYTg== X-Forwarded-Encrypted: i=2; AJvYcCVRi6MvOGVtocYE6kCMnWbi5a5b0Oc1+wfgRPCJL5mX/RCeKJoL4kEU4L0zThaeIGILuQtoVYGOUJWRWvAJ@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yw8YOqRaTewXCH8jn52L3BF9rhcSoaKQCNUPindcunCxmhqeW+h BS+ScmETzlmIeIWp+jDWwwux57hnwsl/++vN89u3nraPAR7c4e4O61TaciUWYjoIaA== X-Google-Smtp-Source: AGHT+IHFbuVQnRpTGWiSx0XD/M8JP2r4xSxg4Y3HyHMupVGAqMUgPpV4e7kXw88fSa0RcTsLnbEghg== X-Received: by 2002:a05:6512:e94:b0:52e:74d5:89ae with SMTP id 2adb3069b0e04-53546b8e017mr11415661e87.39.1725377470073; Tue, 03 Sep 2024 08:31:10 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:3b9d:b0:52f:317:fe07 with SMTP id 2adb3069b0e04-5353d818d91ls675557e87.2.-pod-prod-03-eu; Tue, 03 Sep 2024 08:31:08 -0700 (PDT) X-Received: by 2002:a05:6512:b9b:b0:52f:cdf3:2934 with SMTP id 2adb3069b0e04-53546afa392mr11745221e87.8.1725377467899; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377467; cv=none; d=google.com; s=arc-20160816; b=Ku9OG6+pU5fRGA9FjZSH4etNfDtBwFaBv4ownoExOzA7g11dki7Z/0VUJFD1k0BaVr TspIVIzzD8qtBkIehVmYogCuT1zg85cbGV7VR2A7rw0/8+ALA26+UB5+85QQnM8y2lJq HrSdZcF2sU4T7pDUbg8ZQTexrv0XAb2QiDDBDYf21o2Rqbc521CygVAaDk9eTM9CjLjd itsImfpIthHerpRliYeZych8Cv/zDnk3L0gS+UfYFWDmiQwPavCPqUAY6tCrSuujhF4K iI1Nqj8EK4hM+m/Qs6tURH2g267VuZQ+xaA+4ytCnmr/+LbDGRU9jEpcmz+6TSAAzN5y dccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=kWsyeuNuyXRiGvMqRv7xYcPZNquHRAzCR6o7cCFgnrw=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=DlVL3nu2yDrb0kt5o5St6N9pf7DMFGdm8PMXBkFEriP15MJYbEvIjltaAZb0oSnY6g gEbSBcbiNuho7TIWDDJUUcrSySipn/DxfODv3YcQicgsKIS7Hb7iCmOYjIWWbofZB6FZ l2chky5bGAZPMMSg966/69rlva281orM6tnXMvqnmNAyYISysmg5Jrhh5iq8mS6B0IG1 h/1wOQpuqY39Baa8+x+nqHsM+IeIoY9Xl5KEoX14oYtr6SsEhSGMiKVr7nmPBB25BHT2 ALJlbKnf/t/Br1NCEyECcWykLufP2MgI4UmShgmlgSnqR9ds1hT8NdFd3FLW6ScL8DRw dgbg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TixEND1k; 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=pass 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 5b1f17b1804b1-42bb7053f29sor47062325e9.1.2024.09.03.08.31.07 for (Google Transport Security); Tue, 03 Sep 2024 08:31:07 -0700 (PDT) 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-Received: by 2002:a05:600c:3b21:b0:426:60e4:c691 with SMTP id 5b1f17b1804b1-42c880efb1amr30413745e9.11.1725377467215; Tue, 03 Sep 2024 08:31:07 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:06 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 07/29] clk: imx8mn: Mark IMX8MN_SYS_PLL2 and IMX8MN_SYS_PLL3 as enabled Date: Tue, 3 Sep 2024 17:30:38 +0200 Message-ID: <20240903153100.918077-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=TixEND1k; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Both clock are enabled by the bootloader and we need to increase their reference count to avoid disable during reparent operation. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index e089012477a6..31d2faa97a3e 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -151,6 +151,7 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 static int imx8mn_clk_probe(struct udevice *dev) { struct clk osc_24m_clk; + struct clk *clk; void __iomem *base; int ret; @@ -417,6 +418,13 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_ECSPI3_ROOT, imx_clk_gate4("ecspi3_root_clk", "ecspi3", base + 0x4090, 0)); #endif + ret = clk_get_by_id(IMX8MN_SYS_PLL2, &clk); + if (!ret) + clk_enable(clk); + + ret = clk_get_by_id(IMX8MN_SYS_PLL3, &clk); + if (!ret) + clk_enable(clk); return 0; } From patchwork Tue Sep 3 15:30:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3380 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 167503FA4F for ; Tue, 3 Sep 2024 17:31:11 +0200 (CEST) Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-374beb23f35sf2323415f8f.0 for ; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377470; cv=pass; d=google.com; s=arc-20240605; b=HriW9Xz2NTWorq+5C96d4GaqMEZtdAALRxnZZAPNBOQOcdd4LZo/ppEyZXdKGP50hW PCFLHtb9oUjzdujTIKWi5Zmnm9xufACa3MUCOg05HCEJ30piyRisFDuOPbhEcY0HYy0D 8tf6ei56kY8k+9ANwLL/u6Hz6tKZTXMPg80XrqEmLAUpp9nqVi0g04dRoEn1ZR2AN/4v bXm4PauD5gpL2o+MRImNXdMAiVfwuZ+8Hq/AfO/PqHFpjJ48UkJmIBOYTItziZ/rx+aD 2vt/6pocZTgQNOK7GPdKzRLEeRlbKWQLeDn01+0KOkpPfUF6mytxFnXLiG0aLs1N4fZg i4Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=mWDufPksGEYToewnG+IsiEC6GijPyIJfwVUHg9uQVd4=; fh=2e/FmA1qhoKljMtdpE1Jw+4gx94J0lN5nojLVMRpB6U=; b=cA15LcsIxOrPbpPj+AnpLtT7mRo5H2JsRA9OXBqXZ+IxhuaWm2AoDq8PQlJG/Qwvqx Lwio3h2RzOwmB6KCPR/j60gQI4IqeD4ykwA2gtQya5YsdyAnW9kYojvbWIJU8Y9I0hbK 2bl68fNGjYvmPHMIenkaVChKwOnACWR6XkebKPnsHvtZsxa+seQVTUWfHitdzs0XjiPU IbKkLAs6AwEKFu812PCjDR0vI9Xw/SwQZW4Ek02nsrtsdMbElkvrRo08LLzsbkj5qAcc juS8eJ7AQG8Wb9McL016AnlxmWQvL7gZ1WzhEDZRy5JyXngRyq/NLj3hyUzeZZRHcwj6 iE+A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AT+itxFx; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377470; x=1725982270; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=mWDufPksGEYToewnG+IsiEC6GijPyIJfwVUHg9uQVd4=; b=BV8dXAKeTZWJ+qtm3vG10J/xDt5kxZaHeyOJK/hq/EkNlm1kCLDHJ8BPeJNnv/0x5G A8d26QwPxYseArW89oGLa3PUvDFbYDrR01qZQB6cXEtha8WLuqhhz8U8GTsYR6LzYYPO NoREqadXCfgXIxwxlt3xepd0lzUaV9m1mY7Rw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377470; x=1725982270; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mWDufPksGEYToewnG+IsiEC6GijPyIJfwVUHg9uQVd4=; b=HGappa8Vw5GRZTqs2TuU8R3E5ysUYy5yO7mWfG+y4poKUVHV/IBAWwGtci4/k2vfvy 0oy6mGOfoNNEiBY8sMk9ywQTPpGQXe0zhbemhrYPVxD5RMAuFYHAPLjoTiQJ7iVokrJK nnaKyAFS9mYfyg35tFU0v85rhUh4+r4K0/QLOrT5weFoPmjk+jtmARp33i1qNBN891cy 9R10AxdSk4q/fIoKr5HO3AkP1uT4OBm90LcA7cQh9yu7TFmSXKqpxCITVY1CX7Hc1/UU QB2KA9MrQWmYC3RytpqX9lHW/I6SAEeErqxqAJrnrDTMqHBg6o+KcX34xHRww3nimvvj CTNQ== X-Forwarded-Encrypted: i=2; AJvYcCUgcH0born5XYIJ9Or54kaRV1n6nHYLwUNrA+FV7a3oeqEUihjl9PxXDc6d5wBlpV5/rVjhK0mrPmoE9K1F@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxmKEGM7cmlkHaUmaO+0krBx7hAIJH0bluprUP/e8hkLX6tLIgv Hn8otvzG+FKNJPQxGp6U5MfNl5PhobaoTk9XnlsKuENRa7Z5ZnInN/61LRvOjq7fgw== X-Google-Smtp-Source: AGHT+IFyflJGCmVAkNP+XMbjHvHVAwd4K1EDNJNk/q5Vf5LjDqEHNU8DjCSFIsIevUctKUTC53YaJw== X-Received: by 2002:adf:fb4f:0:b0:368:7f4f:9ead with SMTP id ffacd0b85a97d-3749b531648mr11883963f8f.7.1725377470602; Tue, 03 Sep 2024 08:31:10 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:adf:ffca:0:b0:374:d333:a5d9 with SMTP id ffacd0b85a97d-374d333a676ls453232f8f.0.-pod-prod-08-eu; Tue, 03 Sep 2024 08:31:09 -0700 (PDT) X-Received: by 2002:adf:9d87:0:b0:368:5bb4:169b with SMTP id ffacd0b85a97d-374bed94fe5mr7298576f8f.4.1725377468919; Tue, 03 Sep 2024 08:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377468; cv=none; d=google.com; s=arc-20160816; b=a3qckYdn0Qas8iWyyy24DTaPT6gJztZpc+zVNJg1tnGvDHzgHUdvzWyXliZB0Mo3Zy onS90QriyUk0ZSy4N9gp37Q0sDGP0mu93KxZo0NBvdVPxrEPzdxFGgQMwCgsri2p9PnP 8I7xq983LXxh1Q33/Ixz/D+ld2qRZJ0tTJWCevWdHpJX9HnYHytNggvSbG4us4L5SCwK d2ccU2wGmn274kFUmOuHF3ulXASAFgVkndHjL7tghnTCa3R/1FF83+gOVTwjhBZFIisR Xsd8dX5HGly+HSuI7a8RS2lPhy0x0bxPagpY7zKznTSAiLfBTMnOpXIxUsizbbkUJknY ysyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=oaGGzg1ZcW8MunpfHTSkfDsZrsx9ImjK3JuQuUVolOE=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=o0QMfy2DA6ceYMOPd6uKqfydJEXtDNHwL3BQMgIXU8s67rujfnDPQ/QBPqSHt19joO gT+CePv8by540QVwYtFHqd6nkO3+GhMunHyUff2FDBMGtTl4uwo4GagIXeNcA2NDVcjS G7pepM1MUk6hTZsOFlOOKKzr7UcdQHjjL5IJF2ychZl+gGYjrAqxPRax2E21NSkWxlIp lgpn1TuEb30TSH6+EVKF3Ry16PuoXe32rNVuE2nlG4rDTfqoxxxMQX9ya+Cs+lYL0efF 8mWNoMelFp5NP66coqmt17iaKb7DG9dPftd2NFkMA1YjJgctx2wiBt0WMVdbzDEXIbZJ WSCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AT+itxFx; 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=pass 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 5b1f17b1804b1-42bb7052accsor46233935e9.3.2024.09.03.08.31.08 for (Google Transport Security); Tue, 03 Sep 2024 08:31:08 -0700 (PDT) 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-Received: by 2002:a05:600c:3b10:b0:426:50e1:ea6e with SMTP id 5b1f17b1804b1-42bb0306838mr144717935e9.18.1725377468217; Tue, 03 Sep 2024 08:31:08 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:07 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 08/29] clk: imx8mn: add video clocks support Date: Tue, 3 Sep 2024 17:30:39 +0200 Message-ID: <20240903153100.918077-8-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=AT+itxFx; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Add clocks support for the video subsystem. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 31d2faa97a3e..089f5169da1a 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -17,6 +17,7 @@ static u32 share_count_nand; static const char * const pll_ref_sels[] = { "clock-osc-24m", "dummy", "dummy", "dummy", }; +static const char * const video_pll_bypass_sels[] = {"video_pll", "video_pll_ref_sel", }; static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", }; static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; static const char * const sys_pll1_bypass_sels[] = {"sys_pll1", "sys_pll1_ref_sel", }; @@ -44,6 +45,34 @@ static const char * const imx8mn_enet_axi_sels[] = {"clock-osc-24m", "sys_pll1_2 "video_pll_out", "sys_pll3_out", }; #ifndef CONFIG_SPL_BUILD +static const char * const imx8mn_disp_axi_sels[] = {"clock-osc-24m", "sys_pll2_1000m", "sys_pll1_800m", + "sys_pll3_out", "sys_pll1_40m", "audio_pll2_out", + "clk_ext1", "clk_ext4", }; + +static const char * const imx8mn_disp_apb_sels[] = {"clock-osc-24m", "sys_pll2_125m", "sys_pll1_800m", + "sys_pll3_out", "sys_pll1_40m", "audio_pll2_out", + "clk_ext1", "clk_ext3", }; + +static const char * const imx8mn_disp_pixel_sels[] = {"clock-osc-24m", "video_pll_out", "audio_pll2_out", + "audio_pll1_out", "sys_pll1_800m", "sys_pll2_1000m", + "sys_pll3_out", "clk_ext4", }; + +static const char * const imx8mn_dsi_core_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll2_250m", + "sys_pll1_800m", "sys_pll2_1000m", "sys_pll3_out", + "audio_pll2_out", "video_pll_out", }; + +static const char * const imx8mn_dsi_phy_sels[] = {"clock-osc-24m", "sys_pll2_125m", "sys_pll2_100m", + "sys_pll1_800m", "sys_pll2_1000m", "clk_ext2", + "audio_pll2_out", "video_pll_out", }; + +static const char * const imx8mn_dsi_dbi_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll2_100m", + "sys_pll1_800m", "sys_pll2_1000m", "sys_pll3_out", + "audio_pll2_out", "video_pll_out", }; + +static const char * const imx8mn_camera_pixel_sels[] = {"clock-osc-24m", "sys_pll1_266m", "sys_pll2_250m", + "sys_pll1_800m", "sys_pll2_1000m", "sys_pll3_out", + "audio_pll2_out", "video_pll_out", }; + static const char * const imx8mn_enet_ref_sels[] = {"clock-osc-24m", "sys_pll2_125m", "sys_pll2_50m", "sys_pll2_100m", "sys_pll1_160m", "audio_pll1_out", "video_pll_out", "clk_ext4", }; @@ -148,6 +177,10 @@ static const char * const imx8mn_usb_phy_sels[] = {"clock-osc-24m", "sys_pll1_10 "sys_pll2_100m", "sys_pll2_200m", "clk_ext2", "clk_ext3", "audio_pll2_out", }; +#ifndef CONFIG_SPL_BUILD +static unsigned int share_count_disp; +#endif + static int imx8mn_clk_probe(struct udevice *dev) { struct clk osc_24m_clk; @@ -188,8 +221,19 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_SYS_PLL3, imx_clk_pll14xx("sys_pll3", "sys_pll3_ref_sel", base + 0x114, &imx_1416x_pll)); + clk_dm(IMX8MN_VIDEO_PLL_REF_SEL, + imx_clk_mux("video_pll_ref_sel", base + 0x28, 0, 2, + pll_ref_sels, ARRAY_SIZE(pll_ref_sels))); + clk_dm(IMX8MN_VIDEO_PLL1, + imx_clk_pll14xx("video_pll", "video_pll_ref_sel", + base + 0x28, &imx_1443x_pll)); /* PLL bypass out */ + clk_dm(IMX8MN_VIDEO_PLL_BYPASS, + imx_clk_mux_flags("video_pll_bypass", base + 0x28, 16, 1, + video_pll_bypass_sels, + ARRAY_SIZE(video_pll_bypass_sels), + CLK_SET_RATE_PARENT)); clk_dm(IMX8MN_DRAM_PLL_BYPASS, imx_clk_mux_flags("dram_pll_bypass", base + 0x50, 4, 1, dram_pll_bypass_sels, @@ -217,6 +261,9 @@ static int imx8mn_clk_probe(struct udevice *dev) CLK_SET_RATE_PARENT)); /* PLL out gate */ + clk_dm(IMX8MN_VIDEO_PLL_OUT, + imx_clk_gate("video_pll_out", "video_pll_bypass", + base + 0x28, 13)); clk_dm(IMX8MN_DRAM_PLL_OUT, imx_clk_gate("dram_pll_out", "dram_pll_bypass", base + 0x50, 13)); @@ -373,6 +420,31 @@ static int imx8mn_clk_probe(struct udevice *dev) /* clks not needed in SPL stage */ #ifndef CONFIG_SPL_BUILD + clk_dm(IMX8MN_CLK_DISP_AXI, + imx8m_clk_composite("disp_axi", imx8mn_disp_axi_sels, base + 0x8a00)); + clk_dm(IMX8MN_CLK_DISP_APB, + imx8m_clk_composite("disp_apb", imx8mn_disp_apb_sels, base + 0x8a80)); + clk_dm(IMX8MN_CLK_DISP_PIXEL, + __imx8m_clk_composite("disp_pixel", imx8mn_disp_pixel_sels, base + 0xa500, + CLK_SET_RATE_PARENT)); + clk_dm(IMX8MN_CLK_DSI_CORE, + imx8m_clk_composite("dsi_core", imx8mn_dsi_core_sels, base + 0xbb00)); + clk_dm(IMX8MN_CLK_DSI_PHY_REF, + imx8m_clk_composite("dsi_phy_ref", imx8mn_dsi_phy_sels, base + 0xbb80)); + clk_dm(IMX8MN_CLK_DSI_DBI, + imx8m_clk_composite("dsi_dbi", imx8mn_dsi_dbi_sels, base + 0xbc00)); + clk_dm(IMX8MN_CLK_CAMERA_PIXEL, + imx8m_clk_composite("camera_pixel", imx8mn_camera_pixel_sels, base + 0xbd00)); + + clk_dm(IMX8MN_CLK_DISP_AXI_ROOT, + imx_clk_gate2_shared2("disp_axi_root_clk", "disp_axi", base + 0x45d0, 0, &share_count_disp)); + clk_dm(IMX8MN_CLK_DISP_APB_ROOT, + imx_clk_gate2_shared2("disp_apb_root_clk", "disp_apb", base + 0x45d0, 0, &share_count_disp)); + clk_dm(IMX8MN_CLK_CAMERA_PIXEL_ROOT, + imx_clk_gate2_shared2("camera_pixel_clk", "camera_pixel", base + 0x45d0, 0, &share_count_disp)); + clk_dm(IMX8MN_CLK_DISP_PIXEL_ROOT, + imx_clk_gate2_shared2("disp_pixel_clk", "disp_pixel", base + 0x45d0, 0, &share_count_disp)); + clk_dm(IMX8MN_CLK_ENET_REF, imx8m_clk_composite("enet_ref", imx8mn_enet_ref_sels, base + 0xa980)); From patchwork Tue Sep 3 15:30:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3381 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C8DAE3F360 for ; Tue, 3 Sep 2024 17:31:12 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4280b119a74sf3960245e9.3 for ; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377472; cv=pass; d=google.com; s=arc-20240605; b=gb8j2AWx8GLp276drredaL1bvPq+vAG1D86Gslo+xitpVJFNAjSklGTmAZp49a5a2t majkmcdTT9tPzTuQif4FzF6yvCJn/JSzgrC/qqu1y63FxkY7qWAwj+Z2B8SOZV9nWRpR qbfIXimMj8fX2IjJ2fQoDrusJ9ytTgOQd/pk4OmtFtNIMlvmpe6KkY/d7cPekRZc0Ajq 4uDP70tbs7DYYKgXZTobFpMPUDDxbWsgle7emWEG5S4a7NiFMNxEneHYVhKz1eJrIVg+ Xy3q7aPTrskzAZKid1r1aqsc3ydARYPQm9tpcDCUYYHkX2B0J6EsdGeqBFl0xJcmKiMh PLWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=v3OxefpvdoeH50yprl42ZDBcjf0eFnaPZgpf0nBsokI=; fh=WEXw8XTK0x2tgmzv6nLkgWRHrkKWoy6Rbwks4geofq8=; b=U9Uw8FU5uydwXK0XK6uEZXosEzkYovvLZv/uMM2ARe3JHnhizHw5NXga9tvUksa1P/ ZXS/q8Np94L4x3zw/8IkxUZZVYIdq5ae2slU13Cqjz9oozyiZCCghHmVcP0M43jRy0ec 1epHa+ZGdU9xS8efrFBdDDNhh0/QfYzdNPXRYI7BiFf9lZQq1hbpMNpakglB89+ztx83 +pIks2B/kIiyhlp/+Zmho0YZi85XQIQPSoke6Mk7QqlgIH6ilU2T+ezzwUOhQuSkjK0+ 9oAMCoYqR1qodKG6A67bUeWF7GhYK99k1scj2pkHnBuFNhTRVxqHLqcUPS1JB6Gfoyy1 Dgpw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GNhfhrDH; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377472; x=1725982272; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=v3OxefpvdoeH50yprl42ZDBcjf0eFnaPZgpf0nBsokI=; b=QvOrvknzNa9aibDkdP/94WVMtxhanPUoMWYY9+y26vT4KxnVMufN2uiDJ+Pf8kWggd m680taI2zsxRZOrJabXLLpnLAOzIfq8zx03YHHGxTaYGeeSQ6nQ74ydexnbq0qFRcIQg XfOgCuH9QMtC/NWS/lKmuzepiicUxZQ1+5dQM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377472; x=1725982272; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v3OxefpvdoeH50yprl42ZDBcjf0eFnaPZgpf0nBsokI=; b=Rm/7Ieqk6o/ZJIdYTKAo9+welm6yoHH2o2lMv1iF74/nuZFs4tsXM7ZeubLDwI7E5x agBYqOdlRvhopymUPXDUXEtrg5b3fBp4A+GUfKHdRrDWy/5OcZP7SfkQvNTvo8wU4siJ ckUFqzUUePRVq2sLtHUTHnlhqnNz4tpLnq1TtrbA8aZ3qm8GJ34k8XeUGaTZyo6Jm+dc p31iis+vPVGrvsmzMCkDWQLoG/WTaV8evc9iOcMX3PauZpMH8EEBkF5BI8p6hkIHslvs wpuCOyCh3x0fqsTGKilB/Xf55xS0d0zjxf5tzsBaYF3FvMp7rbQo5janTM6VPhAFsBX0 /Apw== X-Forwarded-Encrypted: i=2; AJvYcCWplAZtPsxdyHQzqWXGqu28CXlVSRVVv3K/QlvqYnNBDu4421SS8NVELz7W4QSuG0API9vPXuyF41o39N11@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwYwZ2/nUFpi+fM159zTfVmcUXvLC5tKJBNhbowoth15MMFwFXt P80sxwoUaDJoT/WsMkktbdMq4+g3bttN8yDWUcNeRe6lrQwyGfI0IjUMO1CUDd2T/Mc8sukxdQ= = X-Google-Smtp-Source: AGHT+IGZROIX27xxF/b+ousk5tED6Wzuz7tRFSYYqEaa4yL6rxkkUxQPE8jlWSxAioEYIFYRFhfXZw== X-Received: by 2002:a05:600c:1f93:b0:426:6308:e2f0 with SMTP id 5b1f17b1804b1-42bb01e6bfamr115051415e9.26.1725377472227; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4686:b0:427:9377:3cc4 with SMTP id 5b1f17b1804b1-42bb2a0d072ls3939635e9.1.-pod-prod-06-eu; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) X-Received: by 2002:a05:6000:cca:b0:368:657a:6347 with SMTP id ffacd0b85a97d-3749b54fb67mr12120894f8f.34.1725377470580; Tue, 03 Sep 2024 08:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377470; cv=none; d=google.com; s=arc-20160816; b=iiqgv7K13rvv7Ha9VQHa7AhXnBAjb+WuuhxYMSLw6ev0P168toOH2D6Uv4HQwn4FbL acAzt0H64VGIyWzIB2ML5TcdFhMGC8LRVQJpDiLfaENLnd3n6vzv8tM1tgzdAGA9pvvv VHdWEJoyaVjtlJvGJnxBZYJ4R35Rjj93gY6R2noPKTWlmoz+cl6SETFzbqE8VecqqZBM cRbqEzI8brdplksZDmT6/S6MxEntl2UBahDKds8Gi93773/vdGPc2jfx1s0OtJpgmbrJ jqv88sdAOVtcp93HDOr2Y1qJqPPGQiYFxQKoHtfde/qj1z1QGI6vG4kBwRVgLPUXo5ek Ad9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=wd8z27M+2rT/HE8v2FCmgjkp6Y/sl22jU7/0tzRq3EQ=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=biGshsH+jeUKvP7j0TBI/0GYPbNGdXisyckTKjLR0hQgT0eIdf2Ey89f2S400ODs2h AhdsZIfxyMR3YWAQiMsFjNRvLZcHRYGqm9bn/ZromlclxgQIsElnuwWYekDNfWlz7iwP wdXIUF/3sTyRlkVMwvAISARyGViW5w1ipMxGqmX7BrCVQSUQZet+rjAUP24s65Dcvj4m gXX6IID3OaSpYemaKkXj5C3Qcb0z44s9uKkxB6raeg68tCof/LwOZ3o49w24XeZGw5WL jK87LEJaSgJCL22eETl3lGbBn9wlNFPO8p+8jVZe4VYi0VoIm/boOM2cHv9RxloVY04b 0wOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=GNhfhrDH; 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=pass 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 5b1f17b1804b1-42bb70b7031sor44103265e9.12.2024.09.03.08.31.10 for (Google Transport Security); Tue, 03 Sep 2024 08:31:10 -0700 (PDT) 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-Received: by 2002:a05:600c:1c1b:b0:426:6f27:379a with SMTP id 5b1f17b1804b1-42bb01b4c35mr126550935e9.13.1725377469449; Tue, 03 Sep 2024 08:31:09 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:09 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 09/29] power: Add iMX8M block ctrl driver for dispmix Date: Tue, 3 Sep 2024 17:30:40 +0200 Message-ID: <20240903153100.918077-9-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=GNhfhrDH; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Add iMX8 block ctrl driver for displaymix on iMX8MM/iMX8MN and mediamix on iMX8MP. To support blk ctrl driver, the power domain driver on iMX8M needs update to add relevant PGC domains Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/power/domain/Kconfig | 6 + drivers/power/domain/Makefile | 1 + drivers/power/domain/imx8m-blk-ctrl.c | 431 ++++++++++++++++++++++ drivers/power/domain/imx8m-power-domain.c | 213 ++++++++++- 4 files changed, 649 insertions(+), 2 deletions(-) create mode 100644 drivers/power/domain/imx8m-blk-ctrl.c diff --git a/drivers/power/domain/Kconfig b/drivers/power/domain/Kconfig index bd82d2f7044b..fb006b6e8e28 100644 --- a/drivers/power/domain/Kconfig +++ b/drivers/power/domain/Kconfig @@ -40,6 +40,12 @@ config IMX8M_POWER_DOMAIN Enable support for manipulating NXP i.MX8M on-SoC power domains via requests to the ATF. +config IMX8M_BLK_CTRL + bool "Enable i.MX8M block control driver" + depends on POWER_DOMAIN && ARCH_IMX8M + help + Enable support for manipulating NXP i.MX8M on-SoC block control driver + config IMX8MP_HSIOMIX_BLKCTRL bool "Enable i.MX8MP HSIOMIX domain driver" depends on POWER_DOMAIN && IMX8MP diff --git a/drivers/power/domain/Makefile b/drivers/power/domain/Makefile index 2daab73eb758..46849fd2a4db 100644 --- a/drivers/power/domain/Makefile +++ b/drivers/power/domain/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_APPLE_PMGR_POWER_DOMAIN) += apple-pmgr.o obj-$(CONFIG_BCM6328_POWER_DOMAIN) += bcm6328-power-domain.o obj-$(CONFIG_IMX8_POWER_DOMAIN) += imx8-power-domain-legacy.o imx8-power-domain.o obj-$(CONFIG_IMX8M_POWER_DOMAIN) += imx8m-power-domain.o +obj-$(CONFIG_IMX8M_BLK_CTRL) += imx8m-blk-ctrl.o obj-$(CONFIG_IMX8MP_HSIOMIX_BLKCTRL) += imx8mp-hsiomix.o obj-$(CONFIG_MTK_POWER_DOMAIN) += mtk-power-domain.o obj-$(CONFIG_MESON_GX_VPU_POWER_DOMAIN) += meson-gx-pwrc-vpu.o diff --git a/drivers/power/domain/imx8m-blk-ctrl.c b/drivers/power/domain/imx8m-blk-ctrl.c new file mode 100644 index 000000000000..3c22d9de3822 --- /dev/null +++ b/drivers/power/domain/imx8m-blk-ctrl.c @@ -0,0 +1,431 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2023 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BLK_SFT_RSTN 0x0 +#define BLK_CLK_EN 0x4 +#define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano/Plus DISPLAY_BLK_CTRL only */ + +#define DOMAIN_MAX_CLKS 4 + +struct imx8m_blk_ctrl_domain { + struct clk clks[DOMAIN_MAX_CLKS]; + struct power_domain power_dev; +}; + +struct imx8m_blk_ctrl { + void __iomem *base; + struct power_domain bus_power_dev; + struct imx8m_blk_ctrl_domain *domains; +}; + +struct imx8m_blk_ctrl_domain_data { + const char *name; + const char * const *clk_names; + const char *gpc_name; + int num_clks; + u32 rst_mask; + u32 clk_mask; + u32 mipi_phy_rst_mask; +}; + +struct imx8m_blk_ctrl_data { + int max_reg; + const struct imx8m_blk_ctrl_domain_data *domains; + int num_domains; + u32 bus_rst_mask; + u32 bus_clk_mask; +}; + +static int imx8m_blk_ctrl_request(struct power_domain *power_domain) +{ + return 0; +} + +static int imx8m_blk_ctrl_free(struct power_domain *power_domain) +{ + return 0; +} + +static int imx8m_blk_ctrl_enable_domain_clk(struct udevice *dev, ulong domain_id, bool enable) +{ + int ret, i; + struct imx8m_blk_ctrl *priv = (struct imx8m_blk_ctrl *)dev_get_priv(dev); + struct imx8m_blk_ctrl_data *drv_data = + (struct imx8m_blk_ctrl_data *)dev_get_driver_data(dev); + + debug("%s num_clk %u\n", __func__, drv_data->domains[domain_id].num_clks); + + for (i = 0; i < drv_data->domains[domain_id].num_clks; i++) { + debug("%s clk %s\n", __func__, drv_data->domains[domain_id].clk_names[i]); + if (enable) + ret = clk_enable(&priv->domains[domain_id].clks[i]); + else + ret = clk_disable(&priv->domains[domain_id].clks[i]); + if (ret && ret != -ENOENT) { + printf("Failed to %s domain clk %s\n", enable ? "enable" : "disable", drv_data->domains[domain_id].clk_names[i]); + return ret; + } + } + + return 0; +} + +static int imx8m_blk_ctrl_power_on(struct power_domain *power_domain) +{ + struct udevice *dev = power_domain->dev; + struct imx8m_blk_ctrl *priv = (struct imx8m_blk_ctrl *)dev_get_priv(dev); + struct imx8m_blk_ctrl_data *drv_data = + (struct imx8m_blk_ctrl_data *)dev_get_driver_data(dev); + int ret; + + debug("%s, id %lu\n", __func__, power_domain->id); + + if (!priv->domains[power_domain->id].power_dev.dev) + return -ENODEV; + + ret = power_domain_on(&priv->bus_power_dev); + if (ret < 0) { + printf("Failed to power up bus domain %d\n", ret); + return ret; + } + + /* Enable bus clock and deassert bus reset */ + setbits_le32(priv->base + BLK_CLK_EN, drv_data->bus_clk_mask); + setbits_le32(priv->base + BLK_SFT_RSTN, drv_data->bus_rst_mask); + + /* wait for reset to propagate */ + udelay(5); + + /* put devices into reset */ + clrbits_le32(priv->base + BLK_SFT_RSTN, drv_data->domains[power_domain->id].rst_mask); + if (drv_data->domains[power_domain->id].mipi_phy_rst_mask) + clrbits_le32(priv->base + BLK_MIPI_RESET_DIV, drv_data->domains[power_domain->id].mipi_phy_rst_mask); + + /* enable upstream and blk-ctrl clocks to allow reset to propagate */ + ret = imx8m_blk_ctrl_enable_domain_clk(dev, power_domain->id, true); + if (ret) { + printf("failed to enable clocks\n"); + goto bus_powerdown; + } + + /* ungate clk */ + setbits_le32(priv->base + BLK_CLK_EN, drv_data->domains[power_domain->id].clk_mask); + + /* power up upstream GPC domain */ + ret = power_domain_on(&priv->domains[power_domain->id].power_dev); + if (ret < 0) { + printf("Failed to power up peripheral domain %d\n", ret); + goto clk_disable; + } + + /* wait for reset to propagate */ + udelay(5); + + /* release reset */ + setbits_le32(priv->base + BLK_SFT_RSTN, drv_data->domains[power_domain->id].rst_mask); + if (drv_data->domains[power_domain->id].mipi_phy_rst_mask) + setbits_le32(priv->base + BLK_MIPI_RESET_DIV, drv_data->domains[power_domain->id].mipi_phy_rst_mask); + + return 0; +clk_disable: + imx8m_blk_ctrl_enable_domain_clk(dev, power_domain->id, false); +bus_powerdown: + power_domain_off(&priv->bus_power_dev); + return ret; +} + +static int imx8m_blk_ctrl_power_off(struct power_domain *power_domain) +{ + struct udevice *dev = power_domain->dev; + struct imx8m_blk_ctrl *priv = (struct imx8m_blk_ctrl *)dev_get_priv(dev); + struct imx8m_blk_ctrl_data *drv_data = + (struct imx8m_blk_ctrl_data *)dev_get_driver_data(dev); + + debug("%s, id %lu\n", __func__, power_domain->id); + + if (!priv->domains[power_domain->id].power_dev.dev) + return -ENODEV; + + /* put devices into reset and disable clocks */ + if (drv_data->domains[power_domain->id].mipi_phy_rst_mask) + clrbits_le32(priv->base + BLK_MIPI_RESET_DIV, drv_data->domains[power_domain->id].mipi_phy_rst_mask); + + /* assert reset */ + clrbits_le32(priv->base + BLK_SFT_RSTN, drv_data->domains[power_domain->id].rst_mask); + + /* gate clk */ + clrbits_le32(priv->base + BLK_CLK_EN, drv_data->domains[power_domain->id].clk_mask); + + /* power down upstream GPC domain */ + power_domain_off(&priv->domains[power_domain->id].power_dev); + + imx8m_blk_ctrl_enable_domain_clk(dev, power_domain->id, false); + + /* power down bus domain */ + power_domain_off(&priv->bus_power_dev); + + return 0; +} + +static int imx8m_blk_ctrl_probe(struct udevice *dev) +{ + int ret, i, j; + struct imx8m_blk_ctrl *priv = (struct imx8m_blk_ctrl *)dev_get_priv(dev); + struct imx8m_blk_ctrl_data *drv_data = + (struct imx8m_blk_ctrl_data *)dev_get_driver_data(dev); + + priv->base = dev_read_addr_ptr(dev); + if (!priv->base) + return -EINVAL; + + priv->domains = kcalloc(drv_data->num_domains, sizeof(struct imx8m_blk_ctrl_domain), GFP_KERNEL); + + ret = power_domain_get_by_name(dev, &priv->bus_power_dev, "bus"); + if (ret) { + printf("Failed to power_domain_get_by_name %s\n", "bus"); + return ret; + } + + for (j = 0; j < drv_data->num_domains; j++) { + ret = power_domain_get_by_name(dev, &priv->domains[j].power_dev, drv_data->domains[j].gpc_name); + if (ret) + continue; + + for (i = 0; i < drv_data->domains[j].num_clks; i++) { + ret = clk_get_by_name(dev, drv_data->domains[j].clk_names[i], &priv->domains[j].clks[i]); + if (ret) { + printf("Failed to get clk %s\n", drv_data->domains[j].clk_names[i]); + return ret; + } + } + } + + return 0; +} + +static int imx8m_blk_ctrl_remove(struct udevice *dev) +{ + struct imx8m_blk_ctrl *priv = (struct imx8m_blk_ctrl *)dev_get_priv(dev); + + kfree(priv->domains); + + return 0; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] = { + [IMX8MM_DISPBLK_PD_CSI_BRIDGE] = { + .name = "dispblk-csi-bridge", + .clk_names = (const char *[]){ "csi-bridge-axi", "csi-bridge-apb", + "csi-bridge-core", }, + .num_clks = 3, + .gpc_name = "csi-bridge", + .rst_mask = BIT(0) | BIT(1) | BIT(2), + .clk_mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5), + }, + [IMX8MM_DISPBLK_PD_LCDIF] = { + .name = "dispblk-lcdif", + .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, + .num_clks = 3, + .gpc_name = "lcdif", + .clk_mask = BIT(6) | BIT(7), + }, + [IMX8MM_DISPBLK_PD_MIPI_DSI] = { + .name = "dispblk-mipi-dsi", + .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, + .num_clks = 2, + .gpc_name = "mipi-dsi", + .rst_mask = BIT(5), + .clk_mask = BIT(8) | BIT(9), + .mipi_phy_rst_mask = BIT(17), + }, + [IMX8MM_DISPBLK_PD_MIPI_CSI] = { + .name = "dispblk-mipi-csi", + .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, + .num_clks = 2, + .gpc_name = "mipi-csi", + .rst_mask = BIT(3) | BIT(4), + .clk_mask = BIT(10) | BIT(11), + .mipi_phy_rst_mask = BIT(16), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { + .max_reg = 0x2c, + .domains = imx8mm_disp_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), + .bus_rst_mask = BIT(6), + .bus_clk_mask = BIT(12), +}; + +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { + [IMX8MN_DISPBLK_PD_MIPI_DSI] = { + .name = "dispblk-mipi-dsi", + .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, + .num_clks = 2, + .gpc_name = "mipi-dsi", + .rst_mask = BIT(0) | BIT(1), + .clk_mask = BIT(0) | BIT(1), + .mipi_phy_rst_mask = BIT(17), + }, + [IMX8MN_DISPBLK_PD_MIPI_CSI] = { + .name = "dispblk-mipi-csi", + .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, + .num_clks = 2, + .gpc_name = "mipi-csi", + .rst_mask = BIT(2) | BIT(3), + .clk_mask = BIT(2) | BIT(3), + .mipi_phy_rst_mask = BIT(16), + }, + [IMX8MN_DISPBLK_PD_LCDIF] = { + .name = "dispblk-lcdif", + .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, + .num_clks = 3, + .gpc_name = "lcdif", + .rst_mask = BIT(4) | BIT(5), + .clk_mask = BIT(4) | BIT(5), + }, + [IMX8MN_DISPBLK_PD_ISI] = { + .name = "dispblk-isi", + .clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root", + "disp_apb_root"}, + .num_clks = 4, + .gpc_name = "isi", + .rst_mask = BIT(6) | BIT(7), + .clk_mask = BIT(6) | BIT(7), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { + .max_reg = 0x84, + .domains = imx8mn_disp_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mn_disp_blk_ctl_domain_data), + .bus_rst_mask = BIT(8), + .bus_clk_mask = BIT(8), +}; + +static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[] = { + [IMX8MP_MEDIABLK_PD_MIPI_DSI_1] = { + .name = "mediablk-mipi-dsi-1", + .clk_names = (const char *[]){ "apb", "phy", }, + .num_clks = 2, + .gpc_name = "mipi-dsi1", + .rst_mask = BIT(0) | BIT(1), + .clk_mask = BIT(0) | BIT(1), + .mipi_phy_rst_mask = BIT(17), + }, + [IMX8MP_MEDIABLK_PD_MIPI_CSI2_1] = { + .name = "mediablk-mipi-csi2-1", + .clk_names = (const char *[]){ "apb", "cam1" }, + .num_clks = 2, + .gpc_name = "mipi-csi1", + .rst_mask = BIT(2) | BIT(3), + .clk_mask = BIT(2) | BIT(3), + .mipi_phy_rst_mask = BIT(16), + }, + [IMX8MP_MEDIABLK_PD_LCDIF_1] = { + .name = "mediablk-lcdif-1", + .clk_names = (const char *[]){ "disp1", "apb", "axi", }, + .num_clks = 3, + .gpc_name = "lcdif1", + .rst_mask = BIT(4) | BIT(5) | BIT(23), + .clk_mask = BIT(4) | BIT(5) | BIT(23), + }, + [IMX8MP_MEDIABLK_PD_ISI] = { + .name = "mediablk-isi", + .clk_names = (const char *[]){ "axi", "apb" }, + .num_clks = 2, + .gpc_name = "isi", + .rst_mask = BIT(6) | BIT(7), + .clk_mask = BIT(6) | BIT(7), + }, + [IMX8MP_MEDIABLK_PD_MIPI_CSI2_2] = { + .name = "mediablk-mipi-csi2-2", + .clk_names = (const char *[]){ "apb", "cam2" }, + .num_clks = 2, + .gpc_name = "mipi-csi2", + .rst_mask = BIT(9) | BIT(10), + .clk_mask = BIT(9) | BIT(10), + .mipi_phy_rst_mask = BIT(30), + }, + [IMX8MP_MEDIABLK_PD_LCDIF_2] = { + .name = "mediablk-lcdif-2", + .clk_names = (const char *[]){ "disp2", "apb", "axi", }, + .num_clks = 3, + .gpc_name = "lcdif2", + .rst_mask = BIT(11) | BIT(12) | BIT(24), + .clk_mask = BIT(11) | BIT(12) | BIT(24), + }, + [IMX8MP_MEDIABLK_PD_ISP] = { + .name = "mediablk-isp", + .clk_names = (const char *[]){ "isp", "axi", "apb" }, + .num_clks = 3, + .gpc_name = "isp", + .rst_mask = BIT(16) | BIT(17) | BIT(18), + .clk_mask = BIT(16) | BIT(17) | BIT(18), + }, + [IMX8MP_MEDIABLK_PD_DWE] = { + .name = "mediablk-dwe", + .clk_names = (const char *[]){ "axi", "apb" }, + .num_clks = 2, + .gpc_name = "dwe", + .rst_mask = BIT(19) | BIT(20) | BIT(21), + .clk_mask = BIT(19) | BIT(20) | BIT(21), + }, + [IMX8MP_MEDIABLK_PD_MIPI_DSI_2] = { + .name = "mediablk-mipi-dsi-2", + .clk_names = (const char *[]){ "phy", }, + .num_clks = 1, + .gpc_name = "mipi-dsi2", + .rst_mask = BIT(22), + .clk_mask = BIT(22), + .mipi_phy_rst_mask = BIT(29), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mp_media_blk_ctl_dev_data = { + .max_reg = 0x138, + .domains = imx8mp_media_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mp_media_blk_ctl_domain_data), + .bus_rst_mask = BIT(8), + .bus_clk_mask = BIT(8), +}; + +static const struct udevice_id imx8m_blk_ctrl_ids[] = { + { .compatible = "fsl,imx8mm-disp-blk-ctrl", .data = (ulong)&imx8mm_disp_blk_ctl_dev_data }, + { .compatible = "fsl,imx8mn-disp-blk-ctrl", .data = (ulong)&imx8mn_disp_blk_ctl_dev_data }, + { .compatible = "fsl,imx8mp-media-blk-ctrl", .data = (ulong)&imx8mp_media_blk_ctl_dev_data }, + { } +}; + +struct power_domain_ops imx8m_blk_ctrl_ops = { + .request = imx8m_blk_ctrl_request, + .rfree = imx8m_blk_ctrl_free, + .on = imx8m_blk_ctrl_power_on, + .off = imx8m_blk_ctrl_power_off, +}; + +U_BOOT_DRIVER(imx8m_blk_ctrl) = { + .name = "imx8m_blk_ctrl", + .id = UCLASS_POWER_DOMAIN, + .of_match = imx8m_blk_ctrl_ids, + .bind = dm_scan_fdt_dev, + .probe = imx8m_blk_ctrl_probe, + .remove = imx8m_blk_ctrl_remove, + .priv_auto = sizeof(struct imx8m_blk_ctrl), + .ops = &imx8m_blk_ctrl_ops, + .flags = DM_FLAG_DEFAULT_PD_CTRL_OFF, +}; diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c index 8b6870c86463..40fec70d954a 100644 --- a/drivers/power/domain/imx8m-power-domain.c +++ b/drivers/power/domain/imx8m-power-domain.c @@ -32,17 +32,31 @@ DECLARE_GLOBAL_DATA_PTR; #define IMX8M_OTG1_A53_DOMAIN BIT(4) #define IMX8M_PCIE1_A53_DOMAIN BIT(3) +#define IMX8MM_VPUH1_A53_DOMAIN BIT(15) +#define IMX8MM_VPUG2_A53_DOMAIN BIT(14) +#define IMX8MM_VPUG1_A53_DOMAIN BIT(13) +#define IMX8MM_DISPMIX_A53_DOMAIN BIT(12) +#define IMX8MM_VPUMIX_A53_DOMAIN BIT(10) +#define IMX8MM_GPUMIX_A53_DOMAIN BIT(9) +#define IMX8MM_GPU_A53_DOMAIN (BIT(8) | BIT(11)) +#define IMX8MM_DDR1_A53_DOMAIN BIT(7) #define IMX8MM_OTG2_A53_DOMAIN BIT(5) #define IMX8MM_OTG1_A53_DOMAIN BIT(4) #define IMX8MM_PCIE_A53_DOMAIN BIT(3) +#define IMX8MM_MIPI_A53_DOMAIN BIT(2) +#define IMX8MN_DISPMIX_A53_DOMAIN BIT(12) +#define IMX8MN_GPUMIX_A53_DOMAIN BIT(9) +#define IMX8MN_DDR1_A53_DOMAIN BIT(7) #define IMX8MN_OTG1_A53_DOMAIN BIT(4) #define IMX8MN_MIPI_A53_DOMAIN BIT(2) #define IMX8MP_HSIOMIX_A53_DOMAIN BIT(19) +#define IMX8MP_MEDIAMIX_A53_DOMAIN BIT(12) #define IMX8MP_USB2_PHY_A53_DOMAIN BIT(5) #define IMX8MP_USB1_PHY_A53_DOMAIN BIT(4) #define IMX8MP_PCIE_PHY_A53_DOMAIN BIT(3) +#define IMX8MP_MIPI_PHY1_A53_DOMAIN BIT(2) #define IMX8MP_GPC_PU_PGC_SW_PUP_REQ 0x0d8 #define IMX8MP_GPC_PU_PGC_SW_PDN_REQ 0x0e4 @@ -50,35 +64,72 @@ DECLARE_GLOBAL_DATA_PTR; #define GPC_PU_PGC_SW_PUP_REQ 0x0f8 #define GPC_PU_PGC_SW_PDN_REQ 0x104 +#define IMX8M_PCIE2_SW_Pxx_REQ BIT(13) +#define IMX8M_MIPI_CSI2_SW_Pxx_REQ BIT(12) +#define IMX8M_MIPI_CSI1_SW_Pxx_REQ BIT(11) +#define IMX8M_DISP_SW_Pxx_REQ BIT(10) +#define IMX8M_HDMI_SW_Pxx_REQ BIT(9) +#define IMX8M_VPU_SW_Pxx_REQ BIT(8) +#define IMX8M_GPU_SW_Pxx_REQ BIT(7) +#define IMX8M_DDR2_SW_Pxx_REQ BIT(6) +#define IMX8M_DDR1_SW_Pxx_REQ BIT(5) #define IMX8M_PCIE2_SW_Pxx_REQ BIT(13) #define IMX8M_OTG2_SW_Pxx_REQ BIT(3) #define IMX8M_OTG1_SW_Pxx_REQ BIT(2) #define IMX8M_PCIE1_SW_Pxx_REQ BIT(1) +#define IMX8MM_VPUH1_SW_Pxx_REQ BIT(13) +#define IMX8MM_VPUG2_SW_Pxx_REQ BIT(12) +#define IMX8MM_VPUG1_SW_Pxx_REQ BIT(11) +#define IMX8MM_DISPMIX_SW_Pxx_REQ BIT(10) +#define IMX8MM_VPUMIX_SW_Pxx_REQ BIT(8) +#define IMX8MM_GPUMIX_SW_Pxx_REQ BIT(7) +#define IMX8MM_GPU_SW_Pxx_REQ (BIT(6) | BIT(9)) +#define IMX8MM_DDR1_SW_Pxx_REQ BIT(5) #define IMX8MM_OTG2_SW_Pxx_REQ BIT(3) #define IMX8MM_OTG1_SW_Pxx_REQ BIT(2) #define IMX8MM_PCIE_SW_Pxx_REQ BIT(1) +#define IMX8MM_MIPI_SW_Pxx_REQ BIT(0) +#define IMX8MN_DISPMIX_SW_Pxx_REQ BIT(10) +#define IMX8MN_GPUMIX_SW_Pxx_REQ BIT(7) +#define IMX8MN_DDR1_SW_Pxx_REQ BIT(5) #define IMX8MN_OTG1_SW_Pxx_REQ BIT(2) #define IMX8MN_MIPI_SW_Pxx_REQ BIT(0) #define IMX8MP_HSIOMIX_Pxx_REQ BIT(17) +#define IMX8MP_MEDIMIX_Pxx_REQ BIT(10) #define IMX8MP_USB2_PHY_Pxx_REQ BIT(3) #define IMX8MP_USB1_PHY_Pxx_REQ BIT(2) #define IMX8MP_PCIE_PHY_SW_Pxx_REQ BIT(1) +#define IMX8MP_MIPI_PHY1_SW_Pxx_REQ BIT(0) #define GPC_M4_PU_PDN_FLG 0x1bc #define IMX8MP_GPC_PU_PWRHSK 0x190 #define GPC_PU_PWRHSK 0x1fc +#define IMX8MM_GPUMIX_HSK_PWRDNACKN BIT(29) +#define IMX8MM_GPU_HSK_PWRDNACKN (BIT(27) | BIT(28)) +#define IMX8MM_VPUMIX_HSK_PWRDNACKN BIT(26) +#define IMX8MM_DISPMIX_HSK_PWRDNACKN BIT(25) #define IMX8MM_HSIO_HSK_PWRDNACKN (BIT(23) | BIT(24)) +#define IMX8MM_GPUMIX_HSK_PWRDNREQN BIT(11) +#define IMX8MM_GPU_HSK_PWRDNREQN (BIT(9) | BIT(10)) +#define IMX8MM_VPUMIX_HSK_PWRDNREQN BIT(8) +#define IMX8MM_DISPMIX_HSK_PWRDNREQN BIT(7) #define IMX8MM_HSIO_HSK_PWRDNREQN (BIT(5) | BIT(6)) +#define IMX8MN_GPUMIX_HSK_PWRDNACKN (BIT(29) | BIT(27)) +#define IMX8MN_DISPMIX_HSK_PWRDNACKN BIT(25) #define IMX8MN_HSIO_HSK_PWRDNACKN BIT(23) +#define IMX8MN_GPUMIX_HSK_PWRDNREQN (BIT(11) | BIT(9)) +#define IMX8MN_DISPMIX_HSK_PWRDNREQN BIT(7) #define IMX8MN_HSIO_HSK_PWRDNREQN BIT(5) +#define IMX8MP_MEDIAMIX_PWRDNACKN BIT(30) #define IMX8MP_HSIOMIX_PWRDNACKN BIT(28) +#define IMX8MP_MEDIAMIX_PWRDNREQN BIT(14) #define IMX8MP_HSIOMIX_PWRDNREQN BIT(12) /* @@ -92,15 +143,31 @@ DECLARE_GLOBAL_DATA_PTR; #define IMX8M_PGC_OTG2 19 #define IMX8M_PGC_PCIE2 29 +#define IMX8MM_PGC_MIPI 16 #define IMX8MM_PGC_PCIE 17 #define IMX8MM_PGC_OTG1 18 #define IMX8MM_PGC_OTG2 19 - +#define IMX8MM_PGC_DDR1 21 +#define IMX8MM_PGC_GPU2D 22 +#define IMX8MM_PGC_GPUMIX 23 +#define IMX8MM_PGC_VPUMIX 24 +#define IMX8MM_PGC_GPU3D 25 +#define IMX8MM_PGC_DISPMIX 26 +#define IMX8MM_PGC_VPUG1 27 +#define IMX8MM_PGC_VPUG2 28 +#define IMX8MM_PGC_VPUH1 29 + +#define IMX8MN_PGC_MIPI 16 #define IMX8MN_PGC_OTG1 18 +#define IMX8MN_PGC_DDR1 21 +#define IMX8MN_PGC_GPUMIX 23 +#define IMX8MN_PGC_DISPMIX 26 +#define IMX8MP_PGC_MIPI1 12 #define IMX8MP_PGC_PCIE 13 #define IMX8MP_PGC_USB1 14 #define IMX8MP_PGC_USB2 15 +#define IMX8MP_PGC_MEDIAMIX 22 #define IMX8MP_PGC_HSIOMIX 29 #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) @@ -142,6 +209,7 @@ struct imx8m_power_domain_plat { void __iomem *base; int resource_id; int has_pd; + int count; }; #if defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MN) || defined(CONFIG_IMX8MQ) @@ -230,6 +298,82 @@ static const struct imx_pgc_domain imx8mm_pgc_domains[] = { }, .pgc = BIT(IMX8MM_PGC_OTG2), }, + + [IMX8MM_POWER_DOMAIN_GPUMIX] = { + .bits = { + .pxx = IMX8MM_GPUMIX_SW_Pxx_REQ, + .map = IMX8MM_GPUMIX_A53_DOMAIN, + .hskreq = IMX8MM_GPUMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_GPUMIX_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MM_PGC_GPUMIX), + .keep_clocks = true, + }, + + [IMX8MM_POWER_DOMAIN_GPU] = { + .bits = { + .pxx = IMX8MM_GPU_SW_Pxx_REQ, + .map = IMX8MM_GPU_A53_DOMAIN, + .hskreq = IMX8MM_GPU_HSK_PWRDNREQN, + .hskack = IMX8MM_GPU_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MM_PGC_GPU2D) | BIT(IMX8MM_PGC_GPU3D), + }, + + [IMX8MM_POWER_DOMAIN_VPUMIX] = { + .bits = { + .pxx = IMX8MM_VPUMIX_SW_Pxx_REQ, + .map = IMX8MM_VPUMIX_A53_DOMAIN, + .hskreq = IMX8MM_VPUMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_VPUMIX_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MM_PGC_VPUMIX), + .keep_clocks = true, + }, + + [IMX8MM_POWER_DOMAIN_VPUG1] = { + .bits = { + .pxx = IMX8MM_VPUG1_SW_Pxx_REQ, + .map = IMX8MM_VPUG1_A53_DOMAIN, + }, + .pgc = BIT(IMX8MM_PGC_VPUG1), + }, + + [IMX8MM_POWER_DOMAIN_VPUG2] = { + .bits = { + .pxx = IMX8MM_VPUG2_SW_Pxx_REQ, + .map = IMX8MM_VPUG2_A53_DOMAIN, + }, + .pgc = BIT(IMX8MM_PGC_VPUG2), + }, + + [IMX8MM_POWER_DOMAIN_VPUH1] = { + .bits = { + .pxx = IMX8MM_VPUH1_SW_Pxx_REQ, + .map = IMX8MM_VPUH1_A53_DOMAIN, + }, + .pgc = BIT(IMX8MM_PGC_VPUH1), + .keep_clocks = true, + }, + + [IMX8MM_POWER_DOMAIN_DISPMIX] = { + .bits = { + .pxx = IMX8MM_DISPMIX_SW_Pxx_REQ, + .map = IMX8MM_DISPMIX_A53_DOMAIN, + .hskreq = IMX8MM_DISPMIX_HSK_PWRDNREQN, + .hskack = IMX8MM_DISPMIX_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MM_PGC_DISPMIX), + .keep_clocks = true, + }, + + [IMX8MM_POWER_DOMAIN_MIPI] = { + .bits = { + .pxx = IMX8MM_MIPI_SW_Pxx_REQ, + .map = IMX8MM_MIPI_A53_DOMAIN, + }, + .pgc = BIT(IMX8MM_PGC_MIPI), + }, }; static const struct imx_pgc_domain_data imx8mm_pgc_domain_data = { @@ -258,6 +402,36 @@ static const struct imx_pgc_domain imx8mn_pgc_domains[] = { }, .pgc = BIT(IMX8MN_PGC_OTG1), }, + + [IMX8MN_POWER_DOMAIN_GPUMIX] = { + .bits = { + .pxx = IMX8MN_GPUMIX_SW_Pxx_REQ, + .map = IMX8MN_GPUMIX_A53_DOMAIN, + .hskreq = IMX8MN_GPUMIX_HSK_PWRDNREQN, + .hskack = IMX8MN_GPUMIX_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MN_PGC_GPUMIX), + .keep_clocks = true, + }, + + [IMX8MN_POWER_DOMAIN_DISPMIX] = { + .bits = { + .pxx = IMX8MN_DISPMIX_SW_Pxx_REQ, + .map = IMX8MN_DISPMIX_A53_DOMAIN, + .hskreq = IMX8MN_DISPMIX_HSK_PWRDNREQN, + .hskack = IMX8MN_DISPMIX_HSK_PWRDNACKN, + }, + .pgc = BIT(IMX8MN_PGC_DISPMIX), + .keep_clocks = true, + }, + + [IMX8MN_POWER_DOMAIN_MIPI] = { + .bits = { + .pxx = IMX8MN_MIPI_SW_Pxx_REQ, + .map = IMX8MN_MIPI_A53_DOMAIN, + }, + .pgc = BIT(IMX8MN_PGC_MIPI), + }, }; static const struct imx_pgc_domain_data imx8mn_pgc_domain_data = { @@ -268,7 +442,15 @@ static const struct imx_pgc_domain_data imx8mn_pgc_domain_data = { #endif #ifdef CONFIG_IMX8MP -static const struct imx_pgc_domain imx8mp_pgc_domains[] = { +static const struct imx_pgc_domain imx8mp_pgc_domains[19] = { + [IMX8MP_POWER_DOMAIN_MIPI_PHY1] = { + .bits = { + .pxx = IMX8MP_MIPI_PHY1_SW_Pxx_REQ, + .map = IMX8MP_MIPI_PHY1_A53_DOMAIN, + }, + .pgc = BIT(IMX8MP_PGC_MIPI1), + }, + [IMX8MP_POWER_DOMAIN_PCIE_PHY] = { .bits = { .pxx = IMX8MP_PCIE_PHY_SW_Pxx_REQ, @@ -293,6 +475,17 @@ static const struct imx_pgc_domain imx8mp_pgc_domains[] = { .pgc = BIT(IMX8MP_PGC_USB2), }, + [IMX8MP_POWER_DOMAIN_MEDIAMIX] = { + .bits = { + .pxx = IMX8MP_MEDIMIX_Pxx_REQ, + .map = IMX8MP_MEDIAMIX_A53_DOMAIN, + .hskreq = IMX8MP_MEDIAMIX_PWRDNREQN, + .hskack = IMX8MP_MEDIAMIX_PWRDNACKN, + }, + .pgc = BIT(IMX8MP_PGC_MEDIAMIX), + .keep_clocks = true, + }, + [IMX8MP_POWER_DOMAIN_HSIOMIX] = { .bits = { .pxx = IMX8MP_HSIOMIX_Pxx_REQ, @@ -329,6 +522,11 @@ static int imx8m_power_domain_on(struct power_domain *power_domain) u32 pgc; int ret; + if (pdata->count > 0) { /* Already on */ + pdata->count++; + return 0; + } + if (pdata->clk.count) { ret = clk_enable_bulk(&pdata->clk); if (ret) { @@ -373,6 +571,8 @@ static int imx8m_power_domain_on(struct power_domain *power_domain) if (!domain->keep_clocks && pdata->clk.count) clk_disable_bulk(&pdata->clk); + pdata->count++; + return 0; out_clk_disable: @@ -391,6 +591,13 @@ static int imx8m_power_domain_off(struct power_domain *power_domain) u32 pgc; int ret; + if (!pdata->count) { /* Already off */ + return 0; + } else if (pdata->count > 1) { + pdata->count--; + return 0; + } + /* Enable reset clocks for all devices in the domain */ if (!domain->keep_clocks && pdata->clk.count) { ret = clk_enable_bulk(&pdata->clk); @@ -439,6 +646,8 @@ static int imx8m_power_domain_off(struct power_domain *power_domain) if (pdata->has_pd) power_domain_off(&pdata->pd); + pdata->count--; + return 0; out_clk_disable: From patchwork Tue Sep 3 15:30:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3382 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B3D23FA49 for ; Tue, 3 Sep 2024 17:31:13 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bb68e1706sf50478615e9.3 for ; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377473; cv=pass; d=google.com; s=arc-20240605; b=R3/+VqrLG+Y4dwry6AaBqBojXriMSXQFBakp4JQUVu+cY/BXrmiF/ll5K6TOQ2paOc Q6IDrHyFNU77GL2YSRfQu8RN33HOeWcR3Nvio+6fcFw1ZmAhqhsr9sOhN2SegHegYISa 3Rs6tNcmm18V6GP5QPNuqrvR80fVT/WSqn88g2UJkmLtGQDd66eIuixlTP1ahQPt4jjr 53xqqGdw6EcDR25bFHTaLwjoC7+7XDYn5aiZvKVi/+7Yew3CfIpKoCw6JOAtgX0b6qM5 VdqdUg3vorVkPQ+LK3RMTwxcXycKSXJt81QzDvjnrdSzb6tmh9WqzQF5NBqMABztIR0h f+hA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=FFpv0fvg3S1q/7GcL9Nh+G5LCs2PdQeWenWXQ8l3ZXU=; fh=xAdjOH7R8QT0YVxFllhOPyTTjTCnSJNMGQ1zkIroel4=; b=X7NVy2M4JDkRjJPtjzfUgoSGKNW2hm0mxggQoGvDkRycA/Qg+zWQYX6VorzKNw1iUk hX59D+3cMaZk2kHDZNourTC/e0CGoE5JMuOSDMkc/txvtJy4te8XxIW6+fbcBZZuU66L wZ8m/GPuF0ZlK88fH8xzk9vwQRHIRuqzT1vSs54y3XTU6V8nqMbc2Cz0cN9bwYPYGJ3c UvTdkUOunWWJayDGXFwSWmd19PoinEgxICoJ7dW34kX7GVXfUKOYW2Crp4jrpEgE9n5D IXpLN9C+UXgPYRXnPsPOraWxhKkd9FJLdOtbf/3fS8rKa7Bgd4zMFo0LzaLccI9alUub 2a/w==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=D2VAkU66; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377473; x=1725982273; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FFpv0fvg3S1q/7GcL9Nh+G5LCs2PdQeWenWXQ8l3ZXU=; b=nPkYJicoDqDvc/R4Kk0qllY/IdrO8F77wcoKxT8ageyYoziQF5cuvOZreo6PiwnVQk atwKifppYNSiNPGSOTUABtTSMGJDcB1uDCNf0+yvX9la69P8Ura2UBK8zi17kiUTekyf t96SW5OJgIdhM0FS8Q4aj1qNtOQopuN+Cnyk8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377473; x=1725982273; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FFpv0fvg3S1q/7GcL9Nh+G5LCs2PdQeWenWXQ8l3ZXU=; b=ESsxR/4hHhMBc1pqyfrsAwXsgMmynm3h81/RvH5GgjTWaNr7tNzdS7Q9fpuYXxrT3e xyPKBAo+ayvlSlwFdKLiSG5hqJupXruEzNc4KtHC6t5wjmEnBKkc6vq1GXjhSYfWIJ/M Vz84qjYPgbywAtLUhmmDZPExDfNCXMqxLbmXCRiWA/hV+oHvXpvg4iL5op2nioKWeugX mKx3pcthEgjy/hUjvBlKKKXCws6TOPif6GLDQ49vYVR4Bzhyu1B10uXCXKuft2kdoyzP NN3upZF18z9xSceqHsilvkf9rbt12GHTbf1wmQUqOJNmmCnz79m4Ie8dMXkadlf9VdvN ZHUQ== X-Forwarded-Encrypted: i=2; AJvYcCWPv8GFgcrTr2TLKRdC3LVveyfvbAxO2dxuHMzO+4ZUYc54UpVSQMzld7wlxuJg4f7loTCJGiPqUe/VcTrY@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwvC9DdFPd7k4YBx6boa2c2sYN687k+1/aSN1jJHcAipszMmGRM jg1Cwgb4guWjPjHr4kMX01DnNM2otgeD8opiVXkYf+vKxXilV2Jh4CPGBCRlMqsEqw== X-Google-Smtp-Source: AGHT+IEO0JKlVCGWwfXho1HDvtxNG0p16a1mFOr4/Myk71eIjlOPrXE0sYsP+fcTwLnjFABl+N3Oew== X-Received: by 2002:a05:600c:4687:b0:428:f79:1836 with SMTP id 5b1f17b1804b1-42c8810318emr28509335e9.26.1725377472915; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4ec6:b0:426:6f58:8e6d with SMTP id 5b1f17b1804b1-42bb2a124e3ls8592455e9.2.-pod-prod-03-eu; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) X-Received: by 2002:a05:600c:502b:b0:42b:a2fd:3e52 with SMTP id 5b1f17b1804b1-42c880f40a3mr32502315e9.22.1725377471147; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377471; cv=none; d=google.com; s=arc-20160816; b=bcjAh3lVLGACFP9aW058NWCxUg6pzS4S1Nfz07KfDPet4ci+XAOME7tdEwTHaZUg1W ELcn30zLw0R2RZQRNM+aB7CnglmDspsCCr9zfSlh4zQxg+tjUpqaRbt2zPf2fUbcA2IG 59uTHZOyQIyXjwTYuM8c9jJ0npe8elbXcWtUdHZEb3Z+jvXmAJ99iFBoAv8zlUYT45jX LCgRApGUjD+QImLeqoHRlUfvUZT3TwRPpiwKmXd92bK4XN8aXjyVIPM5aZBzDK6f+VCL C30vuf/+w5+fgLG9A2v5TrD7owOGlodjZvK/6AxHGv5z8ZdQhh+XvtnUMej5BrsblLQu bybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=HqnAETu1cJ9CY4U+h3ZU9oGJXVqacQpL8LeGxFT4RZI=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=g4zWeRx53f/uJVQXtYGzIIFX1RznUSOcAYtkx0BHfMXNuvDpKLDW40cUxmCnxOz9Gs WpGQkDMX6eVrRqzzhekOZJlpSFBmOcUQ6ggkmiJgqGfV+T9KFd5AGKRySJCkoz3zlQmv JyC35cO2zaMe9SxkyuVmkTWO/5BIFxbffcuor9DCLcoJHx82fL3IXV13Ijh4Uh3XZ2F2 NdJBwr31ChFeXD+T61aXbfq71R73zeirQv5w/uMXDGDcvQs/VBKBmsSTzFoUTStkr3F9 EKexatuf5rsUSeDkoe9wh9EyGURRQHyISW4aijnA5E4621LlFhimcFlDRutUnMqNhR5Y 1uug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=D2VAkU66; 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=pass 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 5b1f17b1804b1-42bb70972b5sor6900705e9.8.2024.09.03.08.31.11 for (Google Transport Security); Tue, 03 Sep 2024 08:31:11 -0700 (PDT) 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-Received: by 2002:a05:600c:4eca:b0:428:31c:5a52 with SMTP id 5b1f17b1804b1-42c881031d6mr31697005e9.29.1725377470339; Tue, 03 Sep 2024 08:31:10 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:10 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 10/29] video: Add video link framework Date: Tue, 3 Sep 2024 17:30:41 +0200 Message-ID: <20240903153100.918077-10-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=D2VAkU66; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi The video link framework bases a port-endpoint gragh in DTB to connect the video components in uclass like: video, display, bridge, and panel. Using the port-endpoint gragh, we manage multiple video link and user can select one of them for splash screen. Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- common/stdio.c | 4 + drivers/video/Kconfig | 6 + drivers/video/Makefile | 1 + drivers/video/bmp.c | 11 +- drivers/video/video_link.c | 533 +++++++++++++++++++++++++++++++++++++ include/video_link.h | 19 ++ 6 files changed, 573 insertions(+), 1 deletion(-) create mode 100644 drivers/video/video_link.c create mode 100644 include/video_link.h diff --git a/common/stdio.c b/common/stdio.c index a61220ce4b9c..66360c97ed12 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -340,6 +341,9 @@ int stdio_add_devices(void) struct udevice *vdev; int ret; + if (IS_ENABLED(CONFIG_VIDEO_LINK)) + video_link_init(); + if (!IS_ENABLED(CONFIG_SYS_CONSOLE_IS_IN_ENV)) { for (ret = uclass_first_device_check(UCLASS_VIDEO, &vdev); diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7808ae7919e0..d2432d67a460 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -798,6 +798,12 @@ config VIDEO_SEPS525 source "drivers/video/zynqmp/Kconfig" source "drivers/video/nexell/Kconfig" +config VIDEO_LINK + bool "Enable video link framework support" + help + This option enables a video link framework basing on port-endpoint graph + to connect video components. + config CONSOLE_SCROLL_LINES int "Number of lines to scroll the console by" default 1 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index f3f70cd04a17..9fd3645994f1 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_$(SPL_TPL_)SIMPLE_PANEL) += simple_panel.o obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.o obj-$(CONFIG_$(SPL_TPL_)BMP) += bmp.o +obj-$(CONFIG_VIDEO_LINK) += video_link.o endif obj-$(CONFIG_BACKLIGHT_LM3533) += lm3533_backlight.o diff --git a/drivers/video/bmp.c b/drivers/video/bmp.c index 291ed36440c8..3ac835d45d05 100644 --- a/drivers/video/bmp.c +++ b/drivers/video/bmp.c @@ -17,6 +17,7 @@ #include #include #include +#include #include /* @@ -124,7 +125,15 @@ int bmp_display(ulong addr, int x, int y) } addr = map_to_sysmem(bmp); - ret = uclass_first_device_err(UCLASS_VIDEO, &dev); + if (IS_ENABLED(CONFIG_VIDEO_LINK)) { + dev = video_link_get_video_device(); + if (!dev) + ret = -ENODEV; + else + ret = 0; + } else { + ret = uclass_first_device_err(UCLASS_VIDEO, &dev); + } if (!ret) { bool align = false; diff --git a/drivers/video/video_link.c b/drivers/video/video_link.c new file mode 100644 index 000000000000..52d37e823009 --- /dev/null +++ b/drivers/video/video_link.c @@ -0,0 +1,533 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 NXP + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +struct of_endpoint { + unsigned int port; + unsigned int id; + ofnode local_node; +}; + +#define MAX_LINKS 3 +#define MAX_LINK_DEVICES 5 + +struct video_link { + struct udevice *link_devs[MAX_LINK_DEVICES]; + int dev_num; +}; + +struct video_link video_links[MAX_LINKS]; +struct video_link temp_stack; +ulong video_links_num = 0; +ulong curr_video_link = 0; +bool video_off = false; + +ofnode ofnode_get_child_by_name(ofnode parent, const char *name) +{ + ofnode child; + const char *child_name; + + for (child = ofnode_first_subnode(parent); + ofnode_valid(child); + child = ofnode_next_subnode(child)) { + + child_name = ofnode_get_name(child); + + if (!strncmp(child_name, name, strlen(name))) { + break; + } + + } + return child; +} + +ofnode ofnode_graph_get_next_endpoint(ofnode parent, + ofnode prev) +{ + ofnode endpoint; + ofnode port; + const char *name; + + + if (!ofnode_valid(prev)) { + ofnode node; + + node = ofnode_find_subnode(parent, "ports"); + if (ofnode_valid(node)) + parent = node; + + port = ofnode_get_child_by_name(parent, "port"); + if (!ofnode_valid(port)) { + debug("no port node found in 0x%lx\n", parent.of_offset); + return ofnode_null(); + } + + endpoint = ofnode_first_subnode(port); + if (ofnode_valid(endpoint)) { + debug("get next endpoint %s\n", ofnode_get_name(endpoint)); + return endpoint; + } + } else { + port = ofnode_get_parent(prev); + endpoint = ofnode_next_subnode(prev); + if (ofnode_valid(endpoint)) { + debug("get next endpoint %s\n", ofnode_get_name(endpoint)); + return endpoint; + } + } + + debug("port %s\n", ofnode_get_name(port)); + + while (1) { + do { + port = ofnode_next_subnode(port); + if (!ofnode_valid(port)) + return ofnode_null(); + + name = ofnode_get_name(port); + } while (strncmp(name, "port", 4)); + + /* + * Now that we have a port node, get the next endpoint by + * getting the next child. If the previous endpoint is NULL this + * will return the first child. + */ + endpoint = ofnode_first_subnode(port); + if (ofnode_valid(endpoint)) { + debug("get next endpoint %s\n", ofnode_get_name(endpoint)); + return endpoint; + } + } + + return ofnode_null(); +} + +#define for_each_endpoint_of_node(parent, child) \ + for (child = ofnode_graph_get_next_endpoint(parent, ofnode_null()); ofnode_valid(child); \ + child = ofnode_graph_get_next_endpoint(parent, child)) + + +int ofnode_graph_get_endpoint_count(ofnode node) +{ + ofnode endpoint; + int num = 0; + + for_each_endpoint_of_node(node, endpoint) + num++; + + return num; +} + +int ofnode_graph_parse_endpoint(ofnode node, + struct of_endpoint *endpoint) +{ + ofnode port_node = ofnode_get_parent(node); + + memset(endpoint, 0, sizeof(*endpoint)); + + endpoint->local_node = node; + /* + * It doesn't matter whether the two calls below succeed. + * If they don't then the default value 0 is used. + */ + ofnode_read_u32(port_node, "reg", &endpoint->port); + ofnode_read_u32(node, "reg", &endpoint->id); + + return 0; +} + +ofnode ofnode_graph_get_endpoint_by_regs( + const ofnode parent, int port_reg, int reg) +{ + struct of_endpoint endpoint; + ofnode node; + + for_each_endpoint_of_node(parent, node) { + ofnode_graph_parse_endpoint(node, &endpoint); + if (((port_reg == -1) || (endpoint.port == port_reg)) && + ((reg == -1) || (endpoint.id == reg))) { + debug("get node %s\n", ofnode_get_name(node)); + + return node; + } + } + + return ofnode_null(); +} + +ofnode ofnode_graph_get_remote_endpoint(ofnode node) +{ + ofnode remote; + u32 phandle; + int ret; + + ret = ofnode_read_u32(node, "remote-endpoint", &phandle); + if (ret) { + printf("required remote-endpoint property isn't provided\n"); + return ofnode_null(); + } + + remote = ofnode_get_by_phandle(phandle); + if (!ofnode_valid(remote)) { + printf("failed to find remote-endpoint\n"); + return ofnode_null(); + } + + return remote; +} + +ofnode ofnode_graph_get_port_parent(ofnode node) +{ + unsigned int depth; + + if (!ofnode_valid(node)) + return ofnode_null(); + + /* + * Preserve usecount for passed in node as of_get_next_parent() + * will do of_node_put() on it. + */ + + /* Walk 3 levels up only if there is 'ports' node. */ + for (depth = 3; depth && ofnode_valid(node); depth--) { + node = ofnode_get_parent(node); + const char *name = ofnode_get_name(node); + if (depth == 2 && strcmp(name, "ports")) + break; + } + return node; +} + +ofnode ofnode_graph_get_remote_port_parent(ofnode node) +{ + ofnode np, pp; + + /* Get remote endpoint node. */ + np = ofnode_graph_get_remote_endpoint(node); + + pp = ofnode_graph_get_port_parent(np); + + return pp; +} + +int find_device_by_ofnode(ofnode node, struct udevice **pdev) +{ + int ret; + + if (!ofnode_is_enabled(node)) + return -2; + + ret = uclass_find_device_by_ofnode(UCLASS_DISPLAY, node, pdev); + if (!ret) + return 0; + + ret = uclass_find_device_by_ofnode(UCLASS_DSI_HOST, node, pdev); + if (!ret) + return 0; + + ret = uclass_find_device_by_ofnode(UCLASS_VIDEO_BRIDGE, node, pdev); + if (!ret) + return 0; + + ret = uclass_find_device_by_ofnode(UCLASS_PANEL, node, pdev); + if (!ret) + return 0; + + return -1; +} + +static void video_link_stack_push(struct udevice *dev) +{ + if (temp_stack.dev_num < MAX_LINK_DEVICES) { + temp_stack.link_devs[temp_stack.dev_num] = dev; + temp_stack.dev_num++; + } +} + +static void video_link_stack_pop(void) +{ + if (temp_stack.dev_num > 0) { + temp_stack.link_devs[temp_stack.dev_num] = NULL; + temp_stack.dev_num--; + } +} + +static int duplicate_video_link(void) +{ + if (video_links_num < MAX_LINKS) { + video_links[video_links_num] = temp_stack; + video_links_num++; + + debug("duplicate links num %lu, temp_stack num %d\n", + video_links_num, temp_stack.dev_num); + return 0; + } + + return -ENODEV; +} + +static void video_link_add_node(struct udevice *peer_dev, struct udevice *dev, ofnode dev_node) +{ + int ret = 0; + ofnode remote, endpoint_node; + struct udevice *remote_dev; + bool find = false; + + debug("endpoint cnt %d\n", ofnode_graph_get_endpoint_count(dev_node)); + + video_link_stack_push(dev); + + for_each_endpoint_of_node(dev_node, endpoint_node) { + remote = ofnode_graph_get_remote_port_parent(endpoint_node); + if (!ofnode_valid(remote)) + continue; + + debug("remote %s\n", ofnode_get_name(remote)); + ret = find_device_by_ofnode(remote, &remote_dev); + if (!ret) { + debug("remote dev %s\n", remote_dev->name); + + if (peer_dev && peer_dev == remote_dev) + continue; + + /* it is possible that ofnode of remote_dev is not equal to remote */ + video_link_add_node(dev, remote_dev, remote); + + find = true; + } + } + + /* leaf node or no valid new endpoint, now copy the entire stack to a new video link */ + if (!find) { + ret = duplicate_video_link(); + if (ret) + printf("video link is full\n"); + } + + video_link_stack_pop(); +} + +struct udevice *video_link_get_next_device(struct udevice *curr_dev) +{ + int i, ret; + + if (video_off) + return NULL; + + if (curr_video_link >= video_links_num) { + printf("current video link is not correct\n"); + return NULL; + } + + for (i = 0; i < video_links[curr_video_link].dev_num; i++) { + if (video_links[curr_video_link].link_devs[i] == curr_dev) { + if ((i + 1) < video_links[curr_video_link].dev_num) { + ret = device_probe(video_links[curr_video_link].link_devs[i + 1]); + if (ret) { + printf("probe device is failed, ret %d\n", ret); + return NULL; + } + + return video_links[curr_video_link].link_devs[i + 1]; + } else { + debug("fail to find next device, already last one\n"); + return NULL; + } + } + } + + return NULL; +} + +struct udevice *video_link_get_video_device(void) +{ + int ret; + if (video_off) + return NULL; + + if (curr_video_link >= video_links_num) + return NULL; + + if (video_links[curr_video_link].dev_num == 0) + return NULL; + + ret = device_probe(video_links[curr_video_link].link_devs[0]); + if (ret) { + printf("probe video device failed, ret %d\n", ret); + return NULL; + } + + return video_links[curr_video_link].link_devs[0]; +} + +int video_link_get_display_timings(struct display_timing *timings) +{ + int i = 0; + int ret; + struct udevice *dev; + + if (video_off) + return -EPERM; + + if (curr_video_link >= video_links_num) + return -ENODEV; + + if (video_links[curr_video_link].dev_num == 0) + return -ENODEV; + + for (i = video_links[curr_video_link].dev_num - 1; i >= 0 ; i--) { + dev = video_links[curr_video_link].link_devs[i]; + if (device_get_uclass_id(dev) == UCLASS_PANEL) { + ret = device_probe(video_links[curr_video_link].link_devs[i]); + if (ret) { + printf("fail to probe panel device %s\n", dev->name); + return ret; + } + + ret = panel_get_display_timing(dev, timings); + if (ret) { + ret = ofnode_decode_display_timing(dev_ofnode(dev), 0, timings); + if (ret) { + printf("fail to get panel timing %s\n", dev->name); + return ret; + } + } + + return 0; + } else if (device_get_uclass_id(dev) == UCLASS_DISPLAY || + device_get_uclass_id(dev) == UCLASS_VIDEO) { + + ret = ofnode_decode_display_timing(dev_ofnode(dev), 0, timings); + if (!ret) + return 0; + } + } + + return -EINVAL; +} + +static void list_videolink(bool current_only) +{ + ulong index = 0; + int j; + bool match; + + /* dump the link */ + debug("video link number: %lu\n", video_links_num); + + for (index = 0; index < video_links_num; index ++) { + match = false; + if (curr_video_link == index) + match = true; + else if (current_only) + continue; + + printf("[%c]-Video Link %lu", (match)? '*':' ', index); + + if (match) { + struct udevice *video_dev = video_link_get_video_device(); + if (video_dev) { + printf(" (%u x %u)", video_get_xsize(video_dev), + video_get_ysize(video_dev)); + } + } + + printf("\n"); + + for (j = 0; j < video_links[index].dev_num; j++) { + printf("\t[%d] %s, %s\n", j, video_links[index].link_devs[j]->name, + dev_get_uclass_name(video_links[index].link_devs[j])); + } + } +} + +static int do_videolink(struct cmd_tbl * cmdtp, int flag, int argc, char * const argv[]) +{ + char cmd = 'l'; + int ret = 0; + + if (argc > 1) + cmd = argv[1][0]; + + switch (cmd) { + case 'l': /* list */ + list_videolink(false); + break; + default: + ret = CMD_RET_USAGE; + break; + } + + return ret; +} + +int video_link_init(void) +{ + struct udevice *dev; + ulong env_id; + int off; + memset(&video_links, 0, sizeof(video_links)); + memset(&temp_stack, 0, sizeof(temp_stack)); + + for (uclass_find_first_device(UCLASS_VIDEO, &dev); + dev; + uclass_find_next_device(&dev)) { + + video_link_add_node(NULL, dev, dev_ofnode(dev)); + } + + if (video_links_num == 0) { + printf("Fail to setup video link\n"); + return -ENODEV; + } + + /* Read the env variable for default video link */ + off = env_get_yesno("video_off"); + if (off == 1) { + video_off = true; + return 0; + } + + env_id = env_get_ulong("video_link", 10, 0); + if (env_id < video_links_num) + curr_video_link = env_id; + + list_videolink(true); + + return 0; +} + +int video_link_shut_down(void) +{ + struct udevice *video_dev = video_link_get_video_device(); + + if (video_dev) + device_remove(video_dev, DM_REMOVE_NORMAL); + + return 0; +} + +#ifdef CONFIG_SYS_LONGHELP +static char video_link_help_text[] = + "list \n" + " - show video link info, set video_link variable to select link"; +#endif + +U_BOOT_CMD( + videolink, 5, 1, do_videolink, + "list and select video link", video_link_help_text +); diff --git a/include/video_link.h b/include/video_link.h new file mode 100644 index 000000000000..5350bfa9e9d1 --- /dev/null +++ b/include/video_link.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2020 NXP + */ + +#ifndef __VIDEO_LINK +#define __VIDEO_LINK + +int video_link_init(void); + +int video_link_shut_down(void); + +struct udevice *video_link_get_next_device(struct udevice *curr_dev); + +struct udevice *video_link_get_video_device(void); + +int video_link_get_display_timings(struct display_timing *timings); + +#endif From patchwork Tue Sep 3 15:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3383 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 866B841742 for ; Tue, 3 Sep 2024 17:31:13 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42bafca2438sf61934915e9.3 for ; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377473; cv=pass; d=google.com; s=arc-20240605; b=BXMk7L5/y+YQniWg6reOvgBsyXNg9L1MFsYrLOuUZ9bVWWIT2Lpc/8gw1nmyYQPMrn FMUpLHbSJq2oiqKZK6TNarTpRC/cUylmDjqiMgfCOZl1YDc61KjX8d2x5z1fWExboTlq vSC5pVX9XLGi/WK+kQP5BPEMmrJ1yOw2Dd0H5Sc7GnVCvMtnrIAF1a3urLN70aHQlahy QI2bBzyDRJft3i+UaXnrYDdE89nDKkpjkdMwF9h9PPPk2EiGbgtDB6vfg/v8fIeONR+c rInJkLjmpw54QLXQSfDfvpv3FjEVMCogbqQXmc5Qczs6ClZT2GeDQwuxR8JQRaBpg7Tc 9EpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; fh=4aU+nCD+MM28uM3kY6+Ijor+GRHD/VepEHAYZrRgyFU=; b=lP2NyeEP0POUC0XiJFot0isaU/wNEh7GIWw6mMiSsdgyusPkOUHlK1tvdoENpaok6S IQXqiknuKy2oD4y55RSTyvhk/oDs535McqYZ3KZGojcs+UZSW8gY0DZuAiBRhVHLAFw0 oVKiy25oUG3dEkOm17YvHHWC/UaRSH964kzmqM3FxOJSZUbBKgLCiiydNzuMJp0HaNmz KVEVf3PBpJg6zMDkb72e+kNlWq4K1Ra5Fkf1CiRowXfi9SuwIABPmHEEJyo1b/Z/dwMr zpMsy94obAmharx7ZJvCBFf8cX/qHvkMENYKpAYZG4LrR5X8+llGSS31iMiP0gXa25Sp FPaQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l3Mhr3E3; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377473; x=1725982273; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=D+Zu6oZ8JxP+yG3h9vG3IT8fKBAehyu0xjl46EXZpr6H016r7tzeD+T2/rHIDwhYFA 16N8D8RQB3f6/Dwmhs65mJDgAhHmcJ05m5xBeAYVx38B+/c4NEAqUw5Axp/mjWqiLORZ QKcGYZoPrRgdu4d+/5bg8lYRzeap+dKpMVzXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377473; x=1725982273; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=fmXHqARhLtoDUgTVBR7zm/OxWdk41MjHuZwJjA0LGP7wHbDyvzuTH0vWMAWLbIU7PP nLS4v9KSBPanpKjMaiSMAQDZx1gaQEWRcAMuw3gwvFdR3w8bMENgK3RVuX52OiFWgXWu N1EJn6hjOUwoDsCh94WJNhi6dUqKgTJu/ycmOBTqofTAwP/2nMHWZT7FexhWvRwL1W0o T6AxKJqDRDT41KHDeB1IECvMJnd33ZiX88lZL+dqxx3JF1Kt9ph4vC+Se48U0TIOpdNe lCOQ5mA7EYEIUc/+w2qLFNAguHSkiHPXR2mJSG+COdjP2dPal5hbbpm69DujKdovYpkX 4wiw== X-Forwarded-Encrypted: i=2; AJvYcCWtUemjef5cDnv7hxuEjf9Hjdt8vi/qmmyWWVA0qIM1dWIi9M03ZOghw+LkktBczzkCL3C/32/81MD0E4yW@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx2lGsi2ERM51nQeg8pK6RRHWd/WM1TYkDdJ6DoKacW1ZWJXdg+ yjEKz/IgrWH2orVaVp4BTy3GxARcFDpCgh9NTuZU4Dq/V3ZNkTYtOgby1D1AEroRcA== X-Google-Smtp-Source: AGHT+IEZxuWnlfgaAwDHW0KnT6aSSWTyhItFKNbWFMBVQDISKa7d6CHX/aKUc5aJ4fL6GiFBNCWcng== X-Received: by 2002:a05:600c:1391:b0:426:6f87:65fc with SMTP id 5b1f17b1804b1-42bb01c19c0mr162661925e9.17.1725377473137; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:426:7318:c5a0 with SMTP id 5b1f17b1804b1-42bb2a0f33cls1306785e9.2.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) X-Received: by 2002:a05:600c:a03:b0:426:5f09:cf53 with SMTP id 5b1f17b1804b1-42bb01b9c73mr177923765e9.15.1725377471659; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377471; cv=none; d=google.com; s=arc-20160816; b=iGjFbDj02xrKPueaKa3VP3U8zANxUy6MIUxx9uiCCxsl+NVTf+xsu/0SB0vbmB8wbf FLtE8Hf/N+klvrqem5OUBuTVUw5JVKWZWd1R87EAoX0fj+K+0FK7If1G0+yvHg53UbyX N4MrkAL6TIyMT6m+2rF/4WyBF7se++kvUiDtEUEJNl3bN67Z6vVmxVfU3qPDI/WPkAnb QKPcL6xxQbuH/NaYqYHPxBPvt2tIKFBXXPhcRQxZ061YMjUJcylZXknaOyjBYyx8uZU4 HYSJnCxSlrZmElgo8S05wgOx5md9/MEnCzaA0x6v8CGcNrknejq9YS//7wZMl6ToJW5i BFRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=18UE/TjtsBSoQafY0oEo7+M0f8SVrTD2gpyVr8YhC8E=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=S4nFH0jZwMgQdK63lG7SHYTyw8yfpMyjmfKhsYGpy7vWEbYIqjsvAoDcYOF5Kna8OZ KXF90esRGV9zsxXCCzQ3mOqJWwlzapAlMCly8VhrcULZffSOST95Itqhu0QEY/WnoqB0 9Pjye+su4S/0LM3J9TvgZHEYltnFHslkgD6j7XksROsCulf9Sp4ojk1KGIPt+CwXfoKu 42m5Py1fnnrnSS3xa0gGZzzQ8pFyJ5VJjItaFESZOiHHANCFNHkAqZyhBeChrUQgEm+I Pa8A9BSaU94LcBEzSH7iFXyqb3nuVmEseF928+7MXs5RGZ+4PU7WP6i8LTHWLuCu4twf t/vw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l3Mhr3E3; 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=pass 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 5b1f17b1804b1-42bb705f8ccsor4098595e9.4.2024.09.03.08.31.11 for (Google Transport Security); Tue, 03 Sep 2024 08:31:11 -0700 (PDT) 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-Received: by 2002:a05:600c:3b99:b0:426:62c5:4731 with SMTP id 5b1f17b1804b1-42bb01edd20mr159912115e9.29.1725377471064; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:10 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 11/29] video: bridge: Add check_timing interface Date: Tue, 3 Sep 2024 17:30:42 +0200 Message-ID: <20240903153100.918077-11-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=l3Mhr3E3; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Add new interface check_timing to video bridge uclass. For bridge device who may update timing needs to implement the callback. So host device can sync the timing with the bridge. Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++ include/video_bridge.h | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c index 2084a2e03ee8..7432107238cc 100644 --- a/drivers/video/bridge/video-bridge-uclass.c +++ b/drivers/video/bridge/video-bridge-uclass.c @@ -48,6 +48,16 @@ int video_bridge_check_attached(struct udevice *dev) return ops->check_attached(dev); } +int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing) +{ + struct video_bridge_ops *ops = video_bridge_get_ops(dev); + + if (ops->check_timing) + return ops->check_timing(dev, timing); + + return 0; +} + int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size) { struct video_bridge_ops *ops = video_bridge_get_ops(dev); diff --git a/include/video_bridge.h b/include/video_bridge.h index 3b429eac578a..8b71b04a1119 100644 --- a/include/video_bridge.h +++ b/include/video_bridge.h @@ -44,6 +44,17 @@ struct video_bridge_ops { */ int (*check_attached)(struct udevice *dev); + /** + * check_timing() - check if the timing need update after the bridge device attached + * + * This method is optional - if not provided then return 0 + * + * @dev: Device to check + * @active: The timing to be checked and updated + * Return: 0 if OK, -ve on error + */ + int (*check_timing)(struct udevice *dev, struct display_timing *timing); + /** * set_backlight() - Set the backlight brightness * @@ -98,6 +109,15 @@ int video_bridge_set_active(struct udevice *dev, bool active); */ int video_bridge_check_attached(struct udevice *dev); +/** + * check_timing() - check if the timing need update after the bridge device attached + * + * @dev: Device to check + * @active: The timing to be checked and updated + * Return: 0 if OK, -ve on error + */ +int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing); + /** * video_bridge_read_edid() - Read information from EDID * From patchwork Tue Sep 3 15:30:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3384 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0B2263F1F3 for ; Tue, 3 Sep 2024 17:31:15 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-53350003ef9sf6739313e87.1 for ; Tue, 03 Sep 2024 08:31:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377474; cv=pass; d=google.com; s=arc-20240605; b=LpO9JZEH9kjtbmq7XtZpdMGlIrGxpGi+fWezDHsesxONnmZDvVW59cBqvLRNYJD21O A4BumwKD3r41JfkPeT07CDvZBOMh62WOqnJz9IoCoBhAqPiLsqKeSpWMwvdje2UI43T6 xLM/D1WdWcSvFf6Oa2vO00U3E2tF1sPa/6nvVEZ/AVp97n0PcqfFNCNBYCjzYDm5/HX3 D/vD7HQ70bV/PtCy/k5nQrMy+w+3C4MV9FuNKWEUzSsmlLr5QikaCJhbyUtP61A++DCY IpzkgtPerClMAZu/qw414FBxarCXhhdZD1Esp4dHrIHvPN44sGqNRTjv5FJBnxAxpPmL 81bQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=ArFQy4MPcHAqWTOS5HHlPVC7kZmpCi1kR7q+SeLvCN4=; fh=/fGsJxObfhHfqQMqjjoxFPvgQTMqhHB7LtWqUMOlvpM=; b=iudfJKa9XhGz9+d58EGMM8b2om1p0ZEQcittxd1iK+76GmUK6T1KKJ3kEg0Qf9BCVB 0ekb+k70vXc+FZW/P0U1UiVetwT3DZq3FToQF+onLZFE/3e8nOWZ2RCvxXCoL8+O5ePt Tz+uU5NEFe3Gz4sTKbr6aSoOioostQNzlQ9KkbeFYQJpmScqO/1UgSyinSfUes0+2VUm Pqm6EMjm/RxTm2tk15f4VF4gfTkANfXiAzVvgk9lE5kikMDRsGCsQiM25vxvYrMX1HFs jgy7dW261llG7SYQ1t5cO+ir91fnkSwBuvh2cypeqXubYnOP5q6Wf91rQBwUiKqZlccq R60A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dUrOmImx; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377474; x=1725982274; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ArFQy4MPcHAqWTOS5HHlPVC7kZmpCi1kR7q+SeLvCN4=; b=QwUtNXyu+DRzGLupSjU7PVtv5QZgzkRWAuQ3Jy+2xjOI28yCl3VLSx8RI9bcM7sqxi eeVcSIUXgMT5F0OuQvmN92VCQzXdYG17NPTYxEQrEC4+axYjesBsW11TYdGxOOA7ULru 0RVMRmojIE7drX4lowEhYStNDeaIOC7bB9m1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377474; x=1725982274; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ArFQy4MPcHAqWTOS5HHlPVC7kZmpCi1kR7q+SeLvCN4=; b=QpA4vIN+dIjgStCKrVIcx/gMr98+eDdfdV9DvGgIa4hM+a6zJa4YJwZZ6K67DbGqVj frGQpO3l3iRL2A28+FJJFdSPELFgzwOkeDqHruY1OT3peHlK/IyyirL4vjuJq8x21cw7 dy/YnI+d76jKZyHOy/QRmUZqefaQG4X59z66xbH+fO+SUVilYEvyMydC8dQ0nr9MdpaA 6KTv1TEQVqgnxTUu++F661UIMk3AmMoLfQ4GZYZMiGMoYABLpb6aCUAnu9tQJ3z02cuY go7P6fVzT8dN/KqhDBysl9XGw48ycKvbCufFCPcenLqcEWVa/XABNpRSdbYcHT2h+anQ dr7Q== X-Forwarded-Encrypted: i=2; AJvYcCWAjonlhhCfrB5fLyjsfnu0LXAjbuJ9KQM2+myDXvqrXvspv6HKp3Th6NG3lq7IqFMwX+ogLOFptZYDFuP1@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyqsUBgHajCeGIFvcIl7fSBm2Lj9A7IVO21LB1E9ugU8Itu9iMt d1NdKUCYkFEDMEHUv8eGkissiV+ol34wgm1sIvwAhu4fsn2HIjF1enVJM3dpdx9/IA== X-Google-Smtp-Source: AGHT+IEGqDVSypTf0170Tuix4LSK3kT00ofPxu0s6hDhEDhZfqM1vqlvR1Jqzf+VqMJ4hcfR+v1Vow== X-Received: by 2002:a05:6512:3f26:b0:52c:d84b:eee6 with SMTP id 2adb3069b0e04-53546baac97mr10219364e87.38.1725377474298; Tue, 03 Sep 2024 08:31:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:2351:b0:52f:cbbe:1afc with SMTP id 2adb3069b0e04-5353d8185abls254988e87.2.-pod-prod-09-eu; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) X-Received: by 2002:a05:6512:1091:b0:52c:c5c4:43d4 with SMTP id 2adb3069b0e04-53546bc75demr9485346e87.53.1725377472486; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377472; cv=none; d=google.com; s=arc-20160816; b=NV2b+gjjcvpIwuQMTokNOoU/SzjLwSX2VBE3oPZi7ALhkfrGoz+j942e6+EoV4cIUO MSKUTpLkFf71qxob5U330o54ODebEW9TqWEJbp7xSMggd6djzecwwtzIp9OZEXTff4G4 bjYA6rAVJ4AWzk7ai4V1XQUi9X7y6klpPoesKjhi27lxnH7ai8l41NXjWPsYf5Ywpkb4 oYNLlkaUF6pCgrlJn5p7fW9JePouj4/kX21A6DCsIac7dsn1tfzZ5FnokWaYr2WWtmx1 XEvT66fyaga03/v7heI0JAfusxhfZIuZ/08Z0TkcDNODLCkzf1YnaNbCzCJbWiBUpIrU U1IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=+G3YJHmN2wVHjbQwepNjO/RbB0P6DWTMuf1v7Yxgzqs=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=x42TQl0PYmqB0omYhp/FWrc0/M2ZrNWHo+II/pr3XiIuBIdehV24l0jcVNLA0+6FOa ruHhOviOGEDI5c3sRdaEljE+PcrNBMZfI4OvGTYrnzt3ZaACPFyas+s7SBLWVF/fvMrK pVAQej/1SXQqoEFXoxPXlEfniBBq8UpTjLkSBizx+SjvkEUj+xqSWLmFVRuYgIIy2VyK TD51Yyj7/pSIhvGFQ5cvS7pqQuCDU4Fjr38vkSiObXy3mlH7LT1/XCfeI/0irzAq5GTZ s4S8WwEXx8Vag8cLuxWcGe1TKfWxFX9J0D59qYSJTOkmWMgPhqb2bW/HAzTed3mQvbnx HlyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dUrOmImx; 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=pass 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 5b1f17b1804b1-42bb7097991sor4237775e9.9.2024.09.03.08.31.12 for (Google Transport Security); Tue, 03 Sep 2024 08:31:12 -0700 (PDT) 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-Received: by 2002:a05:600c:4689:b0:428:29d:4b59 with SMTP id 5b1f17b1804b1-42c8de87c08mr9399515e9.20.1725377471861; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:11 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 12/29] video: dsi_host: add disable host interface Date: Tue, 3 Sep 2024 17:30:43 +0200 Message-ID: <20240903153100.918077-12-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=dUrOmImx; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Current operations structure has provided disable callback, but there is no API from dsi_host uclass to use it. Add this disable host interface, so that dsi bridge can call it to disable host Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/video/dsi-host-uclass.c | 10 ++++++++++ include/dsi_host.h | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/video/dsi-host-uclass.c b/drivers/video/dsi-host-uclass.c index fde275ad7e2e..745991f8dd94 100644 --- a/drivers/video/dsi-host-uclass.c +++ b/drivers/video/dsi-host-uclass.c @@ -34,6 +34,16 @@ int dsi_host_enable(struct udevice *dev) return ops->enable(dev); } +int dsi_host_disable(struct udevice *dev) +{ + struct dsi_host_ops *ops = dsi_host_get_ops(dev); + + if (!ops->disable) + return -ENOSYS; + + return ops->disable(dev); +} + UCLASS_DRIVER(dsi_host) = { .id = UCLASS_DSI_HOST, .name = "dsi_host", diff --git a/include/dsi_host.h b/include/dsi_host.h index 83f8839db68d..5873ab698d9e 100644 --- a/include/dsi_host.h +++ b/include/dsi_host.h @@ -70,4 +70,12 @@ int dsi_host_init(struct udevice *dev, */ int dsi_host_enable(struct udevice *dev); +/** + * dsi_host_disable + * + * @dev: dsi host device + * @return 0 if OK, -ve on error + */ +int dsi_host_disable(struct udevice *dev); + #endif From patchwork Tue Sep 3 15:30:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3385 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C0A353F228 for ; Tue, 3 Sep 2024 17:31:15 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bb8610792sf48163775e9.3 for ; Tue, 03 Sep 2024 08:31:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377475; cv=pass; d=google.com; s=arc-20240605; b=OU+raAeAkSsac5ZNdnz1WHsWaCHQXYpbQ9cBhehK3GE5WLU3UqWHD5kg/2iBWpeMLe eLKQgb1BfO/sgOdxQITY56KQ9Q5ok4Tpwl2CesRFtIQpzeUXSbHVSLJyACT/bMw9yquu ae2ha9VwktsoSbwpjNnXW90+kiBIuYIGCYBK5HPB6E7F8DySc435rsZMmtxQfjsuyfvS 7LEjrA2N6+O0/TCrEsOXdWOmm6bNzgE5I35ljAc2uzK8c4a4hGhZvAGL7+T29/gczq0I gdFVYDBCnFiFSs6ckFIZ509wNpxsRII7d2t/FW379hRl5WBQQ7lJ2jbc5UfKevqrdpxk /9KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=1qjXluEZqIJ4ivd7s/zLuoeS4yndFJ8JwctijI6n0D8=; fh=29OPbD20dLwP5Inrk976lmhbdDvO908eke613XiA1xU=; b=N2W7n/AAxpcVKrjZniRzwpa8d6QDfS5RR+AKpOfPZWp0SWCmgU40PAOiLMI8I5wzWy 65ALDJxPW0H2nXfG6Mk7REgAwjy01ib+NLrYOrimTJGy1SKdkQUDMLSMMlOfrIHXZeUA Zg7OQj+5420hkaOpRGpednBo6y4TxrLp7K0V2JU26OMeNfeueJesPmVFRPYPk0CJfX9u I8jX22FFoRtIf5aJMN/lxdOX3myewuhY2CX2Ja9fDvYvTxR+y23jblbxWtc9c1QDPCTU TpyYTadkf2L5dZwOlQ1Tx/5b1GMOqVXz3fBr7SRKunmoVdJq0YYXPRpAjlc591z9A1HT cytQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q4jKum5R; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377475; x=1725982275; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1qjXluEZqIJ4ivd7s/zLuoeS4yndFJ8JwctijI6n0D8=; b=oN/tP6ZzgBnu+09+czXe4iEt2cHO+RtoRxWBdJUD4KhkLMMbBGyrVN3xxs4HoKe9PZ Yz/Fy6ljKZYaYj1RXyjlARDTxJaT3iGm46bFPrTSrAR4CQ5OeUOoaM/LslDH+yrgABkX qDX99xEys6NPcds3/I4AKqCoE7QQZOrOKmQ94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377475; x=1725982275; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1qjXluEZqIJ4ivd7s/zLuoeS4yndFJ8JwctijI6n0D8=; b=b41rTCSlUBvV4Q5p0TDmNCX47qlh5L+eW/7CRyZXvQmR+KfDOkizGdRk6NMjNCtM0I ckYvrRIZiGa3s3W4BxOziY0bfeGNhfd5otjICxoqG5X/OY5XRBwjgb8qlFg+nKq4Ywqn fgeBBaBiteWyixquZIsp0Nv7oC6Xkm88plBe3gHCxmB5aS7tQ2AxKm74yqls/ia9L73T /pP8jT5wbBhnvF/J5Hyke3LgyULncKtj3h1xMIKR9reKF7DNnxFdpZaHFKnuGGl/WjW6 mrho5hoISXSfe6kxUUQBZehIFiTUNY9h742b9bGzZK9vLSVXxt6QNqDyAaxXQsKXpmNk uFsA== X-Forwarded-Encrypted: i=2; AJvYcCU7xci/wvW0NyjNAY9jkStiX2GVNKJn/jmfMio8lc8Q9CLdGIsBvYmalcJq9r0L52oTiHMjMv9BW1lK9lo9@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxKX5PgI095CTegr3ZEefetUUo747Wqu3gsMwCsddumy9MNPpBU UHbQ5/b9a0ucEnayQqeRXtu/wHwp7zQHEUCazesRqbIbPsZTe7fMmQxu0lYVeT/WBQ== X-Google-Smtp-Source: AGHT+IERnRPuurUnyZRBkESKPKyiZpEDQNuVeTCoJpas/Aw4OiY1+fxE3sn+oiVjCawfbX2iJoYcCw== X-Received: by 2002:a05:600c:1f90:b0:429:dc88:7e65 with SMTP id 5b1f17b1804b1-42bb02ecb7emr131900225e9.12.1725377475346; Tue, 03 Sep 2024 08:31:15 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4ec6:b0:428:1007:62f6 with SMTP id 5b1f17b1804b1-42bb2a12028ls32385545e9.2.-pod-prod-08-eu; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) X-Received: by 2002:a05:600c:3ba7:b0:425:7c5f:1bac with SMTP id 5b1f17b1804b1-42bb0306f94mr147571605e9.21.1725377473518; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377473; cv=none; d=google.com; s=arc-20160816; b=Wh29pzMgW9yqfFvsUMZBbut1+qGINDY1ENAB/t9sVzwTVdT8AXrY/nak9+Iqin3f5r TbatgAPcIl7zNH865+MNxPZQQS8VnkA3PHyRs1xgkCeedM0ByUnlKBlq3sjn55Xx/YRw zgTOXYtwski3intgfO0ymTF+XTpYo/VukBnt14U2w0t5BGgd3tPCHvg51+zFGrg25gMM 2spN/+lfr29OLdytj32JfPu0HlgJueTItoAChtpRBgNIfaEzTIa47y38o7clYgX+aGPF 4pgnVx6oS+hVOFI4LmDmRwv6s2++DrcodV3bkCBWzGRiGHt4WgaE+M4XzhO71IXOp6Uf AMRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=z8nF2JDMXf0aSXakTOuvB/aSZNwxPB0i3IX2I/2bdOc=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=NqvJRSUbtG/2U3zpDUR9CGgDDxCxcTEPVVoQal1FidRMqK0WtNXPqxaL0dMn1Vszsw 2aXpm3IdAKrQ08Gvm2O987ZVR9DYcLqHb5tDhjBPe2ysstSGkSHIMGtNPBYe344cABOU xQw22q6gsF6yt9pVop6qMt1uNzW0fVv3aAY4q2ENnaosFyb/XmB4ZYnGzti9ploaMsyL vYeQKxdqECBjGiIHM7jiZDQe893zPLDUyck6j5Nla1I4D0d3mD7jrN+Ov0lbrs+u1BU7 ePpwtHWwzUicckLvV/AqaTYStdygmb7d14LfHrdydNWcnHcKgr6glreDe0JioCjihvyR fGcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q4jKum5R; 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=pass 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 5b1f17b1804b1-42c878efb03sor12349815e9.0.2024.09.03.08.31.13 for (Google Transport Security); Tue, 03 Sep 2024 08:31:13 -0700 (PDT) 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-Received: by 2002:a05:600c:a07:b0:427:abed:3602 with SMTP id 5b1f17b1804b1-42bb27a9e95mr124619835e9.24.1725377472689; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:12 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 13/29] video: Update mxsfb video drivers for iMX8MM/iMX8MN display Date: Tue, 3 Sep 2024 17:30:44 +0200 Message-ID: <20240903153100.918077-13-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=Q4jKum5R; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Update mxsfb for LCD video driver Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/video/mxsfb.c | 141 ++++++++++++++++++++++++++++-------------- 1 file changed, 95 insertions(+), 46 deletions(-) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 792d6314d15e..4186ccd00209 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -21,8 +21,13 @@ #include #include #include +#include +#include +#include +#include #include "videomodes.h" +#include #define PS2KHZ(ps) (1000000000UL / (ps)) #define HZ2PS(hz) (1000000000UL / ((hz) / 1000)) @@ -30,6 +35,11 @@ #define BITS_PP 18 #define BYTES_PP 4 +struct mxsfb_priv { + fdt_addr_t reg_base; + struct udevice *disp_dev; +}; + struct mxs_dma_desc desc; /** @@ -56,9 +66,10 @@ __weak void mxsfb_system_setup(void) */ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, - struct display_timing *timings, int bpp) + struct display_timing *timings, int bpp, bool bridge) { - struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE; + struct mxsfb_priv *priv = dev_get_priv(dev); + struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)priv->reg_base; const enum display_flags flags = timings->flags; uint32_t word_len = 0, bus_width = 0; uint8_t valid_data = 0; @@ -109,7 +120,7 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, } #else /* Kick in the LCDIF clock */ - mxs_set_lcdclk(MXS_LCDIF_BASE, timings->pixelclock.typ / 1000); + mxs_set_lcdclk(priv->reg_base, timings->pixelclock.typ / 1000); #endif /* Restart the LCDIF block */ @@ -142,26 +153,30 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, LCDIF_CTRL_BYPASS_COUNT | LCDIF_CTRL_LCDIF_MASTER, ®s->hw_lcdif_ctrl); - writel(valid_data << LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET, + writel((valid_data << LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET) | + LCDIF_CTRL1_RECOVER_ON_UNDERFLOW, ®s->hw_lcdif_ctrl1); + if (bridge) + writel(LCDIF_CTRL2_OUTSTANDING_REQS_REQ_16, ®s->hw_lcdif_ctrl2); + mxsfb_system_setup(); writel((timings->vactive.typ << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) | timings->hactive.typ, ®s->hw_lcdif_transfer_count); - vdctrl0 = LCDIF_VDCTRL0_ENABLE_PRESENT | LCDIF_VDCTRL0_ENABLE_POL | + vdctrl0 = LCDIF_VDCTRL0_ENABLE_PRESENT | LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT | LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT | timings->vsync_len.typ; - if(flags & DISPLAY_FLAGS_HSYNC_HIGH) + if (flags & DISPLAY_FLAGS_HSYNC_HIGH) vdctrl0 |= LCDIF_VDCTRL0_HSYNC_POL; - if(flags & DISPLAY_FLAGS_VSYNC_HIGH) + if (flags & DISPLAY_FLAGS_VSYNC_HIGH) vdctrl0 |= LCDIF_VDCTRL0_VSYNC_POL; - if(flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) + if (flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) vdctrl0 |= LCDIF_VDCTRL0_DOTCLK_POL; - if(flags & DISPLAY_FLAGS_DE_HIGH) + if (flags & DISPLAY_FLAGS_DE_HIGH) vdctrl0 |= LCDIF_VDCTRL0_ENABLE_POL; writel(vdctrl0, ®s->hw_lcdif_vdctrl0); @@ -198,10 +213,10 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr, } static int mxs_probe_common(struct udevice *dev, struct display_timing *timings, - int bpp, u32 fb) + int bpp, u32 fb, bool bridge) { /* Start framebuffer */ - mxs_lcd_init(dev, fb, timings, bpp); + mxs_lcd_init(dev, fb, timings, bpp, bridge); #ifdef CONFIG_VIDEO_MXS_MODE_SYSTEM /* @@ -212,7 +227,8 @@ static int mxs_probe_common(struct udevice *dev, struct display_timing *timings, * sets the RUN bit, then waits until it gets cleared and repeats this * infinitelly. This way, we get smooth continuous updates of the LCD. */ - struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE; + struct mxsfb_priv *priv = dev_get_priv(dev); + struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)priv->reg_base; memset(&desc, 0, sizeof(struct mxs_dma_desc)); desc.address = (dma_addr_t)&desc; @@ -229,9 +245,9 @@ static int mxs_probe_common(struct udevice *dev, struct display_timing *timings, return 0; } -static int mxs_remove_common(u32 fb) +static int mxs_remove_common(phys_addr_t reg_base, u32 fb) { - struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE; + struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)(reg_base); int timeout = 1000000; if (!fb) @@ -258,6 +274,7 @@ static int mxs_of_get_timings(struct udevice *dev, int ret = 0; u32 display_phandle; ofnode display_node; + struct mxsfb_priv *priv = dev_get_priv(dev); ret = ofnode_read_u32(dev_ofnode(dev), "display", &display_phandle); if (ret) { @@ -278,10 +295,19 @@ static int mxs_of_get_timings(struct udevice *dev, return -EINVAL; } - ret = ofnode_decode_display_timing(display_node, 0, timings); - if (ret) { - dev_err(dev, "failed to get any display timings\n"); - return -EINVAL; + priv->disp_dev = video_link_get_next_device(dev); + if (priv->disp_dev) { + ret = video_link_get_display_timings(timings); + if (ret) { + dev_err(dev, "failed to get any video link display timings\n"); + return -EINVAL; + } + } else { + ret = ofnode_decode_display_timing(display_node, 0, timings); + if (ret) { + dev_err(dev, "failed to get any display timings\n"); + return -EINVAL; + } } return ret; @@ -291,20 +317,58 @@ static int mxs_video_probe(struct udevice *dev) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); + struct mxsfb_priv *priv = dev_get_priv(dev); struct display_timing timings; u32 bpp = 0; u32 fb_start, fb_end; int ret; + bool enable_bridge = false; debug("%s() plat: base 0x%lx, size 0x%x\n", __func__, plat->base, plat->size); + priv->reg_base = dev_read_addr(dev); + if (priv->reg_base == FDT_ADDR_T_NONE) { + dev_err(dev, "lcdif base address is not found\n"); + return -EINVAL; + } + ret = mxs_of_get_timings(dev, &timings, &bpp); if (ret) return ret; - ret = mxs_probe_common(dev, &timings, bpp, plat->base); + if (priv->disp_dev) { +#if IS_ENABLED(CONFIG_VIDEO_BRIDGE) + if (device_get_uclass_id(priv->disp_dev) == UCLASS_VIDEO_BRIDGE) { + ret = video_bridge_attach(priv->disp_dev); + if (ret) { + dev_err(dev, "fail to attach bridge\n"); + return ret; + } + + ret = video_bridge_set_backlight(priv->disp_dev, 80); + if (ret) { + dev_err(dev, "fail to set backlight\n"); + return ret; + } + + enable_bridge = true; + video_bridge_check_timing(priv->disp_dev, &timings); + } +#endif + + if (device_get_uclass_id(priv->disp_dev) == UCLASS_PANEL) { + ret = panel_enable_backlight(priv->disp_dev); + if (ret) { + dev_err(dev, "panel %s enable backlight error %d\n", + priv->disp_dev->name, ret); + return ret; + } + } + } + + ret = mxs_probe_common(dev, &timings, bpp, plat->base, enable_bridge); if (ret) return ret; @@ -343,33 +407,9 @@ static int mxs_video_probe(struct udevice *dev) static int mxs_video_bind(struct udevice *dev) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); - struct display_timing timings; - u32 bpp = 0; - u32 bytes_pp = 0; - int ret; - ret = mxs_of_get_timings(dev, &timings, &bpp); - if (ret) - return ret; - - switch (bpp) { - case 32: - case 24: - case 18: - bytes_pp = 4; - break; - case 16: - bytes_pp = 2; - break; - case 8: - bytes_pp = 1; - break; - default: - dev_err(dev, "invalid bpp specified (bpp = %i)\n", bpp); - return -EINVAL; - } - - plat->size = timings.hactive.typ * timings.vactive.typ * bytes_pp; + /* Max size supported by LCDIF, because in bind, we can't probe panel */ + plat->size = 1920 * 1080 *4 * 2; return 0; } @@ -377,8 +417,14 @@ static int mxs_video_bind(struct udevice *dev) static int mxs_video_remove(struct udevice *dev) { struct video_uc_plat *plat = dev_get_uclass_plat(dev); + struct mxsfb_priv *priv = dev_get_priv(dev); + + debug("%s\n", __func__); + + if (priv->disp_dev) + device_remove(priv->disp_dev, DM_REMOVE_NORMAL); - mxs_remove_common(plat->base); + mxs_remove_common(priv->reg_base, plat->base); return 0; } @@ -389,6 +435,8 @@ static const struct udevice_id mxs_video_ids[] = { { .compatible = "fsl,imx6sx-lcdif" }, { .compatible = "fsl,imx7ulp-lcdif" }, { .compatible = "fsl,imxrt-lcdif" }, + { .compatible = "fsl,imx8mm-lcdif" }, + { .compatible = "fsl,imx8mn-lcdif" }, { /* sentinel */ } }; @@ -400,4 +448,5 @@ U_BOOT_DRIVER(mxs_video) = { .probe = mxs_video_probe, .remove = mxs_video_remove, .flags = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE, + .priv_auto = sizeof(struct mxsfb_priv), }; From patchwork Tue Sep 3 15:30:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3386 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C2E573FA4F for ; Tue, 3 Sep 2024 17:31:16 +0200 (CEST) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-53436749138sf5978461e87.2 for ; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377476; cv=pass; d=google.com; s=arc-20240605; b=XydgpuJT/Cps6Q10QFqnH4d9jSvVnwN/0ww393ljfCdoexg1DNg9FtFNhClg4V5dx1 2FkWMS1yLypFiq0WmRxRjcYB8LTIaRZf/iuJ7GE0q7HfIW2L86YIKogxSOEPceYZu0kO aUMkuEj1ogLoh0Z174Pw7QOqE68qgd3rXpROLBoocpxVLkunU2cccnRSW3CwtW1mv27G yZ5BEtj65npN2Yo9R+pJkzNt8A9KPQ3NK2RLLA9ZzHI+mlcLeYrXAi16o4niZ8J5O9Rx WNC5T/3mKS7Qn/cZxrb6pyeVvhmI0S5OTDWbxJiY0qXaBchtB4P2zJzH7Fa3/cIRHzIn w2Ew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=GYI325t50TqvqVzBXl0dylB83R1c44SEFpBCc1vV53g=; fh=qpZfOkvjiDGEqYiyqZfFqL0mTsBe63Ki8zsm9mcyzvE=; b=Im+f6v5YRfDuwAZmw4bKOrPplUnU+pAVJMsub5Chc2Rcr935dWcc47Wdq/k4lnJfRU 4DBcesJqiM+TQAAScT+pjNX/B32WrFx581w9GmcdruIkzbtJ9/xE5c2fdtub9ALud2PV FpgWMOYc804I2Aau9U3raoi+xccMTtFSE8N//VwC1uX4f5YM5YTsn7D8WLuxIRm3YB9v nCJlIzCoqRrzC/ukxsX9FqnPiuTcK1yshX2jSmr29p5f8bNYBzPNAjdasL6eDnwQJY3x 2GCU07Pc7G/7w0ZtGHl3NFXdGAKTq03apQGxCUpERl7Y9byGWpitGLnJJ9GgrA0aD/5m nobw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FUAVdpkr; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377476; x=1725982276; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=GYI325t50TqvqVzBXl0dylB83R1c44SEFpBCc1vV53g=; b=UD4VomWUMHvEUU2Dyl5YQZ1HMcJCET2T+0bigdck85TbU3nXbSJIBbvg9n57yRbFEG tjQVZDzGqA8QnEDqo/PshyJ77QgmSR9UqCzJX9dhmqA7IkS6nqqN6zZUToM5MtuZ31zz v2t6k6kB6iF93WbvpqueaP2vm9V9UKARqO/uo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377476; x=1725982276; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GYI325t50TqvqVzBXl0dylB83R1c44SEFpBCc1vV53g=; b=Oj3awMoL8wKGJ55l9FjSidfDmiF9M1+Ca5mVwGfuYLf5u1anKIRvaPWz8FRDEJUMbP 2FOIcaFpApbe6Zu2zusxdQZlHdty5TRxny/ur/F3Cx22XVzNwKb9Y19GMLlqtwEBlJPj hxFm3FcS2UaBPj0JEL9xuxhty9at7QNRzJsMwlFCp1PHowydRJvyFV9GAOBPDS7K3Iq8 b+cNBHoIQaun03KD9rGBA3aJ8sY04AVOfpwSII2HP1hmoEyNvfou7E10uV7z0OluwGML 625lbvJAoWSqhXpICyFxvPedpvJL96xvkxzgvsex40kYVNjM8CMwXvkr6g8Uyxy/B+fm PLRQ== X-Forwarded-Encrypted: i=2; AJvYcCUUuaYxkvMViwtyKe7Al+KYQVwyuYyZcOYroTXADSRRJTELi036jyibXQzO6IZD7HHoxN6VdZG++Wp9JPd2@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxUzvpwQDH6NL6PL7JjyqFq/osoTidoCCRY3MyEMVXGNv3eFrVc KbFGQDX+5P2z5BVhBbYHBx3dBQq10dQIaq3f9PetY8unOTR0EtAJN6NDWhYIqckZJg== X-Google-Smtp-Source: AGHT+IFkX4C/fKUJ0nRrpA1iMRKDvuQUSYUFgDBlTEk8ctKXsw/U9ehXQrJbycVKK9PG8sp2ubxsZg== X-Received: by 2002:a05:6512:318f:b0:52c:d626:77aa with SMTP id 2adb3069b0e04-53546babeb7mr9596027e87.58.1725377476111; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:3b8f:b0:533:45dc:5477 with SMTP id 2adb3069b0e04-5353d8125adls330879e87.1.-pod-prod-07-eu; Tue, 03 Sep 2024 08:31:14 -0700 (PDT) X-Received: by 2002:a05:6512:3d0c:b0:52c:dc57:868b with SMTP id 2adb3069b0e04-53546b05c10mr10172104e87.13.1725377474095; Tue, 03 Sep 2024 08:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377474; cv=none; d=google.com; s=arc-20160816; b=VY2ninpjo/W7FgqDafz080RinLtcQdEzyF+hQ/bX9CY3nAdrCoPD6h1htVG8IROSHB OPdG/KTyiPh83WcG46Y29/ZFByWXw+DY3Laq1/aXz3WS0vQ1kpQObPH6u62cLU/exS31 E3kfKYdxJNlCUCiW3zRW+YwpEFzbdw7duj1sL6ZwJes1+IYl/2iyIFrH7XzKicSb7yHi tojhs4+8zK3q81BwhpkMMKXGHvRtzIYv5BpeVsODkEoab853bKYeUmAOuDhc2bM74xYt jtt/Hp/LVWKBcL2iMGVHclPA1usYbSonmkI4KKXACE9uzz8Xf3GZJcHfmnNt3fhy+xBa u5sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=a86JFaoQ8c+qIPUXnYmUJIpO5dOSF621iR1yQirrag8=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=rExctrJxkPZzo5ryU+gu0toihergxZSck0fnldapRjfYqU6gmxgdK1+SU7rc7xAMJ9 xs49C2OCyjJAZsDUZPEXzW6VUeKsDf2ajHRm4RD3fTNIvM/9z2JfOgy6/p00wjy6+Chi RES+z6/TAjp43Vp+qV8vA39oF7WNLpkBRj6DurDzHXEnjfQDXW3HN9WihtkQPJaIC+op 52R9e0DfnYvMHaLefqoJLjGKRQd89aFSSJJDNnVczrBvEPcAv9O71PZ7efihAOJIhWuh pn2AlVl7A550MFsKyncnNGTn7OiKQX++HoIx4444se6agr36CeSxsXKir3qK+0ST50dN DjKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=FUAVdpkr; 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=pass 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 5b1f17b1804b1-42bb709720bsor44880445e9.10.2024.09.03.08.31.14 for (Google Transport Security); Tue, 03 Sep 2024 08:31:14 -0700 (PDT) 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-Received: by 2002:a05:600c:3b0c:b0:426:65bf:5cc2 with SMTP id 5b1f17b1804b1-42bbb10cd56mr87348825e9.1.1725377473447; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:13 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 14/29] video: Enable DM_UC_FLAG_SEQ_ALIAS for display and bridge Date: Tue, 3 Sep 2024 17:30:45 +0200 Message-ID: <20240903153100.918077-14-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=FUAVdpkr; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi To support multiple display or bridge devices, enable the flag, so we can assign the req seq via DTB alias Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/video/bridge/video-bridge-uclass.c | 1 + drivers/video/display-uclass.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c index 7432107238cc..5e2b76851fed 100644 --- a/drivers/video/bridge/video-bridge-uclass.c +++ b/drivers/video/bridge/video-bridge-uclass.c @@ -145,6 +145,7 @@ int video_bridge_set_active(struct udevice *dev, bool active) UCLASS_DRIVER(video_bridge) = { .id = UCLASS_VIDEO_BRIDGE, .name = "video_bridge", + .flags = DM_UC_FLAG_SEQ_ALIAS, .per_device_auto = sizeof(struct video_bridge_priv), .pre_probe = video_bridge_pre_probe, }; diff --git a/drivers/video/display-uclass.c b/drivers/video/display-uclass.c index 61a73e1bc2a6..07f05be7dd17 100644 --- a/drivers/video/display-uclass.c +++ b/drivers/video/display-uclass.c @@ -80,5 +80,6 @@ bool display_in_use(struct udevice *dev) UCLASS_DRIVER(display) = { .id = UCLASS_DISPLAY, .name = "display", + .flags = DM_UC_FLAG_SEQ_ALIAS, .per_device_plat_auto = sizeof(struct display_plat), }; From patchwork Tue Sep 3 15:30:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3387 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DCC853F360 for ; Tue, 3 Sep 2024 17:31:17 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42bbd062ac1sf40272435e9.0 for ; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377477; cv=pass; d=google.com; s=arc-20240605; b=axAfN2LMSaJ05xAKIoGy2naf+YEVNnds2AhoJaP3z7lHRHQwNN+50JTdUMHLDhzAO0 rpPuaM6n8/YWyx6uGQXyUFiDpJKdQWyYetHd7F+9D8PHM2CJl41ry/DSig9qTWZO9xIn eYkdxieNlnkE2Y3lG7bJFDQNdtPh4DS3RB6ERLwK7OH2+CsismiHJgzNQ4lSkcMoL0Ky zBeRUBLxOJYQ5+2EWcMepMk6tX3na3Z1qE77g21Zyq9xawM6jun/+pW6DCLUeM7lB4+3 0x/u72BEwZDegDWd1T6W5sSzFPFcxNGna4Ns8uJoPZNOjmSZgWXXi+JZyR7wjhpChF3v HMQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=k06/0Ab/FgDmzjsB1xNXwl8FQ2gso+evSdFzyXi39N8=; fh=D38WHr+q6vCztafv2L8HMGJ5M8FqH4zzOCWnXmfndVI=; b=VsNCE6rl2gKb+pd/4Uz9+6kb94f3c4T59S9PKzTVIJxeRlE4e/62XU0rK++PY7a33+ 8cnniqw3TGdpXrZ6omntm5tsSUUQ99E6OPscROW2J52vJyi51yEQ16vxIJ5h/PISOG5r HzYLEQUHrrzPbrU1RjRqvSlFaGxs7May/jSJEZDJ0vgxeNOcw/SznN5gb+BkDwVd1EgW to9mbR/2XS1veVj4FnDNaYnpO0cwSZrEROWhem0uRwrygDbDH9CmUBa45GsX7kwvXnnm Jh7OujX8JhWHtRd3/owSV9zFQ3SeQKqmq8C/rmQXZzG6z2W8FQqSLOFI671Yj4TIwMpx Ielw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AWulH7ks; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377477; x=1725982277; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=k06/0Ab/FgDmzjsB1xNXwl8FQ2gso+evSdFzyXi39N8=; b=DkvBmuG5654NHbf4eSzsA8l9O5hX08Ac259D7KbprZaA6Zmu16yOvuytOflL1snEqk QJCGtji/sE8Hv7nuF72PhS0Z3oQ7NrKbsztpBTWGR5VlAdI3Eg0vOunpGT74Z9pG7Ke9 CUATixVoL4vi9+ExxzUL1vhql5q29peCazkSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377477; x=1725982277; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k06/0Ab/FgDmzjsB1xNXwl8FQ2gso+evSdFzyXi39N8=; b=ASywFAZQ5FIVKYYN04aF7ffiYOQ7YMKihBHiFUSYHCCfnF+a1rUetwrL+4dYd6tXEA oXujevyGqWvhPLMph5iADLNIboIK5FB9SELa7wOrdxpIjJ1Ol1hWjrde55u2HWtgO6Ai XMXkJnY6Zn1kaEGIyAu7LnNDIsJtU03eS6v/xB2uNJamisawWfQ6Nb9torrrT2Q8mjAJ nXLskSVCuBHwWXh3V+S0pW7usFM+MX8vRkzhsHuNIVlsINUM0mtl9cr5wvXLkS2BdFDJ y9OI00iMvh3IilSlh2IPpWdViExX6JrNfLOJ3zh3S9bLEdkdXoW+voUxsvtq1Leivbx6 MEMQ== X-Forwarded-Encrypted: i=2; AJvYcCXOmjpdcfRbzTGDgkEPI/WjRwe2fva112nh4TrC90/koNfMc1XY00HZ2OMhVE0MEDtNqk+h/YM1vaSTgTkl@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzIMsHwDQpPvH0I3dQTYn9unR7ChKjWCe5F1xR0y0tcmr8JEl+Z I4zc1w0l+2Ush/pWKr5rx3VcB78vN9dlj2MwovPt/mX4UdatAEJua3iNmxTmCSC97g== X-Google-Smtp-Source: AGHT+IH5vu+TNrxxtM6nNr4ubKO3RWy+UdD1bd0pLkpYxJvlW9MuMbeZrhEDgsoZHI0+WM1zPN2RjA== X-Received: by 2002:a05:600c:5123:b0:426:6353:4b7c with SMTP id 5b1f17b1804b1-42bda2ce3a1mr81074225e9.8.1725377477500; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3596:b0:426:6eba:e1f4 with SMTP id 5b1f17b1804b1-42bb28403e8ls18103065e9.0.-pod-prod-02-eu; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) X-Received: by 2002:a05:600c:198b:b0:428:23c8:1e54 with SMTP id 5b1f17b1804b1-42bdc637509mr85828445e9.18.1725377475880; Tue, 03 Sep 2024 08:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377475; cv=none; d=google.com; s=arc-20160816; b=rBxa+OIXFmJQiWzqOvpWQyvyc4Zxou0+2z8xOF0+SS3Fd8a0T08Om693Biyr+MLK/n rIwvgwQzsyp0b2zB3lWzM4Rq95/Mte7iq6j19Gc+ui56F82BCM3H1Xrbja5RuhQix58e XCnweD44iYKWQt21HuuEV7K4kTljXLJ+tpWZ6q58/242sb8ovtzjwIHBy7hicua9Av71 IIeksi1YHdpCV5OhHe5muy87xjiGLN4/+bMXjsB3tufV21Oa73OR9g5oxWNx8xtPiKFg StnIPn3nPS7tpMaLwiKcnHGU8S902gX1ZJ3eyVoauGlB5O3TkVydVeOzoszwDfR+xUjA PT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=sva8w17y0XyKKEPL2HBX2MmC5Cmrpq7flOOHEHkSPG0=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=lkdrktp1LcPqaW4moSopLi5A80PpmhM063kGsvKWaS6DBImdvgeMVEcieQs/tEXGha r6oGlYaoMlsyCALP2LrtBvV1GmUQdbqNBWzlU6giBQSmxnvc2bETjIu7GtRqXUUTIZN1 WAkWz4edjG7aqLwAMuJfqgS210/CTF3JkmXpmTwe+0IiOzncB5ABCvIcIgWgrb5mYxgM jtODovm4tUr0Nei1IrsQbYNOhw7ZFiBW02ibgmPity7HFR8lfnhxPRK8Xgam6H1jSKGI CCQUvibV6tX7fGaraunx+x2g9DoR5B/z2u9i+onxS6bJSZuPecjhxMi6jP4AhwH4To6Q LbIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AWulH7ks; 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=pass 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 5b1f17b1804b1-42bb70b18a0sor45122405e9.12.2024.09.03.08.31.15 for (Google Transport Security); Tue, 03 Sep 2024 08:31:15 -0700 (PDT) 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-Received: by 2002:a05:600c:3b87:b0:428:151b:e8e with SMTP id 5b1f17b1804b1-42bdc63348bmr68802625e9.10.1725377475186; Tue, 03 Sep 2024 08:31:15 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:13 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 15/29] phy: dphy: add support to calculate the timing based on hs_clk_rate Date: Tue, 3 Sep 2024 17:30:46 +0200 Message-ID: <20240903153100.918077-15-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=AWulH7ks; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Upstream Linux commit 22168675bae7. For MIPI-CSI sender use-case it is common to specify the allowed link-frequencies which should be used for the MIPI link and is half the hs-clock rate. This commit adds a helper to calculate the D-PHY timing based on the hs-clock rate so we don't need to calculate the timings within the driver. Signed-off-by: Marco Felsch Acked-by: Vinod Koul Signed-off-by: Sakari Ailus Signed-off-by: Michael Trimarchi --- drivers/phy/phy-core-mipi-dphy.c | 32 +++++++++++++++++++++++++++----- include/phy-mipi-dphy.h | 3 +++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index 8fb985a1e682..de467c235266 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -13,21 +13,23 @@ /* * Minimum D-PHY timings based on MIPI D-PHY specification. Derived * from the valid ranges specified in Section 6.9, Table 14, Page 41 - * of the D-PHY specification (v2.1). + * of the D-PHY specification (v1.2). */ -int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, +static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, unsigned int bpp, unsigned int lanes, + unsigned long long hs_clk_rate, struct phy_configure_opts_mipi_dphy *cfg) { - unsigned long long hs_clk_rate; unsigned long long ui; if (!cfg) return -EINVAL; - hs_clk_rate = pixel_clock * bpp; - do_div(hs_clk_rate, lanes); + if (!hs_clk_rate) { + hs_clk_rate = pixel_clock * bpp; + do_div(hs_clk_rate, lanes); + } ui = ALIGN(PSEC_PER_SEC, hs_clk_rate); do_div(ui, hs_clk_rate); @@ -74,6 +76,26 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, return 0; } +int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, + unsigned int bpp, + unsigned int lanes, + struct phy_configure_opts_mipi_dphy *cfg) +{ + return phy_mipi_dphy_calc_config(pixel_clock, bpp, lanes, 0, cfg); + +} + +int phy_mipi_dphy_get_default_config_for_hsclk(unsigned long long hs_clk_rate, + unsigned int lanes, + struct phy_configure_opts_mipi_dphy *cfg) +{ + if (!hs_clk_rate) + return -EINVAL; + + return phy_mipi_dphy_calc_config(0, 0, lanes, hs_clk_rate, cfg); + +} + /* * Validate D-PHY configuration according to MIPI D-PHY specification * (v1.2, Section Section 6.9 "Global Operation Timing Parameters"). diff --git a/include/phy-mipi-dphy.h b/include/phy-mipi-dphy.h index a877ffee845d..1ac128d78dfe 100644 --- a/include/phy-mipi-dphy.h +++ b/include/phy-mipi-dphy.h @@ -279,6 +279,9 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock, unsigned int bpp, unsigned int lanes, struct phy_configure_opts_mipi_dphy *cfg); +int phy_mipi_dphy_get_default_config_for_hsclk(unsigned long long hs_clk_rate, + unsigned int lanes, + struct phy_configure_opts_mipi_dphy *cfg); int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg); #endif /* __PHY_MIPI_DPHY_H_ */ From patchwork Tue Sep 3 15:30:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3388 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 49ED83FA49 for ; Tue, 3 Sep 2024 17:31:19 +0200 (CEST) Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-53341717c62sf5136194e87.2 for ; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377479; cv=pass; d=google.com; s=arc-20240605; b=NIZHEXn7mGx7rEsN+XW13WOUSXnh1vg/jTV0L2dp2bflzi/37prXWVZcWXyXqhG52z YrZgVfajmkeEqbCrzupAA8jlau5QPYtObnOVa9NPFAYJ6R2FmR+B4Kd0uaji6j8HvKXm 7IaxZESvV+GpMjemGL/+pVAGoB37gQicxV1QvMU6itzkb7oi0GMczcEePG+cQ+m+7PTu AXGphOKp55S9/czE8Weme50sq1bmCXRvTlPXBBrWD4Zionv085+Oz6b5jBudSv/eNZfx PnN4BXrO8jZY6jMSDr22Oo01yjd8WCajhz5HhHk0649H17rRxu3X/KHVOROVh7c4ac0J 84xg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; fh=xOJdm1Oe3uKdMTxHaw1jp31ixok7SkxnIcQhYrnUY/4=; b=PBNhpPP15nr2BmD9z52f3zacD5l37jxsh6IMk95WJG31kgp7leV7mjhupx14hrORls oXCWV8b6yv+MY4LllaRi9FLd08mRhP6vjzyqgcrgzgq6+m6qqsitUzc7AixABtIwvUvK zEjo87t0P3al7YBenacGFSJeqVccQcecz7i6CrorP2jjMUDan76OtELJGimk/+/OVH6p zS18QUhBET1FkiES/q9YYfWXs/HkuCS9iW/jMAntdULULV/fSLHPmfcN4rLcfMZ8PriD GYRbM1DdDRiZwKw/IXUJgiuagb3Woxb4CdC344OrI7uVNAci6XlLzQFUU6PtTt3daH0y a9dw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UCiW3d70; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377479; x=1725982279; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; b=lQu8PGnZNbwyrAOsGCkazjEoNb2MZntSyPPImAFbqc5352an3O4RJ1+yI93O+vmui/ fR96FB4eVvxPUJam91ypmGwJciPWqX4q29yKAwCckfhGPyzdvunkVMXbovhcCW/fno1t ZpUYESP4PPvPPHtIYO5Mf460ggR4wTuZp10fE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377479; x=1725982279; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9ng4CwlxHxc6pwVyN9Fn6m6v+d9l4sL1wbU+U0oV8jY=; b=U9FPWlc8TAw4gF5PdZm+4iDxp9WKwt4bzeQV2HznBi4WPSfiFJu2E9bhD/mVBWBVss yqtKW9Q1/3mcgkV3TGdq79/CylwiZZD3G/lFxslo5Q9k/ncn8cDim8FUQcrvgOR8sReT 78W4JCOFB+JX/E/jjidg6nkZXLn1CPVSDAujD2uGGpPQBY9BUFU+BU9ftjsc7fHGGP7i 2UzOOoUjCunnuyx8kxstWA/cKluZ3oYCNRlOzElkcg6jeVR7fiG1vfgR6BauwvUh1aUH 2lHWkqcnG7EDm6OIbtVq64Ow1gC2GDtHJ0fD+J+cx95yo+eIXIcrClclcP7QvI1RvBtv eo7Q== X-Forwarded-Encrypted: i=2; AJvYcCUsMotaitAVdnNcdrMEl7tQQ3TrK6abhuV3j2TP94aVBffocHWtF2W86V0FCKD3BBIZfTsWfSKhlLxYbCP3@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yxsf+Dnb6KxEuCcDcrBaJeV1Bk6SR+mpecM6mYUziPw9gGScz6N 3OvBXgQKCae2dcWLimrupIMzqqdg38Iymxz46L4Z1aBIEpYh5j+rliEUtELS+YYxnA== X-Google-Smtp-Source: AGHT+IGtJxWu8w0X2A1fF30YoREEshaPcLWH5Hrvs1UPc0ABup1Tr++AAuFWFEJYALoW6fsME7TW1g== X-Received: by 2002:a05:6512:3b0b:b0:530:aa82:a50a with SMTP id 2adb3069b0e04-53546ba0471mr9670760e87.45.1725377478608; Tue, 03 Sep 2024 08:31:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3596:b0:427:ad0:2dd8 with SMTP id 5b1f17b1804b1-42bb284074cls3435555e9.0.-pod-prod-04-eu; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) X-Received: by 2002:a05:600c:4f4b:b0:426:629f:1556 with SMTP id 5b1f17b1804b1-42c7b5f0cf8mr65591415e9.31.1725377476952; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377476; cv=none; d=google.com; s=arc-20160816; b=FZzi3vOiTPCSyl5g51+9W7arbMi+OxBzNL9vX/4wa5J9FKPjWY4comc+oYwCdJFJcv TfNM9eLaLylvfxQ2GJT4IgwtYz6JVuIk0hY3L+Yj1z//jqj/yYWAOvb72BaVCSEZFrUi mQCaoepRMZgyBRSknJfTvNw9RKfYu7h9WEKRYubiv0YtO6U6f9i10meX89mCBg63H/a0 MNEVeBetp9Ys9NU6tByNlbBoNbXY4AaCrJyIsl5THbisfHnA9bfjpcq/FjP+x43pxUZ7 hjlM1LxnbGi6yVTkG/xbfy4ij4iXxvk4LlCSCiH4Xoq4Eo9ECmkN9g/NSExwLqbA4Wiv 9XSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=5iW6rpXTdrXWar1+QLqcytSL5S0X3ZyAp83NCIocMAo=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=ctXGBEQHwsXxMx73eVlvfeYJP3q68KSLDz0flAwn0bQV069qTeJNuTpERtKZbiWA3r O8cE8yVwOxew48tZqbceq/rdVilbj8MPsXP1hJ+rRugy2SdlVMFBX5/x8S65h/O7F5Rs a7lYJQRA3dOcZXdw/Wc7bvRZN14eRKJM/pg1mrVPTsu6sNeat3uMpLh10ag7qqsVxOrm EJ64ftduVcKyFrcIJGKOv49QqdmSERAJNccFA3PIqovooLWUlLnHDLAI/QDdUq+MavTu MPAdNzx4eDdycRJAjiywHQeclEfocHyxJFXPLivEasPPtCZ+AoQtaJLuvXopbP178twX PYyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UCiW3d70; 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=pass 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 5b1f17b1804b1-42bb70879e0sor26175975e9.4.2024.09.03.08.31.16 for (Google Transport Security); Tue, 03 Sep 2024 08:31:16 -0700 (PDT) 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-Received: by 2002:a05:600c:5493:b0:428:52a:3580 with SMTP id 5b1f17b1804b1-42c7b59e329mr68508845e9.3.1725377476236; Tue, 03 Sep 2024 08:31:16 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:15 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 16/29] phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure}) Date: Tue, 3 Sep 2024 17:30:47 +0200 Message-ID: <20240903153100.918077-16-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=UCiW3d70; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Upstream linux commit 3153fa38e38af5. According to the comment of the function phy_mipi_dphy_get_default_config(), it uses minimum D-PHY timings based on MIPI D-PHY specification. They are derived from the valid ranges specified in Section 6.9, Table 14, Page 41 of the D-PHY specification (v1.2). The table 14 explicitly mentions that the minimum T-LPX parameter is 50 nanoseconds and the minimum TA-SURE parameter is T-LPX nanoseconds. Likewise, the kernel doc of the 'lpx' and 'ta_sure' members of struct phy_configure_opts_mipi_dphy mentions that the minimum values are 50000 picoseconds and @lpx picoseconds respectively. Also, the function phy_mipi_dphy_config_validate() checks if cfg->lpx is less than 50000 picoseconds and if cfg->ta_sure is less than cfg->lpx, which hints the same minimum values. Without this patch, the function phy_mipi_dphy_get_default_config() wrongly sets cfg->lpx to 60000 picoseconds and cfg->ta_sure to 2 * cfg->lpx. So, let's correct them to 50000 picoseconds and cfg->lpx respectively. Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares. Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220216071257.1647703-1-victor.liu@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Michael Trimarchi --- drivers/phy/phy-core-mipi-dphy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index de467c235266..7a7cc4dc5bdf 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -64,10 +64,10 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, cfg->hs_trail = max(4 * 8 * ui, 60000 + 4 * 4 * ui); cfg->init = 100; - cfg->lpx = 60000; + cfg->lpx = 50000; cfg->ta_get = 5 * cfg->lpx; cfg->ta_go = 4 * cfg->lpx; - cfg->ta_sure = 2 * cfg->lpx; + cfg->ta_sure = cfg->lpx; cfg->wakeup = 1000; cfg->hs_clk_rate = hs_clk_rate; From patchwork Tue Sep 3 15:30:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3389 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 02CE341742 for ; Tue, 3 Sep 2024 17:31:20 +0200 (CEST) Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-374c25d886asf1961513f8f.3 for ; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377479; cv=pass; d=google.com; s=arc-20240605; b=RBrKrhP7wXFYAvNQ/j1J16rbZIAiTSIgcKqbRk6pyy5C+3W8pXgTz4Dq996+86w9ox Rp77p29fbDUp/mAblxUUInLBbjGUYPYL3+BIWj0LNkZUBPz7AnPL+rj1BCnlYNmbV64h eDy9KhWbZyDIOExwPELQEmYUgyIm52orRyiyI75nSy1R2a6yNM589uhhnwUgx5NU3XPA l8eVQ+8ijgVZ66MSmGw1jaLsRf4y5NjU0vAb5hTQFrpeTptTp/cuLdbBuGC1jIt1D9zQ sc8q+e1lE8D3i3ZBf4YEHMNjU5aXrUCg6hyGOSebkneYA2KpPK7fofUvRWACS0D/ZHvb 0WJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dPn9fUSeLS/3B5nD9h/rslOuEetTp3itjVCqKxFV0Ok=; fh=BdDalGh0rPXQIzULId22yEXhqccNbZBoNJz7VRRYUUg=; b=GS/zbjKVzYl+6b8sPAkzKt16+vQl8E1Zad6c45gwJflfKlS8zRoyhJRwnW/gZH9AHy qA6uiFHjfz0OQlidD13IgVTLExoAabUG3khG9AJUA94fyEBqytLXpHpmAOG6iCpauCp+ GlGp1H7T5LdgERUd4L//DmpF38BpnqUHPGuLoP1k3qpASZ4tNR7AOS2Da/q0p+6A6JW7 HnUbbmVlwOtzLZNuc7mw/r13laCPQY4yPgPB2ep0CYmhexGGopw+maufecVJtqyvZ4Yz ujItO7KMEYEY0x6EWjxZ0HLGtHkzDZLlEg0A8+r/fr27jxZ7UWYJMH/0tCzLmBGby88J QU9Q==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NriH1i+X; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377479; x=1725982279; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dPn9fUSeLS/3B5nD9h/rslOuEetTp3itjVCqKxFV0Ok=; b=KIMy6QT8i1P5GC6O7S632tyU0joINXhgLyMge9k33AnpafXJriAgppZPhqdA5wWzWP 2JcZ4G9j4DeDK4Mpb3Uxe34y4UVnprBf+xc0D3F9FNo/AggPRZ4iJYXZxPaRlZzJai2v CJnziKK+T4+7NhK+7iWEJQ8mMCDwdAeHbl4WQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377479; x=1725982279; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-beenthere:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dPn9fUSeLS/3B5nD9h/rslOuEetTp3itjVCqKxFV0Ok=; b=hjRiah/ipntTgid7nTTMkHqD/t2RsKi0VgP32Ne5NWiufnqBri3qDdGewuaombIGBh lhzRsCfnt9UWi/QF4SSiUJTaQ3cXJYXQmBGifsQwUQBKeYsr7pBRkRZC8h6lUI2cr++E L+PdHnDi1vYjG/F9P3YVIALkFsbmc8UC9BKLusohGklG/8Lh8pDEQe/gnyHQbWiNqvB+ g79QFdBR7/kOWV0nL2I0RHIo9KPjdeqS/1+40mqJSWFN3Pvns2/zQd+KvuS6Q0+yc+BH 4QYryWoEFq9DuJP/aU6noURKc82ujdmI5SMDzIkldJ663oUfwtg5hFv1uvpGDvP7FTYZ B3jw== X-Forwarded-Encrypted: i=2; AJvYcCV8zfLmo0Dd5502UfYNhq0JwllryU9HtNILPf5c8krRCdHUAf8fXf3TAiuRb75zDZenek25fLue1PJVHUvj@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxUl1Q1tauOc/+tCaTlFoU2WEh/oicM+vDTm/AI48mbqnJAdaG2 exGKceFdt2DoI9vi+vTctcL6Hh/Cn3+vU46U4umh+EdH5IM8mS1zcvJwP5pzfYCdSQ== X-Google-Smtp-Source: AGHT+IGACu2wp9x2kRkeHd0xR561NEF9CAw745+oCawSIj+qy+F7JlRBD1Ir1dH9Syoi9VweeBRAqw== X-Received: by 2002:adf:eac7:0:b0:374:cbe8:6f43 with SMTP id ffacd0b85a97d-374cbe8703bmr4499360f8f.33.1725377479471; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:428:7aa:dab5 with SMTP id 5b1f17b1804b1-42bb283e022ls16720755e9.0.-pod-prod-07-eu; Tue, 03 Sep 2024 08:31:18 -0700 (PDT) X-Received: by 2002:a05:600c:4fd6:b0:426:6eb9:db07 with SMTP id 5b1f17b1804b1-42bbb205b0emr103205645e9.13.1725377477726; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377477; cv=none; d=google.com; s=arc-20160816; b=h3efm+BkY53/9+TrEiaaxGRQBTQQ4xtQRH9xfu6J0CzuOGzS8aosT3AqpmYvdSPQgL ZzTlRO9I6ZE7zy61fIoPbdDKLL50gkfAWAQdt2vls3lExGqOY7JL313ZrmEQ/Y21X733 iVHvVFEj4G+ab0UXlYev08WgeTVVPdYfxkhR+011u3W/g0cwlcxzX+QE5VvrUvsFIXG8 hBKHqJ5rtsJbHMCBLnkzaHf+oGJY3J5psOn3hOzntAiCPSeXBkN5xBznQtosH4emFJ7o srpgnCPGS32iWIg7BZYsd4OztbK1PJwnCdQ3bPkuR1bRrq+gRc6F8xeaSOIA2bhL5CfC vBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=sMoy9Seih1wvvH2n9n2dryAliQeG+qx1G+lhic58brk=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=Zv+Dmb3Cy4oIz15TjKc7xCqRwGZljMn+0r1vAzrgZ6M0PXmxIhA4WpTuyoHVQjjN3P 6QTpYX23liL6deW6kPg5ZpodpA/NQwX8f2nTmIY7oCcXkqAhf77mZ71pMzbYsRUG1RjM KXaZfp1Ge3/yu2YqiVt0ZIV/Yrom7VwS7WGkmgahxfoxmveydFZ2cbXb0GEBaCbFlpRB aknVRF9u507ZAH8NvnC7gaKXoHilEbezJ9XaFYuLtZimmkhdDetB8LUt0GhHaMk5EMx2 cOPrMYYyyCUh8Oid3WmD5gulV8dVY2Ou9nQkkFyt2RD89096HlMgFzgJSEuslX0Ticlh 08Hg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NriH1i+X; 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=pass 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 5b1f17b1804b1-42c878efa26sor12078035e9.3.2024.09.03.08.31.17 for (Google Transport Security); Tue, 03 Sep 2024 08:31:17 -0700 (PDT) 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-Received: by 2002:a05:600c:510d:b0:42b:af52:2525 with SMTP id 5b1f17b1804b1-42bbb21603amr93264205e9.16.1725377477104; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:16 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 17/29] phy: dphy: Correct clk_pre parameter Date: Tue, 3 Sep 2024 17:30:48 +0200 Message-ID: <20240903153100.918077-17-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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=NriH1i+X; 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=pass 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: , From: Michael Trimarchi Upstream linux commit 9a8406ba1a9a29. The D-PHY specification (v1.2) explicitly mentions that the T-CLK-PRE parameter's unit is Unit Interval(UI) and the minimum value is 8. Also, kernel doc of the 'clk_pre' member of struct phy_configure_opts_mipi_dphy mentions that it should be in UI. However, the dphy core driver wrongly sets 'clk_pre' to 8000, which seems to hint that it's in picoseconds. So, let's fix the dphy core driver to correctly reflect the T-CLK-PRE parameter's minimum value according to the D-PHY specification. I'm assuming that all impacted custom drivers shall program values in TxByteClkHS cycles into hardware for the T-CLK-PRE parameter. The D-PHY specification mentions that the frequency of TxByteClkHS is exactly 1/8 the High-Speed(HS) bit rate(each HS bit consumes one UI). So, relevant custom driver code is changed to program those values as DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE), then. Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares. Tested-by: Liu Ying # RM67191 DSI panel on i.MX8mq EVK Reviewed-by: Andrzej Hajda Reviewed-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Guido Günther # Librem 5 (imx8mq) with it's rather picky panel Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220124024007.1465018-1-victor.liu@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Michael Trimarchi --- drivers/phy/meson-axg-mipi-dphy.c | 2 +- drivers/phy/phy-core-mipi-dphy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/meson-axg-mipi-dphy.c b/drivers/phy/meson-axg-mipi-dphy.c index 3f89de19970b..fb10ccca6ac1 100644 --- a/drivers/phy/meson-axg-mipi-dphy.c +++ b/drivers/phy/meson-axg-mipi-dphy.c @@ -237,7 +237,7 @@ static int phy_meson_axg_mipi_dphy_power_on(struct phy *phy) (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) | (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24)); regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1, - DIV_ROUND_UP(priv->config.clk_pre, temp)); + DIV_ROUND_UP(priv->config.clk_pre, BITS_PER_BYTE)); regmap_write(priv->regmap, MIPI_DSI_HS_TIM, DIV_ROUND_UP(priv->config.hs_exit, temp) | diff --git a/drivers/phy/phy-core-mipi-dphy.c b/drivers/phy/phy-core-mipi-dphy.c index 7a7cc4dc5bdf..8341b78e0dd8 100644 --- a/drivers/phy/phy-core-mipi-dphy.c +++ b/drivers/phy/phy-core-mipi-dphy.c @@ -36,7 +36,7 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock, cfg->clk_miss = 0; cfg->clk_post = 60000 + 52 * ui; - cfg->clk_pre = 8000; + cfg->clk_pre = 8; cfg->clk_prepare = 38000; cfg->clk_settle = 95000; cfg->clk_term_en = 0; From patchwork Tue Sep 3 15:30:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3390 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C93523F1F3 for ; Tue, 3 Sep 2024 17:31:20 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42c7a5563cfsf3962305e9.2 for ; Tue, 03 Sep 2024 08:31:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377480; cv=pass; d=google.com; s=arc-20240605; b=MruzLy5ChFwoUokqMzENJKr048OEp4Wl8DLcmpluNlg9WGaz/9nQuIYsE4eX1thyPo ziK3rtZs6F+IBwvfYFFThP26OwDoUkSVjylGKLpQjeXcbsUz6SefHIAS33peCav7R6BP soKvfJ+g28tos1dhqGtfJCmeMdN4BhNAb1Tdijl1JTzLi3kmDJDyikwuA5KBu5TkFIbw Okn7ttAYW6mxrqIxlVqhgPWZktdvJNzMXrqrbX3cJJFoSuM3Es8gB0TDO8xUidefZj0y LF6WIQBG8d3uL7CjpocoUfRql09vmPxJcuj1PMad5h136blO/EgJnqZQ4wNgakTGuqxO ii2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=+PjFIaIwye3hiWKqNtFxvxOu+c5W414KF3J2fkwTkrA=; fh=Mci6E9zU6IVJMkyxM4N11ScMORSoGb3MKFgUa6KM6Z0=; b=MoHgV/QdzR+FrcUcVn9AmMd0PI6+CB7DAEVpzYjGYB3zmPWSMyuZ0hoph+JcHOpLx1 Xm3CFlaxFjl/cUdy+NEEpUSwpFBmjTTOxoTFT+a7TtAox4aIWU5V9upAaPNepnDV6+Zd vR7dwP6ZR+1Gr4cZRHg5+rxh2/T0Sf2hxDH8FoE20YHPybgtQGmvSfdC9ZbrQseYlhdO 2hkmnfCN82Pn6b48EHWGTaicOmPR/PHUgRpZQGx3zyaRT4pe4Y8moYAYpmWI+KZp14nC KiyzTIaTBtAAjUI/jY/4Ev0KhWjr6p64+Gu4UuuMlmfKnF7KZIgsnJst7w8GWc1BRU+N LYOg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="C/sqHaX2"; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377480; x=1725982280; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+PjFIaIwye3hiWKqNtFxvxOu+c5W414KF3J2fkwTkrA=; b=MeZsp19IGfPgel0PyVN2gSFXl7SAE4VAq8qfcx5TzakJh4M+T2MrVKL1B8bag2vSq9 xZUaE1Ll6RF9CKakRMqh4RhBkGFBQHAZPM/+NT2zV+OFNU7x7GF+vgnlM9+WIeitrlfO rChztSZpHEvRos3xRcqoURqQTd75SY5Rv/mng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377480; x=1725982280; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+PjFIaIwye3hiWKqNtFxvxOu+c5W414KF3J2fkwTkrA=; b=U+LOT/wSa59dzleA8HyIjIZZJOv08fT4WFMfcNnvkV8qLZeqtMYlaD3aFwjTYyORSF JbDO1Gn66mGV6lrX97bK7WbMNAEpcpjgovYxX9XXtDC62W4fXpKcl21NqPzAWskrpdFB GFEaNNzm8hPIBZYfqUaxPwGmjGRu5xdHEw38eBlVTJENnunLffhQdHIMe21rngWdGupX 7MJ6abbu9iTVd4R2pQe+Bd22GRkLVQzgHxy8jeZA/NteY9jYomE3YcoMA+G4ZNUVtynT 6IABRrZF34DJ3ATPg/rfXC7YupyK4DBw8mjlzcIX1PfGxQCVz0skjGGGblfLuLARAGea uNww== X-Forwarded-Encrypted: i=2; AJvYcCXJgB02kP64TJbUm/9eia5TU9DgOCDm7xrT8V1qvVSMdbnB8U6P8+CGnXj5N6ybQiPw6G+/q7nyMuRZLIGa@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxVLyGTgF36QFg5dBIzpI0G5gJLt2F/4KLfJiT4RPJ6Egft+Ekd Ho26qR9wvaRWhk/mG1U4GDX5UszJOyNM9k8bfWa6GxTkwo8atre+aL0vJWLF8FwGCg== X-Google-Smtp-Source: AGHT+IFo0l/oxyhnQnocQE66Um5OcGAiMiRTNAiEufoFNM7KzC7YDfDaCRrPJ7oQRhuhuV89Mt7nxg== X-Received: by 2002:a05:600c:470f:b0:426:5ef5:bcb1 with SMTP id 5b1f17b1804b1-42bb01aa115mr123468565e9.6.1725377480423; Tue, 03 Sep 2024 08:31:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4686:b0:427:9377:3cc4 with SMTP id 5b1f17b1804b1-42bb2a0d072ls3943115e9.1.-pod-prod-06-eu; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) X-Received: by 2002:a05:600c:470f:b0:426:5ef5:bcb1 with SMTP id 5b1f17b1804b1-42bb01aa115mr123467675e9.6.1725377478713; Tue, 03 Sep 2024 08:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377478; cv=none; d=google.com; s=arc-20160816; b=JJ9o8HE/NDpvy/MhhwM2RzGlsm5Fnba43IHUMhT4KO0eCpsiEpDL3TfUHTS/zJhbBN T9Qm7alEPODpcantyZN9mcc8rbYvdch6GrLs2LK5l97csrFC7mBr+N0JliLzjMZNGa+E f0szGGip/+hf1urQfP43PW4CD04MaKR4piLCt2mlVY1eTyE6Piava9kwYb+BXoK51Wgs FrXHeH0AhzoWuEsC8cps2GHNZb3GnzKYgY54M7KQJoQdGkxPJJhAVRszC8H/2RTruptK j1WBMqRM050gmgK92dsOchpiKho1bYFKOZxkuaPV6QGgYTpINBsGKpBbNRPymoaEyEx3 6lUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=XzvabhpATxW1DmCBaEyNON19zj4DFTmPK3v1IpWaSMA=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=qZgRbvMEEr0wB9IqVK7mZCtoikjKfTkxuHxolABhFxtC90cOr8J/7xQEUZ+kTHWv/D CPRrhqTf4kKdbf8gzsa6X29qUgP4NWG0lRppHlF300Nlwl1ZqP8Dv73IXmfJx+hWzn+N U6DyMJYTPpR+9MhGWMNXQdrgcgXHMI8JNe2xYbL19zv9RgtfBYnK4lRZgLvgO/oZqPVf TCWgWPC8B6FHr4qf0zgjai8GXFiXJ+Y1faissTPyni7CPoBoY3cg54DvW/eZjrex9aDa yVveMhNqsiA92TOvNijMiJqDoKxHYiweaQt1i2gq+gF4EdvRjbs/mN6v0TVWbte2EvkV 7E6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="C/sqHaX2"; 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=pass 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 5b1f17b1804b1-42bb70b7031sor44104735e9.12.2024.09.03.08.31.18 for (Google Transport Security); Tue, 03 Sep 2024 08:31:18 -0700 (PDT) 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-Received: by 2002:a05:600c:1c83:b0:426:6ed5:d682 with SMTP id 5b1f17b1804b1-42bb01b4419mr123306235e9.12.1725377477933; Tue, 03 Sep 2024 08:31:17 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:17 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 18/29] lib: div64: sync with Linux Date: Tue, 3 Sep 2024 17:30:49 +0200 Message-ID: <20240903153100.918077-18-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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="C/sqHaX2"; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Sync with Linux commit fc4a0db4149af ("Merge tag '6.5'"). Signed-off-by: Michael Trimarchi --- include/linux/math64.h | 110 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/include/linux/math64.h b/include/linux/math64.h index eaa9fd5b9685..0e684bb2beef 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_MATH64_H #define _LINUX_MATH64_H @@ -12,6 +13,11 @@ /** * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 32bit divisor + * @remainder: pointer to unsigned 32bit remainder + * + * Return: sets ``*remainder``, then returns dividend / divisor * * This is commonly provided by 32bit archs to provide an optimized 64bit * divide. @@ -24,6 +30,11 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) /** * div_s64_rem - signed 64bit divide with 32bit divisor with remainder + * @dividend: signed 64bit dividend + * @divisor: signed 32bit divisor + * @remainder: pointer to signed 32bit remainder + * + * Return: sets ``*remainder``, then returns dividend / divisor */ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) { @@ -33,6 +44,11 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) /** * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 64bit divisor + * @remainder: pointer to unsigned 64bit remainder + * + * Return: sets ``*remainder``, then returns dividend / divisor */ static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) { @@ -42,6 +58,10 @@ static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) /** * div64_u64 - unsigned 64bit divide with 64bit divisor + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 64bit divisor + * + * Return: dividend / divisor */ static inline u64 div64_u64(u64 dividend, u64 divisor) { @@ -53,6 +73,10 @@ static inline u64 div64_u64(u64 dividend, u64 divisor) /** * div64_s64 - signed 64bit divide with 64bit divisor + * @dividend: signed 64bit dividend + * @divisor: signed 64bit divisor + * + * Return: dividend / divisor */ static inline s64 div64_s64(s64 dividend, s64 divisor) { @@ -92,10 +116,14 @@ extern s64 div64_s64(s64 dividend, s64 divisor); /** * div_u64 - unsigned 64bit divide with 32bit divisor + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 32bit divisor * * This is the most common 64bit divide and should be used if possible, * as many 32bit archs can optimize this variant better than a full 64bit * divide. + * + * Return: dividend / divisor */ #ifndef div_u64 static inline u64 div_u64(u64 dividend, u32 divisor) @@ -107,6 +135,10 @@ static inline u64 div_u64(u64 dividend, u32 divisor) /** * div_s64 - signed 64bit divide with 32bit divisor + * @dividend: signed 64bit dividend + * @divisor: signed 32bit divisor + * + * Return: dividend / divisor */ #ifndef div_s64 static inline s64 div_s64(s64 dividend, s32 divisor) @@ -228,6 +260,24 @@ static inline u64 mul_u64_u64_shr(u64 a, u64 b, unsigned int shift) #endif +#ifndef mul_s64_u64_shr +static inline u64 mul_s64_u64_shr(s64 a, u64 b, unsigned int shift) +{ + u64 ret; + + /* + * Extract the sign before the multiplication and put it back + * afterwards if needed. + */ + ret = mul_u64_u64_shr(abs(a), b, shift); + + if (a < 0) + ret = -((s64) ret); + + return ret; +} +#endif /* mul_s64_u64_shr */ + #ifndef mul_u64_u32_div static inline u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) { @@ -257,4 +307,64 @@ static inline u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) } #endif /* mul_u64_u32_div */ +u64 mul_u64_u64_div_u64(u64 a, u64 mul, u64 div); + +/** + * DIV64_U64_ROUND_UP - unsigned 64bit divide with 64bit divisor rounded up + * @ll: unsigned 64bit dividend + * @d: unsigned 64bit divisor + * + * Divide unsigned 64bit dividend by unsigned 64bit divisor + * and round up. + * + * Return: dividend / divisor rounded up + */ +#define DIV64_U64_ROUND_UP(ll, d) \ + ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); }) + +/** + * DIV64_U64_ROUND_CLOSEST - unsigned 64bit divide with 64bit divisor rounded to nearest integer + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 64bit divisor + * + * Divide unsigned 64bit dividend by unsigned 64bit divisor + * and round to closest integer. + * + * Return: dividend / divisor rounded to nearest integer + */ +#define DIV64_U64_ROUND_CLOSEST(dividend, divisor) \ + ({ u64 _tmp = (divisor); div64_u64((dividend) + _tmp / 2, _tmp); }) + +/** + * DIV_U64_ROUND_CLOSEST - unsigned 64bit divide with 32bit divisor rounded to nearest integer + * @dividend: unsigned 64bit dividend + * @divisor: unsigned 32bit divisor + * + * Divide unsigned 64bit dividend by unsigned 32bit divisor + * and round to closest integer. + * + * Return: dividend / divisor rounded to nearest integer + */ +#define DIV_U64_ROUND_CLOSEST(dividend, divisor) \ + ({ u32 _tmp = (divisor); div_u64((u64)(dividend) + _tmp / 2, _tmp); }) + +/** + * DIV_S64_ROUND_CLOSEST - signed 64bit divide with 32bit divisor rounded to nearest integer + * @dividend: signed 64bit dividend + * @divisor: signed 32bit divisor + * + * Divide signed 64bit dividend by signed 32bit divisor + * and round to closest integer. + * + * Return: dividend / divisor rounded to nearest integer + */ +#define DIV_S64_ROUND_CLOSEST(dividend, divisor)( \ +{ \ + s64 __x = (dividend); \ + s32 __d = (divisor); \ + ((__x > 0) == (__d > 0)) ? \ + div_s64((__x + (__d / 2)), __d) : \ + div_s64((__x - (__d / 2)), __d); \ +} \ +) #endif /* _LINUX_MATH64_H */ From patchwork Tue Sep 3 15:30:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3391 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 215203F228 for ; Tue, 3 Sep 2024 17:31:23 +0200 (CEST) Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-374c25d886asf1961564f8f.3 for ; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377483; cv=pass; d=google.com; s=arc-20240605; b=Q7+WnjZKxOlANx9dET1NvOhnFl4aXEBqvZz9k6uHjX1eZONh20biosx9wmJAnD1ftV f+m/XMH1gVO15ANyLIdROakp97O5gzgKGB/04i24xVFiMQ2YvK2kld48ZkAi7lmSRP9T i8UjW4A9Q2qHNjBe5hsqvGsSqKeM2rY+v7AVD/BFqsoGBbiu8806nVuwm2UQHXxRGDu8 OyfnAOzUOyQ2B7Ezv4xJpSleuNkYAVgGuqXB8ExBycmQnaSZeJZR72+tzNJi5aX0K2O9 1sFir60JnMR5L5MQk1R56mICFJ4GKdz+S8zPqDTklPHWlTalgcbqMLISrXWUChmmFB0S GefQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=U44OoUX1WXeVoMOXudjxa228T8igW8a/MPqkj3xR+hc=; fh=kVgrWUUYbNmSB6Btk+WRT+G5h2eoJBWob/M/eyqNB7Y=; b=Fse6KaSzm1x7J76QWiMNxB+qF6rkEK6OYEphg9qtG4e7jhSJGivLV2InlGPiTf1jt6 lIN5S20947Wkp0PiwQ6jyMeVIptWa6YjhU7Xq0QjHcrvNfEV7j/DHVIPfZuvuGvGbjg7 1eSmiHQen+tF4+fEGrffZF/Gj71aWDsKGP5M/tWSSXnKtyqAlxr2Iks4LdrWGr9R4lxF 7wS2OPTsu6GABhGSOY8vJt4Gj8zEwRAt+/rGJyx4tIArLse2Lz2QLsj22uLGc01Ea6d5 OdzJHu8a143sJX5j8a3jrPglo+AQGhZusZ6UmZZleIk5FI0VvUTTUsG0tgxVfd+oB0uk sQvg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Dwe1m7Xw; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377483; x=1725982283; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=U44OoUX1WXeVoMOXudjxa228T8igW8a/MPqkj3xR+hc=; b=iMBo/zFriSvbrWEf1zyX4zhq/5O4wdvmVnygDJvVBjpyP8e2tH3E/H6CX0lPEWiz5M 5fHDAlR81Rx6dvGbDb+CV3+NEHKmZjmxYY2IVEhjqzrTgB7d1H3LUHLwuXZUpdlzraMa jlWG3NWufKMoKKIJ94PDyepn+gLwn6zH+EgWo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377483; x=1725982283; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U44OoUX1WXeVoMOXudjxa228T8igW8a/MPqkj3xR+hc=; b=kH5A3JtGZtYGl6X+QsuLuG/qKg4RoZOU8qnXCWN0/TxOt1Q/ju+i/wxhVYI3CKG8T5 kxEzU1W2/kjbX6uByXx6yjRSR06VekeWmOSA2csikEKT1V8EADiFrH6BjGNiv+ACk+cE PBjJ1Ws1ge6Rp5Qhv9yIWGVIZcVSt8ToJ8+ZOvqZ74QLW497SLBMD4jVxpkJey3laDxT W/dl4WW/7C5pB8XblX4fQwyIADGa86xu0fB3C0fFN8oEMWWN5laB+o27SRWgLvNcdZ7T jtEtMuFICBkmB/QHFrYIL4BYGM7w/4SvOEAvTC0GkWh5yE/2btyd2b5xgQ9TuAN2Yacm MIYw== X-Forwarded-Encrypted: i=2; AJvYcCUaS6QB7AsHGRIIm7MopQlwj4SWRb53FU9gtdr9/Mce8HEv+Sz2OgzE9K3EAM+Q/fCnVxEtaqBXv8BNM0to@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyIKae69n2xZl8ao0RekIaw4Gg1HBRXrus7fcT5OPYVlth4D6hW A+b2fAWO6P0sQ/iuXcxp++q6aUKVn9IDaqVW3UjbP29vwR+JV0aGqgF0s18TcwMGVw== X-Google-Smtp-Source: AGHT+IFmf7hZbAxowNTDAY5VQ9cRIZzNMH++pzT8ZyCuU2eY7CwlT4wlmOkiIOG+J4ccC1y0HF7yZg== X-Received: by 2002:adf:ce87:0:b0:374:c651:4abf with SMTP id ffacd0b85a97d-374c6514c30mr5515603f8f.52.1725377482540; Tue, 03 Sep 2024 08:31:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:428:7aa:dab5 with SMTP id 5b1f17b1804b1-42bb283e022ls16721745e9.0.-pod-prod-07-eu; Tue, 03 Sep 2024 08:31:21 -0700 (PDT) X-Received: by 2002:a05:600c:510d:b0:42b:af52:2525 with SMTP id 5b1f17b1804b1-42bbb21603amr93266225e9.16.1725377480637; Tue, 03 Sep 2024 08:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377480; cv=none; d=google.com; s=arc-20160816; b=oPOC0TMxUDon0BMyZVDcNSROCviz2tinyNau45TsSDVxzoDPT1SO/2WXZk8/aq8Ik9 PElFACZqQYqkLOTqo3wP2pHjkYJ4vEC3zI4s/Kzx15SNb/xR1Sl1CsLuKsQQX5SRVKfM SSGRcwxtzNhtV5KVBl3NIJyycpSmwMooEniF38qzk+eSBSIvzqTjDMvqEbloBfghxwOb D6KlSdy9dVY+UmIDmkuGMuIwZ/r1Rp4AAI4r/Ui/j30MxCn2IaIg6ye8qrWm/SgpIEmO o4Yk58m1QSAO9adNQFDPIf/84GgDKmxP3Mv7zbQwQ53gvQDHhuVXsJCr8DFtJQsatrxR bjVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Gkf26pevCqGkNJhWgB1W6hYVu+XfMNJhZSG9WHgHL7M=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=s7rVk63q4OEDrJymPhFo9PJvQXjRTu2M1YYhNhUCrFymSwxAln1VUHVmGRC6HkJ1G6 ABCftWEvbsD7oRvspzDb8P8v6jjHYafjgQ+38GkC+eWuSpz3bQjII2iz4S+k7xomUMGk JNAi81259NriIhOBQlKdP/+Y9E4PrLbS4rxtpgRAW8MyFFjj5QA4lyyDvhtZrdHhlTOB uyZADEi0jtKoa8MCTpKkzNtik6mop9yxMIvnFn6sLWWw/yRIvm/X+ND905JQSasMOCnp DcfJOgvfIKG/b70u8Vy0IGjynWD1O5L58kL7Wiw7zuGv5C8hoO5sYkNCrAhQOmNoWtUf +7aQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Dwe1m7Xw; 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=pass 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 5b1f17b1804b1-42bb705499bsor44936125e9.1.2024.09.03.08.31.20 for (Google Transport Security); Tue, 03 Sep 2024 08:31:20 -0700 (PDT) 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-Received: by 2002:a05:600c:997:b0:42b:ac3f:f5c with SMTP id 5b1f17b1804b1-42bbb436de5mr88697615e9.26.1725377478932; Tue, 03 Sep 2024 08:31:18 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:18 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 19/29] video: bridge: Add Samsung DSIM bridge Date: Tue, 3 Sep 2024 17:30:50 +0200 Message-ID: <20240903153100.918077-19-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=Dwe1m7Xw; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano. In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the as a bridge that can support all different platform. Signed-off-by: Michael Trimarchi --- drivers/video/bridge/Kconfig | 13 + drivers/video/bridge/Makefile | 1 + drivers/video/bridge/samsung-dsi-host.c | 1567 +++++++++++++++++++++++ drivers/video/bridge/samsung-dsim.c | 148 +++ drivers/video/bridge/samsung-dsim.h | 20 + 5 files changed, 1749 insertions(+) create mode 100644 drivers/video/bridge/samsung-dsi-host.c create mode 100644 drivers/video/bridge/samsung-dsim.c create mode 100644 drivers/video/bridge/samsung-dsim.h diff --git a/drivers/video/bridge/Kconfig b/drivers/video/bridge/Kconfig index ab9172737201..5cb1e7af9935 100644 --- a/drivers/video/bridge/Kconfig +++ b/drivers/video/bridge/Kconfig @@ -44,6 +44,19 @@ config VIDEO_BRIDGE_ANALOGIX_ANX6345 The Analogix ANX6345 is RGB-to-DP converter. It enables an eDP LCD panel to be connected to an parallel LCD interface. +config VIDEO_BRIDGE_SAMSUNG_DSIM + bool "Enable IMX SEC DSI video support" + select MIPI_DPHY_HELPERS + select VIDEO_BRIDGE + select VIDEO_LINK + select VIDEO_MIPI_DSI + help + Enables the common driver code for the Samsung + MIPI DSI block found in SoCs from various vendors. + As this does not provide any functionality by itself (but + rather requires a SoC-specific glue driver to call it), it + can not be enabled from the configuration menu. + config VIDEO_BRIDGE_SOLOMON_SSD2825 bool "Solomon SSD2825 bridge driver" depends on PANEL && DM_GPIO diff --git a/drivers/video/bridge/Makefile b/drivers/video/bridge/Makefile index 58697e3cbe90..8f49013299ae 100644 --- a/drivers/video/bridge/Makefile +++ b/drivers/video/bridge/Makefile @@ -8,5 +8,6 @@ obj-$(CONFIG_VIDEO_BRIDGE_PARADE_DP501) += dp501.o obj-$(CONFIG_VIDEO_BRIDGE_PARADE_PS862X) += ps862x.o obj-$(CONFIG_VIDEO_BRIDGE_NXP_PTN3460) += ptn3460.o obj-$(CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345) += anx6345.o +obj-$(CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM) += samsung-dsim.o samsung-dsi-host.o obj-$(CONFIG_VIDEO_BRIDGE_SOLOMON_SSD2825) += ssd2825.o obj-$(CONFIG_VIDEO_BRIDGE_TOSHIBA_TC358768) += tc358768.o diff --git a/drivers/video/bridge/samsung-dsi-host.c b/drivers/video/bridge/samsung-dsi-host.c new file mode 100644 index 000000000000..dd3e33c4edc7 --- /dev/null +++ b/drivers/video/bridge/samsung-dsi-host.c @@ -0,0 +1,1567 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 Amarula Solutions + * Copyright 2018 NXP + * + */ + +#define LOG_CATEGORY UCLASS_DSI_HOST + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "samsung-dsim.h" + +#define MIPI_FIFO_TIMEOUT 250000 /* 250ms */ + +#define DRIVER_NAME "samsung_dsi" + +/* reg bit manipulation */ +#define REG_MASK(e, s) (((1 << ((e) - (s) + 1)) - 1) << (s)) +#define REG_PUT(x, e, s) (((x) << (s)) & REG_MASK(e, s)) +#define REG_GET(x, e, s) (((x) & REG_MASK(e, s)) >> (s)) + +#define RGB_STATUS_CMDMODE_INSEL BIT(31) +#define RGB_STATUS_GET_RGBSTATE(x) REG_GET(x, 12, 0) + +#define CLKCTRL_DPHY_SEL_1P5G (0x0 << 29) +#define CLKCTRL_PLLBYPASS BIT(29) +#define CLKCTRL_BYTECLKSRC_DPHY_PLL REG_PUT(0, 26, 25) +#define CLKCTRL_SET_LANEESCCLKEN(x) REG_PUT(x, 23, 19) +#define CLKCTRL_SET_ESCPRESCALER(x) REG_PUT(x, 15, 0) + +#define ESCMODE_SET_STOPSTATE_CNT(X) REG_PUT(x, 31, 21) +#define ESCMODE_FORCESTOPSTATE BIT(20) +#define ESCMODE_FORCEBTA BIT(16) +#define ESCMODE_CMDLPDT BIT(7) +#define ESCMODE_TXLPDT BIT(6) +#define ESCMODE_TXTRIGGERRST BIT(5) + +#define MVPORCH_SET_CMDALLOW(x) REG_PUT(x, 31, 28) +#define MVPORCH_SET_STABLEVFP(x) REG_PUT(x, 26, 16) +#define MVPORCH_SET_MAINVBP(x) REG_PUT(x, 10, 0) + +#define MHPORCH_SET_MAINHFP(x) REG_PUT(x, 31, 16) +#define MHPORCH_SET_MAINHBP(x) REG_PUT(x, 15, 0) + +#define MSYNC_SET_MAINVSA(x) REG_PUT(x, 31, 22) +#define MSYNC_SET_MAINHSA(x) REG_PUT(x, 15, 0) + +#define INTSRC_PLLSTABLE BIT(31) +#define INTSRC_SWRSTRELEASE BIT(30) +#define INTSRC_SFRPLFIFOEMPTY BIT(29) +#define INTSRC_SFRPHFIFOEMPTY BIT(28) +#define INTSRC_FRAMEDONE BIT(24) +#define INTSRC_LPDRTOUT BIT(21) +#define INTSRC_TATOUT BIT(20) +#define INTSRC_RXDATDONE BIT(18) +#define INTSRC_MASK (INTSRC_PLLSTABLE | \ + INTSRC_SWRSTRELEASE | \ + INTSRC_SFRPLFIFOEMPTY | \ + INTSRC_SFRPHFIFOEMPTY | \ + INTSRC_FRAMEDONE | \ + INTSRC_LPDRTOUT | \ + INTSRC_TATOUT | \ + INTSRC_RXDATDONE) + +#define INTMSK_MSKPLLSTABLE BIT(31) +#define INTMSK_MSKSWRELEASE BIT(30) +#define INTMSK_MSKSFRPLFIFOEMPTY BIT(29) +#define INTMSK_MSKSFRPHFIFOEMPTY BIT(28) +#define INTMSK_MSKFRAMEDONE BIT(24) +#define INTMSK_MSKLPDRTOUT BIT(21) +#define INTMSK_MSKTATOUT BIT(20) +#define INTMSK_MSKRXDATDONE BIT(18) + +#define PKTHDR_SET_DATA1(x) REG_PUT(x, 23, 16) +#define PKTHDR_GET_DATA1(x) REG_GET(x, 23, 16) +#define PKTHDR_SET_DATA0(x) REG_PUT(x, 15, 8) +#define PKTHDR_GET_DATA0(x) REG_GET(x, 15, 8) +#define PKTHDR_GET_WC(x) REG_GET(x, 23, 8) +#define PKTHDR_SET_DI(x) REG_PUT(x, 7, 0) +#define PKTHDR_GET_DI(x) REG_GET(x, 7, 0) +#define PKTHDR_SET_DT(x) REG_PUT(x, 5, 0) +#define PKTHDR_GET_DT(x) REG_GET(x, 5, 0) +#define PKTHDR_SET_VC(x) REG_PUT(x, 7, 6) +#define PKTHDR_GET_VC(x) REG_GET(x, 7, 6) + +#define FIFOCTRL_FULLRX BIT(25) +#define FIFOCTRL_EMPTYRX BIT(24) +#define FIFOCTRL_FULLHSFR BIT(23) +#define FIFOCTRL_EMPTYHSFR BIT(22) +#define FIFOCTRL_FULLLSFR BIT(21) +#define FIFOCTRL_EMPTYLSFR BIT(20) +#define FIFOCTRL_FULLHMAIN BIT(11) +#define FIFOCTRL_EMPTYHMAIN BIT(10) +#define FIFOCTRL_FULLLMAIN BIT(9) +#define FIFOCTRL_EMPTYLMAIN BIT(8) +#define FIFOCTRL_NINITRX BIT(4) +#define FIFOCTRL_NINITSFR BIT(3) +#define FIFOCTRL_NINITI80 BIT(2) +#define FIFOCTRL_NINITSUB BIT(1) +#define FIFOCTRL_NINITMAIN BIT(0) + +#define PLLCTRL_DPDNSWAP_CLK BIT(25) +#define PLLCTRL_DPDNSWAP_DAT BIT(24) +#define PLLCTRL_PLLEN BIT(23) +#define PLLCTRL_SET_PMS(x) REG_PUT(x, 19, 1) +#define PLLCTRL_SET_P(x) REG_PUT(x, 18, 13) +#define PLLCTRL_SET_M(x) REG_PUT(x, 12, 3) +#define PLLCTRL_SET_S(x) REG_PUT(x, 2, 0) + +#define MAX_MAIN_HRESOL 2047 +#define MAX_MAIN_VRESOL 2047 +#define MAX_SUB_HRESOL 1024 +#define MAX_SUB_VRESOL 1024 + +/* in KHZ */ +#define MAX_ESC_CLK_FREQ 20000 + +/* dsim all irqs index */ +#define PLLSTABLE 1 +#define SWRSTRELEASE 2 +#define SFRPLFIFOEMPTY 3 +#define SFRPHFIFOEMPTY 4 +#define SYNCOVERRIDE 5 +#define BUSTURNOVER 6 +#define FRAMEDONE 7 +#define LPDRTOUT 8 +#define TATOUT 9 +#define RXDATDONE 10 +#define RXTE 11 +#define RXACK 12 +#define ERRRXECC 13 +#define ERRRXCRC 14 +#define ERRESC3 15 +#define ERRESC2 16 +#define ERRESC1 17 +#define ERRESC0 18 +#define ERRSYNC3 19 +#define ERRSYNC2 20 +#define ERRSYNC1 21 +#define ERRSYNC0 22 +#define ERRCONTROL3 23 +#define ERRCONTROL2 24 +#define ERRCONTROL1 25 +#define ERRCONTROL0 26 + +#define PS_TO_CYCLE(ps, hz) DIV64_U64_ROUND_CLOSEST(((ps) * (hz)), 1000000000000ULL) + +#define MIPI_HFP_PKT_OVERHEAD 6 +#define MIPI_HBP_PKT_OVERHEAD 6 +#define MIPI_HSA_PKT_OVERHEAD 6 + +/* DSIM_STATUS */ +#define DSIM_STOP_STATE_DAT(x) (((x) & 0xf) << 0) +#define DSIM_STOP_STATE_CLK BIT(8) +#define DSIM_TX_READY_HS_CLK BIT(10) +#define DSIM_PLL_STABLE BIT(31) + +/* DSIM_SWRST */ +#define DSIM_FUNCRST BIT(16) +#define DSIM_SWRST BIT(0) + +/* DSIM_TIMEOUT */ +#define DSIM_LPDR_TIMEOUT(x) ((x) << 0) +#define DSIM_BTA_TIMEOUT(x) ((x) << 16) + +/* DSIM_CLKCTRL */ +#define DSIM_ESC_PRESCALER(x) (((x) & 0xffff) << 0) +#define DSIM_ESC_PRESCALER_MASK (0xffff << 0) +#define DSIM_LANE_ESC_CLK_EN_CLK BIT(19) +#define DSIM_LANE_ESC_CLK_EN_DATA(x) (((x) & 0xf) << 20) +#define DSIM_LANE_ESC_CLK_EN_DATA_MASK (0xf << 20) +#define DSIM_BYTE_CLKEN BIT(24) +#define DSIM_BYTE_CLK_SRC(x) (((x) & 0x3) << 25) +#define DSIM_BYTE_CLK_SRC_MASK (0x3 << 25) +#define DSIM_PLL_BYPASS BIT(27) +#define DSIM_ESC_CLKEN BIT(28) +#define DSIM_TX_REQUEST_HSCLK BIT(31) + +/* DSIM_CONFIG */ +#define DSIM_LANE_EN_CLK BIT(0) +#define DSIM_LANE_EN(x) (((x) & 0xf) << 1) +#define DSIM_NUM_OF_DATA_LANE(x) (((x) & 0x3) << 5) +#define DSIM_SUB_PIX_FORMAT(x) (((x) & 0x7) << 8) +#define DSIM_MAIN_PIX_FORMAT_MASK (0x7 << 12) +#define DSIM_MAIN_PIX_FORMAT_RGB888 (0x7 << 12) +#define DSIM_MAIN_PIX_FORMAT_RGB666 (0x6 << 12) +#define DSIM_MAIN_PIX_FORMAT_RGB666_P (0x5 << 12) +#define DSIM_MAIN_PIX_FORMAT_RGB565 (0x4 << 12) +#define DSIM_SUB_VC(x) (((x) & 0x3) << 16) +#define DSIM_MAIN_VC(x) (((x) & 0x3) << 18) +#define DSIM_HSA_DISABLE_MODE BIT(20) +#define DSIM_HBP_DISABLE_MODE BIT(21) +#define DSIM_HFP_DISABLE_MODE BIT(22) +/* + * The i.MX 8M Mini Applications Processor Reference Manual, + * Rev. 3, 11/2020 Page 4091 + * The i.MX 8M Nano Applications Processor Reference Manual, + * Rev. 2, 07/2022 Page 3058 + * The i.MX 8M Plus Applications Processor Reference Manual, + * Rev. 1, 06/2021 Page 5436 + * all claims this bit is 'HseDisableMode' with the definition + * 0 = Disables transfer + * 1 = Enables transfer + * + * This clearly states that HSE is not a disabled bit. + * + * The naming convention follows as per the manual and the + * driver logic is based on the MIPI_DSI_MODE_VIDEO_HSE flag. + */ +#define DSIM_HSE_DISABLE_MODE BIT(23) +#define DSIM_AUTO_MODE BIT(24) +#define DSIM_VIDEO_MODE BIT(25) +#define DSIM_BURST_MODE BIT(26) +#define DSIM_SYNC_INFORM BIT(27) +#define DSIM_EOT_DISABLE BIT(28) +#define DSIM_MFLUSH_VS BIT(29) +/* This flag is valid only for exynos3250/3472/5260/5430 */ +#define DSIM_CLKLANE_STOP BIT(30) +#define DSIM_NON_CONTINUOUS_CLKLANE BIT(31) + +/* DSIM_ESCMODE */ +#define DSIM_TX_TRIGGER_RST BIT(4) +#define DSIM_TX_LPDT_LP BIT(6) +#define DSIM_CMD_LPDT_LP BIT(7) +#define DSIM_FORCE_BTA BIT(16) +#define DSIM_FORCE_STOP_STATE BIT(20) +#define DSIM_STOP_STATE_CNT(x) (((x) & 0x7ff) << 21) +#define DSIM_STOP_STATE_CNT_MASK (0x7ff << 21) + +/* DSIM_MDRESOL */ +#define DSIM_MAIN_STAND_BY BIT(31) +#define DSIM_MAIN_VRESOL(x, num_bits) (((x) & ((1 << (num_bits)) - 1)) << 16) +#define DSIM_MAIN_HRESOL(x, num_bits) (((x) & ((1 << (num_bits)) - 1)) << 0) + +/* DSIM_MVPORCH */ +#define DSIM_CMD_ALLOW(x) ((x) << 28) +#define DSIM_STABLE_VFP(x) ((x) << 16) +#define DSIM_MAIN_VBP(x) ((x) << 0) +#define DSIM_CMD_ALLOW_MASK (0xf << 28) +#define DSIM_STABLE_VFP_MASK (0x7ff << 16) +#define DSIM_MAIN_VBP_MASK (0x7ff << 0) + +/* DSIM_MHPORCH */ +#define DSIM_MAIN_HFP(x) ((x) << 16) +#define DSIM_MAIN_HBP(x) ((x) << 0) +#define DSIM_MAIN_HFP_MASK ((0xffff) << 16) +#define DSIM_MAIN_HBP_MASK ((0xffff) << 0) + +/* DSIM_MSYNC */ +#define DSIM_MAIN_VSA(x) ((x) << 22) +#define DSIM_MAIN_HSA(x) ((x) << 0) +#define DSIM_MAIN_VSA_MASK ((0x3ff) << 22) +#define DSIM_MAIN_HSA_MASK ((0xffff) << 0) + +/* DSIM_SDRESOL */ +#define DSIM_SUB_STANDY(x) ((x) << 31) +#define DSIM_SUB_VRESOL(x) ((x) << 16) +#define DSIM_SUB_HRESOL(x) ((x) << 0) +#define DSIM_SUB_STANDY_MASK ((0x1) << 31) +#define DSIM_SUB_VRESOL_MASK ((0x7ff) << 16) +#define DSIM_SUB_HRESOL_MASK ((0x7ff) << 0) + +/* DSIM_INTSRC */ +#define DSIM_INT_PLL_STABLE BIT(31) +#define DSIM_INT_SW_RST_RELEASE BIT(30) +#define DSIM_INT_SFR_FIFO_EMPTY BIT(29) +#define DSIM_INT_SFR_HDR_FIFO_EMPTY BIT(28) +#define DSIM_INT_BTA BIT(25) +#define DSIM_INT_FRAME_DONE BIT(24) +#define DSIM_INT_RX_TIMEOUT BIT(21) +#define DSIM_INT_BTA_TIMEOUT BIT(20) +#define DSIM_INT_RX_DONE BIT(18) +#define DSIM_INT_RX_TE BIT(17) +#define DSIM_INT_RX_ACK BIT(16) +#define DSIM_INT_RX_ECC_ERR BIT(15) +#define DSIM_INT_RX_CRC_ERR BIT(14) + +/* DSIM_FIFOCTRL */ +#define DSIM_RX_DATA_FULL BIT(25) +#define DSIM_RX_DATA_EMPTY BIT(24) +#define DSIM_SFR_HEADER_FULL BIT(23) +#define DSIM_SFR_HEADER_EMPTY BIT(22) +#define DSIM_SFR_PAYLOAD_FULL BIT(21) +#define DSIM_SFR_PAYLOAD_EMPTY BIT(20) +#define DSIM_I80_HEADER_FULL BIT(19) +#define DSIM_I80_HEADER_EMPTY BIT(18) +#define DSIM_I80_PAYLOAD_FULL BIT(17) +#define DSIM_I80_PAYLOAD_EMPTY BIT(16) +#define DSIM_SD_HEADER_FULL BIT(15) +#define DSIM_SD_HEADER_EMPTY BIT(14) +#define DSIM_SD_PAYLOAD_FULL BIT(13) +#define DSIM_SD_PAYLOAD_EMPTY BIT(12) +#define DSIM_MD_HEADER_FULL BIT(11) +#define DSIM_MD_HEADER_EMPTY BIT(10) +#define DSIM_MD_PAYLOAD_FULL BIT(9) +#define DSIM_MD_PAYLOAD_EMPTY BIT(8) +#define DSIM_RX_FIFO BIT(4) +#define DSIM_SFR_FIFO BIT(3) +#define DSIM_I80_FIFO BIT(2) +#define DSIM_SD_FIFO BIT(1) +#define DSIM_MD_FIFO BIT(0) + +/* DSIM_PHYACCHR */ +#define DSIM_AFC_EN BIT(14) +#define DSIM_AFC_CTL(x) (((x) & 0x7) << 5) + +/* DSIM_PLLCTRL */ +#define DSIM_FREQ_BAND(x) ((x) << 24) +#define DSIM_PLL_EN BIT(23) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) +#define DSIM_PLL_M(x) ((x) << 4) +#define DSIM_PLL_S(x) ((x) << 1) + +/* DSIM_PHYCTRL */ +#define DSIM_PHYCTRL_ULPS_EXIT(x) (((x) & 0x1ff) << 0) +#define DSIM_PHYCTRL_B_DPHYCTL_VREG_LP BIT(30) +#define DSIM_PHYCTRL_B_DPHYCTL_SLEW_UP BIT(14) + +/* DSIM_PHYTIMING */ +#define DSIM_PHYTIMING_LPX(x) ((x) << 8) +#define DSIM_PHYTIMING_HS_EXIT(x) ((x) << 0) + +/* DSIM_PHYTIMING1 */ +#define DSIM_PHYTIMING1_CLK_PREPARE(x) ((x) << 24) +#define DSIM_PHYTIMING1_CLK_ZERO(x) ((x) << 16) +#define DSIM_PHYTIMING1_CLK_POST(x) ((x) << 8) +#define DSIM_PHYTIMING1_CLK_TRAIL(x) ((x) << 0) + +/* DSIM_PHYTIMING2 */ +#define DSIM_PHYTIMING2_HS_PREPARE(x) ((x) << 16) +#define DSIM_PHYTIMING2_HS_ZERO(x) ((x) << 8) +#define DSIM_PHYTIMING2_HS_TRAIL(x) ((x) << 0) + +#define DSI_MAX_BUS_WIDTH 4 +#define DSI_NUM_VIRTUAL_CHANNELS 4 +#define DSI_TX_FIFO_SIZE 2048 +#define DSI_RX_FIFO_SIZE 256 +#define DSI_XFER_TIMEOUT_MS 100 +#define DSI_RX_FIFO_EMPTY 0x30800002 + +struct samsung_dsim_driver_data { + const unsigned int *reg_ofs; + unsigned int plltmr_reg; + unsigned int has_freqband:1; + unsigned int has_clklane_stop:1; + unsigned int has_broken_fifoctrl_emptyhdr:1; + unsigned int num_clks; + unsigned int min_freq; + unsigned int max_freq; + unsigned int wait_for_reset; + unsigned int num_bits_resol; + unsigned int pll_p_offset; + const unsigned int *reg_values; + unsigned int pll_fin_min; + unsigned int pll_fin_max; + u16 m_min; + u16 m_max; +}; + +enum reg_idx { + DSIM_STATUS_REG, /* Status register */ + DSIM_RGB_STATUS_REG, /* RGB status register */ + DSIM_SWRST_REG, /* Software reset register */ + DSIM_CLKCTRL_REG, /* Clock control register */ + DSIM_TIMEOUT_REG, /* Time out register */ + DSIM_CONFIG_REG, /* Configuration register */ + DSIM_ESCMODE_REG, /* Escape mode register */ + DSIM_MDRESOL_REG, + DSIM_MVPORCH_REG, /* Main display Vporch register */ + DSIM_MHPORCH_REG, /* Main display Hporch register */ + DSIM_MSYNC_REG, /* Main display sync area register */ + DSIM_INTSRC_REG, /* Interrupt source register */ + DSIM_INTMSK_REG, /* Interrupt mask register */ + DSIM_PKTHDR_REG, /* Packet Header FIFO register */ + DSIM_PAYLOAD_REG, /* Payload FIFO register */ + DSIM_RXFIFO_REG, /* Read FIFO register */ + DSIM_FIFOCTRL_REG, /* FIFO status and control register */ + DSIM_PLLCTRL_REG, /* PLL control register */ + DSIM_PHYCTRL_REG, + DSIM_PHYTIMING_REG, + DSIM_PHYTIMING1_REG, + DSIM_PHYTIMING2_REG, + NUM_REGS +}; + +static const unsigned int exynos_reg_ofs[] = { + [DSIM_STATUS_REG] = 0x00, + [DSIM_SWRST_REG] = 0x04, + [DSIM_CLKCTRL_REG] = 0x08, + [DSIM_TIMEOUT_REG] = 0x0c, + [DSIM_CONFIG_REG] = 0x10, + [DSIM_ESCMODE_REG] = 0x14, + [DSIM_MDRESOL_REG] = 0x18, + [DSIM_MVPORCH_REG] = 0x1c, + [DSIM_MHPORCH_REG] = 0x20, + [DSIM_MSYNC_REG] = 0x24, + [DSIM_INTSRC_REG] = 0x2c, + [DSIM_INTMSK_REG] = 0x30, + [DSIM_PKTHDR_REG] = 0x34, + [DSIM_PAYLOAD_REG] = 0x38, + [DSIM_RXFIFO_REG] = 0x3c, + [DSIM_FIFOCTRL_REG] = 0x44, + [DSIM_PLLCTRL_REG] = 0x4c, + [DSIM_PHYCTRL_REG] = 0x5c, + [DSIM_PHYTIMING_REG] = 0x64, + [DSIM_PHYTIMING1_REG] = 0x68, + [DSIM_PHYTIMING2_REG] = 0x6c, +}; + +static const unsigned int exynos5433_reg_ofs[] = { + [DSIM_STATUS_REG] = 0x04, + [DSIM_RGB_STATUS_REG] = 0x08, + [DSIM_SWRST_REG] = 0x0C, + [DSIM_CLKCTRL_REG] = 0x10, + [DSIM_TIMEOUT_REG] = 0x14, + [DSIM_CONFIG_REG] = 0x18, + [DSIM_ESCMODE_REG] = 0x1C, + [DSIM_MDRESOL_REG] = 0x20, + [DSIM_MVPORCH_REG] = 0x24, + [DSIM_MHPORCH_REG] = 0x28, + [DSIM_MSYNC_REG] = 0x2C, + [DSIM_INTSRC_REG] = 0x34, + [DSIM_INTMSK_REG] = 0x38, + [DSIM_PKTHDR_REG] = 0x3C, + [DSIM_PAYLOAD_REG] = 0x40, + [DSIM_RXFIFO_REG] = 0x44, + [DSIM_FIFOCTRL_REG] = 0x4C, + [DSIM_PLLCTRL_REG] = 0x94, + [DSIM_PHYCTRL_REG] = 0xA4, + [DSIM_PHYTIMING_REG] = 0xB4, + [DSIM_PHYTIMING1_REG] = 0xB8, + [DSIM_PHYTIMING2_REG] = 0xBC, +}; + +enum reg_value_idx { + RESET_TYPE, + PLL_TIMER, + STOP_STATE_CNT, + PHYCTRL_ULPS_EXIT, + PHYCTRL_VREG_LP, + PHYCTRL_SLEW_UP, + PHYTIMING_LPX, + PHYTIMING_HS_EXIT, + PHYTIMING_CLK_PREPARE, + PHYTIMING_CLK_ZERO, + PHYTIMING_CLK_POST, + PHYTIMING_CLK_TRAIL, + PHYTIMING_HS_PREPARE, + PHYTIMING_HS_ZERO, + PHYTIMING_HS_TRAIL +}; + +static const unsigned int reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = DSIM_PHYCTRL_ULPS_EXIT(0x0af), + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x27), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x09), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b), +}; + +static const unsigned int exynos5422_reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = DSIM_PHYCTRL_ULPS_EXIT(0xaf), + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x08), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0d), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x09), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x30), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0e), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x0a), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x0c), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x11), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0d), +}; + +static const unsigned int exynos5433_reg_values[] = { + [RESET_TYPE] = DSIM_FUNCRST, + [PLL_TIMER] = 22200, + [STOP_STATE_CNT] = 0xa, + [PHYCTRL_ULPS_EXIT] = DSIM_PHYCTRL_ULPS_EXIT(0x190), + [PHYCTRL_VREG_LP] = DSIM_PHYCTRL_B_DPHYCTL_VREG_LP, + [PHYCTRL_SLEW_UP] = DSIM_PHYCTRL_B_DPHYCTL_SLEW_UP, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x07), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0c), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x09), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x2d), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0e), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x09), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x0b), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x10), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c), +}; + +static const unsigned int imx8mm_dsim_reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = DSIM_PHYCTRL_ULPS_EXIT(0xaf), + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b), +}; + +static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { + .reg_ofs = exynos_reg_ofs, + .plltmr_reg = 0x50, + .has_freqband = 1, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 1000, + .wait_for_reset = 1, + .num_bits_resol = 11, + .pll_p_offset = 13, + .reg_values = reg_values, + .pll_fin_min = 6, + .pll_fin_max = 12, + .m_min = 41, + .m_max = 125, + .min_freq = 500, + .has_broken_fifoctrl_emptyhdr = 1, +}; + +static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { + .reg_ofs = exynos_reg_ofs, + .plltmr_reg = 0x50, + .has_freqband = 1, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 1000, + .wait_for_reset = 1, + .num_bits_resol = 11, + .pll_p_offset = 13, + .reg_values = reg_values, + .pll_fin_min = 6, + .pll_fin_max = 12, + .m_min = 41, + .m_max = 125, + .min_freq = 500, + .has_broken_fifoctrl_emptyhdr = 1, +}; + +static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { + .reg_ofs = exynos_reg_ofs, + .plltmr_reg = 0x58, + .num_clks = 2, + .max_freq = 1000, + .wait_for_reset = 1, + .num_bits_resol = 11, + .pll_p_offset = 13, + .reg_values = reg_values, + .pll_fin_min = 6, + .pll_fin_max = 12, + .m_min = 41, + .m_max = 125, + .min_freq = 500, +}; + +static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 5, + .max_freq = 1500, + .wait_for_reset = 0, + .num_bits_resol = 12, + .pll_p_offset = 13, + .reg_values = exynos5433_reg_values, + .pll_fin_min = 6, + .pll_fin_max = 12, + .m_min = 41, + .m_max = 125, + .min_freq = 500, +}; + +static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 1500, + .wait_for_reset = 1, + .num_bits_resol = 12, + .pll_p_offset = 13, + .reg_values = exynos5422_reg_values, + .pll_fin_min = 6, + .pll_fin_max = 12, + .m_min = 41, + .m_max = 125, + .min_freq = 500, +}; + +static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 2100, + .wait_for_reset = 0, + .num_bits_resol = 12, + /* + * Unlike Exynos, PLL_P(PMS_P) offset 14 is used in i.MX8M Mini/Nano/Plus + * downstream driver - drivers/gpu/drm/bridge/sec-dsim.c + */ + .pll_p_offset = 14, + .reg_values = imx8mm_dsim_reg_values, + .pll_fin_min = 2, + .pll_fin_max = 30, + .m_min = 64, + .m_max = 1023, + .min_freq = 1050, +}; + +static const struct samsung_dsim_driver_data * +samsung_dsim_types[DSIM_TYPE_COUNT] = { + [DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, + [DSIM_TYPE_EXYNOS4210] = &exynos4_dsi_driver_data, + [DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, + [DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, + [DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, + [DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, + [DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, +}; + +/* DSIM PLL configuration from spec: + * + * Fout(DDR) = (M * Fin) / (P * 2^S), so Fout / Fin = M / (P * 2^S) + * Fin_pll = Fin / P (6 ~ 12 MHz) + * S: [2:0], M: [12:3], P: [18:13], so + * TODO: 'S' is in [0 ~ 3], 'M' is in, 'P' is in [1 ~ 33] + * + */ + +struct samsung_dsi { + void __iomem *reg_base; + struct clk sclk_mipi; + const struct samsung_dsim_driver_data *driver_data; + + /* kHz clocks */ + u64 pix_clk; + u64 bit_clk; + u64 hs_clock; + + unsigned int lanes; + unsigned int channel; /* virtual channel */ + enum mipi_dsi_pixel_format format; + unsigned long mode_flags; + unsigned int pms; + + struct mipi_dsi_device *device; + u32 max_data_lanes; + + struct mipi_dsi_host dsi_host; + struct display_timing timings; +}; + +static inline void samsung_dsim_write(struct samsung_dsi *dsi, + enum reg_idx idx, u32 val) +{ + writel(val, dsi->reg_base + dsi->driver_data->reg_ofs[idx]); +} + +static inline u32 samsung_dsim_read(struct samsung_dsi *dsi, enum reg_idx idx) +{ + return readl(dsi->reg_base + dsi->driver_data->reg_ofs[idx]); +} + +static int samsung_dsi_wait_for_pkt_done(struct samsung_dsi *dsim, unsigned long timeout) +{ + u32 intsrc; + + do { + intsrc = samsung_dsim_read(dsim, DSIM_INTSRC_REG); + if (intsrc & INTSRC_SFRPLFIFOEMPTY) { + samsung_dsim_write(dsim, DSIM_INTSRC_REG, INTSRC_SFRPLFIFOEMPTY); + return 0; + } + + udelay(1); + } while (--timeout); + + return -ETIMEDOUT; +} + +static int samsung_dsi_wait_for_hdr_done(struct samsung_dsi *dsim, unsigned long timeout) +{ + u32 intsrc; + + do { + intsrc = samsung_dsim_read(dsim, DSIM_INTSRC_REG); + if (intsrc & INTSRC_SFRPHFIFOEMPTY) { + samsung_dsim_write(dsim, DSIM_INTSRC_REG, INTSRC_SFRPHFIFOEMPTY); + return 0; + } + + udelay(1); + } while (--timeout); + + return -ETIMEDOUT; +} + +static int samsung_dsi_wait_for_rx_done(struct samsung_dsi *dsim, + unsigned long timeout) +{ + u32 intsrc; + + do { + intsrc = samsung_dsim_read(dsim, DSIM_INTSRC_REG); + if (intsrc & INTSRC_RXDATDONE) { + samsung_dsim_write(dsim, DSIM_INTSRC_REG, INTSRC_RXDATDONE); + return 0; + } + + udelay(1); + } while (--timeout); + + return -ETIMEDOUT; +} + +static int samsung_dsi_wait_pll_stable(struct samsung_dsi *dsim) +{ + u32 status; + ulong start; + + start = get_timer(0); /* Get current timestamp */ + + do { + status = samsung_dsim_read(dsim, DSIM_STATUS_REG); + if (status & DSIM_PLL_STABLE) + return 0; + } while (get_timer(0) < (start + 100)); /* Wait 100ms */ + + return -ETIMEDOUT; +} + +static unsigned long samsung_dsim_pll_find_pms(struct samsung_dsi *dsi, + unsigned long fin, + unsigned long fout, + u8 *p, u16 *m, u8 *s) +{ + const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; + unsigned long best_freq = 0; + u32 min_delta = 0xffffffff; + u8 p_min, p_max; + u8 _p, best_p; + u16 _m, best_m; + u8 _s, best_s; + + p_min = DIV_ROUND_UP(fin, (MHZ(12))); + p_max = fin / (MHZ(6)); + + for (_p = p_min; _p <= p_max; ++_p) { + for (_s = 0; _s <= 5; ++_s) { + u64 tmp; + u32 delta; + + tmp = (u64)fout * (_p << _s); + do_div(tmp, fin); + _m = tmp; + if (_m < driver_data->m_min || _m > driver_data->m_max) + continue; + + tmp = (u64)_m * fin; + do_div(tmp, _p); + if (tmp < driver_data->min_freq * MHZ(1) || + tmp > driver_data->max_freq * MHZ(1)) + continue; + + tmp = (u64)_m * fin; + do_div(tmp, _p << _s); + + delta = abs(fout - tmp); + if (delta < min_delta) { + best_p = _p; + best_m = _m; + best_s = _s; + min_delta = delta; + best_freq = tmp; + } + } + } + + if (best_freq) { + *p = best_p; + *m = best_m; + *s = best_s; + } + + return best_freq; +} + +static int samsung_dsi_config_pll(struct samsung_dsi *dsim) +{ + int ret; + u32 pllctrl = 0, status, data_lanes_en, stop; + + writel(dsim->driver_data->reg_values[PLL_TIMER], + dsim->reg_base + dsim->driver_data->plltmr_reg); + + /* TODO: config dp/dn swap if requires */ + + pllctrl |= PLLCTRL_SET_PMS(dsim->pms) | PLLCTRL_PLLEN; + samsung_dsim_write(dsim, DSIM_PLLCTRL_REG, pllctrl); + + ret = samsung_dsi_wait_pll_stable(dsim); + if (ret) { + log_err("wait for pll stable time out\n"); + return ret; + } + + /* wait for clk & data lanes to go to stop state */ + mdelay(1); + + data_lanes_en = (0x1 << dsim->lanes) - 1; + status = samsung_dsim_read(dsim, DSIM_STATUS_REG); + if (!(status & DSIM_STOP_STATE_CLK)) { + log_err("clock is not in stop state\n"); + return -EBUSY; + } + + stop = DSIM_STOP_STATE_DAT(status); + if ((stop & data_lanes_en) != data_lanes_en) { + log_err("one or more data lanes is not in stop state\n"); + return -EBUSY; + } + + return 0; +} + +static void samsung_dsi_set_main_mode(struct samsung_dsi *dsim) +{ + u32 bpp, hfp_wc, hbp_wc, hsa_wc, wc; + u32 mdresol = 0, mvporch = 0, mhporch = 0, msync = 0; + struct display_timing *timings = &dsim->timings; + unsigned int num_bits_resol = dsim->driver_data->num_bits_resol; + + mdresol |= DSIM_MAIN_VRESOL(timings->vactive.typ, num_bits_resol) | + DSIM_MAIN_HRESOL(timings->hactive.typ, num_bits_resol); + samsung_dsim_write(dsim, DSIM_MDRESOL_REG, mdresol); + + mvporch |= MVPORCH_SET_MAINVBP(timings->vback_porch.typ) | + MVPORCH_SET_STABLEVFP(timings->vfront_porch.typ) | + MVPORCH_SET_CMDALLOW(0x0); + samsung_dsim_write(dsim, DSIM_MVPORCH_REG, mvporch); + + bpp = mipi_dsi_pixel_format_to_bpp(dsim->format); + + wc = DIV_ROUND_UP(timings->hfront_porch.typ * (bpp >> 3), dsim->lanes); + hfp_wc = wc > MIPI_HFP_PKT_OVERHEAD ? + wc - MIPI_HFP_PKT_OVERHEAD : timings->hfront_porch.typ; + wc = DIV_ROUND_UP(timings->hback_porch.typ * (bpp >> 3), dsim->lanes); + hbp_wc = wc > MIPI_HBP_PKT_OVERHEAD ? + wc - MIPI_HBP_PKT_OVERHEAD : timings->hback_porch.typ; + + mhporch |= MHPORCH_SET_MAINHFP(hfp_wc) | + MHPORCH_SET_MAINHBP(hbp_wc); + + samsung_dsim_write(dsim, DSIM_MHPORCH_REG, mhporch); + + wc = DIV_ROUND_UP(timings->hsync_len.typ * (bpp >> 3), dsim->lanes); + hsa_wc = wc > MIPI_HSA_PKT_OVERHEAD ? + wc - MIPI_HSA_PKT_OVERHEAD : timings->hsync_len.typ; + + msync |= MSYNC_SET_MAINVSA(timings->vsync_len.typ) | + MSYNC_SET_MAINHSA(hsa_wc); + + debug("hfp_wc %u hbp_wc %u hsa_wc %u\n", hfp_wc, hbp_wc, hsa_wc); + + samsung_dsim_write(dsim, DSIM_MSYNC_REG, msync); +} + +static void samsung_dsi_config_dpi(struct samsung_dsi *dsim) +{ + u32 config = 0, rgb_status = 0, data_lanes_en; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO) + rgb_status &= ~RGB_STATUS_CMDMODE_INSEL; + else + rgb_status |= RGB_STATUS_CMDMODE_INSEL; + + samsung_dsim_write(dsim, DSIM_RGB_STATUS_REG, rgb_status); + + if (dsim->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) { + config |= DSIM_CLKLANE_STOP; + config |= DSIM_NON_CONTINUOUS_CLKLANE; + } + + if (dsim->mode_flags & MIPI_DSI_MODE_VSYNC_FLUSH) + config |= DSIM_MFLUSH_VS; + + /* disable EoT packets in HS mode */ + if (dsim->mode_flags & MIPI_DSI_MODE_EOT_PACKET) + config |= DSIM_EOT_DISABLE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO) { + config |= DSIM_VIDEO_MODE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) + config |= DSIM_BURST_MODE; + + else if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE) + config |= DSIM_SYNC_INFORM; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_AUTO_VERT) + config |= DSIM_AUTO_MODE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_HSE) + config |= DSIM_HSE_DISABLE_MODE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_HFP) + config |= DSIM_HFP_DISABLE_MODE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_HBP) + config |= DSIM_HBP_DISABLE_MODE; + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO_HSA) + config |= DSIM_HSA_DISABLE_MODE; + } + + config |= DSIM_MAIN_VC(dsim->channel); + + if (dsim->mode_flags & MIPI_DSI_MODE_VIDEO) { + switch (dsim->format) { + case MIPI_DSI_FMT_RGB888: + config |= DSIM_MAIN_PIX_FORMAT_RGB888; + break; + case MIPI_DSI_FMT_RGB666: + config |= DSIM_MAIN_PIX_FORMAT_RGB666; + break; + case MIPI_DSI_FMT_RGB666_PACKED: + config |= DSIM_MAIN_PIX_FORMAT_RGB666_P; + break; + case MIPI_DSI_FMT_RGB565: + config |= DSIM_MAIN_PIX_FORMAT_RGB565; + break; + default: + log_err("invalid pixel format\n"); + break; + } + } + + /* config data lanes number and enable lanes */ + data_lanes_en = BIT(dsim->lanes) - 1; + config |= (DSIM_NUM_OF_DATA_LANE(dsim->lanes - 1) | DSIM_LANE_EN_CLK | + DSIM_LANE_EN(data_lanes_en)); + + debug("DSIM config 0x%x\n", config); + + samsung_dsim_write(dsim, DSIM_CONFIG_REG, config); +} + +static void samsung_dsi_config_cmd_lpm(struct samsung_dsi *dsim, bool enable) +{ + u32 escmode; + + escmode = samsung_dsim_read(dsim, DSIM_ESCMODE_REG); + + if (enable) + escmode |= ESCMODE_CMDLPDT; + else + escmode &= ~ESCMODE_CMDLPDT; + + samsung_dsim_write(dsim, DSIM_ESCMODE_REG, escmode); +} + +static void samsung_dsi_config_dphy(struct samsung_dsi *dsim) +{ + const struct samsung_dsim_driver_data *driver_data = dsim->driver_data; + const unsigned int *reg_values = driver_data->reg_values; + u32 reg; + struct phy_configure_opts_mipi_dphy cfg; + int clk_prepare, lpx, clk_zero, clk_post, clk_trail; + int hs_exit, hs_prepare, hs_zero, hs_trail; + unsigned long long byte_clock = dsim->hs_clock / 8; + + if (driver_data->has_freqband) + return; + + phy_mipi_dphy_get_default_config_for_hsclk(dsim->hs_clock, dsim->lanes, &cfg); + + /* + * TODO: + * The tech Applications Processor manuals for i.MX8M Mini, Nano, + * and Plus don't state what the definition of the PHYTIMING + * bits are beyond their address and bit position. + * After reviewing NXP's downstream code, it appears + * that the various PHYTIMING registers take the number + * of cycles and use various dividers on them. This + * calculation does not result in an exact match to the + * downstream code, but it is very close to the values + * generated by their lookup table, and it appears + * to sync at a variety of resolutions. If someone + * can get a more accurate mathematical equation needed + * for these registers, this should be updated. + */ + + lpx = PS_TO_CYCLE(cfg.lpx, byte_clock); + hs_exit = PS_TO_CYCLE(cfg.hs_exit, byte_clock); + clk_prepare = PS_TO_CYCLE(cfg.clk_prepare, byte_clock); + clk_zero = PS_TO_CYCLE(cfg.clk_zero, byte_clock); + clk_post = PS_TO_CYCLE(cfg.clk_post, byte_clock); + clk_trail = PS_TO_CYCLE(cfg.clk_trail, byte_clock); + hs_prepare = PS_TO_CYCLE(cfg.hs_prepare, byte_clock); + hs_zero = PS_TO_CYCLE(cfg.hs_zero, byte_clock); + hs_trail = PS_TO_CYCLE(cfg.hs_trail, byte_clock); + + /* B D-PHY: D-PHY Master & Slave Analog Block control */ + reg = reg_values[PHYCTRL_ULPS_EXIT] | reg_values[PHYCTRL_VREG_LP] | + reg_values[PHYCTRL_SLEW_UP]; + + samsung_dsim_write(dsim, DSIM_PHYCTRL_REG, reg); + + /* + * T LPX: Transmitted length of any Low-Power state period + * T HS-EXIT: Time that the transmitter drives LP-11 following a HS + * burst + */ + + reg = DSIM_PHYTIMING_LPX(lpx) | DSIM_PHYTIMING_HS_EXIT(hs_exit); + samsung_dsim_write(dsim, DSIM_PHYTIMING_REG, reg); + + /* + * T CLK-PREPARE: Time that the transmitter drives the Clock Lane LP-00 + * Line state immediately before the HS-0 Line state starting the + * HS transmission + * T CLK-ZERO: Time that the transmitter drives the HS-0 state prior to + * transmitting the Clock. + * T CLK_POST: Time that the transmitter continues to send HS clock + * after the last associated Data Lane has transitioned to LP Mode + * Interval is defined as the period from the end of T HS-TRAIL to + * the beginning of T CLK-TRAIL + * T CLK-TRAIL: Time that the transmitter drives the HS-0 state after + * the last payload clock bit of a HS transmission burst + */ + + reg = DSIM_PHYTIMING1_CLK_PREPARE(clk_prepare) | + DSIM_PHYTIMING1_CLK_ZERO(clk_zero) | + DSIM_PHYTIMING1_CLK_POST(clk_post) | + DSIM_PHYTIMING1_CLK_TRAIL(clk_trail); + + samsung_dsim_write(dsim, DSIM_PHYTIMING1_REG, reg); + + /* + * T HS-PREPARE: Time that the transmitter drives the Data Lane LP-00 + * Line state immediately before the HS-0 Line state starting the + * HS transmission + * T HS-ZERO: Time that the transmitter drives the HS-0 state prior to + * transmitting the Sync sequence. + * T HS-TRAIL: Time that the transmitter drives the flipped differential + * state after last payload data bit of a HS transmission burst + */ + + reg = DSIM_PHYTIMING2_HS_PREPARE(hs_prepare) | + DSIM_PHYTIMING2_HS_ZERO(hs_zero) | + DSIM_PHYTIMING2_HS_TRAIL(hs_trail); + + samsung_dsim_write(dsim, DSIM_PHYTIMING2_REG, reg); + + reg = DSIM_BTA_TIMEOUT(0xff) | DSIM_LPDR_TIMEOUT(0xffff); + + samsung_dsim_write(dsim, DSIM_TIMEOUT_REG, reg); +} + +static void samsung_dsim_write_pl_to_sfr_fifo(struct samsung_dsi *dsim, + const void *payload, + size_t length) +{ + u32 pl_data; + + if (!length) + return; + + while (length >= 4) { + pl_data = get_unaligned_le32(payload); + samsung_dsim_write(dsim, DSIM_PAYLOAD_REG, pl_data); + payload += 4; + length -= 4; + } + + pl_data = 0; + switch (length) { + case 3: + pl_data |= ((u8 *)payload)[2] << 16; + case 2: + pl_data |= ((u8 *)payload)[1] << 8; + case 1: + pl_data |= ((u8 *)payload)[0]; + samsung_dsim_write(dsim, DSIM_PAYLOAD_REG, pl_data); + break; + } +} + +static void samsung_dsim_write_ph_to_sfr_fifo(struct samsung_dsi *dsim, + void *header, bool use_lpm) +{ + u32 pkthdr; + + pkthdr = PKTHDR_SET_DATA1(((u8 *)header)[2]) | /* WC MSB */ + PKTHDR_SET_DATA0(((u8 *)header)[1]) | /* WC LSB */ + PKTHDR_SET_DI(((u8 *)header)[0]); /* Data ID */ + + samsung_dsim_write(dsim, DSIM_PKTHDR_REG, pkthdr); +} + +static int samsung_dsim_read_pl_from_sfr_fifo(struct samsung_dsi *dsim, + void *payload, size_t length) +{ + u8 data_type; + u16 word_count = 0; + u32 fifoctrl, ph, pl; + + fifoctrl = samsung_dsim_read(dsim, DSIM_FIFOCTRL_REG); + + if (WARN_ON(fifoctrl & FIFOCTRL_EMPTYRX)) + return -EINVAL; + + ph = samsung_dsim_read(dsim, DSIM_RXFIFO_REG); + data_type = PKTHDR_GET_DT(ph); + switch (data_type) { + case MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT: + dev_err(dsim->device->dev, "peripheral report error: (0-7)%x, (8-15)%x\n", + PKTHDR_GET_DATA0(ph), PKTHDR_GET_DATA1(ph)); + return -EPROTO; + case MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE: + case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE: + if (!WARN_ON(length < 2)) { + ((u8 *)payload)[1] = PKTHDR_GET_DATA1(ph); + word_count++; + } + fallthrough; + case MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE: + case MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE: + ((u8 *)payload)[0] = PKTHDR_GET_DATA0(ph); + word_count++; + length = word_count; + break; + case MIPI_DSI_RX_DCS_LONG_READ_RESPONSE: + case MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE: + word_count = PKTHDR_GET_WC(ph); + if (word_count > length) { + dev_err(dsim->device->dev, "invalid receive buffer length\n"); + return -EINVAL; + } + + length = word_count; + + while (word_count >= 4) { + pl = samsung_dsim_read(dsim, DSIM_RXFIFO_REG); + ((u8 *)payload)[0] = pl & 0xff; + ((u8 *)payload)[1] = (pl >> 8) & 0xff; + ((u8 *)payload)[2] = (pl >> 16) & 0xff; + ((u8 *)payload)[3] = (pl >> 24) & 0xff; + payload += 4; + word_count -= 4; + } + + if (word_count > 0) { + pl = samsung_dsim_read(dsim, DSIM_RXFIFO_REG); + + switch (word_count) { + case 3: + ((u8 *)payload)[2] = (pl >> 16) & 0xff; + case 2: + ((u8 *)payload)[1] = (pl >> 8) & 0xff; + case 1: + ((u8 *)payload)[0] = pl & 0xff; + break; + } + } + + break; + default: + return -EINVAL; + } + + return length; +} + +static void samsung_dsi_init_fifo_pointers(struct samsung_dsi *dsim) +{ + u32 fifoctrl, fifo_ptrs; + + fifoctrl = samsung_dsim_read(dsim, DSIM_FIFOCTRL_REG); + + fifo_ptrs = FIFOCTRL_NINITRX | + FIFOCTRL_NINITSFR | + FIFOCTRL_NINITI80 | + FIFOCTRL_NINITSUB | + FIFOCTRL_NINITMAIN; + + fifoctrl &= ~fifo_ptrs; + samsung_dsim_write(dsim, DSIM_FIFOCTRL_REG, fifoctrl); + udelay(500); + + fifoctrl |= fifo_ptrs; + samsung_dsim_write(dsim, DSIM_FIFOCTRL_REG, fifoctrl); + udelay(500); +} + +static void samsung_dsi_config_clkctrl(struct samsung_dsi *dsim) +{ + u32 clkctrl = 0, data_lanes_en; + u64 byte_clk, esc_prescaler; + + clkctrl |= DSIM_TX_REQUEST_HSCLK; + + /* using 1.5Gbps PHY */ + clkctrl |= CLKCTRL_DPHY_SEL_1P5G; + clkctrl |= DSIM_ESC_CLKEN; + clkctrl &= ~CLKCTRL_PLLBYPASS; + clkctrl |= CLKCTRL_BYTECLKSRC_DPHY_PLL; + clkctrl |= DSIM_BYTE_CLKEN; + + data_lanes_en = (0x1 << dsim->lanes) - 1; + clkctrl |= CLKCTRL_SET_LANEESCCLKEN(0x1 | data_lanes_en << 1); + + /* calculate esc prescaler from byte clock: + * EscClk = ByteClk / EscPrescaler; + */ + byte_clk = dsim->bit_clk >> 3; + esc_prescaler = DIV_ROUND_UP_ULL(byte_clk, MAX_ESC_CLK_FREQ); + + clkctrl |= CLKCTRL_SET_ESCPRESCALER(esc_prescaler); + + debug("DSIM clkctrl 0x%x\n", clkctrl); + + samsung_dsim_write(dsim, DSIM_CLKCTRL_REG, clkctrl); +} + +static void samsung_dsi_set_standby(struct samsung_dsi *dsim, bool standby) +{ + u32 mdresol = 0; + + mdresol = samsung_dsim_read(dsim, DSIM_MDRESOL_REG); + + if (standby) + mdresol |= DSIM_MAIN_STAND_BY; + else + mdresol &= ~DSIM_MAIN_STAND_BY; + + samsung_dsim_write(dsim, DSIM_MDRESOL_REG, mdresol); +} + +static void samsung_dsi_disable_clock(struct samsung_dsi *dsim) +{ + u32 reg; + + reg = samsung_dsim_read(dsim, DSIM_CLKCTRL_REG); + reg &= ~(DSIM_LANE_ESC_CLK_EN_CLK | DSIM_LANE_ESC_CLK_EN_DATA_MASK | + DSIM_ESC_CLKEN | DSIM_BYTE_CLKEN); + samsung_dsim_write(dsim, DSIM_CLKCTRL_REG, reg); + + reg = samsung_dsim_read(dsim, DSIM_PLLCTRL_REG); + reg &= ~DSIM_PLL_EN; + samsung_dsim_write(dsim, DSIM_PLLCTRL_REG, reg); +} + +static inline struct samsung_dsi *host_to_dsi(struct mipi_dsi_host *host) +{ + return container_of(host, struct samsung_dsi, dsi_host); +} + +static int samsung_dsi_bridge_clk_set(struct samsung_dsi *dsim_host) +{ + int bpp; + unsigned long pix_clk, bit_clk; + unsigned long fin, fout; + u8 p, s; + u16 m; + + bpp = mipi_dsi_pixel_format_to_bpp(dsim_host->format); + if (bpp < 0) + return -EINVAL; + + pix_clk = dsim_host->timings.pixelclock.typ; + bit_clk = DIV_ROUND_UP_ULL(pix_clk * bpp, dsim_host->lanes); + + dsim_host->pix_clk = DIV_ROUND_UP_ULL(pix_clk, 1000); + dsim_host->bit_clk = DIV_ROUND_UP_ULL(bit_clk, 1000); + + fout = dsim_host->bit_clk; + fin = clk_get_rate(&dsim_host->sclk_mipi); + if (fin == 0) { + log_err("Error: DSI PHY reference clock is disabled\n"); + return -EINVAL; + } + + fout = samsung_dsim_pll_find_pms(dsim_host, fin, bit_clk, &p, &m, &s); + if (!fout) { + log_err("failed to find PLL PMS for requested frequency\n"); + return -EINVAL; + } + dsim_host->pms = PLLCTRL_SET_P(p) | PLLCTRL_SET_M(m) | + PLLCTRL_SET_S(s); + dsim_host->hs_clock = fout; + + debug("%s: bitclk %llu pixclk %llu pms 0x%x\n", __func__, + dsim_host->bit_clk, dsim_host->pix_clk, dsim_host->pms); + + return 0; +} + +static int samsung_dsi_bridge_prepare(struct samsung_dsi *dsim_host) +{ + int ret; + + /* At this moment, the dsim bridge's preceding encoder has + * already been enabled. So the dsim can be configed here + */ + + /* config main display mode */ + samsung_dsi_set_main_mode(dsim_host); + + /* config dsim dpi */ + samsung_dsi_config_dpi(dsim_host); + + /* config dsim pll */ + ret = samsung_dsi_config_pll(dsim_host); + if (ret) { + log_err("dsim pll config failed: %d\n", ret); + return ret; + } + + /* config dphy timings */ + samsung_dsi_config_dphy(dsim_host); + + samsung_dsi_init_fifo_pointers(dsim_host); + + /* config esc clock, byte clock and etc */ + samsung_dsi_config_clkctrl(dsim_host); + + return 0; +} + +static int samsung_dsi_host_attach(struct mipi_dsi_host *host, + struct mipi_dsi_device *device) +{ + struct samsung_dsi *dsi = host_to_dsi(host); + + if (!device->lanes || device->lanes > dsi->max_data_lanes) { + log_err("invalid data lanes number\n"); + return -EINVAL; + } + + if (!(device->mode_flags & MIPI_DSI_MODE_VIDEO) || + !((device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) || + (device->mode_flags & MIPI_DSI_MODE_VIDEO_SYNC_PULSE))) { + log_err("unsupported dsi mode\n"); + return -EINVAL; + } + + if (device->format != MIPI_DSI_FMT_RGB888 && + device->format != MIPI_DSI_FMT_RGB565 && + device->format != MIPI_DSI_FMT_RGB666 && + device->format != MIPI_DSI_FMT_RGB666_PACKED) { + log_err("unsupported pixel format: %#x\n", device->format); + return -EINVAL; + } + + dsi->lanes = device->lanes; + dsi->channel = device->channel; + dsi->format = device->format; + dsi->mode_flags = device->mode_flags; + + debug("lanes %u, channel %u, format 0x%x, mode_flags 0x%lx\n", dsi->lanes, + dsi->channel, dsi->format, dsi->mode_flags); + + samsung_dsi_bridge_clk_set(dsi); + samsung_dsi_bridge_prepare(dsi); + + return 0; +} + +static ssize_t samsung_dsi_host_transfer(struct mipi_dsi_host *host, + const struct mipi_dsi_msg *msg) +{ + struct samsung_dsi *dsim = host_to_dsi(host); + int ret, nb_bytes; + bool use_lpm; + struct mipi_dsi_packet packet; + + ret = mipi_dsi_create_packet(&packet, msg); + if (ret) { + dev_err(dsim->device->dev, "failed to create dsi packet: %d\n", ret); + return ret; + } + + /* config LPM for CMD TX */ + use_lpm = msg->flags & MIPI_DSI_MSG_USE_LPM ? true : false; + samsung_dsi_config_cmd_lpm(dsim, use_lpm); + + if (packet.payload_length) { /* Long Packet case */ + /* write packet payload */ + samsung_dsim_write_pl_to_sfr_fifo(dsim, packet.payload, + packet.payload_length); + + /* write packet header */ + samsung_dsim_write_ph_to_sfr_fifo(dsim, packet.header, use_lpm); + + ret = samsung_dsi_wait_for_pkt_done(dsim, MIPI_FIFO_TIMEOUT); + if (ret) { + dev_err(dsim->device->dev, "wait tx done timeout!\n"); + return -EBUSY; + } + } else { + /* write packet header */ + samsung_dsim_write_ph_to_sfr_fifo(dsim, packet.header, use_lpm); + + ret = samsung_dsi_wait_for_hdr_done(dsim, MIPI_FIFO_TIMEOUT); + if (ret) { + dev_err(dsim->device->dev, "wait pkthdr tx done time out\n"); + return -EBUSY; + } + } + + /* read packet payload */ + if (unlikely(msg->rx_buf)) { + ret = samsung_dsi_wait_for_rx_done(dsim, MIPI_FIFO_TIMEOUT); + if (ret) { + dev_err(dsim->device->dev, "wait rx done time out\n"); + return -EBUSY; + } + + ret = samsung_dsim_read_pl_from_sfr_fifo(dsim, msg->rx_buf, + msg->rx_len); + if (ret < 0) + return ret; + nb_bytes = msg->rx_len; + } else { + nb_bytes = packet.size; + } + + return nb_bytes; +} + +static const struct mipi_dsi_host_ops samsung_dsi_host_ops = { + .attach = samsung_dsi_host_attach, + .transfer = samsung_dsi_host_transfer, +}; + +static int samsung_dsi_init(struct udevice *dev, + struct mipi_dsi_device *device, + struct display_timing *timings, + unsigned int max_data_lanes, + const struct mipi_dsi_phy_ops *phy_ops) +{ + struct samsung_dsi *dsi = dev_get_priv(dev); + struct udevice *dsi_bridge = device->dev; + enum samsung_dsim_type hw_type = (enum samsung_dsim_type)dev_get_driver_data(dsi_bridge); + + dsi->max_data_lanes = max_data_lanes; + dsi->device = device; + dsi->dsi_host.ops = &samsung_dsi_host_ops; + dsi->driver_data = samsung_dsim_types[hw_type]; + device->host = &dsi->dsi_host; + + dsi->reg_base = (void *)dev_read_addr(device->dev); + if ((fdt_addr_t)dsi->reg_base == FDT_ADDR_T_NONE) { + dev_err(device->dev, "dsi dt register address error\n"); + return -EINVAL; + } + + dsi->timings = *timings; + + return 0; +} + +static int samsung_dsi_enable(struct udevice *dev) +{ + struct samsung_dsi *dsim_host = dev_get_priv(dev); + + /* enable data transfer of dsim */ + samsung_dsi_set_standby(dsim_host, true); + + return 0; +} + +static int samsung_dsi_disable(struct udevice *dev) +{ + u32 intsrc; + struct samsung_dsi *dsim_host = dev_get_priv(dev); + + /* disable data transfer of dsim */ + samsung_dsi_set_standby(dsim_host, false); + + /* disable esc clock & byte clock & dsim pll */ + samsung_dsi_disable_clock(dsim_host); + + /* Clear all intsrc */ + intsrc = samsung_dsim_read(dsim_host, DSIM_INTSRC_REG); + samsung_dsim_write(dsim_host, DSIM_INTSRC_REG, intsrc); + + return 0; +} + +struct dsi_host_ops samsung_dsi_ops = { + .init = samsung_dsi_init, + .enable = samsung_dsi_enable, + .disable = samsung_dsi_disable, +}; + +static int samsung_dsi_probe(struct udevice *dev) +{ + struct samsung_dsi *dsim_host = dev_get_priv(dev); + int ret; + + ret = clk_get_by_name(dev, "sclk_mipi", &dsim_host->sclk_mipi); + if (ret) + debug("Failed to get sclk_mipi clock\n"); + + return ret; +} + +static const struct udevice_id samsung_dsi_ids[] = { + { .compatible = "samsung,sec-mipi-dsi" }, + { } +}; + +U_BOOT_DRIVER(samsung_dsi) = { + .name = "samsung_dsi", + .id = UCLASS_DSI_HOST, + .of_match = samsung_dsi_ids, + .probe = samsung_dsi_probe, + .remove = samsung_dsi_disable, + .ops = &samsung_dsi_ops, + .priv_auto = sizeof(struct samsung_dsi), +}; diff --git a/drivers/video/bridge/samsung-dsim.c b/drivers/video/bridge/samsung-dsim.c new file mode 100644 index 000000000000..986f1d830844 --- /dev/null +++ b/drivers/video/bridge/samsung-dsim.c @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2024 Amarula Solutions + * Copyright 2019 NXP + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "samsung-dsim.h" + +struct samsung_dsim_priv { + struct mipi_dsi_device device; + void __iomem *base; + struct udevice *panel; + struct udevice *dsi_host; +}; + +static int samsung_dsim_attach(struct udevice *dev) +{ + struct samsung_dsim_priv *priv = dev_get_priv(dev); + struct mipi_dsi_device *device = &priv->device; + struct mipi_dsi_panel_plat *mplat; + struct display_timing timings; + int ret; + + priv->panel = video_link_get_next_device(dev); + if (!priv->panel || device_get_uclass_id(priv->panel) != UCLASS_PANEL) { + dev_err(dev, "get panel device error\n"); + return -ENODEV; + } + + mplat = dev_get_plat(priv->panel); + mplat->device = &priv->device; + + ret = video_link_get_display_timings(&timings); + if (ret) { + dev_err(dev, "decode display timing error %d\n", ret); + return ret; + } + + ret = uclass_get_device(UCLASS_DSI_HOST, 0, &priv->dsi_host); + if (ret) { + dev_err(dev, "No video dsi host detected %d\n", ret); + return ret; + } + + /* allow to use the compatible */ + device->dev = dev; + ret = dsi_host_init(priv->dsi_host, device, &timings, 4, + NULL); + if (ret) { + dev_err(dev, "failed to initialize mipi dsi host\n"); + return ret; + } + + return 0; +} + +static int samsung_dsim_set_backlight(struct udevice *dev, int percent) +{ + struct samsung_dsim_priv *priv = dev_get_priv(dev); + int ret; + + ret = panel_enable_backlight(priv->panel); + if (ret) { + dev_err(dev, "panel %s enable backlight error %d\n", + priv->panel->name, ret); + return ret; + } + + ret = dsi_host_enable(priv->dsi_host); + if (ret) { + dev_err(dev, "failed to enable mipi dsi host\n"); + return ret; + } + + return 0; +} + +static int samsung_dsim_probe(struct udevice *dev) +{ + struct samsung_dsim_priv *priv = dev_get_priv(dev); + struct mipi_dsi_device *device = &priv->device; + + device->dev = dev; + + return 0; +} + +static int samsung_dsim_remove(struct udevice *dev) +{ + struct samsung_dsim_priv *priv = dev_get_priv(dev); + int ret; + + if (priv->panel) + device_remove(priv->panel, DM_REMOVE_NORMAL); + + ret = dsi_host_disable(priv->dsi_host); + if (ret) { + dev_err(dev, "failed to enable mipi dsi host\n"); + return ret; + } + + return 0; +} + +static int samsung_dsim_check_timing(struct udevice *dev, struct display_timing *timings) +{ + timings->flags &= ~DISPLAY_FLAGS_DE_HIGH; + return 0; +} + +struct video_bridge_ops samsung_dsim_ops = { + .attach = samsung_dsim_attach, + .set_backlight = samsung_dsim_set_backlight, + .check_timing = samsung_dsim_check_timing, +}; + +static const struct udevice_id samsung_dsim_ids[] = { + { .compatible = "fsl,imx8mm-mipi-dsim", .data = DSIM_TYPE_IMX8MM }, + { .compatible = "fsl,imx8mn-mipi-dsim", .data = DSIM_TYPE_IMX8MM }, + { } +}; + +U_BOOT_DRIVER(samsung_dsim) = { + .name = "samsung_dsim", + .id = UCLASS_VIDEO_BRIDGE, + .of_match = samsung_dsim_ids, + .bind = dm_scan_fdt_dev, + .remove = samsung_dsim_remove, + .probe = samsung_dsim_probe, + .ops = &samsung_dsim_ops, + .priv_auto = sizeof(struct samsung_dsim_priv), +}; diff --git a/drivers/video/bridge/samsung-dsim.h b/drivers/video/bridge/samsung-dsim.h new file mode 100644 index 000000000000..9bb2a379589b --- /dev/null +++ b/drivers/video/bridge/samsung-dsim.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2024 Amarula Solutions + */ + +#ifndef SAMSUNG_DSIM_H +#define SAMSUNG_DSIM_H + +enum samsung_dsim_type { + DSIM_TYPE_EXYNOS3250, + DSIM_TYPE_EXYNOS4210, + DSIM_TYPE_EXYNOS5410, + DSIM_TYPE_EXYNOS5422, + DSIM_TYPE_EXYNOS5433, + DSIM_TYPE_IMX8MM, + DSIM_TYPE_IMX8MP, + DSIM_TYPE_COUNT, +}; + +#endif From patchwork Tue Sep 3 15:30:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3392 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 599C23FA4F for ; Tue, 3 Sep 2024 17:31:23 +0200 (CEST) Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-533a8a3ca6asf5365238e87.1 for ; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377483; cv=pass; d=google.com; s=arc-20240605; b=MXaTTLRLiLnb9vgXDSeQkOEME7M7DnHrMIn6WXq/XIjjc/FB2XrL2ZiPeS1BDXW0wt R/z+DoqMYCPvqPzUd7byNooEJ6Jjypn5fnHT0ZSmsJ+TXom8ZdDR0vaUx4zNCtenzWB/ n2cZA/lx6lqai88GCxD50yIVgfbNzoBsZ2XbaCCDebYlztdgBPSwsa/dc1Rd2+4FFMBi 7mLdRjtesu2wD3QsF/8uFKKe3B3CuOb1x3HcD+kErfqJrIgseLonplFcmBAJ6oySAdYE R0OSZVGvcM4hswseP+vD4H3l0eexCXhjmgC5Py0ACM1/B9aGmRbLAusc4cERyNoYL1Bd tmQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=CkyywR9sPN15zuNAh5hVWX9kHYxVLuxyYB8oxVa4r40=; fh=AH1HPFLK02tN+uziAhJXdn4/A2zPyg1aLJNcZYifoJU=; b=J7aqKcVVGjwvlFV/K5R47lvi5ttfJtpQ+0Fe6nCce/sM1A3MBgpYjG7eRjGyEvw76k 4hErlbtxEG+sUbtoPt6BiYkcYQfc9NwoqigqHXdttrid02koZqtLn+TyukE8PSaV6o8L oo2nCD87d7D04/g4bmgO06klaSuwctFlNuxy7whFwe9mUzCrbVhDp5lkFLheQS7xa96l 8APQPm4THxKtaqyX4GvVuPxlJhMoG58SqsvyPLquoqL3vDqiGiNVDNifsh+UAMZWU41D hRyJ3x2SUybL9yeXk8XsmJSb96ByoI0SUIQmVBJpLtIT/sTu2FIk9bOf8d2HVUqhypo+ nxuQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AJdtR0kP; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377483; x=1725982283; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CkyywR9sPN15zuNAh5hVWX9kHYxVLuxyYB8oxVa4r40=; b=Y3fOD4xpFRNjvMjF9z6IdITLkzL55+JuygLZb37gp6MnDzTHeqHcuYNfcAZ8X+zE/D H/SvKfImFd5nn4LlrVB70SBkxfv+yPuQZ/MvYXp6gYSKROecv8djlkFOEY8RRA4rkcHG lbinsrTW6QZbAEjQa9CnJmIZMnT/ooXKVJd+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377483; x=1725982283; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CkyywR9sPN15zuNAh5hVWX9kHYxVLuxyYB8oxVa4r40=; b=v+OTExaYAfwLl0WjlZbtnvddVmOBr1bcVA75/tJ2TXeGbJNrcQvORghy8nOwXi5uIo FfnSzWjp8QDXJ8cqrrMwzfdahepe9RTvV8XdAe4yftNIQdC3QTTTPsAqJSnYPLFbfwaJ bfpY6J/GO8HExV1ZbWQk3PLhipg9fo24ckfOLcpH+PCnyhiij9cBayIBK9mOEcgK8OwL bhOspqUZNajB/7SLOu9S14b0jXS6hGmHtHZ506UTIwR7Hf/B9R5YvKgBhaqPv94Ig1Ln eAXdJpPYsjcEl43hbVFy+VIvNsrJzSJotMjNzBoOCPF14S37ck+cJetnb1bEEq91a8u8 BWmQ== X-Forwarded-Encrypted: i=2; AJvYcCWU08WWy4ukJyBhKi/TXUQoG1sKUvJY7dlMIpRbcZWubVSHOCui+n5CW+NPq0x+GICakEgPMyl1qMRBC0cp@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yzx2Tmr63jMfVDaHmcwJf+JNB/qspAUgesPzaHPNyO3zDN1sBLW h0jA0FcGwjThzMJuT5hdCf07RoHtZ4iWk/FMC2rZYvIidtCnBTOOZwdbaR4ZJaJppg== X-Google-Smtp-Source: AGHT+IERz7VlbQ/czJR6hxEswD2R+ycbByjWSOLklOk67zeM9MfBGqw5fISxbNtZ2K//+ea2DGbROg== X-Received: by 2002:a05:6512:132a:b0:52c:e393:6634 with SMTP id 2adb3069b0e04-53546b4529dmr9598164e87.33.1725377482533; Tue, 03 Sep 2024 08:31:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:3b8f:b0:52e:9707:ab58 with SMTP id 2adb3069b0e04-5353d812577ls215619e87.1.-pod-prod-04-eu; Tue, 03 Sep 2024 08:31:21 -0700 (PDT) X-Received: by 2002:a05:6512:ba4:b0:533:d28:b9d9 with SMTP id 2adb3069b0e04-53546bc1e58mr9798926e87.58.1725377480510; Tue, 03 Sep 2024 08:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377480; cv=none; d=google.com; s=arc-20160816; b=mrLpX+hIIVTQ7MlsR5iOA6qNFiTPG7are7UQEUtjB5JGeskBvASuCyin5FYxhGjWnl rISQJkhqBRtlWLiZ6cSy7hckzc1gZPK3ixKUG8Go+okh+s/KWitT9WY+pTiE0diHbWWQ cmAx9+KZN5ZewIezI6+IO6oFAU7E1lrJnVnQOZxdNtIn6Ef+z9tU0bD8/NAh2zh5HOpS 5Iuxdz2nFhSZasS2ah3p+zYs9AlmctMbrnGKfzC9DTTz2ZYU7g3Wqx8HEudBg1mRS6ml Pf7UxtoqP5BU4iVJWjmQWmJL1i0Xe8vY9gl/O327vQ98gnWDYgomnXVUoqMq3j5OteEC QG1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=4Zn8ClwdXoAcaHA+tk5biLFrXll9qgGw9IRC/fcfxXM=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=HIyHjuc++Nbkx9Ti13dNTdI9r7karbOvY54nRm2O1YsW+GHqs2aRRgg4Gs+QnXvIIf mCxBhwEAwUfcTccyrEy23R2mS3/HF2XT2noXFEbMkStw88P+qdca7gig+OPWXVrzik0W rX+1YviYDxfvcM4bADK3Etb23HuCGtZcgcvxpFtupemZoK8XG31YvnPc0jW76MoIwRqB ljUJd+9/YU9Ff/86YP4a/8ljnXP+qUveo0F8HrZv/1ATwpBJmpPhRuVmtDHbYgjrAlFS dUkyWfmEBrBSKdcoPnqaSA3qzbf7thrnf39Qq6qOStyuss+paD5+7/gc9hGYVgAvlX8I YYGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AJdtR0kP; 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=pass 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 5b1f17b1804b1-42bb70c9174sor45556965e9.13.2024.09.03.08.31.20 for (Google Transport Security); Tue, 03 Sep 2024 08:31:20 -0700 (PDT) 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-Received: by 2002:a05:600c:1d20:b0:428:ea8e:b4a0 with SMTP id 5b1f17b1804b1-42c7b5a8fb2mr60389415e9.14.1725377479805; Tue, 03 Sep 2024 08:31:19 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:19 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 20/29] video: Add Synaptics R63353 panel driver Date: Tue, 3 Sep 2024 17:30:51 +0200 Message-ID: <20240903153100.918077-20-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=AJdtR0kP; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi The LS068B3SX02 panel is based on the Synaptics R63353 Controller. Add a driver for it. Signed-off-by: Michael Trimarchi --- drivers/video/Kconfig | 8 ++ drivers/video/Makefile | 1 + drivers/video/synaptics-r63353.c | 230 +++++++++++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 drivers/video/synaptics-r63353.c diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index d2432d67a460..9f7cf196e3ac 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -592,6 +592,14 @@ config VIDEO_LCD_SSD2828_RESET The reset pin of SSD2828 chip. This takes a string in the format understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H. +config VIDEO_LCD_SYNAPTICS_R63353 + tristate "Synaptics R63353-based DSI LCD panels support" + select VIDEO_MIPI_DSI + default n + help + Say Y if you want to enable support for panels based on the + Synaptics R63353 controller. + config VIDEO_LCD_TDO_TL070WSH30 bool "TDO TL070WSH30 DSI LCD panel support" select VIDEO_MIPI_DSI diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 9fd3645994f1..4d836efcfa41 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -66,6 +66,7 @@ obj-$(CONFIG_VIDEO_LCD_RENESAS_R61307) += renesas-r61307.o obj-$(CONFIG_VIDEO_LCD_RENESAS_R69328) += renesas-r69328.o obj-$(CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02) += samsung-ltl106hl02.o obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o +obj-$(CONFIG_VIDEO_LCD_SYNAPTICS_R63353) += synaptics-r63353.o obj-$(CONFIG_VIDEO_LCD_TDO_TL070WSH30) += tdo-tl070wsh30.o obj-$(CONFIG_VIDEO_MCDE_SIMPLE) += mcde_simple.o obj-${CONFIG_VIDEO_MESON} += meson/ diff --git a/drivers/video/synaptics-r63353.c b/drivers/video/synaptics-r63353.c new file mode 100644 index 000000000000..25db9c3e707a --- /dev/null +++ b/drivers/video/synaptics-r63353.c @@ -0,0 +1,230 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Synaptics R63353 Controller driver + * + * Copyright (C) 2020 BSH Hausgerate GmbH + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define R63353_INSTR(...) { \ + .len = ARRAY_SIZE(((u8[]) {__VA_ARGS__} )), \ + .data = (const u8 *)&(const u8 []){__VA_ARGS__} \ + } + +struct r63353_instr { + size_t len; + const u8 * const data; +}; + +static const struct r63353_instr init_sequence[] = { + R63353_INSTR(0x51, 0xff), + R63353_INSTR(0x53, 0x0c), + R63353_INSTR(0x55, 0x00), + R63353_INSTR(0x84, 0x00), + R63353_INSTR(0x29), + R63353_INSTR(0x11), +}; + +struct r63353_panel_priv { + struct udevice *dvdd; + struct udevice *avdd; + struct udevice *backlight; + struct gpio_desc reset_gpio; +}; + +static const struct display_timing default_timing = { + .pixelclock.typ = 70000000, + .hactive.typ = 640, + .hfront_porch.typ = 35, + .hsync_len.typ = 2, + .hback_porch.typ = 150, + .vactive.typ = 1280, + .vfront_porch.typ = 2, + .vsync_len.typ = 4, + .vback_porch.typ = 1, + .flags = DISPLAY_FLAGS_DE_LOW, +}; + +static int r63353_panel_enable_backlight(struct udevice *dev) +{ + struct r63353_panel_priv *priv = dev_get_priv(dev); + struct mipi_dsi_panel_plat *plat = dev_get_plat(dev); + struct mipi_dsi_device *dsi = plat->device; + int i, ret; + + ret = mipi_dsi_attach(dsi); + if (ret < 0) + return ret; + + debug("%s: called\n", __func__); + + ret = mipi_dsi_dcs_soft_reset(dsi); + if (ret < 0) { + dev_err(dev, "Failed to do Software Reset (%d)\n", ret); + goto fail; + } + + mdelay(20); + + ret = mipi_dsi_dcs_enter_sleep_mode(dsi); + if (ret < 0) { + dev_err(dev, "Failed to enter sleep mode (%d)\n", ret); + goto fail; + } + + for (i = 0; i < ARRAY_SIZE(init_sequence); i++) { + const struct r63353_instr *instr = &init_sequence[i]; + + ret = mipi_dsi_dcs_write_buffer(dsi, instr->data, instr->len); + if (ret < 0) + goto fail; + } + + mdelay(120); + + ret = mipi_dsi_dcs_exit_sleep_mode(dsi); + if (ret < 0) { + dev_err(dev, "Failed to exit sleep mode (%d)\n", ret); + goto fail; + } + + mdelay(10); + + /* This call starts sending the data on the display (LINUX LOGO) */ + ret = mipi_dsi_dcs_set_display_on(dsi); + if (ret < 0) { + dev_err(dev, "Failed to set display ON (%d)\n", ret); + goto fail; + } + + ret = backlight_enable(priv->backlight); + if (ret) + return ret; + + return 0; + +fail: + dm_gpio_set_value(&priv->reset_gpio, 0); + + return ret; +} + +static int r63353_panel_get_display_timing(struct udevice *dev, + struct display_timing *timing) +{ + struct mipi_dsi_panel_plat *plat = dev_get_plat(dev); + struct mipi_dsi_device *device = plat->device; + + memcpy(timing, &default_timing, sizeof(*timing)); + + /* fill characteristics of DSI data link */ + if (device) { + device->lanes = plat->lanes; + device->format = plat->format; + device->mode_flags = plat->mode_flags; + } + + return 0; +} + +static int r63353_panel_of_to_plat(struct udevice *dev) +{ + struct r63353_panel_priv *priv = dev_get_priv(dev); + int ret; + + ret = device_get_supply_regulator(dev, "dvdd-supply", &priv->dvdd); + if (ret) { + dev_err(dev, "failed to get power dvdd supply\n"); + return ret; + } + + ret = device_get_supply_regulator(dev, "avdd-supply", &priv->avdd); + if (ret) { + dev_err(dev, "failed to get power avdd supply\n"); + return ret; + } + + ret = gpio_request_by_name(dev, "reset-gpios", 0, &priv->reset_gpio, + GPIOD_IS_OUT); + if (ret) { + dev_err(dev, "failed to get RESET GPIO\n"); + return ret; + } + + return 0; +} + +static int r63353_panel_probe(struct udevice *dev) +{ + struct r63353_panel_priv *priv = dev_get_priv(dev); + struct mipi_dsi_panel_plat *plat = dev_get_plat(dev); + int ret; + + ret = regulator_set_enable(priv->avdd, true); + if (ret) { + dev_err(dev, "Failed to enable avdd regulator (%d)\n", ret); + return ret; + } + + mdelay(25); + + ret = regulator_set_enable(priv->dvdd, true); + if (ret) { + dev_err(dev, "Failed to enable dvdd regulator (%d)\n", ret); + regulator_set_enable(priv->avdd, false); + return ret; + } + + dm_gpio_set_value(&priv->reset_gpio, 0); + mdelay(10); + dm_gpio_set_value(&priv->reset_gpio, 1); + mdelay(120); + + /* fill characteristics of DSI data link */ + plat->lanes = 2; + plat->format = MIPI_DSI_FMT_RGB888; + plat->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | + MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_EOT_PACKET; + + ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev, + "backlight", &priv->backlight); + if (ret) { + dev_err(dev, "%s: Warning: cannot get backlight: ret=%d\n", + __func__, ret); + if (ret != -ENOENT) + return ret; + } + + return 0; +} + +static const struct panel_ops r63353_panel_ops = { + .enable_backlight = r63353_panel_enable_backlight, + .get_display_timing = r63353_panel_get_display_timing, +}; + +static const struct udevice_id r63353_panel_ids[] = { + { .compatible = "syna,r63353" }, + { .compatible = "sharp,ls068b3sx02" }, + { } /* sentinel */ +}; + +U_BOOT_DRIVER(r63353_panel) = { + .name = "r63353_panel", + .id = UCLASS_PANEL, + .of_match = r63353_panel_ids, + .ops = &r63353_panel_ops, + .of_to_plat = r63353_panel_of_to_plat, + .probe = r63353_panel_probe, + .plat_auto = sizeof(struct mipi_dsi_panel_plat), + .priv_auto = sizeof(struct r63353_panel_priv), +}; From patchwork Tue Sep 3 15:30:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3393 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 1062C3F360 for ; Tue, 3 Sep 2024 17:31:24 +0200 (CEST) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37496a7daf2sf3695310f8f.2 for ; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377483; cv=pass; d=google.com; s=arc-20240605; b=jZz7IWT1fh1opKBQS1ZBAlt0Fzn717WDE5wVx4J2+cuZuV6IBk5Ju/ieGgskIykJlZ 2W9FK4mrndMGaryEycF7DL5J3lYW1KwENR+feBHskDIxp0QPUsuwD+NEW2wFutqC0L7J 2jPp4j7chC+LGibNKqea96As6HjXOW48OR+CejDMUOmL30SQAoOu7hxZyokd5zhw7Dl8 dA6AeC+nqv+atK6dF+/gnIEF/q8TAonxkzgL/YykfngGnZ7cTh9hDHNYl8tY+ETCgF4z 3FKQyVzNWwLpymj4xSDE7AEfzF2DUE6ILC5C46JFgfL8YxLKB+3XWz4oU7cjwnrQYvur bJPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=RxrVMbJThE/2Td+EsDvk3hgmW909IVBZqOJ4L0f4lR8=; fh=GC/FLbxLJkwmnAeV4rEWGvGnv1dL9z1TK5DAhToLObI=; b=FBSe8pPT5RMZyaNkxcvBwdKEt0ukf+ofUchRhFc92bNVo21DZ18tcKOMZkSGzDSMtJ Z20ZAZk2Qxl6e1ykf+RJH/EV9Xsts8lzQGY6Mp1Lju9QJborE5O/VN8fSkZZOnjZGnbg S12rGSoKoLzt1Tjb1CKW+C9Sq1kmZxwfcnOoiFP6ZW26fQ8vujKlLl7r9WbtNcVgVFgy 5nzayGkBMcZ3F1heSPwReSi8aWanzM4oyc3XfO73pNB9uMB/o9F8rAOcEt2MExGVgKIX I+eR5N4yLEBlvml0E/LfCAxXyOuVCtUwAf/xEbaEphDEKdkW7urseMPQ8Ct+rvfto1/l NxWw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TCJHh5ID; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377483; x=1725982283; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=RxrVMbJThE/2Td+EsDvk3hgmW909IVBZqOJ4L0f4lR8=; b=DVKQxz25PbbL+p6hIPG1lxJJ/lmVK2iNH16eHxIgizNmHOT21/6cIBG5U/TB/soyFz kh/DDTXVUEL0r8v2eM5kj03mx7CVsVF+eA/w09TkaJsCy4k76s5xbHzncyGUWctN3rPI i6JnFuQ5dOSb5oNoWiMKrJv25w40Iy7E188Nk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377483; x=1725982283; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RxrVMbJThE/2Td+EsDvk3hgmW909IVBZqOJ4L0f4lR8=; b=V3p7dtvP0Q877Y2nujH8lgOuttXgJ3sxfZwp/k4vOQaKyoMU25DDtpC7KOO19Pxvkj UKa8nWzWOMJg87DJD6P5hz6Bj2zoH6BgoLVmcNJm3h51y+ySBWYTITnsYf/2PMrY2A8z OWLetMFVaU2JvVQi7DU+Mu0xS8i0x7LC0R6R6xqElf5J5/Z4W1Whs6Ak/7vg3Hu2xw97 r/QUxFt0YmtAJkjeuwT9ZBDJqukbPdyNmV1DgLTGj/jGm6MZn6VHv0nOUHuGMCZGTP2a Vg/f7zxWVAH7iP1NSymrqFD6AvpKwCB+Q7fub9HH3C+NsYkwsO7YJPCnsvPVbSwkInd+ BNBQ== X-Forwarded-Encrypted: i=2; AJvYcCVWgKhJhX2WkbN4zFF5bV8PkENsErdRLkg6RpQ9FsZ0gtMU+pn2fsHHKStNsBtKovU/49BwxRVMdmmM6iTp@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwxRkYsTSD+z5g8xBc6NG9BfxRxCW59vSy06PnUzG7FT+Fo3cbU /ksvuHSuZfyFXmWwGT2dfhfUa/OkvX3hiNbBBLmzykSZzWMFXRmkFUFQ3Z4niK5YZg== X-Google-Smtp-Source: AGHT+IFG873TCUQf8rmmA4k+mslQO/cMizdlL5AQDHPwlymVCrqKV6x/klWTHGd1h05DcT1mYTzw8g== X-Received: by 2002:a05:6000:4025:b0:374:c287:929b with SMTP id ffacd0b85a97d-376dcc8b852mr1100072f8f.4.1725377483607; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:adf:cc81:0:b0:377:2d98:7c90 with SMTP id ffacd0b85a97d-3772d987ddals30408f8f.2.-pod-prod-09-eu; Tue, 03 Sep 2024 08:31:22 -0700 (PDT) X-Received: by 2002:a05:6000:1f8d:b0:374:c29f:8ddc with SMTP id ffacd0b85a97d-376dea47192mr1104480f8f.40.1725377481969; Tue, 03 Sep 2024 08:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377481; cv=none; d=google.com; s=arc-20160816; b=oqkF7i3D8Tbyd++3DcMJf4n8okLZgtJUYFd+XIzIJuwxFQoh3BesBd/6bce1i9kUvj CiVwPDVlEZ0btCcTj+Lc11BFP2tbqlSJ0FC7lJZAPX+KvI0MKX/IzyzfvtV1RcPFNXcq lO2rvSzLGXmJmd2uXCZTLHSOw3Mq6N/CvDCgSBMstmvGjJyKujUFkVdDiYRDVfjpJPAZ iwKse4FrvUM38Xyg3dC6kFpn5bMSEl7QEpbisv0RK/b1Y+mQTDYP+Rjfv7wMG2D/nHfo /TSHJ2pAP6a1iG/v6CpY+sielzHJo39XjYh2p1oUpVq7FH4shQLC/Bs8DL2aigxDMjJ5 p1GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=HWVR1tjgdNZGgyHW680IXPsmI8+TtnYx91IOCA6B+WE=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=C8+c94/4B0lHFYHgrVd+8KB9x8f8UnMj+tUJUeCMi3JA4X/Puf+UPgpXtku53t9sOs 2NC+QQuQ6KnD6/KcbXiGSvVTQI4P5uEtGjg9iS/9y1vAsRjkmeCbXpTJ9sWO0Dx4S+jo YuwCRby+PHMR7+UZqZnSgOl4hVAk1ho0uaXVRHLQ+1EMpOJDxHIpawMpn1Irf8GQ3UYy Io/pNrjo3DbbetGDcsfyRapHkNTIHB88laRSAiJI2K0XVs1WmWDf8TlBKnPTLEjqivOs 1XBUb4RtB7+5B/k1SAEj8ioYhE7WLMqpT9nZyLiQi4e+F2XFDSOzatGcJt+FsVc691wP +3cw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TCJHh5ID; 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=pass 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-374b71fb288sor1916288f8f.0.2024.09.03.08.31.21 for (Google Transport Security); Tue, 03 Sep 2024 08:31:21 -0700 (PDT) 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-Received: by 2002:adf:f503:0:b0:376:37e:2729 with SMTP id ffacd0b85a97d-376dd71a9b5mr776404f8f.31.1725377481230; Tue, 03 Sep 2024 08:31:21 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:20 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 21/29] arm: imx8mn-bsh-smm-s2pro: Enable display on reference design Date: Tue, 3 Sep 2024 17:30:52 +0200 Message-ID: <20240903153100.918077-21-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=TCJHh5ID; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , From: Michael Trimarchi Signed-off-by: Michael Trimarchi --- .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 23 +++++++++++++++++++ configs/imx8mn_bsh_smm_s2pro_defconfig | 14 +++++++++++ 2 files changed, 37 insertions(+) diff --git a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi index 19b0d8977539..8cae580e2851 100644 --- a/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +++ b/arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi @@ -6,6 +6,19 @@ #include "imx8mn-u-boot.dtsi" +/ { + aliases { + display0 = &lcdif; + }; + + samsung_dsi_host: dsi-host { + compatible = "samsung,sec-mipi-dsi"; + clocks = <&clk IMX8MN_CLK_DSI_PHY_REF>; + clock-names = "sclk_mipi"; + status = "okay"; + }; +}; + &{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} { bootph-pre-ram; }; @@ -30,6 +43,16 @@ bootph-pre-ram; }; +&lcdif { + display = <&display0>; + + /* panel is r8g8b8 */ + display0: display@0 { + bits-per-pixel = <24>; + bits-per-color = <8>; + }; +}; + &pinctrl_i2c1 { bootph-pre-ram; }; diff --git a/configs/imx8mn_bsh_smm_s2pro_defconfig b/configs/imx8mn_bsh_smm_s2pro_defconfig index 0faa3376fd3d..eb1275a44307 100644 --- a/configs/imx8mn_bsh_smm_s2pro_defconfig +++ b/configs/imx8mn_bsh_smm_s2pro_defconfig @@ -68,6 +68,8 @@ CONFIG_FASTBOOT_BUF_SIZE=0x20000000 CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_UUU_SUPPORT=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_DM_GPIO_LOOKUP_LABEL=y +CONFIG_SPL_DM_GPIO_LOOKUP_LABEL=y CONFIG_MXC_GPIO=y CONFIG_DM_I2C=y CONFIG_SUPPORT_EMMC_BOOT=y @@ -83,12 +85,17 @@ CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_IMX8M=y +CONFIG_POWER_DOMAIN=y +CONFIG_IMX8M_POWER_DOMAIN=y +CONFIG_IMX8M_BLK_CTRL=y CONFIG_DM_PMIC=y CONFIG_DM_PMIC_BD71837=y CONFIG_SPL_DM_PMIC_BD71837=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_PWM=y +CONFIG_PWM_IMX=y CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y CONFIG_SYSRESET=y @@ -101,5 +108,12 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LOGO=y +CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y +CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y +CONFIG_VIDEO_MXS=y +CONFIG_SPLASH_SCREEN=y +CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_IMX_WATCHDOG=y # CONFIG_FAT_WRITE is not set From patchwork Tue Sep 3 15:30:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3394 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DD66F4174F for ; Tue, 3 Sep 2024 17:31:24 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bbff6a0aesf35707935e9.3 for ; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377484; cv=pass; d=google.com; s=arc-20240605; b=V1+aUtI++V3vwO830hYwk/i21irOKDBSt2ZKmaqAYE+A8HEzNGsFpjuBxY5Vxj8xPd YuDdxgEyh3wflwuFyDAUNzy8KqGu/jOp9OOgPSoHikviUDSQj9nrbsdHFmEKaUdVG06e pjArNnNNbBwT45ve/vb8auuruPaBWFk61Xw3b4ZfKQ41J/ob2KJCCAnm6qoOYyQfeN/+ VyCpnAAI3umUFXWH026XUXo7Hoq+9Ptp1fWy8iPABqiA9nSg2haPudPR/gjjW59diny+ mfPQsRM0LZ1HKB0u1rZPOAoAkUU0xG8sUs6JmoyF2QyL0MTmTqeOsxnLT1TJLFcF/oc3 0XFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Qf8AeJxhbqMvZBPYSCy1lA70PMaWfMGg1u1pxISbVlQ=; fh=jIgZ3oH0NBAsSDPEK4XFFQwzAfraEX2cpKRb0kVaQlg=; b=OSaAwVzUuu8VClhYRUvKGPIb8EF5ezMyX+EmL7LV4dMdGMSlj9XQZtFTb5nGFKrcaP 1FZfDVTvlkMNFyZF8t+DhH6et+jRh5bFT8Wi0lypQTPmhwOlq0FQp6PLBoXrr3CXiJ5b 2ImB43BSb39GMTWpSYfuaXmoYj54y9JrWi0YI1NiKw5WuCvHdw2BIlBRWlaqax//Z7lx q25L4L3p7t0CZVe+DBzlNSjo/hayVEi4pLxVKin21qR5Kwijx3HLYVxULavHUgduVYkx SDDMij23dXonlOfmjT+z8UfzEt7wdMdnv/EekvIQmsir8pXHNP2WYph06XETJ08yeS41 u8AQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gdBBhnpm; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377484; x=1725982284; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Qf8AeJxhbqMvZBPYSCy1lA70PMaWfMGg1u1pxISbVlQ=; b=Oxh3l+k2Vrpdacdv33UHGY+f3swgMO3sjds0Th8Slq6EEYyYzbi1XviCXPWOWfDjqh oq/IsuPovrCKbObZro2FBnKAHE1gzxwNtiSXUAfvRDTVdWzSB5NTzRTKkiMJccnOONaf cQVYUh5sQddoGxsHlj3UpTlar2m2raBAPx3fM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377484; x=1725982284; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qf8AeJxhbqMvZBPYSCy1lA70PMaWfMGg1u1pxISbVlQ=; b=NlBP5TAgA89GhkWfqF5z8nouJXmrtwwGIQYJzgdVXDqUmqhxd9CO4yIvQL8gzKimSB 0dBJxHbDvUdLs7jJnuM0R8eXyUP0aIEIJQkEh4ANbZdjX9xvKaX46QuVltkbUkYoQUvu yx1zCzUwyNwnlD9KRl4wO6fnbX8f7m34Ylo6o8ut6oK0/e85sc1o7a/jtxtu4RnnUvt9 XWfU6aCHzCIQOKatIxw5fxFXnPlBUT9AzZFgMpPIJ+k2v40wUsn/SGUNRB9FjcjX3jnM 2GXn61KAdh1KTHzmWgS4IFo/uU2pR+Tip+su8iElybwJYPlb+1+xmH6oj2BCXZNUJT00 fwNQ== X-Forwarded-Encrypted: i=2; AJvYcCV5CLF+hCZS69vgFU9BGj6HqgCV3GVbpVxcsIW25onFmeJ8wcddCCJNIDb2xyuk0SGVgq4UnoI7uGIVNPnp@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yzp7kmcY5YUINbzrypvVNntjPmCUO1hsCStilUOYREnzJt7CtCh S3IFrp3Hg6NtYTCNrzXWI47p2ffkSBeQ1AlSSxStwdgSyuwFfWnZ/C4OezDcm74A7A== X-Google-Smtp-Source: AGHT+IG4zVZf614D3HflAHsOmDUVy6noy56+PbY6qf/gkxzP4aQkUqfbWuOm/PhCs+7R1fAPgyqplg== X-Received: by 2002:a05:600c:4687:b0:426:68dd:bc92 with SMTP id 5b1f17b1804b1-42c8de5f5demr10015055e9.5.1725377484463; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3c9e:b0:426:6eea:e7ea with SMTP id 5b1f17b1804b1-42bb2a06893ls25149565e9.1.-pod-prod-09-eu; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) X-Received: by 2002:a05:600c:1d19:b0:427:ab29:30cf with SMTP id 5b1f17b1804b1-42c8de5f599mr10203265e9.4.1725377482707; Tue, 03 Sep 2024 08:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377482; cv=none; d=google.com; s=arc-20160816; b=ioOjk6MudwNJcINGya40eWzOQRm8Xf+P5/5bNC14GFG7ams0+DFRyyNvnPqge/LiCM VIPEtEMNbX8+54Jv1JtbGtkdZgs9MstHpBXk+xIcMUjp/zKArog/BTOr/77wjzvMlnTF 2IP+8hcjfHPl+2vLUpTfI4AKqZqZj2Kd4M+zXrnd+HZvck80jJJYdMmUrP3Qr7qUZjrL twD+VtxYnxd45h+hPzSQEsQXYiFgjUXQaBLyTpRRO008x4p2qDFRMp5pZKkycE9gpV/4 bz7rfwFg+9lq5cdYsjBjHZ0GrGISLefQACdhWIDeQsjfOWMXYvKowg2kuP6YY2NT6wng AovQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=3F/m0WrqREzorM4iF2HC0olxLWFILAFdpvU8VWHdIXU=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=DPoeYl4O0cSVQS1JFw2mldj3Fm2kBV7CpkIy4TnaE+oLcosuYj436FeSvD8Xuno1is qWiDgSISWJ1b+RUmm0zb56xUaZS88n+PNJa9Gw2iQfBikOxvrnK93p5Ki0AV8zh9/YsS SAeVvgB2KkhkK/0a6Mr5+F1ZsW0IUCZzqOeo+sW6nX1eINqAYYqhq2y/jmkQdgAjhOoa Q21udj5NIQblH7C3MO6q9MMVGpcDkgpLJaH/wziy2oVtxKXu+x6hgz3UYyjpepQ9/on2 0x20e2jKptFj7++lbWqkR6ZhqqcFIn07TTz166Ask4X8frVOV+AgdLfuGZTz3W3sJ8dr VgeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gdBBhnpm; 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=pass 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 5b1f17b1804b1-42bb7077744sor4240875e9.7.2024.09.03.08.31.22 for (Google Transport Security); Tue, 03 Sep 2024 08:31:22 -0700 (PDT) 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-Received: by 2002:a05:600c:358b:b0:426:5416:67de with SMTP id 5b1f17b1804b1-42c8de9de13mr9846595e9.30.1725377482095; Tue, 03 Sep 2024 08:31:22 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:21 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 22/29] bootm: adjust the print format Date: Tue, 3 Sep 2024 17:30:53 +0200 Message-ID: <20240903153100.918077-22-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=gdBBhnpm; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix. Signed-off-by: Dario Binacchi --- boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootm.c b/boot/bootm.c index 376d63aafc95..a6e1c6d46bd5 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -703,7 +703,7 @@ static int bootm_load_os(struct bootm_headers *images, int boot_progress) /* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != load) { - printf("Moving Image from 0x%lx to 0x%lx, end=%lx\n", + printf("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n", load, relocated_addr, relocated_addr + image_size); memmove((void *)relocated_addr, load_buf, image_size); From patchwork Tue Sep 3 15:30:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3395 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F0BF73FA49 for ; Tue, 3 Sep 2024 17:31:25 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bafca2438sf61940605e9.3 for ; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377485; cv=pass; d=google.com; s=arc-20240605; b=hrT3+7TkfZIoCNpZVudu/05vwIL49T/BI+ZREyfP6p2ToJFSnPglgJ4YF1IzTsN0da 0dC9Qw32W3wfbYWFm3shuAn3W07AeKSWYZizVlq6Vta+N0D3mURUv4qmyMJmkq7NLVcq ZkRHfF79QbRY3xC0/mmIlDFZF1cZvR0Zk/2rzuQzS3HlMOUX9pFe9QKpact77mFPIXWL xIbiyf7SflegjIK7+e6iPbkrGPT+zujaO5NFjV66NiH+qrMdNCZanOY3AcgKapMNOcG+ b2A8+oDCFYot/n7nAbA2YkVvOrvv0txaQSJ4eWue3sQoE95ClHSyoATZ/MjP0NpN/vAD YVsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=93ySCMArp05DF+DPD7qcCsKVEmERYTxCvnurbByGzFs=; fh=Ko9FWccU30vjG7FP5kTfrIa5MsmTL6gnQz5GuAmW3o0=; b=AiLAXKN9FGTH3JCvVl02q/8JYgWuRkI0uiuzyzUZXFYH6KedgjNlAVeZNmh6ixcUga tvkE86C3m9YFYFzWDdlY2DraYYr9kba+4yIaGqghIOMyn2avIFUGjMKhxl9EC1BnUV/5 U3Q6FtRwncfEeDRYkz95UQUrMZzrNeM3tHGeXKvKcDdw9psnG3hqGrmk2vI2wYa3zp1O h39DnlKC630gD+1eS3qa2dEdoA42mjsfsC46IyZXolORf0BAN+ePlS6kYtgu61WPhhpa BPTweCnQQW58OibSSVB6kj+hIA2h8RmPsaaYjJubnGM3MnuWBF/EK3lhCJsCLNbwp4Yb PYAw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=m7CXrOz3; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377485; x=1725982285; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=93ySCMArp05DF+DPD7qcCsKVEmERYTxCvnurbByGzFs=; b=ljH0Yyvkae02Zv1w2wLoKcCP8gYU8V0oJ80pG58Wx14a15FXneckpk/zcUe+lMnIVg Oy/LfLopMB4jeCXSA7omL1rIJA4fQaezHY7qM1npaa4z9yko5GuzKounvrGKGDGmDwMO jmC3Lo4YzyW2DvSF5rCZWi3FzNWFtctaQWIvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377485; x=1725982285; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=93ySCMArp05DF+DPD7qcCsKVEmERYTxCvnurbByGzFs=; b=Jejk0OeSGFp2+SVO23a33G32ul4GTgGgeFuBiMryTYszJlQUvTMeWG+UAVr3YQI5KW CHpv4h78mFrKPG2vpeGiltT1o9GWSe8cXBb1+xafZy9M024nD8HB2sB1k43TVUiv54Ia c7FoV8Bcf7k2PVS/n8/MokbtHYrlN+GdJsuOjfUXBeluRYOjw0iN5lT4/Fy+dmEFprra L0KsXEN3C1eEf3EpLBsZo2glfMDmySjMyI+zNESILICy100+8e3+EqjzxfU5onz9qVP/ rKEJXO6bd0dzOVowvvUUtjrSoSu3vOpOkCFsFoqZGv4PqTM49Up0Cr3UIRjWPgPLEZbq O0hg== X-Forwarded-Encrypted: i=2; AJvYcCVKqClk9W/vwDMfgJYF3ccO5U67HN6xZ3ZVYmI625ALmeOFLW1+WaYDCxvgbOnJBU0FatL6/d7QmS3/6RPs@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyPHWkUTVnChhcQaCi4kjmgmzuhdPFkQdbSdb/RXb87a0vANU0g GgPZh1+T0rLXEwBopCdJty+REjpLNrCK+iHKkO6uMlpEQDiG4lFDvJxfyB2Z/KD57Q== X-Google-Smtp-Source: AGHT+IHeSuKqyb/dkOp76ozLZMaX/cH9YgKvWXGoDWeyBuOqFx129YF8zFGdKZIgbG5ENrG3IuQGAw== X-Received: by 2002:a05:600c:4586:b0:426:61fc:fc1a with SMTP id 5b1f17b1804b1-42bb01ae2a7mr161179305e9.3.1725377485477; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3c9e:b0:426:6eb9:5098 with SMTP id 5b1f17b1804b1-42bb2a057fals1326425e9.1.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) X-Received: by 2002:a05:600c:3b11:b0:426:6714:5415 with SMTP id 5b1f17b1804b1-42bb01edd2bmr133968165e9.30.1725377483675; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377483; cv=none; d=google.com; s=arc-20160816; b=ldNrwWXXTbPO/FWndfcMgKhblYby5HCVGa5CzfXso64lQNWVvdkKx6ettcjeCXLii1 1hnALS8ek5Uf0DIAli8Xsx+5HcnHJxcjoeA92Q3ODsiMzqhTOMNP8jHk6vPqbsVefLSB BypznxbiltSG58c2DB290HBN8rMJFNGv4SkmOef4zYzcJCOcchj44Wzcl1qMWPqSvrV2 BEOM3bIE9kPZ3kqIzrpoiW484VOtkmNE37+iQWO6G2U+0SykkgY8YV3ahRpnAzzXFyRK K9RcSlpPAnjkiXaz1uSHdCN3GLFp7ng0She0b+qUH/enzqo7DT1bsI6kNNDewW5xxKka 0vWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=P0bGH2E05qtaXhwXMMIpoeQkk7HbOzHDP1V+qyxgqmE=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=nzbZbszMa7g0jdnabpQIcPf8m94cXpiHG66GZgdx8MUnK7qygPANk5k7QzuIFPwYNV butfBkZ50axlZ9JS0uYcNr/EKR/uH5jnXznxYbY4pY7RlDy6BUHWG8mkwPP8/QnKk0dh V9bdrdTxF7CbYIkOpV/oIfmNuJEOx4prYwDL5nQMVh40SJ/j1sp43A7vOOnLqmDvoPod pMYvA9/ygf2hMZDXLlrYuDqv7Ycy/g0DShMlUbvmWaCKfMwttGz/1JblX7otolbjyf91 C5lerB1hIwMCK18zlOHkbEk+VB9KPNoEf+wx3cyhV+ng9qTPbX6MHYsDfOaA8ZA9IL2c eWHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=m7CXrOz3; 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=pass 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 5b1f17b1804b1-42c8e32d9f0sor4088715e9.6.2024.09.03.08.31.23 for (Google Transport Security); Tue, 03 Sep 2024 08:31:23 -0700 (PDT) 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-Received: by 2002:a05:600c:3b10:b0:426:6ed5:fcb with SMTP id 5b1f17b1804b1-42bb01ae1fbmr178667105e9.4.1725377483035; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:22 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 23/29] cmd: booti: adjust the print format Date: Tue, 3 Sep 2024 17:30:54 +0200 Message-ID: <20240903153100.918077-23-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=m7CXrOz3; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , All three addresses printed are in hexadecimal format, but only the first two have the "0x" prefix. The patch aligns the format of the "end" address with the other two by adding the "0x" prefix. Signed-off-by: Dario Binacchi --- cmd/booti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/booti.c b/cmd/booti.c index 62b19e834366..ea811244a0a9 100644 --- a/cmd/booti.c +++ b/cmd/booti.c @@ -78,7 +78,7 @@ static int booti_start(struct bootm_info *bmi) /* Handle BOOTM_STATE_LOADOS */ if (relocated_addr != ld) { - printf("Moving Image from 0x%lx to 0x%lx, end=%lx\n", ld, + printf("Moving Image from 0x%lx to 0x%lx, end=0x%lx\n", ld, relocated_addr, relocated_addr + image_size); memmove((void *)relocated_addr, (void *)ld, image_size); } From patchwork Tue Sep 3 15:30:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3396 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2570E41742 for ; Tue, 3 Sep 2024 17:31:27 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42bb8610792sf48166475e9.3 for ; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377487; cv=pass; d=google.com; s=arc-20240605; b=j8yj2DppaO35f5n1Gu9x5SWm11wp1yF1ExObvdiMY2wt+7seOs/o7N0PS9TqI696aQ Ij42OFcKOk55AsSaSxCRSjMlCXz6Mp8wHRyLr+qDdIShRT1aStgCyjwcgeqiSL5gGLP3 umQ7RcY96VhR6H1RpfDRNbRmS5oTN9rLuS/do3zASwePYRMODu0As3okvXhFktBr5Yut aBAR0P2y1D6emt7021ZhLLmVS/d9hkhWDLaSN2FKnvJHIfP6Go0OFFu0fx8jfCMc81xk FQCqoyE/Dlx1QdntD1NshtAzuu0ncbvsc8ayJI+NXM8HWrIuRdfpQ81fFTbrNVCHM0PK zIVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=rjjr5GLpFiePobEZX7Dd3P/Pnw+E9mvPZXqBZJFwmmQ=; fh=UnhaVx3fUDXvgybxMRp4GpvB2oBDmR4cIoBJ3jBIyWs=; b=GxSEf3/D1vH54JksSVb9tbqIaDc/FJw5Edz4KyV4o/D2ACnUsS5JShpWQAy4eqe3vu 5K9DOyiiqy6Z6M3chXcDsVd7+Ljma9DIEFECkQzfXaVm3y/4nX3ux8gqQMfnoPdhnaCY An/il7y4LZminR7SGayYLjhR+rLB4T4fqpoI4DI65dvOeuT6nnvpPWV6hcvuOZp7Wzb+ +0yG+CyBaX2jA5zCf1RnzJwkmB7ol5IZMCl05O4kdZmPK3G0ecrfKKjpvg5djN0DZbo3 e+V16xzwwfT+maVxcmgAonnIfvLRA5DSqeu3vt+KgC7KA3HgLcQ71m6eh19Cmr8ZJtBq JcCQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BdWEatxZ; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377487; x=1725982287; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=rjjr5GLpFiePobEZX7Dd3P/Pnw+E9mvPZXqBZJFwmmQ=; b=hYm8K/7jFNz4+k14NvzuknkI/529MC8W75H8x/fTN5nD+ZokWAZ9LzeCIxtxdKLp+Y Kmq3ZPRLGQBY1z3luU6EVPVo4WOnMMn+RNpUzTEbnhhftAASKkhGaMLP0KePF0Zgjqeb 1tScX6HeF1Mc6WEq+xYXgzgiIShNWC6bgEA9g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377487; x=1725982287; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rjjr5GLpFiePobEZX7Dd3P/Pnw+E9mvPZXqBZJFwmmQ=; b=rmE17h+rVVRXLLf4NHklmd82Cz0ExNSpZ1Bg5/ilEKPKMjJvClekYkBdBRd+xpzh4V SaaL3y/h62yFIZZCrnVeEW2MJblsVarAlq+Y3Pih1fmZ9jz+IP3rEnkBm8YWAh19Uocz k/pgCE5JtAjvcTsyfzea3U6NygTX3SeFUcla2SZtIl5VoFNTMQpfxS4UqFoqlagClVSH 5ByuVG+gXcGCj1YLYRVDXjSRNZuFGPZaGCZsQrEPIdX3K0c48ZKAFwQ9lw9ymR5pUwAo 4FAIpYFULaOEiYCoLQViR90181ufTLZ55TWRm5z3UUDNv/WgLZRkYb+NoskGEois3lCA kG/g== X-Forwarded-Encrypted: i=2; AJvYcCXE1LrTdzE1R0+MXpascuMR1Jq0LBOX+LegrIapgnzcEh4KUUOnONGXRV0s4UOMqTmSFLPPMnPtr5c/qL+8@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxFKDPUDSPv3qU3apVCrH8hcX35pFPMpA7I21Cs1/6dwF00DWGk LkhRWwFklcDSgmkTwjhhZSIY3usPcfzDCi6ZRTIr5INjfS9cJeXAEwGkMO1oVJmiKg== X-Google-Smtp-Source: AGHT+IFC2sHyRL5yVc60UMBUBmuAuQQoofSur5UCvtpcqrBR4+OM7zw5wmrRtMv8lMCwyHGX5nM8Uw== X-Received: by 2002:a05:600c:a07:b0:427:abed:3602 with SMTP id 5b1f17b1804b1-42bb27a9e95mr124629415e9.24.1725377486345; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b99:b0:426:6982:f5de with SMTP id 5b1f17b1804b1-42bb2a07f92ls32450755e9.1.-pod-prod-08-eu; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) X-Received: by 2002:a05:600c:3b10:b0:426:50e1:ea6e with SMTP id 5b1f17b1804b1-42bb0306838mr144724015e9.18.1725377484492; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377484; cv=none; d=google.com; s=arc-20160816; b=Vn+FZqFdrTZBLbh4Bht86Ep4buvbrod36uGs8uAx7/G4Ga+KWaJMzwV6B5cmnGTqxI mty9t/BkAuSuCDBJDYOcCvm0hnfJE7tEhLYFZb1rF+9wUrMHQ8yxmAc7GaqrgR9uYR1y zGdkxWQXo7l1Y71+Fv/L0CodpJ413n4znufP3lLycddrMFL1qi/S/7k4pqkq+3dIhBfz IyyI/QrU59Hshj3ZAtyotT1alGVowgxTYTKH04F47BTQCgNubHb1Qio/btfqxIXTDRN1 saKGWWohzw4AgUqQ4CuRoQswqRu1GwnV3o9Pb2wDNPpumBUDgBKSCuqNRWZcUISfbDHv KgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=IfxV3l45AuATYRBqSYcrSs80NYm/mCxoWdp8mKSl1MI=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=q/Y+Z7bXCdREVr317vAH7mdrLfkdwr01IOaFAvInzwi6NGUftCq1RLDGIgMvnrencK RYiV8oXjz2tRpEtbqSfn7B3aoHS6Sn7b3wGvKxifmRDRpX94h0JYMY3nOr/5PFCs4zK3 3g7Nyn1J2HhYtgc0p2c1dj/UQ8M8Hm32j1foe94B822VXqAu+fCV5swW7hDx8EmWfnob 2FI3ypTmWyeFeaNKpraEKy3BQXzpHum0Ct7XCAQuRmX1+BpIIftJtyrMqa+kyWZxBDV0 bhkeuiY7iIXbpUB/sIdOvpGlMdDQvvYeqHpmhxJlH5fxnBKTWBHRFk8M/YtCNch6Oemm +uPQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BdWEatxZ; 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=pass 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 5b1f17b1804b1-42bb709a75asor46185125e9.8.2024.09.03.08.31.24 for (Google Transport Security); Tue, 03 Sep 2024 08:31:24 -0700 (PDT) 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-Received: by 2002:adf:e407:0:b0:374:ba61:b77e with SMTP id ffacd0b85a97d-374ba61b935mr6453744f8f.63.1725377483800; Tue, 03 Sep 2024 08:31:23 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:23 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 24/29] boot: fdt_simplefb: add a debug message Date: Tue, 3 Sep 2024 17:30:55 +0200 Message-ID: <20240903153100.918077-24-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=BdWEatxZ; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , The printed information is useful when adding support for the simple frame buffer to a board. Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- boot/fdt_simplefb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/fdt_simplefb.c b/boot/fdt_simplefb.c index 53415548459a..22aaad9d5c5b 100644 --- a/boot/fdt_simplefb.c +++ b/boot/fdt_simplefb.c @@ -61,6 +61,8 @@ static int fdt_simplefb_configure_node(void *blob, int off) return -EINVAL; } + debug("Simple frame buffer at 0x%lx, pixels %dx%d, format %s\n", + fb_base, xsize, ysize, name); return fdt_setup_simplefb_node(blob, off, fb_base, xsize, ysize, xsize * (1 << bpix) / 8, name); } From patchwork Tue Sep 3 15:30:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3397 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6F07B3F1F3 for ; Tue, 3 Sep 2024 17:31:27 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-42bb6f0f35csf50085545e9.0 for ; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377487; cv=pass; d=google.com; s=arc-20240605; b=Z2y5qjf+cJI5EQfIDsaiqGIjGZlreS4ljuZMtQLPpccNImg46r3bzw5Sww8uyMLIEp DRATLo+YE2sIrcAHB1ML07oXnO8D+PrC7NdHI9zMIGOzXp7POUGsLnI3svBjgHI9h2AL /oelBc4zP7CpdTB6e8VT/segusMxwXPqcWZ/pkjrxtii94mkc3IgNsmhdWcmC2jvN36o T0BPgoggeV0Z8d1vZj9JrBiRhOqt4llzXcSLEPDh4ONKZCg8pFJV5P3Nu9GeG5nah9f8 VB3ck2s6zeeyIYooLu9DLbbkeAqKX5lFaAQsFpP9bg8aXhvfEIUxbaFW4pth8k6+q8+2 jBJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=FKMTbmTXvtCU3u6QoUBgQ5hbcTpWUvajOb+bd1u7PnY=; fh=/zCEQytby3BcHf8gkkX13181OSS//ctudsaLj0PAzLk=; b=NXSPadR7kcbTN0FeHPl6EEwmT9ZySjFZHecVqAka7qTG4mXBB0qumj7OBVfBZVVFKT flvi4eqU1nMf4vgiQTjirMv9Eg5kI7AokWwtc3DGTg0+oP+wHLykpbP40Y2dJ74/WF4G F/rMJIXqWKv7YXG3JwyCkxFhvNL+jhtU59l3iyTio2cRJCOJJDKrm4qPl1PP9MjyN+YD r8YZdOwbHBsT/LK5Lz86z/cuSQatNH4cjxIEtliiebwpupm9PJfeK3DJJIByokW5fnFj IDe0dPauqNjYW42xZRp4y9ycUr0NQaCB6R3cVcawTFuas/089/le68t4AXv4GdAUbRGT J3hQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IftCytcc; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377487; x=1725982287; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=FKMTbmTXvtCU3u6QoUBgQ5hbcTpWUvajOb+bd1u7PnY=; b=D9HnQy/bHFA5cnOzFIHv1GUENXYmtfLl2HJL3e5+s5Q1F1rRqbolo43IILlXZO5niN /vEwrX1X0f1smbyYVl4eC0sYngP+a6QQsZOWtxJ/X0afAfwWZluDkal4I8iMwR8FPcej TXsTJgYpMcMbZBoTKAA9OgUf/ai0loI89xgyo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377487; x=1725982287; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FKMTbmTXvtCU3u6QoUBgQ5hbcTpWUvajOb+bd1u7PnY=; b=qnXTXEeUCp7HbhMvA8nHaGaGqauzjtduc1Cftuvhru5rPkkzFm5jpTpoUaShNr/fw5 phpsYDfrIVI1ByqZEF0qJi6WpU1w8Qoll1Ffa4yUfdfPGXB9GozJB1q0XbDmaDNjXJ+h rKJDTbbaUPM9sQ3faRvwUAz0Q5a7QU4dU7EV27w89NmOdOIdR/1yVpXAtiZUx+5MUN1j q06bj7/KiWoixRa+Xc3W7YabE9pnHfT3l4CI71SlcF1QYjk5Qm3kkjFQffchPS7X9Hqu Ekcc8me9D2yRHUamKh+kyv1A7OsDhmI9o7WAnDwrMWuR2LlgARrOCS27/SwF73ZYS3qj ws/A== X-Forwarded-Encrypted: i=2; AJvYcCX7Iot5cGg6PXtDJSGYgIp4RtEBWV6YoyKGqzzi182FoyG5qQK13BOGCeKqwGBbkaBE4bC2oN5Hth99jbib@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwZGVBWfZ0/BtQ6ySUuDn/jPfRa8i3DNwDwmbUgGoJ4Gku0gPm1 AKkvpAMB5th1o6Me2fwN29sMNMKv/ABEypoJUAjF+eyc832mX9t0SaGaDeuXJXbxzA== X-Google-Smtp-Source: AGHT+IEsm4fv7CFWyRNJyRNCenSk/Ri6OR4I2W9JIzlj7iozXjxZOOzD3S2limh1vmhWrVns2g6xaQ== X-Received: by 2002:a05:600c:5494:b0:426:5dd0:a1e4 with SMTP id 5b1f17b1804b1-42bbb20568fmr101185615e9.8.1725377486910; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b99:b0:426:6f5a:9b6e with SMTP id 5b1f17b1804b1-42bb2a0f935ls16737145e9.2.-pod-prod-07-eu; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) X-Received: by 2002:a05:600c:3b9f:b0:426:6e8b:3dc5 with SMTP id 5b1f17b1804b1-42bbb440c8bmr116849705e9.32.1725377485254; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377485; cv=none; d=google.com; s=arc-20160816; b=IKOPN+pZAUY4nnQ4AYxWPZDZFxg16CBU03aZsMj6+gVqocR99d/ikPg/GIEhoKCBvp NknPK6hTVJ7R9wb11nSu514XsLKNourUBn0GnVZgNirwIOtQKy7AocYiJBzAdTgpoWKG XQfyfjjF7gipQkBbbxZmCBvsL2yFHS5tz1flRQtPy5cbjyIt7Yr5Vjt7qBiIgrv30FPj 9q9b8I0ooz4FgYtk2tLtGIqqEQGnN+nr8cHuS+c41IXIv2FfI600baXgt4mLXMdr6Gbu 8BEHrQCKjZl80XvB51HOdLllynly5J0og3DLIBeR9oY+G+Xrz6q3tJYg1C8k6BmOSYfu mmtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=gic+gQ5t4Z1X+io7eA9xlw+SaWBWg/DHtmd1XtPj6TU=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=o7NRyrb4B1J1nsBVoJrlhRnQEOm0ahVr3s9GVTuCvjzT5XMTW4V+VJB9z3H9vT5CxJ dLQkW5xjTG+lJvj5XhFNmHlUHTximqrtEyHV/ChaG1QoLn3NEl7zmUI0UiTiAJfV9IjE Ez302MZD/KrDUm9HsWXGw5Hc4gevB5GG5In+hBrS+yK+NiTgEEgSkehWqmgd66fHDW7F U2RK5bJe+A7FbFc+swZl6d0N0UUu4aupfww5+QaawoM2QgFoXabNi81N+2iC3g84Vs0x Q3G1hPFbffrG6LFHAn+lFxpKaR+ef9QOS/E91NL8OU4iF2YIDjGMnlbT38IGPR0iEZT4 mWZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IftCytcc; 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=pass 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 5b1f17b1804b1-42bb6f8e554sor45016735e9.0.2024.09.03.08.31.25 for (Google Transport Security); Tue, 03 Sep 2024 08:31:25 -0700 (PDT) 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-Received: by 2002:a05:600c:510d:b0:42b:af52:2525 with SMTP id 5b1f17b1804b1-42bbb21603amr93268515e9.16.1725377484628; Tue, 03 Sep 2024 08:31:24 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:24 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 25/29] video: mxsfb: support simple frame-buffer Date: Tue, 3 Sep 2024 17:30:56 +0200 Message-ID: <20240903153100.918077-25-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=IftCytcc; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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 patch does not turn off the power domains or reset the peripheral if you want to support such feature. Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/video/mxsfb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 4186ccd00209..254e470230c7 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -424,7 +424,8 @@ static int mxs_video_remove(struct udevice *dev) if (priv->disp_dev) device_remove(priv->disp_dev, DM_REMOVE_NORMAL); - mxs_remove_common(priv->reg_base, plat->base); + if (!IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)) + mxs_remove_common(priv->reg_base, plat->base); return 0; } @@ -447,6 +448,10 @@ U_BOOT_DRIVER(mxs_video) = { .bind = mxs_video_bind, .probe = mxs_video_probe, .remove = mxs_video_remove, +#if !IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB) .flags = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE, +#else + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE | DM_FLAG_LEAVE_PD_ON, +#endif .priv_auto = sizeof(struct mxsfb_priv), }; From patchwork Tue Sep 3 15:30:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3398 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1FCD23F228 for ; Tue, 3 Sep 2024 17:31:28 +0200 (CEST) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-53341717c62sf5136373e87.2 for ; Tue, 03 Sep 2024 08:31:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377487; cv=pass; d=google.com; s=arc-20240605; b=Gb/SccSDKR5W7u8IHxjPDJDxLa9lC0NTu+odCB+yqVPwEF8KSlVz00Ax1zmClINMoO dpLTEQSE4lKK8aVcais63Bt81Hn8ZxWfCyg31LkRdcoiI4TGkBnBYMI5yVMCiFmaNGsu cUUti6BhgueD5BPpl9+hSH5GxXe7ECGku57zxrMM39pxiWAlT4Rs1Q14tWkOhZhQjlE1 sKFKnnGlgIE3gRGwRnWvMzBRxxNRqVK1kXHy8ip76g4jPAyKZ8zWnjdicujEtG2RVMSL 6Y6Odt3HbAahq6+/GxINjZG1VxXMJ9qygWKHRx8TmAywlGmuSHM4UHtf50ofyMOjuOQg Isgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=uEbglxqtV55PAuFOk/kh1d1sFwKvr9AjqMIi6u03PFc=; fh=EU1PrTr97iyXm/91B/bftsx3ulfFrzySoE6P3X+6hgo=; b=hlSlTuTuF5Tg29NmvQIIXJyZa8RDS6oGCbc4yTp3f7J+9NHh2CehP2R6tRSS9VT+oL G/o2nPM8p5WssTjiFw1HG4YTkh2WI467DAio2QQeVkoI32UVYHg86fAoJELJ4UrtWfov 56YdpWF6eGQBtvP9XI5lCDtyBrX861wsHbf1IrCKhk95OxuCWTRJnW4cDPZEPKaoI05g JVPxbGHBW182QCeQs3D/MBQtro6UY68bts8+DWQl3IYMCXgPEWz2Q790guhj/FAijAXS FQsuTzyV21jP5+O5wGiFWht75dnovg+T43my9wyk9UPgWH1Szz7Us4Eg0CHA+e3xzPls yZeQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BBieTSo1; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377487; x=1725982287; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=uEbglxqtV55PAuFOk/kh1d1sFwKvr9AjqMIi6u03PFc=; b=rSwZCuMdqh28BtKwuiNXZcm1O0QPIL0Z5bLoV1n1sBLY9GDvdcbdXWQkntQZyPKVPS v22qE/UENSAcCqRQGmvnMVmRQ9mQu9Gro7c4Kvvqvzg4ZMG3+r0Ec6VajFCljSWUa4e/ NqIvuMH64pJz9XJ3ZpFbiJDXCs0Z4OxN3KfBI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377487; x=1725982287; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uEbglxqtV55PAuFOk/kh1d1sFwKvr9AjqMIi6u03PFc=; b=A2vqMwge+ZJvlqggUHnWXubduvr0tZh5on+wMO3hIyC4pIgTraHk3zGhXI+7k0OH+U sICBN5RasyDPfVC05gsLBCr4fLCsTClZIxm9n1GtZaxvSPlMIJbo49HVxURa3Cc4lG96 Jakli/pS1LT8zjPl5gizuHIAnB+My1NPKTwa18RXQnR+Z7hKJdHOUxVEp1zVFJCcFBRo Bvt/tA40tfR5n1sgZqdLk1v4gBXbV1S3gyqHM0RGqM7y+Q77omyLrAQkA4ZMq6DfqX2Q xgfdEODBp829DNV+Qr4HAPPOgEwkbYIyyH6tQTpFoM0Jr0pjEBUfpJiotAEFsKeyOWhY qbrg== X-Forwarded-Encrypted: i=2; AJvYcCVQXDAI9qVCgj/ozl8OEsTD0dH1aSe3R6MTEG5nNddsfmIi8tggAsRnvH25lRvSUJJ7wd8WNogiV76JCrjI@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyBsXidpSIXa9ULxTIzpC2VJVI9C5AxwaeiFegWseRs2h0q55uS oyIrMI2Dhm10Hk8ujspDd466YXR5CFLrcWYWYEn+HunZES3aBMjKi1g4oHP65kg5zw== X-Google-Smtp-Source: AGHT+IFfDnj/bJpRMKT9Qfj2VuvzslEeBhrBEXUiFGPWzH6OhhXrhbQkmh0jMIPn7WHbnmVAAxsSeA== X-Received: by 2002:a05:6512:693:b0:530:aeea:27e1 with SMTP id 2adb3069b0e04-53546bc03cemr9945293e87.50.1725377487416; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4ec6:b0:426:6c3e:18fc with SMTP id 5b1f17b1804b1-42bb2a15479ls3448215e9.2.-pod-prod-04-eu; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) X-Received: by 2002:a05:600c:3582:b0:42b:9260:235f with SMTP id 5b1f17b1804b1-42c7b5b4b72mr64879275e9.19.1725377485964; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377485; cv=none; d=google.com; s=arc-20160816; b=Fv72qaiFrcl5/7lqqDK00OAS7wzgFNuCscFK3lIUvfG1zI8cXxANmCy8xKTlHdtFbI +BjY/upGSB7g2/Lc2X9Dh+pYrMje6rbcTNavrGn2KkPa0Xh2MyZv1+3rgWwndkfhwDKW CE33yiCvx/CUFT+KHzAKmAavIG5+Pcb9yHQwweAR7umATjfYPdFXj77t/xB4dIOt2duP V6REzkI7m9xg1PoGSek7X5zrE1tCKqQQjQCqsWZaqALhyezS3oeiZ14/0KppEwDFYZX5 8pi80jpKJb066OqsQsVfBzEk8y5j4GLA42zmPwR0HfNYbG9Rln/+6c+63RsWhdZtbuUk hILw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Bnu1QvThdvnbMQYv8rBVdFr0tRSNTs4cbebITfUf0eA=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=i/UdR6JN/xK/kuYsfyAGV4fl2rpMqHWpUzsKMXKJ719MQHZWX07CzCL4uOqJ28uc2A YC6/yHHCSjRtbiAL4uAOrku8NS9Mr875RZmj+AKm/lhE5XRt2s/uRAChjidfnVo1GEZG +3BWGcAn0aDVyoY28ibXpzSK89NgUNcJF5suCsezkM0HOvbYxzJQVgRts37L8CkOtnoa YnU4jQp3iVRLnt38BpvIK3Z5fskX4ODwB5hqyTK8S9ssEGnOY6M8DO3s8CWtfF0CpXzd 2e+O+FYgrkZEMul+Ay6IsX1i2j9euDgD6cvO4d7usTnzrCF4sA97C9xZnPmFwu0CqtyV tc/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BBieTSo1; 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=pass 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 5b1f17b1804b1-42bb70bfb50sor45551195e9.8.2024.09.03.08.31.25 for (Google Transport Security); Tue, 03 Sep 2024 08:31:25 -0700 (PDT) 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-Received: by 2002:a05:600c:c19:b0:427:d8f7:b718 with SMTP id 5b1f17b1804b1-42c7b5d8f40mr65336405e9.24.1725377485317; Tue, 03 Sep 2024 08:31:25 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:25 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 26/29] video: bridge: samsung: support simple frame-buffer Date: Tue, 3 Sep 2024 17:30:57 +0200 Message-ID: <20240903153100.918077-26-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=BBieTSo1; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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 patch does not turn off the power domains or disable the peripheral if you want to support such feature. Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- drivers/video/bridge/samsung-dsi-host.c | 7 +++++++ drivers/video/bridge/samsung-dsim.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/video/bridge/samsung-dsi-host.c b/drivers/video/bridge/samsung-dsi-host.c index dd3e33c4edc7..01385f30fce4 100644 --- a/drivers/video/bridge/samsung-dsi-host.c +++ b/drivers/video/bridge/samsung-dsi-host.c @@ -1515,6 +1515,12 @@ static int samsung_dsi_enable(struct udevice *dev) return 0; } +#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB) +static int samsung_dsi_disable(struct udevice *dev) +{ + return 0; +} +#else static int samsung_dsi_disable(struct udevice *dev) { u32 intsrc; @@ -1532,6 +1538,7 @@ static int samsung_dsi_disable(struct udevice *dev) return 0; } +#endif struct dsi_host_ops samsung_dsi_ops = { .init = samsung_dsi_init, diff --git a/drivers/video/bridge/samsung-dsim.c b/drivers/video/bridge/samsung-dsim.c index 986f1d830844..6e5a12218315 100644 --- a/drivers/video/bridge/samsung-dsim.c +++ b/drivers/video/bridge/samsung-dsim.c @@ -144,5 +144,8 @@ U_BOOT_DRIVER(samsung_dsim) = { .remove = samsung_dsim_remove, .probe = samsung_dsim_probe, .ops = &samsung_dsim_ops, +#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB) + .flags = DM_FLAG_LEAVE_PD_ON, +#endif .priv_auto = sizeof(struct samsung_dsim_priv), }; From patchwork Tue Sep 3 15:30:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3399 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 816D33FA4F for ; Tue, 3 Sep 2024 17:31:29 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bb68e16b0sf62008605e9.1 for ; Tue, 03 Sep 2024 08:31:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377489; cv=pass; d=google.com; s=arc-20240605; b=O/TOIRmSyKpwe1HwxFcnk/NpOp1dJF62kWs25YCBL0TCKzpdLtjT2aI0bXiWkYWGOC ufYkMWkXDP6d6SyJn9c3sWnemOe/OM591COYpj3bhcDQkAQ5jjxvCCpZPkxXEk9j4VV7 GMDUlR2hPFF4FYashSETDRSNi77/aI3LDsDOZWAhRX/AXLmb3XTG0GjOrSbQ2s3kX3j6 XbRz4X405bEO+pOByOMk00BUwLt9yhfKuYNAVtuF8gQnkcHnvbqAXFT3veJi9fOjI5nV U18Q+NXRt1vryPZRsR8n8yLscjYsbaos3Dh1xZbCEBBgIv4C4JOg8rvjMchwvmq6N9Pw nUSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Ev9v1OUgypu+KhgIU87J9C3IBI5s0S4aDmBtueMxlSY=; fh=iOoq9pnUJH9wpp+zCq55TTZM0ocIyec6Ssft7pJAsrY=; b=KeRWJ6YDvjO90lJc7sOsBHAZkLvIqCwD2z5HspLQsfqawsDyd6Sa8QvcMvKQKn1HQf fmwyjlKddGdDoVQA7DeBqBtde4QuJHHrsr4Kr8JiGZSLS9hH2e58pM4GOc0IcqshSnFj iF39joYI8xr9g0QI4TG+OT70q5JAiZO+LVJLCOzgfUNA44P5CXDEPrV5Cg91zXSj/xwa gCrReq2HRmG2/QissLEnfr9Ky9d1x+7XEGAR9WUiJQUm0SswYt+3KpVaw7tQq3n6BU64 Vxg4k1lmYsixsh9OQq6FKlvd64tiOUmJgRN7/sLJ4P4uNNcP2yBjncP+L2QQBg1NAiy6 R/Fw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E8aPHX9q; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377489; x=1725982289; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ev9v1OUgypu+KhgIU87J9C3IBI5s0S4aDmBtueMxlSY=; b=GKHtm/moMlUtGsvtgUnxFm8idrz5yXHWbo/hUksLbFA0H4DDf531ugOEcvxZ1NwZcY wkdklDfaRBUTanRjaHjaSipyKjsAHiZgk/pbrOEOKbl0x8OyUSkmQwOEQfFy3c46YP+x LKuhmdvJ87t46UgeCpjpqUTdaMLHwDNWpUaJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377489; x=1725982289; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ev9v1OUgypu+KhgIU87J9C3IBI5s0S4aDmBtueMxlSY=; b=tMjhVe/nY8SzEnruGR9xhX6cdlHnw0lcY4g52k7brW6cBiugJma9P/g5pOA7J68t+e 04DhyI1jKriq4+RAZ1Kqan80y0z9UeynqSEhudF55lQnN4fb0A7qHX1g2AGePoZTeh+y nOyPIpTEjNiPkxcE2YSSfm5ZHPMZIpW9i1vW5ZhPhcLBIOxZbWFNWrRxtJRfj8O0LRyh yfcI8ryHFhoxw2FIOA2jCTRgP5VUU3glEpdH92aiNM2Ao5vKKs9T7JX2zw1fJQbFCHqW rrnp3T1ohpAJJh+enxhfvaVRCiN91qeeneAM7qEi5vCAhIWI/NnkaTzIbVhZfNpcEUyG 7+Xw== X-Forwarded-Encrypted: i=2; AJvYcCUBx2tB9fYZC/a8vF4FWQ8ZoY5mmKMG7P7Zx9OJPmPqnmKs3NsZ2k7Sy+L7Sn7pYItt+Y8/3hwWpkR89dQ7@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yz4p2+r18T1DBAeUIAgqwXkon9kO3FJBGZ6MxlSU98qID9JkRQg WkiUkTXL1efttJOExhDq+rKXnddfZDdDAGKdu/9yKE8keBMzEUy22CQfnoNVOa/NNQ== X-Google-Smtp-Source: AGHT+IEzppmEzXO2+4ovc98JXUagVIkfSAph6/qprArvILxHC/GeXUT100dADx38cTCZPhUb+hPmBQ== X-Received: by 2002:a05:600c:1c0a:b0:428:15b0:c8dd with SMTP id 5b1f17b1804b1-42bb01c1e95mr173653415e9.20.1725377489097; Tue, 03 Sep 2024 08:31:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:426:7318:c5a0 with SMTP id 5b1f17b1804b1-42bb2a0f33cls1327775e9.2.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) X-Received: by 2002:a05:600c:5102:b0:426:690d:d5b7 with SMTP id 5b1f17b1804b1-42bb01ee5b3mr158931735e9.25.1725377486774; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377486; cv=none; d=google.com; s=arc-20160816; b=SeXvBdmdKxY7P4xRiU9nPB2L9GnfmtgMabkrejxyUlCeWFY4VuySm8Xo82bmIHQtu5 2i4GGlRnJm/MaWTqAZ7n8PIdEkLxAmw8AD8eaR20A/Q2SRCBEGUP4h9dgTR77JXCsD7a MTdvN4AF6/tl2ue4S1E+rmxn9Myw114cwfzCnAlgsYjCT7rDdsDYYdGOYv8BDgwgBss+ CHoRKfN+/CJTKHLEknSX4WIV6RPo8YkAEBeWamtmvPzRUBwNkcyeaPcdWAEAU3Nv2Du/ EaUjgQg47e7ccn5kKq0hTYOXsUUphMBTFbgWasaNr8p9jGw5msGwlobTnyiZ1I3uOOUB b9Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Ty/eOojOBL4vgA9lyzKZZ8YJqhIjNzllwra781C5YKs=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=fcI7bIYd35PptdvkqXQb99/YO0o2wOCDxUCYxKIbR/YD3nqmpj9wXTN0fCN9+8tbmB WqYl2YbCoektBO6a3sQcjt2Nrt17kMjXjAk8SeXVZk7pjZxPCD1eki1e7y3pXmdeXC4/ o7H4ZH7MV85N1yIZALqcvK0XKbqcUCSBjdjnBFfYA3jXAnb0EXqBWRhDV18d1/IskB3C AhoKFu3V1OQZ/izIPxPUS6wvgirJbyTmzCDhe+UJSbsKfYd4eJuoYcUF47jcx8VqoXS8 yjrhJS+WnPSXaEzqaW5+oOzg8XrAeYKFVbdgT4pmZU5t2/iqzniVZpRoo55DMhcwxyPd TUpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E8aPHX9q; 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=pass 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 5b1f17b1804b1-42c8e41b1f9sor3577575e9.7.2024.09.03.08.31.26 for (Google Transport Security); Tue, 03 Sep 2024 08:31:26 -0700 (PDT) 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-Received: by 2002:a05:600c:1d8b:b0:42b:892a:3296 with SMTP id 5b1f17b1804b1-42bb020d4eemr146192715e9.37.1725377486177; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:25 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 27/29] bsh: imx8mn-smm-s2/pro: support simple frame-buffer Date: Tue, 3 Sep 2024 17:30:58 +0200 Message-ID: <20240903153100.918077-27-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=E8aPHX9q; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: Dario Binacchi --- board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c | 98 +++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c b/board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c index c99896873991..fe2f91b82a2c 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_init(void) { @@ -20,3 +22,99 @@ int board_late_init(void) return 0; } + +#if (IS_ENABLED(CONFIG_OF_LIBFDT) && IS_ENABLED(CONFIG_FDT_SIMPLEFB) && \ + IS_ENABLED(CONFIG_VIDEO)) +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_MIPI_DSI_NODE_PATH "/soc@0/bus@32c00000/dsi@32e10000" +#define DT_LCDIF_NODE_PATH "/soc@0/bus@32c00000/lcdif@32e00000" + + const char *dt_addnode[][2] = { + { DT_BLK_CTRL_NODE_PATH, "lcdif" }, + { DT_BLK_CTRL_NODE_PATH, "mipi-dsi" }, + }; + + const char *dt_addprop[][2] = { + { "/regulator-3v3-O2", "regulator-boot-on" }, + { "/regulator-3v3-O3", "regulator-boot-on" }, + { DT_GPC_NODE_PATH"/pgc/power-domain@3", "fsl,boot-on" }, + { DT_GPC_NODE_PATH"/pgc/power-domain@4", "fsl,boot-on" }, + { DT_BLK_CTRL_NODE_PATH"/lcdif", "fsl,boot-on" }, + { DT_BLK_CTRL_NODE_PATH"/mipi-dsi", "fsl,boot-on" }, + { DT_MIPI_DSI_NODE_PATH, "samsung,boot-on" }, + { DT_MIPI_DSI_NODE_PATH"/panel@0", "syna,boot-on" }, + { DT_LCDIF_NODE_PATH, "fsl,boot-on" }, + }; + const char *dt_delprop[][2] = { + { DT_BLK_CTRL_NODE_PATH, "assigned-clock-rates" }, + { DT_GPC_NODE_PATH"/pgc/power-domain@3", "assigned-clock-rates" }, // pgc_dispmix + { 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_addnode); i++) { + const char *path = dt_addnode[i][0]; + const char *node = dt_addnode[i][1]; + + offset = fdt_path_offset(blob, path); + if (offset < 0) { + printf("Missing node %s, err=%s\n", path, + fdt_strerror(offset)); + continue; + } + + offset = fdt_find_or_add_subnode(blob, offset, node); + if (offset < 0) + printf("Failed to create node %s, err=%s\n", path, + fdt_strerror(offset)); + else + debug("Add node %s:%s\n", path, node); + } + + for (i = 0; i < ARRAY_SIZE(dt_addprop); i++) { + const char *path = dt_addprop[i][0]; + const char *prop = dt_addprop[i][1]; + ret = fdt_find_and_setprop(blob, path, prop, NULL, 0, 1); + if (ret < 0) + printf("Failed to add property %s:%s, err=%s\n", path, prop, + fdt_strerror(ret)); + else + debug("Add property %s:%s\n", path, prop); + } + + for (i = 0; i < ARRAY_SIZE(dt_delprop); i++) { + const char *path = dt_delprop[i][0]; + const char *prop = dt_delprop[i][1]; + + offset = fdt_path_offset(blob, path); + if (offset < 0) { + printf("Missing node %s\n", path); + continue; + } + + ret = fdt_delprop(blob, offset, prop); + if (ret < 0) + printf("Failed to delete property %s:%s\n", path, prop); + else + debug("Delete property %s:%s\n", path, prop); + } +} +#endif + +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; +} From patchwork Tue Sep 3 15:30:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3400 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3ACD841751 for ; Tue, 3 Sep 2024 17:31:30 +0200 (CEST) Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5334c7d759dsf5345761e87.3 for ; Tue, 03 Sep 2024 08:31:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377489; cv=pass; d=google.com; s=arc-20240605; b=LwjKK1r2BVQAJn2yfN0KxGvCOK39mKaQ9NA600gn21VCAvVTP8FdjkpbTuQREU63GH batEUiWMoUj4Qdi5jyp2k6xmXDj9kFrcqzB/2Z95gVaTraiHE04AFuChrEzA3cH8bt7X qV8b4jDBVOnnmct+jVMh4Vlw7msUfk1WC0ezqCV+m4Em1kyoRCLISYhnqM8OMZ4l5joG lDAm/wZm2yaWAchaSaBXCZYvBA8+h7339Gr2YXZlfbxfx+YkDeJbdbrmgewIJFKwriqr 1B/F+1Xt28HHQDwsU2JW1YEmZXkM1DC0oSDs2oILdHgyrVFfFmvyB5wsESN56YkP8wij NLrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=macxgNsLvHc/IwqLGAkFfEzm/q8jkcexzi9n63gPlpk=; fh=pUEbzAr+x+q7EUk/ZJt78lQHntUjB3GX35O54VooHbc=; b=Dhawr5VCZN5u6qc+UCy+FacCQQZxGasDH6+05NLxm8Usmtvb2umEgo/7D5Qx9UoF7U 4ffzeHk8TkWMju6z+4edaluhdfiEWKjOV5DhlwtPEJUknQIp+EJQq/On4RsgiWbGmeGL zPiZgGyGDVi+7qFOr0P2MyrZZlY9cY3mjnaqH6Hx90tGlvbSHc2lShSBj92vY9rTpiqH D6yU+mWhcww1leuP245ETueTFoQjLMsAtx+VlnLEqiLezj0bAgEiZi1hYe79fcVyBsHn 2/oRtxUrhXaoV53LA53XEnDyYoVOeLA8UutcjxbBalMdn8lAf6WBJuvm885Vz8QYaSg2 x/Iw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZmLP10jF; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377489; x=1725982289; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=macxgNsLvHc/IwqLGAkFfEzm/q8jkcexzi9n63gPlpk=; b=ar1Wr5ftS0n2yA4cy8HHdFhTaZc5EIREKVJZVrH9QHJaXtFpaSP6iYJnNYZ74D2iyg hEbu5Y/NjMTXea8eEeyu0cX6wGdhUiiGgLwz5wlsQI4szG0TTNcY3ve6kXvhOfTD9/m2 O9EpZva7JuEUKOnkVCEMf1Dd8+6IKb3Ltrnd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377489; x=1725982289; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=macxgNsLvHc/IwqLGAkFfEzm/q8jkcexzi9n63gPlpk=; b=m8R9JDiR4SZ2Je5Dh+ZLhSJPv9Z9vyffbA6ofOVv002ZQGXjJJjrtYf6T+l9yIm8Mp pZt6LODk889EAy10GFi67Lct1SAlup+B9Hj4J6inV6slF6QViIdmo5ch7NYZQytTa5Nh nb5sCSOJ5eYKX/+lZY7Rvkg4T61DcKEDluxs0fiG61VRDT0LZ78vL0N9/F1SqVlyaojl PWaTHJY99DzsNQ9Z4NRNVUXUJu8tQDM+acGIRK4LSvTYt+OJERYUIuVj/i0Gh1u/kBf5 3F3uYAEaiDqR840AeQfexzrSy3yTGMgT58DE08YCHt+LreWNJcHPjczdrS1IftUoy4rL yhtA== X-Forwarded-Encrypted: i=2; AJvYcCVk/JD7BckMaZJXCWgMnXzxHZbGo5H+wTC7xcQliUvYUIfyFq+3SE7vz5s3/wJB/DCpd7hBacEXIsrZXjWd@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzSNSXAcKAa0UZjWsC+KqmZN3v94P0i+yybKHLxOdqfXlZ9YGLY 4k7fA3ZCCLNOE66YLVhKvAiZWFAoedVpk+BnmlCpgQmoVQ1MWHRNeBqbkMBij6E4Ow== X-Google-Smtp-Source: AGHT+IE+Sc2W1wNI0hqKmRYHTaiZwVRr8GSPl+3R1whX16D+ImiMqJycxBq78WF6T+ldstur4KFHkQ== X-Received: by 2002:a05:6512:12ca:b0:530:ac0a:15e6 with SMTP id 2adb3069b0e04-53546aefe5emr9139186e87.12.1725377489492; Tue, 03 Sep 2024 08:31:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:398f:b0:533:483f:9569 with SMTP id 2adb3069b0e04-5356483c06els14809e87.0.-pod-prod-01-eu; Tue, 03 Sep 2024 08:31:28 -0700 (PDT) X-Received: by 2002:a05:6512:3d8f:b0:52f:228:cf80 with SMTP id 2adb3069b0e04-53546b90f81mr10149845e87.40.1725377487652; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377487; cv=none; d=google.com; s=arc-20160816; b=enjRlmGxLrR3sN2yymRmV+afqF73WpL8O+kWLMJTZa6YgIum03jqJwK5S5EAcvvUd1 Ye5ECaMRF+HBG3L5FNp7FyX0taRkyKpQWlTEazp1GfOEg7r50LIn9mAsEsw5W+bLfp+B ZxeH19bt1rJKJkBKTv+iqChAkgb1KFvSVZvZ0WoeSDIjhDc3LgJEkBEgXL7HJCvJpodx ZMZlF418TugnvyHQk5o2CG09phGNn9bajgUrS1VkPhL45+PwIGuGi5J+gPFJwTpr4ON2 cKTrsN3lJarPokuyYHc+3NiWJ4HJFJ/pGHJYzTT3adt/PacotYb7FQNf2tTuJUTzYfqx 4/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=NwkwZRURV7EPbL/ifgkUGO4vf+ImYjQotXUOoWcRyVE=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=pSC4X2gFM9B7MIzyoxJvzrHwpGakUQ40qNPYOQjZIHoYvYnYsBtQzGjvoW/FpWYAV9 L9+TB6+bv17DknowxKbeto+xriEkQubqfTxrSatX37lgXHEyVQSzoR8G3d51/UohlbXY WcVl9tag5hkjhemjB2eoB4DeHrLzFe7wRLqX5gLKxzoRQsFD1Yb9nrVoKdqc99Odo80p wYYzqi4+BUjNj865q2ZlxW56ilAwpg6Auhbzy6NV8GfkkxwhQeSKgvFl5MRheKTyydDV 92WepdKi+sYBxkHNjEv8rXSGwZvgJbvJvlm3lmHqxSVlyyiHfPul23sZmoCOYIXNn9ol 3Osg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ZmLP10jF; 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=pass 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 2adb3069b0e04-535407e710csor3446626e87.23.2024.09.03.08.31.27 for (Google Transport Security); Tue, 03 Sep 2024 08:31:27 -0700 (PDT) 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-Received: by 2002:ac2:4c54:0:b0:533:455c:8a49 with SMTP id 2adb3069b0e04-53546b91324mr10190781e87.38.1725377486886; Tue, 03 Sep 2024 08:31:26 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:26 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 28/29] arm: imx8mn-bsh-smm-s2pro: remove logo options Date: Tue, 3 Sep 2024 17:30:59 +0200 Message-ID: <20240903153100.918077-28-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=ZmLP10jF; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- configs/imx8mn_bsh_smm_s2pro_defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/configs/imx8mn_bsh_smm_s2pro_defconfig b/configs/imx8mn_bsh_smm_s2pro_defconfig index eb1275a44307..1d80e78c8f63 100644 --- a/configs/imx8mn_bsh_smm_s2pro_defconfig +++ b/configs/imx8mn_bsh_smm_s2pro_defconfig @@ -109,11 +109,8 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y CONFIG_VIDEO=y -CONFIG_VIDEO_LOGO=y CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y CONFIG_VIDEO_MXS=y -CONFIG_SPLASH_SCREEN=y -CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_IMX_WATCHDOG=y # CONFIG_FAT_WRITE is not set From patchwork Tue Sep 3 15:31:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3401 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7FF753F360 for ; Tue, 3 Sep 2024 17:31:30 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42bb68e16b0sf62008965e9.1 for ; Tue, 03 Sep 2024 08:31:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377490; cv=pass; d=google.com; s=arc-20240605; b=e4IQlq4NxamKdccuJpgPC28gCW5Vg0G/Ndcq8HxIcAf5qz6TRW+iowq9Cm6EiIDskG NSHliirOzV5FQf0GSDoD4SfKT6nsn+AhLS0poOSIesHtRd6o/8ll5L7/Icv87cVs36s6 jQJlvrrfz8mzFFinvGn288gttA4FDejHamZ6LoLRG0/Bi5yWMpFdETIZGt6F5o9VxerZ ncybYnuR2V8LbrCEjj6Fs6sH67oWe9CvbtfqpsJn9ge8Rirg8vt4TSIaArFJWARoCwKs ToAqTq3dTLJrVXSYV0QOTLT9e9B4ScPPSxjQ32ZT8T62B61tydpuBlZEGaOdiNcIP1fj HZsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Y61+c0OBlpjSCxW0U1TEA+UmEqkBSOytZGSH8XuaDYw=; fh=D8hnB0SKYf59uLjijdYM8uun4BcNQF5ukp7Hed93NIE=; b=jw3YI668XFd7NOpGeJ3KW8K95cVBIs0frDKzw3HyZtkzDY4BJDMnudnt7OOXR23wEy 3JHGA2FiH0Rs+3KF9yZZ/Mdn4juQx0Axasl8mgo62rJaAAvjWD84+CxirPu/koh4hCfc gHXpCUDHSzHcQwY0QsR4ioqhknydZ6Bm9ZEi3W4aYKWDQH64bM+rt93bFk2EImrUy8+K YmIMkrZhlBLvTsJiUpKYmTu6gwlvnEJlFizuGmPJO2c4J9G3iY5TT9szuLQx+ow4FXlH FdT1GaQrKCZ0w5RGoQNlQ/7OGaaWGsb9xvO+uzKoF0JuUCCT4E2at3mwx04Sc63fccLH rVIA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=crbXripy; 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=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377490; x=1725982290; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Y61+c0OBlpjSCxW0U1TEA+UmEqkBSOytZGSH8XuaDYw=; b=E3msTqj7Hn+99G1deR6Fhdb1zGdG5TCAmxBqDxNHuxL2FfGPNU9vr5D1n3Yb7lRKFh 2RC9uNnlkxHrRJVlvwfzOT6dWk4TuxB8kKzvt9jtfJnBsJ6oSmIdC6+5ipK3NxP7+1Bv 8mHUz1RcFBjNaqI3QH4PuUpmpLoPPcRZsiCJ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377490; x=1725982290; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y61+c0OBlpjSCxW0U1TEA+UmEqkBSOytZGSH8XuaDYw=; b=HSxukQR2ZWm1BPYHS/vUmXSdQA837QxAXuH0556lUIVtCye4eKOmzok/BFNY7feukY 8NPB4UuRaFe+IGE3hilfSyOX/zK/ovE9zG5PY/EhgeJUsXJxNeOD5wZAsFyqJRqGrCG8 lUsElRTgoa0RQ1avr4kSzafTIYycBFwEGXu2a6DxUF/rw1AZDfVjixGjG2QW8bhXTYai uFW2GgEQIBIu/9l0LGC0v0snRZV+mnvfZUMyx1MOLxrnis1Jqxj/TEu/EYh5Evn94V4Z VtsiBVbIzP5L5tgT60KDNwG8og7tQaOtyO01ulOS9zOmdXAM9jb/pvTSZL24PExWhQ43 BGJQ== X-Forwarded-Encrypted: i=2; AJvYcCUTitzORvncrg3DbzCzlTAJ110lSiLfWE4QITCydp/3YPaYyoVWCLQw8tuto4GVwqNt5gBW5lFWOmv3W6w9@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwrLlcfdWmtgu+A9cleqt1fUxb/zXya9ezocBvCE0flpCgdWGnX XpjAHvIeqa4cfWw8mWhpJ9B27fXhjaLNTUYo2k0oDSrq6DpVet4U/gd1iXlKOjFjfA== X-Google-Smtp-Source: AGHT+IHSjYPTQN3PG9ulju7IqIDy2mIMGSe8tU1SpMNpsnyxR1FiuohUiLuaLJzdXaHk37+p9P8T3g== X-Received: by 2002:a05:600c:474c:b0:429:c674:d9de with SMTP id 5b1f17b1804b1-42bb01ad776mr155675505e9.2.1725377490026; Tue, 03 Sep 2024 08:31:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3c9e:b0:426:6eb9:5098 with SMTP id 5b1f17b1804b1-42bb2a057fals1335705e9.1.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:28 -0700 (PDT) X-Received: by 2002:a05:600c:4f07:b0:428:f0a:3f92 with SMTP id 5b1f17b1804b1-42bb01c1d40mr172878075e9.21.1725377488401; Tue, 03 Sep 2024 08:31:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377488; cv=none; d=google.com; s=arc-20160816; b=UaDXvDbB495OUpWBtOQk5OI4fArBSnaMUfX2RsS3YhHJizLAAc8Fa/bsdCPvSW2uPC kTWCZPcuMMGWZknV2Jv4ihs4sgPW86aVzP9wSt3OgTt1oGgIIwuq4SY5EZwtg0QpK0lJ z58V88NlI2uFgoVbaRDpnkMKiWR+w0YH7V7uDYcRocLR/iThoeriWP3DPPIr21RYsLum VchE4DqoZaBJ84ooJQlPiqPb8HzYWOQpwElalHLd1o7p29cdkhWNBXoPlKLnbQxPA8FO lPOGU7mQnxvFurma0OPJb6lUAupn2Gv4rJrm1TmXktP6633L71q4d2LzxSwkHRhER/aN KWkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=PKSM0TRZ/+1vjeoMA3RFVYGOLDnlR9o6lLjqyGnI6HM=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=qiK6cQpeZdFCAelh+sFbKTiTmoQKvWafV60CN2qcVBAgm4WexXLP6WVXYt0h6CFQBr PbjFEYs1zs0muTRUsWIUVbvV330jfrLtuY8bpvrlOMjWFqZ/I5ruXcjcn8tjN1aQWaFD YVUpu1tR9M2ZB54jBdzkWl8e24y30V9iFnnbL3iR1Us0XWLGunC/CzAu0cmGofyugH09 Z79kjc5Fr4Iyd4sVZFbTj5+8B/6Yl0I83tjGLbNIIs4rBlbYsS9Lv2zzTJSMzDf/UhfI CtI8hUg0Yjbl4t6EFgXSmcXc/K53OcOrizjCuLODZYqQCO1HQgc1alS0GBPMuICPv/PV 4Jiw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=crbXripy; 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=pass 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 5b1f17b1804b1-42c87b8d20csor4113975e9.2.2024.09.03.08.31.28 for (Google Transport Security); Tue, 03 Sep 2024 08:31:28 -0700 (PDT) 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-Received: by 2002:a05:600c:1548:b0:426:59d3:8cae with SMTP id 5b1f17b1804b1-42bb01b9302mr160724875e9.13.1725377487716; Tue, 03 Sep 2024 08:31:27 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:27 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 29/29] configs/imx8mn-bsh-smm-s2pro: enable simple frame-buffer Date: Tue, 3 Sep 2024 17:31:00 +0200 Message-ID: <20240903153100.918077-29-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-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=crbXripy; 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=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" 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: , Co-Developed-by: Michael Trimarchi Signed-off-by: Dario Binacchi --- configs/imx8mn_bsh_smm_s2pro_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/imx8mn_bsh_smm_s2pro_defconfig b/configs/imx8mn_bsh_smm_s2pro_defconfig index 1d80e78c8f63..456e0006f44b 100644 --- a/configs/imx8mn_bsh_smm_s2pro_defconfig +++ b/configs/imx8mn_bsh_smm_s2pro_defconfig @@ -29,7 +29,9 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000 CONFIG_SPL_LOAD_FIT=y CONFIG_SYS_BOOTM_LEN=0x2000000 CONFIG_DISTRO_DEFAULTS=y +CONFIG_OF_BOARD_SETUP=y CONFIG_OF_SYSTEM_SETUP=y +CONFIG_FDT_SIMPLEFB=y CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-bsh-smm-s2pro.dtb" CONFIG_SYS_CBSIZE=2048 CONFIG_SYS_PBSIZE=2067 @@ -112,5 +114,6 @@ CONFIG_VIDEO=y CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y CONFIG_VIDEO_MXS=y +CONFIG_VIDEO_DT_SIMPLEFB=y CONFIG_IMX_WATCHDOG=y # CONFIG_FAT_WRITE is not set