Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | DESCRIPTION = "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." |
| 5 | LICENSE = "MIT" |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 7 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | COMPATIBLE_MACHINE = "^rpi$" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 9 | |
| 10 | SRCREV = "648ffc470824c43eb0d16c485f4c24816b32cd6f" |
| 11 | SRC_URI = "git://github.com/Evilpaul/RPi-config.git;protocol=git;branch=master \ |
| 12 | " |
| 13 | |
| 14 | S = "${WORKDIR}/git" |
| 15 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 16 | PR = "r5" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 17 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 18 | INHIBIT_DEFAULT_DEPS = "1" |
| 19 | |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 20 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" |
| 21 | PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" |
| 22 | PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | PITFT35r="${@bb.utils.contains("MACHINE_FEATURES", "pitft35r", "1", "0", d)}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 24 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 25 | VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 26 | VC4DTBO_raspberrypi3-64 ?= "vc4-fkms-v3d" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | VC4DTBO ?= "vc4-kms-v3d" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 28 | |
| 29 | inherit deploy nopackages |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 30 | |
| 31 | do_deploy() { |
| 32 | install -d ${DEPLOYDIR}/bcm2835-bootfiles |
| 33 | |
| 34 | cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/ |
| 35 | |
| 36 | if [ -n "${KEY_DECODE_MPG2}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 37 | sed -i '/#decode_MPG2=/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 38 | fi |
| 39 | if [ -n "${KEY_DECODE_WVC1}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 40 | sed -i '/#decode_WVC1=/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 41 | fi |
| 42 | if [ -n "${DISABLE_OVERSCAN}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 43 | sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 44 | fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 45 | if [ -n "${DISABLE_SPLASH}" ]; then |
| 46 | sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 47 | fi |
| 48 | |
| 49 | # Set overclocking options |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 50 | if [ -n "${ARM_FREQ}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 51 | sed -i '/#arm_freq=/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 52 | fi |
| 53 | if [ -n "${GPU_FREQ}" ]; then |
| 54 | sed -i '/#gpu_freq=/ c\gpu_freq=${GPU_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 55 | fi |
| 56 | if [ -n "${CORE_FREQ}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 57 | sed -i '/#core_freq=/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 58 | fi |
| 59 | if [ -n "${SDRAM_FREQ}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 60 | sed -i '/#sdram_freq=/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 61 | fi |
| 62 | if [ -n "${OVER_VOLTAGE}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 63 | sed -i '/#over_voltage=/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 64 | fi |
| 65 | |
| 66 | # GPU memory |
| 67 | if [ -n "${GPU_MEM}" ]; then |
| 68 | sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 69 | fi |
| 70 | if [ -n "${GPU_MEM_256}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 71 | sed -i '/#gpu_mem_256=/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 72 | fi |
| 73 | if [ -n "${GPU_MEM_512}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 74 | sed -i '/#gpu_mem_512=/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 75 | fi |
| 76 | if [ -n "${GPU_MEM_1024}" ]; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 77 | sed -i '/#gpu_mem_1024=/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 78 | fi |
| 79 | |
| 80 | # Set boot delay |
| 81 | if [ -n "${BOOT_DELAY}" ]; then |
| 82 | sed -i '/#boot_delay=/ c\boot_delay=${BOOT_DELAY}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 83 | fi |
| 84 | if [ -n "${BOOT_DELAY_MS}" ]; then |
| 85 | sed -i '/#boot_delay_ms=/ c\boot_delay_ms=${BOOT_DELAY_MS}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 86 | fi |
| 87 | |
| 88 | # Set HDMI and composite video options |
| 89 | if [ -n "${HDMI_FORCE_HOTPLUG}" ]; then |
| 90 | sed -i '/#hdmi_force_hotplug=/ c\hdmi_force_hotplug=${HDMI_FORCE_HOTPLUG}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 91 | fi |
| 92 | if [ -n "${HDMI_DRIVE}" ]; then |
| 93 | sed -i '/#hdmi_drive=/ c\hdmi_drive=${HDMI_DRIVE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 94 | fi |
| 95 | if [ -n "${HDMI_GROUP}" ]; then |
| 96 | sed -i '/#hdmi_group=/ c\hdmi_group=${HDMI_GROUP}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 97 | fi |
| 98 | if [ -n "${HDMI_MODE}" ]; then |
| 99 | sed -i '/#hdmi_mode=/ c\hdmi_mode=${HDMI_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 100 | fi |
| 101 | if [ -n "${CONFIG_HDMI_BOOST}" ]; then |
| 102 | sed -i '/#config_hdmi_boost=/ c\config_hdmi_boost=${CONFIG_HDMI_BOOST}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 103 | fi |
| 104 | if [ -n "${SDTV_MODE}" ]; then |
| 105 | sed -i '/#sdtv_mode=/ c\sdtv_mode=${SDTV_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 106 | fi |
| 107 | if [ -n "${SDTV_ASPECT}" ]; then |
| 108 | sed -i '/#sdtv_aspect=/ c\sdtv_aspect=${SDTV_ASPECT}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 109 | fi |
| 110 | if [ -n "${DISPLAY_ROTATE}" ]; then |
| 111 | sed -i '/#display_rotate=/ c\display_rotate=${DISPLAY_ROTATE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 112 | fi |
| 113 | |
| 114 | # Video camera support |
| 115 | if [ -n "${VIDEO_CAMERA}" ]; then |
| 116 | echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 117 | echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 118 | fi |
| 119 | |
| 120 | # Offline compositing support |
| 121 | if [ -n "${DISPMANX_OFFLINE}" ]; then |
| 122 | echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 123 | echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 124 | fi |
| 125 | |
| 126 | # SPI bus support |
| 127 | if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then |
| 128 | echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 129 | echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 130 | fi |
| 131 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 132 | # I2C support |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 133 | if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then |
| 134 | echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 135 | echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 136 | echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 137 | fi |
| 138 | |
| 139 | # PiTFT22 display support |
| 140 | if [ "${PITFT22}" = "1" ]; then |
| 141 | echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 142 | echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 143 | fi |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 144 | if [ "${PITFT28r}" = "1" ]; then |
| 145 | echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 146 | echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 147 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 148 | if [ "${PITFT35r}" = "1" ]; then |
| 149 | echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 150 | echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 151 | fi |
| 152 | |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 153 | # UART support |
| 154 | if [ "${ENABLE_UART}" = "1" ]; then |
| 155 | echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 156 | echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 157 | fi |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 158 | |
| 159 | # VC4 Graphics support |
| 160 | if [ "${VC4GRAPHICS}" = "1" ]; then |
| 161 | echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 162 | echo "dtoverlay=${VC4DTBO},${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 163 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 164 | |
| 165 | # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm) |
| 166 | if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then |
| 167 | echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 168 | echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 169 | echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 170 | echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 171 | echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 172 | echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 173 | fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 174 | |
| 175 | # DWC2 USB peripheral support |
| 176 | if [ "${ENABLE_DWC2_PERIPHERAL}" = "1" ]; then |
| 177 | echo "# Enable USB peripheral mode" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 178 | echo "dtoverlay=dwc2,dr_mode=peripheral" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 179 | fi |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 180 | |
| 181 | # AT86RF23X support |
| 182 | if [ "${ENABLE_AT86RF}" = "1" ]; then |
| 183 | echo "# Enable AT86RF23X" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 184 | echo "dtoverlay=at86rf233,speed=3000000" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 185 | fi |
| 186 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 187 | # Append extra config if the user has provided any |
| 188 | echo "${RPI_EXTRA_CONFIG}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 189 | } |
| 190 | |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 191 | do_deploy_append_raspberrypi3-64() { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 192 | echo "# have a properly sized image" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 193 | echo "disable_overscan=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 194 | |
| 195 | echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
| 196 | echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 197 | } |
| 198 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 199 | addtask deploy before do_build after do_install |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 200 | do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" |
| 201 | |
| 202 | PACKAGE_ARCH = "${MACHINE_ARCH}" |