linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: Neil Armstrong <narmstrong@baylibre.com>,
	Anand Moon <linux.amoon@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree <devicetree@vger.kernel.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Herring <robh+dt@kernel.org>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCHv1 0/3] Enable RTC on Odroid N2
Date: Thu, 16 Jul 2020 14:28:58 -0700	[thread overview]
Message-ID: <7hh7u7f8th.fsf@baylibre.com> (raw)
In-Reply-To: <a7e9b154-ceb2-3915-454a-a53c9b65622e@baylibre.com>

Neil Armstrong <narmstrong@baylibre.com> writes:

> Hi,
>
> On 16/07/2020 10:20, Neil Armstrong wrote:
>> Hi,
>> 
>> On 16/07/2020 10:14, Anand Moon wrote:
>>> Hi Neil,
>>>
>>> Thanks for your review comments.
>>>
>>> On Thu, 16 Jul 2020 at 12:35, Neil Armstrong <narmstrong@baylibre.com> wrote:
>>>>
>>>> Hi Anand,
>>>>
>>>> Only the vrtc is able to wakeup the device from suspend,
>>>> the external RTC is not capable.
>>>>
>>>> Neil
>>>
>>> Now I have two RTC driver registered
>>>
>>> $ dmesg | grep rtc
>>> [    4.737315] rtc-pcf8563 0-0051: registered as rtc0
>>> [    4.738763] rtc-pcf8563 0-0051: setting system clock to
>>> 2020-07-16T08:00:46 UTC (1594886446)
>>> [    4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1
>>>
>>> And there are two nodes
>>> # ls /dev/rtc*
>>> /dev/rtc  /dev/rtc0  /dev/rtc1
>>>
>>> So it seames an issue that /dev/rtc0 is not able to handle wakeup events.
>>> How can we resolve this issue?
>>>
>>> # time rtcwake -s 30 -m mem
>>> rtcwake: /dev/rtc0 not enabled for wakeup events
>> 
>> rtcwake -d /dev/rtc1 -s 30 -m mem
>> 
>> As Christian reported off-list, it may be necessary to keep the vrtc as rtc0,
>> so you should add aliases in the odroid-n2 DT to have vrtc as rtc0 and the on-board
>> rtc as rtc1, but it may break the hwclock tools, so the reverse may be better
>> but you'll need to specify rtc1 to rtcwake.
>
> While looking closer to the Odroid-N2 schematics and U-Boot/SCP Firmware, the external on-board
> RTC can wake the device with the GPIO_AO 7, and wakeup is enabled in:
> https://github.com/hardkernel/u-boot/blob/odroidn2-v2015.01/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c#L143
>
> So, something must be missing.

A couple possibilities come to mind (without looking at the specific RTC
driver):

1) pinctrl for that GPIO needs proper settings
2) DT node for the RTC needs "wakeup-source" property

Kevin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      parent reply	other threads:[~2020-07-16 21:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 16:02 [PATCHv1 0/3] Enable RTC on Odroid N2 Anand Moon
2020-07-15 16:02 ` [PATCHv1 1/3] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node Anand Moon
2020-07-16  7:08   ` Neil Armstrong
2020-07-16  8:02     ` Anand Moon
2020-07-16  8:08   ` Jerome Brunet
2020-07-16  9:12     ` Anand Moon
2020-07-15 16:02 ` [PATCHv1 2/3] arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC Anand Moon
2020-07-16  7:05   ` Neil Armstrong
2020-07-16  7:19     ` Anand Moon
2020-07-15 16:02 ` [PATCHv1 3/3] arm64: defconfig: Enable RTC devices for Amlogic boards Anand Moon
2020-07-16  7:08   ` Neil Armstrong
2020-07-16  7:05 ` [PATCHv1 0/3] Enable RTC on Odroid N2 Neil Armstrong
2020-07-16  8:14   ` Anand Moon
2020-07-16  8:20     ` Neil Armstrong
2020-07-16  8:35       ` Neil Armstrong
2020-07-16 15:42         ` Anand Moon
2020-07-16 21:28         ` Kevin Hilman [this message]

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=7hh7u7f8th.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux.amoon@gmail.com \
    --cc=mark.rutland@arm.com \
    --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).