Skip to main content

Enable Spread Spectrum Clocking on the DDR Interface

Introduction

This article brings one possible approach to enable spread spectrum clocking using the DDR interface. The reference implementation in this article is done using a Verdin iMX8M Plus System on Module.

Why Enabling Spread Spectrum Clocking?

In some situations, users might face EMI issues due to spikes around specific frequencies, such as 4 Ghz. So, this is indicated to reduce the electromagnetic peak arround that specific frequency.

Prerequisites

Setup your development environmet for Yocto Project. Refer to Build a Reference Image with Yocto Project/OpenEmbedded.

Customize U-Boot and ATF to Enable Spread Spectrum Clocking

  1. On your layers directory, create a layer to contain your patches (e.g. meta-spread-spectrum). You can use bitbake-layers to do this.

  2. In the meta-spread-spectrum layer create a recipes-bsp folder that will contain the modifications on Toradex BSP.

    $ mkdir recipes-bsp && cd recipes-bsp
  3. Inside the recipes-bsp, create the directories that will contain the patch on the Arm Trusted Firmware (imx-atf)

    $ mkdir -p imx-atf/imx-atf/verdin-imx8mp
    $ tree .
    .
    └── imx-atf
    └── imx-atf
    └── verdin-imx8mp
  4. Add your patch to the imx-atf/imx-atf/verdin-imx8mp folder. You can find a reference implementation of the patch for Verdin iMX8M Plus at 0001-PATCH-Add-DRAM-PLL-for-1866MHz-and-enable-SSCG.patch.

  5. Create the append file imx-atf_2.2.bbappend as follows:

    imx-atf_2.2.bbappend
    # check imx-atf bbappend in meta-toradex-nxp
    # it strongly defines SRC_URI
    FILESEXTRAPATHS:prepend:verdin-imx8mp := "${THISDIR}/${PN}:"

    SRC_URI:append:verdin-imx8mp = " \
    file://0001-PATCH-Add-DRAM-PLL-for-1866MHz-and-enable-SSCG.patch"
  6. Inside the recipes-bsp, create the directories that will contain the patches to be applied on U-Boot (u-boot).

    $ mkdir -p u-boot/u-boot-toradex/verdin-imx8mp
    $ tree .
    .
    ├── imx-atf
    │   └── imx-atf
    │   └── verdin-imx8mp
    └── u-boot
    └── u-boot-toradex
    └── verdin-imx8mp
  7. Add your patch to the u-boot/u-boot-toradex/verdin-imx8mp folder. You can find a reference implementation of the patch for Verdin iMX8M Plus at 0001-PATCH-Enable-SSCG-on-DRAM.patch.

  8. Create the append file u-boot-toradex_2020.04.bbappend as follows:

    u-boot-toradex_2020.04.bbappend
    FILESEXTRAPATHS:prepend:verdin-imx8mp := "${THISDIR}/${PN}:"

    SRC_URI += "\
    file://0001-PATCH-Enable-SSCG-on-DRAM.patch"

  9. Verify if your layer directory looks like this:

    $ tree
    .
    ├── conf
    │   └── layer.conf
    ├── COPYING.MIT
    ├── README
    └── recipes-bsp
    ├── imx-atf
    │   ├── imx-atf
    │   │   └── verdin-imx8mp
    │   │   └── 0001-PATCH-Add-DRAM-PLL-for-1866MHz-and-enable-SSCG.patch
    │   └── imx-atf_2.2.bbappend
    └── u-boot
    ├── u-boot-toradex
    │   └── verdin-imx8mp
    │   └── 0001-PATCH-Enable-SSCG-on-DRAM.patch
    └── u-boot-toradex_2020.04.bbappend
  10. (Optional) Check if your layer is being correctly loaded by using the bitbake-layers [show-layers] [show-recipes] command.

  11. Build your customized image using the Bitbake command. For this, follow the steps described on the Build a Reference Image with Yocto Project/OpenEmbedded article.



Send Feedback!