Unified H3 image generation, include h3disp in H3 images, let red led blink while executing firstrun on H3

This commit is contained in:
Thomas Kaiser 2016-02-24 11:47:54 +01:00
parent ee15469089
commit 88b06e010d
6 changed files with 25 additions and 70 deletions

View file

@ -132,7 +132,7 @@ install_board_specific (){
cp $SRC/lib/config/boot.cmd $DEST/cache/sdcard/boot/boot.cmd
# orangepi h3 temp exceptions
[[ $LINUXFAMILY == "sun8i" ]] && sed -i '1s/^/gpio set PA15\nsetenv machid 1029\nsetenv bootm_boot_mode sec\n/' $DEST/cache/sdcard/boot/boot.cmd
[[ $BOARD == orangepip* ]] && sed -i '/^gpio set PA15/a gpio set PG11' $DEST/cache/sdcard/boot/boot.cmd
[[ $BOARD == orangepiplus ]] && sed -i '/^gpio set PA15/a gpio set PG11' $DEST/cache/sdcard/boot/boot.cmd
# let's prepare for old kernel too
chroot $DEST/cache/sdcard /bin/bash -c \
"ln -s /boot/bin/$BOARD.bin /boot/script.bin >/dev/null 2>&1 || cp /boot/bin/$BOARD.bin /boot/script.bin"

View file

@ -387,6 +387,11 @@ _EOF_
# TODO: Set the module to build automatically via dkms in the future here
fi
# h3disp for sun8i/3.4.x
if [ "$BOARD" = "orangepiplus" -o "$BOARD" = "orangepih3" ]; then
install -m 755 "$SRC/lib/scripts/h3disp" "$DEST/cache/sdcard/usr/local/bin"
fi
}

View file

@ -213,65 +213,29 @@
;;
orangepiplus)#enabled
#description H3 quad core 1Gb SoC Wifi GbE USB hub
#description H3 quad core (Orange Pi Plus or Plus 2)
#build 3wip
LINUXFAMILY="sun8i"
BOOTCONFIG="orangepi_plus_defconfig"
MODULES="8189es"
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES_NEXT=""
CPUMIN="480000"
CPUMAX="1296000"
GOVERNOR="interactive"
;;
orangepi2)#enabled
#description H3 quad core 1Gb SoC Wifi USB hub
orangepih3)#enabled
#description H3 quad core (Orange Pi PC/One/2/Lite)
#build 3wip
LINUXFAMILY="sun8i"
BOOTCONFIG="orangepi_pc_defconfig"
MODULES="8189es"
BOOTCONFIG="orangepi_h3_defconfig"
MODULES="8189es #gpio_sunxi #w1-sunxi #w1-gpio #w1-therm #gc2035"
MODULES_NEXT=""
CPUMIN="480000"
CPUMAX="1296000"
GOVERNOR="interactive"
;;
orangepipc)#enabled
#description H3 quad core 1Gb SoC
#build 3wip
LINUXFAMILY="sun8i"
BOOTCONFIG="orangepi_pc_defconfig"
MODULES=""
MODULES_NEXT=""
CPUMIN="480000"
CPUMAX="1296000"
GOVERNOR="interactive"
;;
orangepione)#enabled
#description H3 quad core 512Mb SoC
#build 3wip
LINUXFAMILY="sun8i"
BOOTCONFIG="orangepi_one_defconfig"
MODULES=""
MODULES_NEXT=""
CPUMIN="648000"
CPUMAX="1200000"
GOVERNOR="interactive"
;;
orangepilite)#enabled
#description H3 quad core 512Mb SoC Wifi
#build 3wip
LINUXFAMILY="sun8i"
BOOTCONFIG="orangepi_pc_defconfig"
MODULES="8189es"
MODULES_NEXT=""
CPUMIN="648000"
CPUMAX="1200000"
GOVERNOR="interactive"
;;
cubox-i)#enabled
#description Freescale iMx dual/quad core Wifi
#build 6

View file

