lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Jan 2020 17:47:12 +0100
From:   Jernej Škrabec <jernej.skrabec@...l.net>
To:     Maxime Ripard <mripard@...nel.org>
Cc:     wens@...e.org, robh+dt@...nel.org, mark.rutland@....com,
        linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-sunxi@...glegroups.com
Subject: Re: [PATCH] arm64: dts: allwinner: h6: tanix-tx6: Use internal oscillator

Hi!

Dne četrtek, 16. januar 2020 ob 09:06:52 CET je Maxime Ripard napisal(a):
> Hi Jernej,
> 
> On Mon, Jan 13, 2020 at 07:07:20PM +0100, Jernej Skrabec wrote:
> > Tanix TX6 doesn't have external 32 kHz oscillator, so switch RTC clock
> > to internal one.
> > 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@...l.net>
> > ---
> > 
> > While this patch gives one possible solution, I mainly want to start
> > discussion why Allwinner SoC dtsi reference external 32 kHz crystal
> > although some boards don't have it. My proposal would be to make clock
> > property optional, based on the fact if external crystal is present or
> > not. However, I'm not sure if that is possible at this point or not.
> 
> It's probably a bit of a dumb question but.. are you sure the crystal
> is missing?

Although I don't have schematic, I'm pretty sure. Without this patch or one at 
[1], RTC gives a lot of errors in dmesg. I think that unpopulated XC2 pads 
near SoC (see [2]) are probably reserved for crystal.

With patch in [1], which enables automatic switching in case of error, I saw 
that on this box RTC always switched to internal RC.

> 
> The H6 datasheet mentions that the 32kHz crystal needs to be there,
> and it's part of the power sequence, so I'd expect all boards to have
> it.

Can you be more specific where it is stated that crystal is mandatory? 

Note that schematic of some boards, like OrangePi PC2 (H5) or OrangePi Zero 
(H3) don't even have 32K crystal in them.

> 
> > Driver also considers missing clock property as deprecated (old DT) [1],
> > so this might complicate things even further.
> > 
> > What do you think?
> 
> I'm pretty sure (but that would need to be checked) that we never got
> a node without the clocks property on the H6. If that's the case, then
> we can add a check on the compatible.

Yes, that would be nice solution. I can work something out if you agree that 
this is the way.

> 
> > Best regards,
> > Jernej
> > 
> > [1]
> > https://elixir.bootlin.com/linux/latest/source/drivers/rtc/rtc-sun6i.c#L2
> > 63> 
> >  arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts
> > b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts index
> > 83e6cb0e59ce..af3aebda47bb 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts
> > @@ -91,6 +91,12 @@ &r_ir {
> > 
> >  	status = "okay";
> >  
> >  };
> > 
> > +/* This board doesn't have external 32 kHz crystal. */
> > +&rtc {
> > +	assigned-clocks = <&rtc 0>;
> > +	assigned-clock-parents = <&rtc 2>;
> > +};
> > +
> 
> This should be dealt with in the driver however.

Sure, it is something to start discussion, I don't like tackling clocks in DT 
either.

Best regards,
Jernej

[1] https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Allwinner/
devices/H6/patches/linux/15-RTC-workaround.patch
[2] http://linux-sunxi.org/images/2/2e/Tanix_tx6_pcb_top.png




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