devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Kevin Hilman <khilman@baylibre.com>,
	devicetree <devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-amlogic@lists.infradead.org,
	Rob Herring <robh+dt@kernel.org>,
	Christian Hewitt <christianshewitt@gmail.com>
Subject: Re: [PATCH v3 1/2] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
Date: Sun, 30 Aug 2020 18:41:52 +0530	[thread overview]
Message-ID: <CANAwSgRV8y3Cc72CtppfJMPFKDSfpddzAKLeBGExn8G4OBVJ6g@mail.gmail.com> (raw)
In-Reply-To: <CAFBinCCEJJT_kfJ4qfTEz0R7Mo3ciCGDSw_MJYi_5PyNJA6x5w@mail.gmail.com>

Hi Martin,

On Sun, 30 Aug 2020 at 01:26, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Anand
>
> (I haven't re-read all of this discussion, so apologies if something
> in my reply doesn't make sense)
>
> On Sat, Aug 29, 2020 at 6:31 PM Anand Moon <linux.amoon@gmail.com> wrote:
> [...]
> > Just want to clear my confusion on RTC INT gpio setting is not needed.
> > I did not find any other example to support this changes.
> > So I have enable the debug logs on rtc-pcf8563.c with this current
> > patch at my end.
> my understanding is that your testing procedure is to simply use your
> original patch and see if rtc wake-up is working.
> since GPIOAO_7 is not explicitly mentioned in your testing procedure
> I'm assuming that you're not configuring it anywhere.
Yes...
> Kevin's concern is what happens when that GPIO is configured
> incorrectly (for example by some u-boot bug, firmware issue, ...). for
> example: have you tried to configure GPIOAO_7 in u-boot as output low
> pin and see if rtc wake-up is still working?
Yes I will check this later.

Meanwhile I have checked this feature with _mainline u-boot_ and
_odroid-n2 u-boot_
and the result is that rtc wakeup works.

>
> In your previous replies you mentioned various pin mux settings
> related to TSIN_A_DIN0 //  TDMB_FS // TDMB_SLV_FS
> I don't know how those are related to the RTC
> My suggestion is to look at
> arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi - it has a
> eth_phy_irq_pins definition and apply something similar on Odroid-N2
>

Thanks for your suggestion, I have given this a try see below.
But any new pinctrl setting leads to RTC probe failure.

# dmesg | grep rtc
[    5.308536] meson-vrtc ff8000a8.rtc: registered as rtc1
[    5.483978] rtc-pcf8563 0-0051: pcf8563_probe
[    5.487549] rtc-pcf8563 0-0051: pcf8563_write_block_data: err=-6
addr=0e, data=03
[    5.490116] rtc-pcf8563 0-0051: pcf8563_probe: write error
[    5.552763] rtc-pcf8563: probe of 0-0051 failed with error -5

------------------&------------------------------------
$ git diff arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
index 35a31cf181e2..dad54f8a947f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts
@@ -206,6 +206,15 @@ vddao_3v3: regulator-vddao_3v3 {
                regulator-always-on;
        };

+       /* Make sure the rtc irq pin is properly configured as input */
+       rtc_irq_pins: rtc-pin-irq {
+               mux {
+                       groups = "GPIOAO_7";
+                       function = "gpio_periphs";
+                       bias-disable;
+               };
+       };
+
        hdmi-connector {
                compatible = "hdmi-connector";
                type = "a";
@@ -481,7 +490,8 @@ hdmi_tx_tmds_out: endpoint {

 &i2c3 {
        pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
-       pinctrl-names = "default";
+       pinctrl-1 = <&rtc_irq_pins>;
+       pinctrl-names = "default", "gpio_periphs";
        status = "okay";

        rtc0: rtc@51 {

-Anand

  reply	other threads:[~2020-08-30 13:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 12:13 [PATCH v3 0/2]Enable RTC on Odroid N2 Anand Moon
2020-08-20 12:13 ` [PATCH v3 1/2] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node Anand Moon
2020-08-20 19:33   ` Kevin Hilman
2020-08-21  4:43     ` Anand Moon
2020-08-24 13:41       ` Anand Moon
2020-08-24 13:50         ` Neil Armstrong
2020-08-24 13:57           ` Anand Moon
2020-08-24 14:30           ` Jerome Brunet
2020-08-25  9:01             ` Anand Moon
2020-08-25 14:30               ` Jerome Brunet
2020-08-26  6:59                 ` Anand Moon
2020-08-29 16:31                   ` Anand Moon
2020-08-29 19:56                     ` Martin Blumenstingl
2020-08-30 13:11                       ` Anand Moon [this message]
2020-08-30 14:04                         ` Martin Blumenstingl
2020-08-30 20:05                           ` Anand Moon
2020-08-20 12:13 ` [PATCH v3 2/2] arm64: defconfig: Enable RTC devices for Amlogic boards Anand Moon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANAwSgRV8y3Cc72CtppfJMPFKDSfpddzAKLeBGExn8G4OBVJ6g@mail.gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=christianshewitt@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).