@ -115,18 +115,9 @@ create_board_package (){
mkdir -p $destination/boot/bin
for i in $(ls -w1 $SRC/lib/config/*.fex | xargs -n1 basename); do
fex2bin $SRC/lib/config/${i%*.fex}.fex $destination/boot/bin/${i%*.fex}.bin;
case ${i%*.fex} in
orangepiplus|orangepi2|orangepipc|orangepione|orangepilite)
# H3 based devices need a fix when used with DVI displays
# so we provide a 2nd script.bin to be replaced manually
# when using kernel 3.4.x
sed '/\[hdmi_para\]/a \
hdcp_enable = 0\
hdmi_cts_compatibility = 1\
' <"${SRC}/lib/config/${i%*.fex}.fex" | fex2bin - "${destination}/boot/bin/${i%*.fex}_hdmi2dvi.bin"
;;
esac
done
# One H3 image for all Fast Ethernet equipped Orange Pi H3
cp -p "$destination/boot/bin/orangepi2.bin" "$destination/boot/bin/orangepih3.bin"
# bluetooth device enabler - for cubietruck
install -m 755 $SRC/lib/bin/brcm_patchram_plus $destination/usr/local/bin

View file

@ -1,7 +1,7 @@
diff -Nur a/configs/orangepi_one_defconfig b/configs/orangepi_one_defconfig
--- a/configs/orangepi_one_defconfig 1970-01-01 01:00:00.000000000 +0100
+++ b/configs/orangepi_one_defconfig 2016-02-19 00:58:31.007705977 +0100
@@ -0,0 +1,17 @@
diff -Nur a/configs/orangepi_h3_defconfig b/configs/orangepi_h3_defconfig
--- a/configs/orangepi_h3_defconfig 1970-01-01 01:00:00.000000000 +0100
+++ b/configs/orangepi_h3_defconfig 2016-02-19 00:58:31.007705977 +0100
@@ -0,0 +1,16 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN8I_H3=y
@ -18,7 +18,6 @@ diff -Nur a/configs/orangepi_one_defconfig b/configs/orangepi_one_defconfig
+CONFIG_CMD_GPIO=y
+CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_SUNXI_NO_PMIC=y
diff -Nur a/configs/orangepi_pc_defconfig b/configs/orangepi_pc_defconfig
--- a/configs/orangepi_pc_defconfig 2016-02-18 17:59:46.843681159 +0100
+++ b/configs/orangepi_pc_defconfig 2016-02-19 00:58:41.071856141 +0100
@ -31,15 +30,6 @@ diff -Nur a/configs/orangepi_pc_defconfig b/configs/orangepi_pc_defconfig
diff -Nur a/configs/orangepi_plus_defconfig b/configs/orangepi_plus_defconfig
--- a/configs/orangepi_plus_defconfig 2016-02-15 22:44:30.000000000 +0100
+++ b/configs/orangepi_plus_defconfig 2016-02-19 00:59:04.440204776 +0100
@@ -1,7 +1,7 @@
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN8I_H3=y
-CONFIG_DRAM_CLK=672
+CONFIG_DRAM_CLK=624
CONFIG_DRAM_ZQ=3881979
CONFIG_DRAM_ODT_EN=y
# CONFIG_VIDEO is not set
@@ -12,3 +12,5 @@
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set

View file

@ -97,6 +97,9 @@ autodetect_h3() {
# /run/machine.id so that two OS images (one built for Orange Pi Plus and one
# for the other H3 devices using the internal Ethernet PHY) can be shipped.
# trigger red LED as user feedback
echo heartbeat >/sys/class/leds/red_led/trigger
# wait for armhwinfo
sleep 3
read MACHINE </run/machine.id
@ -121,8 +124,10 @@ autodetect_h3() {
-e 's/MAX_SPEED=1296000/MAX_SPEED=1200000/' /etc/default/cpufrequtils
;;
esac
echo "${MACHINE}" | tr '[:upper:]' '[:lower:]' | sed -e 's/+/plus/' \
-e 's/\ //g' >/etc/hostname
NEWHOSTNAME="$(echo "${MACHINE}" | tr '[:upper:]' '[:lower:]' | sed -e 's/+/plus/' -e 's/\ //g')"
echo "${NEWHOSTNAME}" >/etc/hostname
sed -i "s/orangepih3/${NEWHOSTNAME}/" /etc/hosts
rm /boot/bin/orangepih3.bin
touch /var/run/reboot
} # autodetect_h3