Odroid-C2: Move to 4.17 kernel, rework directories

This commit is contained in:
Ryan Bray
2018-08-21 02:56:00 -06:00
parent 7006a5fd64
commit 0f8010bc90
53 changed files with 4838 additions and 3583 deletions

View File

@@ -0,0 +1,129 @@
# Custom modeline!
# To use custom modeline you need to disable all the below resolutions
# and setup your own!
# For more information check our wiki:
# http://odroid.com/dokuwiki/doku.php?id=en:c2_hdmi_autosetting
# Example below:
#m=custombuilt
#modeline=1920,1200,154000,74040,60,1920,1968,2000,2080,1200,1202,1208,1235,1,0,1
# 480 Lines (720x480)
#m=480i60hz
#m=480i_rpt
#m=480p60hz
#m=480p_rpt
# 576 Lines (720x576)
#m=576i50hz
#m=576i_rpt
#m=576p50hz
#m=576p_rpt
# 720 Lines (1280x720)
#m=720p50hz
#m=720p60hz
# 1080 Lines (1920x1080)
#m=1080i60hz
m=1080p60hz
#m=1080i50hz
#m=1080p50hz
#m=1080p24hz
# 4K (3840x2160)
#m=2160p30hz
#m=2160p25hz
#m=2160p24hz
#m=smpte24hz
#m=2160p50hz
#m=2160p60hz
#m=2160p50hz420
#m=2160p60hz420
### VESA modes ###
#m=640x480p60hz
#m=800x480p60hz
#m=480x800p60hz
#m=800x600p60hz
#m=1024x600p60hz
#m=1024x768p60hz
#m=1280x800p60hz
#m=1280x1024p60hz
#m=1360x768p60hz
#m=1440x900p60hz
#m=1600x900p60hz
#m=1680x1050p60hz
#m=1600x1200p60hz
#m=1920x1200p60hz
#m=2560x1080p60hz
#m=2560x1440p60hz
#m=2560x1600p60hz
#m=3440x1440p60hz
# HDMI BPP Mode
m_bpp=32
#m_bpp=24
#m_bpp=16
# HDMI DVI/VGA modes
# By default its set to HDMI, if needed change below.
# Uncomment only a single Line.
#vout=dvi
#vout=vga
# HDMI HotPlug Detection control
# Allows you to force HDMI thinking that the cable is connected.
# true = HDMI will believe that cable is always connected
# false = will let board/monitor negotiate the connection status
hpd=true
#hpd=false
# Monitor output
# Controls if HDMI PHY should output anything to the monitor
monitor_onoff=false
# Server Mode (aka. No Graphics)
# Setting nographics to 1 will disable all video subsystem
# This mode is ideal of server type usage. (Saves ~300Mb of RAM)
nographics=0
# Meson Timer
# 1 - Meson Timer
# 0 - Arch Timer
# Using meson_timer improves the video playback however it breaks KVM (virtualization).
# Using arch timer allows KVM/Virtualization to work however you'll experience poor video
mesontimer=1
# UHS (Ultra High Speed) MicroSD mode enable/disable
disableuhs=false
# MicroSD Card Detection enable/disable
# Force the MMC controlled to believe that a card is connected.
mmc_removable=true
# USB Multi WebCam tweak
# Only enable this if you use it.
usbmulticam=false
# 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
#maxcpus=1
#maxcpus=2
#maxcpus=3
maxcpus=4
# MAX Frequency
#max_freq=2016
#max_freq=1944
#max_freq=1944
#max_freq=1920
#max_freq=1896
#max_freq=1752
#max_freq=1680
#max_freq=1656
max_freq=1536

View File

@@ -0,0 +1,13 @@
BOARD_ID=odroid-c2
BOARD_NAME="Hardkernel Odroid-C2"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_ENV=/mnt/boot/uboot.env
BOOT_ENV_OFF=0x0000
BOOT_ENV_SIZE=0x2000
PART_BOOT=/dev/disk/by-partuuid/0d3e0000-01
PART_KERNEL_0=/dev/disk/by-partuuid/0d3e0000-05
PART_KERNEL_1=/dev/disk/by-partuuid/0d3e0000-07
PART_SYSTEM_0=/dev/disk/by-partuuid/0d3e0000-06
PART_SYSTEM_1=/dev/disk/by-partuuid/0d3e0000-08

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
#!/bin/bash
set -e
SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts
BOARD_DIR="$(dirname $0)"
BOOT_DATA=${BINARIES_DIR}/boot
. ${SCRIPT_DIR}/hdd-image.sh
. ${SCRIPT_DIR}/name.sh
. ${SCRIPT_DIR}/ota.sh
. ${BR2_EXTERNAL_HASSOS_PATH}/info
. ${BOARD_DIR}/info
# Init boot data
rm -rf ${BOOT_DATA}
mkdir -p ${BOOT_DATA}
cp ${BINARIES_DIR}/boot.scr ${BOOT_DATA}/boot.scr
cp ${BOARD_DIR}/boot-env.txt ${BOOT_DATA}/uboot-settings.txt
cp ${BINARIES_DIR}/meson-gxbb-odroidc2.dtb ${BOOT_DATA}/meson-gxbb-odroidc2.dtb
echo "console=tty0 console=ttyAML0,115200n8" > ${BOOT_DATA}/cmdline.txt
function make_bootable() {
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb"
local hdd_img="$(hassos_image_name img)"
dd if=${BL1} of=${hdd_img} conv=notrunc bs=1 count=442
dd if=${BL1} of=${hdd_img} conv=notrunc bs=512 skip=1 seek=1
dd if=${UBOOT_GXBB} of=${hdd_img} conv=notrunc bs=512 seek=97
}
# Create other layers
prepare_disk_image
create_disk_mbr 2
make_bootable
convert_disk_image_gz
create_ota_update

