Skip to content
Permalink
Browse files

Merge pull request #204 from adamg88/pr-amlogic-ng

projects/Amlogic-ng: introduce new project
  • Loading branch information...
rayelec committed Apr 14, 2019
2 parents e96f308 + a38b21c commit 8ef642acb12739b852c1e3dadaa2fa47c6f4b5aa
Showing with 7,573 additions and 26 deletions.
  1. +1 −1 distributions/CoreELEC/options
  2. +3 −3 packages/linux-driver-addons/dvb/crazycat/package.mk
  3. +3 −3 packages/linux-driver-addons/dvb/dvb-latest/package.mk
  4. +12 −0 ...driver-addons/dvb/dvb-latest/patches/amlogic-4.9/driver.dvb.dvb-latest-01-config_mycompat_h.patch
  5. +0 −11 ...x-driver-addons/dvb/dvb-latest/patches/amlogic-4.9/driver.dvb.dvb-latest-01-remove-rmmod.pl.patch
  6. +12 −2 packages/linux/package.mk
  7. +2 −2 packages/mediacenter/kodi/package.mk
  8. +201 −0 packages/sysutils/v4l-utils/patches/v4l-utils-0002-add-power-on-argument.patch
  9. 0 {projects/Amlogic/packages → packages/tools}/CoreELEC-Debug-Scripts/package.mk
  10. +56 −0 projects/Amlogic-ng/bootloader/Odroid_N2_boot.ini
  11. +11 −0 projects/Amlogic-ng/bootloader/canupdate.sh
  12. +138 −0 projects/Amlogic-ng/bootloader/config.ini
  13. +34 −0 projects/Amlogic-ng/bootloader/mkbootimg
  14. +53 −0 projects/Amlogic-ng/bootloader/mkimage
  15. +7 −0 projects/Amlogic-ng/bootloader/release
  16. +132 −0 projects/Amlogic-ng/bootloader/update.sh
  17. +34 −0 projects/Amlogic-ng/filesystem/etc/lirc/lircd.conf.d/odroid-amremote.conf
  18. +7 −0 projects/Amlogic-ng/filesystem/usr/bin/cputemp
  19. +1 −0 projects/Amlogic-ng/filesystem/usr/bin/gputemp
  20. +16 −0 projects/Amlogic-ng/filesystem/usr/lib/kodi/aml-hdmimonitor.sh
  21. +1 −0 projects/Amlogic-ng/filesystem/usr/lib/modprobe.d/mali.conf
  22. +1 −0 projects/Amlogic-ng/filesystem/usr/lib/modules-load.d/amlvideodri.conf
  23. +2 −0 projects/Amlogic-ng/filesystem/usr/lib/systemd/sleep.conf.d/sleep.conf
  24. +9 −0 projects/Amlogic-ng/filesystem/usr/lib/systemd/system/fstrim.service
  25. +10 −0 projects/Amlogic-ng/filesystem/usr/lib/systemd/system/kodi-aml-hdmimonitor.service
  26. +21 −0 projects/Amlogic-ng/filesystem/usr/lib/systemd/system/serial-console.service
  27. +1 −0 projects/Amlogic-ng/filesystem/usr/lib/udev/rules.d/99-spidev.rules
  28. +165 −0 projects/Amlogic-ng/filesystem/usr/sbin/installtoemmc
  29. +54 −0 projects/Amlogic-ng/filesystem/usr/share/alsa/cards/AML-AUGESOUND.conf
  30. +58 −0 projects/Amlogic-ng/initramfs/platform_init
  31. +41 −0 projects/Amlogic-ng/kodi/appliance.xml
  32. +6,185 −0 projects/Amlogic-ng/linux/linux.aarch64.conf
  33. +160 −0 projects/Amlogic-ng/options
  34. +37 −0 projects/Amlogic-ng/packages/opengl-meson/package.mk
  35. +29 −0 projects/Amlogic-ng/packages/u-boot-Odroid_N2/package.mk
  36. +54 −0 projects/Amlogic-ng/packages/u-boot/package.mk
  37. +21 −0 projects/Amlogic-ng/patches/CoreELEC-settings/01-autoupdate.patch
  38. +1 −4 scripts/image
@@ -208,7 +208,7 @@
ADDON_REPO_VERSION="9.0.2"

