All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Tony Lindgren <tony@atomide.com>
Cc: "Nishanth Menon" <nm@ti.com>, Keerthy <a0393675@ti.com>,
	"Nishanth Menon" <menon.nishanth@gmail.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Laxman Dewangan" <ldewangan@nvidia.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"Russell King" <linux@arm.linux.org.uk>,
	linux-omap <linux-omap@vger.kernel.org>,
	devicetree@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"Marek Belisko" <marek@goldelico.com>,
	"Gražvydas Ignotas" <notasas@gmail.com>,
	Keerthy <j-keerthy@ti.com>
Subject: Re: [PATCH 1/3] ARM: dts: omap5-board-common: enable rtc and charging of backup battery
Date: Fri, 15 Jan 2016 19:11:47 +0100	[thread overview]
Message-ID: <E4B697CC-5C53-41A5-BD44-9AD3C9835774@goldelico.com> (raw)
In-Reply-To: <20160115154645.GA3904@atomide.com>

Hi,

Am 15.01.2016 um 16:47 schrieb Tony Lindgren <tony@atomide.com>:

> * H. Nikolaus Schaller <hns@goldelico.com> [160115 06:34]:
>> Am 14.01.2016 um 19:35 schrieb Tony Lindgren <tony@atomide.com>:
>>> updated patch, please retest that hwclock -w works properly with
>>> the RTC patch in this thread.
>> 
>> I tried and it works.
>> 
>> But then I found that you did set MUX_MODE7. Which is safe-mode.
> 
> Oops, that's a typo, sorry!
> 
>> And in safe-mode the gpio8_234/msecure ball should be "L".
>> 
>> Then I experimented a little and it appears that you can remove
>> the gpio-hog entry:
>> 
>> root@letux:~# devmem2 0x4A002980
>> /dev/mem opened.
>> Memory mapped at address 0xb6f48000.
>> Value at address 0x4A002980 (0xb6f48980): 0x1080006
>> root@letux:~# hwclock
>> Fri Jan 15 13:32:52 2016  -0.726651 seconds
>> root@letux:~# 
>> 
>> Or even mux the gpio to PIN_INPUT_PULLDOWN | MUX_MODE6:
> 
> Hmm interesting. Have to test here too. FYI, it might be also worth
> draining the back-up battery with a small resistor while testing
> to make sure there's no initial state in the PMIC.
> 
>> root@letux:~# devmem2 0x4A002980
>> /dev/mem opened.
>> Memory mapped at address 0xb6f35000.
>> Value at address 0x4A002980 (0xb6f35980): 0x108010E
>> root@letux:~# hwclock
>> Fri Jan 15 14:30:05 2016  -1.155714 seconds
>> root@letux:~# 
>> 
>> So I now wonder if the twl6037 variant on the OMAP5432EVM really has
>> the gpio7 enabled as msecure input (there is some mention of OTP variants
>> in the Palmas docs I have, but I don't have the one of the exact chip variant used
>> on the EVM).
>> 
>> If it were disabled by OTP (and then I assume it is automatically write-unprotected),
>> then we would simply have a useless connection from gpio8_234 to Palmas...
>> 
>> So the outcome might depend on the Palmas chip version that is used on any
>> board that includes the omap5-board-common.dtsi.
> 
> Could be different version yeah.
> 
>> And the main difference between hwclock not-working and working on the omap5evm
>> should be the nirq1 part of your patch!
> 
> OK so best to go back to square one with the testing with just the nirq1
> change.
> 
>> Please can someone else confirm that hwclock works without any init for
>> the msecure line and that I did not have a false positive by some other reason?
> 
> Just to be sure.. Have you tested with hwclock -w and made sure it
> changes the time? Otherwise you may have started the RTC with some
> earlier kernel and it still keeps on ticking so the read test is
> not enough.

You were right (and I as well to doubt my first results). And I also didn't
take ntpd in account.

Now:

root@letux:~# hwclock
Fri Jan 15 16:53:19 2016  -0.699173 seconds
root@letux:~# hwclock --set --date="2011-08-14 16:45:05"
root@letux:~# hwclock
Fri Jan 15 16:54:08 2016  -0.451544 seconds
root@letux:~# devmem2 0x4A002980 w 0x108010E
/dev/mem opened.
Memory mapped at address 0xb6f58000.
Value at address 0x4A002980 (0xb6f58980): 0x108010E
Written 0x108010E; readback 0x108010E
root@letux:~# hwclock --set --date="2011-08-14 16:45:05"
root@letux:~# hwclock
Fri Jan 15 16:55:18 2016  -0.555951 seconds
root@letux:~# devmem2 0x4A002980 w 0x108011E
/dev/mem opened.
Memory mapped at address 0xb6f7e000.
Value at address 0x4A002980 (0xb6f7e980): 0x108010E
Written 0x108011E; readback 0x108011E
root@letux:~# hwclock --set --date="2011-08-14 16:45:05"
root@letux:~# hwclock
Sun Aug 14 16:45:10 2011  -0.813317 seconds
root@letux:~# ^C
root@letux:~# 

So the pull-up in gpin-mode6 must be enable to *write* the RTC, i.e.
the msecure pin must indeed be pulled up (or hogged to "1").

It also works with gpio-hog + PIN_OUTPUT | MUX_MODE6.

This means:
* nirq1 is needed so that we don't have the timeout (on read/write)
* gpio-hog is needed on MODE6 or MODE0 to be able to really write (and not be silently ignored)

