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 |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 68 | layers: meta-oe, meta-multimedia, meta-networking, meta-python |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 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 |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 80 | - raspberrypi0-wifi |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 81 | - raspberrypi2 |
| 82 | - raspberrypi3 |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 83 | - raspberrypi-cm (dummy alias for raspberrypi) |
| 84 | - raspberrypi-cm3 (dummy alias for raspberrypi2) |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 85 | d. bitbake rpi-hwup-image |
| 86 | e. dd to a SD card the generated sdimg file (use xzcat if rpi-sdimg.xz is used) |
| 87 | f. Boot your RPI. |
| 88 | |
| 89 | 2.B. Images |
| 90 | -=========== |
| 91 | * rpi-hwup-image |
| 92 | Hardware up image |
| 93 | * rpi-basic-image |
| 94 | Based on rpi-hwup-image with some added features (ex: splash) |
| 95 | * rpi-test-image |
| 96 | Image based on rpi-basic-image which includes most of the packages in this |
| 97 | layer and some media samples. |
| 98 | |
| 99 | 3. Optional build configuration |
| 100 | =============================== |
| 101 | |
| 102 | There are a set of ways in which a user can influence different paramenters of the build. |
| 103 | We list here the ones that are closely related to this BSP or specific to it. For the rest |
| 104 | please check: http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html |
| 105 | |
| 106 | 3.A. Compressed deployed files |
| 107 | ============================== |
| 108 | 1. Overwrite IMAGE_FSTYPES in local.conf |
| 109 | IMAGE_FSTYPES = "tar.bz2 ext3.xz" |
| 110 | 2. Overwrite SDIMG_ROOTFS_TYPE in local.conf |
| 111 | SDIMG_ROOTFS_TYPE = "ext3.xz" |
| 112 | 3. Overwrite SDIMG_COMPRESSION in local.conf |
| 113 | SDIMG_COMPRESSION = "xz" |
| 114 | *Accommodate the values above to your own needs (ex: ext3 / ext4). |
| 115 | |
| 116 | 3.B. GPU memory |
| 117 | =============== |
| 118 | Variable : Details |
| 119 | GPU_MEM : GPU memory in megabyte. Sets the memory split between the ARM and |
| 120 | GPU. ARM gets the remaining memory. Min 16. Default 64. |
| 121 | GPU_MEM_256 : GPU memory in megabyte for the 256MB Raspberry Pi. Ignored by the |
| 122 | 512MB RP. Overrides gpu_mem. Max 192. Default not set. |
| 123 | GPU_MEM_512 : GPU memory in megabyte for the 512MB Raspberry Pi. Ignored by the |
| 124 | 256MB RP. Overrides gpu_mem. Max 448. Default not set. |
| 125 | GPU_MEM_1024: GPU memory in megabyte for the 1024MB Raspberry Pi. Ignored by the |
| 126 | 256MB/512MB RP. Overrides gpu_mem. Max 944. Default not set. |
| 127 | |
| 128 | 3.C. Add purchased license codecs |
| 129 | ================================= |
| 130 | To add you own licenses use variables KEY_DECODE_MPG2 and KEY_DECODE_WVC1 in |
| 131 | local.conf. Example: |
| 132 | KEY_DECODE_MPG2 = "12345678" |
| 133 | KEY_DECODE_WVC1 = "12345678" |
| 134 | You can supply more licenses separated by comma. Example: |
| 135 | KEY_DECODE_WVC1 = "0x12345678,0xabcdabcd,0x87654321" |
| 136 | |
| 137 | 3.D. Disable overscan |
| 138 | ===================== |
| 139 | By default the GPU adds a black border around the video output to compensate for |
| 140 | TVs which cut off part of the image. To disable this set this variable in |
| 141 | local.conf: |
| 142 | DISABLE_OVERSCAN = "1" |
| 143 | |
| 144 | 3.E. Set overclocking options |
| 145 | ============================= |
| 146 | The Raspberry PI can be overclocked. As of now overclocking up to the "Turbo |
| 147 | Mode" is officially supported by the raspbery and does not void warranty. |
| 148 | Check the config.txt for a detailed description of options and modes. Example: |
| 149 | # Turbo mode |
| 150 | ARM_FREQ = "1000" |
| 151 | CORE_FREQ = "500" |
| 152 | SDRAM_FREQ = "500" |
| 153 | OVER_VOLTAGE = "6" |
| 154 | |
| 155 | 3.F. Video camera support with V4L2 drivers |
| 156 | =========================================== |
| 157 | Set this variable to enable support for the video camera (Linux 3.12.4+ required) |
| 158 | VIDEO_CAMERA = "1" |
| 159 | |
| 160 | 3.G. Enable offline compositing support |
| 161 | ======================================= |
| 162 | Set this variable to enable support for dispmanx offline compositing |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 163 | DISPMANX_OFFLINE = "1" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 164 | |
| 165 | This will enable the firmware to fall back to off-line compositing of |
| 166 | Dispmanx elements. Normally the compositing is done on-line, during scanout, |
| 167 | but cannot handle too many elements. With off-line enabled, an off-screen |
| 168 | buffer is allocated for compositing. When scene complexity (number and sizes |
| 169 | of elements) is high, compositing will happen off-line into the buffer. |
| 170 | |
| 171 | Heavily recommended for Wayland/Weston. |
| 172 | |
| 173 | See: http://wayland.freedesktop.org/raspberrypi.html |
| 174 | |
| 175 | 3.H. Enable kgdb over console support |
| 176 | ===================================== |
| 177 | To add the kdbg over console (kgdboc) parameter to the kernel command line, |
| 178 | set this variable in local.conf: |
| 179 | ENABLE_KGDB = "1" |
| 180 | |
| 181 | 3.I. Boot to U-Boot |
| 182 | =================== |
| 183 | To have u-boot load kernel image, set in your local.conf |
| 184 | KERNEL_IMAGETYPE = "uImage" |
| 185 | |
| 186 | This will make kernel.img be u-boot image which will load uImage. |
| 187 | By default, kernel.img is the actual kernel image (ex. Image). |
| 188 | |
| 189 | 3.J. Image with Initramfs |
| 190 | ========================= |
| 191 | To build an initramfs image : |
| 192 | * Set this 3 kernel variables (in linux-raspberrypi.inc for example) |
| 193 | - kernel_configure_variable BLK_DEV_INITRD y |
| 194 | - kernel_configure_variable INITRAMFS_SOURCE "" |
| 195 | - kernel_configure_variable RD_GZIP y |
| 196 | * Set the yocto variables (in linux-raspberrypi.inc for example) |
| 197 | - INITRAMFS_IMAGE = "<a name for your initramfs image>" |
| 198 | - INITRAMFS_IMAGE_BUNDLE = "1" |
| 199 | * Set the meta-rasberrypi variable (in raspberrypi.conf for example) |
| 200 | - KERNEL_INITRAMFS = "-initramfs" |
| 201 | |
| 202 | 3.K. Device tree support |
| 203 | ========================= |
| 204 | Device tree for RPi is only supported when using linux-raspberrypi 3.18+ |
| 205 | kernels. |
| 206 | |
| 207 | * Set KERNEL_DEVICETREE (in conf/machine/raspberrypi.conf) |
| 208 | - the trailer is added to the kernel image before kernel install task. |
| 209 | While creating the SDCard image, this modified kernel is put on |
| 210 | boot partition (as kernel.img) as well as DeviceTree blobs (.dtb files). |
| 211 | |
| 212 | NOTE: KERNEL_DEVICETREE is default enabled for kernel >= 3.18 and always disabled for |
| 213 | older kernel versions. |
| 214 | |
| 215 | 3.L. Enable SPI bus |
| 216 | ==================== |
| 217 | When using device tree kernels, set this variable to enable the SPI bus |
| 218 | ENABLE_SPI_BUS = "1" |
| 219 | |
| 220 | 3.M. Enable I2C |
| 221 | =============== |
| 222 | When using device tree kernels, set this variable to enable I2C |
| 223 | ENABLE_I2C = "1" |
| 224 | |
| 225 | 3.N. Enable PiTFT support |
| 226 | ========================= |
| 227 | Basic support for using PiTFT screens can be enabled by adding |
| 228 | below in local.conf: |
| 229 | |
| 230 | MACHINE_FEATURES += "pitft" |
| 231 | - This will enable SPI bus and i2c device-trees, it will also setup |
| 232 | framebuffer for console and x server on PiTFT. |
| 233 | |
| 234 | NOTE: To get this working the overlay for the PiTFT model must be build, |
| 235 | added and specified as well (dtoverlay=<driver> in config.txt) |
| 236 | |
| 237 | Below is a list of currently supported PiTFT models in meta-raspberrypi, |
| 238 | the modelname should be added as a MACHINE_FEATURES in local.conf like below: |
| 239 | - MACHINE_FEATURES += "pitft <modelname>" |
| 240 | |
| 241 | List of currently supported models: |
| 242 | - pitft22 |
| 243 | - pitft28r |
| 244 | |
| 245 | 3.O. Enable UART |
| 246 | =============== |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 247 | RaspberryPi 0, 1, 2 and CM will have UART console enabled by default. |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 248 | |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 249 | RaspberryPi 0 WiFi and 3 does not have the UART enabled by default because this |
| 250 | needs a fixed core frequency and enable_uart wil set it to the minimum. Certain |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 323 | 7.B. Patches and pull requests |
| 324 | ============================== |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 325 | |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 326 | To contribute to this project you should send pull requests to the github mirror |
| 327 | (<https://github.com/agherzan/meta-raspberrypi>). **Additionally** you can send |
| 328 | the patches for review to the above specified mailing list. |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 329 | |
| 330 | When creating patches, please use something like: |
| 331 | |
| 332 | git format-patch -s --subject-prefix='meta-raspberrypi][PATCH' origin |
| 333 | |
| 334 | When sending patches to mailing list, please use something like: |
| 335 | |
| 336 | git send-email --to yocto@yoctoproject.org <generated patch> |
| 337 | |
Brad Bishop | 3a5fbf5 | 2017-12-04 02:17:07 -0500 | [diff] [blame] | 338 | 7.C. Github issues |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 339 | ================== |
| 340 | In order to manage and trace the meta-raspberrypi issues, we use github issues: |
| 341 | https://github.com/agherzan/meta-raspberrypi/issues |
| 342 | |
| 343 | If you push patches which have a github issue associated, please provide the |
| 344 | issue number in the commit log just before "Signed-off-by" line(s). Example line |
| 345 | for a bug: |
| 346 | [Issue #13] |
| 347 | |
| 348 | |
| 349 | 8. Maintainers |
| 350 | ============== |
| 351 | |
| 352 | Andrei Gherzan <andrei at gherzan.ro> |