RPi: add device Slice3

This commit is contained in:
Christian Hewitt
2017-03-14 12:06:20 -07:00
committed by Lukas Rusak
parent e63937bab1
commit b61dbfd9bc
15 changed files with 1130 additions and 1 deletions

View File

@@ -1158,6 +1158,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
#
# CONFIG_SENSORS_LIS3LV02D is not set
CONFIG_BCM2835_SMI=m
CONFIG_BCM2835_WS2812=m
# CONFIG_AD525X_DPOT is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_ICS932S401 is not set
@@ -2893,6 +2894,7 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m
CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
CONFIG_SND_BCM2708_SOC_SLICE=m
CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m
CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m
CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m
@@ -2946,7 +2948,7 @@ CONFIG_SND_SOC_ADAU7002=m
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set
# CONFIG_SND_SOC_CS42L73 is not set
# CONFIG_SND_SOC_CS4265 is not set
CONFIG_SND_SOC_CS4265=m
# CONFIG_SND_SOC_CS4270 is not set
# CONFIG_SND_SOC_CS4271_I2C is not set
# CONFIG_SND_SOC_CS4271_SPI is not set

View File

@@ -0,0 +1,23 @@
################################################################################
# This file is part of LibreELEC - http://www.libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
# WARNING: DO NOT EDIT THIS FILE - IT WILL BE OVERWRITTEN WHEN UPGRADING!
dtoverlay=slice
dtoverlay=ws2812
dtoverlay=mmc

Binary file not shown.

View File

@@ -0,0 +1,98 @@
/dts-v1/;
/ {
videocore {
pins_cm3 {
pin_config {
pin@default {
polarity = "active_high";
termination = "pull_down";
startup_state = "inactive";
function = "input";
}; // pin
// BANK 0 //
pin@p0 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p1 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p2 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p3 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p4 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p5 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p6 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p7 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p8 { function = "input"; termination = "pull_up"; }; // NOT USED (DEFAULT STATE)
pin@p9 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p10 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p11 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p12 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p13 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p14 { function = "uart0"; termination = "no_pulling"; }; // UART0_TX
pin@p15 { function = "uart0"; termination = "pull_up"; }; // UART0_RX
pin@p16 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p17 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p18 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p19 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p20 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p21 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p22 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p23 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p24 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p25 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p26 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
pin@p27 { function = "input"; termination = "pull_down"; }; // NOT USED (DEFAULT STATE)
// BANK 1 //
pin@p28 { function = "pcm"; termination = "no_pulling"; }; // PCM_CLK
pin@p29 { function = "pcm"; termination = "no_pulling"; }; // PCM_FS
pin@p30 { function = "pcm"; termination = "no_pulling"; }; // PCM_DIN
pin@p31 { function = "pcm"; termination = "no_pulling"; }; // PCM_DOUT
pin@p32 { function = "gp_clk"; termination = "no_pulling"; }; // PCM_MCLK (GPCLK0)
pin@p33 { function = "output"; termination = "no_pulling"; polarity = "active_low"; startup_state = "inactive"; }; // AUD_RST_N
pin@p34 { function = "input"; termination = "pull_up"; }; // NOT USED
pin@p35 { function = "output"; termination = "no_pulling"; polarity = "active_high"; startup_state = "active"; }; // USB_ON
pin@p36 { function = "input"; termination = "no_pulling"; }; // RTC_IRQ
pin@p37 { function = "input"; termination = "no_pulling"; }; // IR_RX
pin@p38 { function = "output"; termination = "no_pulling"; polarity = "active_high"; startup_state = "inactive"; }; // STBY_LED
pin@p39 { function = "output"; termination = "no_pulling"; polarity = "active_high"; startup_state = "inactive"; }; // DISK_OFF
pin@p40 { function = "pwm"; termination = "no_pulling"; }; // LED_PWM
pin@p41 { function = "output"; termination = "no_pulling"; }; // LAN_RUN
pin@p42 { function = "gp_clk"; termination = "no_pulling"; }; // ETH_CLK (GPCLK1)
pin@p43 { function = "output"; termination = "pull_down"; polarity = "active_high"; startup_state = "inactive"; }; // LEDS_ON
pin@p44 { function = "i2c1"; termination = "no_pulling"; }; // SDA1
pin@p45 { function = "i2c1"; termination = "no_pulling"; }; // SCL1
// BANK 2 //
pin@p46 { function = "input"; termination = "pull_up"; }; // SMPS_SCL
pin@p47 { function = "input"; termination = "pull_up"; }; // SMPS_SDA
pin@p48 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD CLK
pin@p49 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD CMD
pin@p50 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD D0
pin@p51 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD D1
pin@p52 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD D2
pin@p53 { function = "sdcard"; termination = "pull_up"; drive_strength_mA = <8>; }; // SD D3
pin@p128 { function = "input"; termination = "no_pulling"; polarity = "active_low"; }; // Hotplug
pin@p129 { function = "output"; termination = "no_pulling"; polarity = "active_low"; }; // EMMC_ENABLE_N
}; // pin_config
pin_defines {
pin_define@HDMI_CONTROL_ATTACHED { type = "external"; number = <0>; }; // HPD_N on external gpio
pin_define@LAN_RUN { type = "internal"; number = <41>; }; // LAN_RUN
pin_define@EMMC_ENABLE { type = "external"; number = <1>; };
pin_define@SMPS_SDA { type = "internal"; number = <46>; };
pin_define@SMPS_SCL { type = "internal"; number = <47>; };
}; // pin_defines
}; // pins_cm
clock_setup {
clock@PWM { freq = < 2400000>; }; // LEDS PWM CLOCK
clock@GPCLK1 { freq = <25000000>; }; // ETH_CLK
}; // clock_setup
}; // videocore
};

