blob: ca4160b57abc78bb21fff310c1f2509ea83fad37 [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001DESCRIPTION = "Commented config.txt file for the Raspberry Pi. \
2 The Raspberry Pi config.txt file is read by the GPU before \
3 the ARM core is initialised. It can be used to set various \
4 system configuration parameters."
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
7
Brad Bishopd7bf8c12018-02-25 22:55:05 -05008COMPATIBLE_MACHINE = "^rpi$"
Patrick Williams8b8bc412016-08-17 15:02:23 -05009
10SRCREV = "648ffc470824c43eb0d16c485f4c24816b32cd6f"
11SRC_URI = "git://github.com/Evilpaul/RPi-config.git;protocol=git;branch=master \
12 "
13
14S = "${WORKDIR}/git"
15
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060016PR = "r5"
Patrick Williams8b8bc412016-08-17 15:02:23 -050017
18PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
19PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}"
20PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021PITFT35r="${@bb.utils.contains("MACHINE_FEATURES", "pitft35r", "1", "0", d)}"
Patrick Williams8b8bc412016-08-17 15:02:23 -050022
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060023VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024VC4DTBO_raspberrypi3-64 = "vc4-fkms-v3d"
25VC4DTBO ?= "vc4-kms-v3d"
Patrick Williams8b8bc412016-08-17 15:02:23 -050026inherit deploy
27
28do_deploy() {
29 install -d ${DEPLOYDIR}/bcm2835-bootfiles
30
31 cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/
32
33 if [ -n "${KEY_DECODE_MPG2}" ]; then
34 sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
35 fi
36 if [ -n "${KEY_DECODE_WVC1}" ]; then
37 sed -i '/#decode_WVC1/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
38 fi
39 if [ -n "${DISABLE_OVERSCAN}" ]; then
40 sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
41 fi
42 if [ -n "${ARM_FREQ}" ]; then
43 sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
44 fi
45 if [ -n "${CORE_FREQ}" ]; then
46 sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
47 fi
48 if [ -n "${SDRAM_FREQ}" ]; then
49 sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
50 fi
51 if [ -n "${OVER_VOLTAGE}" ]; then
52 sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
53 fi
54
55 # GPU memory
56 if [ -n "${GPU_MEM}" ]; then
57 sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
58 fi
59 if [ -n "${GPU_MEM_256}" ]; then
60 sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
61 fi
62 if [ -n "${GPU_MEM_512}" ]; then
63 sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
64 fi
65 if [ -n "${GPU_MEM_1024}" ]; then
66 sed -i '/#gpu_mem_1024/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
67 fi
68
69 # Video camera support
70 if [ -n "${VIDEO_CAMERA}" ]; then
71 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
72 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
73 fi
74
75 # Offline compositing support
76 if [ -n "${DISPMANX_OFFLINE}" ]; then
77 echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
78 echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
79 fi
80
81 # SPI bus support
82 if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then
83 echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
84 echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
85 fi
86
87 if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then
88 echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
89 echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
90 echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
91 fi
92
93 # PiTFT22 display support
94 if [ "${PITFT22}" = "1" ]; then
95 echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
96 echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
97 fi
98
99 if [ "${PITFT28r}" = "1" ]; then
100 echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
101 echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
102 fi
103
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500104 if [ "${PITFT35r}" = "1" ]; then
105 echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
106 echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
107 fi
108
Patrick Williams8b8bc412016-08-17 15:02:23 -0500109 # UART support
110 if [ "${ENABLE_UART}" = "1" ]; then
111 echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
112 echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
113 fi
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600114
115 # VC4 Graphics support
116 if [ "${VC4GRAPHICS}" = "1" ]; then
117 echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500118 echo "dtoverlay=${VC4DTBO},${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600119 fi
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500120
121 # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm)
122 if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then
123 echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
124 echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
125 echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
126 echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
127 echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
128 echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
129 fi
Patrick Williams8b8bc412016-08-17 15:02:23 -0500130}
131
Brad Bishop3a5fbf52017-12-04 02:17:07 -0500132do_deploy_append_raspberrypi3-64() {
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500133 echo "# have a properly sized image" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
134 echo "disable_overscan=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
135
136 echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
137 echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
138
Brad Bishop3a5fbf52017-12-04 02:17:07 -0500139 # Device Tree support
140 echo "# Load correct Device Tree for Aarch64" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
141 echo "device_tree=bcm2710-rpi-3-b.dtb" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
142}
143
Patrick Williams8b8bc412016-08-17 15:02:23 -0500144addtask deploy before do_package after do_install
145do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
146
147PACKAGE_ARCH = "${MACHINE_ARCH}"