View File

@@ -0,0 +1,86 @@
###########################################
test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B"
test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
if load mmc 0:1 ${ramdisk_addr_r} uboot-settings.txt; then
env import -t ${ramdisk_addr_r} ${filesize};
fi
# Board bootargs
if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
setenv bootargs_odroidc2 "${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam}"
# HassOS bootargs
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor cgroup_enable=memory"
# HassOS system A/B
#setenv bootargs_a "root=PARTUUID=0d3e0000-06 rootfstype=squashfs ro"
#setenv bootargs_b "root=PARTUUID=0d3e0000-08 rootfstype=squashfs ro"
#setenv bootargs_a "root=/dev/mmcblk1p6 rootfstype=squashfs ro rootwait"
#setenv bootargs_b "root=/dev/mmcblk1p8 rootfstype=squashfs ro rootwait"
setenv bootargs_a "root=PARTUUID=0d3e0000-06 rootfstype=squashfs ro rootwait"
setenv bootargs_b "root=PARTUUID=0d3e0000-08 rootfstype=squashfs ro rootwait"
usb start
# Load extraargs
fileenv mmc 0:1 ${ramdisk_addr_r} cmdline.txt cmdline
fatload mmc 0:1 ${fdt_addr_r} meson-gxbb-odroidc2.dtb
#fdt addr ${fdt_addr_r}
# logical volumes get numbered after physical ones.
# 1. boot
# 2. Extended partition
# 3. Overlay
# 4. Data
# 5. KernelA
# 6. SystemA
# 7. KernelB
# 8. SystemB
# 9. BootInfo
setenv bootargs
for BOOT_SLOT in "${BOOT_ORDER}"; do
if test "x${bootargs}" != "x"; then
# skip remaining slots
elif test "x${BOOT_SLOT}" = "xA"; then
if test ${BOOT_A_LEFT} -gt 0; then
setexpr BOOT_A_LEFT ${BOOT_A_LEFT} - 1
echo "Found valid slot A, ${BOOT_A_LEFT} attempts remaining"
setenv load_kernel "ext4load mmc 0:5 ${kernel_addr_r} Image"
setenv bootargs "${bootargs_hassos} ${bootargs_odroidc2} ${bootargs_a} rauc.slot=A ${cmdline}"
fi
elif test "x${BOOT_SLOT}" = "xB"; then
if test ${BOOT_B_LEFT} -gt 0; then
setexpr BOOT_B_LEFT ${BOOT_B_LEFT} - 1
echo "Found valid slot B, ${BOOT_B_LEFT} attempts remaining"
setenv load_kernel "ext4load mmc 0:7 ${kernel_addr_r} Image"
setenv bootargs "${bootargs_hassos} ${bootargs_odroidc2} ${bootargs_b} rauc.slot=B ${cmdline}"
fi
fi
done
setenv fdt_addr
if test -n "${bootargs}"; then
saveenv
else
echo "No valid slot found, resetting tries to 3"
setenv BOOT_A_LEFT 3
setenv BOOT_B_LEFT 3
saveenv
reset
fi
echo "Loading kernel"
run load_kernel
echo " Starting kernel"
printenv load_kernel
printenv bootargs
booti ${kernel_addr_r} - ${fdt_addr_r}
echo "Fails on boot"
reset

View File

@@ -0,0 +1,20 @@
# CONFIG_USB_STORAGE is not set
CONFIG_ENV_IS_IN_FAT=y
CONFIG_ENV_FAT_INTERFACE="mmc"
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_ENV_FAT_FILE="uboot.env"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_DISTRO_DEFAULTS=y
# CONFIG_EXPERT is not set
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="HassOS> "
CONFIG_DOS_PARTITION=y
# CONFIG_ISO_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
CONFIG_FS_EXT4=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_CMD_SETEXPR=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_CMD_FILEENV=y