Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp52097lqe; Wed, 3 Apr 2024 22:01:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4mAlOMGhdlhnMpqZ4yARpTWVnHD97lr2p3zKKcGcX/ZcEs+27giLoMQ4uT15j59E94S7c/djmOui870vbvBB714vsSxB1EWCK+xRSOw== X-Google-Smtp-Source: AGHT+IGnZSIs2fPG5vqotaW7VHXlKGt+RSIu6RuhlnXaxvD5JAK+rAlaqfvPBOloOPGiAFz3Hxuv X-Received: by 2002:a50:875b:0:b0:56d:fdb3:bcc0 with SMTP id 27-20020a50875b000000b0056dfdb3bcc0mr1038663edv.11.1712206886486; Wed, 03 Apr 2024 22:01:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712206886; cv=pass; d=google.com; s=arc-20160816; b=nzNN6E9hPVaUO0r2eJ1EtFyHV0iFQaV+a+h08RRB+zU8hcrO3TLaHIuOim00+YSR1+ tTU8ntYlWG+3S9RHyF8TAALYhjdMxrKtHVYOb0c1WfMkLyp34RCM7gfpS/7zi5ICrvfi JzNhZqr1hILeNqpPzgdAo7dM4Lz7D/nDCWicuIlgARLB6LJ+sjCSjTKxjkF8bBlOJ9gW 6jRKaAZoKASj5PTq0+84tVz+R5rwKEWELvjTAVFsBeJLLgGvF9VnrIBSYanHWM1ucNgT ulp+KasYSR+pXZPKPVAvWbfCCdjjdZKDBLkDmKZ17BZxv+AdfpatX8KmHE006x98Ec7x yy6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zFAj6je791crHAjCG78rptVfPk9mU6AmGgn20crYNyk=; fh=v4XjIS8ZnkfRSzpdvZ0kX2qBiNaW+cViNlbs+XMLZ44=; b=YCZsJ8f8A7+TN75Lw/yUUnhwUoo73mYPwe+TG2/iThslGtDKjhi+uL3erUFV7AEQF+ MiPPldcsgPDoIdGDiq5nYAxw+gQSvIjDRlOb+/cz+ND6MVwNZxMY6RiEMwSlTagxdRyS +WMjbYW+mN56r1hbtA2INgnv7sFS+GtTQbgRO9sa4rdI5DyfbBYxYUz8T8B3UQdeiLvf clU5E25NI8GPB76Y7Gqjq8NJWyfS9dKA+rikXsSVTy2vQITS1+RoL1djfgvkPsz9Ew5W KFISKcabvhJaHVDGltBwgRBBEYBbOkn+KNX3LRjGIZ4j6rpJUrtEudMi9Ni9bsXrjg/j ab/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130874-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p21-20020a50cd95000000b0056e0abadbe6si1178002edi.594.2024.04.03.22.01.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 22:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130874-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 18A6A1F256F1 for ; Thu, 4 Apr 2024 05:01:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4B5B48CDC; Thu, 4 Apr 2024 05:00:51 +0000 (UTC) Received: from sakura.ysato.name (ik1-413-38519.vs.sakura.ne.jp [153.127.30.23]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DFD23E476; Thu, 4 Apr 2024 05:00:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=153.127.30.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712206851; cv=none; b=rQh0gARAgZizTaDMCrFSU5Rb3DceytYZkipnMSmj1DNu/eZta3ilFmYdaKwgrYh3UEE8mkT+758Y/LF0mkUIdRgxTV9oQwBZl8E0c+rwLD4KZ1kr1LI98oMEfgW3d9LQoj3282U4it5pA9dusz9Z+rtzriy8eiHHrRmw/er/uGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712206851; c=relaxed/simple; bh=HPmmSvMhl0GCAZDx4/OjF2pM4q8N+rvJP+xvKvCJtLQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mu4suBLbigEAjRPweFyYAplTC9fAQFkbutXnoivRDB6ZV1pBsA96DxDp1QYd4x3CZdzcdh9cLGS1nUkhmNS91UzU3aid4ZOeBdlycoW6bQpERnpTaw3nVxVC0cJRSTQJ45ldZJzvstBhX1BqBqby2iPusbq69HGUYKGbY//EXzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp; spf=fail smtp.mailfrom=users.sourceforge.jp; arc=none smtp.client-ip=153.127.30.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=users.sourceforge.jp Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=users.sourceforge.jp Received: from SIOS1075.ysato.name (al128006.dynamic.ppp.asahi-net.or.jp [111.234.128.6]) by sakura.ysato.name (Postfix) with ESMTPSA id 71C6D1C05A0; Thu, 4 Apr 2024 14:00:47 +0900 (JST) From: Yoshinori Sato To: linux-sh@vger.kernel.org Cc: Yoshinori Sato , Damien Le Moal , Niklas Cassel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Thomas Gleixner , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Greg Kroah-Hartman , Jiri Slaby , Magnus Damm , Daniel Lezcano , Rich Felker , John Paul Adrian Glaubitz , Lee Jones , Helge Deller , Heiko Stuebner , Shawn Guo , Sebastian Reichel , Chris Morgan , Linus Walleij , Arnd Bergmann , David Rientjes , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Vlastimil Babka , Baoquan He , Andrew Morton , Guenter Roeck , Kefeng Wang , Stephen Rothwell , Javier Martinez Canillas , Guo Ren , Azeem Shaikh , Max Filippov , Jonathan Corbet , Jacky Huang , Herve Codina , Manikanta Guntupalli , Anup Patel , Biju Das , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Sam Ravnborg , Sergey Shtylyov , Laurent Pinchart , linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [PATCH v7 07/37] sh: Fix COMMON_CLK support in CONFIG_OF=y. Date: Thu, 4 Apr 2024 13:59:32 +0900 Message-Id: <429d40e16e70381d25d77c627ae490a2be28a0b7.1712205900.git.ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Initialize the clock and timer using the COMMON_CLK procedure. sh's earlytimer mechanism doesn't work properly in OF, so timer initialization is delayed. If CONFIG_OF=y, perform the general timer initialization procedure. Signed-off-by: Yoshinori Sato --- arch/sh/boards/of-generic.c | 28 ++++------------------------ arch/sh/kernel/time.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c index f7f3e618e85b..f1ca5a914c11 100644 --- a/arch/sh/boards/of-generic.c +++ b/arch/sh/boards/of-generic.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -98,16 +99,7 @@ static void sh_of_smp_probe(void) #endif -static void noop(void) -{ -} - -static int noopi(void) -{ - return 0; -} - -static void __init sh_of_mem_reserve(void) +static void __init sh_of_mem_init(void) { early_init_fdt_reserve_self(); early_init_fdt_scan_reserved_mem(); @@ -140,25 +132,13 @@ static void __init sh_of_init_irq(void) irqchip_init(); } -static int __init sh_of_clk_init(void) -{ -#ifdef CONFIG_COMMON_CLK - /* Disabled pending move to COMMON_CLK framework. */ - pr_info("SH generic board support: scanning for clk providers\n"); - of_clk_init(NULL); -#endif - return 0; -} - static struct sh_machine_vector __initmv sh_of_generic_mv = { .mv_setup = sh_of_setup, .mv_name = "devicetree", /* replaced by DT root's model */ .mv_irq_demux = sh_of_irq_demux, .mv_init_irq = sh_of_init_irq, - .mv_clk_init = sh_of_clk_init, - .mv_mode_pins = noopi, - .mv_mem_init = noop, - .mv_mem_reserve = sh_of_mem_reserve, + .mv_mode_pins = generic_mode_pins, + .mv_mem_init = sh_of_mem_init, }; struct sh_clk_ops; diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 821a09cbd605..ce5b7c2f8628 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -19,7 +19,9 @@ #include #include #include +#include +#ifndef CONFIG_SH_DEVICE_TREE static void __init sh_late_time_init(void) { /* @@ -43,3 +45,13 @@ void __init time_init(void) late_time_init = sh_late_time_init; } +#else +/* CONFIG_SH_DEVICE_TREE */ +void __init time_init(void) +{ + pr_info("SH generic board support: scanning for clk providers\n"); + + of_clk_init(NULL); + timer_probe(); +} +#endif -- 2.39.2