From d480ff5c5fc0efa43bd4459c98ecd08062568085 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Tue, 14 May 2024 13:34:16 +0200 Subject: [PATCH] cv18xxlibs: add BL2 and other firmwares for CV18xx SoCs Signed-off-by: Zoltan HERPAI --- package/boot/cv18xxlibs/Makefile | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/boot/cv18xxlibs/Makefile diff --git a/package/boot/cv18xxlibs/Makefile b/package/boot/cv18xxlibs/Makefile new file mode 100644 index 0000000000..cddebecdf7 --- /dev/null +++ b/package/boot/cv18xxlibs/Makefile @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2024 OpenWrt.org +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cv18xxlibs +#PKG_RELEASE:=1.4 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/milkv-duo/milkv-duo-buildroot-libraries +PKG_SOURCE_DATE:=2024-05-12 +PKG_SOURCE_VERSION:=f359994bd497f942bb67734280d81f6640c7c168 +PKG_MIRROR_HASH:=afb45af8039d3a8b2916a6d6fda664681a669deeaec03e52bbcc21062dd207db + +#PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_TARGETS:=bin +PKG_FLAGS:=nonshared +#PKG_LICENSE:=BSD-2-Clause +#PKG_LICENSE_FILES:=COPYING.BSD +#PKG_BUILD_PARALLEL:=1 + +#PKG_MAINTAINER:=Zoltan HERPAI + +include $(INCLUDE_DIR)/package.mk + +define Package/cv18xxlibs + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@(TARGET_cv18x0) + URL:=https://github.com/milkv-duo/milkv-duo-buildroot-libraries +# VARIANT:=$(subst _,/,$(subst opensbi_,,$(1))) + TITLE:=CV18xx libraries (BL2, chipconf) +endef + +export GCC_HONOUR_COPTS=s + +MAKE_VARS = \ + CROSS_COMPILE="$(TARGET_CROSS)" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/firmware \ + ARCH=riscv BOOT_CPU=riscv CHIP_ARCH=cv180x \ + PROJECT_FULLNAME=cv1800b_milkv_duo_sd FREE_RAM_SIZE=64MB \ + CROSS_COMPILE=$(TARGET_CROSS) \ + bl2 +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/firmware/build/cv180x/bl2.bin $(STAGING_DIR_IMAGE)/bl2_cv1800b_milkv_duo_sd.bin + $(CP) $(PKG_BUILD_DIR)/firmware/plat/cv180x/chip_conf.bin $(STAGING_DIR_IMAGE)/cv180x_chip_conf.bin + $(CP) $(PKG_BUILD_DIR)/firmware/plat/cv180x/multi.its $(STAGING_DIR_IMAGE)/cv180x_multi.its + $(CP) $(PKG_BUILD_DIR)/firmware/test/cv181x/ddr_param.bin $(STAGING_DIR_IMAGE)/cv181x_ddr_param.bin + $(CP) $(PKG_BUILD_DIR)/firmware/plat/cv180x/fiptool.py $(STAGING_DIR_HOST)/bin/ +endef + +$(eval $(call BuildPackage,cv18xxlibs)) -- 2.30.2