imgtec-ci20: genimage config/ u-boot env
[openadk.git] / package / bcm28xx-bootloader / Makefile
blob83a594ad014a300d43d71d3bc53bc98b4f26cb64
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR)/rules.mk
6 PKG_NAME:= bcm28xx-bootloader
7 # not cloned, local src directory used
8 PKG_VERSION:= 1e403e23baab5673f0494a200f57cd01287d5b1a
9 PKG_RELEASE:= 3
10 PKG_DESCR:= bootloader for bcm28xx
11 PKG_SECTION:= base/boot
12 PKG_URL:= https://github.com/raspberrypi/firmware
13 PKG_SITES:= https://github.com/raspberrypi/firmware.git
15 PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi4 raspberry-pi4-64 raspberry-pi5
17 PKG_CHOICES_BCM28XX_BOOTLOADER:= DEFAULT EXTRA CUTDOWN
18 PKGCD_DEFAULT:= default bootloader
19 PKGCD_EXTRA:= bootloader with extra features and codecs
20 PKGCD_CUTDOWN:= cut down bootloader
22 NO_DISTFILES:= 1
24 include $(ADK_TOPDIR)/mk/package.mk
26 $(eval $(call PKG_template,BCM28XX_BOOTLOADER,bcm28xx-bootloader,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
28 CONFIG_STYLE:= manual
29 BUILD_STYLE:= manual
30 INSTALL_STYLE:= manual
32 do-install:
33 $(INSTALL_DIR) $(IDIR_BCM28XX_BOOTLOADER)/boot
34 $(CP) $(WRKBUILD)/boot/bootcode.bin $(IDIR_BCM28XX_BOOTLOADER)/boot/
35 ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_SERIAL_ONLY),y)
36 printf "console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
37 $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
38 endif
39 ifeq ($(ADK_RUNTIME_VERBOSE_KERNEL_VGA_ONLY),y)
40 printf "console=tty0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" > \
41 $(IDIR_BCM28XX_BOOTLOADER)/boot/cmdline.txt
42 endif
43 printf "kernel=kernel\n" > $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
44 printf "dtparam=audio,i2s,spi,i2c\n" >> \
45 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
46 ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_DEFAULT),y)
47 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
48 $(CP) $(WRKBUILD)/boot/{start4.elf,fixup4.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
49 printf "start_file=start4.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
50 printf "fixup_file=fixup4.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
51 else
52 $(CP) $(WRKBUILD)/boot/{start.elf,fixup.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
53 printf "start_file=start.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
54 printf "fixup_file=fixup.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
55 endif
56 endif
57 ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_EXTRA),y)
58 $(CP) $(WRKBUILD)/boot/{start_x.elf,fixup_x.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
59 printf "start_file=start_x.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
60 printf "fixup_file=fixup_x.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
61 endif
62 ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_CUTDOWN),y)
63 $(CP) $(WRKBUILD)/boot/{start_cd.elf,fixup_cd.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
64 printf "start_file=start_cd.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
65 printf "fixup_file=fixup_cd.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
66 endif
67 printf "gpu_mem=$(ADK_TARGET_GPU_MEM)\n" >> \
68 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
69 ifeq ($(ADK_PACKAGE_KODI),y)
70 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
71 printf "dtoverlay=vc4-kms-v3d-pi4\n" >> \
72 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
73 endif
74 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
75 printf "dtoverlay=vc4-kms-v3d-pi5\n" >> \
76 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
77 endif
78 endif
79 ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_AMP),)
80 printf "dtoverlay=hifiberry-amp\n" >> \
81 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
82 endif
83 ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DAC),)
84 printf "dtoverlay=hifiberry-dac\n" >> \
85 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
86 endif
87 ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DACPLUS),)
88 printf "dtoverlay=hifiberry-dacplus\n" >> \
89 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
90 endif
91 ifneq ($(ADK_TARGET_HARDWARE_HIFIBERRY_DIGI),)
92 printf "dtoverlay=hifiberry-digi\n" >> \
93 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
94 endif
95 ifneq ($(ADK_TARGET_HARDWARE_RPI_DAC),)
96 printf "dtoverlay=rpi-dac\n" >> \
97 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
98 endif
99 ifneq ($(ADK_TARGET_HARDWARE_IQAUDIO_DAC),)
100 printf "dtoverlay=iqaudio-dac\n" >> \
101 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
102 endif
103 ifneq ($(ADK_TARGET_HARDWARE_RPI_PROTO),)
104 printf "dtoverlay=rpi-proto\n" >> \
105 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
106 endif
107 ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_WIFI),y)
108 printf "dtoverlay=pi3-disable-wifi\n" >> \
109 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
110 endif
111 ifeq ($(ADK_TARGET_HARDWARE_RPI3_NO_BT),y)
112 printf "dtoverlay=pi3-disable-bt\n" >> \
113 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
114 endif
115 ifeq ($(ADK_TARGET_HARDWARE_RPI3_SERIAL),y)
116 printf "enable_uart=1\n" >> \
117 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
118 endif
119 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4),y)
120 printf "enable_uart=1\n" >> \
121 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
122 endif
123 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3_64)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
124 printf "arm_control=0x200\n" >> \
125 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
126 printf "enable_uart=1\n" >> \
127 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
128 endif
129 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI5),y)
130 printf "dtparam=fan_temp0=0\n" >> \
131 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
132 printf "dtparam=fan_temp0_speed=64\n" >> \
133 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
134 printf "dtparam=fan_temp1_speed=64\n" >> \
135 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
136 printf "dtparam=fan_temp2_speed=64\n" >> \
137 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
138 printf "dtparam=fan_temp3_speed=64\n" >> \
139 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
140 endif
141 ifneq ($(ADK_RUNTIME_MPEG2_KEY),)
142 printf "decode_MPG2=$(ADK_RUNTIME_MPEG2_KEY)\n" >> \
143 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
144 endif
145 ifneq ($(ADK_RUNTIME_VC1_KEY),)
146 printf "decode_WVC1=$(ADK_RUNTIME_VC1_KEY)\n" >> \
147 $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
148 endif
150 include $(ADK_TOPDIR)/mk/pkg-bottom.mk