From 00a4815fc63eb64e70d2c51ab7e28c12588fc3b7 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Wed, 16 Jan 2019 01:08:34 +0000 Subject: [PATCH] [rpi] Reorganize spigen(4) overlays for Raspberry Pi - Remove CS=2 entry from spigen-rpi2 since it didn't work - Add spigen-rpi3 overlay for Raspberry Pi 3 - Enable rpi overlay modules for GENERIC kernel on aarch64 PR: 233489 Submitted by: bobf@mrp3.com Reviewed by: db MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16088 --- sys/arm64/conf/GENERIC | 2 +- sys/dts/arm/overlays/spigen-rpi2.dtso | 13 ++--------- sys/dts/arm64/overlays/spigen-rpi3.dtso | 30 +++++++++++++++++++++++++ sys/modules/dtb/rpi/Makefile | 7 +++++- 4 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 sys/dts/arm64/overlays/spigen-rpi3.dtso diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 091414f52dc2..b1149a377ba3 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -296,4 +296,4 @@ options FDT device acpi # DTBs -makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi" diff --git a/sys/dts/arm/overlays/spigen-rpi2.dtso b/sys/dts/arm/overlays/spigen-rpi2.dtso index 4b0e9fa0d856..6d3862d1406b 100644 --- a/sys/dts/arm/overlays/spigen-rpi2.dtso +++ b/sys/dts/arm/overlays/spigen-rpi2.dtso @@ -12,6 +12,7 @@ spigen0: spigen0 { compatible = "freebsd,spigen"; reg = <0>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; spigen1: spigen1 { @@ -20,20 +21,10 @@ spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; - spigen2: spigen2 { - compatible = "freebsd,spigen"; - reg = <2>; - spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ - status = "okay"; - }; }; &{/soc/gpio@7e200000/spi0_cs_pins} { - brcm,pins = <8 7 16>; + brcm,pins = <8 7>; brcm,function = <4>; /* ALT0 */ }; -&{/soc/gpio@7e200000/spi0_gpio7} { - brcm,pins = <7 8 16 9 10 11>; -}; - diff --git a/sys/dts/arm64/overlays/spigen-rpi3.dtso b/sys/dts/arm64/overlays/spigen-rpi3.dtso new file mode 100644 index 000000000000..a708699c73d5 --- /dev/null +++ b/sys/dts/arm64/overlays/spigen-rpi3.dtso @@ -0,0 +1,30 @@ +/* $FreeBSD$ */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2837"; +}; + +&{/soc/spi@7e204000} { + status = "okay"; + spigen0: spigen0 { + compatible = "freebsd,spigen"; + reg = <0>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ + status = "okay"; + }; + spigen1: spigen1 { + compatible = "freebsd,spigen"; + reg = <1>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ + status = "okay"; + }; +}; + +&{/soc/gpio@7e200000/spi0_cs_pins} { + brcm,pins = <8 7>; + brcm,function = <4>; /* ALT0 */ +}; + diff --git a/sys/modules/dtb/rpi/Makefile b/sys/modules/dtb/rpi/Makefile index 3205e7ae4640..692528047078 100644 --- a/sys/modules/dtb/rpi/Makefile +++ b/sys/modules/dtb/rpi/Makefile @@ -1,7 +1,12 @@ # $FreeBSD$ # DTS files for the Raspberry Pi-B +.if ${MACHINE_ARCH:Marmv[67]*} != "" DTSO= \ spigen-rpi-b.dtso \ - spigen-rpi2.dtso \ + spigen-rpi2.dtso +.elif ${MACHINE_ARCH} == "aarch64" +DTSO= \ + spigen-rpi3.dtso +.endif .include