lantiq: switch to kernel 6.1
[openwrt/openwrt.git] / package / firmware / ixp4xx-microcode / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # Copyright (C) 2007-2023 OpenWrt.org
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=ixp4xx-microcode
8 PKG_VERSION:=2.4
9 PKG_RELEASE:=1
10
11 PKG_SOURCE:=IPL_ixp400NpeLibraryWithCrypto-2_4.zip
12 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
13 PKG_HASH:=1b1170d0657847248589d946048c0aeaa9cd671966fc5bec5933283309485eaa
14
15 PKG_FLAGS:=nonshared
16
17 include $(INCLUDE_DIR)/package.mk
18
19 # Ethernet or WAN support, pick one
20 define Package/ixp4xx-microcode-ethernet
21 SECTION:=firmware
22 CATEGORY:=Firmware
23 TITLE:=IXP4xx ethernet firmware
24 DEPENDS:=@TARGET_ixp4xx
25 endef
26 define Package/ixp4xx-microcode-wan
27 SECTION:=firmware
28 CATEGORY:=Firmware
29 TITLE:=IXP4xx WAN firmware
30 DEPENDS:=@TARGET_ixp4xx
31 endef
32
33 define Package/ixp4xx-microcode-ethernet/description
34 This package contains the microcode needed to use the network engines in
35 IXP4xx CPUs for ethernet on all three NPEs.
36 endef
37 define Package/ixp4xx-microcode-wan/description
38 This package contains the microcode needed to use the network engines in
39 IXP4xx CPUs for ethernet on NPE-A and NPE-B and WAN (HSS) on NPE-C.
40 endef
41
42 define Build/Prepare
43 rm -rf $(PKG_BUILD_DIR)
44 mkdir -p $(PKG_BUILD_DIR)
45 unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE)
46 mv $(PKG_BUILD_DIR)/ixp400_xscale_sw/src/npeDl/IxNpeMicrocode.c $(PKG_BUILD_DIR)/
47 rm -rf $(PKG_BUILD_DIR)/ixp400_xscale_sw
48 $(CP) ./src/* $(PKG_BUILD_DIR)/
49 endef
50
51 define Build/Compile
52 (cd $(PKG_BUILD_DIR); \
53 $(HOSTCC) -Wall -I$(STAGING_DIR_HOST)/include IxNpeMicrocode.c -o IxNpeMicrocode; \
54 ./IxNpeMicrocode -be \
55 )
56 endef
57
58 define Package/ixp4xx-microcode-ethernet/install
59 $(INSTALL_DIR) $(1)/lib/firmware
60 $(INSTALL_DIR) $(1)/usr/share/doc
61 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A $(1)/lib/firmware/
62 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/
63 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/
64 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/
65 endef
66 define Package/ixp4xx-microcode-wan/install
67 $(INSTALL_DIR) $(1)/lib/firmware
68 $(INSTALL_DIR) $(1)/usr/share/doc
69 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A-HSS $(1)/lib/firmware/
70 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/
72 $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/
73 endef
74
75
76 $(eval $(call BuildPackage,ixp4xx-microcode-ethernet))
77 $(eval $(call BuildPackage,ixp4xx-microcode-wan))