layerscape: add ddr-phy package
[openwrt/openwrt.git] / package / firmware / layerscape / ls-ddr-phy / Makefile
1 # SPDX-License-Identifier: GPL-2.0-or-later
2 #
3 # Copyright 2020 NXP
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=ls-ddr-phy
9 PKG_VERSION:=LSDK-20.04-update-290520
10 PKG_RELEASE:=$(AUTORELEASE)
11
12 PKG_SOURCE_PROTO:=git
13 PKG_SOURCE_URL:=https://github.com/NXP/ddr-phy-binary.git
14 PKG_SOURCE_VERSION:=fbc036b88acb6c06ffed02c898cbae9856ec75ba
15 PKG_MIRROR_HASH:=84e2bdea99384211971bb23ba9ed18b5839628ff2aa0738d2978bbdf841638cb
16 PKG_BUILD_DEPENDS:=tfa-layerscape/host
17
18 PKG_LICENSE:=EULA
19 PKG_LICENSE_FILES:=NXP-Binary-EULA.txt
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/layerscape-ddr-phy
24 SECTION:=firmware
25 CATEGORY:=Firmware
26 TITLE:=NXP Layerscape DDR PHY firmware
27 DEPENDS:=@TARGET_layerscape
28 endef
29
30 define Build/Compile
31 cd $(PKG_BUILD_DIR)/lx2160a/ && \
32 tfa-fiptool create \
33 --ddr-immem-udimm-1d ddr4_pmu_train_imem.bin \
34 --ddr-immem-udimm-2d ddr4_2d_pmu_train_imem.bin \
35 --ddr-dmmem-udimm-1d ddr4_pmu_train_dmem.bin \
36 --ddr-dmmem-udimm-2d ddr4_2d_pmu_train_dmem.bin \
37 --ddr-immem-rdimm-1d ddr4_rdimm_pmu_train_imem.bin \
38 --ddr-immem-rdimm-2d ddr4_rdimm2d_pmu_train_imem.bin \
39 --ddr-dmmem-rdimm-1d ddr4_rdimm_pmu_train_dmem.bin \
40 --ddr-dmmem-rdimm-2d ddr4_rdimm2d_pmu_train_dmem.bin \
41 fip_ddr_all.bin
42 endef
43
44 define Build/InstallDev
45 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
46 $(CP) $(PKG_BUILD_DIR)/lx2160a/fip_ddr_all.bin \
47 $(STAGING_DIR_IMAGE)/fsl_lx2160a-rdb-fip_ddr_all.bin
48 endef
49
50 $(eval $(call BuildPackage,layerscape-ddr-phy))