Enable Odroid C1 NEXT, 4.17.y ... usable as headless server. Known issues: stuck on reboot, need power cycle, no hdmi console, no DVFS.

This commit is contained in:
Igor Pecovnik 2018-08-01 13:00:31 +02:00
parent 37b167429c
commit d2147b50c2
14 changed files with 39123 additions and 1739 deletions

View File

@ -6,8 +6,8 @@ BOOTCONFIG="odroidc_config"
MODULES="bonding"
MODULES_NEXT=""
#
KERNEL_TARGET="default,dev"
CLI_TARGET="jessie,xenial:default"
KERNEL_TARGET="default,next,dev"
CLI_TARGET="xenial:default,next"
DESKTOP_TARGET="xenial:default"
#
CLI_BETA_TARGET=""

View File

@ -33,10 +33,14 @@ setenv vout_mode "hdmi"
# setenv vout_mode "vga"
# HDMI BPP Mode
# setenv m_bpp "32"
setenv m_bpp "24"
setenv m_bpp "32"
#setenv m_bpp "24"
# setenv m_bpp "16"
# Monitor output
# Controls if HDMI PHY should output anything to the monitor
setenv monitor_onoff "false" # true or false
# HDMI Hotplug Force (HPD)
# 1 = Enables HOTPlug Detection
# 0 = Disables HOTPlug Detection and force the connected status
@ -55,7 +59,7 @@ setenv cec "0"
# 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"
setenv disableuhs "disableuhs"
# Disable VPU (Video decoding engine, Saves RAM!!!)
@ -71,13 +75,25 @@ setenv hdmioutput "1"
# Default Console Device Setting
if test -e mmc 0:1 boot/.next; then setenv condev "console=ttyAML0,115200n8"; else setenv condev "console=ttyS0,115200n8 console=tty0"; fi
# Enable/Disable ODROID-VU7 Touchscreen
setenv disable_vu7 "false" # false
# CPU Max Frequency
# Possible Values: 96 192 312 408 504 600 720 816
# 1008 1200 1320 1488 1536 1632 1728 and 1824
setenv max_freq "1536"
# setenv max_freq "1632"
# setenv max_freq "1728"
# setenv max_freq "1824"
###########################################
if test "${hpd}" = "0"; then setenv hdmi_hpd "disablehpd=true"; fi
if test "${cec}" = "1"; then setenv hdmi_cec "hdmitx=cecf"; fi
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
# Boot Arguments
setenv bootargs "root=${rootdev} rootwait rw ${condev} rootfstype=${rootfstype} loglevel=1 no_console_suspend consoleblank=0 vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac} ${extraargs}"
setenv bootargs "root=${rootdev} rootwait rw ${condev} rootfstype=${rootfstype} loglevel=3 no_console_suspend consoleblank=0 vdaccfg=0xa000 logo=osd1,loaded,0x7900000,720p,full dmfc=3 cvbsmode=576cvbs hdmimode=${m} m_bpp=${m_bpp} vout=${vout_mode} ${disableuhs} ${hdmi_hpd} ${hdmi_cec} ${enabledac} monitor_onoff=${monitor_onoff} max_freq=${max_freq} ${hid_quirks} ${extraargs}"
# Booting
ext4load mmc 0:1 0x21000000 /boot/uImage || fatload mmc 0:1 0x21000000 uImage || ext4load mmc 0:1 0x21000000 uImage
@ -88,7 +104,6 @@ ext4load mmc 0:1 0x21800000 /boot/dtb/meson8b-odroidc1.dtb
fdt addr 21800000
if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi
if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi
bootm 0x21000000 0x22000000 0x21800000

View File

@ -17,13 +17,21 @@ case $BRANCH in
CAN_BUILD_STRETCH=no
;;
dev)
next)
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
KERNELBRANCH='branch:linux-4.17.y'
KERNELDIR=$MAINLINE_KERNEL_DIR
KERNEL_USE_GCC='> 7.0'
;;
dev)
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
KERNELBRANCH='branch:master'
KERNELDIR=$MAINLINE_KERNEL_DIR
KERNEL_USE_GCC='> 7.0'
;;
esac
CPUMIN=504000

View File

@ -5,5 +5,12 @@
echo "update-initramfs: Converting to u-boot format" >&2
tempname="/boot/uInitrd-$1"
mkimage -A $INITRD_ARCH -O linux -T ramdisk -C gzip -n uInitrd -d $2 $tempname > /dev/null
# odroid exception
if [ "$BOARD" = odroidc1 ] && [ "$BRANCH" = default ]; then
odroidtemp="/boot/odroid"
mkimage -A $INITRD_ARCH -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d $tempname $odroidtemp
mv $odroidtemp $tempname
echo "Odroid C1 default uInitrd"
fi
ln -sf $(basename $tempname) /boot/uInitrd > /dev/null 2>&1 || mv $tempname /boot/uInitrd
exit 0

File diff suppressed because it is too large Load Diff

View File

