From c607f54eb734476fe46950be4aa7a4d86d469052 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Tue, 20 Oct 2026 13:14:39 +0000 Subject: [PATCH] hi3516cv300: give hwclock the SoC RTC as /dev/rtc0 The cv300 kernel was built without the RTC class, so the board had no /dev/rtc0: hwclock failed with "can't open '/dev/misc/rtc'", hctosys never ran, and fake-hwclock had no RTC to keep. The SDK's hi3516cv300_rtc.ko, which the image ships but nothing loads, cannot stand in: it offers only private HI_RTC_* ioctls, so hwclock's RTC_RD_TIME on it fails with EPERM (#191). Turn on the RTC class with hctosys, systohc, the dev, sysfs and proc interfaces, and rtc-hibvt. It binds once the device tree names the RTC "hisilicon,hi35xx-rtc" (OpenIPC/linux#125); until then this costs about 8 KB of kernel and changes nothing else. hi3516ev100 shares the kernel family but is left as it is: there is no ev100 board to run it on. --- .../board/hi3516cv300/hi3516cv300.generic.config | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.generic.config b/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.generic.config index 3c77419458..f173e11610 100644 --- a/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.generic.config +++ b/br-ext-chip-hisilicon/board/hi3516cv300/hi3516cv300.generic.config @@ -1839,7 +1839,17 @@ CONFIG_DETECT_CARD_TIME=200 # CONFIG_ACCESSIBILITY is not set # CONFIG_EDAC is not set CONFIG_RTC_LIB=y -# CONFIG_RTC_CLASS is not set +# The SoC RTC at 0x12090000, as /dev/rtc0 for hwclock, hctosys and +# fake-hwclock (#191). The SDK's hi3516cv300_rtc.ko is no substitute: it +# offers only private HI_RTC_* ioctls, so hwclock's RTC_RD_TIME fails on it. +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +CONFIG_RTC_DRV_HIBVT=y # CONFIG_DMADEVICES is not set # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set