Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Coolkids committed Dec 8, 2023
2 parents c37a6a1 + 897a98d commit c8d5621
Show file tree
Hide file tree
Showing 1,126 changed files with 24,241 additions and 12,132 deletions.
13 changes: 7 additions & 6 deletions config/Config-images.in
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ menu "Target Images"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default y

config GRUB_SERIAL
string "Serial port device"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default "ttyS0"

config GRUB_BAUDRATE
int "Serial port baud rate"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
Expand All @@ -231,7 +226,8 @@ menu "Target Images"

config GRUB_FLOWCONTROL
bool "Use RTE/CTS on serial console"
depends on GRUB_SERIAL != ""
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
depends on TARGET_SERIAL != ""

config GRUB_BOOTOPTS
string "Extra kernel boot options"
Expand Down Expand Up @@ -288,6 +284,11 @@ menu "Target Images"
select PACKAGE_kmod-e1000
default y if BUILDBOT

config TARGET_SERIAL
string "Serial port device"
depends on TARGET_x86 || TARGET_armsr
default "ttyS0"

config TARGET_IMAGES_GZIP
bool "GZip images"
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta
Expand Down
25 changes: 18 additions & 7 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ define Build/append-md5sum-ascii-salted
rm $@.salted
endef

UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE))

define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
Expand All @@ -146,6 +148,8 @@ define Build/append-ubi
$(UBINIZE_OPTS)
cat $@.tmp >> $@
rm $@.tmp
$(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\
$(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
endef

define Build/ubinize-kernel
Expand Down Expand Up @@ -215,7 +219,7 @@ endef

define Build/check-size
@imagesize="$$(stat -c%s $@)"; \
limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \
[ $$limitsize -ge $$imagesize ] || { \
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
rm -f $@; \
Expand Down Expand Up @@ -389,10 +393,17 @@ define Build/kernel-bin
endef

define Build/linksys-image
$(TOPDIR)/scripts/linksys-image.sh \
let \
size="$$(stat -c%s $@)" \
pad="$(call exp_units,$(PAGESIZE))" \
offset="256" \
pad="(pad - ((size + offset) % pad)) % pad"; \
dd if=/dev/zero bs=$$pad count=1 | tr '\000' '\377' >> $@
printf ".LINKSYS.01000409%-15s%08X%-8s%-16s" \
"$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
$@ $@.new
mv $@.new $@
"$$(cksum $@ | cut -d ' ' -f1)" \
"0" "K0000000F0246434" >> $@
dd if=/dev/zero bs=192 count=1 >> $@
endef

define Build/lzma
Expand Down Expand Up @@ -466,8 +477,8 @@ endef
define Build/pad-offset
let \
size="$$(stat -c%s $@)" \
pad="$(subst k,* 1024,$(word 1, $(1)))" \
offset="$(subst k,* 1024,$(word 2, $(1)))" \
pad="$(call exp_units,$(word 1, $(1)))" \
offset="$(call exp_units,$(word 2, $(1)))" \
pad="(pad - ((size + offset) % pad)) % pad" \
newsize='size + pad'; \
dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync
Expand Down Expand Up @@ -636,7 +647,7 @@ endef

define Build/zyxel-ras-image
let \
newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \
$(STAGING_DIR_HOST)/bin/mkrasimage \
-b $(RAS_BOARD) \
-v $(RAS_VERSION) \
Expand Down
5 changes: 4 additions & 1 deletion include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ include $(INCLUDE_DIR)/rootfs.mk
override MAKE:=$(_SINGLE)$(SUBMAKE)
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)

exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1))))

