mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
NXP/iMX6: initial project
This commit is contained in:
parent
40243635ee
commit
af490c7b6f
5
projects/NXP/devices/iMX6/bootloader/install
Normal file
5
projects/NXP/devices/iMX6/bootloader/install
Normal file
@ -0,0 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
cp -av u-boot.img $INSTALL/usr/share/bootloader
|
||||
cp -av SPL $INSTALL/usr/share/bootloader
|
12
projects/NXP/devices/iMX6/bootloader/mkimage
Normal file
12
projects/NXP/devices/iMX6/bootloader/mkimage
Normal file
@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot.img" ]; then
|
||||
echo "Writing u-boot.img to $(basename $DISK)"
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.img" of="$DISK" bs=1K seek=69 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
fi
|
||||
|
||||
if [ -f "$RELEASE_DIR/3rdparty/bootloader/SPL" ]; then
|
||||
echo "Writing SPL to $(basename $DISK)"
|
||||
dd if="$RELEASE_DIR/3rdparty/bootloader/SPL" of="$DISK" bs=1K seek=1 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
|
||||
fi
|
10
projects/NXP/devices/iMX6/bootloader/release
Normal file
10
projects/NXP/devices/iMX6/bootloader/release
Normal file
@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
mkdir -p $RELEASE_DIR/3rdparty/bootloader
|
||||
if [ -n "$UBOOT_SYSTEM" ]; then
|
||||
cp -a $(get_build_dir $BOOTLOADER)/u-boot.img $RELEASE_DIR/3rdparty/bootloader
|
||||
cp -a $(get_build_dir $BOOTLOADER)/SPL $RELEASE_DIR/3rdparty/bootloader
|
||||
fi
|
||||
|
||||
cp -a $(get_build_dir linux)/arch/$TARGET_KERNEL_ARCH/boot/dts/*.dtb $RELEASE_DIR/3rdparty/bootloader
|
45
projects/NXP/devices/iMX6/bootloader/update.sh
Executable file
45
projects/NXP/devices/iMX6/bootloader/update.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
[ -z "$SYSTEM_ROOT" ] && SYSTEM_ROOT=""
|
||||
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
|
||||
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
|
||||
if [ -z "$BOOT_DISK" ]; then
|
||||
case $BOOT_PART in
|
||||
/dev/sd[a-z][0-9]*)
|
||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
|
||||
;;
|
||||
/dev/mmcblk*)
|
||||
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/w
|
||||
mount -o remount,rw $BOOT_ROOT
|
||||
|
||||
# update Device Tree Blobs
|
||||
for all_dtb in /flash/*.dtb; do
|
||||
dtb=$(basename $all_dtb)
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
|
||||
echo "*** updating Device Tree Blob: $dtb ..."
|
||||
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
|
||||
fi
|
||||
done
|
||||
|
||||
# update bootloader files
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.img ]; then
|
||||
echo "*** updating u-boot image on: $BOOT_DISK ..."
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.img of="$BOOT_DISK" bs=1K seek=69 conv=fsync &>/dev/null
|
||||
fi
|
||||
|
||||
if [ -f $SYSTEM_ROOT/usr/share/bootloader/SPL ]; then
|
||||
echo "*** updating u-boot SPL Blob on: $BOOT_DISK ..."
|
||||
dd if=$SYSTEM_ROOT/usr/share/bootloader/SPL of="$BOOT_DISK" bs=1k seek=1 conv=fsync &>/dev/null
|
||||
fi
|
||||
|
||||
# mount $BOOT_ROOT r/o
|
||||
sync
|
||||
mount -o remount,ro $BOOT_ROOT
|
@ -0,0 +1,195 @@
|
||||
#
|
||||
# All PCM must be 24-bit for easy kernel conversion.
|
||||
# IEC958 formatted output can be sent directly.
|
||||
#
|
||||
# Direct-to-hardware converting to 24-bit output.
|
||||
#
|
||||
dw-hdmi-ahb-aud.pcm.hw-s24le {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type linear
|
||||
slave.pcm {
|
||||
type hw
|
||||
card $CARD
|
||||
}
|
||||
slave.format S24_LE
|
||||
}
|
||||
|
||||
#
|
||||
# Dmix hardware 24-bit output.
|
||||
#
|
||||
dw-hdmi-ahb-aud.pcm.dmix-s24le {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type plug
|
||||
slave.pcm { @func concat strings [ "dmix:" $CARD ",FORMAT=S24_LE" ] }
|
||||
}
|
||||
|
||||
#
|
||||
# Softvol with dmix output
|
||||
#
|
||||
dw-hdmi-ahb-aud.pcm.default {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type asym
|
||||
playback.pcm {
|
||||
type softvol
|
||||
slave.pcm {
|
||||
@func refer name {
|
||||
@func concat strings [
|
||||
"cards."
|
||||
{ @func card_driver card $CARD }
|
||||
".pcm.dmix-s24le:CARD=" $CARD
|
||||
]
|
||||
}
|
||||
}
|
||||
control {
|
||||
name "PCM Playback Volume"
|
||||
card $CARD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Common output path for front and surround outputs
|
||||
#
|
||||
dw-hdmi-ahb-aud.pcm.common.0 {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type asym
|
||||
playback.pcm {
|
||||
type softvol
|
||||
slave.pcm {
|
||||
@func refer name {
|
||||
@func concat strings [
|
||||
"cards."
|
||||
{ @func card_driver card $CARD }
|
||||
".pcm.hw-s24le:CARD=" $CARD
|
||||
]
|
||||
}
|
||||
}
|
||||
control {
|
||||
name "PCM Playback Volume"
|
||||
card $CARD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<confdir:pcm/front.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.front.0 cards.dw-hdmi-ahb-aud.pcm.common.0
|
||||
|
||||
# The mapping of ALSA channels to surround channels is very imprecise.
|
||||
# ALSA uses a different terminology and speaker placement to the CEA
|
||||
# surround positioning. CEA has the positioning of:
|
||||
#
|
||||
# LFE
|
||||
# FL FLC FC FRC FR
|
||||
#
|
||||
#
|
||||
# RL RLC RC RRC RR
|
||||
#
|
||||
# ALSA's idea is:
|
||||
#
|
||||
# LFE
|
||||
# FL C FR
|
||||
#
|
||||
# SL SR
|
||||
#
|
||||
# RL RR
|
||||
#
|
||||
# We do our best to map between these representations.
|
||||
|
||||
<confdir:pcm/surround40.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.surround40.0 {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type empty
|
||||
slave.pcm {
|
||||
@func refer
|
||||
name {
|
||||
@func concat strings [
|
||||
"cards.dw-hdmi-ahb-aud.pcm.common.0:CARD="
|
||||
$CARD
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# surround 41 and surround50 are (annoyingly) mapped to surround51
|
||||
# We could do without stacking two 'route' plugins on top of each other
|
||||
|
||||
<confdir:pcm/surround41.conf>
|
||||
<confdir:pcm/surround50.conf>
|
||||
<confdir:pcm/surround51.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.surround51.0 {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type route
|
||||
slave.pcm {
|
||||
@func refer
|
||||
name {
|
||||
@func concat strings [
|
||||
"cards.dw-hdmi-ahb-aud.pcm.common.0:CARD="
|
||||
$CARD
|
||||
]
|
||||
}
|
||||
}
|
||||
ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
|
||||
ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
|
||||
ttable.2.4 1.0 # RL -> slave 4 -> hdmi 4 RL
|
||||
ttable.3.5 1.0 # RR -> slave 5 -> hdmi 5 RR
|
||||
ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
|
||||
ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
|
||||
}
|
||||
|
||||
<confdir:pcm/surround71.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.surround71.0 {
|
||||
@args [ CARD ]
|
||||
@args.CARD { type string }
|
||||
type route
|
||||
slave.pcm {
|
||||
@func refer
|
||||
name {
|
||||
@func concat strings [
|
||||
"cards.dw-hdmi-ahb-aud.pcm.common.0:CARD="
|
||||
$CARD
|
||||
]
|
||||
}
|
||||
}
|
||||
slave.channels 8
|
||||
ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
|
||||
ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
|
||||
ttable.2.6 1.0 # RL -> slave 6 -> hdmi 6 RLC/FLC
|
||||
ttable.3.7 1.0 # RR -> slave 7 -> hdmi 7 RRC/FRC
|
||||
ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
|
||||
ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
|
||||
ttable.6.4 1.0 # SL -> slave 4 -> hdmi 4 RL
|
||||
ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
|
||||
}
|
||||
|
||||
<confdir:pcm/hdmi.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.hdmi.0 {
|
||||
@args [ CARD AES0 AES1 AES2 AES3 ]
|
||||
@args.CARD { type string }
|
||||
@args.AES0 { type integer }
|
||||
@args.AES1 { type integer }
|
||||
@args.AES2 { type integer }
|
||||
@args.AES3 { type integer }
|
||||
type iec958
|
||||
slave.pcm {
|
||||
type hw
|
||||
card $CARD
|
||||
}
|
||||
slave.format IEC958_SUBFRAME_LE
|
||||
# $AES3 must be correct for some AV receivers to accept the stream
|
||||
status [ $AES0 $AES1 $AES2 $AES3 ]
|
||||
}
|
||||
|
||||
<confdir:pcm/iec958.conf>
|
||||
|
||||
dw-hdmi-ahb-aud.pcm.iec958.0 cards.dw-hdmi-ahb-aud.pcm.hdmi.0
|
@ -0,0 +1 @@
|
||||
[ "$1" = "imx6.arm" ] && exit 0 || exit 1
|
5686
projects/NXP/devices/iMX6/linux/linux.arm.conf
Normal file
5686
projects/NXP/devices/iMX6/linux/linux.arm.conf
Normal file
File diff suppressed because it is too large
Load Diff
23
projects/NXP/devices/iMX6/options
Normal file
23
projects/NXP/devices/iMX6/options
Normal file
@ -0,0 +1,23 @@
|
||||
################################################################################
|
||||
# setup device defaults
|
||||
################################################################################
|
||||
|
||||
# The TARGET_CPU variable controls which processor should be targeted for
|
||||
# generated code.
|
||||
case $TARGET_ARCH in
|
||||
arm)
|
||||
TARGET_CPU="cortex-a9"
|
||||
TARGET_FLOAT="hard"
|
||||
TARGET_FPU="neon-vfpv3"
|
||||
TARGET_FEATURES="32bit"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Kernel target
|
||||
KERNEL_TARGET="zImage"
|
||||
|
||||
# kernel serial console
|
||||
EXTRA_CMDLINE="console=ttymxc0,115200 console=tty0"
|
||||
|
||||
# debug tty path
|
||||
DEBUG_TTY="/dev/ttymxc0"
|
@ -0,0 +1,31 @@
|
||||
From: Lucas Stach <l.stach@pengutronix.de>
|
||||
Subject: [PATCH 1/2] mm: cma: export functions to get CMA base and size
|
||||
Date: Wed, 29 May 2019 12:43:11 +0200
|
||||
|
||||
Make them usable in modules. Some drivers want to know where their
|
||||
device CMA area is located to make better decisions about the DMA
|
||||
programming.
|
||||
|
||||
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
|
||||
---
|
||||
mm/cma.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/mm/cma.c b/mm/cma.c
|
||||
index 3340ef34c154..191c89bf038d 100644
|
||||
--- a/mm/cma.c
|
||||
+++ b/mm/cma.c
|
||||
@@ -44,11 +44,13 @@ phys_addr_t cma_get_base(const struct cma *cma)
|
||||
{
|
||||
return PFN_PHYS(cma->base_pfn);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(cma_get_base);
|
||||
|
||||
unsigned long cma_get_size(const struct cma *cma)
|
||||
{
|
||||
return cma->count << PAGE_SHIFT;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(cma_get_size);
|
||||
|
||||
const char *cma_get_name(const struct cma *cma)
|
||||
{
|
@ -0,0 +1,52 @@
|
||||
From: Lucas Stach <l.stach@pengutronix.de>
|
||||
Subject: [PATCH 2/2] drm/etnaviv: use CMA area to compute linear window offset
|
||||
if possible
|
||||
Date: Wed, 29 May 2019 12:43:12 +0200
|
||||
|
||||
The dma_required_mask might overestimate the memory size, or might not match
|
||||
up with the CMA area placement for other reasons. Get the information about
|
||||
CMA area placement directly from CMA where it is available, but keep the
|
||||
dma_required_mask as an approximate fallback for architectures where CMA is
|
||||
not available.
|
||||
|
||||
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
|
||||
---
|
||||
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
|
||||
index 72d01e873160..b144f1bbbb3c 100644
|
||||
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
|
||||
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
|
||||
@@ -4,7 +4,9 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
+#include <linux/cma.h>
|
||||
#include <linux/component.h>
|
||||
+#include <linux/dma-contiguous.h>
|
||||
#include <linux/dma-fence.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/of_device.h>
|
||||
@@ -724,11 +726,18 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
|
||||
*/
|
||||
if (!(gpu->identity.features & chipFeatures_PIPE_3D) ||
|
||||
(gpu->identity.minor_features0 & chipMinorFeatures0_MC20)) {
|
||||
- u32 dma_mask = (u32)dma_get_required_mask(gpu->dev);
|
||||
- if (dma_mask < PHYS_OFFSET + SZ_2G)
|
||||
+ struct cma *cma = dev_get_cma_area(gpu->dev);
|
||||
+ phys_addr_t end_mask;
|
||||
+
|
||||
+ if (cma)
|
||||
+ end_mask = cma_get_base(cma) - 1 + cma_get_size(cma);
|
||||
+ else
|
||||
+ end_mask = dma_get_required_mask(gpu->dev);
|
||||
+
|
||||
+ if (end_mask < PHYS_OFFSET + SZ_2G)
|
||||
gpu->memory_base = PHYS_OFFSET;
|
||||
else
|
||||
- gpu->memory_base = dma_mask - SZ_2G + 1;
|
||||
+ gpu->memory_base = end_mask - SZ_2G + 1;
|
||||
} else if (PHYS_OFFSET >= SZ_2G) {
|
||||
dev_info(gpu->dev, "Need to move linear window on MC1.0, disabling TS\n");
|
||||
gpu->memory_base = PHYS_OFFSET;
|
73
projects/NXP/options
Normal file
73
projects/NXP/options
Normal file
@ -0,0 +1,73 @@
|
||||
################################################################################
|
||||
# setup system defaults
|
||||
################################################################################
|
||||
|
||||
# Bootloader to use (syslinux / u-boot / bcm2835-bootloader)
|
||||
BOOTLOADER="u-boot"
|
||||
|
||||
# u-boot version to use (default)
|
||||
UBOOT_VERSION="default"
|
||||
|
||||
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||
KERNEL_MAKE_EXTRACMD="dtbs"
|
||||
|
||||
# Kernel to use. values can be:
|
||||
# default: default mainline kernel
|
||||
LINUX="default"
|
||||
|
||||
################################################################################
|
||||
# setup build defaults
|
||||
################################################################################
|
||||
|
||||
# Project CFLAGS
|
||||
PROJECT_CFLAGS=""
|
||||
|
||||
# SquashFS compression method (gzip / lzo / xz)
|
||||
SQUASHFS_COMPRESSION="zstd"
|
||||
|
||||
################################################################################
|
||||
# setup project defaults
|
||||
################################################################################
|
||||
|
||||
# build and install ALSA Audio support (yes / no)
|
||||
ALSA_SUPPORT="yes"
|
||||
|
||||
# OpenGL(X) implementation to use (no / mesa)
|
||||
OPENGL="no"
|
||||
|
||||
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q / opengl-meson6)
|
||||
OPENGLES="mesa"
|
||||
|
||||
# include uvesafb support (yes / no)
|
||||
UVESAFB_SUPPORT="no"
|
||||
|
||||
# Displayserver to use (x11 / no)
|
||||
DISPLAYSERVER="no"
|
||||
|
||||
# Windowmanager to use (ratpoison / fluxbox / none)
|
||||
WINDOWMANAGER="none"
|
||||
|
||||
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia)
|
||||
# Space separated list is supported,
|
||||
# e.g. GRAPHIC_DRIVERS="i915 i965 r300 r600 radeonsi nvidia"
|
||||
GRAPHIC_DRIVERS="etnaviv"
|
||||
|
||||
# KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap)
|
||||
KODIPLAYER_DRIVER="mesa"
|
||||
|
||||
# build and install driver addons (yes / no)
|
||||
DRIVER_ADDONS_SUPPORT="yes"
|
||||
|
||||
# driver addons to install:
|
||||
# for a list of additional drivers see packages/linux-driver-addons
|
||||
# Space separated list is supported,
|
||||
DRIVER_ADDONS="crazycat dvb-latest"
|
||||
|
||||
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||
# Space separated list is supported,
|
||||
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||
FIRMWARE="misc-firmware wlan-firmware dvb-firmware brcmfmac_sdio-firmware-imx firmware-imx"
|
||||
|
||||
# build with installer (yes / no)
|
||||
INSTALLER_SUPPORT="no"
|
||||
|
Loading…
x
Reference in New Issue
Block a user