Initial commit
This commit is contained in:
62
target/linux/mediatek/image/Makefile
Normal file
62
target/linux/mediatek/image/Makefile
Normal file
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Copyright (C) 2012-2015 OpenWrt.org
|
||||
# Copyright (C) 2016-2017 LEDE project
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
# for arm
|
||||
KERNEL_LOADADDR := 0x80008000
|
||||
|
||||
# for arm64
|
||||
ifeq ($(SUBTARGET),mt7622)
|
||||
KERNEL_LOADADDR = 0x41080000
|
||||
endif
|
||||
|
||||
define Build/sysupgrade-emmc
|
||||
rm -f $@.recovery
|
||||
mkfs.fat -C $@.recovery 3070
|
||||
|
||||
./gen_mt7623_emmc_img.sh $@ \
|
||||
$(IMAGE_KERNEL) \
|
||||
$@.recovery \
|
||||
$(IMAGE_ROOTFS)
|
||||
endef
|
||||
|
||||
# default all platform image(fit) build
|
||||
define Device/Default
|
||||
PROFILES = Default $$(DEVICE_NAME)
|
||||
KERNEL_NAME := zImage
|
||||
FILESYSTEMS := squashfs
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
|
||||
ifeq ($(SUBTARGET),mt7623)
|
||||
KERNEL_NAME := zImage
|
||||
KERNEL := kernel-bin | append-dtb | uImage none
|
||||
KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
|
||||
endif
|
||||
ifeq ($(SUBTARGET),mt7622)
|
||||
KERNEL_NAME := Image
|
||||
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
endif
|
||||
endef
|
||||
|
||||
ifeq ($(SUBTARGET),mt7622)
|
||||
include mt7622.mk
|
||||
endif
|
||||
|
||||
ifeq ($(SUBTARGET),mt7623)
|
||||
include mt7623.mk
|
||||
endif
|
||||
|
||||
define Image/Build
|
||||
$(call Image/Build/$(1),$(1))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildImage))
|
||||
|
||||
30
target/linux/mediatek/image/gen_mt7623_emmc_img.sh
Executable file
30
target/linux/mediatek/image/gen_mt7623_emmc_img.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This script is used only to create the "legacy" image for UniElec U7623,
|
||||
# suitable for upgrading from the vendor OpenWrt or from OpenWrt 19.07.
|
||||
#
|
||||
OUTPUT_FILE=$1
|
||||
KERNEL_FILE=$2
|
||||
RECOVERY_FILE=$3
|
||||
ROOTFS_FILE=$4
|
||||
|
||||
BS=512
|
||||
|
||||
# These two offsets are relative to the absolute location of the kernel on the mmc
|
||||
# (0xA00), so their position in the image is -2560 blocks
|
||||
#
|
||||
# They must be kept in sync with the default command line for U7623.
|
||||
# blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)"
|
||||
#
|
||||
# For upgrading from the vendor firmware, the total image must fit in its
|
||||
# MTD 'firmware' partition, which is typically 36MiB.
|
||||
|
||||
# In the legacy image, the uImage starts at block 0xa00. Allow 4864 KiB (9728) blocks.
|
||||
RECOVERY_OFFSET=9728
|
||||
# The recovery image is 3MiB, or 6144 blocks.
|
||||
ROOTFS_OFFSET=15872
|
||||
|
||||
dd bs="$BS" of="$OUTPUT_FILE" if="$KERNEL_FILE"
|
||||
dd bs="$BS" of="$OUTPUT_FILE" if="$RECOVERY_FILE" seek="$RECOVERY_OFFSET"
|
||||
dd bs="$BS" of="$OUTPUT_FILE" if="$ROOTFS_FILE" seek="$ROOTFS_OFFSET"
|
||||
dd if=/dev/zero of="$OUTPUT_FILE" bs=128k count=1 oflag=append conv=notrunc
|
||||
9
target/linux/mediatek/image/mt7622.mk
Normal file
9
target/linux/mediatek/image/mt7622.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
define Device/MTK-RFB1
|
||||
DEVICE_TITLE := MTK7622 rfb1 AP
|
||||
DEVICE_DTS := mt7622-rfb1
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
|
||||
SUPPORTED_DEVICES := mt7622
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb3 \
|
||||
kmod-ata-core kmod-ata-ahci-mtk
|
||||
endef
|
||||
TARGET_DEVICES += MTK-RFB1
|
||||
17
target/linux/mediatek/image/mt7623.mk
Normal file
17
target/linux/mediatek/image/mt7623.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
define Device/7623a-unielec-u7623-02-emmc-512m
|
||||
DEVICE_TITLE := MTK7623a UniElec U7623-02 (eMMC/512MB RAM)
|
||||
DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512M
|
||||
DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc
|
||||
SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m
|
||||
IMAGES := sysupgrade-emmc.bin.gz
|
||||
IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata
|
||||
endef
|
||||
|
||||
TARGET_DEVICES += 7623a-unielec-u7623-02-emmc-512m
|
||||
|
||||
define Device/7623n-bananapi-bpi-r2
|
||||
DEVICE_TITLE := MTK7623n BananaPi R2
|
||||
DEVICE_DTS := mt7623n-bananapi-bpi-r2
|
||||
endef
|
||||
|
||||
TARGET_DEVICES += 7623n-bananapi-bpi-r2
|
||||
Reference in New Issue
Block a user