Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp58358lqe; Wed, 3 Apr 2024 22:19:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXAauAMibAaaVUbwTgsfYGo+kEUPb0ecYaprWHd/F2gmv+CWY/1WpE8bgiQ+OF8hqsZQ1RemNjAB7RtwuSQXLXwaUdsiftkbMQ59VDBqA== X-Google-Smtp-Source: AGHT+IHmhxuvwg76kO2n/bjxc2EG3pFoIoQcKs0s1NimKd9IXAlhVnklUEd2MLl5FP9OhGYkZXd1 X-Received: by 2002:a05:6214:27c7:b0:699:1b87:df08 with SMTP id ge7-20020a05621427c700b006991b87df08mr1455724qvb.7.1712207976377; Wed, 03 Apr 2024 22:19:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712207976; cv=pass; d=google.com; s=arc-20160816; b=YoxkMfdEL3NfrqzDQTbiUJVTpWtWOdLqb/d+KEOzLXGBMi/N3IxkChmRSnPfcMXoo7 r6cJ9HEyeMgeow+kKoQWatMD2T1ak1yc0JtsKnllncHhn9qd+ztEAk3cYZvFGV2aikF6 bMx11ba4xjpz2qpkancPOSoa0Q95pKF3lA1KISKKCkzMbEGRQqsZXBuRuPqi8FRML47o 9fKnztkQdCYe0NOo5Z8rZEBTZ2echCOhvZtnxRd3FW0jWt8FC7CXX09IUDzbo290/Ldc oGMjwijwT0t3YMhmDt/LvspSxFNjcgfRB5r+0tdZiPNJaQiJC4UIUoA1B+o9kDzPweI4 73ZA== 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=p3vI1HieLFvI0UBv0DCsgFFA2FVRzMcz1f/32AbLyEUzp0g84cw/1DmjPzfxahgrOg srPFcVqKe1zjBcQ85sIhm1GhZpYtmonO3XSwquAtuy7gd6p430lJAZsLlxTTaZoFLhlg 9rPuJFogsrMfxOuROCRI53lAqGqZnZ2WtybTlWkhGPHhJs/BiXq9psc3+XgllFke9mDm y/qAMFkMH4Bb1mM2SNmwapPB9CJtfwAAfFPF9C4ogDLQ49EiCCDg8UWWUkPJXoWW5kkO 4k2uEhvIMxr6kwiFxw245y3DGoJvjx15r6zaXJWPcT6/T10LECrZe6Mt1QWwZvpxEnvm JdjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130918-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ya14-20020a05620a5e4e00b0078be9dd7eaasi6549208qkn.663.2024.04.03.22.19.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 22:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130918-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1D9671C221DC for ; Thu, 4 Apr 2024 05:19:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1C2273534; Thu, 4 Apr 2024 05:15:10 +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 A65E371B58; Thu, 4 Apr 2024 05:15:08 +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=1712207710; cv=none; b=HmCRghtm7o9mdFQPN1cKm7VztkNLq6Kn7W/SQnKk5Gq1k31qy26OrIH1Ts3yvYkpFRud0LHWvAFS/ASg/FwO0osxkgdUNzmfZ2eu610JypIqbcE6CEtwSnFHBGviHSFzjv5wceC6Exib68NvSJuajhG5s5pgq0hb4DieYeE82K8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712207710; c=relaxed/simple; bh=HPmmSvMhl0GCAZDx4/OjF2pM4q8N+rvJP+xvKvCJtLQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HsSVhoXq63Uw0loRAGk987t/Ab22OgQ3+x6FfsYv4ouOdk8vqHeJw8JxiVlJ6LYDhtONj/TAAVe1YxGbvNqpZDjqdz94+gm0pxlrWVO4MLnJsOMDQlQRnniVMA4+ALQrL33kH0BjZWu5G6TLmwggL2RG0wIrcuiRJpqxqDrO21I= 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 D0D0F1C0FA0; Thu, 4 Apr 2024 14:15:05 +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: [RESEND v7 07/37] sh: Fix COMMON_CLK support in CONFIG_OF=y. Date: Thu, 4 Apr 2024 14:14:18 +0900 Message-Id: <429d40e16e70381d25d77c627ae490a2be28a0b7.1712207606.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