5f34f3218a4adc15e8c7d7092015e4dce61b0dc0
[openwrt/openwrt.git] / package / kernel / brcm2708-gpu-fw / Makefile
1 #
2 # Copyright (C) 2012-2016 OpenWrt.org
3 # Copyright (C) 2016 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_REV:=046effa13ebc4cc7601df4f06f4834bd0eebb0f8
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_REV)
16
17 include $(INCLUDE_DIR)/package.mk
18
19 RPI_FIRMWARE_URL:=@GITHUB/raspberrypi/firmware/$(PKG_REV)/boot/
20 RPI_FIRMWARE_FILE:=rpi-firmware-$(PKG_REV)
21
22 define Download/LICENCE_broadcom
23 FILE:=$(RPI_FIRMWARE_FILE)-LICENCE.broadcom
24 URL:=$(RPI_FIRMWARE_URL)
25 URL_FILE:=LICENCE.broadcom
26 MD5SUM:=4a4d169737c0786fb9482bb6d30401d1
27 endef
28 $(eval $(call Download,LICENCE_broadcom))
29
30 define Download/bootcode_bin
31 FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin
32 URL:=$(RPI_FIRMWARE_URL)
33 URL_FILE:=bootcode.bin
34 MD5SUM:=84d279839c772d3a040b80187388975b
35 endef
36 $(eval $(call Download,bootcode_bin))
37
38 define Download/fixup_dat
39 FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat
40 URL:=$(RPI_FIRMWARE_URL)
41 URL_FILE:=fixup.dat
42 MD5SUM:=70a8da83d2d1bbd27ec783db52ca076d
43 endef
44 $(eval $(call Download,fixup_dat))
45
46 define Download/fixup_cd_dat
47 FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat
48 URL:=$(RPI_FIRMWARE_URL)
49 URL_FILE:=fixup_cd.dat
50 MD5SUM:=3da1bb858629729ef11860871bdc0169
51 endef
52 $(eval $(call Download,fixup_cd_dat))
53
54 define Download/start_elf
55 FILE:=$(RPI_FIRMWARE_FILE)-start.elf
56 URL:=$(RPI_FIRMWARE_URL)
57 URL_FILE:=start.elf
58 MD5SUM:=b9e68841248012ddb2405504d8bd1070
59 endef
60 $(eval $(call Download,start_elf))
61
62 define Download/start_cd_elf
63 FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf
64 URL:=$(RPI_FIRMWARE_URL)
65 URL_FILE:=start_cd.elf
66 MD5SUM:=a0646b9e425febdad30d515b0480fd45
67 endef
68 $(eval $(call Download,start_cd_elf))
69
70 define Package/brcm2708-gpu-fw
71 SECTION:=boot
72 CATEGORY:=Boot Loaders
73 DEPENDS:=@TARGET_brcm2708
74 TITLE:=brcm2708-gpu-fw
75 DEFAULT:=y if TARGET_brcm2708
76 endef
77
78 define Package/brcm2708-gpu-fw/description
79 GPU and kernel boot firmware for brcm2708.
80 endef
81
82 define Build/Prepare
83 rm -rf $(PKG_BUILD_DIR)
84 mkdir -p $(PKG_BUILD_DIR)
85 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-LICENCE.broadcom $(PKG_BUILD_DIR)/LICENCE.broadcom
86 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-bootcode.bin $(PKG_BUILD_DIR)/bootcode.bin
87 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup.dat $(PKG_BUILD_DIR)/fixup.dat
88 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-fixup_cd.dat $(PKG_BUILD_DIR)/fixup_cd.dat
89 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start.elf $(PKG_BUILD_DIR)/start.elf
90 cp $(DL_DIR)/$(RPI_FIRMWARE_FILE)-start_cd.elf $(PKG_BUILD_DIR)/start_cd.elf
91 endef
92
93 define Build/Compile
94 true
95 endef
96
97 define Package/brcm2708-gpu-fw/install
98 true
99 endef
100
101 define Build/InstallDev
102 $(CP) $(PKG_BUILD_DIR)/bootcode.bin $(KERNEL_BUILD_DIR)
103 $(CP) $(PKG_BUILD_DIR)/LICENCE.broadcom $(KERNEL_BUILD_DIR)
104 $(CP) $(PKG_BUILD_DIR)/start.elf $(KERNEL_BUILD_DIR)
105 $(CP) $(PKG_BUILD_DIR)/start_cd.elf $(KERNEL_BUILD_DIR)
106 $(CP) $(PKG_BUILD_DIR)/fixup.dat $(KERNEL_BUILD_DIR)
107 $(CP) $(PKG_BUILD_DIR)/fixup_cd.dat $(KERNEL_BUILD_DIR)
108 endef
109
110 $(eval $(call BuildPackage,brcm2708-gpu-fw))