target_params = $(subst +,$(space),$*)
param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
Expand Down Expand Up @@ -395,6 +397,7 @@ define Device/Init
DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
FACTORY_IMG_NAME :=
IMAGE_SIZE :=
NAND_SIZE :=
KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
KERNEL_SUFFIX := -kernel.bin
KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
Expand Down Expand Up @@ -455,7 +458,7 @@ DEFAULT_DEVICE_VARS := \
DEVICE_DTS_DIR DEVICE_DTS_OVERLAY DEVICE_DTS_LOADADDR \
DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
UIMAGE_TIME SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
UBOOT_PATH IMAGE_SIZE \
UBOOT_PATH IMAGE_SIZE NAND_SIZE \
FACTORY_IMG_NAME FACTORY_SIZE \
DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
Expand Down
4 changes: 2 additions & 2 deletions include/kernel-5.15
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .139
LINUX_KERNEL_HASH-5.15.139 = 9c68c10dfe18e59b892e940436dea6a18d167160d55e62563cf7282244d8044e
LINUX_VERSION-5.15 = .141
LINUX_KERNEL_HASH-5.15.141 = 936d6ac65c692a986b4bde34b7f3d7ad90f7f86f19e4ef320e008d40f07e2cfa
4 changes: 2 additions & 2 deletions include/kernel-6.1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINUX_VERSION-6.1 = .63
LINUX_KERNEL_HASH-6.1.63 = c29d043b01dd4fcc61a24fd027c5c7912b15b1f10d8e3c83a0cb935885f0758d
LINUX_VERSION-6.1 = .65
LINUX_KERNEL_HASH-6.1.65 = 407229936802a44b1e484c2e9ac3bbe53a65d825cc468ccdbd76281b491ab20a
12 changes: 8 additions & 4 deletions include/u-boot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ ifdef UBOOT_USE_BINMAN
endif

ifdef UBOOT_USE_INTREE_DTC
$(eval $(call TestHostCommand,swig, \
Please install the swig package, \
swig -version))

