Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | include conf/machine/include/rpi-default-settings.inc |
| 2 | include conf/machine/include/rpi-default-versions.inc |
| 3 | include conf/machine/include/rpi-default-providers.inc |
| 4 | |
| 5 | SOC_FAMILY = "rpi" |
| 6 | include conf/machine/include/soc-family.inc |
| 7 | |
| 8 | IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 9 | WKS_FILE ?= "sdimage-raspberrypi.wks" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 10 | |
| 11 | XSERVER = " \ |
| 12 | xserver-xorg \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 13 | ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xserver-xorg-extension-glx", "", d)} \ |
| 14 | ${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "xf86-video-modesetting", "xf86-video-fbdev", d)} \ |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 15 | " |
| 16 | |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 17 | RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 18 | overlays/at86rf233.dtbo \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | overlays/dwc2.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 20 | overlays/gpio-key.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 21 | overlays/hifiberry-amp.dtbo \ |
| 22 | overlays/hifiberry-dac.dtbo \ |
| 23 | overlays/hifiberry-dacplus.dtbo \ |
| 24 | overlays/hifiberry-digi.dtbo \ |
| 25 | overlays/i2c-rtc.dtbo \ |
| 26 | overlays/iqaudio-dac.dtbo \ |
| 27 | overlays/iqaudio-dacplus.dtbo \ |
| 28 | overlays/lirc-rpi.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 29 | overlays/pi3-disable-bt.dtbo \ |
| 30 | overlays/pi3-miniuart-bt.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 31 | overlays/pitft22.dtbo \ |
| 32 | overlays/pitft28-resistive.dtbo \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | overlays/pitft35-resistive.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 34 | overlays/pps-gpio.dtbo \ |
| 35 | overlays/rpi-ft5406.dtbo \ |
Brad Bishop | 9392c69 | 2018-09-07 15:37:17 +0100 | [diff] [blame] | 36 | overlays/rpi-poe.dtbo \ |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 37 | overlays/vc4-kms-v3d.dtbo \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 38 | overlays/w1-gpio-pullup.dtbo \ |
| 39 | overlays/w1-gpio.dtbo \ |
Brad Bishop | f27bdd5 | 2018-05-07 15:42:31 +0200 | [diff] [blame] | 40 | " |
| 41 | |
| 42 | RPI_KERNEL_DEVICETREE ?= " \ |
| 43 | bcm2708-rpi-0-w.dtb \ |
| 44 | bcm2708-rpi-b.dtb \ |
| 45 | bcm2708-rpi-b-plus.dtb \ |
| 46 | bcm2709-rpi-2-b.dtb \ |
| 47 | bcm2710-rpi-3-b.dtb \ |
| 48 | bcm2710-rpi-3-b-plus.dtb \ |
| 49 | bcm2708-rpi-cm.dtb \ |
| 50 | bcm2710-rpi-cm3.dtb \ |
| 51 | " |
| 52 | |
| 53 | KERNEL_DEVICETREE ?= " \ |
| 54 | ${RPI_KERNEL_DEVICETREE} \ |
| 55 | ${RPI_KERNEL_DEVICETREE_OVERLAYS} \ |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 56 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 57 | |
| 58 | # By default: |
| 59 | # |
| 60 | # * When u-boot is disabled use the "Image" format which can be directly loaded |
| 61 | # by the rpi firmware. |
| 62 | # |
| 63 | # * When u-boot is enabled use the "uImage" format and the "bootm" command |
| 64 | # within u-boot to load the kernel. |
| 65 | KERNEL_BOOTCMD ??= "bootm" |
| 66 | KERNEL_IMAGETYPE_UBOOT ??= "uImage" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 67 | KERNEL_IMAGETYPE_DIRECT ??= "zImage" |
| 68 | KERNEL_IMAGETYPE ?= "${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
| 69 | '${KERNEL_IMAGETYPE_UBOOT}', '${KERNEL_IMAGETYPE_DIRECT}', d)}" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 70 | |
| 71 | MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" |
| 72 | |
| 73 | # Raspberry Pi has no hardware clock |
| 74 | MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" |
| 75 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 76 | MACHINE_EXTRA_RRECOMMENDS += " kernel-modules udev-rules-rpi" |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 77 | |
| 78 | # Set Raspberrypi splash image |
| 79 | SPLASH = "psplash-raspberrypi" |
| 80 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 81 | def make_dtb_boot_files(d): |
| 82 | # Generate IMAGE_BOOT_FILES entries for device tree files listed in |
| 83 | # KERNEL_DEVICETREE. |
| 84 | alldtbs = d.getVar('KERNEL_DEVICETREE') |
| 85 | imgtyp = d.getVar('KERNEL_IMAGETYPE') |
| 86 | |
| 87 | def transform(dtb): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 88 | base = os.path.basename(dtb) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 89 | if dtb.endswith('dtb'): |
| 90 | # eg: whatever/bcm2708-rpi-b.dtb has: |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 91 | # DEPLOYDIR file: bcm2708-rpi-b.dtb |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 92 | # destination: bcm2708-rpi-b.dtb |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 93 | return base |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 94 | elif dtb.endswith('dtbo'): |
| 95 | # overlay dtb: |
| 96 | # eg: overlays/hifiberry-amp.dtbo has: |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 97 | # DEPLOYDIR file: hifiberry-amp.dtbo |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 98 | # destination: overlays/hifiberry-amp.dtbo |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 99 | return '{};{}'.format(base, dtb) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 100 | |
| 101 | return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) |
| 102 | |
| 103 | |
| 104 | IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* \ |
| 105 | ${@make_dtb_boot_files(d)} \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 106 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 107 | '${KERNEL_IMAGETYPE} u-boot.bin;${SDIMG_KERNELIMAGE} boot.scr', \ |
| 108 | '${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}', d)} \ |
| 109 | " |
| 110 | do_image_wic[depends] += " \ |
| 111 | bcm2835-bootfiles:do_deploy \ |
| 112 | ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \ |
| 113 | " |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 114 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 115 | do_image_wic[recrdeps] = "do_build" |
| 116 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 117 | # The kernel image is installed into the FAT32 boot partition and does not need |
| 118 | # to also be installed into the rootfs. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 119 | RDEPENDS_${KERNEL_PACKAGE_NAME}-base = "" |