| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | Quick links | 
|  | 2 | =========== | 
|  | 3 | Git repository web frontend: | 
|  | 4 | http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/ | 
|  | 5 | Mailing list (yocto mailing list): | 
|  | 6 | yocto@yoctoproject.org | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 7 | Issues management (Github Issues): | 
|  | 8 | https://github.com/agherzan/meta-raspberrypi/issues | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 9 |  | 
|  | 10 |  | 
|  | 11 | Contents: | 
|  | 12 | ========= | 
|  | 13 | 1. Description | 
|  | 14 | 2. Yocto BSP Layer - Raspberry Pi | 
|  | 15 | 2.A. How to use it | 
|  | 16 | 2.B. Images | 
|  | 17 | 3. Optional build configuration | 
|  | 18 | 3.A. Compressed deployed files | 
|  | 19 | 3.B. GPU memory | 
|  | 20 | 3.C. Add purchased license codecs | 
|  | 21 | 3.D. Disable overscan | 
|  | 22 | 3.E. Set overclocking options | 
|  | 23 | 3.F. Video camera support with V4L2 drivers | 
|  | 24 | 3.G. Enable offline compositing support | 
|  | 25 | 3.H. Enable kgdb over console support | 
|  | 26 | 3.I. Boot to U-Boot | 
|  | 27 | 3.J. Image with Initramfs | 
|  | 28 | 3.K. Device tree support | 
|  | 29 | 3.L. Enable SPI bus | 
|  | 30 | 3.M. Enable I2C | 
|  | 31 | 3.N. Enable PiTFT support | 
|  | 32 | 3.O. Enable UART support | 
|  | 33 | 4. Extra apps | 
|  | 34 | 4.A. omxplayer | 
|  | 35 | 5. Board Configuration | 
|  | 36 | 5.A. Audio Routing | 
|  | 37 | 6. Source code and mirrors | 
|  | 38 | 7. Contribution | 
|  | 39 | 7.A. Mailing List | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 40 | 7.B. Github Issues | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 41 | 8. Maintainers | 
|  | 42 |  | 
|  | 43 |  | 
|  | 44 | 1. Description | 
|  | 45 | ============== | 
|  | 46 |  | 
|  | 47 | This is the general hardware specific BSP overlay for the RaspberryPi device. | 
|  | 48 |  | 
|  | 49 | More information can be found at: | 
|  | 50 | http://www.raspberrypi.org/ (Official Site) | 
|  | 51 |  | 
|  | 52 | The core BSP part of meta-raspberrypi should work with different | 
|  | 53 | OpenEmbedded/Yocto distributions and layer stacks, such as: | 
|  | 54 | * Distro-less (only with OE-Core). | 
|  | 55 | * Angstrom. | 
|  | 56 | * Yocto/Poky (main focus of testing). | 
|  | 57 |  | 
|  | 58 | 2. Yocto BSP Layer - RaspberryPi | 
|  | 59 | ================================ | 
|  | 60 |  | 
|  | 61 | This layer depends on: | 
|  | 62 |  | 
|  | 63 | URI: git://git.yoctoproject.org/poky | 
|  | 64 | branch: master | 
|  | 65 | revision: HEAD | 
|  | 66 |  | 
|  | 67 | URI: git://git.openembedded.org/meta-openembedded | 
|  | 68 | layers: meta-oe, meta-multimedia | 
|  | 69 | branch: master | 
|  | 70 | revision: HEAD | 
|  | 71 |  | 
|  | 72 | 2.A. How to use it | 
|  | 73 | ================== | 
|  | 74 | a. source poky/oe-init-build-env rpi-build | 
|  | 75 | b. Add needed layer to bblayers.conf: | 
|  | 76 | - meta-raspberrypi | 
|  | 77 | c. Set MACHINE in local.conf to one of the supported boards: | 
|  | 78 | - raspberrypi | 
|  | 79 | - raspberrypi0 | 
|  | 80 | - raspberrypi2 | 
|  | 81 | - raspberrypi3 | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 82 | - raspberrypi-cm (dummy alias for raspberrypi) | 
|  | 83 | - raspberrypi-cm3 (dummy alias for raspberrypi2) | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 84 | d. bitbake rpi-hwup-image | 
|  | 85 | e. dd to a SD card the generated sdimg file (use xzcat if rpi-sdimg.xz is used) | 
|  | 86 | f. Boot your RPI. | 
|  | 87 |  | 
|  | 88 | 2.B. Images | 
|  | 89 | -=========== | 
|  | 90 | * rpi-hwup-image | 
|  | 91 | Hardware up image | 
|  | 92 | * rpi-basic-image | 
|  | 93 | Based on rpi-hwup-image with some added features (ex: splash) | 
|  | 94 | * rpi-test-image | 
|  | 95 | Image based on rpi-basic-image which includes most of the packages in this | 
|  | 96 | layer and some media samples. | 
|  | 97 |  | 
|  | 98 | 3. Optional build configuration | 
|  | 99 | =============================== | 
|  | 100 |  | 
|  | 101 | There are a set of ways in which a user can influence different paramenters of the build. | 
|  | 102 | We list here the ones that are closely related to this BSP or specific to it. For the rest | 
|  | 103 | please check: http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html | 
|  | 104 |  | 
|  | 105 | 3.A. Compressed deployed files | 
|  | 106 | ============================== | 
|  | 107 | 1. Overwrite IMAGE_FSTYPES in local.conf | 
|  | 108 | IMAGE_FSTYPES = "tar.bz2 ext3.xz" | 
|  | 109 | 2. Overwrite SDIMG_ROOTFS_TYPE in local.conf | 
|  | 110 | SDIMG_ROOTFS_TYPE = "ext3.xz" | 
|  | 111 | 3. Overwrite SDIMG_COMPRESSION in local.conf | 
|  | 112 | SDIMG_COMPRESSION = "xz" | 
|  | 113 | *Accommodate the values above to your own needs (ex: ext3 / ext4). | 
|  | 114 |  | 
|  | 115 | 3.B. GPU memory | 
|  | 116 | =============== | 
|  | 117 | Variable    : Details | 
|  | 118 | GPU_MEM     : GPU memory in megabyte. Sets the memory split between the ARM and | 
|  | 119 | GPU. ARM gets the remaining memory. Min 16. Default 64. | 
|  | 120 | GPU_MEM_256 : GPU memory in megabyte for the 256MB Raspberry Pi. Ignored by the | 
|  | 121 | 512MB RP. Overrides gpu_mem. Max 192. Default not set. | 
|  | 122 | GPU_MEM_512 : GPU memory in megabyte for the 512MB Raspberry Pi. Ignored by the | 
|  | 123 | 256MB RP. Overrides gpu_mem. Max 448. Default not set. | 
|  | 124 | GPU_MEM_1024: GPU memory in megabyte for the 1024MB Raspberry Pi. Ignored by the | 
|  | 125 | 256MB/512MB RP. Overrides gpu_mem. Max 944. Default not set. | 
|  | 126 |  | 
|  | 127 | 3.C. Add purchased license codecs | 
|  | 128 | ================================= | 
|  | 129 | To add you own licenses use variables KEY_DECODE_MPG2 and KEY_DECODE_WVC1 in | 
|  | 130 | local.conf. Example: | 
|  | 131 | KEY_DECODE_MPG2 = "12345678" | 
|  | 132 | KEY_DECODE_WVC1 = "12345678" | 
|  | 133 | You can supply more licenses separated by comma. Example: | 
|  | 134 | KEY_DECODE_WVC1 = "0x12345678,0xabcdabcd,0x87654321" | 
|  | 135 |  | 
|  | 136 | 3.D. Disable overscan | 
|  | 137 | ===================== | 
|  | 138 | By default the GPU adds a black border around the video output to compensate for | 
|  | 139 | TVs which cut off part of the image. To disable this set this variable in | 
|  | 140 | local.conf: | 
|  | 141 | DISABLE_OVERSCAN = "1" | 
|  | 142 |  | 
|  | 143 | 3.E. Set overclocking options | 
|  | 144 | ============================= | 
|  | 145 | The Raspberry PI can be overclocked. As of now overclocking up to the "Turbo | 
|  | 146 | Mode" is officially supported by the raspbery and does not void warranty. | 
|  | 147 | Check the config.txt for a detailed description of options and modes. Example: | 
|  | 148 | # Turbo mode | 
|  | 149 | ARM_FREQ = "1000" | 
|  | 150 | CORE_FREQ = "500" | 
|  | 151 | SDRAM_FREQ = "500" | 
|  | 152 | OVER_VOLTAGE = "6" | 
|  | 153 |  | 
|  | 154 | 3.F. Video camera support with V4L2 drivers | 
|  | 155 | =========================================== | 
|  | 156 | Set this variable to enable support for the video camera (Linux 3.12.4+ required) | 
|  | 157 | VIDEO_CAMERA = "1" | 
|  | 158 |  | 
|  | 159 | 3.G. Enable offline compositing support | 
|  | 160 | ======================================= | 
|  | 161 | Set this variable to enable support for dispmanx offline compositing | 
| Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 162 | DISPMANX_OFFLINE = "1" | 
| Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 163 |  | 
|  | 164 | This will enable the firmware to fall back to off-line compositing of | 
|  | 165 | Dispmanx elements. Normally the compositing is done on-line, during scanout, | 
|  | 166 | but cannot handle too many elements. With off-line enabled, an off-screen | 
|  | 167 | buffer is allocated for compositing. When scene complexity (number and sizes | 
|  | 168 | of elements) is high, compositing will happen off-line into the buffer. | 
|  | 169 |  | 
|  | 170 | Heavily recommended for Wayland/Weston. | 
|  | 171 |  | 
|  | 172 | See: http://wayland.freedesktop.org/raspberrypi.html | 
|  | 173 |  | 
|  | 174 | 3.H. Enable kgdb over console support | 
|  | 175 | ===================================== | 
|  | 176 | To add the kdbg over console (kgdboc) parameter to the kernel command line, | 
|  | 177 | set this variable in local.conf: | 
|  | 178 | ENABLE_KGDB = "1" | 
|  | 179 |  | 
|  | 180 | 3.I. Boot to U-Boot | 
|  | 181 | =================== | 
|  | 182 | To have u-boot load kernel image, set in your local.conf | 
|  | 183 | KERNEL_IMAGETYPE = "uImage" | 
|  | 184 |  | 
|  | 185 | This will make kernel.img be u-boot image which will load uImage. | 
|  | 186 | By default, kernel.img is the actual kernel image (ex. Image). | 
|  | 187 |  | 
|  | 188 | 3.J. Image with Initramfs | 
|  | 189 | ========================= | 
|  | 190 | To build an initramfs image : | 
|  | 191 | * Set this 3 kernel variables (in linux-raspberrypi.inc for example) | 
|  | 192 | - kernel_configure_variable BLK_DEV_INITRD y | 
|  | 193 | - kernel_configure_variable INITRAMFS_SOURCE "" | 
|  | 194 | - kernel_configure_variable RD_GZIP y | 
|  | 195 | * Set the yocto variables (in linux-raspberrypi.inc for example) | 
|  | 196 | - INITRAMFS_IMAGE = "<a name for your initramfs image>" | 
|  | 197 | - INITRAMFS_IMAGE_BUNDLE = "1" | 
|  | 198 | * Set the meta-rasberrypi variable (in raspberrypi.conf for example) | 
|  | 199 | - KERNEL_INITRAMFS = "-initramfs" | 
|  | 200 |  | 
|  | 201 | 3.K. Device tree support | 
|  | 202 | ========================= | 
|  | 203 | Device tree for RPi is only supported when using linux-raspberrypi 3.18+ | 
|  | 204 | kernels. | 
|  | 205 |  | 
|  | 206 | * Set KERNEL_DEVICETREE (in conf/machine/raspberrypi.conf) | 
|  | 207 | - the trailer is added to the kernel image before kernel install task. | 
|  | 208 | While creating the SDCard image, this modified kernel is put on | 
|  | 209 | boot partition (as kernel.img) as well as DeviceTree blobs (.dtb files). | 
|  | 210 |  | 
|  | 211 | NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for | 
|  | 212 | older kernel versions. | 
|  | 213 |  | 
|  | 214 | 3.L. Enable SPI bus | 
|  | 215 | ==================== | 
|  | 216 | When using device tree kernels, set this variable to enable the SPI bus | 
|  | 217 | ENABLE_SPI_BUS = "1" | 
|  | 218 |  | 
|  | 219 | 3.M. Enable I2C | 
|  | 220 | =============== | 
|  | 221 | When using device tree kernels, set this variable to enable I2C | 
|  | 222 | ENABLE_I2C = "1" | 
|  | 223 |  | 
|  | 224 | 3.N. Enable PiTFT support | 
|  | 225 | ========================= | 
|  | 226 | Basic support for using PiTFT screens can be enabled by adding | 
|  | 227 | below in local.conf: | 
|  | 228 |  | 
|  | 229 | MACHINE_FEATURES += "pitft" | 
|  | 230 | - This will enable SPI bus and i2c device-trees, it will also setup | 
|  | 231 | framebuffer for console and x server on PiTFT. | 
|  | 232 |  | 
|  | 233 | NOTE: To get this working the overlay for the PiTFT model must be build, | 
|  | 234 | added and specified as well (dtoverlay=<driver> in config.txt) | 
|  | 235 |  | 
|  | 236 | Below is a list of currently supported PiTFT models in meta-raspberrypi, | 
|  | 237 | the modelname should be added as a MACHINE_FEATURES in local.conf like below: | 
|  | 238 | - MACHINE_FEATURES += "pitft <modelname>" | 
|  | 239 |  | 
|  | 240 | List of currently supported models: | 
|  | 241 | - pitft22 | 
|  | 242 | - pitft28r | 
|  | 243 |  | 
|  | 244 | 3.O. Enable UART | 
|  | 245 | =============== | 
|  | 246 |  | 
|  | 247 | RaspberryPi 1, 2 and CM will have UART console enabled by default. | 
|  | 248 |  | 
|  | 249 | RaspberryPi 3 does not have the UART enabled by default because this needs a | 
|  | 250 | fixed core frequency and enable_uart wil set it to the minimum. Certain | 
|  | 251 | operations - 60fps h264 decode, high quality deinterlace - which aren't | 
|  | 252 | performed on the ARM may be affected, and we wouldn't want to do that to users | 
|  | 253 | who don't want to use the serial port. Users who want serial console support on | 
|  | 254 | RaspberryPi3 will have to explicitely set in local.conf: ENABLE_UART = "1". | 
|  | 255 |  | 
|  | 256 | Ref.: https://github.com/raspberrypi/firmware/issues/553 | 
|  | 257 | https://github.com/RPi-Distro/repo/issues/22 | 
|  | 258 |  | 
|  | 259 | 4. Extra apps | 
|  | 260 | ============= | 
|  | 261 |  | 
|  | 262 | 4.A. omxplayer | 
|  | 263 | ============== | 
|  | 264 | omxplayer depends on libav which has a commercial license. So in order to be | 
|  | 265 | able to compile omxplayer you will need to whiteflag the commercial license | 
|  | 266 | adding to you local.conf: | 
|  | 267 | LICENSE_FLAGS_WHITELIST = "commercial" | 
|  | 268 |  | 
|  | 269 | 5. Board Configuration | 
|  | 270 | ====================== | 
|  | 271 |  | 
|  | 272 | 5.A. Audio Routing | 
|  | 273 | ================== | 
|  | 274 | To load audio driver | 
|  | 275 |  | 
|  | 276 | modprobe snd-bcm2835 | 
|  | 277 |  | 
|  | 278 | To test audio playback | 
|  | 279 |  | 
|  | 280 | e.g. aplay test.wav | 
|  | 281 |  | 
|  | 282 | Note that without HDMI connected this emits audio from the 3.5in jack connector | 
|  | 283 | as expected. However With an HDMI display connected there is no audio output from | 
|  | 284 | the jack connector. | 
|  | 285 |  | 
|  | 286 | To force the audio routing via the 3.5in jack connector use | 
|  | 287 |  | 
|  | 288 | amixer cset numid=3 1 | 
|  | 289 |  | 
|  | 290 | Options to amixer cset are: | 
|  | 291 |  | 
|  | 292 | 0=auto | 
|  | 293 | 1=headphones | 
|  | 294 | 2=hdmi | 
|  | 295 |  | 
|  | 296 | 6. Source code and mirrors | 
|  | 297 | ========================== | 
|  | 298 |  | 
|  | 299 | Main repo: | 
|  | 300 | git://git.yoctoproject.org/meta-raspberrypi | 
|  | 301 | http://git.yoctoproject.org/git/meta-raspberrypi | 
|  | 302 |  | 
|  | 303 | Github mirror: | 
|  | 304 | https://github.com/agherzan/meta-raspberrypi | 
|  | 305 |  | 
|  | 306 | Bitbucket mirror: | 
|  | 307 | https://bitbucket.org/agherzan/meta-raspberrypi | 
|  | 308 |  | 
|  | 309 |  | 
|  | 310 | 7. Contributing | 
|  | 311 | =============== | 
|  | 312 |  | 
|  | 313 | 7.A. Mailing list | 
|  | 314 | ================= | 
|  | 315 | The main communication tool we use is a mailing list: | 
|  | 316 | yocto@yoctoproject.org | 
|  | 317 | https://lists.yoctoproject.org/listinfo/yocto | 
|  | 318 |  | 
|  | 319 | Feel free to ask any kind of questions but always prepend your email subject | 
|  | 320 | with "[meta-raspberrypi]". This is because we use the 'yocto' mailing list and | 
|  | 321 | not a perticular 'meta-raspberrypi' mailing list. | 
|  | 322 |  | 
|  | 323 | To contribute to this layer you should send the patches for review to the | 
|  | 324 | above specified mailing list. | 
|  | 325 | The patches should be compliant with the openembedded patch guidelines: | 
|  | 326 | http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines | 
|  | 327 |  | 
|  | 328 |  | 
|  | 329 | When creating patches, please use something like: | 
|  | 330 |  | 
|  | 331 | git format-patch -s --subject-prefix='meta-raspberrypi][PATCH' origin | 
|  | 332 |  | 
|  | 333 | When sending patches to mailing list, please use something like: | 
|  | 334 |  | 
|  | 335 | git send-email --to yocto@yoctoproject.org <generated patch> | 
|  | 336 |  | 
|  | 337 | 7.B. Github issues | 
|  | 338 | ================== | 
|  | 339 | In order to manage and trace the meta-raspberrypi issues, we use github issues: | 
|  | 340 | https://github.com/agherzan/meta-raspberrypi/issues | 
|  | 341 |  | 
|  | 342 | If you push patches which have a github issue associated, please provide the | 
|  | 343 | issue number in the commit log just before "Signed-off-by" line(s). Example line | 
|  | 344 | for a bug: | 
|  | 345 | [Issue #13] | 
|  | 346 |  | 
|  | 347 |  | 
|  | 348 | 8. Maintainers | 
|  | 349 | ============== | 
|  | 350 |  | 
|  | 351 | Andrei Gherzan <andrei at gherzan.ro> |