--- zzzz-none-000/linux-4.1.52/drivers/rtc/Makefile 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/drivers/rtc/Makefile 2022-03-02 11:37:13.000000000 +0000 @@ -155,3 +155,35 @@ obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o obj-$(CONFIG_RTC_DRV_SIRFSOC) += rtc-sirfsoc.o obj-$(CONFIG_RTC_DRV_MOXART) += rtc-moxart.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