Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp799649pxb; Thu, 31 Mar 2022 18:35:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGInXu/xvw3ve7o0YMqwVOVDeQ/dktygznAGB81nZ5tLVHsRCPcug9983Ue8wmOn2ARlHo X-Received: by 2002:a17:90b:1018:b0:1c9:fc37:fa31 with SMTP id gm24-20020a17090b101800b001c9fc37fa31mr9174167pjb.62.1648776924798; Thu, 31 Mar 2022 18:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648776924; cv=none; d=google.com; s=arc-20160816; b=MH0wkBhUDCMsZ//eku4MLOXErvvqp/vaJ+jmdgfyEGSbP41C+oZCZy3SK8DVn3rIvk ror2LxuWSAb3gQK/1fARx5S+6VLLySvOEiJwNMIWDyhKtsqd8++CF0OUrtwSOrkwmdPv DlGbyNa0wz5dLorZHmItCEhkX9frJi0x47cKWJMWFBx9zievuhY59jKthB78h13WDtDS HN2s/R54Jwju4tW2XWCEXi8N9zd66Ax8L/QNH2LUZ7jv1sN/RQm8Q3HaXhcywq3rKs6X 9LEO3gWAdI/WL5MwLIMhlnRECRRjMD8De4fO5sCf3AIu9vGOIbEZ9W82aCLsjk+jOoF4 3JXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=uOc8bieFFHCRlC2Sc+Da1M2Dv0xeHwXYUL9e7fwv18g=; b=mABIKyirumm1B9pK0A28aiBkEd7m6GiTwEtfRDaMLGiME3MTQfX1fOrpZPm9CoKHEF FpHuANw34ySEn6WSzq7L2XurZsRvB6dtQY6CqnVYtcT0lsHamxEya4kFxZwMtTzbl6cy Yt8c3LxLCB8Uo2C4PSiPjNwj2xqVB2XPXEVhFBIMbHRGaOq9A+F4tp7ez6bYeMhhAjGX yOmvA/qDWPVlPNAszRcDJakNrZ1yTjs5S/V8Dr1wqjm6yQRE4VyYUQx64f4Pelk9qS08 sbfn3eXdVX9qYvrd++4JTSVozfVy+99WQQvZu6jQ0CqGhBPZE/nTLHEaZ8YZyjjau75m Y1xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a634547000000b0039845840ff2si1148559pgk.41.2022.03.31.18.35.10; Thu, 31 Mar 2022 18:35:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241969AbiCaVzJ convert rfc822-to-8bit (ORCPT + 99 others); Thu, 31 Mar 2022 17:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242004AbiCaVzF (ORCPT ); Thu, 31 Mar 2022 17:55:05 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C2329C; Thu, 31 Mar 2022 14:53:15 -0700 (PDT) Received: from mail-wm1-f43.google.com ([209.85.128.43]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1McHQA-1oAUTN2kzU-00cdqe; Thu, 31 Mar 2022 23:53:13 +0200 Received: by mail-wm1-f43.google.com with SMTP id n63-20020a1c2742000000b0038d0c31db6eso429078wmn.1; Thu, 31 Mar 2022 14:53:13 -0700 (PDT) X-Gm-Message-State: AOAM5305OXLMlTXJuVThcnnOdrTLpgEYdyda/hmiJt+ilwn4OgZxhj1i WqRT5rdB2HBjfM8N/RtEYEcHuL5kNLUsjDUkqXc= X-Received: by 2002:a1c:f219:0:b0:38c:782c:3bb with SMTP id s25-20020a1cf219000000b0038c782c03bbmr6160589wmc.94.1648763593322; Thu, 31 Mar 2022 14:53:13 -0700 (PDT) MIME-Version: 1.0 References: <20220310195229.109477-1-nick.hawkins@hpe.com> <20220310195229.109477-9-nick.hawkins@hpe.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 31 Mar 2022 23:52:57 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 09/10] arch: arm: boot: dts: Introduce HPE GXP Device tree To: "Hawkins, Nick" Cc: Arnd Bergmann , "Verdun, Jean-Marie" , Olof Johansson , "soc@kernel.org" , Rob Herring , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:dPX2QrCBwjyyBFklQRFdGm6/RQRV4vXf4kV7XhROMWwEGX6FXrw KZIzwfpt4kK/Pbhfi5zJbBnMJM0Bd1iPVqK8lzN/cCjMTIqLlhaV0zdk6muZ3Z4nA/3jdDE 4XvPZ5huUg8fBdbePoCa/CkzzlWc+EzhsLARswxnjU8wFcwAOJ0VFRKSDYyKgwVVMGJXWIH dhk4v+ZYe3XHXvcrfOC4A== X-UI-Out-Filterresults: notjunk:1;V03:K0:dvkznSxNqDI=:DsE35yqgJj1v1QpJsOmvkz E66/7cH6BsPYxD9yRpnIQubXtcDYAr8CZ6zTB2TDk9RHP6l1t1p7hcnJ5PCkUwSwHfdzG83pn zhM5LI5TQkxr3iFAugHgaDv75OhRMYiKrl36Kh9HQM78bOgKMvt9ucjtP8HxGVAUYmk2XisbL QT0ncych37ZsF8g5s1jUjQI6/iKfWTeU0acaRN3wnXyJoLUeJF2uXvkZjFGvEeVM5GMDIkQj8 pk94zkpsqT6NuqZb0Hfz9kMz04O8TsPCeya99YUFk8BkXtJ4hbmUDmcawkDBjpNYNqB1zHC4n hwRzikiY/iN4CINHIsl5OAqiGMJ1dS13t7B4z64yLalldjWqAt/O1HfwgIn707W6bszjZ2+AY IXYvoV3UUccQp96AIQsdui/NM3AQB3FyoDZ4Kmk6O6ytIEC79YNiuWiLB7g/TKysdCDauh2Ro hGZGdBHSRXcRydpCKml9IO1S0s2x6FqMuRIIliP49DVttjY0fZW3h+xB8nRBM2mWBKuw2TQ3/ 5PIm0DfezXur5X3rUDw916NQ1KiHpybgcJ+v75HKMXVcyxIc4yww4I5QXk/VhihwaNu+5VOYv hZxXD9pUxRU7M3g1RHyrF/eA8NLkMKtZKcbfc0zZApuYgtf0JC6L3qigGIh4CUh/yIlwSdkfK 9+ehN6+zLrcLnVL1oCLzqPOj+krSyZz4SjRw+DWk3F+JLF1NzTuSDsCoWYQFsg1+w/Lk= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 31, 2022 at 11:09 PM Hawkins, Nick wrote: > On Thu, Mar 31, 2022 at 12:27 AM Hawkins, Nick wrote: > > On Tue, Mar 29, 2022 at 9:38 PM Hawkins, Nick > wrote: > > I'd have to study the other examples myself to see what is most common. > > > My feeling would be that it's better to either have a "hpe,gxp-timer" parent device with a watchdog child but no syscon, or to have a syscon/simple-mfd parent with both the timer and the watchdog as children. > > Arnd, thanks for the feedback. I am trying to use the approach you recommend where you have a syscon/simple-mfd parent with watchdog and timer as children. > > st: chip-controller@80 { > compatible = "hpe,gxp-ctrl-st","syscon","simple-mfd"; > reg = <0x80 0x16>; > > timer0: timer { > compatible = "hpe,gxp-timer"; > interrupts = <0>; > interrupt-parent = <&vic0>; > clocks = <&ppuclk>; > clock-names = "ppuclk"; > }; > > watchdog { > compatible = "hpe,gxp-wdt"; > }; > }; > > This compiles without any errors but I do have some questions about accessing the regmap in both drivers, specifically the timer code. How do you use a regmap with clocksource_mmio_init? I tried searching through the codebase and could not find the answer. I assume I am missing some vital step. I don't think you can do this, if you are using the syscon regmap, you go through the regmap indirection rather than accessing the mmio register by virtual address, and this may result in some extra code in your driver, and a little runtime overhead. If you prefer to avoid that, you can go back to having the timer node as the parent, but without being a syscon. In this case, the watchdog would be handled in one of these ways: a) a child device gets created from the clocksource driver and bound to the watchdog driver, which then uses a private interface between the clocksource and the watchdog to access the registers b) the clocksource driver itself registers as a watchdog driver, without having a separate driver module One thing to consider is whether the register range here contains any registers that may be used in another driver, e.g. a second timer, a PWM, or a clk controller. If not, you are fairly free to pick any of these approaches. Arnd