* Hardware clock on the Pioneer
@ 2025-12-30 22:56 Michael Orlitzky
2026-01-05 0:38 ` Chen Wang
0 siblings, 1 reply; 2+ messages in thread
From: Michael Orlitzky @ 2025-12-30 22:56 UTC (permalink / raw)
To: sophgo
Hello, I finally have the upstream kernel running on my Pioneer Box,
and I notice that the hardware clock is not enabled. I've patched this
in my own kernel (sg2042-milkv-pioneer.dts) by enabling i2c0, defining
the RTC,
&i2c0 {
pinctrl-0 = <&i2c0_cfg>;
pinctrl-names = "default";
status = "okay";
rtc: rtc@68 {
compatible = "dallas,ds1307";
reg = <0x68>;
};
};
and copying the pinctrl bits from i2c1:
i2c0_cfg: i2c0-cfg {
i2c0-pins {
pinmux = <PINMUX(PIN_IIC0_SDA, 0)>,
<PINMUX(PIN_IIC0_SCL, 0)>;
bias-pull-up;
drive-strength-microamp = <26800>;
input-schmitt-enable;
};
};
It seems to work:
$ sudo hwclock --show
2025-12-30 17:54:05.093606-05:00
Is there a reason not to do this? The sophgo upstream status page says
that the RTC is "Low priority, may not be needed." But if the above is
OK, I will submit a patch for it.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Hardware clock on the Pioneer
2025-12-30 22:56 Hardware clock on the Pioneer Michael Orlitzky
@ 2026-01-05 0:38 ` Chen Wang
0 siblings, 0 replies; 2+ messages in thread
From: Chen Wang @ 2026-01-05 0:38 UTC (permalink / raw)
To: Michael Orlitzky, sophgo
Hello~
On 12/31/2025 6:56 AM, Michael Orlitzky wrote:
> Hello, I finally have the upstream kernel running on my Pioneer Box,
> and I notice that the hardware clock is not enabled. I've patched this
> in my own kernel (sg2042-milkv-pioneer.dts) by enabling i2c0, defining
> the RTC,
>
> &i2c0 {
> pinctrl-0 = <&i2c0_cfg>;
> pinctrl-names = "default";
> status = "okay";
>
> rtc: rtc@68 {
> compatible = "dallas,ds1307";
> reg = <0x68>;
> };
> };
>
> and copying the pinctrl bits from i2c1:
>
> i2c0_cfg: i2c0-cfg {
> i2c0-pins {
> pinmux = <PINMUX(PIN_IIC0_SDA, 0)>,
> <PINMUX(PIN_IIC0_SCL, 0)>;
> bias-pull-up;
> drive-strength-microamp = <26800>;
> input-schmitt-enable;
> };
> };
>
> It seems to work:
>
> $ sudo hwclock --show
> 2025-12-30 17:54:05.093606-05:00
It looks good to me.
>
> Is there a reason not to do this? The sophgo upstream status page says
> that the RTC is "Low priority, may not be needed." But if the above is
> OK, I will submit a patch for it.
I don't quite remember why I initially said it wasn't needed; perhaps I
just thought it wouldn't significantly impact the main functionality, so
I wasn't in a rush to implement it. Later, I got busy with other things
and didn't have time to work on it.
Therefore, I think it should be ok for you to submit a patch to the
upstream.
BTW, I saw a similar implementation in the sophgo code repository [1],
but it doesn't quite conform to the upstream standard, while your
approach is better.
Link to:
https://github.com/sophgo/linux-riscv/blob/sg2042-rel-6.1.31/arch/riscv/boot/dts/sophgo/mango-milkv-pioneer.dts#L12
[1]
Thanks,
Chen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-05 0:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-30 22:56 Hardware clock on the Pioneer Michael Orlitzky
2026-01-05 0:38 ` Chen Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox