From patchwork Wed Feb 15 05:47:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tang yuantian X-Patchwork-Id: 9573401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CD6160493 for ; Wed, 15 Feb 2017 06:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3981A1FF13 for ; Wed, 15 Feb 2017 06:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C3AB2015F; Wed, 15 Feb 2017 06:02:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82B181FF13 for ; Wed, 15 Feb 2017 06:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MfIdP8ccNUIua4RA9UzIQ2ke83+OXq0O9fwIM9/TdaI=; b=ZLL0wIOXNv4QBQ Wsjwh2DSHjK6CiYWD0V+IRuYkkfi7V0nf7wF8OyIW8+YysPpIdBcS1XMOtG2mwokJLa8S7Ffc27Gh PhFj071/tymwMTv5oCzTw92YPWGBZ7Xwhk6hejNjVnHmrgCXUjyE1t+hYcuPVjcuEVKX+cr6QppJ5 eGj30+jszWm7jp2IeFfE/Yct3zpA/D9AsqH0FPUN7dGCcWt4r7vNEskj3IZdAV0DKnTeI7Nlc+Mqa SIbLFTSKzzF6nrIfl6wTICGb6woSDxfr7hFnSRXEK5L8MrXxmmwQBFqoI8ITlmcwL921+sCKWSFZR 3ZpHEfJd4qK2hpSqn4hA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdsfJ-00056q-1e; Wed, 15 Feb 2017 06:02:09 +0000 Received: from mail-dm3nam03on0049.outbound.protection.outlook.com ([104.47.41.49] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdsf1-0004rK-GP for linux-arm-kernel@lists.infradead.org; Wed, 15 Feb 2017 06:01:53 +0000 Received: from BN6PR03CA0038.namprd03.prod.outlook.com (10.175.124.24) by BY2PR0301MB0726.namprd03.prod.outlook.com (10.160.63.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 06:01:29 +0000 Received: from BN1BFFO11FD004.protection.gbl (2a01:111:f400:7c10::1:179) by BN6PR03CA0038.outlook.office365.com (2603:10b6:404:10c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 15 Feb 2017 06:01:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD004.mail.protection.outlook.com (10.58.144.67) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 06:01:23 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v1F61CfD000789; Tue, 14 Feb 2017 23:01:19 -0700 From: To: Subject: [PATCH 2/2] clk: qoriq: Separate root input clock for core PLLs on ls1012a Date: Wed, 15 Feb 2017 13:47:36 +0800 Message-ID: <1487137656-4006-2-git-send-email-yuantian.tang@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1487137656-4006-1-git-send-email-yuantian.tang@nxp.com> References: <1487137656-4006-1-git-send-email-yuantian.tang@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316120889564689; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39400400002)(39850400002)(39450400003)(39410400002)(39380400002)(39840400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(2876002)(626004)(48376002)(97736004)(50986999)(92566002)(76176999)(68736007)(47776003)(8936002)(81166006)(81156014)(50226002)(85426001)(33646002)(8676002)(86152003)(575784001)(54906002)(5660300001)(189998001)(50466002)(36756003)(104016004)(2950100002)(77096006)(6916009)(5003940100001)(86362001)(2351001)(53936002)(7416002)(2906002)(305945005)(6666003)(4326007)(105606002)(8656002)(356003)(106466001)(389900002)(38730400002)(110136004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0726; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD004; 1:HpkxNJwOAjBuMNQIQcMSloqVr+lzzq9h2vNt9h81eEXZ+iA+961v7s60FbPrOaoSbZIxhW6sEhRsOioVsqK5reRRsKhcYvZT7RdqQdYvWKS1w27c2x15x1I0W2cqgYOXZqMRbJlB3/kKWYI431IGN0mNeCjkuyyKYMh4FI/iglW83rkQMx2HAqA66GhVuXh8nFT48Ugaj9FhknXPJLCuTSTXHIdrFeYK12KQLNPHeG4Th4cFrNB2yHlDKUA2uWfKsdYLhryVrHG48xZxc2JSkEb+3+Xml2OW+aTRpUK77DKSvzBWfZQnUknBEAXL0wauukP0oQOtNE9EmvFmjcfTVWhAXnbh15ZwHG67+bWHYXQGslEFJw2raUJGo2egBILZkue59Zk1h6hG8yGeNfObwuZw+MCAlhl42Jp5kBzWEafhdKL63NrLwGMSssaFIzOwr1d3RYiA2rsDsvdNP366fJPG+da0hmdoctOVmpInvyv8TDo1NOkqOfymoep8n4baEfPbYcvPar9WkLs/LLGfG9uE3J9dP2eiuakL1GCykeij5QPzsuW8+xkUFAzFFgEBuzpZA7O7NDCQbBKTBj8uXIsyb4ttI/a+Y/33b1zg1vN3hnBapsTS31f57LPyamHEQR3jrmeuKQvUifla8g619rdWOFX3303Enq9h/6e5tGcNhHQPYrl56jezWH0LUBbT4ItzrRfzlvowWUGrJIX0++KYimlA2hTAtU/9AIp1jR0= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 20a6a72c-c11e-4083-3cb0-08d45568155c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0726; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0726; 3:h/6CoTg0c6OGZ+LuzZ9pwmKFts1/44bajyziQRkPrL2ZT3tyrGc//tTtrGQtH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H7Cqydbrd4Z2q3Lda1FMmIze2mI4C1jihOVr3TMQE+tdC9rke8LZb4wu/o= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(8121501046)(13015025)(5005006)(13017025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(20161123565025)(20161123561025)(20161123559025); SRVR:BY2PR0301MB0726; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0726; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0726; 4:/9WHH4Bkkp5/KglUQySy6vuss1Y/ZEShR4OpelAszyoK5Ul1HqATzKN3g5XXTh8jisNHjSVDqo3lQ1TtmuMJl5LbVvMDYVVuWV6M3hWvu0t2WqDbUM1BAsM1TP7oclGaqXPRiuWIdZPXfNgGXhDBiEmDJkUc6j6N316dcS9znyoriCrs1AVcK5aaxEYkX1Dn8CmqabpjpQRMMauW7l4pZ0NgkSbSgfb3LOiTSRTaoYg0UyP76A7TS6Pd3RsWfuGFuyaW8cDrAX4wQrlefFB4kKSWkP67a0ZQmx0IDqlTAllG614lLYFGfS/o01Zf70B0kvDC+J1N+Q3uTMJb9faAP2B1c9lWEJrDvtlNlyzILUu2cGwTjFrsvlQHPjwqlcmbajJZMpqfZG5AMzF5EvjC2G6BhZOsaa2xrfXHQWXOcsOmzQXg97BfvF8m5wXn6/+nT6LRhjF5P8sJumJxpv5zkejHBxgH+rgnCODB7S2Fj9UAIbc+XEkwEmyo3UfaudksmtTVEwnPN+5BtRa2IHuVmFvtgKOz4OincBdlvQomnhi7/SkJCPffpuCnzW04/dySNYgo4ek0/LROoUJUtOXizGBSOo6/QRORgyyBsle4zeV6djMDRdHQcs+e8BmbwsaUpyrGlkACUf0Bkf5a8H/qur8eCOzN4yOwLDfca3q9SgdLEOMgL19aK1J4JwHSlNw9rn3CiY07lNQ+vvGkBNs2CWkrXGX/y0zyEkyoLIResSu4135Ota9N0TNy/xCQYQec X-Forefront-PRVS: 021975AE46 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0726; 23:VDQ6MfehrE0gW4b2zkljRMXtNiuRGq69mg3tGx/?= =?us-ascii?Q?+t/Lt0IoFonApczqP34YJ+ebjWYYCYU1KwCbVVErsCSJNCUeGzjxtE0mbWmb?= =?us-ascii?Q?4e6QzoLmnkemje5MjAhdZ+ac4E8zqtRCZ3RQ3JUCIhaPKveVCFcDNQGuJhDx?= =?us-ascii?Q?1OjUgmD5uJh4hfR+uZPEzlk4xffswKzZsmxknV2hMFePAQUgAftO3g11F6Xp?= =?us-ascii?Q?X3pdRs9/VyF9087xO2vOjIwEjHJQeLx1puZuLM1liJf1eEsBlB4Nw9EHAFaF?= =?us-ascii?Q?+yhYdMITB8T0dt0XpGsWVn6hnsjVw+J/ZrmReo+1bxpsSAy33Tjipu8Unw9c?= =?us-ascii?Q?F5GzV7I6zuzSLqOtvTKFlPomzyvhYmbWtLVsleU3JDsPk/+zvZSj7C/FNkgs?= =?us-ascii?Q?eD5OK/E+VYonlgbYXzA09lv517b+1sTEHHTg6BNz7WMXwX8Qpjtrd3CZuYof?= =?us-ascii?Q?y/4Ul9dO+Ik9k+hFaaGIQIowXORpKhuEAiMx54EHg15gIwN85isVp9et+JvN?= =?us-ascii?Q?MV+ZKaP8NGz4pV9SnE6rfMgdOpAJa4gpf/4b3lfe/enTwlM+lSd6f10rmeJR?= =?us-ascii?Q?390a01v8k+yg8YP9mHj3AotFuVPUnsn5Zv7l/PlnqaOyy3EDBZkhYOgkMvU3?= =?us-ascii?Q?YEY0sxPwFIJMEIW0uyAyBFVjgi7Mz+K7DWkz1SCAK3MopIsUSgJpGIexukui?= =?us-ascii?Q?qwWCYBW2uQ+lUZudnKMQemlz9IMIEOBS0OZqkyxg/7XhYClpPQh1QZlp47UQ?= =?us-ascii?Q?B5ErSy2KLvKqvpmf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HohXnp0eAtAYae7qmCNzHyRSAHFuCqRL4Sq7nh2kPm0iXs+d6eJUHg5BKf94pt+QHRHoh6+8zfrzsz9O9kr/R72mhmqBwzimleKae6MSu6EkZHntrRnehMq6vDQViomyg+Wh4Iuk23FkwcBshj1WIL2wa4pGbx/4qlgUwENjSNqEp70U40/wuMK+v34usUCNehcTp0ZBQUHWjZhTy4=; 5:+0UmO5ysdIsmN5XKPiGcUeQaqlDnF/35HYAGdHLyXHVNXptABwmOKGSm+IdPSD4e8efcuY1pP+xZGfssF1KtvfsoAVcXztvhqyHNKou3S+VrMPJ3oqlKrYN6+ZSYPWZaYVu30Xcm3Pjkcq7KyqRqKVR9silQa944xQCRru11fQkKwRgZHpR/I6YYVLqshLnz; 24:bgu8d6uBln0LTyapmHKowOFSTN9qalu9ckel3S8UGtsMmqqgoGWxbe3tTPPNmEiFIL/Gh1htUzJ7QIi0p+5QLTWa54EEd7Yxz9ZiwdKFosU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0726; 7:Jjm0hH5Zq+/ETv0FrL1KaYaFXDhW1enmJ8pT3/MiHPayPaI7A+3fgydfYS+dKBo+27VBQ6OnJTWM3/NvaQTytsU1s22v04Pe/123DYSzRXF2T2jfry2W4LaIHYHTPMs2TXwL7UzqC6h3Zzgskf69KZM7S3h4ANj6F25YmR1jTTWCw2VRdtWWvg/1xplLRCoOfv5WR3T1p07+YpOWv8Hp8Q8YihtZXMOmzMyKapgQj7am3W4eqsf0KyFIGXRBA8L+UfeBqjrG3BjURLqDFWCmsjObmzZijA3gQCkyWubYcgzopwPwsQx663uC2pTZec43Cyu431M2tTW/69796civ+rWiBJcFFNkWmuatAz4quSxLWNXQVTHTyngxgDtgJnP237fsC/z8jZ1RbdsTKmnBhvqF1luAifdBIBAfoaDx8Pp7IIO0SwSoFDuVmbYLvHA37epqj7/h/73bJZVAw4fccpaBKpgN/bwW7AWxtjowWA+w8lV8rqT0adiCQfRHUwUat5vB2fz41Glh/maJtTdShA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 06:01:23.3092 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0726 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170214_220151_755558_2952DD5F X-CRM114-Status: GOOD ( 21.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, Scott Wood , Tang Yuantian , robh+dt@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tang Yuantian ls1012a has separate input root clocks for core PLLs versus the platform PLL, with the latter described as sysclk in the hw docs. If a second input clock, named "coreclk", is present, this clock will be used for the core PLLs. Signed-off-by: Scott Wood Signed-off-by: Tang Yuantian --- drivers/clk/clk-qoriq.c | 91 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c index d0bf8b1..f3931e3 100644 --- a/drivers/clk/clk-qoriq.c +++ b/drivers/clk/clk-qoriq.c @@ -87,7 +87,7 @@ struct clockgen { struct device_node *node; void __iomem *regs; struct clockgen_chipinfo info; /* mutable copy */ - struct clk *sysclk; + struct clk *sysclk, *coreclk; struct clockgen_pll pll[6]; struct clk *cmux[NUM_CMUX]; struct clk *hwaccel[NUM_HWACCEL]; @@ -904,7 +904,12 @@ static void __init create_muxes(struct clockgen *cg) static void __init clockgen_init(struct device_node *np); -/* Legacy nodes may get probed before the parent clockgen node */ +/* + * Legacy nodes may get probed before the parent clockgen node. + * It is assumed that device trees with legacy nodes will not + * contain a "clocks" property -- otherwise the input clocks may + * not be initialized at this point. + */ static void __init legacy_init_clockgen(struct device_node *np) { if (!clockgen.node) @@ -945,18 +950,13 @@ static struct clk __init return clk_register_fixed_rate(NULL, name, NULL, 0, rate); } -static struct clk *sysclk_from_parent(const char *name) +static struct clk __init *input_clock(const char *name, struct clk *clk) { - struct clk *clk; - const char *parent_name; - - clk = of_clk_get(clockgen.node, 0); - if (IS_ERR(clk)) - return clk; + const char *input_name; /* Register the input clock under the desired name. */ - parent_name = __clk_get_name(clk); - clk = clk_register_fixed_factor(NULL, name, parent_name, + input_name = __clk_get_name(clk); + clk = clk_register_fixed_factor(NULL, name, input_name, 0, 1, 1); if (IS_ERR(clk)) pr_err("%s: Couldn't register %s: %ld\n", __func__, name, @@ -965,6 +965,29 @@ static struct clk *sysclk_from_parent(const char *name) return clk; } +static struct clk __init *input_clock_by_name(const char *name, + const char *dtname) +{ + struct clk *clk; + + clk = of_clk_get_by_name(clockgen.node, dtname); + if (IS_ERR(clk)) + return clk; + + return input_clock(name, clk); +} + +static struct clk __init *input_clock_by_index(const char *name, int idx) +{ + struct clk *clk; + + clk = of_clk_get(clockgen.node, 0); + if (IS_ERR(clk)) + return clk; + + return input_clock(name, clk); +} + static struct clk * __init create_sysclk(const char *name) { struct device_node *sysclk; @@ -974,7 +997,11 @@ static struct clk * __init create_sysclk(const char *name) if (!IS_ERR(clk)) return clk; - clk = sysclk_from_parent(name); + clk = input_clock_by_name(name, "sysclk"); + if (!IS_ERR(clk)) + return clk; + + clk = input_clock_by_index(name, 0); if (!IS_ERR(clk)) return clk; @@ -985,7 +1012,27 @@ static struct clk * __init create_sysclk(const char *name) return clk; } - pr_err("%s: No input clock\n", __func__); + pr_err("%s: No input sysclk\n", __func__); + return NULL; +} + +static struct clk * __init create_coreclk(const char *name) +{ + struct clk *clk; + + clk = input_clock_by_name(name, "coreclk"); + if (!IS_ERR(clk)) + return clk; + + /* + * This indicates a mix of legacy nodes with the new coreclk + * mechanism, which should never happen. If this error occurs, + * don't use the wrong input clock just because coreclk isn't + * ready yet. + */ + if (WARN_ON(PTR_ERR(clk) == -EPROBE_DEFER)) + return clk; + return NULL; } @@ -1008,11 +1055,19 @@ static void __init create_one_pll(struct clockgen *cg, int idx) u32 __iomem *reg; u32 mult; struct clockgen_pll *pll = &cg->pll[idx]; + const char *input = "cg-sysclk"; int i; if (!(cg->info.pll_mask & (1 << idx))) return; + if (cg->coreclk && idx != PLATFORM_PLL) { + if (IS_ERR(cg->coreclk)) + return; + + input = "cg-coreclk"; + } + if (cg->info.flags & CG_VER3) { switch (idx) { case PLATFORM_PLL: @@ -1063,7 +1118,7 @@ static void __init create_one_pll(struct clockgen *cg, int idx) "cg-pll%d-div%d", idx, i + 1); clk = clk_register_fixed_factor(NULL, - pll->div[i].name, "cg-sysclk", 0, mult, i + 1); + pll->div[i].name, input, 0, mult, i + 1); if (IS_ERR(clk)) { pr_err("%s: %s: register failed %ld\n", __func__, pll->div[i].name, PTR_ERR(clk)); @@ -1200,6 +1255,13 @@ static struct clk *clockgen_clk_get(struct of_phandle_args *clkspec, void *data) goto bad_args; clk = pll->div[idx].clk; break; + case 5: + if (idx != 0) + goto bad_args; + clk = cg->coreclk; + if (IS_ERR(clk)) + clk = NULL; + break; default: goto bad_args; } @@ -1311,6 +1373,7 @@ static void __init clockgen_init(struct device_node *np) clockgen.info.flags |= CG_CMUX_GE_PLAT; clockgen.sysclk = create_sysclk("cg-sysclk"); + clockgen.coreclk = create_coreclk("cg-coreclk"); create_plls(&clockgen); create_muxes(&clockgen);