From patchwork Wed Aug 21 10:59:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1974878 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=dkim header.b=MqXjlRaG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=devicetree+bounces-95520-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WpkmL07LXz1yYZ for ; Wed, 21 Aug 2024 21:35:46 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 09FCA1C225D1 for ; Wed, 21 Aug 2024 11:35:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 189C11B5337; Wed, 21 Aug 2024 10:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b="MqXjlRaG" X-Original-To: devicetree@vger.kernel.org Received: from mail.thorsis.com (mail.thorsis.com [217.92.40.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F4611B3B20; Wed, 21 Aug 2024 10:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.92.40.78 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724237996; cv=none; b=Z0O4AxF//D401PxTcnVxd8NScstnmHxVEnYzYRD/YJENB0NltvQu76hLyUB/Zxboq2SAAvQ0bUIOEgjzFqSFPg92tudCwmY/RRvbGnvSuB9C/sJzb7j284P7izkqTQWT9FZCnldpPeUFUjKBdovLVIPieLaAtNkgFEfVmFAYstE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724237996; c=relaxed/simple; bh=lOVznm8znpiD9wHxT5WSSLClhJbN3kr6RCRdHWLy3eA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hC4WyTkVOZegwtx+zr0yjt1fMbiYi9eiq51eUv5aowAddmIrIkALmDlrEWShwNXLa8uYaeFa1CT6vmC9cU1J+pv5noJG75OyPDKC/pKBDkWzfWvKxacmMUjECFp1FMH7Bhv+lDCSt8K2oRqjZ2GaNg5ierG3y7F/ymHhnzwC4Zk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com; spf=pass smtp.mailfrom=thorsis.com; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b=MqXjlRaG; arc=none smtp.client-ip=217.92.40.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thorsis.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 334771483DF3; Wed, 21 Aug 2024 12:59:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1724237992; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=vc+ZNqDqtDjunBZp8r2rWXp9yJg3iRJrNVvLS3A0AHU=; b=MqXjlRaGpeliknT7/fXfpDP3ZLqCTYlPXXl618rXz38QxZTqKCZoV53B5btH7ZNTIrVBXE kwGwoyEpE4GWjvIuiEEx+BxV+VkZzrKz3JDN87ees/0qIfaLWWnEjpMR+/I8b+5RKpkO3V NNJVhQVkdBWi72PEIOxvKm+pJuh6a8B/OGzG3LyZS3TL/o/Pjch7rFzIYryGDT++6dU/YG OZ8o3epf/A0u3cDEgPKAXbWmMcY1EhI5KwoKOznoiQ9LtkunCpOEzmrIqiSuxc9uPogmsj AHQAHwptUiIdiO8g1xfY/FZ50KDxBt/ORWrZbDwk5KJsu8l/f8s50Rk29WYHGA== From: Alexander Dahl To: Claudiu Beznea Cc: Christian Melki , Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-kernel@lists.infradead.org (moderated list:MICROCHIP OTPC DRIVER), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 03/12] dt-bindings: nvmem: microchip-otpc: Add compatible for SAM9X60 Date: Wed, 21 Aug 2024 12:59:34 +0200 Message-Id: <20240821105943.230281-4-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240821105943.230281-1-ada@thorsis.com> References: <20240821105943.230281-1-ada@thorsis.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 The SAM9X60 SoC family has a similar OTPC to the SAMA7G5 family. Signed-off-by: Alexander Dahl --- .../devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml index cc25f2927682..d98b6711bdfd 100644 --- a/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml +++ b/Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml @@ -21,6 +21,7 @@ allOf: properties: compatible: items: + - const: microchip,sam9x60-otpc - const: microchip,sama7g5-otpc - const: syscon From patchwork Wed Aug 21 10:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1974879 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=dkim header.b=YmOGDdOg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=devicetree+bounces-95523-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wpknq0gbxz1yYZ for ; Wed, 21 Aug 2024 21:37:03 +1000 (AEST) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E29671C21359 for ; Wed, 21 Aug 2024 11:37:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 626FC1BAEC8; Wed, 21 Aug 2024 11:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b="YmOGDdOg" X-Original-To: devicetree@vger.kernel.org Received: from mail.thorsis.com (mail.thorsis.com [217.92.40.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A57E1B81B2; Wed, 21 Aug 2024 10:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.92.40.78 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724238001; cv=none; b=eWj2I3TsIYbZN0qUkfROI+iQZZChG881d27clGMeg6JClU41Hnb4zZ+c76hjhx7b2ZRnJ0zkUd9FZNNamISdBnZnWjY5CPzWtxiB1UNcBXhSi5FBZpwxILoBPQmvtyB3gQIRLaBQBi5Eanx+kpjl4NPGfbg4W2yEUNohCmLseb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724238001; c=relaxed/simple; bh=+tqmoTa1quo78lh0ER4UFgZxylnStwrnOjZvqTlhY5k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jSlQOfNSLrtHh3xjKoXrnCofSlN15SiB0ejXuzoOPHQ0Ig5H5t9B7MnjN4ICdeSD3sCERK3TEeXy6zqv1cUAcFd3MJgyWTG/1ZVlP4FyhrKkhVs8dXpfPuNC4HS7IHj57NsrJEis0raY6qCjAqeY1y/252ZpCAUqpIFdjoc+AlQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com; spf=pass smtp.mailfrom=thorsis.com; dkim=pass (2048-bit key) header.d=thorsis.com header.i=@thorsis.com header.b=YmOGDdOg; arc=none smtp.client-ip=217.92.40.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thorsis.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D8D5B1483DED; Wed, 21 Aug 2024 12:59:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1724237997; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=f3c3Rb0MaGLfvzOor2+zbB5i0hEP30uww3c4MW+lsbw=; b=YmOGDdOgxWvh/GWC/OCxBEmVYsKO3lJkNsRx3guhWR1wIDL1qcFGNbGznSRMKndM1od4RH SYnWCBbfaXD2k3JeMbj7dDMWL+4w48QEdz1GyFdd4A5j5w8qj2PU0sqwDZFZkl+7W4R3R6 dn0SDIUkNJ1RbW2wmTQ9JCNQZHKHrj5IzvExaqyT++6suwhJX3rsvRq+DAAxQhKehlS1Un 2dcVNNj9a5/5SfJQvOGzNZCwu5AX7L+sfxGPHJJnIzxTp8xnV68f7pw83ATU4ibQPqQATT eX55ep9Gll/Mk++jVEPZcoyM5RrV+Y6Zn1I7dZFfNx7zxVlrzPLQMU554RMn6Q== From: Alexander Dahl To: Claudiu Beznea Cc: Christian Melki , Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-clk@vger.kernel.org (open list:COMMON CLK FRAMEWORK), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Microchip (AT91) SoC support), linux-kernel@vger.kernel.org (open list), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v1 09/12] clk: at91: sam9x60: Allow enabling main_rc_osc through DT Date: Wed, 21 Aug 2024 12:59:40 +0200 Message-Id: <20240821105943.230281-10-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240821105943.230281-1-ada@thorsis.com> References: <20240821105943.230281-1-ada@thorsis.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 SAM9X60 Datasheet (DS60001579G) Section "23.4 Product Dependencies" says: "The OTPC is clocked through the Power Management Controller (PMC). The user must power on the main RC oscillator and enable the peripheral clock of the OTPC prior to reading or writing the OTP memory." The code for enabling/disabling that clock is already present, it was just not possible to hook into DT anymore, after at91 clk devicetree binding rework back in 2018 for kernel v4.19. Signed-off-by: Alexander Dahl --- drivers/clk/at91/sam9x60.c | 3 ++- include/dt-bindings/clock/at91.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c index e309cbf3cb9a..4d5ee20b8fc4 100644 --- a/drivers/clk/at91/sam9x60.c +++ b/drivers/clk/at91/sam9x60.c @@ -207,7 +207,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) if (IS_ERR(regmap)) return; - sam9x60_pmc = pmc_data_allocate(PMC_PLLACK + 1, + sam9x60_pmc = pmc_data_allocate(PMC_MAIN_RC + 1, nck(sam9x60_systemck), nck(sam9x60_periphck), nck(sam9x60_gck), 8); @@ -218,6 +218,7 @@ static void __init sam9x60_pmc_setup(struct device_node *np) 50000000); if (IS_ERR(hw)) goto err_free; + sam9x60_pmc->chws[PMC_MAIN_RC] = hw; hw = at91_clk_register_main_osc(regmap, "main_osc", mainxtal_name, NULL, 0); if (IS_ERR(hw)) diff --git a/include/dt-bindings/clock/at91.h b/include/dt-bindings/clock/at91.h index 3e3972a814c1..f957625cb3ac 100644 --- a/include/dt-bindings/clock/at91.h +++ b/include/dt-bindings/clock/at91.h @@ -25,6 +25,7 @@ #define PMC_PLLBCK 8 #define PMC_AUDIOPLLCK 9 #define PMC_AUDIOPINCK 10 +#define PMC_MAIN_RC 11 /* SAMA7G5 */ #define PMC_CPUPLL (PMC_MAIN + 1)