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 178B8C05027 for ; Thu, 2 Feb 2023 18:15:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1AFCE85DDB; Thu, 2 Feb 2023 19:14:38 +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="lz/+i6MI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 30F8B85DE0; Thu, 2 Feb 2023 19:14:28 +0100 (CET) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 62FC085DD5 for ; Thu, 2 Feb 2023 19:14:22 +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-x32c.google.com with SMTP id q10-20020a1cf30a000000b003db0edfdb74so4431538wmq.1 for ; Thu, 02 Feb 2023 10:14:22 -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=lz/+i6MI/6z/7jqFWgtEBDdAvZ+Gl69CkJxG5a2SzOqaSxdBS9tzKFl8qUz8MUwoWF B0SEhiFoLsJnl1UcM84qqkMqx6g1o8TQOyG75Cdf8jbH0bOQdtQIT9D8C1pvtqy+N5zz +1jDy+YSyE6oc2lglVMZTuZdqO5J4a5WDya3RcpqlhFTHbdNc3/8Ek8FhxLiypUOPT1B 7c6zmDx+NAlPSsPSqz66NlAw5Vm5jvYCGHwFFOq4rAeKA/PoESYRV8Tjju8JkII2IhBt CfB3dToq2vm+g5jvjsKtC67LtCsw1/P5KghDc7JSZYCSJkjRjbYFweAkG6g9vOf//4u+ ReEg== 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=UDubuiJVdXWo9VY5Kttr+cgtVzgwUEU47ZDDHbyCvPQ/Q1u7mpQ+2ofCguZ2Yso8QW sdfeTpPgK/KT6QR9Clte0mGtLglvjFHkfNeFgswy0/vTtLX5eeJH2Q0CO9rOD3hKcgXr ZSc/rXyIMTEhAmuNS/X6u+9HTnryV4mO+TeQtH4gxOHQHY08w9rKAMAgg/PY86GGEjeo I+ZlsPBmlxCdAz91ts+9l/xnGQpMox60639pNrumGjKN2S4VBjqQ5tKsGiNKsH9LniMr v76WGiGE98onupjHMfOrxuKRx6FziPfLkFYzIOLcp6VLpM9iicksTetp92oOjWX1NsNl eWSQ== X-Gm-Message-State: AO0yUKVl1SqpFJLOMPWtUcI60KPYbishGqBN6WDWWmXBeMMxn0K1ZyfL zkj7V1sFm3XiekVGFoeVGnc7b/+g27LzFD0o X-Google-Smtp-Source: AK7set8X9CBalFhnAQmPq/bF1s5LfniMRNYSD1Bwzi4n9vpZ3FIzCp0DWNMWQG/Z8QaDDxDaJknmsw== X-Received: by 2002:a05:600c:3d98:b0:3df:50eb:7cd9 with SMTP id bi24-20020a05600c3d9800b003df50eb7cd9mr5235539wmb.14.1675361661938; Thu, 02 Feb 2023 10:14:21 -0800 (PST) Received: from xeon.. ([188.163.112.54]) by smtp.gmail.com with ESMTPSA id x14-20020a1c7c0e000000b003daffc2ecdesm5516543wmc.13.2023.02.02.10.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 10:14:21 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Alban Bedel , 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 v2 05/16] ARM: tegra30: add PLLD to pll setup Date: Thu, 2 Feb 2023 20:13:46 +0200 Message-Id: <20230202181357.4455-6-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230202181357.4455-1-clamor95@gmail.com> References: <20230202181357.4455-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