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
-
On your layers directory, create a layer to contain your patches (e.g.
meta-spread-spectrum). You can usebitbake-layersto do this. -
In the
meta-spread-spectrumlayer create arecipes-bspfolder that will contain the modifications on Toradex BSP.$ mkdir recipes-bsp && cd recipes-bsp -
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 -
Add your patch to the
imx-atf/imx-atf/verdin-imx8mpfolder. 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. -
Create the append file
imx-atf_2.2.bbappendas 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" -
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 -
Add your patch to the
u-boot/u-boot-toradex/verdin-imx8mpfolder. You can find a reference implementation of the patch for Verdin iMX8M Plus at 0001-PATCH-Enable-SSCG-on-DRAM.patch. -
Create the append file
u-boot-toradex_2020.04.bbappendas follows:u-boot-toradex_2020.04.bbappendFILESEXTRAPATHS:prepend:verdin-imx8mp := "${THISDIR}/${PN}:"
SRC_URI += "\
file://0001-PATCH-Enable-SSCG-on-DRAM.patch" -
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 -
(Optional) Check if your layer is being correctly loaded by using the
bitbake-layers [show-layers] [show-recipes]command. -
Build your customized image using the
Bitbakecommand. For this, follow the steps described on the Build a Reference Image with Yocto Project/OpenEmbedded article.