###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
-ifneq "$(MKIMAGE)" "1"
# Raspberry Pi 3
-mkdir -pv /usr/share/u-boot/rpi
cd $(DIR_APP) && make CROSS_COMPILE="" rpi_3_config
cd $(DIR_APP) && install -v -m 644 u-boot.bin \
/usr/share/u-boot/rpi/u-boot-rpi3.bin
cd $(DIR_APP) && install u-boot.bin /boot/u-boot-rpi3.bin
+ cd $(DIR_APP) && install -v -m 755 tools/mkimage /usr/bin
cd $(DIR_APP) && make distclean
# Raspberry Pi 4
cd $(DIR_APP) && make distclean
# Nanopi R2C
- cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/rockchip/add_nanopi-r2c.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/u-boot/rockchip/add-nanopi-r2c-and-orangepi-r1-plus-lts.patch
cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
cd $(DIR_APP) && tar axf $(DIR_DL)/arm-trusted-firmware-$(ATF_VER).tar.gz
cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=rk3328 ARCH=aarch64 DEBUG=0 bl31 LDFLAGS="$(LDFLAGS)"
/usr/share/u-boot/nanopi_r2c/u-boot-rockchip.bin
cd $(DIR_APP) && make distclean
+ # Orangepi R1 plus lts
+ cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
+ cd $(DIR_APP) && tar axf $(DIR_DL)/arm-trusted-firmware-$(ATF_VER).tar.gz
+ cd $(DIR_APP)/arm-trusted-firmware-$(ATF_VER) && make PLAT=rk3328 ARCH=aarch64 DEBUG=0 bl31 LDFLAGS="$(LDFLAGS)"
+ cd $(DIR_APP) && cp arm-trusted-firmware-$(ATF_VER)/build/rk3328/release/bl31/bl31.elf bl31.elf
+ cd $(DIR_APP) && rm -rf arm-trusted-firmware-$(ATF_VER)
+ -mkdir -pv /usr/share/u-boot/orangepi_r1_plus_lts
+
+ cd $(DIR_APP) && make CROSS_COMPILE="" orangepi-r1-plus-lts-rk3328_config
+ cd $(DIR_APP) && sed -i -e 's!^CONFIG_IDENT_STRING=.*!CONFIG_IDENT_STRING=" OrangePi R1 plus lts - IPFire.org"!' .config
+ cd $(DIR_APP) && sed -i -e 's!^CONFIG_BOOTCOMMAND=.*!CONFIG_BOOTCOMMAND="console=ttyS2,115200n8;run distro_bootcmd"!' .config
+ cd $(DIR_APP) && sed -i -e 's!^CONFIG_BAUDRATE=.*!CONFIG_BAUDRATE=115200!' .config
+ cd $(DIR_APP) && sed -i -e 's!.*CONFIG_ENV_OVERWRITE.*!CONFIG_ENV_OVERWRITE=y!' .config
+ cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)"
+ cd $(DIR_APP) && install -v -m 644 u-boot-rockchip.bin \
+ /usr/share/u-boot/orangepi_r1_plus_lts/u-boot-rockchip.bin
+ cd $(DIR_APP) && make distclean
# Nanopi R4S
# arm trusted firmware for rk3399 cannot build without cortex m0 gcc crosscompiler
# patch real Kernel version to uEnv.txt
sed -e "s/xxxKVERxxx/$(KVER)/g" -i /boot/uEnv.txt
-else
- # mkimage
- cd $(DIR_APP) && make CROSS_COMPILE="" rpi_3_config
- cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)" tools
- cd $(DIR_APP) && install -v -m 755 tools/mkimage /usr/bin
-endif
-
@rm -rf $(DIR_APP)
@$(POSTBUILD)