This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62A-LP: SK-AM62A-LP Camera Device Tree Driver Porting

Part Number: SK-AM62A-LP

Hi.

I used SK-AM62A-LP,
I'm trying to port custom CSI2 camera (SONY IMX307)
I use .dts for linux academy and sdk doc
I can't find an example of porting a camera driver

Can you give me a good example for me to refer to?
* It doesn't have to be an AM62A document
It doesn't have to be IMX307.

  • Hi Hyunwoo

    Did you have any chance to read the following guidance?

    Thanks.

    Best Regards, 

    Jack

    ==============================================

    Enable A New CSI-2 Sensor

    The Processor SDK supports one or more camera sensors by default. Both the driver modules and the device tree overlays for the supported sensors are pre-built and included in the SDK. To enable a new CSI-2 sensor, the following listed steps are needed to build the driver and device tree on the host and copy to the target. The OV9281 sensor is used as an example in the given steps. Some steps can be skipped if the driver is already included in the SDK.

    1. Add the sensor driver source code to drivers/media/i2c (path is relative to <sdk root>/board-support/linux-<version>):

      drivers/media/i2c/ov9281.c
      
    2. Add the sensor in drivers/media/i2c/Kconfig. For example:

      config VIDEO_OV9281
              tristate "OmniVision OV9281 sensor support"
              depends on GPIOLIB && VIDEO_V4L2 && I2C
              select MEDIA_CONTROLLER
              select VIDEO_V4L2_SUBDEV_API
              select V4L2_FWNODE
              help
                This is a Video4Linux2 sensor driver for the OmniVision
                OV9281 camera sensor.
      
    3. Add the sensor driver to drivers/media/i2c/Makefile:

      obj-$(CONFIG_VIDEO_OV9281) += ov9281.o
      
    4. Enable the sensor in ti_config_fragments/v8_audio_display.cfg:

      CONFIG_VIDEO_OV9281=m
      
    5. Create a device tree overlay for the sensor and add to arch/arm64/boot/dts/ti:

      arch/arm64/boot/dts/ti/k3-am625-sk-csi2-ov9281.dts
      
    6. Add the device tree overlay to arch/arm64/boot/dts/ti/Makefile:

      dtb-$(CONFIG_ARCH_K3) += k3-am625-sk-csi2-ov9281.dtbo
      
    7. Generate the defconfig and rebuild kernel image, modules and device tree, according to instructions given in section Build Kernel:

      $ ti_config_fragments/defconfig_builder.sh -t ti_sdk_arm64_release
      $ make ti_sdk_arm64_release_defconfig
      $ make Image modules dtbs
      
    8. Install the newly built kernel image, modules and device tree overlay binary:

      $ sudo cp arch/arm64/boot/Image <path to root of file system>/boot
      $ sudo cp arch/arm64/boot/dts/ti/k3-am625-sk-csi2-ov9281.dtbo <path to root of file system>/boot
      $ sudo make INSTALL_MOD_PATH=<path to root of file system> modules_install
      
    9. Boot the EVM with the updated kernel and root filesystem. Apply the device tree overlay at U-Boot prompt:

      =>setenv name_overlays k3-am625-sk-csi2-ov9281.dtbo
      =>saveenv
      =>boot
      
    10. Verify the sensor is added using “v4l2-ctl” and “media-ctl” utilities as described earlier.

      #media-ctl -d /dev/media0 -p
      ...
      - entity 13: ov9281 4-0060 (1 pad, 1 link)
            type V4L2 subdev subtype Sensor flags 0
            device node name /dev/v4l-subdev2
       pad0: Source
               [fmt:SGRBG8_1X8/1280x800 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range
                crop.bounds:(0,0)/1280x800
                crop:(0,0)/1280x800]
               -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
      ...


  • Hello Hyunwoo,

    Which version of SDK are you using? The instructions provided by Jack above were for SDK 8.6.

    Regards,

    Jianzhong

  • Hi Jianzhong

    Please provide us with the latest guidance based on PSDK 9.1 for AM62Ax.

    They would use the latest SDK version before they fix SDK version for thier MP release. 

    - EdgeAI SDK setup : AM62AX/09_01_00/

    Thanks.

    Best Regards, 

    Jack

  • Hello Jack,

    Please refer to the latest Linux Academy (based on 9.0 but applies to 9.1) on adding a new sensor driver (scroll to "Enable A New CSI-2 Sensor"). 

    Please note that we do not cover how to write a driver from scratch. The existing sensor drivers can be references for you.

    Regards,

    Jianzhong