Thanks and BR,
Nikolaus

  parent reply	other threads:[~2016-01-15 18:11 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 12:01 [PATCH 0/3] Enable twl603x-GPADC for some OMAP4/OMAP5 boards and Palmas-RTC for OMAP5 H. Nikolaus Schaller
2016-01-05 12:01 ` [PATCH 1/3] ARM: dts: omap5-board-common: enable rtc and charging of backup battery H. Nikolaus Schaller
2016-01-05 12:01   ` H. Nikolaus Schaller
2016-01-05 23:40   ` Nishanth Menon
2016-01-05 23:40     ` Nishanth Menon
2016-01-06  1:00     ` Tony Lindgren
2016-01-06  1:00       ` Tony Lindgren
2016-01-06  8:11       ` H. Nikolaus Schaller
2016-01-06 16:41         ` Tony Lindgren
2016-01-06 16:41           ` Tony Lindgren
2016-01-06 16:47           ` H. Nikolaus Schaller
2016-01-06 17:09             ` Tony Lindgren
2016-01-06 17:09               ` Tony Lindgren
2016-01-08 17:49               ` H. Nikolaus Schaller
2016-01-08 18:15                 ` Tony Lindgren
2016-01-08 18:32                   ` H. Nikolaus Schaller
2016-01-08 18:32                     ` H. Nikolaus Schaller
2016-01-08 19:04                     ` Tony Lindgren
2016-01-08 19:31                       ` H. Nikolaus Schaller
2016-01-11 20:24                         ` Tony Lindgren
2016-01-12  0:09                           ` Tony Lindgren
2016-01-12  0:09                             ` Tony Lindgren
2016-01-12 13:30                             ` H. Nikolaus Schaller
2016-01-12 13:30                               ` H. Nikolaus Schaller
2016-01-12 21:27                               ` H. Nikolaus Schaller
2016-01-12 21:37                                 ` Nishanth Menon
2016-01-12 21:37                                   ` Nishanth Menon
2016-01-12 22:13                                   ` Tony Lindgren
2016-01-12 22:13                                     ` Tony Lindgren
2016-01-13 10:25                                 ` H. Nikolaus Schaller
2016-01-13 14:55                                   ` Nishanth Menon
2016-01-13 15:14                                     ` Grygorii Strashko
2016-01-13 15:14                                       ` Grygorii Strashko
2016-01-13 16:48                                       ` Tony Lindgren
2016-01-13 17:12                                         ` Grygorii Strashko
2016-01-13 17:38                                           ` Nishanth Menon
2016-01-13 18:00                                             ` H. Nikolaus Schaller
2016-01-13 18:23                                               ` Nishanth Menon
2016-01-13 17:29                                         ` Nishanth Menon
2016-01-13 18:00                                           ` Tony Lindgren
2016-01-13 18:08                                             ` H. Nikolaus Schaller
2016-01-13 18:08                                               ` H. Nikolaus Schaller
2016-01-13 18:31                                               ` Nishanth Menon
2016-01-13 18:31                                                 ` Nishanth Menon
2016-01-13 18:44                                                 ` H. Nikolaus Schaller
2016-01-13 18:44                                                   ` H. Nikolaus Schaller
2016-01-13 19:05                                                   ` Nishanth Menon
2016-01-13 19:22                                                     ` Grygorii Strashko
2016-01-13 19:40                                                     ` Tony Lindgren
2016-01-13 22:32                                                       ` Nishanth Menon
2016-01-14 10:01                                                         ` Keerthy
2016-01-14 17:39                                                           ` Nishanth Menon
2016-01-14 17:39                                                             ` Nishanth Menon
2016-01-14 18:35                                                             ` Tony Lindgren
2016-01-14 18:35                                                               ` Tony Lindgren
2016-01-15 14:33                                                               ` H. Nikolaus Schaller
2016-01-15 15:47                                                                 ` Tony Lindgren
2016-01-15 17:10                                                                   ` Tony Lindgren
2016-01-15 17:10                                                                     ` Tony Lindgren
2016-01-15 18:11                                                                   ` H. Nikolaus Schaller [this message]
2016-08-25  2:43                                                     ` Matthijs van Duin
2016-01-13 18:18                                             ` Nishanth Menon
2016-01-06  7:42     ` H. Nikolaus Schaller
2016-01-06  8:13       ` Laxman Dewangan
2016-01-06  8:13         ` Laxman Dewangan
2016-01-06 14:36         ` Nishanth Menon
2016-01-06 19:34           ` Rob Herring
2016-01-06 19:34             ` Rob Herring
2016-01-06 19:53             ` Nishanth Menon
2016-01-06 19:53               ` Nishanth Menon
2016-01-08 19:33               ` Rob Herring
2016-01-05 12:01 ` [PATCH 2/3] ARM: dts: omap5-board-common: enable iio gpadc for Palmas H. Nikolaus Schaller
2016-01-05 12:01   ` H. Nikolaus Schaller
2016-01-05 12:01 ` [PATCH 3/3] ARM: dts: twl6030: add gpadc H. Nikolaus Schaller
2016-01-05 12:01   ` H. Nikolaus Schaller

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=E4B697CC-5C53-41A5-BD44-9AD3C9835774@goldelico.com \
    --to=hns@goldelico.com \
    --cc=a0393675@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grygorii.strashko@ti.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=j-keerthy@ti.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marek@goldelico.com \
    --cc=mark.rutland@arm.com \
    --cc=menon.nishanth@gmail.com \
    --cc=nm@ti.com \
    --cc=notasas@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.