View File

@@ -0,0 +1,172 @@
// Definitions for Slice hardware
/dts-v1/;
/plugin/;
#include "dt-bindings/clock/bcm2835.h"
/ {
compatible = "brcm,bcm2708";
//
// Set up GPIOs:
// I2C1 on GPIO44,45
// LIRC input/output on GPIO4 and 37 (NB GPIO4 NC on Slice)
// I2S on GPIO28-31
//
fragment@0 {
target = <&gpio>;
__overlay__ {
i2c1_pins: i2c1 {
brcm,pins = <44 45>;
brcm,function = <6>; /* alt2 */
};
lirc_pins: lirc_pins {
brcm,pins = <4 37>; // <out in>
brcm,function = <1 0>; // out in
brcm,pull = <0 1>; // off down
};
i2s_pins: i2s {
brcm,pins = <28 29 30 31>;
brcm,function = <6>; /* alt2 */
};
ws2812_pins: ws2812 {
brcm,pins = <40>;
brcm,function = <4>; /* alt0 */
};
};
};
//
// I2C at 100KHz
//
fragment@1 {
target = <&i2c1>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
clock-frequency = <100000>;
};
};
//
// Add devices to I2C1 Bus:
// PCF8523 RTC device
// CS4265 Audio CODEC
//
fragment@2 {
target = <&i2c1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
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>;
cs4265-reset-gpios = <&gpio 33 0>; /* AUD_RST_N on GPIO33 */
cirrus,no-s16le; /* remove S16LE support to workaround I2S controller issue */
status = "okay";
};
};
};
//
// LIRC
//
fragment@3 {
target-path = "/";
__overlay__ {
lirc_rpi: lirc_rpi {
compatible = "rpi,lirc-rpi";
pinctrl-names = "default";
pinctrl-0 = <&lirc_pins>;
status = "okay";
// Override autodetection of IR receiver circuit
// (0 = active high, 1 = active low, -1 = no override )
rpi,sense = <0xffffffff>;
// Software carrier
// (0 = off, 1 = on)
rpi,softcarrier = <1>;
// Invert output
// (0 = off, 1 = on)
rpi,invert = <0>;
// Enable debugging messages
// (0 = off, 1 = on)
rpi,debug = <0>;
};
};
};
//
// Audio driver
//
fragment@4 {
#address-cells = <1>;
#size-cells = <1>;
target = <&sound>;
__overlay__ {
compatible = "fiveninjas,slice";
clocks = <&cprman BCM2835_CLOCK_GP0>;
clock-names = "gp0";
pinctrl-names = "default";
i2s-controller = <&i2s>;
status = "okay";
};
};
//
// Enable I2S
//
fragment@5 {
target = <&i2s>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&i2s_pins>;
brcm,enable-mmap;
status = "okay";
};
};
//
// WS2812B LEDs driver
//
fragment@6 {
target = <&soc>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
ws2812: ws2812 {
compatible = "rpi,ws2812";
pinctrl-names = "default";
pinctrl-0 = <&ws2812_pins>;
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";
};
};
};
//
// Disable standard audio
//
fragment@7 {
target = <&audio>;
__overlay__ {
status = "disabled";
};
};
};