@ -11,3 +11,17 @@ index 3216e09..21bce28
static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;
static int __init early_coherent_pool(char *p)
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ada8eb2..8df220f
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -381,7 +381,7 @@ static void __dma_free_remap(void *cpu_addr, size_t size)
VM_ARM_DMA_CONSISTENT | VM_USERMAP);
}
-#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
+#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_2M
static struct gen_pool *atomic_pool __ro_after_init;
static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE;

View File

@ -5,7 +5,7 @@ index 90c9a8a..3c79b90 100755
@@ -29,6 +29,27 @@ create_package() {
# in case we are in a restrictive umask environment like 0077
chmod -R a+rX "$pdir"
+ # Create preinstall and post install script to remove dtb
+ if [[ "$1" == *dtb* ]]; then
+ echo "if [ -d /boot/dtb-$version ]; then mv /boot/dtb-$version /boot/dtb-$version.old; fi" >> $pdir/DEBIAN/preinst
@ -38,12 +38,12 @@ index 90c9a8a..3c79b90 100755
-kernel_headers_packagename=linux-headers-$version
-libc_headers_packagename=linux-libc-dev
+dtb_dir="$objtree/debian/dtbtmp"
+packagename=linux-image-dev"$LOCALVERSION"
+kernel_headers_packagename=linux-headers-dev"$LOCALVERSION"
+dtb_packagename=linux-dtb-dev"$LOCALVERSION"
+libc_headers_packagename=linux-libc-dev-dev"$LOCALVERSION"
+packagename=linux-image-next"$LOCALVERSION"
+kernel_headers_packagename=linux-headers-next"$LOCALVERSION"
+dtb_packagename=linux-dtb-next"$LOCALVERSION"
+libc_headers_packagename=linux-libc-next-dev"$LOCALVERSION"
dbg_packagename=$packagename-dbg
if [ "$ARCH" = "um" ] ; then
@@ -52,6 +75,15 @@ fi
# XXX: have each arch Makefile export a variable of the canonical image install
@ -63,7 +63,7 @@ index 90c9a8a..3c79b90 100755
;;
@@ -65,7 +97,9 @@ esac
BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
# Setup the directory structure
-rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
+rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" "$dtb_dir" $objtree/debian/files
@ -75,7 +75,7 @@ index 90c9a8a..3c79b90 100755
@@ -118,6 +152,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
fi
fi
+if grep -q '^CONFIG_OF=y' $KCONFIG_CONFIG ; then
+ #mkdir -p "$tmpdir/boot/dtb"
+ INSTALL_DTBS_PATH="$dtb_dir/boot/dtb-$version" $MAKE KBUILD_SRC= dtbs_install
@ -90,13 +90,13 @@ index 90c9a8a..3c79b90 100755
cat <<EOF > "$tmpdir/DEBIAN/$script"
-#!/bin/sh
+#!/bin/bash
set -e
@@ -153,9 +192,60 @@ EOF
chmod 755 "$tmpdir/DEBIAN/$script"
done
+##
+## Create sym link to kernel image
+##
@ -164,7 +164,7 @@ index 90c9a8a..3c79b90 100755
(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
+(cd $destdir; make M=scripts clean)
+
if [ "$ARCH" != "um" ]; then
@ -173,7 +173,7 @@ index 90c9a8a..3c79b90 100755
+ # create_package "$libc_headers_packagename" "$libc_headers_dir"
+ create_package "$dtb_packagename" "$dtb_dir"
fi
create_package "$packagename" "$tmpdir"
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 6adb3a1..00e12eb 100755
@ -185,14 +185,14 @@ index 6adb3a1..00e12eb 100755
sourcename=$KDEB_SOURCENAME
-packagename=linux-image-$version
-kernel_headers_packagename=linux-headers-$version
+packagename=linux-image-dev$LOCALVERSION
+kernel_headers_packagename=linux-headers-dev$LOCALVERSION
+dtb_packagename=linux-dtb-dev$LOCALVERSION
+packagename=linux-image-next$LOCALVERSION
+kernel_headers_packagename=linux-headers-next$LOCALVERSION
+dtb_packagename=linux-dtb-next$LOCALVERSION
dbg_packagename=$packagename-dbg
debarch=
+image_name=
set_debarch
if [ "$ARCH" = "um" ] ; then
@@ -168,6 +170,11 @@ Architecture: $debarch
Description: Linux kernel debugging symbols for $version
@ -204,18 +204,18 @@ index 6adb3a1..00e12eb 100755
+Description: Linux DTB, version $version
+ This package contains device blobs from the Linux kernel, version $version
EOF
cat <<EOF > debian/rules
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f839ecd9..cd276162 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -103,7 +103,7 @@ core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
# Default target when executing plain make
boot := arch/arm64/boot
-KBUILD_IMAGE := $(boot)/Image.gz
+KBUILD_IMAGE := $(boot)/Image
KBUILD_DTBS := dtbs
all: Image.gz $(KBUILD_DTBS)