$(eval $(call TestHostCommand,python3-dev, \
Please install the python3-dev package, \
python3.11-config --includes 2>&1 | grep 'python3', \
Expand All @@ -39,6 +35,14 @@ ifdef UBOOT_USE_INTREE_DTC
python3.8-config --includes 2>&1 | grep 'python3', \
python3.7-config --includes 2>&1 | grep 'python3', \
python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?'))

$(eval $(call TestHostCommand,python3-setuptools, \
Please install the Python3 setuptools module, \
$(STAGING_DIR_HOST)/bin/python3 -c 'import setuptools'))

$(eval $(call TestHostCommand,swig, \
Please install the swig package, \
swig -version))
endif

export GCC_HONOUR_COPTS=s
Expand Down
31 changes: 31 additions & 0 deletions package/base-files/files/lib/functions/leds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,44 @@ get_dt_led_path() {
echo "$ledpath"
}

get_dt_led_color_func() {
local enum
local func
local idx
local label

[ -e "$1/function" ] && func=$(cat "$1/function")
[ -e "$1/color" ] && idx=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/color")))
[ -e "$1/function-enumerator" ] && \
enum=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/function-enumerator")))

[ -z "$idx" ] && [ -z "$func" ] && return 2

if [ -n "$idx" ]; then
for color in "white" "red" "green" "blue" "amber" \
"violet" "yellow" "ir" "multicolor" "rgb" \
"purple" "orange" "pink" "cyan" "lime"
do
[ $idx -eq 0 ] && label="$color" && break
idx=$((idx-1))
done
fi

label="$label:$func"
[ -n "$enum" ] && label="$label-$enum"
echo "$label"

return 0
}

get_dt_led() {
local label
local ledpath=$(get_dt_led_path $1)

[ -n "$ledpath" ] && \
label=$(cat "$ledpath/label" 2>/dev/null) || \
label=$(cat "$ledpath/chan-name" 2>/dev/null) || \
label=$(get_dt_led_color_func "$ledpath") || \
label=$(basename "$ledpath")

echo "$label"
Expand Down
10 changes: 10 additions & 0 deletions package/boot/arm-trusted-firmware-mediatek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr4
NAND_TYPE:=spim:2k+64
endef

define Trusted-Firmware-A/mt7986-spim-nand-4k-ddr4
NAME:=MediaTek MT7986 (SPI-NAND via SPIM, DDR4)
BOOT_DEVICE:=spim-nand
BUILD_SUBTARGET:=filogic
PLAT:=mt7986
DDR_TYPE:=ddr4
NAND_TYPE:=spim:4k+256
endef

define Trusted-Firmware-A/mt7986-nor-ddr3
NAME:=MediaTek MT7986 (SPI-NOR, DDR3)
BOOT_DEVICE:=nor
Expand Down Expand Up @@ -377,6 +386,7 @@ TFA_TARGETS:= \
mt7986-sdmmc-ddr4 \
mt7986-snand-ddr4 \
mt7986-spim-nand-ddr4 \
mt7986-spim-nand-4k-ddr4 \
mt7988-emmc-ddr3 \
mt7988-nor-ddr3 \
mt7988-sdmmc-ddr3 \
Expand Down
1 change: 1 addition & 0 deletions package/boot/uboot-envtools/files/ath79
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ asus,zenwifi-cd6n|\
asus,zenwifi-cd6r|\
buffalo,bhr-4grv2|\
devolo,magic-2-wifi|\
dlink,dap-1720-a1|\
dlink,dir-859-a1|\
dlink,dir-859-a3|\
dlink,dir-869-a1|\
Expand Down
58 changes: 33 additions & 25 deletions package/boot/uboot-envtools/files/mediatek_filogic
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ bananapi,bpi-r3-mini)
;;
esac
;;
cetron,ct3003-stock|\
cetron,ct3003-ubootmod|\
cmcc,rax3000m-nand-ubootmod|\
netgear,wax220|\
zbtlink,zbt-z8102ax)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
cmcc,rax3000m)
case "$(cmdline_get_var root)" in
/dev/mmc*)
Expand All @@ -58,16 +65,39 @@ cmcc,rax3000m)
cmcc,rax3000m-emmc-ubootmod)
ubootenv_add_uci_config "/dev/mmcblk0p1" "0x0" "0x80000" "0x80000"
;;
glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
;;
glinet,gl-mt2500|\
glinet,gl-mt6000)
local envdev=$(find_mmc_part "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
;;
glinet,gl-mt3000)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
;;
h3c,magic-nx30-pro|\
h3c,magic-nx30-pro-nmbm|\
jcg,q30|\
qihoo,360t7|\
tplink,tl-xdr4288|\
tplink,tl-xdr6086|\
tplink,tl-xdr6088|\
xiaomi,mi-router-wr30u-ubootmod|\
xiaomi,redmi-router-ax6000-ubootmod|\
zyxel,ex5601-t0-ubootmod)
. /lib/upgrade/nand.sh
local envubi=$(nand_find_ubi ubi)
local envdev=/dev/$(nand_find_volume $envubi ubootenv)
local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
;;
imou,lc-hx3001-ubootmod)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000" "1"
;;
jdcloud,re-cp-03)
local envdev=$(find_mmc_part "ubootenv" "mmcblk0")
ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
;;
livinet,zr-3020|\
livinet,zr-3020-ubootmod|\
qihoo,360t7-ubootmod)
Expand All @@ -77,12 +107,6 @@ mercusys,mr90x-v1)
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
;;
cetron,ct3003-stock|\
cetron,ct3003-ubootmod|\
cmcc,rax3000m-nand-ubootmod|\
netgear,wax220)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
ubnt,unifi-6-plus)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000"
;;
Expand All @@ -93,22 +117,6 @@ xiaomi,redmi-router-ax6000-stock)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
;;
h3c,magic-nx30-pro|\
h3c,magic-nx30-pro-nmbm|\
jcg,q30|\
qihoo,360t7|\
tplink,tl-xdr4288|\
tplink,tl-xdr6086|\
tplink,tl-xdr6088|\
xiaomi,mi-router-wr30u-ubootmod|\
xiaomi,redmi-router-ax6000-ubootmod)
. /lib/upgrade/nand.sh
local envubi=$(nand_find_ubi ubi)
local envdev=/dev/$(nand_find_volume $envubi ubootenv)
local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
;;
zyxel,ex5601-t0)
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2"
Expand Down
1 change: 1 addition & 0 deletions package/boot/uboot-envtools/files/ramips
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ beeline,smartbox-giga|\
beeline,smartbox-turbo|\
beeline,smartbox-turbo-plus|\
etisalat,s3|\
rostelecom,rt-fe-1a|\
rostelecom,rt-sf-1)
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
;;
Expand Down
Loading

0 comments on commit c8d5621

Please sign in to comment.