diff --git a/projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch b/packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/libcec/libcec-00-aocec-support.patch
rename to packages/devel/libcec/patches/aarch64/libcec-00-aocec-support.patch
diff --git a/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch b/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch
new file mode 100644
index 0000000000..06b040858d
--- /dev/null
+++ b/packages/linux-drivers/RTL8192EU/patches/RTL8192EU-gcc-5.patch
@@ -0,0 +1,25 @@
+diff -Naur a/include/ieee80211.h b/include/ieee80211.h
+--- a/include/ieee80211.h
++++ b/include/ieee80211.h
+@@ -1314,18 +1314,18 @@
+ (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
+ (((Addr[5]) & 0xff) == 0xff))
+ #else
+-extern __inline int is_multicast_mac_addr(const u8 *addr)
++static __inline int is_multicast_mac_addr(const u8 *addr)
+ {
+ return ((addr[0] != 0xff) && (0x01 & addr[0]));
+ }
+
+-extern __inline int is_broadcast_mac_addr(const u8 *addr)
++static __inline int is_broadcast_mac_addr(const u8 *addr)
+ {
+ return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
+ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
+ }
+
+-extern __inline int is_zero_mac_addr(const u8 *addr)
++static __inline int is_zero_mac_addr(const u8 *addr)
+ {
+ return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
+ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
diff --git a/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch b/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch
index 95466b1b1f..ed84e0226c 100644
--- a/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch
+++ b/packages/linux-drivers/RTL8812AU/patches/RTL8812AU-03-gcc-5.patch
@@ -1,7 +1,7 @@
-diff -Naur RTL8812AU-3f015f0/include/ieee80211.h RTL8812AU-3f015f0.patch/include/ieee80211.h
---- RTL8812AU-3f015f0/include/ieee80211.h 2015-07-14 21:45:26.000000000 +0200
-+++ RTL8812AU-3f015f0.patch/include/ieee80211.h 2015-11-03 14:12:38.570076503 +0100
-@@ -1286,12 +1286,12 @@
+diff -Naur a/include/ieee80211.h b/include/ieee80211.h
+--- a/include/ieee80211.h
++++ b/include/ieee80211.h
+@@ -1388,18 +1388,18 @@
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
@@ -14,5 +14,12 @@ diff -Naur RTL8812AU-3f015f0/include/ieee80211.h RTL8812AU-3f015f0.patch/include
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+static __inline int is_broadcast_mac_addr(const u8 *addr)
{
- return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
- (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
+ return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
+ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
+ }
+
+-extern __inline int is_zero_mac_addr(const u8 *addr)
++static __inline int is_zero_mac_addr(const u8 *addr)
+ {
+ return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
+ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
diff --git a/packages/linux/package.mk b/packages/linux/package.mk
index 1d9743e522..768c2211be 100644
--- a/packages/linux/package.mk
+++ b/packages/linux/package.mk
@@ -39,7 +39,7 @@ case "$LINUX" in
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
;;
amlogic-3.14)
- PKG_VERSION="c733661"
+ PKG_VERSION="a0d96f4"
PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_DIR="$PKG_NAME-amlogic-$PKG_VERSION*"
;;
diff --git a/projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch b/packages/linux/patches/aarch64/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/linux/staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch
rename to packages/linux/patches/aarch64/linux-001-staging_rtl8712_rtl8712_avoid_lots_of_build_warnings.patch
diff --git a/packages/linux/patches/aarch64/linux-003-no_dev_console.patch b/packages/linux/patches/aarch64/linux-003-no_dev_console.patch
new file mode 100644
index 0000000000..df35a7ab9a
--- /dev/null
+++ b/packages/linux/patches/aarch64/linux-003-no_dev_console.patch
@@ -0,0 +1,21 @@
+diff --git a/init/main.c b/init/main.c
+index 9484f4b..db55edd 100644
+--- a/init/main.c
++++ b/init/main.c
+@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
+ do_basic_setup();
+
+ /* Open the /dev/console on the rootfs, this should never fail */
+- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+- pr_err("Warning: unable to open an initial console.\n");
++ char *console = "/dev_console";
++
++ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
++ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
++ if (sys_open(console, O_RDWR, 0) < 0)
++ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
++ sys_unlink(console);
++ }
+
+ (void) sys_dup(0);
+ (void) sys_dup(0);
diff --git a/projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch b/packages/linux/patches/aarch64/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/linux/limit_avaiable_sampling_freqencies_and_bit_depths.patch
rename to packages/linux/patches/aarch64/linux-007-sound_soc_aml_m8-Report-only-working-frequecies-and-bit-depths.patch
diff --git a/projects/WeTek_Hub/patches/kodi/0001-aml-Fill-audio-packets-completely-when-resampling-to.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0001-aml-Fill-audio-packets-completely-when-resampling-to.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/kodi/0001-aml-Fill-audio-packets-completely-when-resampling-to.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0001-aml-Fill-audio-packets-completely-when-resampling-to.patch
diff --git a/projects/WeTek_Hub/patches/kodi/0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/kodi/0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0002-aml-Multichannel-PCM-and-HD-Audio-passthrough.patch
diff --git a/projects/WeTek_Hub/patches/kodi/0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/kodi/0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0003-EGLNativeTypeAmlogic-Enable-GUI-free_scale-when-framebuffer-size-is-less-than-output.patch
diff --git a/projects/Odroid_C2/patches/kodi/kodi-0002-disable-suspend.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0004-powermanagement-disable-suspend.patch
similarity index 100%
rename from projects/Odroid_C2/patches/kodi/kodi-0002-disable-suspend.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0004-powermanagement-disable-suspend.patch
diff --git a/projects/WeTek_Hub/patches/kodi/0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/kodi/0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0005-aml-FIX-renderer-hide-meaningless-skips-from-users.patch
diff --git a/projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch b/packages/mediacenter/kodi/patches/aarch64/kodi-0006-fix-resolution-fallback.patch
similarity index 100%
rename from projects/WeTek_Hub/patches/kodi/0006-fix-resolution-fallback.patch
rename to packages/mediacenter/kodi/patches/aarch64/kodi-0006-fix-resolution-fallback.patch
diff --git a/packages/tools/u-boot/package.mk b/packages/tools/u-boot/package.mk
index 44cb247628..fe6618fd34 100644
--- a/packages/tools/u-boot/package.mk
+++ b/packages/tools/u-boot/package.mk
@@ -25,7 +25,7 @@ if [ "$UBOOT_VERSION" = "imx6-cuboxi" ]; then
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
[ -n "$UBOOT_CONFIG_V2" ] && PKG_DEPENDS_TARGET="toolchain u-boot-v2"
elif [ "$UBOOT_VERSION" = "hardkernel" ]; then
- PKG_VERSION="61f29bb"
+ PKG_VERSION="6e4e886"
PKG_SITE="https://github.com/hardkernel/u-boot"
PKG_URL="https://github.com/hardkernel/u-boot/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET gcc-linaro-aarch64-elf:host gcc-linaro-arm-eabi:host"
diff --git a/packages/tools/u-boot/patches/61f29bb/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch b/packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch
similarity index 100%
rename from packages/tools/u-boot/patches/61f29bb/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch
rename to packages/tools/u-boot/patches/6e4e886/u-boot-0001-use-arm-eabi-for-bl301-scp_task.patch
diff --git a/packages/tools/u-boot/scripts/update-c2.sh b/packages/tools/u-boot/scripts/update-c2.sh
index 7dde62898c..c063567c0a 100644
--- a/packages/tools/u-boot/scripts/update-c2.sh
+++ b/packages/tools/u-boot/scripts/update-c2.sh
@@ -55,8 +55,10 @@ dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=1 cou
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=512 skip=1 seek=1
# monkey patch boot.ini for updated kernel
- sed -i '/setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"/i \setenv timer "fdt addr 0x1000000; fdt rm /timer"' /flash/boot.ini
- sed -i 's|setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"|setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"|' /flash/boot.ini
+ sed -i 's|setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}"|setenv odroidp1 "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs"|' /flash/boot.ini
+ sed -i 's|setenv odroidp2 "${disableuhs} consoleblank=0|setenv odroidp2 "mac=${ethaddr} consoleblank=0|' /flash/boot.ini
+ sed -i 's|setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"|setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"|' /flash/boot.ini
+ sed -i 's|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${hpd} ${dac} ${libreelec}"|setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${libreelec}"|' /flash/boot.ini
# mount $BOOT_ROOT r/o
sync
diff --git a/projects/Odroid_C2/bootloader/boot.ini b/projects/Odroid_C2/bootloader/boot.ini
index e1df57a56a..224485b4da 100644
--- a/projects/Odroid_C2/bootloader/boot.ini
+++ b/projects/Odroid_C2/bootloader/boot.ini
@@ -25,62 +25,44 @@ setenv console "console=tty0"
#------------------------------------------------------------------------------------------------------
#
# Video
-# Setup the video output
+# Setup the video output (default is 1080p60hz)
# 480 Lines (720x480)
-# setenv video_output "480i60hz" # Interlaced 60Hz
-# setenv video_output "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz
-# setenv video_output "480p60hz" # 480 Progressive 60Hz
-# setenv video_output "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz
+# setenv hdmimode "480i60hz" # Interlaced 60Hz
+# setenv hdmimode "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz
+# setenv hdmimode "480p60hz" # 480 Progressive 60Hz
+# setenv hdmimode "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz
# 576 Lines (720x576)
-# setenv video_output "576i50hz" # Interlaced 50Hz
-# setenv video_output "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz
-# setenv video_output "576p50hz" # Progressive 50Hz
-# setenv video_output "576p_rpt" # Progressive for Rear Projection Televisions 50Hz
+# setenv hdmimode "576i50hz" # Interlaced 50Hz
+# setenv hdmimode "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz
+# setenv hdmimode "576p50hz" # Progressive 50Hz
+# setenv hdmimode "576p_rpt" # Progressive for Rear Projection Televisions 50Hz
# 720 Lines (1280x720)
-# setenv video_output "720p50hz" # Progressive 50Hz
-# setenv video_output "720p60hz" # Progressive 60Hz
+# setenv hdmimode "720p60hz" # Progressive 60Hz
+# setenv hdmimode "720p50hz" # Progressive 50Hz
# 1080 Lines (1920x1080)
-# setenv video_output "1080i60hz" # Interlaced 60Hz
-# setenv video_output "1080p60hz" # Progressive 60Hz
-# setenv video_output "1080i50hz" # Interlaced 50Hz
-# setenv video_output "1080p50hz" # Progressive 50Hz
-# setenv video_output "1080p24hz" # Progressive 24Hz
+# setenv hdmimode "1080i60hz" # Interlaced 60Hz
+# setenv hdmimode "1080p60hz" # Progressive 60Hz
+# setenv hdmimode "1080i50hz" # Interlaced 50Hz
+# setenv hdmimode "1080p50hz" # Progressive 50Hz
+# setenv hdmimode "1080p30hz" # Progressive 30Hz
+# setenv hdmimode "1080p25hz" # Progressive 25Hz
+# setenv hdmimode "1080p24hz" # Progressive 24Hz
# 4K (3840x2160)
-# setenv video_output "2160p30hz" # Progressive 30Hz
-# setenv video_output "2160p25hz" # Progressive 25Hz
-# setenv video_output "2160p24hz" # Progressive 24Hz
-# setenv video_output "smpte24hz" # Progressive 24Hz SMPTE
-# setenv video_output "2160p50hz" # Progressive 50Hz
-# setenv video_output "2160p60hz" # Progressive 60Hz
-# setenv video_output "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
-# setenv video_output "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
-# VESA modes
-# setenv video_output "640x480p60hz"
-# setenv video_output "800x480p60hz"
-# setenv video_output "800x600p60hz"
-# setenv video_output "1024x600p60hz"
-# setenv video_output "1024x768p60hz"
-# setenv video_output "1280x800p60hz"
-# setenv video_output "1280x1024p60hz"
-# setenv video_output "1360x768p60hz"
-# setenv video_output "1366x768p60hz"
-# setenv video_output "1440x900p60hz"
-# setenv video_output "1600x900p60hz"
-# setenv video_output "1680x1050p60hz"
-# setenv video_output "1920x1200p60hz"
-#
-# Setup the HDMI video mode (Must be one or the other)
-# setenv video_mode "dvi" # DVI
-# setenv video_mode "vga" # VGA
-#
-# Setup the HDMI BPP Mode
-# setenv video_bpp "32" # 32-bit
-# setenv video_bpp "24" # 24-bit
-# setenv video_bpp "16" # 16-bit
-#
-# Enable|Disable HDMI Hotplug Detection
-# setenv hdmihotplug "0" # Disabled
-# setenv hdmihotplug "1" # Enabled
+# setenv hdmimode "2160p60hz" # Progressive 60Hz
+# setenv hdmimode "2160p50hz" # Progressive 50Hz
+# setenv hdmimode "2160p30hz" # Progressive 30Hz
+# setenv hdmimode "2160p25hz" # Progressive 25Hz
+# setenv hdmimode "2160p24hz" # Progressive 24Hz
+# setenv hdmimode "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
+# setenv hdmimode "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
+# 4K2K (4096x2160)
+# setenv hdmimode "smpte60hz" # Progressive 60Hz SMPTE
+# setenv hdmimode "smpte50hz" # Progressive 50Hz SMPTE
+# setenv hdmimode "smpte30hz" # Progressive 30Hz SMPTE
+# setenv hdmimode "smpte25hz" # Progressive 25Hz SMPTE
+# setenv hdmimode "smpte24hz" # Progressive 24Hz SMPTE
+# setenv hdmimode "smpte60hz420" # Progressive 60Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
+# setenv hdmimode "smpte50hz420" # Progressive 50Hz SMPTE with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
#
# Enable|Disable HDMI (Saves RAM)
# setenv hdmioutput "0" # Disabled
@@ -91,10 +73,6 @@ setenv console "console=tty0"
# setenv vpu "1" # Enabled
#
#------------------------------------------------------------------------------------------------------
-setenv video_output "1080p60hz"
-setenv video_mode "hdmi"
-setenv video_bpp "32"
-setenv hdmihotplug "1"
setenv hdmioutput "1"
setenv vpu "1"
@@ -107,15 +85,6 @@ setenv vpu "1"
#------------------------------------------------------------------------------------------------------
setenv libreelec "quiet"
-#------------------------------------------------------------------------------------------------------
-#
-# UHS Card Configuration
-# Uncomment the line below to __DISABLE__ UHS-1 MicroSD support
-# This might break boot for some brand models of cards.
-#
-#------------------------------------------------------------------------------------------------------
-# setenv disableuhs "disableuhs"
-
#------------------------------------------------------------------------------------------------------
#
# Enable|Disable HDMI CEC Control
@@ -127,22 +96,40 @@ setenv hdmi_cec "1"
#------------------------------------------------------------------------------------------------------
#
-# PCM5102 I2S Audio DAC (HiFi Shield)
-# PCM5102 is an I2S Audio DAC Addon board for ODROID-C1+
+# CPU Frequency / Cores control
+#
+# WARNING!!! WARNING!!! WARNING!!!
+# Before changing anything here please read the wiki entry:
+# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq
+#
+# MAX CPU's
+# setenv maxcpus "1"
+# setenv maxcpus "2"
+# setenv maxcpus "3"
+# setenv maxcpus "4"
+#
+# MAX Frequency
+# setenv max_freq "2016" # 2.016GHz
+# setenv max_freq "1944" # 1.944GHz
+# setenv max_freq "1944" # 1.944GHz
+# setenv max_freq "1920" # 1.920GHz
+# setenv max_freq "1896" # 1.896GHz
+# setenv max_freq "1752" # 1.752GHz
+# setenv max_freq "1680" # 1.680GHz
+# setenv max_freq "1656" # 1.656GHz
+# setenv max_freq "1536" # 1.536GHz
#
-# Enable|Disable Audio DAC
-# setenv audio_dac "0" # Disabled
-# setenv audio_dac "1" # Enabled
#------------------------------------------------------------------------------------------------------
-setenv audio_dac "0"
+setenv maxcpus "4"
+setenv max_freq "1536"
#------------------------------------------------------------------------------------------------------
#
-# Odroid C1 specific
+# Odroid C2 specific
#
#------------------------------------------------------------------------------------------------------
-setenv odroidp1 "no_console_suspend hdmimode=${video_output} m_bpp=${video_bpp} vout=${video_mode}"
-setenv odroidp2 "${disableuhs} consoleblank=0"
+setenv odroidp1 "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs"
+setenv odroidp2 "mac=${ethaddr} consoleblank=0 max_freq=${max_freq} maxcpus=${maxcpus}"
setenv odroid "${odroidp1} ${odroidp2}"
#------------------------------------------------------------------------------------------------------
@@ -153,8 +140,7 @@ setenv odroid "${odroidp1} ${odroidp2}"
setenv kernel "fatload mmc 0:1 0x11000000 KERNEL"
setenv dtb "fatload mmc 0:1 0x1000000 meson64_odroidc2.dtb"
setenv bootseq "booti 0x11000000 - 0x1000000"
-setenv timer "fdt addr 0x1000000; fdt rm /timer"
-setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"
+setenv bootcmd "${kernel}; ${dtb}; ${bootseq}"
#------------------------------------------------------------------------------------------------------
#
@@ -164,13 +150,11 @@ setenv bootcmd "${kernel}; ${dtb}; ${timer}; ${bootseq}"
# Prepare to boot
if test "${hdmi_cec}" = "1"; then setenv cec "hdmitx=cec17"; fi
-if test "${hdmi_hotplug}" = "0"; then setenv hpd "disablehpd=true"; fi
-if test "${audio_dac}" = "1"; then setenv dac "enabledac"; fi
if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi
if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi
# Populate the final bootcmd
-setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${hpd} ${dac} ${libreelec}"
+setenv bootargs "${console} ${bootrootfs} ${odroid} ${cec} ${libreelec}"
# Boot the board
run bootcmd
diff --git a/projects/Odroid_C2/filesystem/etc/amremote/remote.conf b/projects/Odroid_C2/filesystem/etc/amremote/remote.conf
new file mode 100644
index 0000000000..f1b937180b
--- /dev/null
+++ b/projects/Odroid_C2/filesystem/etc/amremote/remote.conf
@@ -0,0 +1,57 @@
+#*********************************************************************************************************
+#this file is configuration for each factory remote device
+# work_mode 0 :software mode 1 :hardware mode
+# repeat_enable 0 :disable repeat 1 :enable repeat
+#
+# factory_code each device has it's unique factory code.
+# pattern:custom_code(16bit)+index_code(16bit)
+# examble: 0xff000001 = 0xff00(custom cod) 0001 (index)
+#
+# release_delay unit:ms.release will report from kernel to user layer after this period of time
+# from press or repeat triggered.
+#
+# debug_enable 0 :debug disable 1 :debug disable
+#
+# SW MODE:
+# bit_count how many bits in each frame
+# tw_leader_act time window for leader active
+# tw_bit0 time window for bit0 time.
+# tw_bit1 time window for bit1 time
+# tw_repeat_leader time window for repeat leader
+# REG
+# reg_base_gen set value for PREG_IR_DEC_BASE_GEN
+# reg_control set value for PREG_IR_DEC_CONTROL
+# reg_leader_act set value for PREG_IR_DEC_LEADER_ACTIVE
+# reg_leader_idle set value for PREG_IR_DEC_LEADER_IDLE
+# reg_repeat_leader set value for PREG_IR_DEC_REPEAT_IDLE
+# reg_bit0_time set value for PREG_IR_DEC_BIT0_TIME
+#*************************************************************************************************************
+#amlogic NEC remote
+factory_code = 0x4db20001
+work_mode = 0
+repeat_enable = 1
+repeat_delay = 40
+repeat_peroid = 39
+release_delay = 121
+debug_enable = 1
+
+up_key_scancode = 0xca
+down_key_scancode = 0xd2
+left_key_scancode = 0x99
+right_key_scancode = 0xc1
+ok_key_scancode = 0xce
+
+key_begin
+ 0xdc 116 ; KEY_POWER
+ 0x88 113 ; KEY_MUTE
+ 0x82 102 ; KEY_HOME
+ 0xca 103 ; KEY_UP
+ 0xd2 108 ; KEY_DOWN
+ 0x99 105 ; KEY_LEFT
+ 0xc1 106 ; KEY_RIGHT
+ 0xce 28 ; KEY_ENTER
+ 0x9a 1 ; KEY_ESC
+ 0xc5 46 ; KEY_C
+ 0x80 115 ; KEY_VOLUMEUP
+ 0x81 114 ; KEY_VOLUMEDOWN
+key_end
diff --git a/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote b/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote
new file mode 100644
index 0000000000..5bd1125445
--- /dev/null
+++ b/projects/Odroid_C2/filesystem/etc/lirc/lircd.conf.amremote
@@ -0,0 +1,34 @@
+begin remote
+
+ name odroid_amremote
+ bits 16
+ flags SPACE_ENC|CONST_LENGTH
+ eps 30
+ aeps 100
+
+ header 9000 4500
+ one 563 1687
+ zero 563 562
+ ptrail 563
+ repeat 9000 2250
+ pre_data_bits 16
+ pre_data 0x4DB2
+ gap 0
+ suppress_repeat 1
+
+ begin codes
+ KEY_POWER 0x3BC4
+ KEY_MUTE 0x11EE
+ KEY_HOME 0x41BE
+ KEY_ENTER 0x738C
+ KEY_LEFT 0x9966
+ KEY_RIGHT 0x837C
+ KEY_UP 0x53AC
+ KEY_DOWN 0x4BB4
+ KEY_BACK 0x59A6
+ KEY_MENU 0xA35C
+ KEY_VOLUMEDOWN 0x817E
+ KEY_VOLUMEUP 0x01FE
+ end codes
+
+end remote
diff --git a/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf b/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf
deleted file mode 100644
index 29c66fc8c8..0000000000
--- a/projects/Odroid_C2/filesystem/usr/lib/modules-load.d/mali.conf
+++ /dev/null
@@ -1 +0,0 @@
-mali
diff --git a/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules b/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules
deleted file mode 100644
index 3f927bf6e0..0000000000
--- a/projects/Odroid_C2/filesystem/usr/lib/udev/rules.d/10-odroid.rules
+++ /dev/null
@@ -1,8 +0,0 @@
-KERNEL=="mali",SUBSYSTEM=="misc",MODE="0777"
-KERNEL=="mali0",SUBSYSTEM=="misc",MODE="0777"
-KERNEL=="ump",SUBSYSTEM=="ump",MODE="0777"
-KERNEL=="ttySAC0", SYMLINK+="ttyACM99"
-KERNEL=="event*", SUBSYSTEM=="input", MODE="0777"
-KERNEL=="CEC", MODE="0777"
-KERNEL=="amvideo", MODE="0666"
-KERNEL=="amstream*", MODE="0666"
diff --git a/projects/Odroid_C2/initramfs/platform_init b/projects/Odroid_C2/initramfs/platform_init
index b529283cc1..d99783f0ba 100644
--- a/projects/Odroid_C2/initramfs/platform_init
+++ b/projects/Odroid_C2/initramfs/platform_init
@@ -1,50 +1,69 @@
#!/bin/sh
+################################################################################
+# This file is part of LibreELEC - https://LibreELEC.tv
+# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.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 .
+################################################################################
-for x in $(cat /proc/cmdline); do
- case ${x} in
- m_bpp=*) export bpp=${x#*=} ;;
- hdmimode=*) export mode=${x#*=} ;;
+hdmimode=1080p60hz
+
+# Parse command line arguments
+for arg in $(cat /proc/cmdline); do
+ case $arg in
+ hdmimode=*)
+ hdmimode="${arg#*=}"
+ ;;
esac
done
-common_display_setup() {
- M="0 0 $(($X - 1)) $(($Y - 1))"
- Y_VIRT=$(($Y * 2))
- fbset -fb /dev/fb0 -g $X $Y $X $Y_VIRT $bpp
- fbset -fb /dev/fb1 -g 32 32 32 32 32
- echo $mode > /sys/class/display/mode
- echo 0 > /sys/class/graphics/fb0/free_scale
- echo 1 > /sys/class/graphics/fb0/freescale_mode
- echo $M > /sys/class/graphics/fb0/free_scale_axis
- echo $M > /sys/class/graphics/fb0/window_axis
- echo 0 > /sys/class/graphics/fb1/free_scale
- echo 1 > /sys/class/video/disable_video
-}
+# Enable first framebuffer
+echo 0 > /sys/class/graphics/fb0/blank
-case $mode in
- 480*) export X=720 Y=480 ;;
- 576*) export X=720 Y=576 ;;
- 720p*) export X=1280 Y=720 ;;
- 1080*) export X=1920 Y=1080 ;;
- 2160p*) export X=3840 Y=2160 ;;
- smpte24hz*) export X=3840 Y=2160 ;;
- 640x480p60hz*) export X=640 Y=480 ;;
- 800x480p60hz*) export X=800 Y=480 ;;
- 800x600p60hz*) export X=800 Y=600 ;;
- 1024x600p60hz*) export X=1024 Y=600 ;;
- 1024x768p60hz*) export X=1024 Y=768 ;;
- 1280x800p60hz*) export X=1280 Y=800 ;;
- 1280x1024p60hz*) export X=1280 Y=1024 ;;
- 1360x768p60hz*) export X=1360 Y=768 ;;
- 1366x768p60hz*) export X=1366 Y=768 ;;
- 1440x900p60hz*) export X=1440 Y=900 ;;
- 1600x900p60hz*) export X=1600 Y=900 ;;
- 1680x1050p60hz*) export X=1680 Y=1050 ;;
- 1920x1200p60hz*) export X=1920 Y=1200 ;;
+# Disable second framebuffer
+echo 1 > /sys/class/graphics/fb1/blank
+
+# Disable framebuffer scaling
+echo 0 > /sys/class/graphics/fb0/free_scale
+echo 0 > /sys/class/graphics/fb1/free_scale
+
+# set initial video state
+echo 1 > /sys/class/video/disable_video
+
+# Set framebuffer geometry to match the resolution
+case $hdmimode in
+ 480*) X=720 Y=480 ;;
+ 576*) X=720 Y=576 ;;
+ 720p*) X=1280 Y=720 ;;
+ *) X=1920 Y=1080 ;;
esac
-common_display_setup
+fbset -fb /dev/fb0 -g $X $Y 1920 2160 32
+fbset -fb /dev/fb1 -g 32 32 32 32 32
-# Console unblack
-echo 0 > /sys/class/graphics/fb0/blank
-echo 0 > /sys/class/graphics/fb1/blank
+# Enable scaling for 4K output
+case $hdmimode in
+ 4k*|smpte*|2160*)
+ echo 0 0 1919 1079 > /sys/class/graphics/fb0/free_scale_axis
+ echo 0 0 3839 2159 > /sys/class/graphics/fb0/window_axis
+ echo 1920 > /sys/class/graphics/fb0/scale_width
+ echo 1080 > /sys/class/graphics/fb0/scale_height
+ echo 0x10001 > /sys/class/graphics/fb0/free_scale
+ ;;
+esac
+
+# Include deinterlacer into default VFM map
+echo rm default > /sys/class/vfm/map
+echo add default decoder ppmgr deinterlace amvideo > /sys/class/vfm/map
diff --git a/projects/Odroid_C2/linux/linux.aarch64.conf b/projects/Odroid_C2/linux/linux.aarch64.conf
index e9ef18f652..aa6a146a2b 100644
--- a/projects/Odroid_C2/linux/linux.aarch64.conf
+++ b/projects/Odroid_C2/linux/linux.aarch64.conf
@@ -1,15 +1,18 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm64 3.14.79 Kernel Configuration
+# Linux/arm64 3.14.29 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_ARM64_HAS_SG_CHAIN=y
CONFIG_64BIT=y
CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_MMU=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=18
+CONFIG_ARCH_MMAP_RND_BITS_MAX=18
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_NO_IOPORT=y
CONFIG_STACKTRACE_SUPPORT=y
-CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
@@ -36,7 +39,7 @@ CONFIG_CROSS_COMPILE=""
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_DEFAULT_HOSTNAME="@DISTRONAME@"
-# CONFIG_SWAP is not set
+CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
@@ -123,7 +126,7 @@ CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
-CONFIG_SCHED_AUTOGROUP=y
+# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
@@ -203,6 +206,11 @@ CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_MODULES_USE_ELF_RELA=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_ARCH_MMAP_RND_BITS=18
+CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
CONFIG_CLONE_BACKWARDS=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_COMPAT_OLD_SIGACTION=y
@@ -211,7 +219,6 @@ CONFIG_COMPAT_OLD_SIGACTION=y
# GCOV-based kernel profiling
#
# CONFIG_GCOV_KERNEL is not set
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
@@ -268,19 +275,27 @@ CONFIG_ARCH_MESON64_ODROIDC2=y
CONFIG_ARM_AMBA=y
#
-# Kernel Features
+# ARM errata workarounds via the alternatives framework
#
+CONFIG_ARM64_ERRATUM_845719=y
+CONFIG_ARM64_ERRATUM_843419=y
+CONFIG_ARM64_ERRATUM_835769=y
#
-# ARM errata workarounds
+# Kernel Features
#
-# CONFIG_ARM64_ERRATUM_845719 is not set
# CONFIG_ARM64_64K_PAGES is not set
# CONFIG_CPU_BIG_ENDIAN is not set
CONFIG_SMP=y
CONFIG_SCHED_MC=y
-CONFIG_SCHED_SMT=y
+# CONFIG_SCHED_SMT is not set
# CONFIG_DISABLE_CPU_SCHED_DOMAIN_BALANCE is not set
+CONFIG_SCHED_HMP=y
+# CONFIG_SCHED_HMP_PRIO_FILTER is not set
+CONFIG_HMP_FAST_CPU_MASK=""
+CONFIG_HMP_SLOW_CPU_MASK=""
+# CONFIG_HMP_VARIABLE_SCALE is not set
+# CONFIG_SCHED_HMP_LITTLE_PACKING is not set
CONFIG_NR_CPUS=4
CONFIG_HOTPLUG_CPU=y
CONFIG_SWP_EMULATE=y
@@ -300,7 +315,6 @@ CONFIG_ARMV7_COMPAT_CPUINFO=y
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
-CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_SPARSEMEM=y
@@ -329,6 +343,8 @@ CONFIG_CMA_AREAS=7
# CONFIG_ZBUD is not set
# CONFIG_ZSMALLOC is not set
CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
# CONFIG_XEN is not set
CONFIG_FORCE_MAX_ZONEORDER=11
CONFIG_SECCOMP=y
@@ -341,7 +357,6 @@ CONFIG_CMDLINE_FROM_BOOTLOADER=y
# CONFIG_CMDLINE_EXTEND is not set
# CONFIG_CMDLINE_FORCE is not set
# CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE is not set
-# CONFIG_EFI is not set
#
# Userspace binary formats
@@ -402,11 +417,17 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
-# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_HOTPLUG=y
-# CONFIG_CPU_FREQ_GOV_INTERACTIVE is not set
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
# CONFIG_GENERIC_CPUFREQ_CPU0 is not set
+
+#
+# ARM CPU frequency scaling drivers
+#
+# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARM64_CPU_SUSPEND=y
@@ -420,7 +441,6 @@ CONFIG_ARM64_CPU_SUSPEND=y
#
# CONFIG_CPU_IDLE is not set
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
-# CONFIG_ARM64_ERRATUM_843419 is not set
CONFIG_NET=y
CONFIG_COMPAT_NETLINK_MESSAGES=y
@@ -779,14 +799,12 @@ CONFIG_MAC80211_LEDS=y
#
# Amlogic Device Drivers
#
-
-#
-# AO CEC Support
-#
-CONFIG_AML_AO_CEC=y
CONFIG_MESON_TIMER=y
+# CONFIG_MESON_LOCAL_TIMER is not set
+CONFIG_MESON_BC_TIMER=y
CONFIG_AM_UART=y
CONFIG_SERIAL_MESON_CONSOLE=y
+# CONFIG_PRINTK_NOBLOCK_MODE is not set
CONFIG_AML_CPU_VERSION=y
CONFIG_AML_MESON64_VERSION=y
# CONFIG_AML_M8_VERSION is not set
@@ -804,8 +822,10 @@ CONFIG_USB_HOST_ELECT_TEST=y
# I2C Hardware Bus support
#
CONFIG_I2C_AML=y
+# CONFIG_I2C_SLAVE_AML is not set
# CONFIG_I2C_SW_AML is not set
# CONFIG_BCM2079X_I2C is not set
+# CONFIG_AML_PWM is not set
#
# HDMI TX Support
@@ -824,6 +844,7 @@ CONFIG_AML_REG_ACCESS=y
#
# CONFIG_AML_POWER_SUPPORT is not set
# CONFIG_AML_PMU_ALGORITHM_SUPPORT is not set
+# CONFIG_AML_PMU4 is not set
#
# Ethernet Support
@@ -878,7 +899,6 @@ CONFIG_AM_VOUT=y
CONFIG_AM_TV_OUTPUT=y
CONFIG_AML_VOUT_FRAMERATE_AUTOMATION=y
# CONFIG_AML_VDAC_HW_SWITCH is not set
-# CONFIG_AM_LCD_OUTPUT is not set
#
# Amlogic OSD Module
@@ -902,10 +922,15 @@ CONFIG_FB_OSD2_CURSOR=y
CONFIG_AM_GE2D=y
CONFIG_AM_LOGO=y
+#
+# Amlogic LCD Output Module
+#
+# CONFIG_AML_LCD is not set
+
#
# Amlogic Backlight Support
#
-# CONFIG_AMLOGIC_BACKLIGHT is not set
+# CONFIG_AML_BACKLIGHT is not set
# CONFIG_AMLOGIC_LED is not set
#
@@ -914,6 +939,7 @@ CONFIG_AM_LOGO=y
CONFIG_AML_CANVAS=y
CONFIG_AMLOGIC_CLK=y
CONFIG_AMLOGIC_SEC=y
+# CONFIG_AML_SERR is not set
CONFIG_AMLOGIC_SECURITY_KEY=y
CONFIG_AM_PTSSERVER=y
# CONFIG_H264_4K2K_SINGLE_CORE is not set
@@ -934,6 +960,7 @@ CONFIG_AM_VDEC_H264=y
CONFIG_AM_VDEC_H264MVC=y
CONFIG_AM_VDEC_H264_4K2K=y
CONFIG_AM_VDEC_H265=y
+CONFIG_AM_VDEC_VP9=y
CONFIG_AM_VDEC_MJPEG=y
CONFIG_AM_ENCODER=y
CONFIG_AM_JPEG_ENCODER=y
@@ -945,6 +972,7 @@ CONFIG_AM_TIMESYNC=y
CONFIG_AM_STREAMING=y
CONFIG_AM_SUBTITLE=y
# CONFIG_AM_VIDEOCAPTURE is not set
+# CONFIG_AM_HEVCENC is not set
#
# Deinterlace driver
@@ -984,7 +1012,7 @@ CONFIG_AML_AUDIO_DSP=y
#
CONFIG_POST_PROCESS_MANAGER=y
CONFIG_POST_PROCESS_MANAGER_PPSCALER=y
-# CONFIG_POST_PROCESS_MANAGER_3D_PROCESS is not set
+CONFIG_POST_PROCESS_MANAGER_3D_PROCESS=y
#
# Amlogic Wifi Driver
@@ -997,6 +1025,7 @@ CONFIG_GXBB_POWER_RESET=y
#
# Amlogic Bt Rfkill Driver
#
+# CONFIG_BLUESLEEP is not set
#
# Amlogic ion video support
@@ -1013,7 +1042,14 @@ CONFIG_V4L_AMLOGIC_VIDEO=y
#
# Amlogic TVIN Drivers
#
-# CONFIG_TVIN is not set
+CONFIG_TVIN=y
+# CONFIG_TVIN_VDIN is not set
+# CONFIG_TVIN_AFE is not set
+CONFIG_TVIN_HDMI=y
+# CONFIG_TVIN_HDMI_CEC is not set
+# CONFIG_TVIN_BT656 is not set
+# CONFIG_VIUIN is not set
+# CONFIG_TVIN_ISP is not set
#
# Amlogic VECM Drivers
@@ -1036,6 +1072,7 @@ CONFIG_MESON_INPUT_KEYBOARD=y
CONFIG_ADC_KEYPADS_AM=y
CONFIG_AML_GPIO_KEY=y
# CONFIG_SENSOR_DEVICES is not set
+# CONFIG_AMLOGIC_AVIN_DETECT is not set
# CONFIG_AMLOGIC_MESON_CPUFREQ is not set
CONFIG_AMLOGIC_SCPI_CPUFREQ=y
CONFIG_MESON_SUSPEND=y
@@ -1053,6 +1090,7 @@ CONFIG_GXBB_SUSPEND=y
#
# CONFIG_AM_PCMCIA is not set
# CONFIG_AM_IOBUS is not set
+# CONFIG_AML_SMARTCARD is not set
#
# MESON MHU mailbox Support
@@ -1068,7 +1106,7 @@ CONFIG_AML_RDMA=y
#
# Amlogic temperature sensor
#
-# CONFIG_AML_TEMP_SENSOR is not set
+CONFIG_AML_TEMP_SENSOR=y
CONFIG_AUDIO_DATA=y
# CONFIG_INSTABOOT is not set
@@ -1078,8 +1116,29 @@ CONFIG_AUDIO_DATA=y
# CONFIG_VIDEO_AMLOGIC_CAPTURE is not set
CONFIG_AML_CODEC_MM=y
# CONFIG_AML_WDT is not set
-CONFIG_MESON_PWM=y
-CONFIG_MESON_PWM_CTRL=y
+
+#
+# AMLOGIC SPI Hardware bus support
+#
+# CONFIG_AMLOGIC_SPICC_MASTER is not set
+# CONFIG_AMLOGIC_JTAG is not set
+CONFIG_AMLOGIC_CPU_INFO=y
+
+#
+# defend img file update support
+#
+# CONFIG_DEFEND_IMG is not set
+
+#
+# AO CEC Support
+#
+CONFIG_AML_AO_CEC=y
+
+#
+# Amlogic Crypto Support
+#
+# CONFIG_CRYPTO_AML is not set
+# CONFIG_AMLOGIC_WATCHPOINT is not set
#
# Generic Driver Options
@@ -1214,7 +1273,8 @@ CONFIG_OF=y
#
# Device Tree and Open Firmware support
#
-# CONFIG_OF_UNITTEST is not set
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_OF_SELFTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
@@ -1403,6 +1463,7 @@ CONFIG_NET_VENDOR_WIZNET=y
#
# MII PHY device drivers
#
+# CONFIG_AMLOGIC_PHY is not set
# CONFIG_AT803X_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set
@@ -1548,13 +1609,12 @@ CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
+# CONFIG_RTL_CARDS is not set
# CONFIG_WL_TI is not set
CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set
# CONFIG_MWIFIEX is not set
# CONFIG_CW1200 is not set
-# CONFIG_RTL8821AU is not set
-# CONFIG_RTL8192CU is not set
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -1657,8 +1717,7 @@ CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
@@ -1687,6 +1746,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_SERIAL_ARC is not set
# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SUPPORT_SYSRQ is not set
CONFIG_TTY_PRINTK=y
# CONFIG_IPMI_HANDLER is not set
CONFIG_HW_RANDOM=y
@@ -2196,7 +2256,6 @@ CONFIG_IR_IGUANA=m
CONFIG_IR_TTUSBIR=m
# CONFIG_RC_LOOPBACK is not set
CONFIG_IR_GPIO_CIR=m
-CONFIG_IR_GPIOPLUG_CIR=m
CONFIG_MEDIA_USB_SUPPORT=y
#
@@ -2591,21 +2650,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=m
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_LOGO is not set
# CONFIG_FB_SSD1307 is not set
-CONFIG_MALI400=y
-CONFIG_MALI450=y
-# CONFIG_MALI470 is not set
-# CONFIG_MALI400_DEBUG is not set
-# CONFIG_MALI400_PROFILING is not set
-CONFIG_MALI400_UMP=y
-# CONFIG_MALI_DVFS is not set
-CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
-# CONFIG_MALI_SHARED_INTERRUPTS is not set
-# CONFIG_MALI_PMU_PARALLEL_POWER_UP is not set
-CONFIG_MALI_DT=y
-# CONFIG_MALI_QUIET is not set
-CONFIG_UMP=y
-# CONFIG_UMP_DEBUG is not set
-# CONFIG_FB_TFT is not set
CONFIG_SOUND=y
# CONFIG_SOUND_OSS_CORE is not set
CONFIG_SND=y
@@ -2649,10 +2693,16 @@ CONFIG_SND_SOC=y
# CONFIG_SND_DESIGNWARE_I2S is not set
CONFIG_SND_AML_M8_SOC=y
CONFIG_SND_AML_M8=y
-# CONFIG_SND_AML_G9TV is not set
+CONFIG_SND_AML_SPLIT_MODE=y
+# CONFIG_SND_AML_SPLIT_MODE_MMAP is not set
CONFIG_SND_SOC_I2C_AND_SPI=y
CONFIG_SND_SOC_DUMMY_CODEC=y
+CONFIG_SND_SOC_TAS5707=y
+CONFIG_SND_SOC_TAS5717=y
+CONFIG_SND_SOC_TAS5731=y
CONFIG_SND_SOC_PCM2BT=y
+CONFIG_SND_SOC_AMLT9015=y
+CONFIG_SND_SOC_AMLT9015S=y
# CONFIG_SND_SIMPLE_CARD is not set
# CONFIG_SOUND_PRIME is not set
@@ -2676,6 +2726,7 @@ CONFIG_HID_AUREAL=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
CONFIG_HID_CHICONY=y
+# CONFIG_HID_DIA_REMOTE is not set
# CONFIG_HID_PRODIKEYS is not set
CONFIG_HID_CYPRESS=y
CONFIG_HID_DRAGONRISE=m
@@ -2931,6 +2982,9 @@ CONFIG_USB_PHY=y
CONFIG_USB_ISP1301=y
# CONFIG_USB_RCAR_PHY is not set
CONFIG_USB_ULPI=y
+# CONFIG_AMLOGIC_USBPHY is not set
+# CONFIG_AMLOGIC_USB2PHY is not set
+# CONFIG_AMLOGIC_USB3PHY is not set
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
@@ -3181,14 +3235,11 @@ CONFIG_DVB_AS102=m
# Android
#
CONFIG_ANDROID=y
-CONFIG_ANDROID_BINDER_IPC=y
-# CONFIG_ANDROID_BINDER_IPC_32BIT is not set
-CONFIG_ASHMEM=y
-CONFIG_ANDROID_LOGGER=y
-CONFIG_ANDROID_TIMED_OUTPUT=y
-# CONFIG_ANDROID_TIMED_GPIO is not set
-CONFIG_ANDROID_LOW_MEMORY_KILLER=y
-CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y
+# CONFIG_ANDROID_BINDER_IPC is not set
+# CONFIG_ASHMEM is not set
+# CONFIG_ANDROID_LOGGER is not set
+# CONFIG_ANDROID_TIMED_OUTPUT is not set
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
# CONFIG_ANDROID_INTF_ALARM_DEV is not set
CONFIG_SYNC=y
CONFIG_SW_SYNC=y
@@ -3262,11 +3313,7 @@ CONFIG_RESET_CONTROLLER=y
# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set
# CONFIG_PHY_EXYNOS_DP_VIDEO is not set
# CONFIG_POWERCAP is not set
-
-#
-# Firmware Drivers
-#
-# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_CORESIGHT is not set
#
# File systems
@@ -3311,7 +3358,6 @@ CONFIG_QUOTACTL=y
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
# CONFIG_CUSE is not set
-# CONFIG_OVERLAY_FS is not set
#
# Caches
@@ -3335,6 +3381,7 @@ CONFIG_FAT_FS=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
+# CONFIG_EXFAT_FS is not set
# CONFIG_NTFS_FS is not set
#
@@ -3391,7 +3438,6 @@ CONFIG_F2FS_FS=y
CONFIG_F2FS_STAT_FS=y
# CONFIG_F2FS_FS_XATTR is not set
# CONFIG_F2FS_CHECK_FS is not set
-# CONFIG_AUFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
@@ -3501,7 +3547,7 @@ CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_REDUCED is not set
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
+CONFIG_FRAME_WARN=2048
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
@@ -3629,6 +3675,7 @@ CONFIG_FTRACE_MCOUNT_RECORD=y
# CONFIG_DMA_API_DEBUG is not set
# CONFIG_TEST_MODULE is not set
# CONFIG_TEST_USER_COPY is not set
+# CONFIG_CHECK_ISR_TIME is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
diff --git a/projects/Odroid_C2/options b/projects/Odroid_C2/options
index 9edaf70d71..010da61e85 100644
--- a/projects/Odroid_C2/options
+++ b/projects/Odroid_C2/options
@@ -45,7 +45,7 @@
# Kernel to use. values can be:
# default: default mainline kernel
- LINUX="hardkernel"
+ LINUX="amlogic-3.14"
################################################################################
# setup build defaults
@@ -97,7 +97,7 @@
# for a list of additinoal drivers see packages/linux-drivers
# Space separated list is supported,
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
- ADDITIONAL_DRIVERS="RTL8192CU RTL8192DU RTL8188EU RTL8192EU RTL8812AU"
+ ADDITIONAL_DRIVERS="gpu-aml RTL8192CU RTL8192DU RTL8188EU RTL8192EU RTL8812AU"
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
# Space separated list is supported,
@@ -113,9 +113,6 @@
# Amlogic IR remote support (yes / no)
AMREMOTE_SUPPORT="no"
- # Odroid IR remote support (yes / no)
- ODROIDREMOTE_SUPPORT="yes"
-
# build with swap support (yes / no)
SWAP_SUPPORT="no"
diff --git a/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch b/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch
deleted file mode 100644
index a3443c2e10..0000000000
--- a/projects/Odroid_C2/patches/eventlircd/eventlircd-0001-without-werror.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur a/configure.ac b/configure.ac
---- a/configure.ac 2016-02-10 07:28:43.854521022 +0100
-+++ b/configure.ac 2016-02-10 07:42:40.195015151 +0100
-@@ -126,7 +126,6 @@
- AX_C_CHECK_FLAG([-pedantic],[],[],[CFLAGS="$CFLAGS -pedantic"],[])
- AX_C_CHECK_FLAG([-flto],[],[],[CFLAGS="$CFLAGS -flto"],[])
- AX_C_CHECK_FLAG([-fvisibility=hidden],[],[],[CFLAGS="$CFLAGS -fvisibility=hidden"],[])
--AX_C_CHECK_FLAG([-Werror],[],[],[CFLAGS="$CFLAGS -Werror"],[])
- AX_C_CHECK_FLAG([-Wall],[],[],[CFLAGS="$CFLAGS -Wall"],[])
- AX_C_CHECK_FLAG([-Wextra],[],[],[CFLAGS="$CFLAGS -Wextra"],[])
- AX_C_CHECK_FLAG([-Wcast-qual],[],[],[CFLAGS="$CFLAGS -Wcast-qual"],[])
diff --git a/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch b/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch
deleted file mode 100644
index b7812f7a02..0000000000
--- a/projects/Odroid_C2/patches/kodi/kodi-0001-enable-OMX_PTS64.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From be8eb87a89b6d074c16b6d4d138bfe0ff16aa663 Mon Sep 17 00:00:00 2001
-From: Markus Pfau
-Date: Wed, 24 Aug 2016 19:16:24 +0200
-Subject: [PATCH] OMX_PTS type decision by sizeof(long)
-
----
- xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-index ca8e964..e384711 100644
---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-@@ -1895,7 +1895,7 @@ int CAMLCodec::DequeueBuffer(int64_t &pts)
- // Since kernel 3.14 Amlogic changed length and units of PTS values reported here.
- // To differentiate such PTS values we check for existence of omx_pts_interval_lower
- // parameter, because it was introduced since kernel 3.14.
-- if (access("/sys/module/amvideo/parameters/omx_pts_interval_lower", F_OK) != -1)
-+ if (1)
- {
- pts = vbuf.timestamp.tv_sec & 0xFFFFFFFF;
- pts <<= 32;
---
-1.9.1
-
diff --git a/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch b/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch
deleted file mode 100644
index db7bfa0b45..0000000000
--- a/projects/Odroid_C2/patches/kodi/kodi-0001-owersun-odroid.patch
+++ /dev/null
@@ -1,730 +0,0 @@
-From 99f9fb9e1df7f6877bbce3cf90ebf24cacea1797 Mon Sep 17 00:00:00 2001
-From: Markus Pfau
-Date: Tue, 23 Aug 2016 00:06:43 +0200
-Subject: [PATCH] oversun-changes
-
----
- xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 39 ++++++---
- .../cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 13 +--
- xbmc/utils/AMLUtils.cpp | 93 ++++++++++++++++++--
- xbmc/utils/CPUInfo.cpp | 25 +++---
- xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 98 ++++++++++++++++------
- xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 19 ++++-
- 6 files changed, 221 insertions(+), 66 deletions(-)
-
-diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-index 4bb159f..ea2db01 100644
---- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-@@ -490,6 +490,7 @@ snd_pcm_chmap_t* CAESinkALSA::SelectALSAChannelMap(const CAEChannelInfo& info)
-
- void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params)
- {
-+#if !defined(HAS_LIBAMCODEC)
- if (m_passthrough)
- params = "AES0=0x06";
- else
-@@ -506,6 +507,7 @@ void CAESinkALSA::GetAESParams(const AEAudioFormat& format, std::string& params)
- else if (format.m_sampleRate == 44100) params += ",AES3=0x00";
- else if (format.m_sampleRate == 32000) params += ",AES3=0x03";
- else params += ",AES3=0x01";
-+#endif
- }
-
- bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device)
-@@ -744,16 +746,16 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
- snd_pcm_hw_params_get_buffer_size_max(hw_params, &bufferSize);
- snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL);
-
-- /*
-- We want to make sure, that we have max 200 ms Buffer with
-+ /*
-+ We want to make sure, that we have max 200 ms Buffer with
- a periodSize of approx 50 ms. Choosing a higher bufferSize
- will cause problems with menu sounds. Buffer will be increased
- after those are fixed.
- */
- periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20);
- bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) sampleRate / 5);
--
-- /*
-+
-+ /*
- According to upstream we should set buffer size first - so make sure it is always at least
- 4x period size to not get underruns (some systems seem to have issues with only 2 periods)
- */
-@@ -772,7 +774,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
- snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
- CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: Failed to limit periodSize to %lu", periodSizeMax);
- }
--
-+
- // first trying bufferSize, PeriodSize
- // for more info see here:
- // http://mailman.alsa-project.org/pipermail/alsa-devel/2009-September/021069.html
-@@ -782,22 +784,24 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
- snd_pcm_uframes_t periodSizeTemp, bufferSizeTemp;
- periodSizeTemp = periodSize;
- bufferSizeTemp = bufferSize;
-- if (snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
-- || snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
-+ int dir = 0;
-+
-+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
-+ || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
- || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
- {
- bufferSize = bufferSizeTemp;
- periodSize = periodSizeTemp;
- // retry with PeriodSize, bufferSize
- snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
-- if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
-+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
- || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
- || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
- {
- // try only periodSize
- periodSize = periodSizeTemp;
- snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
-- if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
-+ if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, &dir) != 0
- || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
- {
- // try only BufferSize
-@@ -819,7 +823,7 @@ bool CAESinkALSA::InitializeHW(const ALSAConfig &inconfig, ALSAConfig &outconfig
- snd_pcm_get_params(m_pcm, &bufferSize, &periodSize);
- }
- }
--
-+
- CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Got: periodSize %lu, bufferSize %lu", periodSize, bufferSize);
-
- /* set the format parameters */
-@@ -1302,6 +1306,15 @@ void CAESinkALSA::EnumerateDevicesEx(AEDeviceInfoList &list, bool force)
-
- AEDeviceType CAESinkALSA::AEDeviceTypeFromName(const std::string &name)
- {
-+
-+#if defined(HAS_LIBAMCODEC)
-+ // ugly workaround to show DTS / AC3 caps
-+ // but don't run into multi channel issues
-+ // as we can only open 2 pcm channels
-+ // God, forgive me I wrote this
-+ return AE_DEVTYPE_IEC958;
-+#endif
-+
- if (name.substr(0, 4) == "hdmi")
- return AE_DEVTYPE_HDMI;
- else if (name.substr(0, 6) == "iec958" || name.substr(0, 5) == "spdif")
-@@ -1406,9 +1419,9 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev
-
- if (badHDMI)
- {
-- /*
-- * Warn about disconnected devices, but keep them enabled
-- * Detection can go wrong on Intel, Nvidia and on all
-+ /*
-+ * Warn about disconnected devices, but keep them enabled
-+ * Detection can go wrong on Intel, Nvidia and on all
- * AMD (fglrx) hardware, so it is not safe to close those
- * handles
- */
-diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-index 5dadf82..ca8e964 100644
---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
-@@ -398,7 +398,7 @@ void dumpfile_write(am_private_t *para, void* buf, int bufsiz)
- }
-
- if (para->dumpdemux && para->dumpfile != -1)
-- write(para->dumpfile, buf, bufsiz);
-+ int ret = write(para->dumpfile, buf, bufsiz);
- }
-
- static vformat_t codecid_to_vformat(enum AVCodecID id)
-@@ -713,7 +713,7 @@ int write_av_packet(am_private_t *para, am_packet_t *pkt)
- }
- pkt->newflag = 0;
- }
--
-+
- buf = pkt->data;
- size = pkt->data_size ;
- if (size == 0 && pkt->isvalid) {
-@@ -1563,7 +1563,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
- // h264 in an avi file
- if (m_hints.ptsinvalid)
- am_private->gcodec.param = (void*)(EXTERNAL_PTS | SYNC_OUTSIDE);
-- break;
-+ break;
- case VFORMAT_REAL:
- am_private->stream_type = AM_STREAM_RM;
- am_private->vcodec.noblock = 1;
-@@ -1628,7 +1628,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
-
- Create();
-
-- m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iHeight);
-+ m_display_rect = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight);
-
- std::string strScaler;
- SysfsUtils::GetString("/sys/class/ppmgr/ppscaler", strScaler);
-@@ -2154,7 +2154,6 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
- int diff = (int) ((dst_rect.Height() - dst_rect.Width()) / 2);
- dst_rect = CRect(DestRect.x1 - diff, DestRect.y1, DestRect.x2 + diff, DestRect.y2);
- }
--
- }
-
- if (m_dst_rect != dst_rect)
-@@ -2176,7 +2175,7 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
- #ifdef TARGET_ANDROID
- display = m_display_rect;
- #else
-- display = gui;
-+ display = CRect(0, 0, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenWidth, CDisplaySettings::GetInstance().GetCurrentResolutionInfo().iScreenHeight);;
- #endif
- if (gui != display)
- {
-@@ -2248,6 +2247,8 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
- std::string s_gui = StringUtils::Format("%i,%i,%i,%i",
- (int)gui.x1, (int)gui.y1,
- (int)gui.Width(), (int)gui.Height());
-+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:SrcRect(%i,%i,%i,%i)", (int)SrcRect.x1, (int)SrcRect.y1, (int)SrcRect.Width(), (int)SrcRect.Height());
-+ CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:DestRect(%i,%i,%i,%i)", (int)DestRect.x1, (int)DestRect.y1, (int)DestRect.Width(), (int)DestRect.Height());
- CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:display(%s)", s_display.c_str());
- CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:gui(%s)", s_gui.c_str());
- CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_dst_rect(%s)", s_m_dst_rect.c_str());
-diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
-index 80fb453..0f0fef0 100644
---- a/xbmc/utils/AMLUtils.cpp
-+++ b/xbmc/utils/AMLUtils.cpp
-@@ -78,7 +78,7 @@ bool aml_wired_present()
- }
-
- bool aml_permissions()
--{
-+{
- if (!aml_present())
- return false;
-
-@@ -209,7 +209,8 @@ bool aml_support_h264_4k2k()
-
- void aml_set_audio_passthrough(bool passthrough)
- {
-- SysfsUtils::SetInt("/sys/class/audiodsp/digital_raw", passthrough ? 2:0);
-+ CLog::Log(LOGDEBUG, "AML: Setting passthrough %d", passthrough);
-+ SysfsUtils::SetString("/sys/class/audiodsp/digital_raw", passthrough ? "2":"0");
- }
-
- void aml_probe_hdmi_audio()
-@@ -227,7 +228,7 @@ void aml_probe_hdmi_audio()
- {
- char valstr[1024] = {0};
-
-- read(fd, valstr, sizeof(valstr) - 1);
-+ int tmp = read(fd, valstr, sizeof(valstr) - 1);
- valstr[strlen(valstr)] = '\0';
- close(fd);
-
-@@ -362,6 +363,60 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
- res->fRefreshRate = 50;
- res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
- }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p23hz")) // fake
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 23.98;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p24hz")) // fake
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 24;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p25hz")) // fake
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 25;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p29hz")) // fake
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 29.97;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p30hz")) // fake
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 30;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "720p59hz")) // real
-+ {
-+ res->iWidth = 1280;
-+ res->iHeight= 720;
-+ res->iScreenWidth = 1280;
-+ res->iScreenHeight= 720;
-+ res->fRefreshRate = 59.94;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
- else if (StringUtils::EqualsNoCase(fromMode, "720p") || StringUtils::EqualsNoCase(fromMode, "720p60hz"))
- {
- res->iWidth = 1280;
-@@ -407,6 +462,24 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
- res->fRefreshRate = 24;
- res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
- }
-+ else if (StringUtils::EqualsNoCase(fromMode, "1080p25hz"))
-+ {
-+ res->iWidth = 1920;
-+ res->iHeight= 1080;
-+ res->iScreenWidth = 1920;
-+ res->iScreenHeight= 1080;
-+ res->fRefreshRate = 25;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "1080p29hz")) // fake
-+ {
-+ res->iWidth = 1920;
-+ res->iHeight= 1080;
-+ res->iScreenWidth = 1920;
-+ res->iScreenHeight= 1080;
-+ res->fRefreshRate = 29.97;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
- else if (StringUtils::EqualsNoCase(fromMode, "1080p30hz"))
- {
- res->iWidth = 1920;
-@@ -515,7 +588,7 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
- res->fRefreshRate = 30;
- res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
- }
-- else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz420"))
-+ else if (StringUtils::EqualsNoCase(fromMode, "2160p50hz"))
- {
- res->iWidth = 1920;
- res->iHeight= 1080;
-@@ -524,7 +597,16 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
- res->fRefreshRate = 50;
- res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
- }
-- else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz420"))
-+ else if (StringUtils::EqualsNoCase(fromMode, "4k2k59hz") || StringUtils::EqualsNoCase(fromMode, "2160p59hz"))
-+ {
-+ res->iWidth = 1920;
-+ res->iHeight= 1080;
-+ res->iScreenWidth = 3840;
-+ res->iScreenHeight= 2160;
-+ res->fRefreshRate = 59.940;
-+ res->dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
-+ }
-+ else if (StringUtils::EqualsNoCase(fromMode, "2160p60hz"))
- {
- res->iWidth = 1920;
- res->iHeight= 1080;
-@@ -549,4 +631,3 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
-
- return res->iWidth > 0 && res->iHeight> 0;
- }
--
-diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
-index 6377d35..b50b288 100644
---- a/xbmc/utils/CPUInfo.cpp
-+++ b/xbmc/utils/CPUInfo.cpp
-@@ -120,7 +120,7 @@ CCPUInfo::CCPUInfo(void)
-
- size_t len = 4;
- std::string cpuVendor;
--
-+
- // The number of cores.
- if (sysctlbyname("hw.activecpu", &m_cpuCount, &len, NULL, 0) == -1)
- m_cpuCount = 1;
-@@ -141,7 +141,7 @@ CCPUInfo::CCPUInfo(void)
- len = 512;
- if (sysctlbyname("machdep.cpu.vendor", &buffer, &len, NULL, 0) == 0)
- cpuVendor = buffer;
--
-+
- #endif
- // Go through each core.
- for (int i=0; isecond.m_fSpeed);
- else
-@@ -597,7 +597,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
- {
- int value = 0;
- char scale = 0;
--
-+
- #ifdef TARGET_POSIX
- #if defined(TARGET_DARWIN_OSX)
- value = SMCGetTemperature(SMC_KEY_CPU_TEMP);
-@@ -626,23 +626,24 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
- // procfs is deprecated in the linux kernel, we should move away from
- // using it for temperature data. It doesn't seem that sysfs has a
- // general enough interface to bother implementing ATM.
--
-+
- rewind(m_fProcTemperature);
- fflush(m_fProcTemperature);
- ret = fscanf(m_fProcTemperature, "temperature: %d %c", &value, &scale);
--
-+
- // read from the temperature file of the new kernels
- if (!ret)
- {
- ret = fscanf(m_fProcTemperature, "%d", &value);
-- value = value / 1000;
-+ if ((int)value > 1000)
-+ value = value / 1000;
- scale = 'c';
- ret++;
- }
- }
-
- if (ret != 2)
-- return false;
-+ return false;
- #endif
- #endif // TARGET_POSIX
-
-@@ -652,7 +653,7 @@ bool CCPUInfo::getTemperature(CTemperature& temperature)
- temperature = CTemperature::CreateFromFahrenheit(value);
- else
- return false;
--
-+
- return true;
- }
-
-@@ -707,7 +708,7 @@ bool CCPUInfo::readProcStat(unsigned long long& user, unsigned long long& nice,
- const LONGLONG deltaTotal = coreTotal - curCore.m_total,
- deltaIdle = coreIdle - curCore.m_idle;
- const double load = (double(deltaTotal - deltaIdle) * 100.0) / double(deltaTotal);
--
-+
- // win32 has some problems with calculation of load if load close to zero
- curCore.m_fPct = (load < 0) ? 0 : load;
- if (load >= 0 || deltaTotal > 5 * 10 * 1000 * 1000) // do not update (smooth) values for 5 seconds on negative loads
-diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
-index 88cd385..cc62734 100644
---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
-+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
-@@ -23,13 +23,18 @@
- #include "utils/AMLUtils.h"
- #include "utils/StringUtils.h"
- #include "utils/SysfsUtils.h"
-+#include "utils/log.h"
-
--#include
- #include
- #include
- #include
- #include
-
-+#ifdef CLASSNAME
-+#undef CLASSNAME
-+#endif
-+#define CLASSNAME "CEGLNativeTypeAmlogic"
-+
- CEGLNativeTypeAmlogic::CEGLNativeTypeAmlogic()
- {
- const char *env_framebuffer = getenv("FRAMEBUFFER");
-@@ -53,9 +58,12 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility()
- {
- std::string name;
- std::string modalias = "/sys/class/graphics/" + m_framebuffer_name + "/device/modalias";
-+ std::string meson = "meson";
-+ std::string fb = "fb";
-
- SysfsUtils::GetString(modalias, name);
-- if (name.find("meson") != std::string::npos)
-+ StringUtils::Trim(name);
-+ if (name.find(meson) != std::string::npos && name.find(fb) != std::string::npos)
- return true;
- return false;
- }
-@@ -63,28 +71,37 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility()
- void CEGLNativeTypeAmlogic::Initialize()
- {
- aml_permissions();
-- DisableFreeScale();
-+ FreeScale(false);
- }
-+
- void CEGLNativeTypeAmlogic::Destroy()
- {
-+ SetScreenScale(1, 1, false);
- return;
- }
-
- bool CEGLNativeTypeAmlogic::CreateNativeDisplay()
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- m_nativeDisplay = EGL_DEFAULT_DISPLAY;
- return true;
- }
-
- bool CEGLNativeTypeAmlogic::CreateNativeWindow()
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- #if defined(_FBDEV_WINDOW_H_)
- fbdev_window *nativeWindow = new fbdev_window;
- if (!nativeWindow)
- return false;
-
-- nativeWindow->width = 1920;
-- nativeWindow->height = 1080;
-+ RESOLUTION_INFO res;
-+ GetPreferredResolution(&res);
-+
-+ nativeWindow->width = res.iWidth;
-+ nativeWindow->height = res.iHeight;
- m_nativeWindow = nativeWindow;
-
- SetFramebufferResolution(nativeWindow->width, nativeWindow->height);
-@@ -97,6 +114,8 @@ bool CEGLNativeTypeAmlogic::CreateNativeWindow()
-
- bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay) const
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- if (!nativeDisplay)
- return false;
- *nativeDisplay = (XBNativeDisplayType*) &m_nativeDisplay;
-@@ -105,6 +124,8 @@ bool CEGLNativeTypeAmlogic::GetNativeDisplay(XBNativeDisplayType **nativeDisplay
-
- bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) const
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- if (!nativeWindow)
- return false;
- *nativeWindow = (XBNativeWindowType*) &m_nativeWindow;
-@@ -113,11 +134,15 @@ bool CEGLNativeTypeAmlogic::GetNativeWindow(XBNativeWindowType **nativeWindow) c
-
- bool CEGLNativeTypeAmlogic::DestroyNativeDisplay()
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- return true;
- }
-
- bool CEGLNativeTypeAmlogic::DestroyNativeWindow()
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- #if defined(_FBDEV_WINDOW_H_)
- delete (fbdev_window*)m_nativeWindow, m_nativeWindow = NULL;
- #endif
-@@ -133,6 +158,8 @@ bool CEGLNativeTypeAmlogic::GetNativeResolution(RESOLUTION_INFO *res) const
-
- bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
- {
-+ CLog::Log(LOGNOTICE, "%s::%s to %dx%d@%f", CLASSNAME, __func__, res.iScreenWidth, res.iScreenHeight, res.fRefreshRate);
-+
- #if defined(_FBDEV_WINDOW_H_)
- if (m_nativeWindow)
- {
-@@ -152,6 +179,8 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
-
- bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector &resolutions)
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- std::string valstr;
- SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", valstr);
- std::vector probe_str = StringUtils::Split(valstr, "\n");
-@@ -164,11 +193,12 @@ bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector &resol
- resolutions.push_back(res);
- }
- return resolutions.size() > 0;
--
- }
-
- bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- // check display/mode, it gets defaulted at boot
- if (!GetNativeResolution(res))
- {
-@@ -181,6 +211,8 @@ bool CEGLNativeTypeAmlogic::GetPreferredResolution(RESOLUTION_INFO *res) const
-
- bool CEGLNativeTypeAmlogic::ShowWindow(bool show)
- {
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
- std::string blank_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/blank";
- SysfsUtils::SetInt(blank_framebuffer.c_str(), show ? 0 : 1);
- return true;
-@@ -188,6 +220,8 @@ bool CEGLNativeTypeAmlogic::ShowWindow(bool show)
-
- bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution)
- {
-+ CLog::Log(LOGNOTICE, "%s::%s to %s", CLASSNAME, __func__, resolution);
-+
- std::string mode = resolution;
- // switch display resolution
- SysfsUtils::SetString("/sys/class/display/mode", mode.c_str());
-@@ -195,36 +229,46 @@ bool CEGLNativeTypeAmlogic::SetDisplayResolution(const char *resolution)
- RESOLUTION_INFO res;
- aml_mode_to_resolution(mode.c_str(), &res);
- SetFramebufferResolution(res);
-+ DealWithScale(res);
-
- return true;
- }
-
--void CEGLNativeTypeAmlogic::SetupVideoScaling(const char *mode)
-+void CEGLNativeTypeAmlogic::FreeScale(bool state)
- {
-- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 1);
-- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0);
-- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0);
-- SysfsUtils::SetInt("/sys/class/ppmgr/ppscaler", 0);
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-
-- if (strstr(mode, "1080"))
-- {
-- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "8");
-- SysfsUtils::SetString("/sys/class/graphics/fb1/scale_axis", "1280 720 1920 1080");
-- SysfsUtils::SetString("/sys/class/graphics/fb1/scale", "0x10001");
-- }
-- else
-- {
-- SysfsUtils::SetString("/sys/class/graphics/fb0/request2XScale", "16 1280 720");
-+ std::string freescale_framebuffer = "/sys/class/graphics/" + m_framebuffer_name + "/free_scale";
-+ SysfsUtils::SetInt(freescale_framebuffer.c_str(), state ? 1 : 0);
-+}
-+
-+void CEGLNativeTypeAmlogic::DealWithScale(const RESOLUTION_INFO &res)
-+{
-+ CLog::Log(LOGDEBUG, "%s::%s Interface is %dx%d, screen size is %dx%d", CLASSNAME, __func__, res.iWidth, res.iHeight, res.iScreenWidth, res.iScreenHeight);
-+
-+ if (res.iScreenWidth > res.iWidth && res.iScreenHeight > res.iHeight) {
-+ CLog::Log(LOGNOTICE, "%s::%s Scaling interfaces of size %dx%d to full screen", CLASSNAME, __func__, res.iWidth, res.iHeight);
-+ SetScreenScale(res.iWidth, res.iHeight, true);
- }
-+}
-
-- SysfsUtils::SetInt("/sys/class/graphics/fb0/blank", 0);
-+void CEGLNativeTypeAmlogic::SetScreenScale(int width, int height, bool state)
-+{
-+ char setting[256] = {};
-+ sprintf(setting, "0 0 %d %d", width - 1 , height - 1);
-+ std::string framebuffer = "/sys/class/graphics/" + m_framebuffer_name;
-+ SysfsUtils::SetString(framebuffer + "/scale_axis", setting);
-+ SysfsUtils::SetString(framebuffer + "/scale", state ? "0x10001" : "0x0");
- }
-
--void CEGLNativeTypeAmlogic::DisableFreeScale()
-+bool CEGLNativeTypeAmlogic::IsHdmiConnected() const
- {
-- // turn off frame buffer freescale
-- SysfsUtils::SetInt("/sys/class/graphics/fb0/free_scale", 0);
-- SysfsUtils::SetInt("/sys/class/graphics/fb1/free_scale", 0);
-+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-+
-+ std::string hpd_state;
-+ SysfsUtils::GetString("/sys/class/amhdmitx/amhdmitx0/disp_cap", hpd_state);
-+ StringUtils::Trim(hpd_state);
-+ return hpd_state == "1";
- }
-
- void CEGLNativeTypeAmlogic::SetFramebufferResolution(const RESOLUTION_INFO &res) const
-@@ -244,8 +288,8 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons
- {
- vinfo.xres = width;
- vinfo.yres = height;
-- vinfo.xres_virtual = 1920;
-- vinfo.yres_virtual = 2160;
-+ vinfo.xres_virtual = width;
-+ vinfo.yres_virtual = height * 2;
- vinfo.bits_per_pixel = 32;
- vinfo.activate = FB_ACTIVATE_ALL;
- ioctl(fd0, FBIOPUT_VSCREENINFO, &vinfo);
-diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
-index cfb33ca..bdb08b6 100644
---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
-+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
-@@ -24,6 +24,19 @@
- #include
-
- #include "EGLNativeType.h"
-+#include
-+
-+#ifndef _FBDEV_WINDOW_H_
-+// Define it right here, since some platforms doesn't has fbdev_window.h at all.
-+// This will not make it fail on these platforms badly, since it will fail softly anyway on some other init steps.
-+#define _FBDEV_WINDOW_H_
-+typedef struct fbdev_window
-+{
-+ unsigned short width;
-+ unsigned short height;
-+} fbdev_window;
-+#endif
-+
- class CEGLNativeTypeAmlogic : public CEGLNativeType
- {
- public:
-@@ -52,12 +65,14 @@ public:
-
- protected:
- bool SetDisplayResolution(const char *resolution);
-- void SetupVideoScaling(const char *mode);
-- void DisableFreeScale();
-
- private:
- void SetFramebufferResolution(const RESOLUTION_INFO &res) const;
- void SetFramebufferResolution(int width, int height) const;
-+ void FreeScale(bool state);
-+ void DealWithScale(const RESOLUTION_INFO &res);
-+ void SetScreenScale(int width, int height, bool state);
-+ bool IsHdmiConnected() const;
-
- std::string m_framebuffer_name;
- };
---
-1.9.1
-
diff --git a/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch b/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch
deleted file mode 100644
index 9169cacad5..0000000000
--- a/projects/Odroid_C2/patches/kodi/kodi-0004-Multichannel-PCM-and-HD-Audio-passthrough.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From a49dd2258d46279466d5aaba44d1f0ee06253ff2 Mon Sep 17 00:00:00 2001
-From: kszaq
-Date: Sun, 4 Sep 2016 00:51:03 +0200
-Subject: [PATCH] [aml] Multichannel-PCM and HD Audio passthrough
-
-1. If we want passthrough, is should be redirected to device 1. To make sure device 1 output is enabled, set device 0 to stereo.
-2. Set digital_codec parameter to notify sound driver about audio format.
-3. Amlogic wants 48kHz for EAC3 passthrough.
-4. Identify Amlogic audio output as HDMI.
----
- xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 59 +++++++++++++++++++++++++++--
- 1 file changed, 55 insertions(+), 4 deletions(-)
-
-diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-index 6a9066b..9741e3e 100644
---- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
-@@ -38,6 +38,7 @@
- #include "settings/AdvancedSettings.h"
- #if defined(HAS_LIBAMCODEC)
- #include "utils/AMLUtils.h"
-+#include "utils/SysfsUtils.h"
- #endif
-
- #ifdef TARGET_POSIX
-@@ -534,13 +535,57 @@ bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device)
- {
- m_passthrough = false;
- }
--#if defined(HAS_LIBAMCODEC)
-- if (aml_present())
-+
-+ if (device.find("M8AUDIO") != std::string::npos)
- {
-+ int aml_digital_codec = 0;
-+
-+ if (m_passthrough)
-+ {
-+ /* Open 2 channels at device 0 to enable device 1 output to HDMI */
-+ ALSAConfig m_inconfig, m_outconfig;
-+ snd_config_t *config;
-+ m_inconfig = inconfig;
-+ m_inconfig.channels = 2;
-+ snd_config_copy(&config, snd_config);
-+ OpenPCMDevice("hw:AMLM8AUDIO,0", "", m_inconfig.channels, &m_pcm, config);
-+ snd_config_delete(config);
-+ InitializeHW(m_inconfig, m_outconfig);
-+
-+ /* Passthrough is supported only by device 1 */
-+ device = "hw:AMLM8AUDIO,1";
-+
-+ switch(format.m_streamInfo.m_type)
-+ {
-+ case CAEStreamInfo::STREAM_TYPE_AC3:
-+ aml_digital_codec = 2;
-+ break;
-+
-+ case CAEStreamInfo::STREAM_TYPE_DTS_512:
-+ case CAEStreamInfo::STREAM_TYPE_DTS_1024:
-+ case CAEStreamInfo::STREAM_TYPE_DTS_2048:
-+ case CAEStreamInfo::STREAM_TYPE_DTSHD_CORE:
-+ aml_digital_codec = 3;
-+ break;
-+
-+ case CAEStreamInfo::STREAM_TYPE_EAC3:
-+ aml_digital_codec = 4;
-+ inconfig.sampleRate = 48000;
-+ break;
-+
-+ case CAEStreamInfo::STREAM_TYPE_DTSHD:
-+ aml_digital_codec = 8;
-+ break;
-+
-+ case CAEStreamInfo::STREAM_TYPE_TRUEHD:
-+ aml_digital_codec = 7;
-+ break;
-+ }
-+ }
-+
- aml_set_audio_passthrough(m_passthrough);
-- device = "default";
-+ SysfsUtils::SetInt("/sys/class/audiodsp/digital_codec", aml_digital_codec);
- }
--#endif
-
- if (inconfig.channels == 0)
- {
-@@ -1550,6 +1595,12 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev
- info.m_dataFormats.push_back(i);
- }
-
-+ if (info.m_displayName.find("M8AUDIO") != std::string::npos)
-+ {
-+ info.m_displayNameExtra = "HDMI";
-+ info.m_deviceType = AE_DEVTYPE_HDMI;
-+ }
-+
- if (info.m_deviceType == AE_DEVTYPE_HDMI)
- {
- // we don't trust ELD information and push back our supported formats explicitely
---
-1.8.3.1
diff --git a/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch b/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch
deleted file mode 100644
index 00f67c5133..0000000000
--- a/projects/Odroid_C2/patches/libcec/libcec-00-aocec-support.patch
+++ /dev/null
@@ -1,803 +0,0 @@
-diff --git a/README.md b/README.md
-index dfaf4d6..87491ef 100644
---- a/README.md
-+++ b/README.md
-@@ -93,6 +93,12 @@ To compile in support for Exynos devices, you have to pass the argument -DHAVE_E
- cmake -DHAVE_EXYNOS_API=1 ..
- ```
-
-+### AOCEC
-+To compile in support for AOCEC devices, you have to pass the argument -DHAVE_AOCEC_API=1 to cmake:
-+```
-+cmake -DHAVE_AOCEC_API=1 ..
-+```
-+
- ### TDA995x
- To compile in support for TDA995x devices, you have to pass the argument -DHAVE_TDA995X_API=1 to cmake:
- ```
-diff --git a/include/cectypes.h b/include/cectypes.h
-index 0fdd48e..881a805 100644
---- a/include/cectypes.h
-+++ b/include/cectypes.h
-@@ -309,6 +309,16 @@ namespace CEC {
- #define CEC_EXYNOS_VIRTUAL_COM "Exynos"
-
- /*!
-+ * the path to use for the AOCEC HDMI CEC device
-+ */
-+#define CEC_AOCEC_PATH "/dev/cec"
-+
-+/*!
-+ * the name of the virtual COM port to use for the AOCEC' CEC wire
-+ */
-+#define CEC_AOCEC_VIRTUAL_COM "AOCEC"
-+
-+/*!
- * Mimimum client version
- */
- #define CEC_MIN_LIB_VERSION 3
-@@ -877,7 +887,8 @@ typedef enum cec_adapter_type
- ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
- ADAPTERTYPE_RPI = 0x100,
- ADAPTERTYPE_TDA995x = 0x200,
-- ADAPTERTYPE_EXYNOS = 0x300
-+ ADAPTERTYPE_EXYNOS = 0x300,
-+ ADAPTERTYPE_AOCEC = 0x500
- } cec_adapter_type;
-
- /** force exporting through swig */
-diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
-index a494533..d3eefa3 100644
---- a/src/libcec/CMakeLists.txt
-+++ b/src/libcec/CMakeLists.txt
-@@ -87,6 +87,9 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
- adapter/Exynos/ExynosCEC.h
- adapter/Exynos/ExynosCECAdapterDetection.h
- adapter/Exynos/ExynosCECAdapterCommunication.h
-+ adapter/AOCEC/AOCEC.h
-+ adapter/AOCEC/AOCECAdapterDetection.h
-+ adapter/AOCEC/AOCECAdapterCommunication.h
- adapter/Pulse-Eight/USBCECAdapterMessageQueue.h
- adapter/Pulse-Eight/USBCECAdapterCommunication.h
- adapter/Pulse-Eight/USBCECAdapterCommands.h
-diff --git a/src/libcec/adapter/AOCEC/AOCEC.h b/src/libcec/adapter/AOCEC/AOCEC.h
-new file mode 100644
-index 0000000..560fbdd
---- /dev/null
-+++ b/src/libcec/adapter/AOCEC/AOCEC.h
-@@ -0,0 +1,55 @@
-+#pragma once
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
-+ * based heavily on:
-+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
-+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * This program is dual-licensed; 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.
-+ *
-+ * This program 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 this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ * Alternatively, you can license this library under a commercial license,
-+ * please contact Pulse-Eight Licensing for more information.
-+ *
-+ * For more information contact:
-+ * Pulse-Eight Licensing
-+ * http://www.pulse-eight.com/
-+ * http://www.pulse-eight.net/
-+ */
-+
-+
-+#define CEC_DEFAULT_PADDR 0x1000
-+
-+#define CEC_IOC_MAGIC 'C'
-+#define CEC_IOC_GET_PHYSICAL_ADDR _IOR(CEC_IOC_MAGIC, 0x00, uint16_t)
-+#define CEC_IOC_GET_VERSION _IOR(CEC_IOC_MAGIC, 0x01, int)
-+#define CEC_IOC_GET_VENDOR_ID _IOR(CEC_IOC_MAGIC, 0x02, uint32_t)
-+#define CEC_IOC_GET_PORT_INFO _IOR(CEC_IOC_MAGIC, 0x03, int)
-+#define CEC_IOC_GET_PORT_NUM _IOR(CEC_IOC_MAGIC, 0x04, int)
-+#define CEC_IOC_GET_SEND_FAIL_REASON _IOR(CEC_IOC_MAGIC, 0x05, uint32_t)
-+#define CEC_IOC_SET_OPTION_WAKEUP _IOW(CEC_IOC_MAGIC, 0x06, uint32_t)
-+#define CEC_IOC_SET_OPTION_ENALBE_CEC _IOW(CEC_IOC_MAGIC, 0x07, uint32_t)
-+#define CEC_IOC_SET_OPTION_SYS_CTRL _IOW(CEC_IOC_MAGIC, 0x08, uint32_t)
-+#define CEC_IOC_SET_OPTION_SET_LANG _IOW(CEC_IOC_MAGIC, 0x09, uint32_t)
-+#define CEC_IOC_GET_CONNECT_STATUS _IOR(CEC_IOC_MAGIC, 0x0A, uint32_t)
-+#define CEC_IOC_ADD_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0B, uint32_t)
-+#define CEC_IOC_CLR_LOGICAL_ADDR _IOW(CEC_IOC_MAGIC, 0x0C, uint32_t)
-+
-+#define CEC_MAX_FRAME_SIZE 16
-diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
-new file mode 100644
-index 0000000..8edf981
---- /dev/null
-+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.cpp
-@@ -0,0 +1,343 @@
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
-+ * based heavily on:
-+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
-+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * This program is dual-licensed; 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.
-+ *
-+ * This program 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 this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ * Alternatively, you can license this library under a commercial license,
-+ * please contact Pulse-Eight Licensing for more information.
-+ *
-+ * For more information contact:
-+ * Pulse-Eight Licensing
-+ * http://www.pulse-eight.com/
-+ * http://www.pulse-eight.net/
-+ */
-+
-+#include "env.h"
-+#include
-+#include
-+
-+
-+#if defined(HAVE_AOCEC_API)
-+#include "AOCEC.h"
-+#include "AOCECAdapterCommunication.h"
-+
-+#include "CECTypeUtils.h"
-+#include "LibCEC.h"
-+#include
-+
-+using namespace CEC;
-+using namespace P8PLATFORM;
-+
-+#define LIB_CEC m_callback->GetLib()
-+
-+
-+CAOCECAdapterCommunication::CAOCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
-+ IAdapterCommunication(callback),
-+ m_bLogicalAddressChanged(false)
-+{
-+ CLockObject lock(m_mutex);
-+
-+ m_logicalAddresses.Clear();
-+ m_fd = INVALID_SOCKET_VALUE;
-+}
-+
-+
-+CAOCECAdapterCommunication::~CAOCECAdapterCommunication(void)
-+{
-+ Close();
-+}
-+
-+
-+bool CAOCECAdapterCommunication::IsOpen(void)
-+{
-+ CLockObject lock(m_mutex);
-+ return IsInitialised() && m_fd != INVALID_SOCKET_VALUE;
-+}
-+
-+
-+bool CAOCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening)
-+{
-+ if (IsOpen())
-+ Close();
-+
-+ CLockObject lock(m_mutex);
-+
-+ if ((m_fd = open(CEC_AOCEC_PATH, O_RDWR)) > 0)
-+ {
-+ uint32_t enable = true;
-+
-+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
-+ return false;
-+ }
-+
-+ if (!bStartListening || CreateThread()) {
-+ return true;
-+ }
-+ close(m_fd);
-+ m_fd = INVALID_SOCKET_VALUE;
-+ }
-+ return false;
-+}
-+
-+
-+void CAOCECAdapterCommunication::Close(void)
-+{
-+ StopThread(0);
-+
-+ CLockObject lock(m_mutex);
-+
-+ uint32_t enable = false;
-+
-+ if (ioctl(m_fd, CEC_IOC_SET_OPTION_SYS_CTRL, enable))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_SET_OPTION_SYS_CTRL failed !", __func__);
-+ }
-+
-+ close(m_fd);
-+ m_fd = INVALID_SOCKET_VALUE;
-+}
-+
-+
-+std::string CAOCECAdapterCommunication::GetError(void) const
-+{
-+ std::string strError(m_strError);
-+ return strError;
-+}
-+
-+int CAOCECAdapterCommunication::getFileDescriptor(void)
-+{
-+ CLockObject lock(m_mutex);
-+
-+ return m_fd;
-+}
-+
-+
-+
-+cec_adapter_message_state CAOCECAdapterCommunication::Write(
-+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
-+{
-+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
-+ int32_t size = 1;
-+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR;
-+
-+ if (!IsOpen())
-+ return rc;
-+
-+ CLockObject lock(m_mutex);
-+
-+ if ((size_t)data.parameters.size + data.opcode_set > sizeof(buffer))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__);
-+ return ADAPTER_MESSAGE_STATE_ERROR;
-+ }
-+
-+ buffer[0] = (data.initiator << 4) | (data.destination & 0x0f);
-+
-+ if (data.opcode_set)
-+ {
-+ buffer[1] = data.opcode;
-+ size++;
-+
-+ memcpy(&buffer[size], data.parameters.data, data.parameters.size);
-+ size += data.parameters.size;
-+ }
-+
-+ if (write(m_fd, (void *)buffer, size) == size)
-+ {
-+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED;
-+ }
-+ else
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: write failed !", __func__);
-+ }
-+
-+ return rc;
-+}
-+
-+
-+uint16_t CAOCECAdapterCommunication::GetFirmwareVersion(void)
-+{
-+ int version = 0;
-+
-+ if (!IsOpen())
-+ return version;
-+
-+ CLockObject lock(m_mutex);
-+
-+ if (ioctl(m_fd, CEC_IOC_GET_VERSION, &version) < 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VERSION failed !", __func__);
-+ }
-+ return (uint16_t)version;
-+}
-+
-+
-+cec_vendor_id CAOCECAdapterCommunication::GetVendorId(void)
-+{
-+ int vendor_id = CEC_VENDOR_UNKNOWN;
-+
-+ if (!IsOpen())
-+ return cec_vendor_id(vendor_id);
-+
-+ CLockObject lock(m_mutex);
-+
-+ if (ioctl(m_fd, CEC_IOC_GET_VENDOR_ID, &vendor_id) < 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_VENDOR_ID failed !", __func__);
-+ }
-+ return cec_vendor_id(vendor_id);
-+}
-+
-+
-+uint16_t CAOCECAdapterCommunication::GetPhysicalAddress(void)
-+{
-+ int phys_addr = CEC_DEFAULT_PADDR;
-+
-+ if (!IsOpen())
-+ return (uint16_t)phys_addr;
-+
-+ CLockObject lock(m_mutex);
-+
-+ if (ioctl(m_fd, CEC_IOC_GET_PHYSICAL_ADDR, &phys_addr) < 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_GET_PHYSICAL_ADDR failed !", __func__);
-+ phys_addr = CEC_DEFAULT_PADDR;
-+ }
-+ return (uint16_t)phys_addr;
-+}
-+
-+
-+cec_logical_addresses CAOCECAdapterCommunication::GetLogicalAddresses(void)
-+{
-+ return m_logicalAddresses;
-+}
-+
-+
-+bool CAOCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
-+{
-+ unsigned int log_addr = addresses.primary;
-+ if (!IsOpen())
-+ return false;
-+
-+ CLockObject lock(m_mutex);
-+
-+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
-+ return false;
-+ }
-+ m_logicalAddresses = addresses;
-+ m_bLogicalAddressChanged = true;
-+
-+ return true;
-+}
-+
-+
-+void CAOCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress))
-+{
-+ unsigned int log_addr = CECDEVICE_BROADCAST;
-+
-+ if (!IsOpen())
-+ return;
-+
-+ CLockObject lock(m_mutex);
-+
-+ if (ioctl(m_fd, CEC_IOC_ADD_LOGICAL_ADDR, log_addr))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: IOCTL CEC_IOC_ADD_LOGICAL_ADDR failed !", __func__);
-+ }
-+}
-+
-+
-+void *CAOCECAdapterCommunication::Process(void)
-+{
-+ uint8_t buffer[CEC_MAX_FRAME_SIZE];
-+ uint32_t size;
-+ fd_set rfds;
-+ cec_logical_address initiator, destination;
-+ struct timeval tv;
-+
-+ if (!IsOpen())
-+ return 0;
-+
-+ while (!IsStopped())
-+ {
-+ int fd = getFileDescriptor();
-+
-+ if (fd == INVALID_SOCKET_VALUE)
-+ {
-+ break;
-+ }
-+
-+ FD_ZERO(&rfds);
-+ FD_SET(fd, &rfds);
-+
-+ tv.tv_sec = 1;
-+ tv.tv_usec = 0;
-+
-+ if (select(fd + 1, &rfds, NULL, NULL, &tv) >= 0 )
-+ {
-+
-+ if (!FD_ISSET(fd, &rfds))
-+ continue;
-+
-+ size = read(fd, buffer, CEC_MAX_FRAME_SIZE);
-+
-+ if (size > 0)
-+ {
-+#if 0 // currently unused
-+ if (buffer[0] == 0xff) // driver wants us to reread the physical address
-+ {
-+ if (!IsStopped())
-+ {
-+ uint16_t iNewAddress = GetPhysicalAddress();
-+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
-+ }
-+ continue;
-+ }
-+#endif
-+ initiator = cec_logical_address(buffer[0] >> 4);
-+ destination = cec_logical_address(buffer[0] & 0x0f);
-+
-+ cec_command cmd;
-+
-+ cec_command::Format(
-+ cmd, initiator, destination,
-+ ( size > 1 ) ? cec_opcode(buffer[1]) : CEC_OPCODE_NONE);
-+
-+ for( uint8_t i = 2; i < size; i++ )
-+ cmd.parameters.PushBack(buffer[i]);
-+
-+ if (!IsStopped())
-+ m_callback->OnCommandReceived(cmd);
-+ }
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+#endif // HAVE_AOCEC_API
-diff --git a/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
-new file mode 100644
-index 0000000..f6a8a4a
---- /dev/null
-+++ b/src/libcec/adapter/AOCEC/AOCECAdapterCommunication.h
-@@ -0,0 +1,105 @@
-+#pragma once
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC AOCEC Code Copyright (C) 2016 Gerald Dachs
-+ * based heavily on:
-+ * libCEC Exynos Code Copyright (C) 2014 Valentin Manea
-+ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * This program is dual-licensed; 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.
-+ *
-+ * This program 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 this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ * Alternatively, you can license this library under a commercial license,
-+ * please contact Pulse-Eight Licensing for more information.
-+ *
-+ * For more information contact:
-+ * Pulse-Eight Licensing
-+ * http://www.pulse-eight.com/
-+ * http://www.pulse-eight.net/
-+ */
-+
-+#include "env.h"
-+
-+#if defined(HAVE_AOCEC_API)
-+
-+#include
-+#include
-+#include "../AdapterCommunication.h"
-+#include