modules/unipi/.tmp_versions
modules/unipi/unipi.mod.c
modules/unipi/modules.order
+debian/neuron-kernel.changelog
\ No newline at end of file
--- /dev/null
+unipi-kernel-modules (1.22.1.20190517-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20190517-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 19 Jun 2019 12:58:45 +0200
+
+unipi-kernel-modules (1.22.1.20190401-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20190401-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 29 Apr 2019 10:25:58 +0200
+
+unipi-kernel-modules (1.22.1.20190215-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20190215-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:54:40 +0100
+
+unipi-kernel-modules (1.22) UNRELEASED; urgency=medium
+
+ * fix float to int convertor in unipi_iio
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:45:22 +0100
+
+unipi-kernel-modules (1.21.1.20190215-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20190215-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:42:04 +0100
+
+unipi-kernel-modules (1.21) UNRELEASED; urgency=medium
+
+ * rework spi to use async calling and RT kthread
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 21 Feb 2019 14:47:46 +0100
+
+unipi-kernel-modules (1.19.1.20181112-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20181112-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 17 Jan 2019 11:18:36 +0100
+
+unipi-kernel-modules (1.19) unstable; urgency=medium
+
+ * fixed frequency detection
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 17 Jan 2019 11:17:54 +0100
+
+unipi-kernel-modules (1.18.1.20181112-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20181112-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 28 Nov 2018 09:11:02 +0100
+
+unipi-kernel-modules (1.18.1.20180924-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20180924-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 08 Nov 2018 09:16:26 +0100
+
+unipi-kernel-modules (1.18) unstable; urgency=medium
+
+ * disabled long spi tranfer
+ * added missing dummy method for reading secondary analog output
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 16 Oct 2018 15:08:40 +0200
+
+unipi-kernel-modules (1.17.1.20180924-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20180924-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Tue, 16 Oct 2018 19:46:01 +0200
+
+unipi-kernel-modules (1.17.1.20180919-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20180919-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 24 Sep 2018 19:47:34 +0200
+
+unipi-kernel-modules (1.17) UNRELEASED; urgency=medium
+
+ * add dependncy on raspberrypi-kernel-headers
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 13:20:35 +0200
+
+unipi-kernel-modules (1.16.1.20180919-1) unstable; urgency=medium
+
+ * Compiled for raspberrypi-kernel 1.20180919-1
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 12:06:43 +0200
+
+unipi-kernel-modules (1.16) unstable; urgency=medium
+
+ * changed from binary to dkms version
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 01:03:41 +0200
+
+neuron-kernel (1.15.20180914) unstable; urgency=medium
+
+ * Compiled for kernel 4.14.69-v7+ (=1.20180910-1)
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 14 Sep 2018 16:35:36 +0200
+
+neuron-kernel (1.15.20180907) unstable; urgency=medium
+
+ * Compiled for kernel 4.14.62-v7+ (=1.20180817-1)
+ * fixed spi buffer alignement
+ * redesigned uart rx/tx proc
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 14 Sep 2018 00:47:53 +0200
+
+neuron-kernel (1.14.20180803) unstable; urgency=medium
+
+ * fixed trace_printk for debugging
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 03 Aug 2018 12:42:40 +0200
+
+neuron-kernel (1.14.20180802) unstable; urgency=medium
+
+ * redesigned line discipline
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 02 Aug 2018 21:37:29 +0200
+
+neuron-kernel (1.13.20180719) unstable; urgency=medium
+
+ * Compiled for kernel 4.14.52-v7+ (=1.20180703-1)
+ * changed char dev name to /dev/unipispi
+
+ -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 02 Aug 2018 21:36:09 +0200
+
+neuron-kernel (1.12.14062018-0) unstable; urgency=medium
+
+ * Compiled for new distribution kernel 4.14.52-v7+ (=1.20180703-1)
+
+ -- Miroslav Ondra <info@unipi.technology> Wed, 16 Jul 2018 10:00:19 +0200
+
+neuron-kernel (1.11.06062018-0) unstable; urgency=medium
+
+ * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology> Wed, 06 Jun 2018 20:16:19 +0200
+
+neuron-kernel (0.03082018-3) unstable; urgency=medium
+
+ * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
+
+ -- Miroslav Ondra <info@unipi.technology> Wed, 18 Apr 2018 21:49:19 +0200
+
+neuron-kernel (0.03082018-2) unstable; urgency=medium
+
+ * Compiled for new distribution kernel (=1.20180328-1)
+
+ -- Miroslav Ondra <info@unipi.technology> Wed, 17 Apr 2018 10:14:19 +0200
+
+neuron-kernel (0.03082018) unstable; urgency=medium
+
+ * Initial Release.
+
+ -- Miroslav Ondra <info@unipi.technology> Wed, 11 Apr 2018 10:14:19 +0200
+++ /dev/null
-unipi-kernel-modules (1.22.1.20190517-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20190517-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 19 Jun 2019 12:58:45 +0200
-
-unipi-kernel-modules (1.22.1.20190401-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20190401-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 29 Apr 2019 10:25:58 +0200
-
-unipi-kernel-modules (1.22.1.20190215-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20190215-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:54:40 +0100
-
-unipi-kernel-modules (1.22) UNRELEASED; urgency=medium
-
- * fix float to int convertor in unipi_iio
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:45:22 +0100
-
-unipi-kernel-modules (1.21.1.20190215-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20190215-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 27 Mar 2019 16:42:04 +0100
-
-unipi-kernel-modules (1.21) UNRELEASED; urgency=medium
-
- * rework spi to use async calling and RT kthread
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 21 Feb 2019 14:47:46 +0100
-
-unipi-kernel-modules (1.19.1.20181112-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20181112-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 17 Jan 2019 11:18:36 +0100
-
-unipi-kernel-modules (1.19) unstable; urgency=medium
-
- * fixed frequency detection
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 17 Jan 2019 11:17:54 +0100
-
-unipi-kernel-modules (1.18.1.20181112-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20181112-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Wed, 28 Nov 2018 09:11:02 +0100
-
-unipi-kernel-modules (1.18.1.20180924-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20180924-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 08 Nov 2018 09:16:26 +0100
-
-unipi-kernel-modules (1.18) unstable; urgency=medium
-
- * disabled long spi tranfer
- * added missing dummy method for reading secondary analog output
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 16 Oct 2018 15:08:40 +0200
-
-unipi-kernel-modules (1.17.1.20180924-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20180924-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Tue, 16 Oct 2018 19:46:01 +0200
-
-unipi-kernel-modules (1.17.1.20180919-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20180919-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Mon, 24 Sep 2018 19:47:34 +0200
-
-unipi-kernel-modules (1.17) UNRELEASED; urgency=medium
-
- * add dependncy on raspberrypi-kernel-headers
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 13:20:35 +0200
-
-unipi-kernel-modules (1.16.1.20180919-1) unstable; urgency=medium
-
- * Compiled for raspberrypi-kernel 1.20180919-1
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 12:06:43 +0200
-
-unipi-kernel-modules (1.16) unstable; urgency=medium
-
- * changed from binary to dkms version
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 21 Sep 2018 01:03:41 +0200
-
-neuron-kernel (1.15.20180914) unstable; urgency=medium
-
- * Compiled for kernel 4.14.69-v7+ (=1.20180910-1)
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 14 Sep 2018 16:35:36 +0200
-
-neuron-kernel (1.15.20180907) unstable; urgency=medium
-
- * Compiled for kernel 4.14.62-v7+ (=1.20180817-1)
- * fixed spi buffer alignement
- * redesigned uart rx/tx proc
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 14 Sep 2018 00:47:53 +0200
-
-neuron-kernel (1.14.20180803) unstable; urgency=medium
-
- * fixed trace_printk for debugging
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Fri, 03 Aug 2018 12:42:40 +0200
-
-neuron-kernel (1.14.20180802) unstable; urgency=medium
-
- * redesigned line discipline
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 02 Aug 2018 21:37:29 +0200
-
-neuron-kernel (1.13.20180719) unstable; urgency=medium
-
- * Compiled for kernel 4.14.52-v7+ (=1.20180703-1)
- * changed char dev name to /dev/unipispi
-
- -- Miroslav Ondra <bokula@bokula.faster.cz> Thu, 02 Aug 2018 21:36:09 +0200
-
-neuron-kernel (1.12.14062018-0) unstable; urgency=medium
-
- * Compiled for new distribution kernel 4.14.52-v7+ (=1.20180703-1)
-
- -- Miroslav Ondra <info@unipi.technology> Wed, 16 Jul 2018 10:00:19 +0200
-
-neuron-kernel (1.11.06062018-0) unstable; urgency=medium
-
- * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
-
- -- Miroslav Ondra <info@unipi.technology> Wed, 06 Jun 2018 20:16:19 +0200
-
-neuron-kernel (0.03082018-3) unstable; urgency=medium
-
- * Compiled for new distribution kernel 4.14.34-v7+ (=1.20180417-1)
-
- -- Miroslav Ondra <info@unipi.technology> Wed, 18 Apr 2018 21:49:19 +0200
-
-neuron-kernel (0.03082018-2) unstable; urgency=medium
-
- * Compiled for new distribution kernel (=1.20180328-1)
-
- -- Miroslav Ondra <info@unipi.technology> Wed, 17 Apr 2018 10:14:19 +0200
-
-neuron-kernel (0.03082018) unstable; urgency=medium
-
- * Initial Release.
-
- -- Miroslav Ondra <info@unipi.technology> Wed, 11 Apr 2018 10:14:19 +0200
MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
+ifeq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
+
+RPI_FIRMWARE_VER = $(shell dpkg-query -f='$${Version}' -W raspberrypi-kernel-headers)
+LINUX_DIR_PATH = $(shell dpkg -L raspberrypi-kernel-headers | sed -n '/^\/lib\/modules\/.*-v7.*\/build$$/p')
+KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
+
+else
+
.raspbian-versions:
misc/check-raspbian
include ./.raspbian-versions
+LINUX_DIR_PATH = ${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-DISTRIB=$(shell dpkg-parsechangelog -l debian/neuron-kernel.changelog -S Distribution)
-NEURON_KERNEL_VERSION=$(shell dpkg-parsechangelog -l debian/neuron-kernel.changelog -S Version)
+endif
%:
dh $@ --with dkms
-# dh_make generated override targets
-# This is example for Cmake (See https://bugs.debian.org/641051 )
-#override_dh_auto_configure:
-# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
override_dh_installmodules:
DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
override_dh_prep:
- dh_prep --exclude=neuron-kernel.substvars
- echo RPI-FIRMWARE-VER=${RPI_FIRMWARE_VER} >> debian/neuron-kernel.substvars
- sed "s/#MOD_VERSION#/$(MOD_VERSION)/g" debian/unipi-kernel-modules-dkms.install.in > debian/unipi-kernel-modules-dkms.install
- @if echo ${NEURON_KERNEL_VERSION} | grep -qve "^$(MOD_VERSION)"; then\
- ( sed '/^ -- /q;' debian/changelog; echo ""; cat debian/neuron-kernel.changelog )>debian/_cl;\
- mv debian/_cl debian/neuron-kernel.changelog;\
- fi
- @if [ ${NEURON_KERNEL_VERSION} != $(MOD_VERSION).$(RPI_FIRMWARE_VER) ]; then\
- dch -mv $(MOD_VERSION).$(RPI_FIRMWARE_VER) --release-heuristic=log \
- -c debian/neuron-kernel.changelog "Compiled for raspberrypi-kernel ${RPI_FIRMWARE_VER}"; \
- fi;
- @if [ ${DISTRIB} != "UNRELEASED" ]; then dch -rm -c debian/neuron-kernel.changelog ""; fi
+ @dh_prep --exclude=neuron-kernel.substvars
+ @echo RPI-FIRMWARE-VER=${RPI_FIRMWARE_VER} >> debian/neuron-kernel.substvars
+ @sed "s/#MOD_VERSION#/$(MOD_VERSION)/g" debian/unipi-kernel-modules-dkms.install.in > debian/unipi-kernel-modules-dkms.install
+ ( sed 's/)/-${RPI_FIRMWARE_VER})/;q' debian/changelog; \
+ printf "\n * Compiled for raspberrypi-kernel\n";\
+ printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
+ cat debian/changelog;\
+ ) >debian/neuron-kernel.changelog
override_dh_dkms:
dh_dkms -V $(MOD_VERSION)
#override_dh_build:
+ifneq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
override_dh_auto_configure:
misc/check-raspbian
misc/current
+endif
override_dh_auto_build:
dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER} ARCH=${DEB_TARGET_ARCH_CPU}
+ LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU}
override_dh_auto_install:
dh_auto_install --destdir=debian/neuron-kernel -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER} ARCH=${DEB_TARGET_ARCH_CPU}
+ LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU}
#override_dh_gencontrol:
+###
+### devicetree overlay for unipispi board on Raspberry Pi
+###
-CC = dtc -O dtb -@
+LINUX_DIR_PATH = /lib/modules/$(shell uname -r)/build
+ifdef CCPREFIX
+ CCPAR = CROSS_COMPILE=${CCPREFIX}
+endif
+ifdef ARCH
+ CCPAR += ARCH=${ARCH}
+endif
-.PHONY = clean
-.PHONY += all
+PWD := $(shell pwd)
-%.dtbo: %.dts
- $(CC) -o $@ $<
+dtbo-y += neuron-spi-new.dtbo
-install: clean neuron-spi-new.dtbo
- $(shell mount -o remount,rw /boot) \
- $(shell cp neuron-spi-new.dtbo /boot/overlays)
+targets += $(dtbo-y)
+always := $(dtbo-y)
+
+
+all:
+ make $(CCPAR) -C $(LINUX_DIR_PATH) M=$(PWD)
clean:
- $(shell rm -r -f neuron-spi-new.dtbo)
+ make $(CCPAR) -C $(LINUX_DIR_PATH) M=$(PWD) clean
+
+
+#DTC = dtc -O dtb -@
+
+#%.dtbo: %.dts
+# $(DTC) -o $@ $<
+
+#install: clean neuron-spi-new.dtbo
+# $(shell mount -o remount,rw /boot) \
+# $(shell cp neuron-spi-new.dtbo /boot/overlays)
--- /dev/null
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708",
+"brcm,bcm2709";
+ fragment@0 {
+ target = <&spi0>;
+ frag0: __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+ pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
+ cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 24 1>, <&gpio 25 1>;
+ neuronspi0: neuronspi@0 {
+ compatible = "unipi,neuron";
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ spi-max-frequency = <12000000>;
+ pinctrl-0 = <&neuron_0_irq_pin>;
+ pinctrl-names = "default";
+ interrupt-parent = <&gpio>;
+ interrupts = <27 0x1>;
+ status = "okay";
+ neuron-board-index = <0>;
+ neuron-probe-always-succeeds = <0>;
+ neuron-always-create-tty = <0>;
+ };
+ neuronspi1: neuronspi@1 {
+ compatible = "unipi,neuron";
+ reg = <2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ spi-max-frequency = <1200000>;
+ pinctrl-0 = <&neuron_1_irq_pin>;
+ pinctrl-names = "default";
+ interrupt-parent = <&gpio>;
+ interrupts = <23 0x1>;
+ status = "okay";
+ neuron-board-index = <1>;
+ neuron-probe-always-succeeds = <0>;
+ neuron-always-create-tty = <0>;
+ };
+ neuronspi2: neuronspi@2 {
+ compatible = "unipi,neuron";
+ reg = <3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ spi-max-frequency = <1200000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&neuron_2_irq_pin>;
+ interrupt-parent = <&gpio>;
+ interrupts = <22 0x1>;
+ status = "okay";
+ neuron-board-index = <2>;
+ neuron-probe-always-succeeds = <0>;
+ neuron-always-create-tty = <0>;
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&spidev0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@2 {
+ target = <&spidev1>;
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@3 {
+ target = <&gpio>;
+ __overlay__ {
+ spi0_cs_pins {
+ brcm,pins = <8 7 24 25>;
+ brcm,function = <1>;
+ brcm,pull = <0>;
+ };
+ neuron_0_irq_pin: neuron_0_irq_pin {
+ brcm,pins = <27>;
+ brcm,function = <0>;
+ brcm,pull = <1>;
+ };
+ neuron_1_irq_pin: neuron_1_irq_pin {
+ brcm,pins = <23>;
+ brcm,function = <0>;
+ brcm,pull = <1>;
+ };
+ neuron_2_irq_pin: neuron_2_irq_pin {
+ brcm,pins = <22>;
+ brcm,function = <0>;
+ brcm,pull = <1>;
+ };
+ };
+ };
+
+ __overrides__ {
+ cs0_pin = <&frag0>,"cs-gpios:4", <&spi0_cs_pins>, "brcm,pins:0";
+ cs1_pin = <&frag0>,"cs-gpios:16", <&spi0_cs_pins>,"brcm,pins:4";
+ cs2_pin = <&frag0>,"cs-gpios:40", <&spi0_cs_pins>,"brcm,pins:12";
+ cs3_pin = <&frag0>,"cs-gpios:28", <&spi0_cs_pins>,"brcm,pins:8";
+ neuron_irq_0 = <&neuronspi0>,"interrupts:0", <&neuron_0_irq_pin>,"brcm,pins:0";
+ neuron_irq_1 = <&neuronspi1>,"interrupts:0", <&neuron_1_irq_pin>,"brcm,pins:0";
+ neuron_irq_2 = <&neuronspi2>,"interrupts:0", <&neuron_2_irq_pin>,"brcm,pins:0";
+ };
+};
+
+++ /dev/null
-/dts-v1/;
-/plugin/;
-
-/ {
- compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708",
-"brcm,bcm2709";
- fragment@0 {
- target = <&spi0>;
- frag0: __overlay__ {
- #address-cells = <1>;
- #size-cells = <0>;
- status = "okay";
- pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
- cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 24 1>, <&gpio 25 1>;
- neuronspi0: neuronspi@0 {
- compatible = "unipi,neuron";
- reg = <1>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <12000000>;
- pinctrl-0 = <&neuron_0_irq_pin>;
- pinctrl-names = "default";
- interrupt-parent = <&gpio>;
- interrupts = <27 0x1>;
- status = "okay";
- neuron-board-index = <0>;
- neuron-probe-always-succeeds = <0>;
- neuron-always-create-tty = <0>;
- };
- neuronspi1: neuronspi@1 {
- compatible = "unipi,neuron";
- reg = <2>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <1200000>;
- pinctrl-0 = <&neuron_1_irq_pin>;
- pinctrl-names = "default";
- interrupt-parent = <&gpio>;
- interrupts = <23 0x1>;
- status = "okay";
- neuron-board-index = <1>;
- neuron-probe-always-succeeds = <0>;
- neuron-always-create-tty = <0>;
- };
- neuronspi2: neuronspi@2 {
- compatible = "unipi,neuron";
- reg = <3>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <1200000>;
- pinctrl-names = "default";
- pinctrl-0 = <&neuron_2_irq_pin>;
- interrupt-parent = <&gpio>;
- interrupts = <22 0x1>;
- status = "okay";
- neuron-board-index = <2>;
- neuron-probe-always-succeeds = <0>;
- neuron-always-create-tty = <0>;
- };
- };
- };
-
- fragment@1 {
- target = <&spidev0>;
- __overlay__ {
- status = "okay";
- };
- };
-
- fragment@2 {
- target = <&spidev1>;
- __overlay__ {
- status = "disabled";
- };
- };
-
- fragment@3 {
- target = <&gpio>;
- __overlay__ {
- spi0_cs_pins {
- brcm,pins = <8 7 24 25>;
- brcm,function = <1>;
- brcm,pull = <0>;
- };
- neuron_0_irq_pin: neuron_0_irq_pin {
- brcm,pins = <27>;
- brcm,function = <0>;
- brcm,pull = <1>;
- };
- neuron_1_irq_pin: neuron_1_irq_pin {
- brcm,pins = <23>;
- brcm,function = <0>;
- brcm,pull = <1>;
- };
- neuron_2_irq_pin: neuron_2_irq_pin {
- brcm,pins = <22>;
- brcm,function = <0>;
- brcm,pull = <1>;
- };
- };
- };
-
- __overrides__ {
- cs0_pin = <&frag0>,"cs-gpios:4", <&spi0_cs_pins>, "brcm,pins:0";
- cs1_pin = <&frag0>,"cs-gpios:16", <&spi0_cs_pins>,"brcm,pins:4";
- cs2_pin = <&frag0>,"cs-gpios:40", <&spi0_cs_pins>,"brcm,pins:12";
- cs3_pin = <&frag0>,"cs-gpios:28", <&spi0_cs_pins>,"brcm,pins:8";
- neuron_irq_0 = <&neuronspi0>,"interrupts:0", <&neuron_0_irq_pin>,"brcm,pins:0";
- neuron_irq_1 = <&neuronspi1>,"interrupts:0", <&neuron_1_irq_pin>,"brcm,pins:0";
- neuron_irq_2 = <&neuronspi2>,"interrupts:0", <&neuron_2_irq_pin>,"brcm,pins:0";
- };
-};
-
+++ /dev/null
-/dts-v1/;
-/plugin/;
-
-/ {
- compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708",
-"brcm,bcm2709";
-
- fragment@0 {
- target = <&spi0>;
- frag0: __overlay__ {
- #address-cells = <1>;
- #size-cells = <0>;
- status = "okay";
- pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
- cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 24 1>, <&gpio 25 1>;
- neuronspi0: neuronspi@0 {
- compatible = "unipi,neuron";
- reg = <1>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <12000000>;
- status = "okay";
- };
- neuronspi1: neuronspi@1 {
- compatible = "unipi,neuron";
- reg = <2>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <1200000>;
- status = "okay";
- };
- neuronspi2: neuronspi@2 {
- compatible = "unipi,neuron";
- reg = <3>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <1200000>;
- status = "okay";
- };
- };
- };
-
- fragment@1 {
- target = <&spidev0>;
- __overlay__ {
- status = "disabled";
- };
- };
-
- fragment@2 {
- target = <&spidev1>;
- __overlay__ {
- status = "disabled";
- };
- };
-
- fragment@3 {
- target = <&gpio>;
- __overlay__ {
- spi0_cs_pins {
- brcm,pins = <8 7 24 25>;
- brcm,function = <1>;
- };
- };
-
- };
-
- __overrides__ {
- cs0_pin = <&frag0>,"cs-gpios:4", <&spi0_cs_pins>, "brcm,pins:0";
- cs1_pin = <&frag0>,"cs-gpios:16", <&spi0_cs_pins>,"brcm,pins:4";
- cs2_pin = <&frag0>,"cs-gpios:40", <&spi0_cs_pins>,"brcm,pins:12";
- cs3_pin = <&frag0>,"cs-gpios:28", <&spi0_cs_pins>,"brcm,pins:8";
- };
-
-
-};
-
# filesystems (notably VirtualBox vmfs); therefore we allow using /run/ through the 'symlink' target,
# if necessary.
+LINUX_DIR_PATH = /lib/modules/$(shell uname -r)/build
+ifdef CCPREFIX
+ CCPAR = CROSS_COMPILE=${CCPREFIX}
+endif
+ifdef ARCH
+ CCPAR += ARCH=${ARCH}
+endif
+
SYMLINK_DIR_PATH = /run/kernel/unipi_spi
-LINUX_DIR_PATH = /root/linux/4_9_14/linux/
+
SRC_DIR_PATH = $(PWD)/src
BIN_DIR_PATH = $(PWD)/bin
default: all ;
all:
- make ARCH=${ARCH} CROSS_COMPILE=${CCPREFIX} -C ${LINUX_DIR_PATH} M=${PWD} modules
+ make $(CCPAR) -C $(LINUX_DIR_PATH) M=${PWD} modules
modules_install:
- make ARCH=${ARCH} CROSS_COMPILE=${CCPREFIX} -C ${LINUX_DIR_PATH} M=${PWD} modules_install
+ make $(CCPAR) -C $(LINUX_DIR_PATH) M=${PWD} modules_install
clean:
rm -f ${unipi-objs} src/.*.o.cmd