From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44F9DCA5FC5 for ; Wed, 30 Sep 2026 17:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wG87avWDvYFoGPnCxGXtYfkNymSrwnb7XNMJgIjYo74=; b=YdTkPIJVmNSsjyfBRs/Mm0HUPB uGDX2fniWLGZqM2X6SVyyAGJcLkwpi7rS6BrAZzhMhOHlYhOEVcjg3de6A/mFUCrjsLh+zWtjeq57 4AkzwsAltV4nsCpkg2G0pv5jgzSqPkqshnYm4gs7rNRadEwc/S5hNz/fvE/4waIsB2OEwxi7WSS7q IMsTPYumPnC5nGGC/ixAxCh0EY1SI7OznLs37zQKvwA3d99Qu1xFaBnDgNx6ITfIW6CYtueoUG9Pz XVnzGcQ7dKU/d4TW0bTBH6XnaRwH+hYSwfpgDr3xuBS+664zF4ZPa/78UTePCirJ9re0aJFN8WcVK ERwMxL/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBy7F-00000006q3G-3pxF; Wed, 30 Sep 2026 17:29:13 +0000 Received: from mail-wr2-x0e.google.com ([2a00:1450:4864:30::e]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBy7C-00000006q1v-0T6L for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2026 17:29:11 +0000 Received: by mail-wr2-x0e.google.com with SMTP id ffacd0b85a97d-48afe3b2383so889198f8f.1 for ; Wed, 30 Sep 2026 10:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790789348; x=1791394148; darn=lists.infradead.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wG87avWDvYFoGPnCxGXtYfkNymSrwnb7XNMJgIjYo74=; b=ScBp+wM//StdUs6nzorO8ypdzyAhPDXIO5jZatDjj4QLPHfwNncnYbYof342Od32fn vJlXsPxCI6UaW2xLuc3Q3lkxdAVKK5k1Af24StLENU9ACxzK8ZHl0xqeFiPDU/CYjeRB XEpaKt2bbl1L3cFslJwVWLtv0K2B2CXmDXoOU/q6t4kDkdKnHBDpBYxIauSA04LhPmdX AGTlSB+irji1RnXWzr3SPPXUUA/w72y60LLQyPcY2S5PbkQ19AnyWLlfFV1YYuDHpiBo noOm/JOwdQlNI7DElsssUtCvmR5bjtGI7Uo3YslZynJ/8p0g7FgTeG2h3RX6Jwv4MYLC UItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790789348; x=1791394148; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wG87avWDvYFoGPnCxGXtYfkNymSrwnb7XNMJgIjYo74=; b=XINf+5lbVarvjkbWkVY/AVYBAT3gjHxfn/4UQ5y6sEHQvtYI6EclVKQCu2FeFho2wi HgGKlEBi5Gu1S9SiBrjsXEQblhmCjhwXXNHw31fddbAx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:b0:488:83b1:16a1 with SMTP id ffacd0b85a97d-48b0242562emr4834485f8f.7.1790789347964; Wed, 30 Sep 2026 10:29:07 -0700 (PDT) Received: from [192.168.0.40] (212.71.14.70.adsl.dyn.edpnet.net. [212.71.14.70]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48b06a2fca3sm527144f8f.34.2026.09.30.10.29.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Sep 2026 10:29:07 -0700 (PDT) Message-ID: <2872a37d-4f24-4429-aba5-34f020740821@gmail.com> Date: Wed, 30 Sep 2026 19:29:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 2/2] rtc: Add Raspberry Pi 5 RTC driver To: Stefan Wahren Cc: Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Jonathan Bell , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, pbrobinson@gmail.com, Dom Cobley References: <20260930095203.492949-1-sander.speetjens@gmail.com> <20260930095203.492949-3-sander.speetjens@gmail.com> <7441de5b-e9a6-4080-b312-d6c7123fdcde@gmx.net> Content-Language: en-US From: Sander Speetjens In-Reply-To: <7441de5b-e9a6-4080-b312-d6c7123fdcde@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260930_102910_166994_D17FFC38 X-CRM114-Status: GOOD ( 23.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Stefan, >> +    // Check if our model is a Raspberry Pi 5, as the RTC is only >> present on that model. >> +    if (!of_machine_is_compatible("brcm,bcm2712")) >> +        return; > I don't like the comment, because it doesn't check for Raspberry Pi 5, > the code checks for a BCM2712 SoC which could also be on a CM5 or a > Raspberry Pi 500+ I changed it to BCM2712, but isn't RPi 5 the generation/platform name and RPi 5b the specific board? >> +#define RPI_FIRMWARE_GET_RTC_REG 0x00030087 >> +#define RPI_FIRMWARE_SET_RTC_REG 0x00038087 > Was there a specific reason to not include these defines to > include/soc/bcm2835/raspberry-pi-firmware.h as all the others firmware > tags? No specific reason, this is how Raspberry Pi originally did it, I moved them to raspberrypi-firmware.h >> + >> +enum { >> +    RTC_TIME, >> +    RTC_ALARM, >> +    RTC_ALARM_PENDING, >> +    RTC_ALARM_ENABLE, >> +    RTC_BBAT_CHG_VOLTS, >> +    RTC_BBAT_CHG_VOLTS_MIN, >> +    RTC_BBAT_CHG_VOLTS_MAX, >> +    RTC_BBAT_VOLTS >> +}; > Hm, an enum suggests that we simply can add / remove items, but that's > not the case. The Raspberry Pi firmware defines the values. Should I also move those to raspberrypi-firmware.h or is this not what you imply? > In case rpi_rtc_set_limits() fails, both limit would be initialized > with 0 and this always fail. Maybe we should dev_warn to > rpi_rtc_set_limits()? I added a warning for failing to set the min and max values. > Just to be sure, both calls are optional and not critical for the > drivers function? > Why does rpi_rtc_set_charge_voltage have a return value at all? I removed the return value >> +MODULE_ALIAS("platform:raspberrypi-rtc"); > Is this really necessary for module autoloading? I'm not sure, it was used in the previous versions when using the platform device register on the register_clk driver before it had a custom dt node. Kind regards, Sander Speetjens