mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
Merge pull request #3663 from LibreELEC/nxp
New project and device: NXP/iMX6
This commit is contained in:
commit
58dc947242
@ -3,12 +3,12 @@
|
||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="firmware-imx"
|
||||
PKG_VERSION="5.4"
|
||||
PKG_SHA256="c5bd4bff48cce9715a5d6d2c190ff3cd2262c7196f7facb9b0eda231c92cc223"
|
||||
PKG_VERSION="7.9"
|
||||
PKG_SHA256="30e22c3e24a8025d60c52ed5a479e30fad3ad72127c84a870e69ec34e46ea8c0"
|
||||
PKG_ARCH="arm"
|
||||
PKG_LICENSE="other"
|
||||
PKG_SITE="http://www.freescale.com"
|
||||
PKG_URL="http://www.nxp.com/lgfiles/NMG/MAD/YOCTO/${PKG_NAME}-${PKG_VERSION}.bin"
|
||||
PKG_URL="https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/${PKG_NAME}-${PKG_VERSION}.bin"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
PKG_LONGDESC="firmware-imx: Freescale IMX firmware such as for the VPU"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
@ -19,6 +19,9 @@ unpack() {
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/$(get_full_firmware_dir)/imx/sdma
|
||||
cp -P firmware/sdma/sdma-imx6q.bin $INSTALL/$(get_full_firmware_dir)/imx/sdma
|
||||
|
||||
mkdir -p $INSTALL/$(get_full_firmware_dir)/vpu
|
||||
cp -P firmware/vpu/vpu_fw_imx6d.bin $INSTALL/$(get_full_firmware_dir)/vpu
|
||||
cp -P firmware/vpu/vpu_fw_imx6q.bin $INSTALL/$(get_full_firmware_dir)/vpu
|
||||
|
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
|
26
projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-audio
Executable file
26
projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-audio
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: rdu-audio <0-100>"
|
||||
echo " The recommended level is 80"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VOLUME="$1%"
|
||||
|
||||
amixer -q sset 'TPA6130A2 Headphone',0 $VOLUME
|
||||
amixer -q sset 'Speaker',0 on
|
||||
amixer -q sset 'Speaker Analog',0 $VOLUME
|
||||
amixer -q sset 'Speaker Driver',0 $VOLUME
|
||||
amixer -q sset 'Speaker Driver',0 on
|
||||
amixer -q sset 'DAC',0 $VOLUME
|
||||
amixer -q sset 'HP Analog',0 $VOLUME
|
||||
amixer -q sset 'HP Driver',0 $VOLUME
|
||||
amixer -q sset 'HP Driver',0 on
|
||||
amixer -q sset 'HP Left',0 on
|
||||
amixer -q sset 'HP Right',0 on
|
||||
amixer -q sset 'Output Left From AIN1',0 on
|
||||
amixer -q sset 'Output Left From AIN2',0 on
|
||||
amixer -q sset 'Output Left From Left DAC',0 on
|
||||
amixer -q sset 'Output Right From AIN2',0 on
|
||||
amixer -q sset 'Output Right From Right DAC',0 on
|
117
projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network
Executable file
117
projects/NXP/devices/iMX6/filesystem/usr/bin/rdu-network
Executable file
@ -0,0 +1,117 @@
|
||||
#!/bin/sh
|
||||
|
||||
ACTION=$1
|
||||
|
||||
LOGGER_TAG="rdu-network"
|
||||
MODEL=$(cat /sys/firmware/devicetree/base/model)
|
||||
|
||||
IP_IFACE=""
|
||||
BR_NAME=""
|
||||
BR_IFACES=""
|
||||
UNUSED_IFACES=""
|
||||
USED_IFACES=""
|
||||
|
||||
function log
|
||||
{
|
||||
logger -t "${LOGGER_TAG}" "$@"
|
||||
}
|
||||
|
||||
function logerr
|
||||
{
|
||||
logger -t "${LOGGER_TAG}" -p "err" "$@"
|
||||
}
|
||||
|
||||
# Select setup based on model
|
||||
|
||||
case "${MODEL}" in
|
||||
"ZII RDU2+ Board" | "ZII RDU2 Board")
|
||||
log "Loading RDU2 networking setup..."
|
||||
IP_IFACE="enp1s0"
|
||||
BR_NAME="br0"
|
||||
BR_IFACES="netaux netleft netright gigabit_proc"
|
||||
ALL_IFACES="eth0 ${IP_IFACE} ${BR_IFACES} ${BR_NAME}"
|
||||
;;
|
||||
"ZII RDU1 Board")
|
||||
log "Loading RDU1 networking setup..."
|
||||
IP_IFACE="br0"
|
||||
BR_NAME="br0"
|
||||
BR_IFACES="netaux netleft netright"
|
||||
ALL_IFACES="eth0 ${BR_NAME} ${BR_IFACES}"
|
||||
;;
|
||||
*)
|
||||
logerr "invalid hardware model detected: ${MODEL}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${ACTION}" in
|
||||
|
||||
"start")
|
||||
|
||||
# Assume RDU network is already started if the bridge is available
|
||||
if [ -d /sys/class/net/${BR_NAME} ]; then
|
||||
log "Networking setup is already started"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Cleanup all addresses from all interfaces and bring them down
|
||||
log "Resetting interfaces..."
|
||||
for IFACE in ${ALL_IFACES}; do
|
||||
log " Resetting ${IFACE}..."
|
||||
ip addr flush dev ${IFACE} >/dev/null 2>&1
|
||||
ip link set dev ${IFACE} down >/dev/null 2>&1
|
||||
done
|
||||
|
||||
# Create bridge with all interfaces
|
||||
log "Creating bridge interface..."
|
||||
brctl addbr ${BR_NAME} >/dev/null 2>&1
|
||||
for IFACE in ${BR_IFACES}; do
|
||||
log " Adding ${IFACE} to bridge..."
|
||||
brctl addif ${BR_NAME} ${IFACE} >/dev/null 2>&1
|
||||
done
|
||||
|
||||
# Bring all bridge interfaces and the bridge itself up
|
||||
log "Bringing up all interfaces..."
|
||||
for IFACE in ${ALL_IFACES}; do
|
||||
log " Bringing up ${IFACE}..."
|
||||
ip link set dev ${IFACE} up >/dev/null 2>&1
|
||||
done
|
||||
|
||||
# All done
|
||||
log "RDU networking started"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
"stop")
|
||||
|
||||
# Assume RDU network is already stopped if the bridge is available
|
||||
if [ ! -d /sys/class/net/${BR_NAME} ]; then
|
||||
log "Networking setup is already stopped"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Cleanup all addresses from all interfaces and bring them down
|
||||
log "Resetting interfaces..."
|
||||
for IFACE in ${ALL_IFACES}; do
|
||||
ip addr flush dev ${IFACE} >/dev/null 2>&1
|
||||
ip link set dev ${IFACE} down >/dev/null 2>&1
|
||||
done
|
||||
|
||||
# Remove bridge interfaces and bridge itself
|
||||
log "Removing bridge interface..."
|
||||
for IFACE in ${BR_IFACES}; do
|
||||
brctl delif ${BR_NAME} ${IFACE} >/dev/null 2>&1
|
||||
done
|
||||
brctl delbr ${BR_NAME} >/dev/null 2>&1
|
||||
|
||||
# All done
|
||||
log "RDU networking stopped"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
logerr "invalid action requested: ${ACTION}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=RDU audio setup
|
||||
After=sound.target
|
||||
ConditionPathExistsGlob=/flash/imx6*-zii-rdu2.dtb
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/rdu-audio 80
|
||||
RemainAfterExit=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=RDU network setup
|
||||
After=network-pre.target
|
||||
ConditionPathExistsGlob=/flash/imx6*-zii-rdu2.dtb
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/rdu-network start
|
||||
RemainAfterExit=true
|
||||
ExecStop=/usr/bin/rdu-network stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -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"
|
||||
|
@ -115,6 +115,38 @@ devices = \
|
||||
},
|
||||
},
|
||||
},
|
||||
'NXP': {
|
||||
'iMX6': {
|
||||
'cubox-dl': {
|
||||
'dtb': 'imx6dl-cubox-i.dtb',
|
||||
'config': 'mx6cuboxi_defconfig'
|
||||
},
|
||||
'cubox-q': {
|
||||
'dtb': 'imx6q-cubox-i.dtb',
|
||||
'config': 'mx6cuboxi_defconfig'
|
||||
},
|
||||
'matrix-q': {
|
||||
'dtb': 'imx6q-tbs2910.dtb',
|
||||
'config': 'tbs2910_defconfig'
|
||||
},
|
||||
'udoo-dl': {
|
||||
'dtb': 'imx6dl-udoo.dtb',
|
||||
'config': 'udoo_defconfig'
|
||||
},
|
||||
'udoo-q': {
|
||||
'dtb': 'imx6q-udoo.dtb',
|
||||
'config': 'udoo_defconfig'
|
||||
},
|
||||
'wandboard-dl': {
|
||||
'dtb': 'imx6dl-wandboard.dtb',
|
||||
'config': 'wandboard_defconfig'
|
||||
},
|
||||
'wandboard-q': {
|
||||
'dtb': 'imx6q-wandboard.dtb',
|
||||
'config': 'wandboard_defconfig'
|
||||
},
|
||||
},
|
||||
},
|
||||
'Qualcomm': {
|
||||
'Dragonboard': {
|
||||
'410c': {
|
||||
|
Loading…
x
Reference in New Issue
Block a user