Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp494000lqb; Wed, 29 May 2024 01:43:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/yY3fFq9RgSDItMV1jnjcrcsy/siQ22+aXr40oR0+cthv8udhOn5UbZAUByByeRkAkdz11H7wam4tI/xoeABaUT4BGN4U409L/kht7A== X-Google-Smtp-Source: AGHT+IE6hgxYtNkWBFQfvv0YqasoM2pmY+R1RULzc0d3t//asIuBPJdHi6YrVaZtTI8T3WYVFU2B X-Received: by 2002:a17:90b:104c:b0:2a5:5a2c:6066 with SMTP id 98e67ed59e1d1-2bf5f20935fmr12457962a91.37.1716972214390; Wed, 29 May 2024 01:43:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716972214; cv=pass; d=google.com; s=arc-20160816; b=EPlJWsnUG6Idx3ThsjIDb06/rMJjpeMUf+C5P8hLoeVNCnAyntOiGEDN4sCk2pcxel s0p60kS0k0oxiLVynzSoGnKX1IRbG3MbcCIfgMlqdurBtvjotMP8VUn8jtIyS0scQCCZ M7Zy28EQcx1mMIpQzU7FPTyqVPkV+4IQ+5LqES/w+JQWINbJd1IoYbnlhDlE9BDulvSt 1DsCDiKfW8JgikuBQuANMKNi0urA3dzNhpnClgMXsH4urWCxLLACS4srQLS8mLzGIEj/ uEAMlFVqaG8DtD5+oolvl1Ezt2J9VZfcWgm7qYuKiN9OQ/RlWadRxuXX+IkeNfpIRq4+ EHMQ== 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=lQO+F7SmQCsZJJaUMosjqABNsNUVX77KeHUiQCQBVoc=; fh=NCl8CixGeTFE2HqgWDW+UlfZpmTMmLot3MlKffw+YoQ=; b=qecjK+LOiyQ/VN28FchztrhH8OVy7W0/jyoYFja6DsqFgYzfNR3j3QZQQdDdMdAMOe gEi3Zt0UsKKXNrdGwkAcdvzgyKY4H6X8gSbeysI/QQkdatxPCdEeisfl5NbM+b5fDXnW /LZ2qlkSj/sdGCqTLWA8AmSabZh1YjuyK+lac6LaobbSRd0KQnjZrxNQcynlspDXJXDh w4b9zvpJqqTuU9sREfyaBW11PAdlKza46d7lK+qNUvlIJKVLiOgkrHX0YdcZtpwqlLqQ +gwWhLYtrqN8NlFBMegtxm9Gq11NE+/aJcdRJVPJV7Er0sNTdEjHptoEs3hgKjiZtDKt WnGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-193645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193645-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c01400b4e8si2441232a91.14.2024.05.29.01.43.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 01:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-193645-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193645-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F2AFEB2A1C8 for ; Wed, 29 May 2024 08:19:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BC6F16A380; Wed, 29 May 2024 08:01:45 +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 9A33F16938E; Wed, 29 May 2024 08:01:42 +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=1716969704; cv=none; b=RRBBV36vY0HaxnJNPNHjfw9EBCBaTkJM+sotZyinwxkSEbKobGkGmshnbt24P8h7rWDAoggfIRmCuMvwkqsyIZB3JFgMXa1CygM0r+t20yfHXUPULlhKTcAqP9njgCizdGGTS7P/iKVBIJy3HvdNp3XTlUxiP2l9dMqBKxnUZcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969704; c=relaxed/simple; bh=Klae42aAEUmwCNAZhqTsDWsg17yqN5BuEDRVCoPnVdo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gY6UXOX1OjkyedE4FYKk9qcy2IA9pBE9mkBEQpqH7jaZzTSQzkmNcpKROBOuUWqy4bYW7jCC1GO0qb1XLM1PWkPDSfdzI7r4XuFN4jA5p8LAcVZfqNdDDB/v8Nhwdbh3YfS0C0zVw9Wg3a658NWDwMe/0LBh9OsR06CI0Hpdq/Y= 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 9ED681C0659; Wed, 29 May 2024 17:01:40 +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 , Neil Armstrong , Chris Morgan , Sebastian Reichel , Linus Walleij , Arnd Bergmann , Masahiro Yamada , Baoquan He , Andrew Morton , Guenter Roeck , Kefeng Wang , Stephen Rothwell , Azeem Shaikh , Guo Ren , Max Filippov , Jernej Skrabec , Herve Codina , Andy Shevchenko , Anup Patel , Jacky Huang , Hugo Villeneuve , Jonathan Corbet , Wolfram Sang , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Christophe JAILLET , Sam Ravnborg , Javier Martinez Canillas , 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: [DO NOT MERGE v8 07/36] sh: Fix COMMON_CLK support in CONFIG_OF=y. Date: Wed, 29 May 2024 17:00:53 +0900 Message-Id: <4433650694e36ab9fb7748904c5e424865edece6.1716965617.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 cc88cb8908cc..64f80d2878b1 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 @@ -100,16 +101,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(); @@ -142,25 +134,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