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