brcm2708-gpu-fw: add fw required for camera module
[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/fixup_x_dat
57 FILE:=$(RPI_FIRMWARE_FILE)-fixup_x.dat
58 URL:=$(RPI_FIRMWARE_URL)
59 HASH:=ec99af78227d9ffa2e46ab80a96aa762187467fe33876e4d8085377e7d0f76c2
60 URL_FILE:=fixup_x.dat
61 endef
62 $(eval $(call Download,fixup_x_dat))
63
64 define Download/start_elf
65 FILE:=$(RPI_FIRMWARE_FILE)-start.elf
66 URL:=$(RPI_FIRMWARE_URL)
67 URL_FILE:=start.elf
68 HASH:=7e69d068c249cd859f5c44a8cf80a5e96a3f3fbeeeb0260de7373130a1d9b0fe
69 endef
70 $(eval $(call Download,start_elf))
71
72 define Download/start_cd_elf
73 FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf
74 URL:=$(RPI_FIRMWARE_URL)
75 URL_FILE:=start_cd.elf
76 HASH:=08aee2119a19c3556099ff875181d8e5440ebd1cecf1a5936b9340fe41da4428
77 endef
78 $(eval $(call Download,start_cd_elf))
79
80 define Download/start_x_elf
81 FILE:=$(RPI_FIRMWARE_FILE)-start_x.elf
82 URL:=$(RPI_FIRMWARE_URL)
83 HASH:=4fa98ee8eca7427aa013c1ad4a70d7b4cd01dcc08264307d1cb62f7c9ddfeed9
84 URL_FILE:=start_x.elf
85 endef
86 $(eval $(call Download,start_x_elf))
87
88 define Package/brcm2708-gpu-fw
89 SECTION:=boot
90 CATEGORY:=Boot Loaders
91 DEPENDS:=@TARGET_brcm2708
92 TITLE:=brcm2708-gpu-fw
93 DEFAULT:=y if TARGET_brcm2708
94 endef
95
96 define Package/brcm2708-gpu-fw/description
97 GPU and kernel boot firmware for brcm2708.
98 endef
99
100 define Build/Prepare
101 rm -rf $(PKG_BUILD_DIR)
102 mkdir -p $(PKG_BUILD_DIR)
103 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-LICENCE.broadcom $(PKG_BUILD_DIR)/LICENCE.broadcom
104 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-bootcode.bin $(PKG_BUILD_DIR)/bootcode.bin
105 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup.dat $(PKG_BUILD_DIR)/fixup.dat
106 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup_cd.dat $(PKG_BUILD_DIR)/fixup_cd.dat
107 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup_x.dat $(PKG_BUILD_DIR)/fixup_x.dat
108 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start.elf $(PKG_BUILD_DIR)/start.elf
109 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start_cd.elf $(PKG_BUILD_DIR)/start_cd.elf
110 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start_x.elf $(PKG_BUILD_DIR)/start_x.elf
111 endef
112
113 define Build/Compile
114 true
115 endef
116
117 define Package/brcm2708-gpu-fw/install
118 true
119 endef
120
121 define Build/InstallDev
122 $(CP) $(PKG_BUILD_DIR)/bootcode.bin $(KERNEL_BUILD_DIR)
123 $(CP) $(PKG_BUILD_DIR)/LICENCE.broadcom $(KERNEL_BUILD_DIR)
124 $(CP) $(PKG_BUILD_DIR)/start.elf $(KERNEL_BUILD_DIR)
125 $(CP) $(PKG_BUILD_DIR)/start_cd.elf $(KERNEL_BUILD_DIR)
126 $(CP) $(PKG_BUILD_DIR)/start_x.elf $(KERNEL_BUILD_DIR)
127 $(CP) $(PKG_BUILD_DIR)/fixup.dat $(KERNEL_BUILD_DIR)
128 $(CP) $(PKG_BUILD_DIR)/fixup_cd.dat $(KERNEL_BUILD_DIR)
129 $(CP) $(PKG_BUILD_DIR)/fixup_x.dat $(KERNEL_BUILD_DIR)
130 endef
131
132 $(eval $(call BuildPackage,brcm2708-gpu-fw))