Move Odroid C4 from legacy u-boot toward mainline (#2350)

- move Odroid C4 from legacy u-boot toward mainline
- get rid of dirty legacy u-boot code
- get rid of FAT boot partition
- briefly tested
- both kernels can operate with one standard boot script
- add upstream patch and adjust config
- fix console
- don't clock C4 too high by default
This commit is contained in:
Igor Pečovnik
2020-11-22 13:47:41 +01:00
committed by GitHub
parent 666ac0bc5e
commit e833e2589c
8 changed files with 8045 additions and 79 deletions

View File

@@ -5,5 +5,4 @@ BOOTCONFIG="odroid-c4_defconfig"
KERNEL_TARGET="legacy,current,dev"
FULL_DESKTOP="yes"
SERIALCON="ttyAML0"
FORCE_BOOTSCRIPT_UPDATE="yes"
BOOT_LOGO="desktop"

View File

@@ -14,6 +14,69 @@ setenv bootlogo "false"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
# odroid c4 legacy kernel values from boot.ini
setenv dtb_loadaddr "0x1000000"
setenv k_addr "0x1100000"
setenv loadaddr "0x1B00000"
setenv initrd_loadaddr "0x4080000"
setenv display_autodetect "true"
# HDMI Mode
# Resolution Configuration
# Symbol | Resolution
# ----------------------+-------------
# "480x272p60hz" | 480x272 Progressive 60Hz
# "480x320p60hz" | 480x320 Progressive 60Hz
# "480p60hz" | 720x480 Progressive 60Hz
# "576p50hz" | 720x576 Progressive 50Hz
# "720p60hz" | 1280x720 Progressive 60Hz
# "720p50hz" | 1280x720 Progressive 50Hz
# "1080p60hz" | 1920x1080 Progressive 60Hz
# "1080p50hz" | 1920x1080 Progressive 50Hz
# "1080p30hz" | 1920x1080 Progressive 30Hz
# "1080p24hz" | 1920x1080 Progressive 24Hz
# "1080i60hz" | 1920x1080 Interlaced 60Hz
# "1080i50hz" | 1920x1080 Interlaced 50Hz
# "2160p60hz" | 3840x2160 Progressive 60Hz
# "2160p50hz" | 3840x2160 Progressive 50Hz
# "2160p30hz" | 3840x2160 Progressive 30Hz
# "2160p25hz" | 3840x2160 Progressive 25Hz
# "2160p24hz" | 3840x2160 Progressive 24Hz
# "smpte24hz" | 3840x2160 Progressive 24Hz SMPTE
# "2160p60hz420" | 3840x2160 Progressive 60Hz YCbCr 4:2:0
# "2160p50hz420" | 3840x2160 Progressive 50Hz YCbCr 4:2:0
# "640x480p60hz" | 640x480 Progressive 60Hz
# "800x480p60hz" | 800x480 Progressive 60Hz
# "800x600p60hz" | 800x600 Progressive 60Hz
# "1024x600p60hz" | 1024x600 Progressive 60Hz
# "1024x768p60hz" | 1024x768 Progressive 60Hz
# "1280x800p60hz" | 1280x800 Progressive 60Hz
# "1280x1024p60hz" | 1280x1024 Progressive 60Hz
# "1360x768p60hz" | 1360x768 Progressive 60Hz
# "1440x900p60hz" | 1440x900 Progressive 60Hz
# "1600x900p60hz" | 1600x900 Progressive 60Hz
# "1600x1200p60hz" | 1600x1200 Progressive 60Hz
# "1680x1050p60hz" | 1680x1050 Progressive 60Hz
# "1920x1200p60hz" | 1920x1200 Progressive 60Hz
# "2560x1080p60hz" | 2560x1080 Progressive 60Hz
# "2560x1440p60hz" | 2560x1440 Progressive 60Hz
# "2560x1600p60hz" | 2560x1600 Progressive 60Hz
# "3440x1440p60hz" | 3440x1440 Progressive 60Hz
setenv hdmimode "1080p60hz"
setenv monitor_onoff "false"
setenv overscan "100"
setenv sdrmode "auto"
setenv voutmode "hdmi"
setenv disablehpd "false"
setenv cec "false"
setenv disable_vu7 "true"
setenv max_freq_a55 "1908"
#setenv max_freq_a55 "2100"
setenv maxcpus "4"
# legacy kernel values from boot.ini
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
load ${devtype} ${devnum} ${load_addr} ${prefix}armbianEnv.txt
env import -t ${load_addr} ${filesize}
@@ -22,51 +85,72 @@ fi
# get PARTUUID of first partition on SD/eMMC it was loaded from
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
if test "${console}" = "display"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyAML0,115200"; fi
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyAML0,115200 console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyAML0,115200"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 coherent_pool=2M loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
if test -e ${devtype} ${devnum} ${prefix}zImage; then
# legacy kernel boot
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyS0,115200 console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyS0,115200"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 coherent_pool=2M loglevel=${verbosity} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a55=${max_freq_a55} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} ${cec_enable} sdrmode=${sdrmode} consoleblank=0"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
load ${devtype} ${devnum} ${k_addr} boot/zImage
load ${devtype} ${devnum} ${dtb_loadaddr} boot/dtb/amlogic/meson64_odroidc4.dtb
load ${devtype} ${devnum} ${initrd_loadaddr} boot/uInitrd
fdt addr ${dtb_loadaddr}
unzip ${k_addr} ${loadaddr}
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
else
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
# moder kernel boot
if test "${console}" = "serial"; then setenv consoleargs "console=ttyAML0,115200"; fi
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=ttyAML0,115200 console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "console=ttyAML0,115200"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.armbian ${consoleargs}"; fi
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 coherent_pool=2M loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${load_addr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${load_addr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${load_addr}
fi
fi
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
fi
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

View File

@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 4.9.241 Kernel Configuration
# Linux/arm64 4.9.244 Kernel Configuration
#
CONFIG_ARM64=y
CONFIG_64BIT=y
@@ -299,7 +299,7 @@ CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
# CONFIG_BLK_DEV_INTEGRITY is not set
CONFIG_BLK_DEV_INTEGRITY=y
# CONFIG_BLK_CMDLINE_PARSER is not set
#
@@ -2325,6 +2325,13 @@ CONFIG_DM_VERITY_FEC=y
CONFIG_DM_LOG_WRITES=m
CONFIG_DM_VERITY_AVB=m
# CONFIG_DM_ANDROID_VERITY_AT_MOST_ONCE_DEFAULT_ENABLED is not set
CONFIG_TARGET_CORE=m
CONFIG_TCM_IBLOCK=m
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
CONFIG_TCM_USER2=m
CONFIG_LOOPBACK_TARGET=m
CONFIG_ISCSI_TARGET=m
# CONFIG_FUSION is not set
#
@@ -4969,6 +4976,7 @@ CONFIG_USB_U_ETHER=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_TCM=m
CONFIG_USB_F_MTP=y
CONFIG_USB_F_PTP=y
CONFIG_USB_F_AUDIO_SRC=y
@@ -4997,6 +5005,7 @@ CONFIG_USB_CONFIGFS_F_MIDI=y
# CONFIG_USB_CONFIGFS_F_HID is not set
# CONFIG_USB_CONFIGFS_F_UVC is not set
# CONFIG_USB_CONFIGFS_F_PRINTER is not set
CONFIG_USB_CONFIGFS_F_TCM=y
# CONFIG_USB_LED_TRIG is not set
# CONFIG_USB_ULPI_BUS is not set
# CONFIG_UWB is not set
@@ -6240,7 +6249,9 @@ CONFIG_NLS_UTF8=m
CONFIG_VIRTUALIZATION=y
# CONFIG_KVM is not set
# CONFIG_VHOST_NET is not set
CONFIG_VHOST_SCSI=m
# CONFIG_VHOST_VSOCK is not set
CONFIG_VHOST=m
# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set
#
@@ -6755,12 +6766,3 @@ CONFIG_FONT_10x18=y
CONFIG_SG_POOL=y
CONFIG_ARCH_HAS_SG_CHAIN=y
CONFIG_SBITMAP=y
## LinuxIO - iSCSI Target modules
CONFIG_TARGET_CORE=m
CONFIG_ISCSI_TARGET=m
CONFIG_TCM_IBLOCK=m
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
CONFIG_TCM_USER2=m

View File

@@ -1,38 +1,10 @@
source "${BASH_SOURCE%/*}/include/meson64_common.inc"
ASOUND_STATE="asound.state.meson64"
CPUMIN=667000
CPUMAX=2016000
CPUMAX=2100000
GOVERNOR=ondemand
if [[ $BRANCH == legacy ]]; then
OVERLAY_PREFIX='meson/odroidc4'
BOOTCONFIG="odroidc4_defconfig"
BOOTSCRIPT="boot-odroid-c4.ini:boot.ini"
UBOOT_TARGET_MAP=';;sd_fuse/u-boot.bin'
SERIALCON=ttyS0
UBOOT_USE_GCC='< 4.9'
UBOOT_TOOLCHAIN2="arm-none-eabi-:< 5.0"
UBOOT_COMPILER="aarch64-none-elf-"
BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidg12-v2015.01'
BOOTPATCHDIR='u-boot-odroid'
BOOTDIR='u-boot-odroid'
# unstable EXT4 support
BOOTSIZE="200"
BOOTFS_TYPE="fat"
write_uboot_platform()
{
dd if=$1/u-boot.bin of=$2 bs=512 seek=1 conv=fsync > /dev/null 2>&1
}
fi
[[ $BRANCH == legacy ]] && SERIALCON=ttyS0
family_tweaks()
{
@@ -41,7 +13,7 @@ family_tweaks()
uboot_custom_postprocess()
{
if [[ $BOARD == odroid*c4 && $BRANCH != legacy ]]; then
if [[ $BOARD == odroid*c4 ]]; then
uboot_g12_postprocess $SRC/cache/sources/amlogic-boot-fip/odroid-c4 g12a
fi
}

View File

@@ -456,6 +456,7 @@ odroidn2 current focal cli stable yes
# Odroid C4
odroidc4 legacy focal desktop stable yes
odroidc4 legacy buster cli stable yes
odroidc4 current focal desktop stable yes
odroidc4 current buster cli stable yes
odroidc4 current bullseye cli stable yes
@@ -464,6 +465,7 @@ odroidc4 current groovy cli stable yes
# Odroid HC4
odroidhc4 legacy focal cli stable yes
odroidhc4 legacy buster cli stable yes
odroidhc4 current buster cli stable yes
odroidhc4 current focal cli stable yes
odroidhc4 current groovy cli stable yes

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
diff --git a/Makefile b/Makefile
index d41de2c1159e7..c6fcfe4bfeed5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
-SUBLEVEL = 242
+SUBLEVEL = 243
EXTRAVERSION =
NAME = Roaring Lionus
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index 5b10b50f8686f..5c064df7d81f1 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -379,9 +379,9 @@ static void create_power_zone_common_attributes(
&dev_attr_max_energy_range_uj.attr;
if (power_zone->ops->get_energy_uj) {
if (power_zone->ops->reset_energy_uj)
- dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUGO;
+ dev_attr_energy_uj.attr.mode = S_IWUSR | S_IRUSR;
else
- dev_attr_energy_uj.attr.mode = S_IRUGO;
+ dev_attr_energy_uj.attr.mode = S_IRUSR;
power_zone->zone_dev_attrs[count++] =
&dev_attr_energy_uj.attr;
}

File diff suppressed because it is too large Load Diff