diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc index cd6d0b0..d4a25a4 100644 --- a/conf/machine/include/rpi-base.inc +++ b/conf/machine/include/rpi-base.inc @@ -42,6 +42,7 @@ RPI_KERNEL_DEVICETREE_OVERLAYS ?= " \ overlays/w1-gpio.dtbo \ overlays/gpio-ir.dtbo \ overlays/gpio-ir-tx.dtbo \ + overlays/imx219.dtbo \ " RPI_KERNEL_DEVICETREE ?= " \ diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 8460184..921dcc5 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md @@ -326,3 +326,17 @@ option: # Raspberry Pi 7\" display/touch screen \n \ lcd_rotate=2 \n \ ' +## Enable Raspberrypi Camera V2 + +RaspberryPi does not have the unicam device ( RaspberryPi Camera ) enabled by default. +Because this unicam device ( bcm2835-unicam ) as of now is used by libcamera opensource. +So we have to explicitly set in local.conf. + + RASPBERRYPI_CAMERA_V2 = "1" + +This will add the device tree overlays imx219 ( RaspberryPi Camera sensor V2 driver ) to config.txt. +Also, this will enable adding Contiguous Memory Allocation value in the cmdline.txt. + +Ref.: +* +* diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index 9489951..e1c330d 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -178,6 +178,12 @@ do_deploy() { echo "dtoverlay=${VC4DTBO}" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt fi + # Choose Camera Sensor to be used, default imx219 sensor + if [ "${RASPBERRYPI_CAMERA_V2}" = "1" ]; then + echo "# Enable Sony RaspberryPi Camera" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt + echo "dtoverlay=imx219" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/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}/${BOOTFILES_DIR_NAME}/config.txt diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 3219a23..4e0d4d0 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc @@ -27,7 +27,8 @@ LINUX_VERSION_EXTENSION ?= "" # CMDLINE for raspberrypi SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}" -CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" +CMA ?= "${@oe.utils.conditional("RASPBERRYPI_CAMERA_V2", "1", "cma=64M", "", d)}" +CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait ${CMA}" # Add the kernel debugger over console kernel command line option if enabled CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'