2 # Copyright (C) 2012-2019 OpenWrt.org
3 # Copyright (C) 2016-2017 LEDE project
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/image.mk
12 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_TARGET_KERNEL_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
15 $(CP
) $(LINUX_DIR
)/COPYING
$(KDIR
)/COPYING.linux
19 define Build
/kernel-img
20 perl
$(LINUX_DIR
)/scripts
/mkknlimg
$@
$@.tmp
24 define Build
/boot-common
26 mkfs.fat
-C
$@.boot
$(FAT32_BLOCKS
)
27 mcopy
-i
$@.boot
$(KDIR
)/COPYING.linux
::
28 mcopy
-i
$@.boot
$(KDIR
)/bootcode.bin
::
29 mcopy
-i
$@.boot
$(KDIR
)/LICENCE.broadcom
::
30 mcopy
-i
$@.boot cmdline.txt
::
31 mcopy
-i
$@.boot config.txt
::
32 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::$(KERNEL_IMG
)
33 $(foreach dts
,$(shell echo
$(DEVICE_DTS
)),mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb
::;)
34 mmd
-i
$@.boot
::/overlays
35 mcopy
-i
$@.boot
$(DTS_DIR
)/overlays
/*.dtbo
::/overlays
/
36 mcopy
-i
$@.boot
$(DTS_DIR
)/overlays
/README
::/overlays
/
39 define Build
/boot-2708
40 mcopy
-i
$@.boot
$(KDIR
)/start.elf
::
41 mcopy
-i
$@.boot
$(KDIR
)/start_cd.elf
::
42 mcopy
-i
$@.boot
$(KDIR
)/start_x.elf
::
43 mcopy
-i
$@.boot
$(KDIR
)/fixup.dat
::
44 mcopy
-i
$@.boot
$(KDIR
)/fixup_cd.dat
::
45 mcopy
-i
$@.boot
$(KDIR
)/fixup_x.dat
::
48 define Build
/boot-2711
49 mcopy
-i
$@.boot
$(KDIR
)/start4.elf
::
50 mcopy
-i
$@.boot
$(KDIR
)/start4cd.elf
::
51 mcopy
-i
$@.boot
$(KDIR
)/start4x.elf
::
52 mcopy
-i
$@.boot
$(KDIR
)/fixup4.dat
::
53 mcopy
-i
$@.boot
$(KDIR
)/fixup4cd.dat
::
54 mcopy
-i
$@.boot
$(KDIR
)/fixup4x.dat
::
57 define Build
/sdcard-img
58 .
/gen_rpi_sdcard_img.sh
$@
$@.boot
$(IMAGE_ROOTFS
) \
59 $(CONFIG_TARGET_KERNEL_PARTSIZE
) $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
64 KERNEL
:= kernel-bin | kernel-img
65 KERNEL_IMG
:= kernel.img
66 IMAGES
:= factory.img.gz sysupgrade.img.gz
67 IMAGE
/sysupgrade.img.gz
:= boot-common | boot-2708 | sdcard-img | gzip | append-metadata
68 IMAGE
/factory.img.gz
:= boot-common | boot-2708 | sdcard-img | gzip
72 DEVICE_TITLE
:= Raspberry Pi B
/B
+/CM
/Zero
/ZeroW
73 DEVICE_DTS
:= bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm bcm2708-rpi-zero bcm2708-rpi-zero-w
74 SUPPORTED_DEVICES
:= \
75 rpi-b rpi-b-plus rpi-cm rpi-zero rpi-zero-w \
76 raspberrypi
,model-b raspberrypi
,model-b-plus raspberrypi
,model-b-rev2 \
77 raspberrypi
,compute-module raspberrypi
,compute-module-1 \
78 raspberrypi
,model-zero raspberrypi
,model-zero-w
80 brcmfmac-firmware-43430-sdio \
81 brcmfmac-firmware-43430-sdio-rpi-zero-w \
82 kmod-brcmfmac wpad-basic
84 ifeq ($(SUBTARGET
),bcm2708
)
89 DEVICE_TITLE
:= Raspberry Pi
2B
/3B
/3B
+/3CM
/4B
90 DEVICE_DTS
:= bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2711-rpi-4-b bcm2710-rpi-cm3
91 SUPPORTED_DEVICES
:= \
92 rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm \
93 raspberrypi
,2-model-b \
94 raspberrypi
,3-model-b raspberrypi
,3-model-b-plus \
95 raspberrypi
,3-compute-module raspberrypi
,compute-module-3
97 brcmfmac-firmware-43430-sdio \
98 brcmfmac-firmware-43430-sdio-rpi-3b \
99 brcmfmac-firmware-43455-sdio brcmfmac-firmware-43455-clm_blob \
100 brcmfmac-firmware-43455-sdio-rpi-3b-plus brcmfmac-firmware-43455-sdio-rpi-4b \
101 kmod-brcmfmac wpad-basic
102 IMAGE
/sysupgrade.img.gz
:= boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata
103 IMAGE
/factory.img.gz
:= boot-common | boot-2708 | boot-2711 | sdcard-img | gzip
105 ifeq ($(SUBTARGET
),bcm2709
)
106 TARGET_DEVICES
+= rpi-2
110 KERNEL_IMG
:= kernel8.img
111 DEVICE_TITLE
:= Raspberry Pi
3B
/3B
+/3CM
112 DEVICE_DTS
:= broadcom
/bcm2710-rpi-3-b broadcom
/bcm2710-rpi-3-b-plus broadcom
/bcm2710-rpi-cm3
113 SUPPORTED_DEVICES
:= \
114 rpi-3-b rpi-3-b-plus \
115 raspberrypi
,3-model-b raspberrypi
,3-model-b-plus \
116 raspberrypi
,3-compute-module raspberrypi
,compute-module-3
118 brcmfmac-firmware-43430-sdio \
119 brcmfmac-firmware-43430-sdio-rpi-3b \
120 brcmfmac-firmware-43455-sdio brcmfmac-firmware-43455-clm_blob \
121 brcmfmac-firmware-43455-sdio-rpi-3b-plus \
122 kmod-brcmfmac wpad-basic
124 ifeq ($(SUBTARGET
),bcm2710
)
125 TARGET_DEVICES
+= rpi-3
128 $(eval
$(call BuildImage
))