Merge pull request #3585 from HiassofT/le10-slice-dtoverlays

Slice, Slice3: fix device tree overlay building on kernel 5.1
This commit is contained in:
CvH 2019-06-21 12:36:12 +02:00 committed by GitHub
commit 8d100fe44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 13 additions and 363 deletions

View File

@ -2,8 +2,8 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="slice-drivers"
PKG_VERSION="8a2bdcd5dc182de899f19b0935d8beeb7f5fdbcb"
PKG_SHA256="ffb3b9ef5a0e6101d661407447257abf136f1ae206a17bd18d9b204e0b29f050"
PKG_VERSION="cff35bf3819edd3379140ccbbe667cbfd3535e93"
PKG_SHA256="7d159cc52c7ee086468799ec7b2941ba7a39fe5fc372faa59c38a141b8b0ae01"
PKG_ARCH="arm"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/LibreELEC/slice-drivers"
@ -18,10 +18,17 @@ pre_make_target() {
}
make_target() {
kernel_make KDIR=$(kernel_path)
local kdir=$(kernel_path)
local dtc=${kdir}/scripts/dtc/dtc
local dtcflags="-@ -O dtb -Wno-unit_address_vs_reg"
kernel_make KDIR=${kdir}
${dtc} ${dtcflags} -o slice.dtbo slice-overlay.dts
${dtc} ${dtcflags} -o ws2812.dtbo ws2812-overlay.dts
}
makeinstall_target() {
mkdir -p $INSTALL/$(get_full_module_dir)/$PKG_NAME
cp *.ko $INSTALL/$(get_full_module_dir)/$PKG_NAME
mkdir -p $INSTALL/usr/share/bootloader/overlays
cp *.dtbo $INSTALL/usr/share/bootloader/overlays
}

View File

@ -89,16 +89,6 @@ post_patch() {
sed -i -e "s|^CONFIG_ISCSI_IBFT_FIND=.*$|# CONFIG_ISCSI_IBFT_FIND is not set|" $PKG_BUILD/.config
sed -i -e "s|^CONFIG_ISCSI_IBFT=.*$|# CONFIG_ISCSI_IBFT is not set|" $PKG_BUILD/.config
fi
# install extra dts files
for f in $PROJECT_DIR/$PROJECT/config/*-overlay.dts; do
[ -f "$f" ] && cp -v $f $PKG_BUILD/arch/$TARGET_KERNEL_ARCH/boot/dts/overlays || true
done
if [ -n "$DEVICE" ]; then
for f in $PROJECT_DIR/$PROJECT/devices/$DEVICE/config/*-overlay.dts; do
[ -f "$f" ] && cp -v $f $PKG_BUILD/arch/$TARGET_KERNEL_ARCH/boot/dts/overlays || true
done
fi
}
make_host() {

View File

@ -7,3 +7,6 @@
# NOOBS supported model versions
NOOBS_SUPPORTED_MODELS='"Pi 2","Pi 3"'
# TESTING, do not commit!
ADDITIONAL_DRIVERS="${ADDITIONAL_DRIVERS} slice-drivers"

View File

@ -1,112 +0,0 @@
// Definitions for Slice hardware
/dts-v1/;
/plugin/;
#include "dt-bindings/clock/bcm2835.h"
#include "dt-bindings/pinctrl/bcm2835.h"
/ {
compatible = "brcm,bcm2708";
// disable analog audio
fragment@0 {
target = <&audio>;
__overlay__ {
status = "disabled";
};
};
// pinctrl definitions
fragment@1 {
target = <&gpio>;
__overlay__ {
// configure I2S to GPIO 28-31
slice_i2s_pins: slice_i2s_pins {
brcm,pins = <28 29 30 31>;
brcm,function = <BCM2835_FSEL_ALT2>;
};
slice_ir_pins: slice_ir_pins {
brcm,pins = <37>;
brcm,function = <BCM2835_FSEL_GPIO_IN>;
brcm,pull = <BCM2835_PUD_DOWN>;
};
cs4265_reset_pins: cs4265_reset_pins {
brcm,pins = <33>;
brcm,function = <BCM2835_FSEL_GPIO_OUT>;
};
};
};
// IR receiver
fragment@2 {
target-path = "/";
__overlay__ {
gpio_ir: ir-receiver {
compatible = "gpio-ir-receiver";
pinctrl-names = "default";
pinctrl-0 = <&slice_ir_pins>;
gpios = <&gpio 37 1>;
linux,rc-map-name = "rc-rc6-mce";
status = "okay";
};
};
};
// enable I2S
fragment@3 {
target = <&i2s>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&slice_i2s_pins>;
status = "okay";
};
};
// I2C
fragment@4 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c1_gpio44>; // use GPIO 44/45 for I2C1
clock-frequency = <100000>;
pcf8523@68 {
compatible = "nxp,pcf8523";
reg = <0x68>;
nxp,xtalcap-7pf; // set crystal load to 7pf
status = "okay";
};
cs4265@4e {
#sound-dai-cells = <0>;
compatible = "cirrus,cs4265";
reg = <0x4e>;
pinctrl-names = "default";
pinctrl-0 = <&cs4265_reset_pins>;
cs4265-reset-gpios = <&gpio 33 0>; /* AUD_RST_N on GPIO33 */
cirrus,no-s16le; // remove S16LE support to workaround I2S controller issue
status = "okay";
};
};
};
// Audio driver
fragment@5 {
target = <&sound>;
__overlay__ {
compatible = "fiveninjas,slice";
clocks = <&clocks BCM2835_CLOCK_GP0>;
clock-names = "gp0";
i2s-controller = <&i2s>;
status = "okay";
};
};
};

