blob: 4bc8eb73de81bc7f7f9cebc2225ead8246ca215d [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
16PR = "r4"
17
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)}"
21
22inherit deploy
23
24do_deploy() {
25 install -d ${DEPLOYDIR}/bcm2835-bootfiles
26
27 cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/
28
29 if [ -n "${KEY_DECODE_MPG2}" ]; then
30 sed -i '/#decode_MPG2/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
31 fi
32 if [ -n "${KEY_DECODE_WVC1}" ]; then
33 sed -i '/#decode_WVC1/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
34 fi
35 if [ -n "${DISABLE_OVERSCAN}" ]; then
36 sed -i '/#disable_overscan/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
37 fi
38 if [ -n "${ARM_FREQ}" ]; then
39 sed -i '/#arm_freq/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
40 fi
41 if [ -n "${CORE_FREQ}" ]; then
42 sed -i '/#core_freq/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
43 fi
44 if [ -n "${SDRAM_FREQ}" ]; then
45 sed -i '/#sdram_freq/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
46 fi
47 if [ -n "${OVER_VOLTAGE}" ]; then
48 sed -i '/#over_voltage/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
49 fi
50
51 # GPU memory
52 if [ -n "${GPU_MEM}" ]; then
53 sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
54 fi
55 if [ -n "${GPU_MEM_256}" ]; then
56 sed -i '/#gpu_mem_256/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
57 fi
58 if [ -n "${GPU_MEM_512}" ]; then
59 sed -i '/#gpu_mem_512/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
60 fi
61 if [ -n "${GPU_MEM_1024}" ]; then
62 sed -i '/#gpu_mem_1024/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
63 fi
64
65 # Video camera support
66 if [ -n "${VIDEO_CAMERA}" ]; then
67 echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
68 echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
69 fi
70
71 # Offline compositing support
72 if [ -n "${DISPMANX_OFFLINE}" ]; then
73 echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
74 echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
75 fi
76
77 # SPI bus support
78 if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then
79 echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
80 echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
81 fi
82
83 if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then
84 echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
85 echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
86 echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
87 fi
88
89 # PiTFT22 display support
90 if [ "${PITFT22}" = "1" ]; then
91 echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
92 echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
93 fi
94
95 if [ "${PITFT28r}" = "1" ]; then
96 echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
97 echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
98 fi
99
100 # UART support
101 if [ "${ENABLE_UART}" = "1" ]; then
102 echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
103 echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt
104 fi
105}
106
107addtask deploy before do_package after do_install
108do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
109
110PACKAGE_ARCH = "${MACHINE_ARCH}"