| 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" | 
 | 6 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 
 | 7 |  | 
 | 8 | COMPATIBLE_MACHINE = "raspberrypi" | 
 | 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 |  | 
 | 18 | PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" | 
 | 19 | PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" | 
 | 20 | PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}" | 
 | 21 |  | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 22 | VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" | 
 | 23 |  | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 24 | inherit deploy | 
 | 25 |  | 
 | 26 | do_deploy() { | 
 | 27 |     install -d ${DEPLOYDIR}/bcm2835-bootfiles | 
 | 28 |  | 
 | 29 |     cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/ | 
 | 30 |  | 
 | 31 |     if [ -n "${KEY_DECODE_MPG2}" ]; then | 
 | 32 |         sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 33 |     fi | 
 | 34 |     if [ -n "${KEY_DECODE_WVC1}" ]; then | 
 | 35 |         sed -i '/#decode_WVC1/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 36 |     fi | 
 | 37 |     if [ -n "${DISABLE_OVERSCAN}" ]; then | 
 | 38 |         sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 39 |     fi | 
 | 40 |     if [ -n "${ARM_FREQ}" ]; then | 
 | 41 |         sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 42 |     fi | 
 | 43 |     if [ -n "${CORE_FREQ}" ]; then | 
 | 44 |         sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 45 |     fi | 
 | 46 |     if [ -n "${SDRAM_FREQ}" ]; then | 
 | 47 |         sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 48 |     fi | 
 | 49 |     if [ -n "${OVER_VOLTAGE}" ]; then | 
 | 50 |         sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 51 |     fi | 
 | 52 |  | 
 | 53 |     # GPU memory | 
 | 54 |     if [ -n "${GPU_MEM}" ]; then | 
 | 55 |         sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 56 |     fi | 
 | 57 |     if [ -n "${GPU_MEM_256}" ]; then | 
 | 58 |         sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 59 |     fi | 
 | 60 |     if [ -n "${GPU_MEM_512}" ]; then | 
 | 61 |         sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 62 |     fi | 
 | 63 |     if [ -n "${GPU_MEM_1024}" ]; then | 
 | 64 |         sed -i '/#gpu_mem_1024/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 65 |     fi | 
 | 66 |  | 
 | 67 |     # Video camera support | 
 | 68 |     if [ -n "${VIDEO_CAMERA}" ]; then | 
 | 69 |         echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 70 |         echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 71 |     fi | 
 | 72 |  | 
 | 73 |     # Offline compositing support | 
 | 74 |     if [ -n "${DISPMANX_OFFLINE}" ]; then | 
 | 75 |         echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 76 |         echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 77 |     fi | 
 | 78 |  | 
 | 79 |     # SPI bus support | 
 | 80 |     if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then | 
 | 81 |         echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 82 |         echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 83 |     fi | 
 | 84 |  | 
 | 85 |     if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then | 
 | 86 |         echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 87 |         echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 88 |         echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 89 |     fi | 
 | 90 |  | 
 | 91 |     # PiTFT22 display support | 
 | 92 |     if [ "${PITFT22}" = "1" ]; then | 
 | 93 |         echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 94 |         echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 95 |     fi | 
 | 96 |  | 
 | 97 |     if [ "${PITFT28r}" = "1" ]; then | 
 | 98 |         echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 99 |         echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 100 |     fi | 
 | 101 |  | 
 | 102 |     # UART support | 
 | 103 |     if [ "${ENABLE_UART}" = "1" ]; then | 
 | 104 |         echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 105 |         echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 106 |     fi | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 107 |  | 
 | 108 |     # VC4 Graphics support | 
 | 109 |     if [ "${VC4GRAPHICS}" = "1" ]; then | 
 | 110 |         echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 111 |         echo "dtoverlay=vc4-kms-v3d,${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt | 
 | 112 |     fi | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 113 | } | 
 | 114 |  | 
 | 115 | addtask deploy before do_package after do_install | 
 | 116 | do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" | 
 | 117 |  | 
 | 118 | PACKAGE_ARCH = "${MACHINE_ARCH}" |