--- zzzz-none-000/linux-4.19.183/drivers/rtc/Makefile 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/rtc/Makefile 2023-06-28 08:54:19.000000000 +0000 @@ -176,3 +176,35 @@ obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o obj-$(CONFIG_RTC_DRV_ZYNQMP) += rtc-zynqmp.o obj-$(CONFIG_RTC_DRV_GOLDFISH) += rtc-goldfish.o +obj-$(CONFIG_RTC_DRV_AVM_REF_CLOCK) += rtc-avm.o + +ifeq ($(CONFIG_RTC_DRV_AVM_REF_CLOCK),m) +CFLAGS_rtc-avm.o += -DRTC_AVM_DEVICE_COUNT=1 # -DRTC_AVM_DEBUG=1 + +extra-y += install-S09-rtc + +$(obj)/S09-rtc: FORCE + $(Q)echo " GEN $@" >&2 + $(Q)echo "#!/bin/sh" >$@ + $(Q)echo "/sbin/modprobe rtc-avm" >>$@ + $(Q)echo 'rtc_major=`grep rtc /proc/devices`' >>$@ + $(Q)echo 'rtc_major=$${rtc_major%% rtc}' >>$@ + $(Q)echo 'mknod /dev/rtc0 c $${rtc_major} 0' >>$@ +# $(Q)echo 'mknod /dev/rtc1 c $${rtc_major} 1' >>$@ + +ifeq ($(INSTALL_MOD_PATH),) +export INSTALL_MOD_PATH = $(realpath $(srctree)/../../filesystem) +$(info avmnet/common: Guessing INSTALL_MOD_PATH: $(INSTALL_MOD_PATH)) +endif + +$(INSTALL_MOD_PATH)/etc/init.d/S09-rtc: $(obj)/S09-rtc + $(Q)mkdir -p $(dir $@) + $(Q)if ! test -s $@ || ! cmp -s $< $@ ; then \ + echo " INSTALL $@ <- $<" >&2 ; \ + cp $< $@ ; \ + fi + +PHONY += install-S09-rtc +$(obj)/install-S09-rtc: $(INSTALL_MOD_PATH)/etc/init.d/S09-rtc + +endif