View File

@ -1,43 +0,0 @@
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
// disable pwm
fragment@0 {
target = <&pwm>;
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&soc>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
ws2812: ws2812 {
compatible = "rpi,ws2812";
pinctrl-names = "default";
pinctrl-0 = <&pwm0_gpio40>;
reg = <0x7e20c000 0x100>; /* PWM */
dmas = <&dma 5>;
dma-names = "pwm_dma";
led-en-gpios = <&gpio 43 0>;
rpi,invert = <1>;
rpi,num_leds = <25>;
status = "okay";
};
};
};
__overrides__ {
invert = <&ws2812>,"rpi,invert:0";
num_leds = <&ws2812>,"rpi,num_leds:0";
};
};

View File

@ -2,9 +2,6 @@
# Device defaults
################################################################################
# Additional kernel make parameters
KERNEL_MAKE_EXTRACMD+=" overlays/slice.dtbo overlays/ws2812.dtbo"
# NOOBS supported hex versions (legacy)
NOOBS_HEX="2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,19,0092,0093"

View File

@ -1,17 +0,0 @@
--- a/drivers/rtc/rtc-pcf8523.c 2016-10-01 10:16:30.259771931 +0100
+++ b/drivers/rtc/rtc-pcf8523.c 2016-10-01 10:21:29.762638800 +0100
@@ -291,7 +291,13 @@ static int pcf8523_probe(struct i2c_clie
if (!pcf)
return -ENOMEM;
- err = pcf8523_select_capacitance(client, true);
+ if (of_property_read_bool(client->dev.of_node, "nxp,xtalcap-7pf")) {
+ printk(KERN_ERR "PCF8523 - set 7pF crystal load");
+ err = pcf8523_select_capacitance(client, false);
+ } else {
+ printk(KERN_ERR "PCF8523 - set 12pF crystal load");
+ err = pcf8523_select_capacitance(client, true);
+ }
if (err < 0)
return err;

View File

@ -1,112 +0,0 @@
// Definitions for Slice hardware
/dts-v1/;
/plugin/;
#include "dt-bindings/clock/bcm2835.h"
#include "dt-bindings/pinctrl/bcm2835.h"
/ {
compatible = "brcm,bcm2708";
// disable analog audio
fragment@0 {
target = <&audio>;
__overlay__ {
status = "disabled";
};
};
// pinctrl definitions
fragment@1 {
target = <&gpio>;
__overlay__ {
// configure I2S to GPIO 28-31
slice_i2s_pins: slice_i2s_pins {
brcm,pins = <28 29 30 31>;
brcm,function = <BCM2835_FSEL_ALT2>;
};
slice_ir_pins: slice_ir_pins {
brcm,pins = <37>;
brcm,function = <BCM2835_FSEL_GPIO_IN>;
brcm,pull = <BCM2835_PUD_DOWN>;
};
cs4265_reset_pins: cs4265_reset_pins {
brcm,pins = <33>;
brcm,function = <BCM2835_FSEL_GPIO_OUT>;
};
};
};
// IR receiver
fragment@2 {
target-path = "/";
__overlay__ {
gpio_ir: ir-receiver {
compatible = "gpio-ir-receiver";
pinctrl-names = "default";
pinctrl-0 = <&slice_ir_pins>;
gpios = <&gpio 37 1>;
linux,rc-map-name = "rc-rc6-mce";
status = "okay";
};
};
};
// enable I2S
fragment@3 {
target = <&i2s>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&slice_i2s_pins>;
status = "okay";
};
};
// I2C
fragment@4 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c1_gpio44>; // use GPIO 44/45 for I2C1
clock-frequency = <100000>;
pcf8523@68 {
compatible = "nxp,pcf8523";
reg = <0x68>;
nxp,xtalcap-7pf; // set crystal load to 7pf
status = "okay";
};
cs4265@4e {
#sound-dai-cells = <0>;
compatible = "cirrus,cs4265";
reg = <0x4e>;
pinctrl-names = "default";
pinctrl-0 = <&cs4265_reset_pins>;
cs4265-reset-gpios = <&gpio 33 0>; /* AUD_RST_N on GPIO33 */
cirrus,no-s16le; // remove S16LE support to workaround I2S controller issue
status = "okay";
};
};
};
// Audio driver
fragment@5 {
target = <&sound>;
__overlay__ {
compatible = "fiveninjas,slice";
clocks = <&clocks BCM2835_CLOCK_GP0>;
clock-names = "gp0";
i2s-controller = <&i2s>;
status = "okay";
};
};
};

