diff --git a/buildroot-external/Config.in b/buildroot-external/Config.in index e41683a30..9f16bd18b 100644 --- a/buildroot-external/Config.in +++ b/buildroot-external/Config.in @@ -8,3 +8,6 @@ source "$BR2_EXTERNAL_HASSOS_PATH/package/rpi-eeprom/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/rtl8812au/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/os-agent/Config.in" source "$BR2_EXTERNAL_HASSOS_PATH/package/udisks2/Config.in" +source "$BR2_EXTERNAL_HASSOS_PATH/package/eq3_char_loop/Config.in" +source "$BR2_EXTERNAL_HASSOS_PATH/package/generic_raw_uart/Config.in" +source "$BR2_EXTERNAL_HASSOS_PATH/package/rpi-rf-mod/Config.in" diff --git a/buildroot-external/board/asus/hassos-hook.sh b/buildroot-external/board/asus/hassos-hook.sh index bb0170f2b..cb6b8e604 100755 --- a/buildroot-external/board/asus/hassos-hook.sh +++ b/buildroot-external/board/asus/hassos-hook.sh @@ -10,6 +10,10 @@ function hassos_pre_image() { "${BINARIES_DIR}/rk3288-tinker.dtb" \ "${BINARIES_DIR}/rk3288-tinker-s.dtb" + mkdir -p "${BOOT_DATA}/overlays" + cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/" + cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt" + echo "console=tty1" > "${BOOT_DATA}/cmdline.txt" # SPL diff --git a/buildroot-external/board/asus/tinker/boot-env.txt b/buildroot-external/board/asus/tinker/boot-env.txt new file mode 100644 index 000000000..1870a8e10 --- /dev/null +++ b/buildroot-external/board/asus/tinker/boot-env.txt @@ -0,0 +1,2 @@ +# Uncomment this to enable GPIO support for RPI-RF-MOD/HM-MOD-RPI-PCB +#overlays=rpi-rf-mod diff --git a/buildroot-external/board/asus/tinker/uboot-boot.ush b/buildroot-external/board/asus/tinker/uboot-boot.ush index 9cab62b3f..d3f86d055 100644 --- a/buildroot-external/board/asus/tinker/uboot-boot.ush +++ b/buildroot-external/board/asus/tinker/uboot-boot.ush @@ -23,14 +23,37 @@ setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=ap setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait" setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait" +# Load environment from haos-config.txt +if test -e mmc ${devnum}:1 haos-config.txt; then + fatload mmc ${devnum}:1 ${ramdisk_addr_r} haos-config.txt + env import -t ${ramdisk_addr_r} ${filesize} +fi + # Load extraargs fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline # Load device tree if test "$devnum" = "0"; then - fatload mmc ${devnum}:1 ${fdt_addr_r} rk3288-tinker-s.dtb + setenv fdtfile "rk3288-tinker-s.dtb" else - fatload mmc ${devnum}:1 ${fdt_addr_r} rk3288-tinker.dtb + setenv fdtfile "rk3288-tinker.dtb" +fi + +echo "Loading standard device tree ${fdtfile}" +fatload mmc ${devnum}:1 ${fdt_addr_r} ${fdtfile} +fdt addr ${fdt_addr_r} + +# load dt overlays +fdt resize 65536 +for overlay_file in ${overlays}; do + if fatload mmc ${devnum}:1 ${ramdisk_addr_r} overlays/${overlay_file}.dtbo; then + echo "Applying kernel provided DT overlay ${overlay_file}.dtbo" + fdt apply ${ramdisk_addr_r} || setenv overlay_error "true" + fi +done +if test "${overlay_error}" = "true"; then + echo "Error applying DT overlays, restoring original DT" + fatload mmc ${devnum}:1 ${fdt_addr_r} ${fdtfile} fi setenv bootargs diff --git a/buildroot-external/board/asus/tinker/uboot.config b/buildroot-external/board/asus/tinker/uboot.config index 3f90be221..13e696205 100644 --- a/buildroot-external/board/asus/tinker/uboot.config +++ b/buildroot-external/board/asus/tinker/uboot.config @@ -1,2 +1,3 @@ # CONFIG_USB_STORAGE is not set # CONFIG_DOS_PARTITION is not set +CONFIG_OF_LIBFDT_OVERLAY=y diff --git a/buildroot-external/board/raspberrypi/boot-env.txt b/buildroot-external/board/raspberrypi/boot-env.txt index 65f6b39e2..8d6c716d6 100644 --- a/buildroot-external/board/raspberrypi/boot-env.txt +++ b/buildroot-external/board/raspberrypi/boot-env.txt @@ -60,6 +60,12 @@ kernel=u-boot.bin # Uncomment this to enable the lirc-rpi module #dtoverlay=lirc-rpi +# Uncomment this to enable GPIO support for RPI-RF-MOD/HM-MOD-RPI-PCB +#enable_uart=1 +#dtparam=i2c_arm=on +#dtoverlay=miniuart-bt +#dtoverlay=rpi-rf-mod + # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) diff --git a/buildroot-external/board/raspberrypi/hassos-hook.sh b/buildroot-external/board/raspberrypi/hassos-hook.sh index 583e70a39..dda9d21d0 100755 --- a/buildroot-external/board/raspberrypi/hassos-hook.sh +++ b/buildroot-external/board/raspberrypi/hassos-hook.sh @@ -10,6 +10,7 @@ function hassos_pre_image() { cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/" cp -r "${BINARIES_DIR}/rpi-firmware/"* "${BOOT_DATA}/" cp "${BOARD_DIR}/../boot-env.txt" "${BOOT_DATA}/config.txt" + cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/" # EEPROM update for Raspberry Pi 4/Compute Module 4 if grep -Eq "^BR2_PACKAGE_RPI_EEPROM=y$" "${BR2_CONFIG}"; then diff --git a/buildroot-external/configs/generic_x86_64_defconfig b/buildroot-external/configs/generic_x86_64_defconfig index 3c7681950..66f6ab2e1 100644 --- a/buildroot-external/configs/generic_x86_64_defconfig +++ b/buildroot-external/configs/generic_x86_64_defconfig @@ -114,3 +114,4 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_INTEL_E1000E=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/odroid_c2_defconfig b/buildroot-external/configs/odroid_c2_defconfig index d118a1597..e8c346d62 100644 --- a/buildroot-external/configs/odroid_c2_defconfig +++ b/buildroot-external/configs/odroid_c2_defconfig @@ -111,3 +111,4 @@ BR2_PACKAGE_HARDKERNEL_BOOT_ODROID_C2=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_RTL8812AU=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/odroid_c4_defconfig b/buildroot-external/configs/odroid_c4_defconfig index 988601d25..23996bb2a 100644 --- a/buildroot-external/configs/odroid_c4_defconfig +++ b/buildroot-external/configs/odroid_c4_defconfig @@ -109,3 +109,4 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_HARDKERNEL_BOOT=y BR2_PACKAGE_HARDKERNEL_BOOT_ODROID_C4=y BR2_PACKAGE_RTL8812AU=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/odroid_n2_defconfig b/buildroot-external/configs/odroid_n2_defconfig index ad80589f0..251f07576 100644 --- a/buildroot-external/configs/odroid_n2_defconfig +++ b/buildroot-external/configs/odroid_n2_defconfig @@ -111,3 +111,4 @@ BR2_PACKAGE_HARDKERNEL_BOOT_ODROID_N2=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_RTL8812AU=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/odroid_xu4_defconfig b/buildroot-external/configs/odroid_xu4_defconfig index 6222902e0..bf7fab886 100644 --- a/buildroot-external/configs/odroid_xu4_defconfig +++ b/buildroot-external/configs/odroid_xu4_defconfig @@ -114,3 +114,4 @@ BR2_PACKAGE_HARDKERNEL_BOOT_ODROID_XU4=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y BR2_PACKAGE_RTL8812AU=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index da3818042..7e585df54 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -115,3 +115,4 @@ BR2_PACKAGE_APPARMOR_PROFILES=y BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index 94f1e99f8..90c13ce28 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -108,3 +108,5 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_BCM43XX=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index 72e1f699b..409b0f44a 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -109,3 +109,5 @@ BR2_PACKAGE_APPARMOR_PROFILES=y BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index 27715eb52..54fbeba77 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -108,3 +108,5 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_BCM43XX=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 09cf16f1c..90a5cb93f 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -108,3 +108,5 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_BCM43XX=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi4_64_defconfig b/buildroot-external/configs/rpi4_64_defconfig index ce55236e9..1a6f06241 100644 --- a/buildroot-external/configs/rpi4_64_defconfig +++ b/buildroot-external/configs/rpi4_64_defconfig @@ -111,3 +111,5 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_BCM43XX=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi4_defconfig b/buildroot-external/configs/rpi4_defconfig index 1b4d3a789..f053f0289 100644 --- a/buildroot-external/configs/rpi4_defconfig +++ b/buildroot-external/configs/rpi4_defconfig @@ -109,3 +109,5 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_BCM43XX=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index af4016063..c180edd3e 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -109,3 +109,5 @@ BR2_PACKAGE_APPARMOR_PROFILES=y BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y diff --git a/buildroot-external/configs/tinker_defconfig b/buildroot-external/configs/tinker_defconfig index 9fa04b2d0..d83cd4cf6 100644 --- a/buildroot-external/configs/tinker_defconfig +++ b/buildroot-external/configs/tinker_defconfig @@ -31,6 +31,7 @@ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_HASSOS_PATH)/kernel/hasso BR2_LINUX_KERNEL_LZ4=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="rk3288-tinker rk3288-tinker-s" +BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_HASSOS_PATH)/busybox.config" @@ -113,3 +114,6 @@ BR2_PACKAGE_LIBCURL_CURL=y BR2_PACKAGE_BLUETOOTH_RTL8723=y BR2_PACKAGE_DOSFSTOOLS=y BR2_PACKAGE_DOSFSTOOLS_FSCK_FAT=y +BR2_PACKAGE_RPI_RF_MOD=y +BR2_PACKAGE_RPI_RF_MOD_DTS=y +BR2_PACKAGE_RPI_RF_MOD_DTS_TINKER=y diff --git a/buildroot-external/kernel/device-support.config b/buildroot-external/kernel/device-support.config index bc10ec30f..a3a97d084 100644 --- a/buildroot-external/kernel/device-support.config +++ b/buildroot-external/kernel/device-support.config @@ -156,6 +156,10 @@ CONFIG_SND_HDA_CODEC_ANALOG=m CONFIG_SND_HDA_CODEC_VIA=m CONFIG_SND_HDA_CODEC_HDMI=m +# GPIO support +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y + # Can Bus support CONFIG_CAN=m CONFIG_CAN_RAW=m diff --git a/buildroot-external/package/eq3_char_loop/0001-Makefile.patch b/buildroot-external/package/eq3_char_loop/0001-Makefile.patch new file mode 100644 index 000000000..f92449731 --- /dev/null +++ b/buildroot-external/package/eq3_char_loop/0001-Makefile.patch @@ -0,0 +1,4 @@ +--- ./KernelDrivers/Makefile.orig 2021-04-02 17:01:07.029932165 +0200 ++++ ./KernelDrivers/Makefile 2020-06-04 14:36:10.188174788 +0200 +@@ -0,0 +1 @@ ++obj-m += eq3_char_loop.o diff --git a/buildroot-external/package/eq3_char_loop/0002-version1_1.patch b/buildroot-external/package/eq3_char_loop/0002-version1_1.patch new file mode 100644 index 000000000..7b2208dda --- /dev/null +++ b/buildroot-external/package/eq3_char_loop/0002-version1_1.patch @@ -0,0 +1,109 @@ +--- ./KernelDrivers/eq3_char_loop.c.orig 2017-05-14 22:57:19.109181928 +0200 ++++ ./KernelDrivers/eq3_char_loop.c 2020-06-04 14:36:10.188174788 +0200 +@@ -48,8 +48,8 @@ + /* Use 'L' as magic number */ + #define EQ3LOOP_IOC_MAGIC 'L' + +-#define EQ3LOOP_IOCSCREATESLAVE _IOW(EQ3LOOP_IOC_MAGIC, 1, unsigned long) +-#define EQ3LOOP_IOCGEVENTS _IOR(EQ3LOOP_IOC_MAGIC, 2, unsigned long) ++#define EQ3LOOP_IOCSCREATESLAVE _IOW(EQ3LOOP_IOC_MAGIC, 1, uint32_t) ++#define EQ3LOOP_IOCGEVENTS _IOR(EQ3LOOP_IOC_MAGIC, 2, uint32_t) + + #define EVENT_BIT_SLAVE_OPENED 0 + #define EVENT_BIT_SLAVE_CLOSED 1 +@@ -62,6 +62,12 @@ + + #define DUMP_READWRITE 0 + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) ++ #define _access_ok(__type, __addr, __size) access_ok(__addr, __size) ++#else ++ #define _access_ok(__type, __addr, __size) access_ok(__type, __addr, __size) ++#endif ++ + struct eq3loop_channel_data + { + struct circ_buf master2slave_buf; +@@ -353,7 +359,7 @@ + { + ret=-EFAULT; + count_to_end = CIRC_SPACE( head, channel->master2slave_buf.tail, BUFSIZE); +- printk( KERN_ERR EQ3LOOP_DRIVER_NAME ": eq3loop_write_master() %s: not enought space in the buffers. free space = %i, required space = %i", channel->name,count_to_end,count ); ++ printk( KERN_ERR EQ3LOOP_DRIVER_NAME ": eq3loop_write_master() %s: not enough space in buffers. free space = %zu, required space = %zu", channel->name,count_to_end,count ); + goto out; + } + /* ok, space is free, write something */ +@@ -389,7 +395,7 @@ + up (&channel->sem); + if(ret < 0) + { +- printk( KERN_INFO EQ3LOOP_DRIVER_NAME ": eq3loop_write_master() retrun error:"); ++ printk( KERN_INFO EQ3LOOP_DRIVER_NAME ": eq3loop_write_master() return error: %d", ret); + } + if( ret > 0 || CIRC_CNT(channel->master2slave_buf.head,channel->master2slave_buf.tail,BUFSIZE) ) + { +@@ -456,9 +462,9 @@ + * "write" is reversed + */ + if (_IOC_DIR(cmd) & _IOC_READ) +- ret = !access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd)); ++ ret = !_access_ok(VERIFY_WRITE, (void *)arg, _IOC_SIZE(cmd)); + else if (_IOC_DIR(cmd) & _IOC_WRITE) +- ret = !access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd)); ++ ret = !_access_ok(VERIFY_READ, (void *)arg, _IOC_SIZE(cmd)); + if (ret) return -EFAULT; + + switch(cmd) { +@@ -500,7 +506,7 @@ + switch(cmd) { + + case TCGETS: +- if( access_ok(VERIFY_READ, (void *)arg, sizeof(struct termios) ) ) ++ if( _access_ok(VERIFY_READ, (void *)arg, sizeof(struct termios) ) ) + { + ret = copy_to_user( (void*)arg, &channel->termios, sizeof(struct termios) ); + } else { +@@ -508,7 +514,7 @@ + } + break; + case TCSETS: +- if( access_ok(VERIFY_WRITE, (void *)arg, sizeof(struct termios) ) ) ++ if( _access_ok(VERIFY_WRITE, (void *)arg, sizeof(struct termios) ) ) + { + ret = copy_from_user( &channel->termios, (void*)arg, sizeof(struct termios) ); + } else { +@@ -533,6 +539,12 @@ + break; + case TIOCMSET: + break; ++ case TIOCSERGETLSR: ++ ret = -ENOIOCTLCMD; ++ break; ++ case TIOCGICOUNT: ++ ret = -ENOIOCTLCMD; ++ break; + default: + ret = -ENOTTY; + break; +@@ -541,6 +553,7 @@ + if( ret == -ENOTTY ) + { + printk( KERN_NOTICE EQ3LOOP_DRIVER_NAME ": eq3loop_ioctl_slave() %s: unhandled ioctl 0x%04X\n", channel->name, cmd ); ++ ret = -ENOIOCTLCMD; + } + return ret; + } +@@ -908,6 +921,7 @@ + .ioctl = eq3loop_ioctl, + #else + .unlocked_ioctl = eq3loop_ioctl, ++ .compat_ioctl = eq3loop_ioctl, + #endif + }; + +@@ -979,4 +993,4 @@ + module_exit(eq3loop_exit); + MODULE_DESCRIPTION("eQ-3 IPC loopback char driver"); + MODULE_LICENSE("GPL"); +- ++MODULE_VERSION("1.1"); diff --git a/buildroot-external/package/eq3_char_loop/Config.in b/buildroot-external/package/eq3_char_loop/Config.in new file mode 100644 index 000000000..810133231 --- /dev/null +++ b/buildroot-external/package/eq3_char_loop/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_EQ3_CHAR_LOOP + bool "Support for eq3 char loop kernel module" diff --git a/buildroot-external/package/eq3_char_loop/eq3_char_loop.mk b/buildroot-external/package/eq3_char_loop/eq3_char_loop.mk new file mode 100644 index 000000000..9aca0095e --- /dev/null +++ b/buildroot-external/package/eq3_char_loop/eq3_char_loop.mk @@ -0,0 +1,18 @@ +############################################################# +# +# eQ-3 char loopback kernel module for HomeMatic/homematicIP +# dual stack implementations for the RPI-RF-MOD/HM-MOD-RPI-PCB +# +# Copyright (c) 2015 by eQ-3 Entwicklung GmbH +# https://github.com/eq-3/occu/tree/master/KernelDrivers +# +############################################################# + +EQ3_CHAR_LOOP_VERSION = 8cb51174c2bc8c4b33df50a96b82c90e8092f79c +EQ3_CHAR_LOOP_SITE = $(call github,eq-3,occu,$(EQ3_CHAR_LOOP_VERSION)) +EQ3_CHAR_LOOP_LICENSE = GPL2 +#EQ3_CHAR_LOOP_LICENSE_FILES = LICENSE +EQ3_CHAR_LOOP_MODULE_SUBDIRS = KernelDrivers + +$(eval $(kernel-module)) +$(eval $(generic-package)) diff --git a/buildroot-external/package/generic_raw_uart/0001-kernel-Makefile.patch b/buildroot-external/package/generic_raw_uart/0001-kernel-Makefile.patch new file mode 100644 index 000000000..adab383b5 --- /dev/null +++ b/buildroot-external/package/generic_raw_uart/0001-kernel-Makefile.patch @@ -0,0 +1,39 @@ +--- ./kernel/Makefile.orig 2020-12-14 13:09:44.406823210 +0100 ++++ ./kernel/Makefile 2021-01-14 11:37:37.524474444 +0100 +@@ -1,17 +1,26 @@ +-obj-m += eq3_char_loop.o +-obj-m += plat_eq3ccu2.o ++#obj-m += eq3_char_loop.o ++#obj-m += plat_eq3ccu2.o + obj-m += generic_raw_uart.o ++ifeq ($(CONFIG_ARCH_BCM2835),y) + obj-m += pl011_raw_uart.o ++endif ++ifeq ($(CONFIG_ARCH_ROCKCHIP),y) + obj-m += dw_apb_raw_uart.o ++endif ++ifeq ($(CONFIG_ARCH_MESON64_ODROIDC2),y) + obj-m += meson_raw_uart.o +-obj-m += fake_hmrf.o ++endif ++#obj-m += fake_hmrf.o + obj-m += rpi_rf_mod_led.o + obj-m += dummy_rx8130.o +-obj-m += led_trigger_timer.o ++#obj-m += led_trigger_timer.o + obj-m += hb_rf_usb.o + obj-m += hb_rf_usb-2.o + obj-m += hb_rf_eth.o +-obj-m += rtc-rx8130.o ++#obj-m += rtc-rx8130.o ++ ++# disable ++ifeq (0,1) + + ifeq ($(KERNELRELEASE),) + KERNELRELEASE := $(shell uname -r) +@@ -32,3 +41,4 @@ + clean: + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean + ++endif diff --git a/buildroot-external/package/generic_raw_uart/Config.in b/buildroot-external/package/generic_raw_uart/Config.in new file mode 100644 index 000000000..81f38f641 --- /dev/null +++ b/buildroot-external/package/generic_raw_uart/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_GENERIC_RAW_UART + bool "Support for Generic RAW UART kernel module" + help + Adds support for generic-raw-uart kernel module + + Alexander Reinert + https://github.com/alexreinert/piVCCU/tree/master/kernel diff --git a/buildroot-external/package/generic_raw_uart/generic_raw_uart.mk b/buildroot-external/package/generic_raw_uart/generic_raw_uart.mk new file mode 100644 index 000000000..863d45866 --- /dev/null +++ b/buildroot-external/package/generic_raw_uart/generic_raw_uart.mk @@ -0,0 +1,23 @@ +############################################################# +# +# Generic raw uart kernel module for low-latency uart +# communication with a RPI-RF-MOD/HM-MOD-RPI-PCB +# +# Copyright (c) 2021 Alexander Reinert +# https://github.com/alexreinert/piVCCU/tree/master/kernel +# +# Uses parts of bcm2835_raw_uart.c +# Copyright (c) 2015 eQ-3 Entwicklung GmbH +# https://github.com/eq-3/occu/tree/master/KernelDrivers +# https://github.com/jens-maus/RaspberryMatic/tree/master/buildroot-external/package/bcm2835_raw_uart +# +############################################################# + +GENERIC_RAW_UART_VERSION = dab76ddd1d568cc4925dc778e43d70fccffdc0e8 +GENERIC_RAW_UART_SITE = $(call github,alexreinert,piVCCU,$(GENERIC_RAW_UART_VERSION)) +GENERIC_RAW_UART_LICENSE = GPL2 +#GENERIC_RAW_UART_LICENSE_FILES = LICENSE +GENERIC_RAW_UART_MODULE_SUBDIRS = kernel + +$(eval $(kernel-module)) +$(eval $(generic-package)) diff --git a/buildroot-external/package/rpi-rf-mod/Config.in b/buildroot-external/package/rpi-rf-mod/Config.in new file mode 100644 index 000000000..c6b4fba9b --- /dev/null +++ b/buildroot-external/package/rpi-rf-mod/Config.in @@ -0,0 +1,31 @@ +config BR2_PACKAGE_RPI_RF_MOD + select BR2_PACKAGE_EQ3_CHAR_LOOP + select BR2_PACKAGE_GENERIC_RAW_UART + bool "Support for RPI-RF-MOD/HM-MOD-RPI-PCB GPIO HAT" + +if BR2_PACKAGE_RPI_RF_MOD + +config BR2_PACKAGE_RPI_RF_MOD_DTS + bool "Compile Device Tree Overlay" + +if BR2_PACKAGE_RPI_RF_MOD_DTS + +choice + prompt "For Target" + default BR2_PACKAGE_RPI_RF_MOD_DTS_RPI + +config BR2_PACKAGE_RPI_RF_MOD_DTS_RPI + bool "RaspberryPi" + help + For the RaspberryPi + +config BR2_PACKAGE_RPI_RF_MOD_DTS_TINKER + bool "ASUS Tinkerboard" + help + For the ASUS Tinkerboard + +endchoice + +endif + +endif diff --git a/buildroot-external/package/rpi-rf-mod/rpi-rf-mod.mk b/buildroot-external/package/rpi-rf-mod/rpi-rf-mod.mk new file mode 100644 index 000000000..e37fcd822 --- /dev/null +++ b/buildroot-external/package/rpi-rf-mod/rpi-rf-mod.mk @@ -0,0 +1,40 @@ +############################################################# +# +# Meta package for RPI-RF-MOD/HM-MOD-RPI-PCB device support +# for HomeMatic/homematicIP connectivity. +# +# This includes compiling of required device tree overlays for +# selected platforms +# +# Copyright (c) 2018-2021 Jens Maus +# https://github.com/jens-maus/RaspberryMatic/tree/master/buildroot-external/package/rpi-rf-mod +# +############################################################# + +RPI_RF_MOD_VERSION = 97bd31203445d14e3d97e1d6e7a0bcf93b400c2e +RPI_RF_MOD_SITE = $(call github,jens-maus,RaspberryMatic,$(RPI_RF_MOD_VERSION)) +RPI_RF_MOD_LICENSE = Apache-2.0 +RPI_RF_MOD_DEPENDENCIES = host-dtc +#RPI_RF_MOD_LICENSE_FILES = LICENSE + +ifeq ($(BR2_PACKAGE_RPI_RF_MOD_DTS_RPI),y) + # RaspberryPi DTS file + RPI_RF_MOD_DTS_FILE = rpi-rf-mod +else ifeq ($(BR2_PACKAGE_RPI_RF_MOD_DTS_TINKER),y) + # ASUS Tinkerboard DTS file + RPI_RF_MOD_DTS_FILE = rpi-rf-mod-tinker +endif + +define RPI_RF_MOD_BUILD_CMDS + if [[ -n "$(RPI_RF_MOD_DTS_FILE)" ]]; then \ + $(HOST_DIR)/bin/dtc -@ -I dts -O dtb -W no-unit_address_vs_reg -o $(@D)/buildroot-external/package/rpi-rf-mod/dts/rpi-rf-mod.dtbo $(@D)/buildroot-external/package/rpi-rf-mod/dts/$(RPI_RF_MOD_DTS_FILE).dts; \ + fi +endef + +define RPI_RF_MOD_INSTALL_TARGET_CMDS + if [[ -n "$(RPI_RF_MOD_DTS_FILE)" ]]; then \ + $(INSTALL) -D -m 0644 $(@D)/buildroot-external/package/rpi-rf-mod/dts/rpi-rf-mod.dtbo $(BINARIES_DIR)/; \ + fi +endef + +$(eval $(generic-package))