PHYTEC VM-017/VM-117 for BSP-Yocto-FSL-i.MX8MP-PD21.1.1
=======================================================

Introduction
------------

Install
-------

There are prebuild images of the driver module and the devicetrees
which can be used out-of-the-box with the BSP-Yocto-FSL-i.MX8MP-PD21.1.1
release.

NOTE: This procedure does not work with BSP-Yocto-FSL-i.MX8MP-PD21.1.0, the
latest version BSP-Yocto-FSL-i.MX8MP-PD21.1.1 is required.

1. Copy the ar052x.ko and .dtb files onto the target board with a method
   of your choice, e.g. scp.

2. Mount the boot partition from eMMC or SD-card which contains the
   Linux Kernel image and the devicetree to use.
   target$ mount /dev/mmcblk1p1 /mnt		(SD-card)
   target$ mount /dev/mmcblk0p1 /mnt		(eMMC)

3. Copy the dtb files into the boot partition.
   target$ cp \*.dtb /mnt/

4. Copy the dtb file you would like to boot with into the oftree file
   in the boot partition.
   target$ cp /mnt/imx8mp-phyboard-pollux-rdk-vm017.dtb /mnt/oftree

5. Copy the ar052x.ko kernel module to /lib/modules/$(uname -r)/extra
   target$ cp ar052x.ko /lib/modules/$(uname -r)/extra/

6. Activate the newly added kernel module with depmod
   target$ depmod

5. Reboot
   target$ reboot

7. Now the driver for the VM-017/117 phyCAM-M is laoded and can be used.


Build
-----

To build the kernel module and devicetree a cross-compiler toolchain is
required and the kernel sources from the BSP release to build them
against.

The cross-compiler toolchain is part of the Yocto SDK available on our
download page, so we recommend to use this one.

The kernel sources can be download from git:
https://git.phytec.de

Take following steps to build the kernel module and devicetree blobs.

1. Check out the kernel sources for BSP-Yocto-FSL-i.MX8MP-PD21.1.1:
   host$ git clone --depth 1 -b v5.4.70_2.3.2-phy5 git://git.phytec.de/linux-imx

2. Source the environment from the Yocto SDK.
   host$ . <path_to_sdk>/environment-setup-aarch64-phytec-linux

3. Copy the kernel configuration from our download server
   host$ cd linux-imx
   host$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-i.MX8MP/BSP-Yocto-FSL-i.MX8MP-PD21.1.1/images/yogurt-vendor-xwayland/phyboard-pollux-imx8mp-2/Image.config -O .config

4. Build the kernel.
   host$ make -j4

5. Build ar052x module and devicetrees.
   host$ cd ..
   host$ STAGING_KERNEL_DIR=linux-imx make


Requirements
------------
In order to build the Linux Kernel module we recommend using the prebuild
Yocto SDK which can be downloaded here:

https://download.phytec.de/Software/Linux/BSP-Yocto-i.MX8MP/BSP-Yocto-FSL-i.MX8MP-PD21.1.1/sdk/yogurt-vendor-xwayland/

More information about how to build and use the SDK can be found in our
Yocto Reference Manual (L-813e).

https://www.phytec.de/cdocuments/?doc=NgKGEg
