Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09EC7C61DA4 for ; Fri, 3 Feb 2023 09:28:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 27A9085EF6; Fri, 3 Feb 2023 10:27:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ct/5Hk76"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B31D85EDA; Fri, 3 Feb 2023 10:27:19 +0100 (CET) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D5CB885D9F for ; Fri, 3 Feb 2023 10:27:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-wm1-x32d.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso5547255wms.5 for ; Fri, 03 Feb 2023 01:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9S+C4xkNdQEKANbpuuRi4aLHk3ZpbtIVLJBhxwRlBc8=; b=Ct/5Hk76tI2eSJXC2DrVHrmV3cnkiICb7Rq+q3Kg46cNK+T+IAsNa7PkR89F+/6fAP +ledkASwyEVbbeqE931hsUULLcuGHFKNxGvStBoTCqp9yRtgO0/Ktn/+PEjuFp2gmy19 sXt/TlV7hjhIgnWCIJw5YzEjWHTEYHiWD6VIU6iXu9I3G+o4T4LbxisbZKpu028wzTRu fhuINN04cxhuuwXzdLBqtjXf/SQuuSHxvvub2pqY48KXtjPkdX1e5G3PFoJV3JSS0rvw /OGm22v+37hfIdvvJagFUC9EQks3uN468m2QlYCuizYXtlVlxl1poehALKJrxAWnvGca CTPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9S+C4xkNdQEKANbpuuRi4aLHk3ZpbtIVLJBhxwRlBc8=; b=1fWOWyNxokH4ChgY2ikyaJh7VhvjctKpVqgyqy3FkS2pYDYEBKoH2lWFbLoqh/1VLF k4YpDY/1W6FbxARzD7/3TRoJE2elnzuZDTLRT32ly/LYqLxHlknoQPa45ZGvNTCuv/rL w5VH6fvt/7jlPbQCdCM2ORyHIcdkWNY/0BWiI0s9oAUVD1fgTcS8CYLK+yiG5lwmCXsf cfU8nTeE2saPZvsL1m9P+VJ3u+7O4WFYcS0aFN4+xmb/N97m3vse4yOgRFrbqtloKKHr EXhzTl77fHUN8i3w+F6ZdH3MhdlRPAIKE4VRXmH9bOnXGTjsAvstPopPEZ5Ovc6vdHwM fPcw== X-Gm-Message-State: AO0yUKUmm0zIzN9aOCGmc4XqPbujrWHaOma1xYdB34JdFolF//CFAOB9 XxJ4hPi+F0o4C8bCSmS+K3Y= X-Google-Smtp-Source: AK7set/2MWc+2ezqY0TjScRWO/QNAkAH40imqESCJanZ6zGFrVocvjQgOq23F7QuIr+i9G5O+BWO7Q== X-Received: by 2002:a05:600c:1f10:b0:3db:742:cfe9 with SMTP id bd16-20020a05600c1f1000b003db0742cfe9mr9438398wmb.34.1675416431263; Fri, 03 Feb 2023 01:27:11 -0800 (PST) Received: from xeon.. ([188.163.112.54]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c46c600b003dc54344764sm7865025wmo.48.2023.02.03.01.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 01:27:11 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Stephen Warren , Marcel Ziswiler , Allen Martin , Jagan Teki , Lukasz Majewski , Marek Vasut , Svyatoslav Ryhel , Ramin Khonsari , Thierry Reding , Maxim Schwalm , Dmitry Osipenko Cc: u-boot@lists.denx.de Subject: [PATCH v3 05/16] ARM: tegra30: add PLLD to pll setup Date: Fri, 3 Feb 2023 11:26:29 +0200 Message-Id: <20230203092640.40821-6-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230203092640.40821-1-clamor95@gmail.com> References: <20230203092640.40821-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On T30 unlike T20 dsi panels are wider used on devices and PLLD is used as DISP1 parent more often, so lets enable it as well for this cases. Tested-by: Andreas Westman Dorcsak # ASUS TF700T T30 Tested-by: Svyatoslav Ryhel # HTC One X T30 Signed-off-by: Svyatoslav Ryhel --- arch/arm/mach-tegra/tegra30/clock.c | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/arm/mach-tegra/tegra30/clock.c b/arch/arm/mach-tegra/tegra30/clock.c index dcdd0d0978..b66211ce94 100644 --- a/arch/arm/mach-tegra/tegra30/clock.c +++ b/arch/arm/mach-tegra/tegra30/clock.c @@ -669,7 +669,48 @@ enum clock_id clk_id_to_pll_id(int clk_id) void clock_early_init(void) { + struct clk_rst_ctlr *clkrst = + (struct clk_rst_ctlr *)NV_PA_CLK_RST_BASE; + struct clk_pll_info *pllinfo; + u32 data; + tegra30_set_up_pllp(); + + /* + * PLLD output frequency set to 925Mhz + */ + switch (clock_get_osc_freq()) { + case CLOCK_OSC_FREQ_12_0: /* OSC is 12Mhz */ + case CLOCK_OSC_FREQ_48_0: /* OSC is 48Mhz */ + clock_set_rate(CLOCK_ID_DISPLAY, 925, 12, 0, 12); + break; + + case CLOCK_OSC_FREQ_26_0: /* OSC is 26Mhz */ + clock_set_rate(CLOCK_ID_DISPLAY, 925, 26, 0, 12); + break; + + case CLOCK_OSC_FREQ_13_0: /* OSC is 13Mhz */ + case CLOCK_OSC_FREQ_16_8: /* OSC is 16.8Mhz */ + clock_set_rate(CLOCK_ID_DISPLAY, 925, 13, 0, 12); + break; + + case CLOCK_OSC_FREQ_19_2: + case CLOCK_OSC_FREQ_38_4: + default: + /* + * These are not supported. It is too early to print a + * message and the UART likely won't work anyway due to the + * oscillator being wrong. + */ + break; + } + + /* PLLD_MISC: Set CLKENABLE, CPCON 12, LFCON 1, and enable lock */ + pllinfo = &tegra_pll_info_table[CLOCK_ID_DISPLAY]; + data = (12 << pllinfo->kcp_shift) | (1 << pllinfo->kvco_shift); + data |= (1 << PLLD_CLKENABLE) | (1 << pllinfo->lock_ena); + writel(data, &clkrst->crc_pll[CLOCK_ID_DISPLAY].pll_misc); + udelay(2); } void arch_timer_init(void) -- 2.37.2