e98add03bd0b76b9cadb656a7b38f8fa93260658
[openwrt/openwrt.git] / package / kernel / brcm2708-gpu-fw / Makefile
1 #
2 # Copyright (C) 2012-2016 OpenWrt.org
3 # Copyright (C) 2017 LEDE project
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=brcm2708-gpu-fw
12 PKG_VERSION:=2018-11-29
13 PKG_RELEASE:=b428bdd819df8d0ad3009b64492a4b3d1f9453e4
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE)
16
17 PKG_FLAGS:=nonshared
18
19 include $(INCLUDE_DIR)/package.mk
20
21 RPI_FIRMWARE_URL:=@GITHUB/raspberrypi/firmware/$(PKG_RELEASE)/boot/
22 RPI_FIRMWARE_FILE:=rpi-firmware-$(PKG_RELEASE)
23
24 define Download/LICENCE_broadcom
25 FILE:=$(RPI_FIRMWARE_FILE)-LICENCE.broadcom
26 URL:=$(RPI_FIRMWARE_URL)
27 URL_FILE:=LICENCE.broadcom
28 HASH:=ba76edfc10a248166d965b8eaf320771c44f4f432d4fce2fd31fd272e7038add
29 endef
30 $(eval $(call Download,LICENCE_broadcom))
31
32 define Download/bootcode_bin
33 FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin
34 URL:=$(RPI_FIRMWARE_URL)
35 URL_FILE:=bootcode.bin
36 HASH:=7b24659eb049333eec69f59cf0c5aa0d49eab5ed67726af3c6f0c9bcf1e3f9e3
37 endef
38 $(eval $(call Download,bootcode_bin))
39
40 define Download/fixup_dat
41 FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat
42 URL:=$(RPI_FIRMWARE_URL)
43 URL_FILE:=fixup.dat
44 HASH:=5e5946fe7c0b1f5e270f43a17aef5f6da5758d5e544ed37137628c972c9b8061
45 endef
46 $(eval $(call Download,fixup_dat))
47
48 define Download/fixup_cd_dat
49 FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat
50 URL:=$(RPI_FIRMWARE_URL)
51 URL_FILE:=fixup_cd.dat
52 HASH:=d7ed04063af818695f6d2f6ffdde8304c19385051c9cee7f8d6d5b20851e4e55
53 endef
54 $(eval $(call Download,fixup_cd_dat))
55
56 define Download/start_elf
57 FILE:=$(RPI_FIRMWARE_FILE)-start.elf
58 URL:=$(RPI_FIRMWARE_URL)
59 URL_FILE:=start.elf
60 HASH:=7e69d068c249cd859f5c44a8cf80a5e96a3f3fbeeeb0260de7373130a1d9b0fe
61 endef
62 $(eval $(call Download,start_elf))
63
64 define Download/start_cd_elf
65 FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf
66 URL:=$(RPI_FIRMWARE_URL)
67 URL_FILE:=start_cd.elf
68 HASH:=08aee2119a19c3556099ff875181d8e5440ebd1cecf1a5936b9340fe41da4428
69 endef
70 $(eval $(call Download,start_cd_elf))
71
72 define Package/brcm2708-gpu-fw
73 SECTION:=boot
74 CATEGORY:=Boot Loaders
75 DEPENDS:=@TARGET_brcm2708
76 TITLE:=brcm2708-gpu-fw
77 DEFAULT:=y if TARGET_brcm2708
78 endef
79
80 define Package/brcm2708-gpu-fw/description
81 GPU and kernel boot firmware for brcm2708.
82 endef
83
84 define Build/Prepare
85 rm -rf $(PKG_BUILD_DIR)
86 mkdir -p $(PKG_BUILD_DIR)
87 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-LICENCE.broadcom $(PKG_BUILD_DIR)/LICENCE.broadcom
88 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-bootcode.bin $(PKG_BUILD_DIR)/bootcode.bin
89 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup.dat $(PKG_BUILD_DIR)/fixup.dat
90 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup_cd.dat $(PKG_BUILD_DIR)/fixup_cd.dat
91 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start.elf $(PKG_BUILD_DIR)/start.elf
92 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start_cd.elf $(PKG_BUILD_DIR)/start_cd.elf
93 endef
94
95 define Build/Compile
96 true
97 endef
98
99 define Package/brcm2708-gpu-fw/install
100 true
101 endef
102
103 define Build/InstallDev
104 $(CP) $(PKG_BUILD_DIR)/bootcode.bin $(KERNEL_BUILD_DIR)
105 $(CP) $(PKG_BUILD_DIR)/LICENCE.broadcom $(KERNEL_BUILD_DIR)
106 $(CP) $(PKG_BUILD_DIR)/start.elf $(KERNEL_BUILD_DIR)
107 $(CP) $(PKG_BUILD_DIR)/start_cd.elf $(KERNEL_BUILD_DIR)
108 $(CP) $(PKG_BUILD_DIR)/fixup.dat $(KERNEL_BUILD_DIR)
109 $(CP) $(PKG_BUILD_DIR)/fixup_cd.dat $(KERNEL_BUILD_DIR)
110 endef
111
112 $(eval $(call BuildPackage,brcm2708-gpu-fw))