From patchwork Thu Jun 1 14:14:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Elwell X-Patchwork-Id: 9759641 X-Patchwork-Delegate: sboyd@codeaurora.org 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 14E4B602BC for ; Thu, 1 Jun 2017 14:14:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03C792849A for ; Thu, 1 Jun 2017 14:14:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC9BC284BF; Thu, 1 Jun 2017 14:14: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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B4BD2849A for ; Thu, 1 Jun 2017 14:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751076AbdFAOOU (ORCPT ); Thu, 1 Jun 2017 10:14:20 -0400 Received: from mx08-00252a01.pphosted.com ([91.207.212.211]:37168 "EHLO mx08-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdFAOOS (ORCPT ); Thu, 1 Jun 2017 10:14:18 -0400 Received: from pps.filterd (m0102629.ppops.net [127.0.0.1]) by mx08-00252a01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v51E9xbD015689 for ; Thu, 1 Jun 2017 15:14:17 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.org; h=to : from : subject : message-id : date : mime-version : content-type : content-transfer-encoding; s=pp; bh=S1G9lIpnZhkjH+FVzstXRcQb9buPPR+NZsmMtWmTvvE=; b=A5MI+dtwWh5kXlOd7hRAA3xdJdX2tefHVcoORWzRr/AmF+4/Z+WnKPLxz+bXHAwPIVs0 RIvVCgLrFj7x99+otclCEPoU1X2rtRjrAqoTfgl2b3r79JbFCL82StlpdIsHZuW0zjDk Q/QK2cyMtSQjfJTV6OB+QoK/5i9b6I+jXWSGjq+STtEM1AvJAomHtA2tDr9K9TCO7Ng2 73Q2bXJ163t1K27uaVcHmy4+s+7yk9YfZHlIDDk6ENzTWL3oj1IJkgmZf/IztMXuXSQd qkWIpa3DrN700/qwYITXHF/K0d8pINbzZnldOYbc61A6GIkcTBac7MlhZlTKdAUiASn7 Lg== Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by mx08-00252a01.pphosted.com with ESMTP id 2apwxetgat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK) for ; Thu, 01 Jun 2017 15:14:17 +0100 Received: by mail-wm0-f69.google.com with SMTP id 139so10388662wmf.5 for ; Thu, 01 Jun 2017 07:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi-org.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=S1G9lIpnZhkjH+FVzstXRcQb9buPPR+NZsmMtWmTvvE=; b=fsTKRg3JfpOjETSvKYPbgmyBL9hUJQorQRie3OFmBI76g5Ol26J+QZ797GTBCODDnU jYRA+XsPC+to+Qr1yeSlUiPrmDVdUTsJOgk3zpNCPZtnyPBhUIi40eqOXPyIne9lDUNh /EK/4Fd2JaiBVHyS1lEgnnGhQRpZYlf6lEWLw/LjfuzpCnn2svE8GN8/xQebUFlU+Ctb eD0zFLar9wlHZ9NbHSaXqXBD7hP6pCeBAsE5JYIPnMm3nFwgtWbzGo7pBGJCpy6nw6fW jLkavdCpVzEm07acW0a7uXpP/n26OMnFv1fnjZ0xsLoo6KcVM/pyDutqcUFM1aZoaHpR XVFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=S1G9lIpnZhkjH+FVzstXRcQb9buPPR+NZsmMtWmTvvE=; b=MMbFHRTjBW9sK1NpIHA48tf3r4d7+bsImgznBBM+i25pfai1ztglEWbh6159TCyC3+ r7MZ3WJ2AsByX134ex8l4jk140obn+UrviMHYjHu1d2gftRS+oidTFXOrTmVg24z3GJh PoE9fMoIMtYB6lwNHdjBscVK+XN/qLINjV45wHwVOiPm9opAtSMZv5TDBQJVinSlnMN8 jWiEsPSo3hTZN0ff/B/EupZTPKFCMZbJSB2+Fxa6ZsQXizgWJVLtkfklXtVweTubrtMC prAq4nLNxukOsmtUJW4eM6AloTex9HX2sVAGs0LdBvlbJkiyqjPb5dQRNtDsRsK6QzzW CmbA== X-Gm-Message-State: AODbwcB4bbJRB89yxUEZhm72WVztNh6Ndui4cDG4foAq6n1EoX8iQdLr /AkDjyRLgHiyRN0lJ4fjUId3ylp+HEdQbJjvueiXXGjpcWMTH2+VyjjxuSA4Vk6FfdNK077NpRQ fQLleN3R5ssQ= X-Received: by 10.223.129.183 with SMTP id 52mr1476078wra.185.1496326456268; Thu, 01 Jun 2017 07:14:16 -0700 (PDT) X-Received: by 10.223.129.183 with SMTP id 52mr1476070wra.185.1496326456099; Thu, 01 Jun 2017 07:14:16 -0700 (PDT) Received: from ?IPv6:2a00:2381:fdf7:14:79d0:49c2:6e14:f72b? ([2a00:2381:fdf7:14:79d0:49c2:6e14:f72b]) by smtp.gmail.com with ESMTPSA id p5sm34686466wma.17.2017.06.01.07.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 07:14:15 -0700 (PDT) To: Michael Turquette , Stephen Boyd , Eric Anholt , Stefan Wahren , Florian Fainelli , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Phil Elwell Subject: [PATCH v4 1/2] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER Message-ID: <8cc0ba82-d33e-127b-7b86-ac595ef416d1@raspberrypi.org> Date: Thu, 1 Jun 2017 15:14:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Language: en-GB X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-01_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706010262 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Restrict clock sources for the PCM peripheral to the oscillator and PLLD_PER because other source may have varying rates or be switched off. Prevent other sources from being selected by replacing their names in the list of potential parents with dummy entries (entry index is significant). Signed-off-by: Phil Elwell Reviewed-by: Eric Anholt Acked-by: Stefan Wahren --- drivers/clk/bcm/clk-bcm2835.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 0258538..49867d2 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1516,6 +1516,31 @@ struct bcm2835_clk_desc { .parents = bcm2835_clock_per_parents, \ __VA_ARGS__) +/* + * Restrict clock sources for the PCM peripheral to the oscillator and + * PLLD_PER because other source may have varying rates or be switched + * off. + * + * Prevent other sources from being selected by replacing their names in + * the list of potential parents with dummy entries (entry index is + * significant). + */ +static const char *const bcm2835_pcm_per_parents[] = { + "-", + "xosc", + "-", + "-", + "-", + "-", + "plld_per", + "-", +}; + +#define REGISTER_PCM_CLK(...) REGISTER_CLK( \ + .num_mux_parents = ARRAY_SIZE(bcm2835_pcm_per_parents), \ + .parents = bcm2835_pcm_per_parents, \ + __VA_ARGS__) + /* main vpu parent mux */ static const char *const bcm2835_clock_vpu_parents[] = { "gnd", @@ -1993,7 +2018,7 @@ struct bcm2835_clk_desc { .int_bits = 4, .frac_bits = 8, .tcnt_mux = 22), - [BCM2835_CLOCK_PCM] = REGISTER_PER_CLK( + [BCM2835_CLOCK_PCM] = REGISTER_PCM_CLK( .name = "pcm", .ctl_reg = CM_PCMCTL, .div_reg = CM_PCMDIV,