From patchwork Wed Jul 15 11:24:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11665017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E5F013A4 for ; Wed, 15 Jul 2020 11:26:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC87A2063A for ; Wed, 15 Jul 2020 11:26:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1nK02TIO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="CmudExX9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC87A2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=k+h6Eh7Kg3tKWx330mRKwYCVjA3PdAypB2ctTD2UJQ4=; b=1nK02TIOGewJcCpt8UA29QwxPe 7jU92IZvnJfR2IpNjESausmcSBse28nD3LSzw4b0cwkZFe5aVmulc2ENgb9+n0ML1D00UVAbWiVCt jKx4QwHkSC9OTzomXlYX8BAYbNGcSyN38SVtncmpSRvDEK1lO/5txeFTh80JfIOx+7tDKHeUm9Sx5 mRpJbx+tucjTUAHi5/RDphi9KvkbjCOkheYDkbCBnosuQ+2YMJRpB0FsEPB9BHVJFtJhihGBFrU/v tUBfnhwcXOLOJKkGtg/QdM5PitPudVyrlwe1VMBNE6GEtrWKAQTFKs9aBfRwePaFEPDdNEMBkPeV5 KACCpWug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvfWi-0004Ig-4N; Wed, 15 Jul 2020 11:24:40 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvfWf-0004He-DZ for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2020 11:24:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1594812277; x=1626348277; h=from:to:cc:subject:date:message-id:mime-version; bh=N6DV/31sOvQExw0bvi++MBVy/1MVzuDsKT0HgUq9HoE=; b=CmudExX92MEsEubSkzZtGaT8BTczrdTXz2JkxMOey4mzZFordJ8NvWZo ErIT6+h6LdiLbc30Y/2a5XYtrCgs6tU6FJA6PIMK+foF/MZ+tnRJSLCD1 oNenYKG8K4yTUGdsdaVXYx5xz8ay41k/Q3TZv3BH9hsxs8h/EkMc3zL6z xXWoP/PfYDhQVFCmuyRYqJwRDJyhTrgMd0kZbtDyLcvPtrthgWoOoPX4K 1TOwL32VqUzBEr6fYzLXlKi460bY9jLPavlyGWRynQuh70kbspf1HcqOX VLRWOPuEYvzDhb7DErxe3duz9zrOhNT50KOvZZoQvWz4wqBPjfMB9PPP2 g==; IronPort-SDR: ZKHXd4/fyx4RCYvlqHOKqh2HnOppqoJljtcZg0EbsfeF2z5ThN5f/JdhTh9kAoAaXrnh5YiuSI pMYCxeqmBSFLZyESAZlCRrQ+DSAR9DMAQU8lI7nZPqtCRzHd8BJ99JVslqs9c6KnIvNOdtkkfO mUEUSMWgeewAOYgC59D6tlbnfSNUsuuSS3e3Zs+nwmwfXClEHCSsZjcjMti8f2Ntgmr8+l2Tbc jvZ2qpgSDkwYidyrtxWA7TwwNIm3eywe9G7MEGIO4DsJlaW8bHTcYTpF7Rnc8lKekDHIYh3hYN pj0= X-IronPort-AV: E=Sophos;i="5.75,355,1589266800"; d="scan'208";a="83962759" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jul 2020 04:24:34 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Wed, 15 Jul 2020 04:24:02 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Wed, 15 Jul 2020 04:23:58 -0700 From: Claudiu Beznea To: , , , , Subject: [PATCH 00/19] clk: at91: add sama7g5 clock support Date: Wed, 15 Jul 2020 14:24:08 +0300 Message-ID: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_072437_703642_7C1A4D83 X-CRM114-Status: GOOD ( 10.43 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.153.233 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [68.232.153.233 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Claudiu Beznea , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bbrezillon@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi, This series adds clock support for SAMA7G5. The first patches in series, patches 1/19-9/19, contains some fixes (let me know if you want to send them as a separate series). For SAMA7G5 clock support some AT91 clock drivers needed changes because: 1/ some of generated, master and peripheral clocks could have changeable parents (being able to request frequency changes from parent) 2/ generated and programmable clocks parents needed a mux table as the hardware parent index doesn't correspond with software parent index 3/ there are 4 new master clocks, MCK1..4 (compared with previous AT91 architectures) which are controlled separately from MCK0 4/ some of the PLLs have 2 outputs the internal block schema being as follows: +------+ +--------+ | FRAC |-----+----->| DIVPMC |---> +------+ | +--------+ | | +--------+ +----->| DIVIO |---> +--------+ For this, the clk-sam9x60-pll driver has been re-factored. Claudiu Beznea (19): clk: at91: clk-generated: continue if __clk_determine_rate() returns error clk: at91: clk-generated: check best_rate against ranges clk: at91: clk-sam9x60-pll: fix mul mask clk: at91: sam9x60-pll: use frac when computing pll frequency clk: at91: sam9x60-pll: use logical or for range check clk: at91: sam9x60-pll: check fcore against ranges clk: at91: sam9x60-pll: use frac when setting frequency clk: at91: sam9x60: fix main rc oscillator frequency clk: at91: sckc: register slow_rc with accuracy option clk: at91: replace conditional operator with double logical not clk: at91: clk-generated: pass the id of changeable parent at registration clk: at91: clk-generated: add mux_table option clk: at91: clk-master: add master clock support for SAMA7G5 clk: at91: clk-peripheral: add support for changeable parent rate clk: at91: clk-programmable: add mux_table option clk: at91: add macro for pll ids mask clk: at91: clk-sam9x60-pll: re-factor to support plls with multiple outputs clk: at91: clk-utmi: add utmi support for sama7g5 clk: at91: sama7g5: add clock support for sama7g5 drivers/clk/at91/Makefile | 1 + drivers/clk/at91/at91rm9200.c | 3 +- drivers/clk/at91/at91sam9260.c | 3 +- drivers/clk/at91/at91sam9g45.c | 3 +- drivers/clk/at91/at91sam9n12.c | 5 +- drivers/clk/at91/at91sam9rl.c | 3 +- drivers/clk/at91/at91sam9x5.c | 7 +- drivers/clk/at91/clk-generated.c | 44 +- drivers/clk/at91/clk-main.c | 6 +- drivers/clk/at91/clk-master.c | 310 +++++++++- drivers/clk/at91/clk-peripheral.c | 111 +++- drivers/clk/at91/clk-programmable.c | 11 +- drivers/clk/at91/clk-sam9x60-pll.c | 547 ++++++++++++------ drivers/clk/at91/clk-system.c | 4 +- drivers/clk/at91/clk-utmi.c | 103 +++- drivers/clk/at91/dt-compat.c | 25 +- drivers/clk/at91/pmc.h | 43 +- drivers/clk/at91/sam9x60.c | 64 ++- drivers/clk/at91/sama5d2.c | 41 +- drivers/clk/at91/sama5d3.c | 6 +- drivers/clk/at91/sama5d4.c | 7 +- drivers/clk/at91/sama7g5.c | 1059 +++++++++++++++++++++++++++++++++++ drivers/clk/at91/sckc.c | 5 +- include/linux/clk/at91_pmc.h | 4 + 24 files changed, 2140 insertions(+), 275 deletions(-) create mode 100644 drivers/clk/at91/sama7g5.c