From f8ba05d065c78c04153119f38df9237988e7b23a Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 10 Oct 2018 12:47:04 +0200 Subject: [PATCH 01/10] imx-boot, imx-sc-firmware: adapt recipes for step B0 of the i.MX8X CPU These adaptations include changing the mkimage targets and removing any handling of the DCD files, since they are now included in the SCFW. Note that these changes break support for step A0 of the silicon. The md5sum of the imx-sc-firmware tarball will be updated once the step B0 CPUs are ready. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- .../recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 17 ++++------------- .../imx-sc-firmware/imx-sc-firmware_0.7.bb | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb index b3e817eeb..f2e4f26c0 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb @@ -71,8 +71,6 @@ DCD_NAME ?= "imx8qm_dcd.cfg.tmp" DCD_NAME_mx8qm = "imx8qm_dcd.cfg.tmp" DCD_NAME_mx8qxp = "imx8qx_dcd.cfg.tmp" -DCD_SRC_NAME = "imx8qx_dcd_1.2GHz.cfg" - UBOOT_NAME = "u-boot-${MACHINE}.bin" BOOT_CONFIG_MACHINE = "${BOOT_NAME}" @@ -92,9 +90,6 @@ IMXBOOT_TARGETS ?= "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi' IMXBOOT_TARGETS_mx8qxp = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \ bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ 'flash_all flash', d), d)}" -IMXBOOT_TARGETS_ccimx8x = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi_a0', \ - bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand_a0', \ - 'flash_dcd_a0 flash_multi_cores_a0', d), d)}" IMXBOOT_TARGETS_imx8qxpddr3arm2 = "flash_ddr3_dcd_a0" S = "${WORKDIR}/git" @@ -129,10 +124,11 @@ do_compile () { cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin ${S}/${SOC_TARGET}/m40_tcm.bin cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin ${S}/${SOC_TARGET}/CM4.bin cp ${DEPLOY_DIR_IMAGE}/ahab-container.img ${S}/${SOC_TARGET}/ - cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME} ${S}/${SOC_TARGET}/scfw_tcm.bin cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${S}/${SOC_TARGET}/bl31.bin for type in ${UBOOT_CONFIG}; do + RAM_SIZE="$(echo ${type} | sed -e 's,.*\([0-9]\+GB\),\1,g')" cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${UBOOT_NAME}-${type} ${S}/${SOC_TARGET}/u-boot.bin-${type} + cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME}-${RAM_SIZE} ${S}/${SOC_TARGET}/scfw_tcm.bin-${RAM_SIZE} done fi @@ -146,7 +142,7 @@ do_compile () { cd ${S}/${SOC_TARGET} ln -sf u-boot.bin-${type} u-boot.bin RAM_SIZE="$(echo ${type} | sed -e 's,.*\([0-9]\+GB\),\1,g')" - ln -sf ${DCD_SRC_NAME}-${RAM_SIZE} ${DCD_SRC_NAME} + ln -sf scfw_tcm.bin-${RAM_SIZE} scfw_tcm.bin cd - for target in ${IMXBOOT_TARGETS}; do echo "building ${SOC_TARGET} - ${type} - ${target}" @@ -155,8 +151,7 @@ do_compile () { cp ${S}/${SOC_TARGET}/flash.bin ${S}/${BOOT_CONFIG_MACHINE}-${type}.bin-${target} fi done - cp ${S}/${SOC_TARGET}/${DCD_NAME} ${S}/${SOC_TARGET}/${DCD_NAME}-${type} - rm ${S}/${SOC_TARGET}/${DCD_SRC_NAME} + rm ${S}/${SOC_TARGET}/scfw_tcm.bin rm ${S}/${SOC_TARGET}/u-boot.bin # Remove u-boot-atf.bin so it gets generated with the next iteration's U-Boot rm ${S}/${SOC_TARGET}/u-boot-atf.bin @@ -194,10 +189,6 @@ do_deploy () { install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} else - # the DCD only needs to get copied when using an A0 CPU - for type in ${UBOOT_CONFIG}; do - install -m 0644 ${S}/${SOC_TARGET}/${DCD_NAME}-${type} ${DEPLOYDIR}/${DEPLOYDIR_IMXBOOT} - done install -m 0644 ${S}/${SOC_TARGET}/ahab-container.img ${DEPLOYDIR}/${DEPLOYDIR_IMXBOOT} install -m 0644 ${S}/${SOC_TARGET}/m40_tcm.bin ${DEPLOYDIR}/${DEPLOYDIR_IMXBOOT} install -m 0644 ${S}/${SOC_TARGET}/CM4.bin ${DEPLOYDIR}/${DEPLOYDIR_IMXBOOT} diff --git a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb b/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb index 37f16775f..d2d78432c 100644 --- a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb +++ b/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb @@ -23,18 +23,24 @@ SYSROOT_DIRS += "/boot" do_install () { install -d ${D}/boot - install -m 0644 ${S}/${SC_FIRMWARE_NAME} ${D}/boot/ + for type in ${UBOOT_CONFIG}; do + RAM_SIZE="$(echo ${type} | sed -e 's,.*\([0-9]\+GB\),\1,g')" + install -m 0644 ${S}/${SC_FIRMWARE_NAME}-${RAM_SIZE} ${D}/boot/ + done } BOOT_TOOLS = "imx-boot-tools" do_deploy () { install -d ${DEPLOYDIR}/${BOOT_TOOLS} - install -m 0644 ${S}/${SC_FIRMWARE_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/ - cd ${DEPLOYDIR}/${BOOT_TOOLS}/ - rm -f ${symlink_name} - ln -sf ${SC_FIRMWARE_NAME} ${symlink_name} - cd - + for type in ${UBOOT_CONFIG}; do + RAM_SIZE="$(echo ${type} | sed -e 's,.*\([0-9]\+GB\),\1,g')" + install -m 0644 ${S}/${SC_FIRMWARE_NAME}-${RAM_SIZE} ${DEPLOYDIR}/${BOOT_TOOLS}/ + cd ${DEPLOYDIR}/${BOOT_TOOLS}/ + rm -f ${symlink_name}-${RAM_SIZE} + ln -sf ${SC_FIRMWARE_NAME}-${RAM_SIZE} ${symlink_name}-${RAM_SIZE} + cd - + done } addtask deploy after do_install From 302f9208fb98715ca94c8202131c15a038edd6b1 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 10 Oct 2018 12:53:06 +0200 Subject: [PATCH 02/10] imx-boot: change order of mkimage targets Otherwise, the default imx-boot images will include the Cortex M4 demo. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb index f2e4f26c0..b1360f177 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb @@ -89,7 +89,7 @@ IMXBOOT_TARGETS ?= "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi' 'flash_multi_cores flash flash_dcd', d), d)}" IMXBOOT_TARGETS_mx8qxp = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \ bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ - 'flash_all flash', d), d)}" + 'flash flash_all', d), d)}" IMXBOOT_TARGETS_imx8qxpddr3arm2 = "flash_ddr3_dcd_a0" S = "${WORKDIR}/git" From 7f076d951bc927f8553ee0e5b0b7f1af85f76809 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 10 Oct 2018 12:59:44 +0200 Subject: [PATCH 03/10] ccimx8x: modify BOOTLOADER_SEEK value for step B0 of the silicon This breaks support for step A0 of the i.MX8X die. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/machine/include/ccimx8x.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index 7424d1e97..c703df604 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -16,7 +16,7 @@ UBOOT_SYMLINK = "u-boot-${MACHINE}.${UBOOT_SUFFIX}" EXTRA_IMAGEDEPENDS = "imx-boot" IMAGE_BOOTLOADER = "imx-boot" # BOOTLOADER_SEEK is 33 for step A of the silicon and 32 for step B -BOOTLOADER_SEEK = "33" +BOOTLOADER_SEEK = "32" SDIMG_BOOTLOADER = "${DEPLOY_DIR_IMAGE}/imx-boot-${MACHINE}.bin" # Linux kernel configuration From 17b054059d7f6a95e0b7c210035391df25f9fd63 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 16 Oct 2018 18:13:47 +0200 Subject: [PATCH 04/10] imx-boot: add coreutils-native as a dependency for the ccimx8x The "sha384sum" tool included in the coreutils package is needed by mkimage when creating the imx-boot image. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb index b1360f177..00583264b 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb @@ -31,6 +31,7 @@ DEPENDS += " \ ${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'optee-os-imx', '', d)} \ " DEPENDS_append_mx8mq = " dtc-native" +DEPENDS_append_ccimx8x = " coreutils-native" # For i.MX 8, this package aggregates the imx-m4-demos # output. Note that this aggregation replaces the aggregation From 577302650dc9e497f39be3b386dfe5529cc9fcde Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 17 Oct 2018 13:58:32 +0200 Subject: [PATCH 05/10] imx-boot: remove DCD patches These patches were originally introduced in the recipe because the DCD files were needed by mkimage to create the final imx-boot binaries. Now they are in the SCFW source code instead. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- ...-DCD-for-the-2GB-variant-of-the-cc8x.patch | 315 ------------------ .../recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 5 - 2 files changed, 320 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/imx-mkimage/files/0002-cc8x-add-second-DCD-for-the-2GB-variant-of-the-cc8x.patch diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/files/0002-cc8x-add-second-DCD-for-the-2GB-variant-of-the-cc8x.patch b/meta-digi-arm/recipes-bsp/imx-mkimage/files/0002-cc8x-add-second-DCD-for-the-2GB-variant-of-the-cc8x.patch deleted file mode 100644 index da34c8e21..000000000 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/files/0002-cc8x-add-second-DCD-for-the-2GB-variant-of-the-cc8x.patch +++ /dev/null @@ -1,315 +0,0 @@ -From: Gabriel Valcazar -Date: Fri, 27 Jul 2018 12:50:37 +0200 -Subject: [PATCH 2/2] cc8x: add second DCD for the 2GB variant of the cc8x - -This DCD is the same as the one used for the 1GB variant, but with minor timing -and indexing changes. - -Also, suffix each DCD with their corresponding UBOOT_CONFIG values so the -imx-boot recipe is able to handle them. - -https://jira.digi.com/browse/DEL-6085 - -Signed-off-by: Gabriel Valcazar -Signed-off-by: Arturo Buzarra ---- - ...d_1.2GHz.cfg => imx8qx_dcd_1.2GHz.cfg-1GB} | 0 - iMX8QX/imx8qx_dcd_1.2GHz.cfg-2GB | 284 ++++++++++++++++++ - 2 files changed, 284 insertions(+) - rename iMX8QX/{imx8qx_dcd_1.2GHz.cfg => imx8qx_dcd_1.2GHz.cfg-1GB} (100%) - create mode 100644 iMX8QX/imx8qx_dcd_1.2GHz.cfg-2GB - -diff --git a/iMX8QX/imx8qx_dcd_1.2GHz.cfg b/iMX8QX/imx8qx_dcd_1.2GHz.cfg-1GB -similarity index 100% -rename from iMX8QX/imx8qx_dcd_1.2GHz.cfg -rename to iMX8QX/imx8qx_dcd_1.2GHz.cfg-1GB -diff --git a/iMX8QX/imx8qx_dcd_1.2GHz.cfg-2GB b/iMX8QX/imx8qx_dcd_1.2GHz.cfg-2GB -new file mode 100644 -index 0000000..bb37fd5 ---- /dev/null -+++ b/iMX8QX/imx8qx_dcd_1.2GHz.cfg-2GB -@@ -0,0 +1,284 @@ -+#define __ASSEMBLY__ -+ -+#include -+#include -+ -+/* -+ * Device Configuration Data (DCD) -+ * -+ * Each entry must have the format: -+ * Addr-type Address Value -+ * -+ * where: -+ * Addr-type register length (1,2 or 4 bytes) -+ * Address absolute address of the register -+ * value value to be stored in the register -+ */ -+ -+#ifndef SCFW_DCD -+/* For 1200MHz DDR, DRC 600MHz operation */ -+DATA 4 0xff190000 0x00000CC8 /* DRC0 bringup */ -+#else -+/* Set the DRC rate to 600MHz, the PHY PLL will double this for the DRAM rate. */ -+uint32_t rate2 = SC_600MHZ; -+pm_set_clock_rate(SC_PT, SC_R_DRC_0, SC_PM_CLK_MISC0, &rate2); -+#endif -+ -+DATA 4 0x41C80208 0x1 -+DATA 4 0x41C80040 0xb -+DATA 4 0x41C80204 0x1 -+ -+/* DRAM 0 controller configuration begin */ -+DATA 4 DDRC_MSTR_0 0xC1080020 // Set LPDDR4, BL = 16 and active ranks -+DATA 4 DDRC_DERATEEN_0 0x00000203 // derate enable, derate values, byte to read MRR data -+DATA 4 DDRC_DERATEINT_0 0x0124F800 // derate MR4 interval read -+DATA 4 DDRC_RFSHTMG_0 0x004900A8 // tREFI, tRFC -+DATA 4 DDRC_INIT0_0 0x40030495 // pre_cke = 2ms, post_cke = 2us -+DATA 4 DDRC_INIT1_0 0x00770000 // dram_rstn = 200us -+DATA 4 DDRC_INIT3_0 0x00440024 // MR1, MR2 -+DATA 4 DDRC_INIT4_0 0x00F10000 // MR3, MR13 -+DATA 4 DDRC_RANKCTL_0 0x0000066F // diff_rank_wr_gap, diff_rank_rd_gap, max_rank_rd -+DATA 4 DDRC_DRAMTMG0_0 0x1618141A // wr2pr, tFAW, tRASmax, tRASmin -+DATA 4 DDRC_DRAMTMG1_0 0x00050526 // tXP, rd2pre, tRC -+DATA 4 DDRC_DRAMTMG2_0 0x060E1714 // WL, RL, rd2wr, wr2rd -+DATA 4 DDRC_DRAMTMG3_0 0x00909000 // tmrw, tmrd, tmod -+DATA 4 DDRC_DRAMTMG4_0 0x0B04060B // trcd, tccd, trrd, trp -+DATA 4 DDRC_DRAMTMG5_0 0x02030909 // tCKCKEH, tCKCKEL, tckesr, tcke -+DATA 4 DDRC_DRAMTMG6_0 0x02020006 // tckdpde, tckdpdx, tckcsx -+DATA 4 DDRC_DRAMTMG7_0 0x00000301 // tckpde, tckpdx -+DATA 4 DDRC_DRAMTMG12_0 0x00020510 // tCMDCKE, tCKEHCMD -+DATA 4 DDRC_DRAMTMG13_0 0x0B100002 // tODTLoff, tCCDMW, tPPD -+DATA 4 DDRC_DRAMTMG14_0 0x000000AD // txsr -+DATA 4 DDRC_ZQCTL0_0 0x02580012 // tZQCAL, tZQLAT -+DATA 4 DDRC_ZQCTL1_0 0x01E0493E // tZQReset, tzq_short_interval -+DATA 4 DDRC_DFITMG0_0 0x0499820A // dfi_t_ctrl_delay, dfi_t_rddata_en, dfi_tphy_wrdata, dfi_tphy_wrlat -+DATA 4 DDRC_DFITMG1_0 0x00070303 // dfi_t_wrdata_delay, dfi_t_dram_clk_disable, dfi_t_dram_clk_enable -+DATA 4 DDRC_DFITMG2_0 0x00001708 // dfi_tphy_rdcslat, dfi_tphy_wrcslat -+DATA 4 DDRC_DFIMISC_0 0x00000005 // dfi_data_cs_polarity -+DATA 4 DDRC_DFIUPD0_0 0x00400003 // Disable the automatic dfi_ctrlupd_req generation -+DATA 4 DDRC_DFIUPD1_0 0x008000A0 // dfi_ctrlupd_req generation interval generation (min and max) -+DATA 4 DDRC_DFIUPD2_0 0x80000000 // dfi_phyupd_en -+DATA 4 DDRC_ADDRMAP0_0 0x0000001F // addrmap_cs_bit0 -+DATA 4 DDRC_ADDRMAP3_0 0x00000000 // addrmap_col_b9, addrmap_col_b8, addrmap_col_b7, addrmap_col_b6 -+DATA 4 DDRC_ADDRMAP4_0 0x00001F1F // addrmap_col_b10 and addrmap_col_b11 set to de-activated -+DATA 4 DDRC_ADDRMAP1_0 0x00080808 // addrmap_bank_b2, addrmap_bank_b1, addrmap_bank_b0 -+DATA 4 DDRC_ADDRMAP5_0 0x07070707 // addrmap_row_b11, addrmap_row_b10_b2, addrmap_row_b1, addrmap_row_b0 -+DATA 4 DDRC_ADDRMAP6_0 0x07070707 // addrmap_row_b15, addrmap_row_b14, addrmap_row_b13, addrmap_row_b12 -+DATA 4 DDRC_DBICTL_0 0x00000007 // rd_dbi_en=wr_dbi_en=dm_en=1 -+DATA 4 DDRC_ODTMAP_0 0x00002211 // rank[3:0]_wr_odt, rank[3:0]_wr_odt -+DATA 4 DDRC_PCTRL_0_0 0x00000001 // Enable port 0 -+ -+DATA 4 DDRC_DFITMG0_SHADOW_0 0x00808000 -+ -+DATA 4 DDRC_PWRCTL_0 0x0000010D -+ -+DATA 4 0x41c80208 0x1 -+DATA 4 0x41c80040 0xf -+DATA 4 0x41c80204 0x1 -+ -+//------------------------------------------- -+// Configure registers for PHY initialization -+// Timings are computed for 1200MHz DRAM operation -+//-------------------------------------------- -+// Set-up DRAM Configuration Register -+DATA 4 DDR_PHY_DCR_0 0x0000040D // LPDDR4 selection with 8 bank -+// Set-up byte and bit swapping registers -+DATA 4 DDR_PHY_PGCR8_0 0x0001000A -+DATA 4 DDR_PHY_DX0DQMAP0_0 0x00053210 // DQ bit 0/1/2/3/4 remapping -+DATA 4 DDR_PHY_DX0DQMAP1_0 0x00004876 // DQ bit 5/6/7 and DM remapping -+DATA 4 DDR_PHY_DX1DQMAP0_0 0x00053210 // DQ bit 0/1/2/3/4 remapping -+DATA 4 DDR_PHY_DX1DQMAP1_0 0x00004876 // DQ bit 5/6/7 and DM remapping -+DATA 4 DDR_PHY_DX2DQMAP0_0 0x00053210 // DQ bit 0/1/2/3/4 remapping -+DATA 4 DDR_PHY_DX2DQMAP1_0 0x00004876 // DQ bit 5/6/7 and DM remapping -+DATA 4 DDR_PHY_DX3DQMAP0_0 0x00053210 // DQ bit 0/1/2/3/4 remapping -+DATA 4 DDR_PHY_DX3DQMAP1_0 0x00004876 // DQ bit 5/6/7 and DM remapping -+DATA 4 DDR_PHY_CATR0_0 0x00141032 // Only for LPDDR3 but used here to know how LPDDR4 bytes are connected to PHY -+DATA 4 DDR_PHY_CATR1_0 0x0103AAAA // Only for LPDDR3 but used here to know how LPDDR4 bytes are connected to PHY -+// Set-up PHY General Configuration Register -+// PGCR1,4,5,6,7 are untouched -+SET_BIT 4 DDR_PHY_PGCR1_0 0x000A0000 // DISDIC=1 (no uMCTL2 commands can go to memory) and WDQSEXT=1 -+DATA 4 DDR_PHY_PGCR0_0 0x87001E00 // Set ADCP=1 (Address Copy) -+DATA 4 DDR_PHY_PGCR2_0 0x00F0A193 // Set tREFPRD -+DATA 4 DDR_PHY_PGCR3_0 0x050A1080 // CKEN/CKNEN toggling and polarity -+// Set-up PHY Timing Register -+// PTR2 is untouched -+DATA 4 DDR_PHY_PTR0_0 0x4B025810 // tPLLPD, tPLLGS, tPHYRST -+DATA 4 DDR_PHY_PTR1_0 0x3A981518 // tPLLLOCK, tPLLRST -+// Set-up PLL Control Register -+DATA 4 DDR_PHY_PLLCR0_0 0x001C0000 -+DATA 4 DDR_PHY_DX8SLbPLLCR0_0 0x001C0000 -+// Set-up Impedance Control Register -+DATA 4 DDR_PHY_ZQCR_0 0x008A2C58 // Set ODT_MODE=0b10(LPDDR4 stype pullup) -+// ZPROG_DRAM_ODT and ZPROG_HOST_ODT -+DATA 4 DDR_PHY_ZQ0PR0_0 0x1BBBB // Optimal setting based on factory testing -+DATA 4 DDR_PHY_ZQ1PR0_0 0x1B9BB // Optimal setting based on factory testing -+// Set-up PHY Initialization Register -+DATA 4 DDR_PHY_PIR_0 0x32 -+// Launch initialization (set bit 0) -+DATA 4 DDR_PHY_PIR_0 0x33 -+ -+ -+//------------------------------------------- -+// Configure registers for DRAM initialization -+//------------------------------------------- -+// Set-up Mode Register -+// MR0, MR3, MR4, MR5 MR6 are untouched -+DATA 4 DDR_PHY_MR1_0 0x44 // Set BL, WR-PRE, nWR, RPST -+DATA 4 DDR_PHY_MR2_0 0x24 // Set RL/WL -+DATA 4 DDR_PHY_MR3_0 0xF1 // Set drive strength -+ -+DATA 4 DDR_PHY_MR11_0 0x54 // Set CA and DQ ODT -+DATA 4 DDR_PHY_MR22_0 0x15 // Set ODTE-CS=1 (overrides ODT_CA for CS1 as CS not shared between ranks) -+/* LPDDR4 mode register writes for CA and DQ VREF settings */ -+DATA 4 DDR_PHY_MR12_0 0x48 -+DATA 4 DDR_PHY_MR14_0 0x48 -+// Set-up DRAM Timing Parameters Register -+// DTPR6 is untouched -+DATA 4 DDR_PHY_DTPR0_0 0x0C331A09 // tRRD, tRAS, tRP, tRTP -+DATA 4 DDR_PHY_DTPR1_0 0x28300411 // tWLMRD, tFAW, tODTUP, tMRD -+DATA 4 DDR_PHY_DTPR2_0 0x0069615A // tRTW, tRTODT, tCMDCKE, tCKE, tVRCG, tXS -+DATA 4 DDR_PHY_DTPR3_0 0x01800501 // tODX, tCCD, tDLLK, tDQSCKmax, tDQSCK (FIXME double check tDLLK) -+DATA 4 DDR_PHY_DTPR4_0 0x01502B0C // tRFC, tWLO, tXP -+DATA 4 DDR_PHY_DTPR5_0 0x194C160D // tRC, tRCD, tWTR -+// Set-up PHY Timing Register -+DATA 4 DDR_PHY_PTR3_0 0x00249F00 // tDINIT0 -+DATA 4 DDR_PHY_PTR4_0 0x00000960 // tDINIT1 -+DATA 4 DDR_PHY_PTR5_0 0x0003A980 // tDINIT2 -+DATA 4 DDR_PHY_PTR6_0 0x027004B0 // tDINIT4, tDINIT3 -+ -+ -+// Set-up ODT Configuration Register -+// DDR ODT_CA signal is tied at boundary of DDR. Thus no need to drive it dynamically. -+DATA 4 DDR_PHY_RANKIDR_0 0x00000001 // Select rank 1 to write -+DATA 4 DDR_PHY_ODTCR_0 0x00000000 // ODT of rank1 disabled -+DATA 4 DDR_PHY_RANKIDR_0 0x00000000 // Select rank 0 to write -+DATA 4 DDR_PHY_ODTCR_0 0x00000000 // ODT of rank0 disabled -+ -+ -+// Set-up AC I/O Configuration Register -+// ACIOCR1-4 are untouched -+DATA 4 DDR_PHY_ACIOCR0_0 0x30070800 // PNUM2 (i.e.LPDDR4) selection [10:11] = 0x2 -+DATA 4 DDR_PHY_ACIOCR5_0 0x09000000 // I/O mode = LPDDR4 -+// Due to address copy set A[13] (=cke_B[0]) and A[15] (=cke_B[1]) outputs as always ON. -+DATA 4 DDR_PHY_ACIOCR1_0 0x44000000 -+// Set-up VREF Training Control Registers -+DATA 4 DDR_PHY_VTCR0_0 0xF0032008 // CK1, CK0, DRAM VREF set to same as MR12 -+DATA 4 DDR_PHY_VTCR1_0 0x07F0018F // HVIO=1, SHREN=1, SHRNK=0 -+// Set-up DATX8 General Configuration Registers -+// DXnGCR0-4 are untouched -+SET_BIT 4 DDR_PHY_PGCR5_0 0x4 -+DATA 4 DDR_PHY_PGCR6_0 0x00033200 // Enable CSN Bit Delay VT Compensation (AC already enabled by default) + drift limit -+// Set-up DATX8 General Configuration Registers -+DATA 4 DDR_PHY_DX0GCR5_0 0x09092020 // Set DXREFISELR0 and DXREFISELR1 to 0x30, maintain other defaults -+DATA 4 DDR_PHY_DX1GCR5_0 0x09092020 // Set DXREFISELR0 and DXREFISELR1 to 0x30, maintain other defaults -+DATA 4 DDR_PHY_DX2GCR5_0 0x09092020 // Set DXREFISELR0 and DXREFISELR1 to 0x30, maintain other defaults -+DATA 4 DDR_PHY_DX3GCR5_0 0x09092020 // Set DXREFISELR0 and DXREFISELR1 to 0x30, maintain other defaults -+DATA 4 DDR_PHY_DX0GCR4_0 0x0E00BF3C // Set DXREFSSEL,DXREFSSELRANGE,DXREFSEN,DXREFIEN, maintain other defaults -+DATA 4 DDR_PHY_DX1GCR4_0 0x0E00BF3C // Set DXREFSSEL,DXREFSSELRANGE,DXREFSEN,DXREFIEN, maintain other defaults -+DATA 4 DDR_PHY_DX2GCR4_0 0x0E00BF3C // Set DXREFSSEL,DXREFSSELRANGE,DXREFSEN,DXREFIEN, maintain other defaults -+DATA 4 DDR_PHY_DX3GCR4_0 0x0E00BF3C // Set DXREFSSEL,DXREFSSELRANGE,DXREFSEN,DXREFIEN, maintain other defaults -+// Set-up DATX8 DX Control Register 2 -+// PREOEX=2.5tCK (0.5 more than MR1), POSOEX=1tCK (0.5 more than in MR3), LPWAKEUP_THRSH=0xA -+DATA 4 DDR_PHY_DX8SLbDXCTL2_0 0x001C1400 -+// Set-up DATX8 IO Control Register -+DATA 4 DDR_PHY_DX8SLbIOCR_0 0x79000000 // I/O mode = LPDDR4 -+ -+#if DDR_TRAIN_IN_DCD -+// Wait PHY initialization end then launch DRAM initialization -+// Wait for bit 0 of PGSR0 to be '1' -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x7FF40000 // Check that no error occured -+ -+// Launch DRAM 0 initialization (set bit 0) -+DATA 4 DDR_PHY_PIR_0 0x180 -+DATA 4 DDR_PHY_PIR_0 0x181 -+ -+// DRAM 0 initialization end -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x7FF40000 -+ -+// Launch a second time DRAM initialization due to following Synopsys PHY bug: -+// Title: "PUB does not program LPDDR4 DRAM MR22 prior to running DRAM ZQ calibration" -+// Workaround: "Run DRAM Initialization twice" -+DATA 4 DDR_PHY_PIR_0 0x100 -+DATA 4 DDR_PHY_PIR_0 0x101 -+ -+// Wait (second time) DRAM 0 initialization end -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x7FF40000 -+ -+//---------------------------------------------------------------// -+// DATA training -+//---------------------------------------------------------------// -+// configure PHY for data training -+// The following register writes are recommended by SNPS prior to running training -+CLR_BIT 4 DDR_PHY_DQSDR0_0 0x00000001 // Disable drift -+SET_BIT 4 DDR_PHY_PGCR6_0 0x00000001 // Disable VT compensation -+CHECK_BITS_SET 4 DDR_PHY_PGSR1_0 0x40000000 // Disable VT compensation -+SET_BIT 4 DDR_PHY_PGCR1_0 0x00020040 // DISDIC=1; PUBMODE=1 -+// Per SNPS initialize BIST registers for VREF training -+DATA 4 DDR_PHY_BISTAR1_0 0x00010100 //BMRANK=1 (maximum rank minus 1); BIST Address Increment: 0x10 (16) -+DATA 4 DDR_PHY_BISTAR2_0 0x700003FF // BMBANK=8; BMCOL=0x400 (limit to min cols in JEDEC) -+DATA 4 DDR_PHY_BISTAR4_0 0x00003FFF // BMROW=0x4000 (limit to min rows in JEDEC) -+ -+// Set-up Data Training Configuration Register -+// Note that DTCR0.RFSHDT are set to 0x0 as a workaround for PHY bug (Synopsys -+// case 9001045655: Design limitation in LPDDR4 mode: REFRESH must be disabled during DQS2DQ training). -+// (FYI avoiding refresh during training leads to Denali error (CUMULATIVE_REFRESH_POSTPONE_EXCEEDS_MAX_ALLOWED). -+DATA 4 DDR_PHY_DTCR0_0 0x000071C7 // Set DTRPTN to 0x7. RFSHDT=0 -+DATA 4 DDR_PHY_DTCR1_0 0x00010236 // Set RANKEN -+ -+CLR_BIT 4 DDR_PHY_DX4GCR1_0 0xFF // disable byte 4 -+ -+// Launch Write leveling -+DATA 4 DDR_PHY_PIR_0 0x200 -+DATA 4 DDR_PHY_PIR_0 0x201 -+// Wait Write leveling to complete -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x00200000 -+ -+// Set DQS/DQSn glitch suppression resistor for training PHY0 -+DATA 4 DDR_PHY_DX8SLbDQSCTL_0 0x012640F7 -+// Launch Read DQS training -+DATA 4 DDR_PHY_PIR_0 0x400 -+DATA 4 DDR_PHY_PIR_0 0x401 -+// Wait Read DQS training to complete PHY0 -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x00400000 -+// Remove DQS/DQSn glitch suppression resistor PHY0 -+DATA 4 DDR_PHY_DX8SLbDQSCTL_0 0x01264000 -+ -+// DQS2DQ training, Write leveling, Deskew and eye trainings -+DATA 4 DDR_PHY_PIR_0 0x0010F800 -+DATA 4 DDR_PHY_PIR_0 0x0010F801 -+// Wait for training to complete -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x7FF40000 -+ -+// Launch VREF training -+DATA 4 DDR_PHY_PIR_0 0x00020000 -+DATA 4 DDR_PHY_PIR_0 0x00020001 -+// Wait for training to complete -+CHECK_BITS_SET 4 DDR_PHY_PGSR0_0 0x1 -+CHECK_BITS_CLR 4 DDR_PHY_PGSR0_0 0x00080000 -+ -+//Re-allow uMCTL2 to send commands to DDR -+CLR_BIT 4 DDR_PHY_PGCR1_0 0x00020040 // DISDIC=0, PUBMODE=0 -+ -+//DQS Drift Registers PHY0 -+CLR_BIT 4 DDR_PHY_DX0GCR3_0 0x08000000 -+CLR_BIT 4 DDR_PHY_DX1GCR3_0 0x08000000 -+CLR_BIT 4 DDR_PHY_DX2GCR3_0 0x08000000 -+CLR_BIT 4 DDR_PHY_DX3GCR3_0 0x08000000 -+// Enable DQS drift detection PHY0 -+DATA 4 DDR_PHY_DQSDR0_0 0x20188005 -+DATA 4 DDR_PHY_DQSDR1_0 0xA8AA0000 -+DATA 4 DDR_PHY_DQSDR2_0 0x00070200 -+ -+// Enable VT compensation -+CLR_BIT 4 DDR_PHY_PGCR6_0 0x1 -+ -+//Check that controller is ready to operate -+CHECK_BITS_SET 4 DDRC_STAT_0 0x1 -+ -+#endif diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb index 00583264b..4cf46a252 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb @@ -9,11 +9,6 @@ require imx-mkimage_git.inc inherit deploy -SRC_URI_append = " \ - file://0001-cc8x-configure-DDRC-for-Micron-MT53B256M32D1.patch \ - file://0002-cc8x-add-second-DCD-for-the-2GB-variant-of-the-cc8x.patch \ -" - # Add CFLAGS with native INCDIR & LIBDIR for imx-mkimage build CFLAGS = "-O2 -Wall -std=c99 -static -I ${STAGING_INCDIR_NATIVE} -L ${STAGING_LIBDIR_NATIVE}" From 352dc3dd38f9c2bf79cf9238b8dd506748f586c9 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Mon, 22 Oct 2018 13:49:00 +0200 Subject: [PATCH 06/10] ccimx8x: add VPU encoder and decoder firmware https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- meta-digi-arm/conf/machine/include/ccimx8x.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index c703df604..ae72c1115 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -26,7 +26,7 @@ KERNEL_DEFCONFIG ?= "arch/arm64/configs/ccimx8x_defconfig" WIRELESS_MODULE ?= "" # Firmware -MACHINE_FIRMWARE ?= "" +MACHINE_FIRMWARE ?= "firmware-imx-vpu-imx8qxp" MACHINE_EXTRA_RDEPENDS += " \ e2fsprogs-mke2fs \ From 6f700ff19bfb811ae5067513fd24d76fab295ab3 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 7 Nov 2018 13:40:31 +0100 Subject: [PATCH 07/10] imx-sc-firmware: update checksums https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- .../recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb b/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb index d2d78432c..dd95dc427 100644 --- a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb +++ b/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb @@ -11,8 +11,8 @@ inherit pkgconfig deploy SRC_URI = "${DIGI_PKG_SRC}/${PN}-${PV}.tar.gz" -SRC_URI[md5sum] = "2b403986a9a0e47528baa3138015ce02" -SRC_URI[sha256sum] = "dbdffdd9b0d527218a1bf90aad2ef8dcee1b4c5170e5a983ae6f5e54b062cddc" +SRC_URI[md5sum] = "f6a71c00362b8ece938b5dc67bedadb1" +SRC_URI[sha256sum] = "7b7ebbc903c4bf580547d36dfd8bb16ddb816c47fe755a379ffbc4fd35a9b2c3" S = "${WORKDIR}/${PN}-${PV}" From 49f1c40f6a917f22b68f2283b4d50354662f2364 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 7 Nov 2018 14:01:05 +0100 Subject: [PATCH 08/10] imx-sc-firmware: rename to digi-sc-firmware This reflects the fact that the firmware is customized for Digi platforms. The versioning still follows the one used by NXP in their recipe. https://jira.digi.com/browse/DEL-6158 Signed-off-by: Gabriel Valcazar --- .../digi-sc-firmware_0.7.bb} | 2 +- meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename meta-digi-arm/recipes-bsp/{imx-sc-firmware/imx-sc-firmware_0.7.bb => digi-sc-firmware/digi-sc-firmware_0.7.bb} (94%) diff --git a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb similarity index 94% rename from meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb rename to meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb index dd95dc427..fba103f0c 100644 --- a/meta-digi-arm/recipes-bsp/imx-sc-firmware/imx-sc-firmware_0.7.bb +++ b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb @@ -2,7 +2,7 @@ # Copyright 2017-2018 NXP # Copyright (C) 2018 Digi International. -DESCRIPTION = "i.MX System Controller Firmware" +DESCRIPTION = "i.MX System Controller Firmware, customized for Digi platforms" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=ab61cab9599935bfe9f700405ef00f28" SECTION = "BSP" diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb index 4cf46a252..59d07ef76 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_0.2.bb @@ -18,7 +18,7 @@ PROVIDES = "${BOOT_NAME}" IMX_FIRMWARE = "imx-sc-firmware" IMX_FIRMWARE_mx8mq = "firmware-imx" -IMX_FIRMWARE_mx8qxp = "firmware-imx imx-sc-firmware" +IMX_FIRMWARE_mx8qxp = "firmware-imx digi-sc-firmware" DEPENDS += " \ u-boot \ ${IMX_FIRMWARE} \ From fa5004dafb7455130b4508ebbbe1cf9852745037 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Tue, 20 Nov 2018 17:42:52 +0100 Subject: [PATCH 09/10] Revert "ccimx8x: bluetooth-init: set 115200bps for SOMv1" SOM v1 is not going to be released, so there's no need for a revision check. Now that hw flow control is available, use it along with the highest baudrate possible. This reverts commit e4fbba3dde020f05985134c7c5155d4b45eeafdd. https://jira.digi.com/browse/DEL-6254 --- .../bluez/bluez5-5.46/ccimx8x/bluetooth-init | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx8x/bluetooth-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx8x/bluetooth-init index 7dfeccd1b..0a6a70cc4 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx8x/bluetooth-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.46/ccimx8x/bluetooth-init @@ -46,21 +46,6 @@ bluetooth_init() { BT_MACADDR="00:04:F3:FF:FF:BB" fi - # Module version older than revision 2 has swapped CTS and RTS lines - MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null | tr -d '\0' || true)))" - if [ "${MOD_VERSION}" -lt "2" ]; then - # Reduce the rate to avoid the need for HW flow control - BT_RATE="115200" - BT_RATE_CODE="00" # 115200 bps - BT_FLOW="noflow" - - # Modify the baudrate in the firmware file - BT_FW_FILE="/lib/firmware/qca/nvm_tlv_3.2.bin" - if [ "$(hexdump -s 56 -n 1 -ve '1/1 "%.2x"' ${BT_FW_FILE})" != "${BT_RATE_CODE}" ]; then - printf "\x${BT_RATE_CODE}" | dd of="${BT_FW_FILE}" bs=1 seek=56 count=1 conv=notrunc,fsync 2>/dev/null - fi - fi - # Start the Bluetooth driver and bring up the interface HCIATTACH_LOG="/var/log/hciattach.log" From f0adfce98de17894224a54f5190eb2e569d88833 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 21 Nov 2018 16:30:46 +0100 Subject: [PATCH 10/10] digi-sc-firmware: update checksums for the newer 0.7 version of the firmware Signed-off-by: Gabriel Valcazar --- .../recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb index fba103f0c..d7b367b45 100644 --- a/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb +++ b/meta-digi-arm/recipes-bsp/digi-sc-firmware/digi-sc-firmware_0.7.bb @@ -11,8 +11,8 @@ inherit pkgconfig deploy SRC_URI = "${DIGI_PKG_SRC}/${PN}-${PV}.tar.gz" -SRC_URI[md5sum] = "f6a71c00362b8ece938b5dc67bedadb1" -SRC_URI[sha256sum] = "7b7ebbc903c4bf580547d36dfd8bb16ddb816c47fe755a379ffbc4fd35a9b2c3" +SRC_URI[md5sum] = "1f8e370c9f25e6b03acc403c8487c7bd" +SRC_URI[sha256sum] = "67ea4ffed833c235b71dec592dc71659260da36eefa2958b8d51f200b50f3914" S = "${WORKDIR}/${PN}-${PV}"