View File

@ -1,43 +0,0 @@
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
// disable pwm
fragment@0 {
target = <&pwm>;
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&soc>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
ws2812: ws2812 {
compatible = "rpi,ws2812";
pinctrl-names = "default";
pinctrl-0 = <&pwm0_gpio40>;
reg = <0x7e20c000 0x100>; /* PWM */
dmas = <&dma 5>;
dma-names = "pwm_dma";
led-en-gpios = <&gpio 43 0>;
rpi,invert = <1>;
rpi,num_leds = <25>;
status = "okay";
};
};
};
__overrides__ {
invert = <&ws2812>,"rpi,invert:0";
num_leds = <&ws2812>,"rpi,num_leds:0";
};
};

View File

@ -2,9 +2,6 @@
# Device defaults
################################################################################
# Additional kernel make parameters
KERNEL_MAKE_EXTRACMD+=" overlays/slice.dtbo overlays/ws2812.dtbo"
# NOOBS supported hex versions (legacy)
NOOBS_HEX="1040,1041,2082"

View File

@ -1,17 +0,0 @@
--- a/drivers/rtc/rtc-pcf8523.c 2016-10-01 10:16:30.259771931 +0100
+++ b/drivers/rtc/rtc-pcf8523.c 2016-10-01 10:21:29.762638800 +0100
@@ -291,7 +291,13 @@ static int pcf8523_probe(struct i2c_clie
if (!pcf)
return -ENOMEM;
- err = pcf8523_select_capacitance(client, true);
+ if (of_property_read_bool(client->dev.of_node, "nxp,xtalcap-7pf")) {
+ printk(KERN_ERR "PCF8523 - set 7pF crystal load");
+ err = pcf8523_select_capacitance(client, false);
+ } else {
+ printk(KERN_ERR "PCF8523 - set 12pF crystal load");
+ err = pcf8523_select_capacitance(client, true);
+ }
if (err < 0)
return err;