View File

@@ -0,0 +1,33 @@
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target = <&soc>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
ws2812: ws2812 {
compatible = "rpi,ws2812";
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

@@ -0,0 +1,2 @@
#!/bin/bash
hdparm -S60 /dev/sda

View File

@@ -0,0 +1,23 @@
#!/bin/bash
if [ -f /storage/.kodi/media/ledpatterns/shutdown.png ]; then
LEDDIR=/storage/.kodi
else
LEDDIR=/usr/share/kodi
fi
case "$1" in
halt)
hdparm -y /dev/sda
led_png $LEDDIR/media/ledpatterns/shutdown.png
;;
poweroff)
hdparm -y /dev/sda
led_png $LEDDIR/media/ledpatterns/shutdown.png
;;
reboot)
led_png $LEDDIR/media/ledpatterns/shutdown.png
;;
*)
;;
esac

View File

@@ -0,0 +1,25 @@
<confdir:pcm/iec958.conf>
snd_slice.pcm.iec958.0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD {
type string
}
@args.AES0 {
type integer
}
@args.AES1 {
type integer
}
@args.AES2 {
type integer
}
@args.AES3 {
type integer
}
type hooks
slave.pcm {
type hw
card $CARD
}
}

View File

@@ -0,0 +1 @@
../../RPi2/linux/linux.arm.conf

View File

@@ -0,0 +1,2 @@
# Additional kernel make parameters
KERNEL_MAKE_EXTRACMD+=" dt-blob.dtb overlays/slice.dtbo overlays/ws2812.dtbo"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp 2016-09-17 16:35:20.000000000 +0100
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp 2016-10-01 19:26:40.470553260 +0100
@@ -527,6 +527,7 @@
m_info.m_wantsIECPassthrough = true;
list.push_back(m_info);
+#if 0
m_info.m_channels.Reset();
m_info.m_dataFormats.clear();
m_info.m_streamTypes.clear();
@@ -548,6 +549,7 @@
m_info.m_wantsIECPassthrough = true;
list.push_back(m_info);
+#endif
m_info.m_channels.Reset();
m_info.m_dataFormats.clear();

View File

@@ -0,0 +1,22 @@
--- a/system/keymaps/keyboard.xml 2016-09-17 16:35:20.000000000 +0100
+++ b/system/keymaps/keyboard.xml 2016-10-01 19:31:07.928719606 +0100
@@ -56,7 +56,7 @@
<menu mod="longpress">Menu</menu>
<c>ContextMenu</c>
<c mod="longpress">Menu</c>
- <space>Pause</space>
+ <space>PlayPause</space>
<x>Stop</x>
<period>SkipNext</period>
<comma>SkipPrevious</comma>
@@ -321,8 +321,8 @@
<l>NextSubtitle</l>
<left>StepBack</left>
<right>StepForward</right>
- <up>ChapterOrBigStepForward</up>
- <down>ChapterOrBigStepBack</down>
+ <up>VolumeUp</up>
+ <down>VolumeDown</down>
<up mod="longpress">AudioNextLanguage</up>
<down mod="longpress">NextSubtitle</down>
<a>AudioDelay</a>

View File

@@ -0,0 +1,31 @@
diff --git a/xbmc/windows/CMakeLists.txt b/xbmc/windows/CMakeLists.txt
index 3700602..c75f78f 100644
--- a/xbmc/windows/CMakeLists.txt
+++ b/xbmc/windows/CMakeLists.txt
@@ -1,3 +1,5 @@
+find_package(PNG REQUIRED)
+
set(SOURCES GUIMediaWindow.cpp
GUIWindowDebugInfo.cpp
GUIWindowFileManager.cpp
@@ -9,7 +11,8 @@ set(SOURCES GUIMediaWindow.cpp
GUIWindowSplash.cpp
GUIWindowStartup.cpp
GUIWindowSystemInfo.cpp
- GUIWindowWeather.cpp)
+ GUIWindowWeather.cpp
+ readpng.c)
set(HEADERS GUIMediaWindow.h
GUIWindowDebugInfo.h
@@ -22,6 +25,9 @@ set(HEADERS GUIMediaWindow.h
GUIWindowSplash.h
GUIWindowStartup.h
GUIWindowSystemInfo.h
- GUIWindowWeather.h)
+ GUIWindowWeather.h
+ readpng.h)
core_add_library(windows)
+
+target_link_libraries(windows PRIVATE ${PNG_LIBRARIES})