From 68170c248592c9db1f2f1bbeb39cddf16fb50773 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 27 Jun 2017 09:37:10 +0200 Subject: [PATCH] mesongx: new target This target supports Amlogic S9 SoCs. Signed-off-by: Stijn Tintel --- target/linux/mesongx/Makefile | 32 ++ target/linux/mesongx/base-files/etc/inittab | 5 + .../base-files/lib/preinit/79_move_config | 22 + .../base-files/lib/upgrade/platform.sh | 34 ++ target/linux/mesongx/config-5.4 | 433 ++++++++++++++++++ target/linux/mesongx/image/Makefile | 67 +++ target/linux/mesongx/image/boot.odroid-c2.txt | 8 + 7 files changed, 601 insertions(+) create mode 100644 target/linux/mesongx/Makefile create mode 100644 target/linux/mesongx/base-files/etc/inittab create mode 100644 target/linux/mesongx/base-files/lib/preinit/79_move_config create mode 100644 target/linux/mesongx/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/mesongx/config-5.4 create mode 100644 target/linux/mesongx/image/Makefile create mode 100644 target/linux/mesongx/image/boot.odroid-c2.txt diff --git a/target/linux/mesongx/Makefile b/target/linux/mesongx/Makefile new file mode 100644 index 0000000000..7039edca23 --- /dev/null +++ b/target/linux/mesongx/Makefile @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Copyright (C) 2017-2021 Stijn Tintel + +include $(TOPDIR)/rules.mk + +ARCH:=aarch64 +BOARD:=mesongx +BOARDNAME:=Amlogic S9 family +CPU_TYPE:=cortex-a53 +DEVICE_TYPE:=other +FEATURES:=audio boot-part ext4 fpu legacy-sdcard squashfs usbgadget +MAINTAINER:=Stijn Tintel + +KERNEL_PATCHVER:=5.4 + +define Target/Description + Build firmware image for Amlogic S9 SoC devices. +endef + +include $(INCLUDE_DIR)/target.mk + +DEFAULT_PACKAGES += \ + e2fsprogs \ + kmod-sound-core \ + kmod-usb-hid \ + mkf2fs \ + partx-utils + +KERNELNAME:=Image dtbs + +$(eval $(call BuildTarget)) diff --git a/target/linux/mesongx/base-files/etc/inittab b/target/linux/mesongx/base-files/etc/inittab new file mode 100644 index 0000000000..a5100a7050 --- /dev/null +++ b/target/linux/mesongx/base-files/etc/inittab @@ -0,0 +1,5 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K shutdown +::askconsole:/usr/libexec/login.sh +tty1::askfirst:/usr/libexec/login.sh +ttyAML0::askfirst:/usr/libexec/login.sh diff --git a/target/linux/mesongx/base-files/lib/preinit/79_move_config b/target/linux/mesongx/base-files/lib/preinit/79_move_config new file mode 100644 index 0000000000..6ac1b3be69 --- /dev/null +++ b/target/linux/mesongx/base-files/lib/preinit/79_move_config @@ -0,0 +1,22 @@ +#!/bin/sh +# Copyright (C) 2012-2015 OpenWrt.org + +move_config() { + local partdev + + . /lib/upgrade/common.sh + + if export_bootdevice && export_partdevice partdev 1; then + mkdir -p /boot + if mount -t ext4 -o ro,noatime "/dev/$partdev" /boot; then + if [ -f /boot/sysupgrade.tgz ]; then + mount /boot -o remount,rw,noatime + mv -f /boot/sysupgrade.tgz / + mount /boot -o remount,ro,noatime + fi + fi + fi +} + +boot_hook_add preinit_mount_root move_config + diff --git a/target/linux/mesongx/base-files/lib/upgrade/platform.sh b/target/linux/mesongx/base-files/lib/upgrade/platform.sh new file mode 100644 index 0000000000..ee20683cb8 --- /dev/null +++ b/target/linux/mesongx/base-files/lib/upgrade/platform.sh @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + case "$(board_name)" in + hardkernel,odroid-c2) + legacy_sdcard_check_image "$1" + ;; + *) + return 0 + ;; + esac +} + +platform_do_upgrade() { + case "$(board_name)" in + hardkernel,odroid-c2) + legacy_sdcard_do_upgrade "$1" + ;; + *) + default_do_upgrade "$1" + ;; + esac +} +platform_copy_config() { + case "$(board_name)" in + hardkernel,odroid-c2) + legacy_sdcard_copy_config + ;; + esac +} diff --git a/target/linux/mesongx/config-5.4 b/target/linux/mesongx/config-5.4 new file mode 100644 index 0000000000..e22313a40b --- /dev/null +++ b/target/linux/mesongx/config-5.4 @@ -0,0 +1,433 @@ +CONFIG_64BIT=y +# CONFIG_AIO is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MESON=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=33 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM64=y +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_CNP=y +CONFIG_ARM64_CONT_SHIFT=4 +CONFIG_ARM64_ERRATUM_1165522=y +CONFIG_ARM64_ERRATUM_1286807=y +CONFIG_ARM64_ERRATUM_819472=y +CONFIG_ARM64_ERRATUM_824069=y +CONFIG_ARM64_ERRATUM_826319=y +CONFIG_ARM64_ERRATUM_827319=y +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_858921=y +CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_MODULE_PLTS=y +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_PAN=y +CONFIG_ARM64_PA_BITS=48 +CONFIG_ARM64_PA_BITS_48=y +CONFIG_ARM64_PMEM=y +# CONFIG_ARM64_PTR_AUTH is not set +CONFIG_ARM64_SSBD=y +CONFIG_ARM64_SVE=y +# CONFIG_ARM64_SW_TTBR0_PAN is not set +CONFIG_ARM64_TAGGED_ADDR_ABI=y +CONFIG_ARM64_UAO=y +CONFIG_ARM64_VA_BITS=48 +# CONFIG_ARM64_VA_BITS_39 is not set +CONFIG_ARM64_VA_BITS_48=y +CONFIG_ARM64_VHE=y +CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SCMI_PROTOCOL is not set +CONFIG_ARM_SCPI_POWER_DOMAIN=y +CONFIG_ARM_SCPI_PROTOCOL=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +CONFIG_BLK_DEBUG_FS=y +# CONFIG_BLK_DEV_INITRD is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_PM=y +# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set +# CONFIG_CEC_PLATFORM_DRIVERS is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_AXG=y +# CONFIG_COMMON_CLK_AXG_AUDIO is not set +CONFIG_COMMON_CLK_G12A=y +CONFIG_COMMON_CLK_GXBB=y +CONFIG_COMMON_CLK_MESON_AO_CLKC=y +CONFIG_COMMON_CLK_MESON_CPU_DYNDIV=y +CONFIG_COMMON_CLK_MESON_DUALDIV=y +CONFIG_COMMON_CLK_MESON_EE_CLKC=y +CONFIG_COMMON_CLK_MESON_MPLL=y +CONFIG_COMMON_CLK_MESON_PLL=y +CONFIG_COMMON_CLK_MESON_REGMAP=y +CONFIG_COMMON_CLK_MESON_VID_PLL_DIV=y +# CONFIG_COMMON_CLK_SCPI is not set +CONFIG_COMMON_CLK_XGENE=y +CONFIG_CONSOLE_POLL=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTIG_ALLOC=y +CONFIG_COREDUMP=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRC7=y +CONFIG_CRC_ITU_T=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_INFO=y +CONFIG_DMA_CMA=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_REMAP=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DRM=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_DW_HDMI=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_GEM_CMA_HELPER=y +CONFIG_DRM_KMS_CMA_HELPER=y +CONFIG_DRM_KMS_FB_HELPER=y +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_MALI_DISPLAY=y +CONFIG_DRM_MESON=y +CONFIG_DRM_MESON_DW_HDMI=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_RCAR_WRITEBACK=y +CONFIG_DTC=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_DWMAC_DWC_QOS_ETH=y +# CONFIG_DWMAC_GENERIC is not set +CONFIG_DWMAC_MESON=y +CONFIG_EDAC_SUPPORT=y +CONFIG_ELF_CORE=y +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_SECURITY=y +CONFIG_EXTCON=y +CONFIG_F2FS_FS=y +CONFIG_F2FS_FS_POSIX_ACL=y +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FONT_SUPPORT=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FRAME_POINTER=y +CONFIG_FSL_ERRATUM_A008585=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +# CONFIG_FUJITSU_ERRATUM_010001 is not set +CONFIG_FUNCTION_ERROR_INJECTION=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HDMI=y +CONFIG_HISILICON_ERRATUM_161010101=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_HWMON=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_MESON=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_MESON=y +CONFIG_IIO=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_INPUT=y +CONFIG_IOSCHED_BFQ=y +CONFIG_IPV6=y +CONFIG_IPV6_MROUTE=y +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_PIMSM_V2 is not set +# CONFIG_IPV6_SEG6_LWTUNNEL is not set +CONFIG_IPV6_SUBTREES=y +CONFIG_IP_MROUTE_COMMON=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IR_IMON_RAW is not set +CONFIG_IR_MESON=y +# CONFIG_IR_SERIAL is not set +# CONFIG_IR_SIR is not set +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KGDB=y +# CONFIG_KGDB_KDB is not set +CONFIG_KGDB_SERIAL_CONSOLE=y +# CONFIG_KGDB_TESTS is not set +CONFIG_KPROBES=y +CONFIG_KRETPROBES=y +# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set +CONFIG_LEDS_GPIO=y +CONFIG_LIBFDT=y +# CONFIG_LIRC is not set +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAILBOX=y +# CONFIG_MAILBOX_TEST is not set +CONFIG_MDIO_BUS=y +CONFIG_MDIO_BUS_MUX=y +CONFIG_MDIO_BUS_MUX_MESON_G12A=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_CEC_SUPPORT=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_MESON_CANVAS=y +CONFIG_MESON_CLK_MEASURE=y +CONFIG_MESON_EE_PM_DOMAINS=y +CONFIG_MESON_EFUSE=y +CONFIG_MESON_GXBB_WATCHDOG=y +# CONFIG_MESON_GXL_PHY is not set +CONFIG_MESON_GX_PM_DOMAINS=y +CONFIG_MESON_GX_SOCINFO=y +CONFIG_MESON_IRQ_GPIO=y +# CONFIG_MESON_MX_EFUSE is not set +CONFIG_MESON_MX_SOCINFO=y +CONFIG_MESON_SARADC=y +CONFIG_MESON_SM=y +CONFIG_MESON_WATCHDOG=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_ARMMMCI=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_MESON_GX=y +# CONFIG_MMC_MESON_MX_SDIO is not set +CONFIG_MMC_SPI=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MQ_IOSCHED_DEADLINE=y +CONFIG_MQ_IOSCHED_KYBER=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_CLS_ACT=y +CONFIG_NET_EMATCH=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NLS=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NO_IOPORT_MAP=y +CONFIG_NR_CPUS=8 +CONFIG_NVMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PARTITION_PERCPU=y +CONFIG_PGTABLE_LEVELS=4 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PHY_MESON8B_USB2=y +CONFIG_PHY_MESON_G12A_USB2=y +CONFIG_PHY_MESON_G12A_USB3_PCIE=y +CONFIG_PHY_MESON_GXL_USB2=y +CONFIG_PHY_MESON_GXL_USB3=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_MESON=y +CONFIG_PINCTRL_MESON8_PMX=y +CONFIG_PINCTRL_MESON_AXG=y +CONFIG_PINCTRL_MESON_AXG_PMX=y +CONFIG_PINCTRL_MESON_G12A=y +CONFIG_PINCTRL_MESON_GXBB=y +CONFIG_PINCTRL_MESON_GXL=y +CONFIG_PLATFORM_MHU=y +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_POWER_RESET=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PRINTK_TIME=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PWM=y +CONFIG_PWM_MESON=y +CONFIG_PWM_SYSFS=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RATIONAL=y +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RC_CORE=y +CONFIG_RC_DEVICES=y +# CONFIG_RC_XBOX_DVD is not set +CONFIG_REALTEK_PHY=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_DEBUG=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_GPIO=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_MESON=y +# CONFIG_RESET_MESON_AUDIO_ARB is not set +CONFIG_RFS_ACCEL=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +CONFIG_RPS=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SDIO_UART=y +CONFIG_SENSORS_ARM_SCPI=y +CONFIG_SERIAL_8250_FSL=y +# CONFIG_SERIAL_KGDB_NMI is not set +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_MESON=y +CONFIG_SERIAL_MESON_CONSOLE=y +CONFIG_SMP=y +CONFIG_SOC_BUS=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MESON_SPICC=y +CONFIG_SPI_MESON_SPIFC=y +CONFIG_SRCU=y +CONFIG_STMMAC_ETH=y +CONFIG_STMMAC_PLATFORM=y +# CONFIG_STMMAC_SELFTESTS is not set +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SYNC_FILE=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_DWC2=y +CONFIG_USB_DWC2_DUAL_ROLE=y +CONFIG_USB_GADGET=y +CONFIG_USB_OTG=y +CONFIG_USB_OTG_FSM=y +CONFIG_USB_PHY=y +CONFIG_USB_ROLE_SWITCH=y +CONFIG_USB_SUPPORT=y +# CONFIG_V4L_PLATFORM_DRIVERS is not set +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_VIDEO_DEV=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L2_I2C=y +CONFIG_VMAP_STACK=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XPS=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/mesongx/image/Makefile b/target/linux/mesongx/image/Makefile new file mode 100644 index 0000000000..59929d0c85 --- /dev/null +++ b/target/linux/mesongx/image/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2017-2019 Stijn Tintel +# +# 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 + +define Build/bootloader-odroid-c2 + fip_create \ + --bl30 $(STAGING_DIR_IMAGE)/odroidc2/bl30.bin \ + --bl301 $(STAGING_DIR_IMAGE)/odroidc2/bl301.bin \ + --bl31 $(STAGING_DIR_IMAGE)/bl31_gxbb.bin \ + --bl33 $(BIN_DIR)/u-boot-odroid-c2/u-boot.bin \ + $(STAGING_DIR_IMAGE)/odroidc2/fip.bin + + cat $(STAGING_DIR_IMAGE)/odroidc2/bl2.package $(STAGING_DIR_IMAGE)/odroidc2/fip.bin > $(STAGING_DIR_IMAGE)/odroidc2/boot_new.bin + + amlbootsig $(STAGING_DIR_IMAGE)/odroidc2/boot_new.bin $(STAGING_DIR_IMAGE)/odroidc2/boot_new.bin.signed + + dd if=$(STAGING_DIR_IMAGE)/odroidc2/boot_new.bin.signed of=$(STAGING_DIR_IMAGE)/odroidc2/u-boot.gxbb bs=512 skip=96 + dd if=$(STAGING_DIR_IMAGE)/odroidc2/bl1.bin.hardkernel of=$@ conv=fsync,notrunc bs=1 count=440 + dd if=$(STAGING_DIR_IMAGE)/odroidc2/bl1.bin.hardkernel of=$@ conv=fsync,notrunc bs=512 skip=1 seek=1 + dd if=$(STAGING_DIR_IMAGE)/odroidc2/u-boot.gxbb of=$@ conv=fsync,notrunc bs=512 seek=97 +endef + +define Build/sdcard-img + $(INSTALL_DIR) $(KDIR)/boot.ext4 + $(CP) $(KDIR)/boot.$1.scr $(KDIR)/boot.ext4/boot.scr + $(CP) $(KDIR_KERNEL_IMAGE) $(KDIR)/boot.ext4/uImage + $(foreach dts,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dts).dtb $(KDIR)/boot.ext4/) + PADDING="$(CONFIG_TARGET_IMAGES_PAD)" \ + PATH="$(TARGET_PATH)" \ + $(SCRIPT_DIR)/gen_image_generic.sh $@ \ + $(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/boot.ext4 \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ + 4096 + $(RM) -rf $(KDIR)/boot.ext4 +endef + +define Build/uImage-meson + $(call Build/uImage,none) + mkimage -A arm64 -T script -C none -n "boot.scr uImage" -d boot.$1.txt $(KDIR)/boot.$1.scr +endef + +### Devices ### +define Device/Default + FILESYSTEMS := ext4 squashfs + IMAGES := sdcard.img.gz + IMAGE/sdcard.img.gz := sdcard-img $$(DEVICE_NAME) | bootloader-$$(DEVICE_NAME) | gzip | append-metadata + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_LOADADDR := 0x01080000 + KERNEL_NAME := Image + PROFILES = Default $$(DEVICE_NAME) +endef + +define Device/odroid-c2 + DEVICE_DTS := amlogic/meson-gxbb-odroidc2 + DEVICE_PACKAGES += odroid-firmware-c2 u-boot-odroid-c2 + DEVICE_TITLE := ODROID C2 + KERNEL := kernel-bin | uImage-meson $$(DEVICE_NAME) + SUPPORTED_DEVICES += hardkernel,odroid-c2 +endef +TARGET_DEVICES += odroid-c2 + +$(eval $(call BuildImage)) diff --git a/target/linux/mesongx/image/boot.odroid-c2.txt b/target/linux/mesongx/image/boot.odroid-c2.txt new file mode 100644 index 0000000000..d8a9263bc8 --- /dev/null +++ b/target/linux/mesongx/image/boot.odroid-c2.txt @@ -0,0 +1,8 @@ +setenv bootargs "root=PARTUUID=5452574f-02 rootwait ro rootfstype=ext4,squashfs console=ttyAML0,115200 earlycon" +setenv loadaddr "0x01080000" +setenv dtb_loadaddr "0x01000000" + +ext2load mmc 0:1 ${loadaddr} uImage +ext2load mmc 0:1 ${dtb_loadaddr} meson-gxbb-odroidc2.dtb + +bootm ${loadaddr} - ${dtb_loadaddr} -- 2.30.2