blob: b3c50847ac32d33a48ec536fd95122209dc9553c [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
8COMPATIBLE_MACHINE = "raspberrypi"
9
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)}"
24
Patrick Williams8b8bc412016-08-17 15:02:23 -050025inherit deploy
26
27do_deploy() {
28 install -d ${DEPLOYDIR}/bcm2835-bootfiles
29
30 cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/
31
32 if [ -n "${KEY_DECODE_MPG2}" ]; then
33 sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
34 fi
35 if [ -n "${KEY_DECODE_WVC1}" ]; then
36 sed -i '/#decode_WVC1/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
37 fi
38 if [ -n "${DISABLE_OVERSCAN}" ]; then
39 sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
40 fi
41 if [ -n "${ARM_FREQ}" ]; then
42 sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
43 fi
44 if [ -n "${CORE_FREQ}" ]; then
45 sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
46 fi
47 if [ -n "${SDRAM_FREQ}" ]; then
48 sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
49 fi
50 if [ -n "${OVER_VOLTAGE}" ]; then
51 sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
52 fi
53
54 # GPU memory
55 if [ -n "${GPU_MEM}" ]; then
56 sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
57 fi
58 if [ -n "${GPU_MEM_256}" ]; then
59 sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
60 fi
61 if [ -n "${GPU_MEM_512}" ]; then
62 sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
63 fi
64 if [ -n "${GPU_MEM_1024}" ]; then
65 sed -i '/#gpu_mem_1024/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
66 fi
67
68 # Video camera support
69 if [ -n "${VIDEO_CAMERA}" ]; then
70 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
71 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
72 fi
73
74 # Offline compositing support
75 if [ -n "${DISPMANX_OFFLINE}" ]; then
76 echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
77 echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
78 fi
79
80 # SPI bus support
81 if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then
82 echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
83 echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
84 fi
85
86 if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then
87 echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
88 echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
89 echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
90 fi
91
92 # PiTFT22 display support
93 if [ "${PITFT22}" = "1" ]; then
94 echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
95 echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
96 fi
97
98 if [ "${PITFT28r}" = "1" ]; then
99 echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
100 echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
101 fi
102
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500103 if [ "${PITFT35r}" = "1" ]; then
104 echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
105 echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
106 fi
107
Patrick Williams8b8bc412016-08-17 15:02:23 -0500108 # UART support
109 if [ "${ENABLE_UART}" = "1" ]; then
110 echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
111 echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
112 fi
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -0600113
114 # VC4 Graphics support
115 if [ "${VC4GRAPHICS}" = "1" ]; then
116 echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
117 echo "dtoverlay=vc4-kms-v3d,${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
118 fi
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500119
120 # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm)
121 if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then
122 echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
123 echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
124 echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
125 echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
126 echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
127 echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
128 fi
Patrick Williams8b8bc412016-08-17 15:02:23 -0500129}
130
Brad Bishop3a5fbf52017-12-04 02:17:07 -0500131do_deploy_append_raspberrypi3-64() {
132 # Device Tree support
133 echo "# Load correct Device Tree for Aarch64" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
134 echo "device_tree=bcm2710-rpi-3-b.dtb" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
135}
136
Patrick Williams8b8bc412016-08-17 15:02:23 -0500137addtask deploy before do_package after do_install
138do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
139
140PACKAGE_ARCH = "${MACHINE_ARCH}"