Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv/clk: sophgo: Fix EFI RTC on Milk-V Pioneer
@ 2026-11-21 10:38 Han Gao via B4 Relay
  2026-11-21 10:38 ` [PATCH 1/2] riscv: efi: Map runtime MMIO with device attributes Han Gao via B4 Relay
  2026-11-21 10:38 ` [PATCH 2/2] clk: sophgo: sg2042-clkgen: Keep gates of reserved devices enabled Han Gao via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: Han Gao via B4 Relay @ 2026-11-21 10:38 UTC (permalink / raw)
  To: Ard Biesheuvel, Ilias Apalodimas, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Atish Patra, Stephen Boyd,
	Brian Masney, Jerome Brunet, Chen Wang, Inochi Amaoto
  Cc: Han Gao, linux-efi, linux-riscv, linux-kernel, linux-clk, sophgo,
	Han Gao

Pioneer firmware can take over the DS1307 on I2C0 and expose it through
EFI runtime services, so Linux uses rtc-efi. I2C0 is then marked
"reserved" in the device tree.

Two things break GetTime() in that setup:

- RISC-V maps EFI runtime MMIO as normal memory, and firmware takes a
  load access fault on the clock controller. Patch 1 maps it as I/O.

- I2C0 shares a clock gate with the other I2C controllers. Once Linux
  runtime-suspends them, the gate goes off and GetTime() returns
  EFI_NOT_READY. Patch 2 keeps gates used by reserved devices on.

Tested on Milk-V Pioneer.

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
Han Gao (2):
      riscv: efi: Map runtime MMIO with device attributes
      clk: sophgo: sg2042-clkgen: Keep gates of reserved devices enabled

 arch/riscv/kernel/efi.c                |  2 +-
 drivers/clk/sophgo/clk-sg2042-clkgen.c | 38 +++++++++++++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261121-b4-sg2042-efi-rtc-e4d5222513ae

Best regards,
--  
Han Gao <gaohan@iscas.ac.cn>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-21 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 10:38 [PATCH 0/2] riscv/clk: sophgo: Fix EFI RTC on Milk-V Pioneer Han Gao via B4 Relay
2026-11-21 10:38 ` [PATCH 1/2] riscv: efi: Map runtime MMIO with device attributes Han Gao via B4 Relay
2026-11-21 12:42   ` Ard Biesheuvel
2026-11-21 14:48     ` Han Gao
2026-11-21 10:38 ` [PATCH 2/2] clk: sophgo: sg2042-clkgen: Keep gates of reserved devices enabled Han Gao via B4 Relay
2026-11-21 16:11   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox