Skip to content

Commit

Permalink
meson: bump to 6.1 kernel, drop mesongx (#11570)
Browse files Browse the repository at this point in the history
Make it into a direct brush package, making it convenient for software to brush into EMMC without the need for SD or USB drive

u-boot: https://github.com/shiyu1314/u-boot-onecloud/releases

SD firmware conversion to direct flash firmware: https://github.com/shiyu1314/openwrt-onecloud

Signed-off-by: Li Xueli <1052672227@qq.com>
  • Loading branch information
shiyu1314 authored Oct 5, 2023
1 parent e9ca86b commit 597b88e
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 1,569 deletions.
18 changes: 9 additions & 9 deletions target/linux/meson/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2017-2021 Stijn Tintel <stijn@linux-ipv6.be>
# Copyright (C) 2006-2013 OpenWrt.org

include $(TOPDIR)/rules.mk

ARCH:=arm
BOARD:=meson
BOARDNAME:=Amlogic Meson family
FEATURES:=audio boot-part ext4 fpu legacy-sdcard squashfs usbgadget
MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
SUBTARGETS:=meson8b mesongx
FEATURES:=boot-part ext4 fpu legacy-sdcard squashfs usbgadget
SUBTARGETS:=meson8b

KERNEL_PATCHVER:=5.10
KERNEL_TESTING_PATCHVER:=5.15
KERNEL_PATCHVER:=6.1

define Target/Description
Build firmware image for Amlogic Meson SoC devices.
Expand All @@ -23,9 +21,11 @@ include $(INCLUDE_DIR)/target.mk

DEFAULT_PACKAGES += \
e2fsprogs \
kmod-sound-core \
kmod-usb-hid \
mkf2fs \
automount \
resize2fs \
parted \
losetup \
partx-utils

KERNELNAME:=Image dtbs
Expand Down
92 changes: 11 additions & 81 deletions target/linux/meson/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ include $(INCLUDE_DIR)/image.mk
FAT32_BLOCK_SIZE=1024
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_TARGET_KERNEL_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))

define Build/sdcard-img
define Build/boot-script
# Make an U-boot image and copy it to the boot partition
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "boot.scr" -d boot.txt $(KDIR)/boot.scr
endef

define Build/sdcard-common
$(RM) -f $@.boot
mkfs.fat -C $@.boot $(FAT32_BLOCKS)

mkdir -p $(KDIR)/boot.fat
#For S805
mcopy -i $@.boot $(KDIR)/uInitrd ::
mcopy -i $@.boot $(KDIR)/s805_autoscript ::
mcopy -i $@.boot $(KDIR)/s805_autoscript.txt ::
mcopy -i $@.boot $(KDIR)/boot.scr ::
mcopy -i $@.boot $(KDIR)/boot.txt ::
#For S905
mcopy -i $@.boot $(KDIR)/uEnv.ini ::
mcopy -i $@.boot $(KDIR)/s905_autoscript ::
mcopy -i $@.boot $(KDIR)/s905_autoscript.txt ::

$(CP) $(KDIR)/boot.scr $(KDIR)/boot.fat/boot.scr
mcopy -i $@.boot $(KDIR)/boot.scr ::
$(CP) $(IMAGE_KERNEL) $(KDIR)/boot.fat/uImage
mcopy -i $@.boot $(KDIR)/boot.fat/uImage ::

Expand All @@ -33,92 +31,24 @@ define Build/sdcard-img

./gen_aml_sdcard_img.sh $@ $@.boot $(IMAGE_ROOTFS) \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE)

endef

define Build/uImage-meson
#For S805 autoscript && boot.scr
$(RM) -rf $(KDIR)/uInitrd
$(RM) -rf $(KDIR)/s805_autoscript
$(RM) -rf $(KDIR)/s805_autoscript.txt
$(RM) -rf $(KDIR)/boot.scr
$(RM) -rf $(KDIR)/boot.txt


#For S905 autoscript
$(RM) -rf $(KDIR)/s905_autoscript
$(RM) -rf $(KDIR)/s905_autoscript.txt
$(RM) -rf $(KDIR)/uEnv.ini

$(call Build/uImage,none)

#For S805 autoscript && boot.scr
touch $(KDIR)/uInitrd
$(CP) s805_autoscript.txt $(KDIR)/s805_autoscript.txt
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "s805_autoscript" -d s805_autoscript.txt $(KDIR)/s805_autoscript
$(CP) boot.txt $(KDIR)/boot.txt
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "boot.scr" -d boot.txt $(KDIR)/boot.scr

#For S905 autoscript
$(CP) uEnv.ini $(KDIR)/uEnv.ini
$(CP) s905_autoscript.txt $(KDIR)/s905_autoscript.txt
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "s905_autoscript" -d s905_autoscript.txt $(KDIR)/s905_autoscript

endef

### Devices ###
define Device/Default
FILESYSTEMS := ext4
IMAGES := sdcard.img
IMAGE/sdcard.img := sdcard-img $$(DEVICE_NAME)
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
KERNEL_LOADADDR := 0x01080000
KERNEL_NAME := Image
KERNEL := kernel-bin | uImage-meson none
KERNEL := kernel-bin | uImage none
PROFILES = Default $$(DEVICE_NAME)
endef

define Device/odroid-c1
DEVICE_DTS := meson8b-odroidc1
DEVICE_PACKAGES +=
DEVICE_TITLE := ODROID C1
KERNEL_LOADADDR := 0x00208000
endef
ifeq ($(SUBTARGET),meson8b)
TARGET_DEVICES += odroid-c1
endif

define Device/odroid-c2
DEVICE_DTS := amlogic/meson-gxbb-odroidc2
DEVICE_PACKAGES +=
DEVICE_TITLE := ODROID C2
endef
ifeq ($(SUBTARGET),mesongx)
TARGET_DEVICES += odroid-c2
endif

define Device/gxl-s905x-p212
DEVICE_DTS := amlogic/meson-gxl-s905x-p212
DEVICE_PACKAGES +=
DEVICE_TITLE := S905X Design Reference Board
endef
ifeq ($(SUBTARGET),mesongx)
TARGET_DEVICES += gxl-s905x-p212
endif

define Device/gxm-q200
DEVICE_DTS := amlogic/meson-gxm-q200
DEVICE_PACKAGES +=
DEVICE_TITLE := GXM Q200 Development Board
endef
ifeq ($(SUBTARGET),mesongx)
TARGET_DEVICES += gxm-q200
endif

define Device/thunder-onecloud
DEVICE_DTS := meson8b-onecloud
DEVICE_TITLE := Thunder OneCloud
KERNEL_LOADADDR := 0x00208000
IMAGE/sdcard.img := boot-script onecloud | sdcard-common $$(DEVICE_NAME)
endef
ifeq ($(SUBTARGET),meson8b)
TARGET_DEVICES += thunder-onecloud
Expand Down
19 changes: 0 additions & 19 deletions target/linux/meson/image/s805_autoscript.txt

This file was deleted.

16 changes: 0 additions & 16 deletions target/linux/meson/image/s905_autoscript.txt

This file was deleted.

3 changes: 0 additions & 3 deletions target/linux/meson/image/uEnv.ini

This file was deleted.

Loading

1 comment on commit 597b88e

@shawnchain
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个commit把s905也干掉了?

Please sign in to comment.