From patchwork Sun Apr 21 14:07:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 3082 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6414840CB3 for ; Sun, 21 Apr 2024 16:07:53 +0200 (CEST) Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2dccd9dee76sf20224321fa.2 for ; Sun, 21 Apr 2024 07:07:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713708472; cv=pass; d=google.com; s=arc-20160816; b=xle9KzwmEvyTWTatohiwjDwDzMVmOS3djPJ77IWz2+41XauNNK2ErR2E+ARYebuJIq Ygf5LqDY5yJKiRyyjvht/bFsoNec6c/uWv357v/YuLdngy7CWb6XMryfQEp8x4Wvm1wL VwkkvcwTSWLZloy2ixcKLfXxuDfs3u58Z6+7WTX4+wpG4vnMWgztM7JvNtgbLZrWDpEs SXwvBGboY5dERuXAuCa1S3QHV0YKU9h+tR0B+e7W6uTsgeoyDuqdjtCHki9oCTgjoFlA L/dy0pvxFYNRSfFMyEnPRBEOgrEYIEM606QB6hkImnK80xgn0scoYKH7BTZTigxcxkaA cECw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=d2r+QbRNbY34Zv5v1Lj2uoc539arB4zRXXRBrZwqJNA=; fh=T32O6UtTiCJv7if+RPfvblLcGjBmnGAZxwJYYNFFof4=; b=VDaQ419LU+kMqkw0/deNe/RGFPSqmsepvav7N/DKGL9bQw3lF/+3G3j/p1SFktPBMq 3btAsObC4zYt+MWyF6L4kkwxQoFRxVpbrTs4TqcSxQDWjpQPFuKn8a4UVh32e7YowVH1 9b1dvCHlgmc3zOcGMpQTckPZk6xvyDVfk9CU4xls/MWZ3Sdc5ecJKFISP1sclg5JAAks RFSN5N/NE6Lj1/uJj8hgF4pqcrbPqH9SgJVXvYyysOtgt7UZ6ehqPik6DwwX6ZelVaD5 w9B1mvqV1i5YlMf63aRv+He9q5nBSv6LvOmlu5QmryzdNznxT6wubPcqZGGsXqEP110Q 90ag==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RWEV1ApP; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1713708472; x=1714313272; 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:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=d2r+QbRNbY34Zv5v1Lj2uoc539arB4zRXXRBrZwqJNA=; b=evk85s+nH4fp+6PTE8okENaYphHgg0VRm0mbKmTrJ85GtFPhLnbtu6Ob58aZaRVC4l 9Rqlyj/0K49l+UhidgIk1Y4Uy109ydzSiIdJXHmSFa0jId4ghKckC781XSWlkOOGMZC+ moMVTZlXrIjOWoi52ZidNqZmQblPjOwvz/Ck8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713708472; x=1714313272; 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:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=d2r+QbRNbY34Zv5v1Lj2uoc539arB4zRXXRBrZwqJNA=; b=Cpxc/8B8dcqEcrWtmCzKBJPP48a361wX8P57RXbewP6SZ0Vn/uSgmxGEvIYtIAi11J t/Q4JEZhmaQcV2yxiyI+7NszS7wYJK1OihywB5kaIUMGxmJGzEM+xspRFE8mUokao6Ne ohiVOiYvRQ7MQCXtZln47y1/M4Cz5LFw5J0sO9B/8PhKHiXDTHwJEf1H9UjSfCOA5J/3 5fkmxLo4avhJqEh25sAg36tqybBJpOch+9FduouO9ohr/f3XyXbpl8GNVgHdfYtpeMum 5Y0RrAEASYwAFdHPGhBSSyPdHD/AHrwUYUYPDkeQVhQnz0cYmBBLPXymKJlKkY+J15tQ dhyA== X-Forwarded-Encrypted: i=2; AJvYcCXO/7EQjl81nwzQGXAq+mrAjBYnykkGHmvDk3Q0OTDQed116J8fjk/RxoHUzcYABxEjM3GDmGX0W7yDCdO7mK/GObsNXotSZ2cRvHH9tyg1wyZkJy+w7XI9myurcw== X-Gm-Message-State: AOJu0YyzBFCzenRcmR/wq/F0p/kGmIRWo87StpvLLpYuGfBwVWg7k1uY zWMb39cjKIrFtqwg7qGnePA+xKwk8E5mhfdH1oMg6QOVzJ7yqlm6fgbsBSXrKKPLCnwn3KhZVw= = X-Google-Smtp-Source: AGHT+IFUY7B8/zmlvyahRwVJnmpGDZkbSRIRKWB0nNHtF01mVLsUTiPz86tcT7xPD7c0Zu/8G4/Keg== X-Received: by 2002:a2e:9697:0:b0:2d8:729f:cf3a with SMTP id q23-20020a2e9697000000b002d8729fcf3amr4598248lji.32.1713708471781; Sun, 21 Apr 2024 07:07:51 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:3b13:b0:418:fa47:e914 with SMTP id 5b1f17b1804b1-418fec2b756ls12804485e9.0.-pod-prod-09-eu; Sun, 21 Apr 2024 07:07:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGxkpDMRsClKme0KZyu0rG1+D5xduPNujGXRyKVZsf0125jmU2fQGeWKUHNcBx/Y/8r3lioXo07QvCjT0//Gn0CyxGTm2DRGR9ZgICp/zkMxVz X-Received: by 2002:a05:600c:1394:b0:418:e6a1:c0e8 with SMTP id u20-20020a05600c139400b00418e6a1c0e8mr4838129wmf.7.1713708469935; Sun, 21 Apr 2024 07:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713708469; cv=none; d=google.com; s=arc-20160816; b=jKpDwD8JX35aiOftD3G0Tnnna3dRXaprEuZIYTw/P16oyIj9nnMTg21WyrJ7Iq6VPz +i3pHB7uID0iealjWw++Yv1jT2JpmpA1J1Z6LanxN/C7/4E+QmgB53Wp1T3B7M8HMiWs kB3Iq+Dn5APIjx6rfk4NhWeZ+7W6klMTrE9hwi/eNZrFd4yka+L3Qz1R+yrTGOfAAJ+j mVNTQZfq9ULs8wvBFeXyxBikL2uLiZ8dnM8eWdjSkShjKVuh7wDN7agDylUdqBZMllIK o+8F6Wk8hCjqQ0E5xjJ4zMLC34Wo4SQcC3QdBlk7Ju8278SNQi6QrVltKZ0CVyazqEKt vemQ== 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:cc :to:from:dkim-signature; bh=pRn4ZyunEviE0YbPOFSQffFYSR8jGupbyCCDFq4etgg=; fh=xtu2aR6yN/LM46fS9uVUS5QEd0Qk0y68VzgkxnpMrug=; b=bkqz5lzkqzvIez+2ODPTjBPYIZe0g/N2hnb93l2o1+VH0xSm+7VLtP6yBm7xr9UIJ7 skI7QXX3rOxscwCpsVTy7DOBIcVTSosn3Bh2kcfA4YnGftnJ6BYoEvcqSZlP+lnKmFwH SqitoBrMmDXG1KqF2MON+PKbcKS8r726/6h9FXZP6H7pRcQb2QBLRcK5qT456uMIzxVc jyeFJW/8NwqriJS6SiZ6cViU0fDmDWRtcvYUA84wQrESqwJJAri49T0pOin0DJ1jM9nU CCeWO+OHEff+Ptm78xJE6VWdOMXqGoxGE0odaExH/F+Qx2jT2fUPpCKDtwMoOb8AAfai Pnvg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RWEV1ApP; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 jn17-20020a05600c6b1100b004154b4b13aasor2082580wmb.12.2024.04.21.07.07.49 for (Google Transport Security); Sun, 21 Apr 2024 07:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCVDiY/Ilh16YBwNCgIjLGRrzq4z4DG+uVJtPBj8Uqj/jxzHc0foAzsuQV5UX4fcTBcs5PqesQq4pI71+M3/k0i3QuIRodXI6UdUHvEBsMKDd6AH X-Received: by 2002:a05:600c:310a:b0:41a:5d49:8cab with SMTP id g10-20020a05600c310a00b0041a5d498cabmr20752wmo.11.1713708469403; Sun, 21 Apr 2024 07:07:49 -0700 (PDT) Received: from panicking.amarulasolutions.com ([62.18.232.149]) by smtp.gmail.com with ESMTPSA id r13-20020a05600c458d00b00417f65f148esm17314734wmo.31.2024.04.21.07.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 07:07:49 -0700 (PDT) From: Michael Trimarchi To: Lukasz Majewski , Sean Anderson , Tom Rini Cc: u-boot@lists.denx.de, Fabio Estevam , linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi Subject: [PATCH] clk: imx8mn: add video clocks support Date: Sun, 21 Apr 2024 16:07:45 +0200 Message-Id: <20240421140745.25870-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RWEV1ApP; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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: , Add clocks support for the video subsystem. Signed-off-by: Michael Trimarchi --- drivers/clk/imx/clk-imx8mn.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c index 457acb8a40..baac79dd29 100644 --- a/drivers/clk/imx/clk-imx8mn.c +++ b/drivers/clk/imx/clk-imx8mn.c @@ -23,6 +23,7 @@ static const char *arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", }; static const char *sys_pll1_bypass_sels[] = {"sys_pll1", "sys_pll1_ref_sel", }; static const char *sys_pll2_bypass_sels[] = {"sys_pll2", "sys_pll2_ref_sel", }; static const char *sys_pll3_bypass_sels[] = {"sys_pll3", "sys_pll3_ref_sel", }; +static const char *video_pll_bypass_sels[] = {"video_pll", "video_pll_ref_sel", }; static const char *imx8mn_a53_sels[] = {"clock-osc-24m", "arm_pll_out", "sys_pll2_500m", "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m", "audio_pll1_out", "sys_pll3_out", }; @@ -30,6 +31,10 @@ static const char *imx8mn_a53_sels[] = {"clock-osc-24m", "arm_pll_out", "sys_pll static const char *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 *imx8mn_disp_pixel_sels[] = {"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 *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", }; @@ -139,6 +144,9 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_SYS_PLL3_REF_SEL, imx_clk_mux("sys_pll3_ref_sel", base + 0x114, 0, 2, pll_ref_sels, ARRAY_SIZE(pll_ref_sels))); + clk_dm(IMX8MN_VIDEO_PLL1_REF_SEL, + imx_clk_mux("video_pll_ref_sel", base + 0x28, 0, 2, + pll_ref_sels, ARRAY_SIZE(pll_ref_sels))); clk_dm(IMX8MN_DRAM_PLL, imx_clk_pll14xx("dram_pll", "dram_pll_ref_sel", @@ -155,6 +163,9 @@ 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_PLL1, + imx_clk_pll14xx("video_pll", "video_pll_ref_sel", + base + 0x28, &imx_1443x_pll)); /* PLL bypass out */ clk_dm(IMX8MN_DRAM_PLL_BYPASS, @@ -183,6 +194,12 @@ static int imx8mn_clk_probe(struct udevice *dev) ARRAY_SIZE(sys_pll3_bypass_sels), CLK_SET_RATE_PARENT)); + clk_dm(IMX8MN_VIDEO_PLL1_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)); + /* PLL out gate */ clk_dm(IMX8MN_DRAM_PLL_OUT, imx_clk_gate("dram_pll_out", "dram_pll_bypass", @@ -199,6 +216,9 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_SYS_PLL3_OUT, imx_clk_gate("sys_pll3_out", "sys_pll3_bypass", base + 0x114, 11)); + clk_dm(IMX8MN_VIDEO_PLL1_OUT, + imx_clk_gate("video_pll_out", "video_pll_bypass", + base + 0x28, 13)); /* SYS PLL fixed output */ clk_dm(IMX8MN_SYS_PLL1_40M, @@ -275,6 +295,9 @@ static int imx8mn_clk_probe(struct udevice *dev) clk_dm(IMX8MN_CLK_USDHC2, imx8m_clk_composite("usdhc2", imx8mn_usdhc2_sels, base + 0xac80)); + + clk_dm(IMX8MN_CLK_DISP_PIXEL, + imx8m_clk_composite("disp_pixel", imx8mn_disp_pixel_sels, base + 0xa500)); clk_dm(IMX8MN_CLK_I2C1, imx8m_clk_composite("i2c1", imx8mn_i2c1_sels, base + 0xad00)); clk_dm(IMX8MN_CLK_I2C2,