diff options
Diffstat (limited to 'meta-raspberrypi/recipes-bsp')
9 files changed, 331 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb b/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb new file mode 100644 index 000000000..466f44381 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "Closed source binary files to help boot the ARM on the BCM2835." +LICENSE = "Proprietary" + +LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=4a4d169737c0786fb9482bb6d30401d1" + +inherit deploy nopackages + +include recipes-bsp/common/firmware.inc + +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS = "rpi-config" + +COMPATIBLE_MACHINE = "^rpi$" + +S = "${RPIFW_S}/boot" + +PR = "r3" + +do_deploy() { + install -d ${DEPLOYDIR}/${PN} + + for i in ${S}/*.elf ; do + cp $i ${DEPLOYDIR}/${PN} + done + for i in ${S}/*.dat ; do + cp $i ${DEPLOYDIR}/${PN} + done + for i in ${S}/*.bin ; do + cp $i ${DEPLOYDIR}/${PN} + done + + # Add stamp in deploy directory + touch ${DEPLOYDIR}/${PN}/${PN}-${PV}.stamp +} + +addtask deploy before do_build after do_install +do_deploy[dirs] += "${DEPLOYDIR}/${PN}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + diff --git a/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb new file mode 100644 index 000000000..e0b2b58bc --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb @@ -0,0 +1,196 @@ +DESCRIPTION = "Commented config.txt file for the Raspberry Pi. \ + The Raspberry Pi config.txt file is read by the GPU before \ + the ARM core is initialised. It can be used to set various \ + system configuration parameters." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +COMPATIBLE_MACHINE = "^rpi$" + +SRCREV = "648ffc470824c43eb0d16c485f4c24816b32cd6f" +SRC_URI = "git://github.com/Evilpaul/RPi-config.git;protocol=git;branch=master \ + " + +S = "${WORKDIR}/git" + +PR = "r5" + +INHIBIT_DEFAULT_DEPS = "1" + +PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}" +PITFT22="${@bb.utils.contains("MACHINE_FEATURES", "pitft22", "1", "0", d)}" +PITFT28r="${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "1", "0", d)}" +PITFT35r="${@bb.utils.contains("MACHINE_FEATURES", "pitft35r", "1", "0", d)}" + +VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}" +VC4DTBO_raspberrypi3-64 ?= "vc4-fkms-v3d" +VC4DTBO ?= "vc4-kms-v3d" + +inherit deploy nopackages + +do_deploy() { + install -d ${DEPLOYDIR}/bcm2835-bootfiles + + cp ${S}/config.txt ${DEPLOYDIR}/bcm2835-bootfiles/ + + if [ -n "${KEY_DECODE_MPG2}" ]; then + sed -i '/#decode_MPG2=/ c\decode_MPG2=${KEY_DECODE_MPG2}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${KEY_DECODE_WVC1}" ]; then + sed -i '/#decode_WVC1=/ c\decode_WVC1=${KEY_DECODE_WVC1}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${DISABLE_OVERSCAN}" ]; then + sed -i '/#disable_overscan=/ c\disable_overscan=${DISABLE_OVERSCAN}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${DISABLE_SPLASH}" ]; then + sed -i '/#disable_splash=/ c\disable_splash=${DISABLE_SPLASH}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Set overclocking options + if [ -n "${ARM_FREQ}" ]; then + sed -i '/#arm_freq=/ c\arm_freq=${ARM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_FREQ}" ]; then + sed -i '/#gpu_freq=/ c\gpu_freq=${GPU_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${CORE_FREQ}" ]; then + sed -i '/#core_freq=/ c\core_freq=${CORE_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${SDRAM_FREQ}" ]; then + sed -i '/#sdram_freq=/ c\sdram_freq=${SDRAM_FREQ}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${OVER_VOLTAGE}" ]; then + sed -i '/#over_voltage=/ c\over_voltage=${OVER_VOLTAGE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # GPU memory + if [ -n "${GPU_MEM}" ]; then + sed -i '/#gpu_mem=/ c\gpu_mem=${GPU_MEM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_MEM_256}" ]; then + sed -i '/#gpu_mem_256=/ c\gpu_mem_256=${GPU_MEM_256}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_MEM_512}" ]; then + sed -i '/#gpu_mem_512=/ c\gpu_mem_512=${GPU_MEM_512}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${GPU_MEM_1024}" ]; then + sed -i '/#gpu_mem_1024=/ c\gpu_mem_1024=${GPU_MEM_1024}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Set boot delay + if [ -n "${BOOT_DELAY}" ]; then + sed -i '/#boot_delay=/ c\boot_delay=${BOOT_DELAY}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${BOOT_DELAY_MS}" ]; then + sed -i '/#boot_delay_ms=/ c\boot_delay_ms=${BOOT_DELAY_MS}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Set HDMI and composite video options + if [ -n "${HDMI_FORCE_HOTPLUG}" ]; then + sed -i '/#hdmi_force_hotplug=/ c\hdmi_force_hotplug=${HDMI_FORCE_HOTPLUG}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${HDMI_DRIVE}" ]; then + sed -i '/#hdmi_drive=/ c\hdmi_drive=${HDMI_DRIVE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${HDMI_GROUP}" ]; then + sed -i '/#hdmi_group=/ c\hdmi_group=${HDMI_GROUP}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${HDMI_MODE}" ]; then + sed -i '/#hdmi_mode=/ c\hdmi_mode=${HDMI_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${CONFIG_HDMI_BOOST}" ]; then + sed -i '/#config_hdmi_boost=/ c\config_hdmi_boost=${CONFIG_HDMI_BOOST}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${SDTV_MODE}" ]; then + sed -i '/#sdtv_mode=/ c\sdtv_mode=${SDTV_MODE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${SDTV_ASPECT}" ]; then + sed -i '/#sdtv_aspect=/ c\sdtv_aspect=${SDTV_ASPECT}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ -n "${DISPLAY_ROTATE}" ]; then + sed -i '/#display_rotate=/ c\display_rotate=${DISPLAY_ROTATE}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Video camera support + if [ -n "${VIDEO_CAMERA}" ]; then + echo "# Enable video camera" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "start_x=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Offline compositing support + if [ -n "${DISPMANX_OFFLINE}" ]; then + echo "# Enable offline compositing" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dispmanx_offline=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # SPI bus support + if [ -n "${ENABLE_SPI_BUS}" ] || [ "${PITFT}" = "1" ]; then + echo "# Enable SPI bus" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=spi=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # I2C support + if [ -n "${ENABLE_I2C}" ] || [ "${PITFT}" = "1" ]; then + echo "# Enable I2C" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c1=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=i2c_arm=on" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # PiTFT22 display support + if [ "${PITFT22}" = "1" ]; then + echo "# Enable PITFT22 display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft22,rotate=270,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ "${PITFT28r}" = "1" ]; then + echo "# Enable PITFT28r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft28-resistive,rotate=90,speed=32000000,txbuflen=32768" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + if [ "${PITFT35r}" = "1" ]; then + echo "# Enable PITFT35r display" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=pitft35-resistive,rotate=90,speed=42000000,fps=20" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # UART support + if [ "${ENABLE_UART}" = "1" ]; then + echo "# Enable UART" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "enable_uart=1" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # VC4 Graphics support + if [ "${VC4GRAPHICS}" = "1" ]; then + echo "# Enable VC4 Graphics" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=${VC4DTBO},${VC4_CMA_SIZE}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Waveshare "C" 1024x600 7" Rev2.1 IPS capacitive touch (http://www.waveshare.com/7inch-HDMI-LCD-C.htm) + if [ "${WAVESHARE_1024X600_C_2_1}" = "1" ]; then + echo "# Waveshare \"C\" 1024x600 7\" Rev2.1 IPS capacitive touch screen" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "max_usb_current=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "hdmi_group=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "hdmi_mode=87" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "hdmi_cvt 1024 600 60 6 0 0 0" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # DWC2 USB peripheral support + if [ "${ENABLE_DWC2_PERIPHERAL}" = "1" ]; then + echo "# Enable USB peripheral mode" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=dwc2,dr_mode=peripheral" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # Append extra config if the user has provided any + echo "${RPI_EXTRA_CONFIG}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt +} + +do_deploy_append_raspberrypi3-64() { + echo "# have a properly sized image" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "disable_overscan=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + + echo "# Enable audio (loads snd_bcm2835)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt +} + +addtask deploy before do_build after do_install +do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-raspberrypi/recipes-bsp/common/firmware.inc b/meta-raspberrypi/recipes-bsp/common/firmware.inc new file mode 100644 index 000000000..d564a49ab --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/common/firmware.inc @@ -0,0 +1,10 @@ +RPIFW_DATE ?= "20180417" +SRCREV ?= "5db8e4e1c63178e200d6fbea23ed4a9bf4656658" +RPIFW_SRC_URI ?= "https://github.com/raspberrypi/firmware/archive/${SRCREV}.tar.gz" +RPIFW_S ?= "${WORKDIR}/firmware-${SRCREV}" + +SRC_URI = "${RPIFW_SRC_URI}" +SRC_URI[md5sum] = "6bce52f22a7a005a9bcdb9912b132590" +SRC_URI[sha256sum] = "84568c4e7f5b0deee4cd76e7c0b48315885f983d6131d8148ef8af8438328a36" + +PV = "${RPIFW_DATE}" diff --git a/meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig b/meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig new file mode 100644 index 000000000..bef4ce3c9 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig @@ -0,0 +1,6 @@ +HAVE_TOUCHSCREEN=0 +HAVE_KEYBOARD=1 + +DISPLAY_CAN_ROTATE=0 +DISPLAY_ORIENTATION=0 +DISPLAY_DPI=133 diff --git a/meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend b/meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend new file mode 100644 index 000000000..72d991c7e --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in b/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in new file mode 100644 index 000000000..ad54cd067 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.in @@ -0,0 +1,3 @@ +fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs +fatload mmc 0:1 ${kernel_addr_r} @@KERNEL_IMAGETYPE@@ +@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr} diff --git a/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bb b/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bb new file mode 100644 index 000000000..0106ac3ff --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bb @@ -0,0 +1,26 @@ +SUMMARY = "U-boot boot scripts for Raspberry Pi" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +COMPATIBLE_MACHINE = "^rpi$" + +DEPENDS = "u-boot-mkimage-native" + +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://boot.cmd.in" + +do_compile() { + sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ + -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ + "${WORKDIR}/boot.cmd.in" > "${WORKDIR}/boot.cmd" + mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr +} + +inherit deploy nopackages + +do_deploy() { + install -d ${DEPLOYDIR} + install -m 0644 boot.scr ${DEPLOYDIR} +} + +addtask do_deploy after do_compile before do_build diff --git a/meta-raspberrypi/recipes-bsp/u-boot/u-boot/0002-rpi_0_w-Add-configs-consistent-with-RpI3.patch b/meta-raspberrypi/recipes-bsp/u-boot/u-boot/0002-rpi_0_w-Add-configs-consistent-with-RpI3.patch new file mode 100644 index 000000000..e98fd85ae --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/u-boot/u-boot/0002-rpi_0_w-Add-configs-consistent-with-RpI3.patch @@ -0,0 +1,41 @@ +From 5d113dc0130ea2ea9faaa000fba9c737266b9747 Mon Sep 17 00:00:00 2001 +From: Drew Moseley <drew.moseley@northern.tech> +Date: Fri, 9 Feb 2018 18:10:09 -0500 +Subject: [PATCH] rpi_0_w: Add configs consistent with RpI3 + +Upstream-Status: Accepted [https://patchwork.ozlabs.org/patch/856572/] + +Signed-off-by: Drew Moseley <drew.moseley@northern.tech> +--- + configs/rpi_0_w_defconfig | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig +index 9a6d24b..1248294 100644 +--- a/configs/rpi_0_w_defconfig ++++ b/configs/rpi_0_w_defconfig +@@ -12,14 +12,21 @@ CONFIG_SYS_PROMPT="U-Boot> " + CONFIG_CMD_GPIO=y + CONFIG_CMD_MMC=y + CONFIG_CMD_USB=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_FAT_INTERFACE="mmc" ++CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" ++CONFIG_DM_KEYBOARD=y + CONFIG_DM_MMC=y + CONFIG_MMC_SDHCI=y + CONFIG_MMC_SDHCI_BCM2835=y + CONFIG_DM_ETH=y + CONFIG_USB=y + CONFIG_DM_USB=y ++CONFIG_USB_DWC2=y + CONFIG_USB_STORAGE=y + CONFIG_USB_KEYBOARD=y ++CONFIG_USB_HOST_ETHER=y ++CONFIG_USB_ETHER_SMSC95XX=y + CONFIG_DM_VIDEO=y + CONFIG_SYS_WHITE_ON_BLACK=y + CONFIG_CONSOLE_SCROLL_LINES=10 +-- +2.7.4 + diff --git a/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend new file mode 100644 index 000000000..7d4a49e23 --- /dev/null +++ b/meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot:" + +SRC_URI_append_rpi = " \ + file://0002-rpi_0_w-Add-configs-consistent-with-RpI3.patch \ +" + +DEPENDS_append_rpi = " rpi-u-boot-scr" |