# set the addon dirs
ADDON_PATH="$ADDON_VERSION/$PROJECT/$TARGET_ARCH"
ADDON_PATH="$ADDON_VERSION/Amlogic/$TARGET_ARCH"
ADDON_URL="$ADDON_SERVER_URL/$ADDON_PATH"

# Default size of system partition, in MB, eg. 512
@@ -21,7 +21,7 @@ PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_VERSION="${ADDON_VERSION}.${PKG_REV}"

configure_package() {
if [ "$PROJECT" = "Amlogic" ]; then
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
PKG_PATCH_DIRS="amlogic"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET media_tree_aml"
PKG_NEED_UNPACK="$PKG_NEED_UNPACK media_tree_aml"
@@ -35,7 +35,7 @@ pre_make_target() {

make_target() {
cp -RP $(get_build_dir media_tree_cc)/* $PKG_BUILD/linux
if [ "$PROJECT" = "Amlogic" ]; then
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
cp -RP $(get_build_dir media_tree_aml)/* $PKG_BUILD/linux
echo "obj-y += video_dev/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
echo "obj-y += dvb-avl/" >> "$PKG_BUILD/linux/drivers/media/platform/meson/Makefile"
@@ -49,7 +49,7 @@ make_target() {
if [ "$PROJECT" = Rockchip ]; then
sed -e 's/CONFIG_DVB_CXD2820R=m/# CONFIG_DVB_CXD2820R is not set/g' -i v4l/.config
sed -e 's/CONFIG_DVB_LGDT3306A=m/# CONFIG_DVB_LGDT3306A is not set/g' -i v4l/.config
elif [ "$PROJECT" = "Amlogic" ]; then
elif [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
sed -e 's/CONFIG_DVB_LGDT3306A=m/# CONFIG_DVB_LGDT3306A is not set/g' -i v4l/.config
sed -e 's/CONFIG_VIDEO_S5C73M3=m/# CONFIG_VIDEO_S5C73M3 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_SAA7146_VV=m/# CONFIG_VIDEO_SAA7146_VV is not set/g' -i $PKG_BUILD/v4l/.config
@@ -30,7 +30,7 @@ case "$LINUX" in
esac

configure_package() {
if [ "$PROJECT" = "Amlogic" ]; then
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
PKG_PATCH_DIRS+=" amlogic-common"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET media_tree_aml"
PKG_NEED_UNPACK="$PKG_NEED_UNPACK media_tree_aml"
@@ -45,7 +45,7 @@ pre_make_target() {
make_target() {
cp -RP $(get_build_dir media_tree)/* $PKG_BUILD/linux

if [ "$PROJECT" = "Amlogic" ]; then
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
cp -Lr $(get_build_dir media_tree_aml)/* $PKG_BUILD/linux

# compile modules
@@ -58,7 +58,7 @@ make_target() {
kernel_make VER=$KERNEL_VER SRCDIR=$(kernel_path) allyesconfig

# hack to workaround media_build bug
if [ "$PROJECT" = "Amlogic" ]; then
if [ "$PROJECT" = "Amlogic" -o "$PROJECT" = "Amlogic-ng" ]; then
sed -e 's/CONFIG_DVB_LGDT3306A=m/# CONFIG_DVB_LGDT3306A is not set/g' -i v4l/.config
sed -e 's/CONFIG_VIDEO_S5C73M3=m/# CONFIG_VIDEO_S5C73M3 is not set/g' -i $PKG_BUILD/v4l/.config
sed -e 's/CONFIG_VIDEO_SAA7146_VV=m/# CONFIG_VIDEO_SAA7146_VV is not set/g' -i $PKG_BUILD/v4l/.config
@@ -0,0 +1,12 @@
--- /dev/null
+++ b/v4l/config-mycompat.h
@@ -0,0 +1,8 @@
+#undef smp_mb__after_atomic
+#define smp_mb__after_atomic() smp_mb() /*mb*/
+#undef NEED_SMP_MB_AFTER_ATOMIC
+#undef writel_relaxed
+#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)cpu_to_le32(v),(c)))
+#undef NEED_WRITEL_RELAXED
+#undef NEED_PM_RUNTIME_GET
+#undef NEED_OF_NODE_NAME_EQ
--

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2017-2019 Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2018-present Team CoreELEC (https://coreelec.org)

PKG_NAME="linux"
@@ -32,6 +32,15 @@ case "$LINUX" in
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
PKG_BUILD_PERF="no"
;;
amlogic-4.9)
PKG_VERSION="0d33ccc124a5ed4c4c36f0a4c12bfe5c79c0f61c"
PKG_SHA256="820d0435cda94468305a0144f5ed7a56809f8e9136a3f425a0ee74cbf47f30ba"
PKG_URL="https://github.com/CoreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
PKG_BUILD_PERF="no"
PKG_GIT_BRANCH="amlogic-4.9"
;;
rockchip-4.4)
PKG_VERSION="aa8bacf821e5c8ae6dd8cae8d64011c741659945"
PKG_SHA256="a2760fe89a15aa7be142fd25fb08ebd357c5d855c41f1612cf47c6e89de39bb3"
@@ -228,9 +237,10 @@ make_target() {

makeinstall_target() {
if [ "$BOOTLOADER" = "u-boot" ]; then
mkdir -p $INSTALL/usr/share/bootloader
mkdir -p $INSTALL/usr/share/bootloader/device_trees
if [ -d arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic ]; then
cp arch/$TARGET_KERNEL_ARCH/boot/*dtb.img $INSTALL/usr/share/bootloader/ 2>/dev/null || :
[ "$PROJECT" = "Amlogic-ng" ] && cp arch/$TARGET_KERNEL_ARCH/boot/dts/amlogic/*.dtb $INSTALL/usr/share/bootloader/device_trees 2>/dev/null || :
fi
elif [ "$BOOTLOADER" = "bcm2835-bootloader" ]; then
mkdir -p $INSTALL/usr/share/bootloader/overlays
@@ -13,8 +13,8 @@ PKG_PATCH_DIRS="$KODI_VENDOR"

case $KODI_VENDOR in
amlogic-4.9)
PKG_VERSION="09648b1dc7e85609773fd5d2f74beb082533e0cd"
PKG_SHA256="07869dd8330ca1c201fd43da1aa2201457f34a1fc6d96e5c78d7e0fe638ee8ef"
PKG_VERSION="aba082e570b9471690c451ffd37c422dae60573c"
PKG_SHA256="35b16aa8036c5fb7aa97b947bcd5dafc31689c8db9047ea0ea9e55e08ca693f4"
PKG_URL="https://github.com/CoreELEC/xbmc/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="kodi-$PKG_VERSION.tar.gz"
;;
@@ -0,0 +1,201 @@
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 34a1522..88ee52b 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -228,6 +228,7 @@ static const struct argp_option options[] = {
{"clear", 'c', 0, 0, N_("clears the old table"), 0},
{"sysdev", 's', N_("SYSDEV"), 0, N_("ir class device to control"), 0},
{"test", 't', 0, 0, N_("test if IR is generating events"), 0},
+ {"power-key", 'u', 0, 0, N_("will scan for NEC power on code"), 0},
{"device", 'd', N_("DEV"), 0, N_("ir device to control"), 0},
{"read", 'r', 0, 0, N_("reads the current scancode/keycode table"), 0},
{"write", 'w', N_("TABLE"), 0, N_("write (adds) the scancodes to the device scancode/keycode table from an specified file"), 0},
@@ -254,6 +255,7 @@ static int readtable = 0;
static int clear = 0;
static int debug = 0;
static int test = 0;
+static int poweron = 0;
static int delay = -1;
static int period = -1;
static enum sysfs_protocols ch_proto = 0;
@@ -478,6 +480,9 @@ static error_t parse_opt(int k, char *arg, struct argp_state *state)
case 't':
test++;
break;
+ case 'u':
+ poweron++;
+ break;
case 'c':
clear++;
break;
@@ -1339,7 +1344,7 @@ static void print_scancodes(const struct lirc_scancode *scancodes, unsigned coun
}
}

-static void test_event(struct rc_device *rc_dev, int fd)
+static void test_event(struct rc_device *rc_dev, int fd, int power_on)
{
struct input_event ev[64];
struct lirc_scancode sc[64];
@@ -1364,7 +1369,11 @@ static void test_event(struct rc_device *rc_dev, int fd)
}
}

- printf (_("Testing events. Please, press CTRL-C to abort.\n"));
+ if (!power_on)
+ printf (_("Testing events. Please, press CTRL-C to abort.\n"));
+ else
+ printf (_("Waiting for NEC decode event. Please, press CTRL-C to abort.\n"));
+
while (1) {
struct pollfd pollstruct[2] = {
{ .fd = fd, .events = POLLIN },
@@ -1399,54 +1408,72 @@ static void test_event(struct rc_device *rc_dev, int fd)
return;
}

- for (i = 0; i < rd / sizeof(struct input_event); i++) {
- printf(_("%ld.%06ld: event type %s(0x%02x)"),
- ev[i].time.tv_sec, ev[i].time.tv_usec,
- get_event_name(events_type, ev[i].type), ev[i].type);
+ if (!power_on) {
+ for (i = 0; i < rd / sizeof(struct input_event); i++) {
+ printf(_("%ld.%06ld: event type %s(0x%02x)"),
+ ev[i].time.tv_sec, ev[i].time.tv_usec,
+ get_event_name(events_type, ev[i].type), ev[i].type);

- switch (ev[i].type) {
- case EV_SYN:
- printf(".\n");
- break;
- case EV_KEY:
- printf(_(" key_%s: %s(0x%04x)\n"),
- (ev[i].value == 0) ? _("up") : _("down"),
- get_event_name(key_events, ev[i].code),
- ev[i].code);
- break;
- case EV_REL:
- printf(_(": %s (0x%04x) value=%d\n"),
- get_event_name(rel_events, ev[i].code),
- ev[i].code,
- ev[i].value);
- break;
- case EV_ABS:
- printf(_(": %s (0x%04x) value=%d\n"),
- get_event_name(abs_events, ev[i].code),
- ev[i].code,
- ev[i].value);
- break;
- case EV_MSC:
- if (ev[i].code == MSC_SCAN)
- printf(_(": scancode = 0x%02x\n"), ev[i].value);
- else
- printf(_(": code = %s(0x%02x), value = %d\n"),
- get_event_name(msc_events, ev[i].code),
+ switch (ev[i].type) {
+ case EV_SYN:
+ printf(".\n");
+ break;
+ case EV_KEY:
+ printf(_(" key_%s: %s(0x%04x)\n"),
+ (ev[i].value == 0) ? _("up") : _("down"),
+ get_event_name(key_events, ev[i].code),
+ ev[i].code);
+ break;
+ case EV_REL:
+ printf(_(": %s (0x%04x) value=%d\n"),
+ get_event_name(rel_events, ev[i].code),
+ ev[i].code,
+ ev[i].value);
+ break;
+ case EV_ABS:
+ printf(_(": %s (0x%04x) value=%d\n"),
+ get_event_name(abs_events, ev[i].code),
+ ev[i].code,
+ ev[i].value);
+ break;
+ case EV_MSC:
+ if (ev[i].code == MSC_SCAN)
+ printf(_(": scancode = 0x%02x\n"), ev[i].value);
+ else
+ printf(_(": code = %s(0x%02x), value = %d\n"),
+ get_event_name(msc_events, ev[i].code),
+ ev[i].code, ev[i].value);
+ break;
+ case EV_REP:
+ printf(_(": value = %d\n"), ev[i].value);
+ break;
+ case EV_SW:
+ case EV_LED:
+ case EV_SND:
+ case EV_FF:
+ case EV_PWR:
+ case EV_FF_STATUS:
+ default:
+ printf(_(": code = 0x%02x, value = %d\n"),
ev[i].code, ev[i].value);
- break;
- case EV_REP:
- printf(_(": value = %d\n"), ev[i].value);
- break;
- case EV_SW:
- case EV_LED:
- case EV_SND:
- case EV_FF:
- case EV_PWR:
- case EV_FF_STATUS:
- default:
- printf(_(": code = 0x%02x, value = %d\n"),
- ev[i].code, ev[i].value);
- break;
+ break;
+ }
+ }
+ } else {
+ for (i = 0; i < rd / sizeof(struct input_event); i++) {
+
+ switch (ev[i].type) {
+ case EV_MSC:
+ if (ev[i].code == MSC_SCAN) {
+ unsigned int nec_code =
+ ((~ev[i].value & 0xFF) << 24) |
+ ((ev[i].value & 0xFF) << 16) |
+ ((~(ev[i].value >> 8) & 0xFF) << 8) |
+ ((ev[i].value >> 8) & 0xFF);
+ printf(_("Received NEC code: 0x%08X\n"), nec_code);
+ }
+ break;
+ }
}
}
}
@@ -1624,7 +1651,7 @@ int main(int argc, char *argv[])
argp_parse(&argp, argc, argv, ARGP_NO_HELP, 0, 0);

/* Just list all devices */
- if (!clear && !readtable && !keytable && !ch_proto && !cfg.next && !test && delay < 0 && period < 0) {
+ if (!clear && !readtable && !keytable && !ch_proto && !cfg.next && !test && !poweron && delay < 0 && period < 0) {
if (devicename) {
fd = open(devicename, O_RDONLY);
if (fd < 0) {
@@ -1750,6 +1777,9 @@ int main(int argc, char *argv[])
/*
* Third step: change protocol
*/
+ if (poweron)
+ ch_proto = SYSFS_NEC;
+
if (ch_proto) {
rc_dev.current = ch_proto;
if (set_proto(&rc_dev))
@@ -1780,8 +1810,8 @@ int main(int argc, char *argv[])
set_rate(fd, new_delay, new_period);
}

- if (test)
- test_event(&rc_dev, fd);
+ if (test || poweron)
+ test_event(&rc_dev, fd, poweron);

return 0;
}
@@ -0,0 +1,56 @@
ODROIDN2-UBOOT-CONFIG

#------------------------------------------------------------------------------------------------------
#
# boot.ini
#
# WARNING DO NOT MODIFY THIS FILE! ALL CHANGES WILL BE LOST WITH THE NEXT UPDATE!
# Set your own settings in config.ini
#
#------------------------------------------------------------------------------------------------------

setenv bootrootfs "BOOT_IMAGE=kernel.img boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@"
setenv condev "console=ttyS0,115200 console=tty0"
setenv hdmimode "1080p60hz"
setenv bmp_width "1920"
setenv bmp_height "1080"
setenv vout_mode "hdmi"
setenv hdmioutput "1"
setenv vpu "1"
setenv coreelec "quiet"
setenv hdmi_cec "1"
setenv maxcpus "6"
setenv max_freq_a73 "1800"
setenv max_freq_a53 "1896"
setenv rtc_shield "0"
setenv emmc_timeout "0"
setenv wol "1"

setenv loadaddr 0x11000000
setenv dtb_mem_addr 0x1000000
setenv uenv_addr 0x13000000

fatload mmc ${mmc_dev}:1 ${loadaddr} kernel.img
fatload mmc ${mmc_dev}:1 ${dtb_mem_addr} dtb.img

if fatload mmc ${mmc_dev}:1 ${uenv_addr} config.ini; then env import -t ${uenv_addr} $filesize; fi

if test "${emmc_timeout}" = "1"; then showlogo ${hdmimode} ${bmp_width} ${bmp_height} timeout-logo-${bmp_height}.bmp.gz; sleep 30; mmc dev 1; mmc dev 0; fi

setenv device "no_console_suspend logo=osd0,loaded,0x3f800000,${hdmimode} vout=${hdmimode},enable voutmode=${vout_mode} hdmimode=${hdmimode} cvbsmode=nocvbs mac=${ethaddr} consoleblank=0 max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} enable_wol=${wol}"
if test "${hdmi_cec}" = "1"; then setenv cec "hdmitx=cec3f"; fi
setenv bootargs "${condev} ${bootrootfs} ${device} ${cec} ${coreelec}"

# Device tree modifications
bootm start
bootm loados
bootm fdt
if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi
if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi
if test "${rtc_shield}" = "1"; then fdt set "/i2c@c1108500/pcf8563@51" status okay; else fdt set "/i2c@c1108500/pcf8563@51" status disabled; fi
# Remove aml partition layout from device tree (required for eMMC boot)
fdt rm /partitions
bootm prep

# Boot the board
bootm go
Oops, something went wrong.

0 comments on commit 8ef642a

Please sign in to comment.
You can’t perform that action at this time.