...
 
Commits (6)
......@@ -40,6 +40,9 @@ password: **password**
+ [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)
* BCM2711
+ [Raspberry Pi 4](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/) board provided by user [wowbaggerHU](https://www.linuxquestions.org/questions/user/wowbaggerhu-1042789/)
* Amlogic
* S905X3
+ [Odroid-C4](https://wiki.odroid.com/odroid-c4/hardware/hardware#specifications)
# BUILD #
......
legacy blobs: https://github.com/hardkernel/u-boot/releases/
......@@ -170,7 +170,11 @@ if [[ $COMPILE_BINARIES == true ]]; then
# aarch64 change interpreter path
[[ $MARCH == aarch64 ]] && change_interpreter_path "${XTOOLS[@]}"
clear_boot_tools
[[ ! -z $ATF && $SOCFAMILY == rk33* ]] && compile_boot_tools
# if [[ ! -z $ATF && $SOCFAMILY == rk33* ]] || [[ $SOCFAMILY == meson* ]]; then
if [[ ! -z $ATF && $SOCFAMILY == rk33* ]]; then
[[ $DOWNLOAD_SOURCE_BINARIES == true ]] && patching_source "u-boot-tools"
compile_boot_tools
fi
[[ ! -z $ATF && $DOWNLOAD_SOURCE_BINARIES == true ]] && ( patching_source "atf" && compile_atf )
[[ $DOWNLOAD_SOURCE_BINARIES == true ]] && patching_source "u-boot"
......
......@@ -42,6 +42,8 @@ build_kernel_pkg() {
cp -a $SOURCE/$KERNEL_DIR/arch/${KARCH}/boot/dts/overlays/{*.dtbo,README} \
$BUILD/$PKG/kernel-${SOCFAMILY}/boot/overlays/ >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
fi
[[ $SOCFAMILY == meson* ]] && ( cp -a $SOURCE/$KERNEL_DIR/arch/${KARCH}/boot/dts/amlogic/*.dtb \
$BUILD/$PKG/kernel-${SOCFAMILY}/boot/dtb/ >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1 )
else
cp -a $SOURCE/$KERNEL_DIR/arch/${KARCH}/boot/dts/*${SOCFAMILY}*dtb \
$BUILD/$PKG/kernel-${SOCFAMILY}/boot/dtb/ >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
......
......@@ -379,11 +379,14 @@ create_initrd() {
setting_bootloader() {
message "" "setting" "bootloader"
# u-boot config
install -Dm644 $CWD/config/boot_scripts/boot-$SOCFAMILY.cmd "$SOURCE/$ROOTFS/boot/boot.cmd"
# u-boot serial inteface config
sed -e "s:%SERIAL_CONSOLE%:${SERIAL_CONSOLE}:g" \
-e "s:%SERIAL_CONSOLE_SPEED%:${SERIAL_CONSOLE_SPEED}:g" \
-i "$SOURCE/$ROOTFS/boot/boot.cmd"
if [[ -f $CWD/config/boot_scripts/boot-$SOCFAMILY.cmd ]]; then
install -Dm644 $CWD/config/boot_scripts/boot-$SOCFAMILY.cmd "$SOURCE/$ROOTFS/boot/boot.cmd"
# u-boot serial inteface config
sed -e "s:%SERIAL_CONSOLE%:${SERIAL_CONSOLE}:g" \
-e "s:%SERIAL_CONSOLE_SPEED%:${SERIAL_CONSOLE_SPEED}:g" \
-i "$SOURCE/$ROOTFS/boot/boot.cmd"
fi
[[ -f $CWD/config/boot_scripts/boot-$SOCFAMILY.ini ]] && install -Dm644 $CWD/config/boot_scripts/boot-$SOCFAMILY.ini "$SOURCE/$ROOTFS/boot/boot.ini"
# compile boot script
[[ -f $SOURCE/$ROOTFS/boot/boot.cmd ]] && ( $SOURCE/$BOOT_LOADER_DIR/tools/mkimage -C none -A arm -T script -d $SOURCE/$ROOTFS/boot/boot.cmd \
"$SOURCE/$ROOTFS/boot/boot.scr" >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1 )
......
......@@ -57,7 +57,7 @@ compile_boot_loader() {
fi
fi
if [[ $SOCFAMILY == sun* || $SOCFAMILY == bcm2* ]]; then
if [[ $SOCFAMILY == sun* || $SOCFAMILY == bcm2* || $SOCFAMILY == meson* ]]; then
if [ "$KERNEL_SOURCE" != "next" ] ; then
# patch mainline uboot configuration to boot with old kernels
if [ "$(cat $SOURCE/$BOOT_LOADER_DIR/.config | grep CONFIG_ARMV7_BOOT_SEC_DEFAULT=y)" == "" ]; then
......@@ -115,15 +115,21 @@ compile_boot_tools() {
message "" "compiling" "$BOOT_LOADER_TOOLS_DIR $BOOT_LOADER_TOOLS_BRANCH"
cd $SOURCE/$BOOT_LOADER_TOOLS_DIR >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
if [[ $MARCH == "x86_64" ]]; then
if [[ $MARCH == "x86_64" && $SOCFAMILY == rk33* ]]; then
ln -sf ../../rkbin/tools/boot_merger tools/boot_merger
ln -sf ../../rkbin/tools/trust_merger tools/trust_merger
return 0
fi
make clean >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
make ${SOCFAMILY}_defconfig >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
make $CTHREADS tools >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
if [[ $SOCFAMILY == rk33* ]]; then
make ${SOCFAMILY}_defconfig >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
make $CTHREADS tools >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
fi
if [[ $SOCFAMILY == meson* ]]; then
make ${BOARD_NAME}_defconfig >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
make $CTHREADS >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
fi
}
......
_ ___ ___
___ | | ___ ___ _____ | _|| | |
|_ -|| || .'|| _|| || . ||_ |
|___||_||__,||_| |_|_|_||___| |_|
_ _ _ ___
___ _| | ___ ___ |_| _| | ___ | | |
| . || . || _|| . || || . | | _||_ |
|___||___||_| |___||_||___| |___| |_|
#---------------------------------------------
# odroid c4
# S905X3 quad core 4GB SoC GBE 4xUSB3 eMMC SPI
#---------------------------------------------
BOARD_NAME="odroid_c4"
SOCFAMILY=meson-sm1
BOOT_LOADER_CONFIG="${BOARD_NAME//_/-}_defconfig"
DISTR=slarm64
ARCH_KERNEL=arm64
case $KERNEL_SOURCE in
legacy)
DEVICE_TREE_BLOB=$SOCFAMILY-${BOARD_NAME//_/-}.dtb
LINUX_CONFIG="linux-${SOCFAMILY}-${KERNEL_SOURCE}.config"
ROOT_DISK="mmcblk0p1"
;;
next)
DEVICE_TREE_BLOB=$SOCFAMILY-${BOARD_NAME//_/-}.dtb
LINUX_CONFIG="linux-${SOCFAMILY}-${KERNEL_SOURCE}.config"
ROOT_DISK="mmcblk0p1"
;;
esac
ODROIDC4-UBOOT-CONFIG
setenv rootdev "/dev/mmcblk0p1"
setenv rootfstype "ext4"
# Default Console Device Setting
setenv condev "console=ttyS0,115200n8 console=tty1 loglevel=1" # on both
# Auto Detection of Monitor settings based on your Screen information
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"
# Monitor output
# Controls if HDMI PHY should output anything to the monitor
setenv monitor_onoff "false" # true or false
# Overscan percentage
# This value scales down the actual screen size by the percentage below
# valid range is 80 to 100
setenv overscan "100"
# SDR/HDR Configuration
# This forces SDR or HDR modes
# valid options are: sdr hdr auto
setenv sdrmode "auto"
### voutmode : hdmi or dvi
setenv voutmode "hdmi"
# setenv voutmode "dvi"
# HPD enable/disable option
setenv disablehpd "false"
# Enable/Disable CEC
setenv cec "false"
# Hardkernel ODROID-VU7 support
# By default VU7 support is disabled
setenv disable_vu7 "true"
# setenv disable_vu7 "false"
# max cpu frequency for little core, A55 in MHz unit
# setenv max_freq_a55 "2016" # 2.016 Ghz
setenv max_freq_a55 "1908" # 1.908 GHz, default value
# setenv max_freq_a55 "1800" # 1.8 Ghz
# setenv max_freq_a55 "1704" # 1.704 GHz
# max cpu-cores
setenv maxcpus "4"
### Normal HDMI Monitors
if test "${display_autodetect}" = "true"; then hdmitx edid; fi
if test "${hdmimode}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
if test "${cec}" = "true"; then setenv cec_enable "hdmitx=cec3f"; fi
# VU7 Settings
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
# load nEnv.txt
if ext4load mmc ${devno}:1 0x44000000 /boot/uEnv.txt || fatload mmc ${devno}:1 0x44000000 uEnv.txt || ext4load mmc ${devno}:1 0x44000000 uEnv.txt; then env import -t 0x44000000 ${filesize}; fi
# Boot Args
setenv bootargs "root=${rootdev} ro rootwait rootflags=data=writeback rootfstype=${rootfstype} ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} logo=osd0,loaded ${cec_enable} ${bootsplash} sdrmode=${sdrmode} consoleblank=0"
# Set load addresses
setenv dtb_loadaddr "0x1000000"
setenv k_addr "0x1100000"
setenv loadaddr "0x1B00000"
setenv initrd_loadaddr "0x4080000"
# Load kernel, dtb and initrd
#fatload mmc ${devno}:1 ${k_addr} ${prefix}zImage
fatload mmc ${devno}:1 ${k_addr} ${prefix}Image
fatload mmc ${devno}:1 ${dtb_loadaddr} ${prefix}dtb/meson-sm1-odroid-c4.dtb
fdt addr ${dtb_loadaddr}
# unzip the kernel
#unzip ${k_addr} ${loadaddr}
if fatload mmc ${devno}:1 ${initrd_loadaddr} ${prefix}uInitrd; then
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}
else
booti ${loadaddr} - ${dtb_loadaddr}
fi
# DO NOT EDIT THIS FILE
#
# Please edit /boot/uEnv.txt to set supported parameters
#
setenv load_addr "0x34000000"
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
# default values
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "both"
setenv rootfstype "ext4"
if test -e ${devtype} ${devnum} ${prefix}uEnv.txt; then
load ${devtype} ${devnum} ${load_addr} ${prefix}uEnv.txt
env import -t ${load_addr} ${filesize}
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" || test "${console}" = "both"; then setenv consoleargs "console=%SERIAL_CONSOLE%,%SERIAL_CONSOLE_SPEED%n8"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=tty1"; fi
setenv bootargs "root=${rootdev} ro rootwait rootfstype=${rootfstype} init=/sbin/init ${consoleargs} consoleblank=0 coherent_pool=2M loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
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
if load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd; then
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r};
else
booti ${kernel_addr_r} - ${fdt_addr_r};
fi
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
INITRD_MODULES="ext4:btrfs:xfs"
BOOT_LOADER_TOOLS_SOURCE="https://github.com/hardkernel/u-boot.git"
BOOT_LOADER_TOOLS_DIR="u-boot-tools-amlogic"
BOOT_LOADER_TOOLS_BRANCH="odroidg12-v2015.01::"
FIRMWARE="firmware"
SERIAL_CONSOLE_SPEED=115200
SERIAL_CONSOLE=ttyAML0
IMAGE_OFFSET=2048
BOOT_LOADER_BIN="u-boot.bin"
case $KERNEL_SOURCE in
legacy)
LINUX_SOURCE="https://github.com/hardkernel/linux.git"
KERNEL_BRANCH="odroidg12-4.9.y::"
KERNEL_DIR="linux-$SOCFAMILY-$KERNEL_SOURCE"
;;
esac
create_uboot()
{
if [[ -f $CWD/blobs/amlogic/boot/$BOARD_NAME/u-boot-${KERNEL_SOURCE}.bin ]]; then
install -Dm644 $CWD/blobs/amlogic/boot/$BOARD_NAME/u-boot-${KERNEL_SOURCE}.bin $BUILD/$OUTPUT/$TOOLS/$BOARD_NAME/boot/$BOOT_LOADER_BIN >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
return 0
fi
pushd $SOURCE/$BOOT_LOADER_DIR >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
install -Dm644 $BOOT_LOADER_BIN $BUILD/$OUTPUT/$TOOLS/$BOARD_NAME/boot/$BOOT_LOADER_BIN >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
popd >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
}
write_uboot()
{
if [[ -f $BUILD/$OUTPUT/$TOOLS/$BOARD_NAME/boot/$BOOT_LOADER_BIN ]]; then
dd if=$BUILD/$OUTPUT/$TOOLS/$BOARD_NAME/boot/$BOOT_LOADER_BIN of=$1 conv=fsync bs=512 seek=1 status=noxfer >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
message "" "write" "bootloader: $BOOT_LOADER_BIN"
fi
}
#create_img() {
#
# if [[ $1 == xfce ]]; then
# IMAGE="$ROOTFS_XFCE"
# else
# IMAGE="$ROOTFS"
# fi
#
# # +800M for create swap firstrun
# ROOTFS_SIZE=$(rsync -an --stats $SOURCE/$IMAGE test | grep "Total file size" | sed 's/[^0-9]//g' | xargs -I{} expr {} / $((1024*1024)) + 1000)"M"
#
# message "" "create" "image size $ROOTFS_SIZE"
#
# dd if=/dev/zero of=$SOURCE/$IMAGE.img bs=1 count=0 seek=$ROOTFS_SIZE >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
#
# LOOP=$(losetup -f)
#
# losetup $LOOP $SOURCE/$IMAGE.img || exit 1
#
# message "" "create" "partition"
# echo -e "\no\nn\np\n1\n$IMAGE_OFFSET\n+100M\n\nt\nc\nn\np\n2\n\n\nw" | fdisk $LOOP >> $LOG 2>&1 || true
#
# partprobe $LOOP >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
#
# message "" "create" "filesystem"
# mkfs.vfat ${LOOP}p1 >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
# mkfs.ext4 -F -m 0 -L linuxroot ${LOOP}p2 >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
#
# message "" "tune" "filesystem"
# tune2fs -o journal_data_writeback ${LOOP}p2 >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
# tune2fs -O ^has_journal ${LOOP}p2 >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
# e2fsck -yf ${LOOP}p2 >> $LOG 2>&1 || (message "err" "details" && exit 1) || exit 1
#
# message "" "create" "mount point and mount image"
#
# mkdir -p $SOURCE/image
# mount ${LOOP}p2 $SOURCE/image
# mkdir -p $SOURCE/image/boot
# mount ${LOOP}p1 $SOURCE/image/boot
#
# write_uboot $LOOP
#
# rsync -a "$SOURCE/$IMAGE/" "$SOURCE/image/"
#
# umount $SOURCE/image/boot
# umount $SOURCE/image
#
# if [[ -d $SOURCE/image ]]; then
# rm -rf $SOURCE/image
# fi
# losetup -d $LOOP
#
# if [[ -f $SOURCE/$IMAGE.img ]]; then
# mv $SOURCE/$IMAGE.img $BUILD/$OUTPUT/$IMAGES
# fi
#
# message "" "done" "image $IMAGE"
#}
source "$CWD/config/sources/amlogic.inc" || exit 1
#BOOT_LOADER_BRANCH="master:tag:v2020.07"
......@@ -8,7 +8,7 @@ RKBIN_DIR="rkbin"
RKBIN_BRANCH="master::"
BOOT_LOADER_TOOLS_SOURCE="https://github.com/rockchip-linux/u-boot.git"
BOOT_LOADER_TOOLS_DIR="u-boot-tools"
BOOT_LOADER_TOOLS_DIR="u-boot-tools-rockchip"
BOOT_LOADER_TOOLS_BRANCH="next-dev::"
FIRMWARE="firmware"
......
......@@ -116,10 +116,17 @@ patching_source() {
"$CWD/patch/u-boot/$SOCFAMILY"
"$CWD/patch/u-boot/$SOCFAMILY/$KERNEL_SOURCE"
"$CWD/patch/u-boot/$SOCFAMILY/$BOARD_NAME"
"$CWD/patch/u-boot/$SOCFAMILY/$BOARD_NAME/$KERNEL_SOURCE"
)
PATCH_SOURCE="$SOURCE/$BOOT_LOADER_DIR"
;;
u-boot-tools)
dirs=(
"$CWD/patch/u-boot-tools/$SOCFAMILY"
"$CWD/patch/u-boot-tools/$SOCFAMILY/$KERNEL_SOURCE"
"$CWD/patch/u-boot-tools/$SOCFAMILY/$BOARD_NAME"
)
PATCH_SOURCE="$SOURCE/$BOOT_LOADER_TOOLS_DIR"
;;
atf)
dirs=( "$CWD/patch/atf/$SOCFAMILY"
"$CWD/patch/atf/$SOCFAMILY/$BOARD_NAME"
......
Upstream-Status: Backport
From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Sat, 7 Feb 2015 22:52:40 +0100
Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5
Add linux/compiler-gcc5/h from the kernel sources at:
commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
Author: Steven Noonan <[email protected]>
Date: Sat Oct 25 15:09:42 2014 -0700
compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
Signed-off-by: Hans de Goede <[email protected]>
---
include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 include/linux/compiler-gcc5.h
Index: git/include/linux/compiler-gcc5.h
===================================================================
--- /dev/null
+++ git/include/linux/compiler-gcc5.h
@@ -0,0 +1,65 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
+#endif
+
+#define __used __attribute__((__used__))
+#define __must_check __attribute__((warn_unused_result))
+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
+
+/* Mark functions as cold. gcc will assume any path leading to a call
+ to them will be unlikely. This means a lot of manual unlikely()s
+ are unnecessary now for any paths leading to the usual suspects
+ like BUG(), printk(), panic() etc. [but let's keep them for now for
+ older compilers]
+
+ Early snapshots of gcc 4.3 don't support this and we can't detect this
+ in the preprocessor, but we can live with this because they're unreleased.
+ Maketime probing would be overkill here.
+
+ gcc also has a __attribute__((__hot__)) to move hot functions into
+ a special section, but I don't see any sense in this right now in
+ the kernel context */
+#define __cold __attribute__((__cold__))
+
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
+
+#ifndef __CHECKER__
+# define __compiletime_warning(message) __attribute__((warning(message)))
+# define __compiletime_error(message) __attribute__((error(message)))
+#endif /* __CHECKER__ */
+
+/*
+ * Mark a position in code as unreachable. This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ *
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
+ * this in the preprocessor, but we can live with this because they're
+ * unreleased. Really, we need to have autoconf for the kernel.
+ */
+#define unreachable() __builtin_unreachable()
+
+/* Mark a function definition as prohibited from being cloned. */
+#define __noclone __attribute__((__noclone__))
+
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
+
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
+#define __HAVE_BUILTIN_BSWAP16__
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
This diff is collapsed.
diff -Naur Makefile Makefile
--- a/Makefile 2020-09-06 06:02:23.834348950 +0300
--- b/Makefile 2020-09-07 21:01:12.758985809 +0300
@@ -246,7 +246,7 @@
CROSS_COMPILE ?=
endif
-export CROSS_COMPILE=aarch64-none-elf-
+export CROSS_COMPILE=aarch64-unknown-linux-gnu-
KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG
diff -Naur arch/arm/cpu/armv8/axg/firmware/scp_task/Makefile arch/arm/cpu/armv8/axg/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/axg/firmware/scp_task/Makefile 2020-09-06 06:02:24.266348107 +0300
--- b/arch/arm/cpu/armv8/axg/firmware/scp_task/Makefile 2020-09-07 21:01:06.110999072 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/g12a/firmware/scp_task/Makefile arch/arm/cpu/armv8/g12a/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/g12a/firmware/scp_task/Makefile 2020-09-06 06:02:24.322347998 +0300
--- b/arch/arm/cpu/armv8/g12a/firmware/scp_task/Makefile 2020-09-07 21:01:06.150998993 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile 2020-09-06 06:02:24.342347958 +0300
--- b/arch/arm/cpu/armv8/g12b/firmware/scp_task/Makefile 2020-09-07 21:01:06.178998937 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile 2020-09-06 06:02:24.366347912 +0300
--- b/arch/arm/cpu/armv8/gxb/firmware/scp_task/Makefile 2020-09-07 21:01:06.206998881 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/gxl/firmware/scp_task/Makefile arch/arm/cpu/armv8/gxl/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/gxl/firmware/scp_task/Makefile 2020-09-06 06:02:24.386347873 +0300
--- b/arch/arm/cpu/armv8/gxl/firmware/scp_task/Makefile 2020-09-07 21:01:06.234998825 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/gxtvbb/firmware/scp_task/Makefile arch/arm/cpu/armv8/gxtvbb/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/gxtvbb/firmware/scp_task/Makefile 2020-09-06 06:02:24.406347834 +0300
--- b/arch/arm/cpu/armv8/gxtvbb/firmware/scp_task/Makefile 2020-09-07 21:01:06.314998665 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/tl1/firmware/scp_task/Makefile arch/arm/cpu/armv8/tl1/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/tl1/firmware/scp_task/Makefile 2020-09-06 06:02:24.422347802 +0300
--- b/arch/arm/cpu/armv8/tl1/firmware/scp_task/Makefile 2020-09-07 21:01:06.346998602 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/txhd/firmware/scp_task/Makefile arch/arm/cpu/armv8/txhd/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/txhd/firmware/scp_task/Makefile 2020-09-06 06:02:24.498347654 +0300
--- b/arch/arm/cpu/armv8/txhd/firmware/scp_task/Makefile 2020-09-07 21:01:06.474998346 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/txl/firmware/scp_task/Makefile arch/arm/cpu/armv8/txl/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/txl/firmware/scp_task/Makefile 2020-09-06 06:02:24.538347576 +0300
--- b/arch/arm/cpu/armv8/txl/firmware/scp_task/Makefile 2020-09-07 21:01:06.522998250 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
diff -Naur arch/arm/cpu/armv8/txlx/firmware/scp_task/Makefile arch/arm/cpu/armv8/txlx/firmware/scp_task/Makefile
--- a/arch/arm/cpu/armv8/txlx/firmware/scp_task/Makefile 2020-09-06 06:02:24.562347529 +0300
--- b/arch/arm/cpu/armv8/txlx/firmware/scp_task/Makefile 2020-09-07 21:01:06.570998155 +0300
@@ -6,7 +6,7 @@
include $(buildtree)/.config
# Select ARMv7-m bare-metal toolchain
-CROSS_COMPILE=arm-none-eabi-
+CROSS_COMPILE=arm-unknown-linux-gnueabi-
ASM=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
CPP=$(CROSS_COMPILE)cpp
--- u-boot-tools-amlogic.1/common/bootm.c 2020-09-06 06:02:28.302340237 +0300
+++ u-boot-tools-amlogic/common/bootm.c 2020-09-08 20:19:51.522349607 +0300
@@ -330,7 +330,7 @@
#ifdef CONFIG_OF_LIBFDT_OVERLAY
static int get_fdto_totalsize(u32 *tz)
{
- unsigned long long dtbo_mem_addr = NULL;
+ unsigned long long dtbo_mem_addr = 0;
int ret;
ret = read_fdto_partition();
@@ -392,7 +392,7 @@
#ifdef CONFIG_OF_LIBFDT_OVERLAY
static int do_fdt_overlay(void)
{
- unsigned long long dtbo_mem_addr = NULL;
+ unsigned long long dtbo_mem_addr = 0;
int dtbo_num = 0;
int i;
char cmd[128];
--- a/configs/rockpro64-rk3399_defconfig 2020-07-15 21:06:42.343280693 +0300
+++ b/configs/rockpro64-rk3399_defconfig 2020-07-12 19:40:49.027763713 +0300
@@ -2,6 +2,8 @@
CONFIG_ARCH_ROCKCHIP=y
--- a/configs/rockpro64-rk3399_defconfig 2020-09-06 13:39:51.757790407 +0300
+++ b/configs/rockpro64-rk3399_defconfig 2020-09-06 13:39:23.857827316 +0300
@@ -3,7 +3,10 @@
CONFIG_SYS_TEXT_BASE=0x00200000
CONFIG_ENV_SIZE=0x8000
+CONFIG_SPL_DM_SPI=y
+CONFIG_ROCKCHIP_RK3399=y
CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_SECT_SIZE=0x1000
+CONFIG_SPL_DM_SPI=y
CONFIG_ROCKCHIP_RK3399=y
+CONFIG_ENV_OFFSET=0x3F8000
CONFIG_TARGET_ROCKPRO64_RK3399=y
@@ -11,29 +13,42 @@
CONFIG_NR_DRAM_BANKS=1
CONFIG_DEBUG_UART_BASE=0xFF1A0000
@@ -11,29 +14,42 @@
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI_SUPPORT=y
CONFIG_DEBUG_UART=y
......@@ -23,6 +25,7 @@
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
CONFIG_TPL=y
CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPIO=y
......@@ -31,7 +34,6 @@
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_USB=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_TIME=y
......@@ -52,7 +54,7 @@
CONFIG_MISC=y
CONFIG_ROCKCHIP_EFUSE=y
CONFIG_MMC_DW=y
@@ -41,22 +56,29 @@
@@ -41,29 +57,40 @@
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
CONFIG_SPI_FLASH_GIGADEVICE=y
......@@ -70,7 +72,6 @@
CONFIG_PWM_ROCKCHIP=y
CONFIG_RAM_RK3399_LPDDR4=y
CONFIG_DM_RESET=y
+CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
CONFIG_BAUDRATE=1500000
......@@ -82,14 +83,13 @@
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_EHCI_HCD=y
@@ -64,6 +86,12 @@
CONFIG_USB_EHCI_GENERIC=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_GENERIC=y
CONFIG_USB_KEYBOARD=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+CONFIG_ROCKCHIP_USB2_PHY=y
+CONFIG_USB_KEYBOARD=y
CONFIG_USB_KEYBOARD=y
+CONFIG_USB_KEYBOARD_FN_KEYS=y
+CONFIG_USB_GADGET=y
CONFIG_USB_HOST_ETHER=y
......