From patchwork Wed May 27 05:07:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Stephane Viau (OSS)" X-Patchwork-Id: 1298614 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-NXP1-onmicrosoft-com header.b=kKityhtJ; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49WzQ91HFJz9sRW for ; Wed, 27 May 2020 15:09:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ACB718856F; Wed, 27 May 2020 05:08:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ndBpJXwtPQix; Wed, 27 May 2020 05:08:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8B84F8852D; Wed, 27 May 2020 05:08:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 363E41BF86C for ; Wed, 27 May 2020 05:08:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 32B75877E8 for ; Wed, 27 May 2020 05:08:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gwjWZhqCG-zn for ; Wed, 27 May 2020 05:08:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70059.outbound.protection.outlook.com [40.107.7.59]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2903D81F17 for ; Wed, 27 May 2020 05:08:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CeJ58hAwJt2WDFjxgiITozcosCKzF7SPPfVpsORYQNSiQL0g8gY7xVVjIHj31J3NdlzxfkIP/dqVJAxJ/24xBhx9FjRocd579NHE/uODNMNptNI577MnfBm6l0obvOwUlSXKGJf1nSb3rt27CqdZUS/yjS+7z8kr9kIJcPoVstngeDLKb8yBhX9jWnVoAyhJuo8tib5oI/KXN9WGiJ2qV2IyddqS6QN02SMHGZEHBGBe4aPDWkJ2o6XVJGLrbQrMJ3C2pgcRy16oNWg7N28GucuyPJYRVBpiZbj11QPG/UPdEiHJWSDNa1zgxdg4k1Ss8egmZ8SyWo+15e5n7mpIXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIZBrM8OpLPcRO7m+bRbXYn0dUqRl5vmeLwe7AWRAHg=; b=mL44OsvxZKYNXUh18WaT1F0Y8KXRDTt9L0hjY6HpPCkNZalGMlFwjBcXJKtry4gH5OAaDO1yTDDLa73ekQWnshaXhHwmgzk/Wj3ZA2mwlMljbx4HMJT4FrC1yaZ3PeI2fovZjiEJI6xYKtnyHcBGdfoitDMSQvHxKUv80Tg32bZqa88zOna9A+vkZ/VJEtZrvKP7SA1XAfw4PdgCw7r7eV2i/5Xx7EsJz/cR7WhamVUnFs6CHrF8wm8Tgu34XwfaaqwvRg+V3l9M6IXh8SabTNADxiB9csT49+5V88QY/2n245uTWxrwWAb0Vq1qp/F1NYm+nGYtroKgZJEK6+KxPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIZBrM8OpLPcRO7m+bRbXYn0dUqRl5vmeLwe7AWRAHg=; b=kKityhtJ0ILv6C+ZBAERN/w5jsuAue111sydcOUYsLfi6VNBvZaIhUn6CmA2zXpy1e3aKwEjTBhR0fTtRN5Uj5Yb2bRyEzXUVCxOy7j7cE3g8WkwRR/FzBkUOmK/PZGx9xntbXCrdLT3TSy0DuGTpanGXeS5uquPM2ZMA0ZKidk= Authentication-Results: buildroot.org; dkim=none (message not signed) header.d=none;buildroot.org; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB4786.eurprd04.prod.outlook.com (2603:10a6:208:cf::25) by AM0PR04MB5412.eurprd04.prod.outlook.com (2603:10a6:208:10f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Wed, 27 May 2020 05:08:42 +0000 Received: from AM0PR04MB4786.eurprd04.prod.outlook.com ([fe80::715c:fa5c:5b68:5e2c]) by AM0PR04MB4786.eurprd04.prod.outlook.com ([fe80::715c:fa5c:5b68:5e2c%4]) with mapi id 15.20.3021.029; Wed, 27 May 2020 05:08:42 +0000 From: Stephane Viau To: buildroot@buildroot.org Date: Wed, 27 May 2020 07:07:45 +0200 Message-Id: <1590556068-7043-3-git-send-email-stephane.viau@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590556068-7043-1-git-send-email-stephane.viau@oss.nxp.com> References: <1590556068-7043-1-git-send-email-stephane.viau@oss.nxp.com> X-ClientProxiedBy: PR0P264CA0199.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::19) To AM0PR04MB4786.eurprd04.prod.outlook.com (2603:10a6:208:cf::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a01:e0a:43f:82f0:e5ce:dba0:335b:3910) by PR0P264CA0199.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3045.17 via Frontend Transport; Wed, 27 May 2020 05:08:41 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [2a01:e0a:43f:82f0:e5ce:dba0:335b:3910] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d0bba767-4b9e-4f02-041e-08d801fc064f X-MS-TrafficTypeDiagnostic: AM0PR04MB5412: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 04163EF38A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Q0ruFbc5YH389HjUttzaBLTH2kb+rMKO0gSGY88BUGw/U6C3FtD6RgFc0lRHL7rQ0Comc7fdSWtHDrct++j4CNRSx+4c6DjoYa8ZvRhfbDbE8HjLDdFiYw6/ixQwFrF3+wvz8hVi/JW4TwFPhrGDSqC/ltRXSojYT0qQFbi+ru+Nyp3LsaHG71D0wMLSe+1GGzpYoa2cw5aOnUkaI3VUjEQLU1+j6pXz5i71kRkGr6EVtvFuYA4DXih6omQQ2STCwKVg9RYttMLoC3g2vfXfuYlfUMgrCY8F8XYkAFdyCAymRtImt/J9Zll9QFoItCYJxN4KXUJcVNXaQUCBmbnWlh0aqEgbgCN5GZ1UI0hPDmMWEFXzeKnCKx3+NYaSc4/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4786.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(6486002)(54906003)(52116002)(6506007)(478600001)(316002)(6916009)(2906002)(44832011)(4326008)(8676002)(2616005)(8936002)(5660300002)(69590400007)(66476007)(66556008)(66946007)(6512007)(83380400001)(186003)(16526019)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /8uce4UivYSkCFQjcmtEy+YX0MMdnKCdeEFwMVAo1Bhr+apE4TBRiop5pAgoZe+SqbRigE5ojASSWk2NWVksmWu77udM+YD1KC5TZmZ7+3KMqHSjmzX+8YCysj9QQuIbhCgDeCJDYQJQo8gDRKLBzcpDpAhJEANd6ztaZSZ9Pq9an12ZEyM6T1PfN2AntuM4XKvBweqIvJeyCd5cRMKkqWVrJhrLdNCN8uRtpVI6KLCYzPucDaPI/WNXfagKUHgpibXR8OJmtr/2ovT5aIiFl8AIax8BkKWWz95KZ8eFArJxIkJWEdye6c923vqvBS8OZt1JLv1FeWzvy2uMeGTo/FvlQ1mpM/IzDklFMETDuqpHJb+B52jmE6LzQ1sw1MfiC2Su1QHizDaSKcaBO+vPSCGJb/AY/SdkCznclo07/OooI8nkXllwDkfWc3Qn3fybi75odRgZnBP36nCBkBXyrhxhUTzRJSUTHmi2d47dCl8Vux6yZAjgqjW8h4rvh7J06MdsCgQ+Ha6w42vvuAMQLkb/MxCTzXTqIodFAmqHDllX/qGp7IqTQ9Z/g8CRfbtG X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0bba767-4b9e-4f02-041e-08d801fc064f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2020 05:08:42.4731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JsSh5+PyQSFEfRnU+ZhHJjtND7jh7UyOj1KvyOl5OH9FCM2bc6bmLdy3+dT4Wbjna0Xh5Pu7UnwMrVtmK/FOSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5412 Subject: [Buildroot] [PATCH v4 2/5] package/freescale-imx/firmware-imx: add choice for DDR training binaries X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gary Bisson , Maeva Manuel , Gilles Talis , Refik Tuzakli , Julien Olivain , Stephane Viau , Fabio Estevam Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Several i.MX8 (e.g.: 8M, 8MM, 8MN) support many DDR types (LPDDR4, DDR4, etc.), for which the DDR training is performed in the bootloader. Some boards have LPDDR4 (e.g.: nitrogen8mn) and some others have the DDR4 (e.g.: NXP's reference board EVK). This patch allows the selection of either of the binaries used to train the DDR. Note that DDR and HDMI FW copies are now separated, which makes latter being properly copied only for the relevant SoC (i.MX8MQ). Suggested-by: Gary Bisson Signed-off-by: Stephane Viau Reviewed-by: Maeva Manuel Reviewed-by: Julien Olivain Reviewed-by: Gary Bisson --- v4: - Keep the 'if IMX8M...' around the whole block (Gary) - Remove FIRMWARE_IMX_PREPARE_HDMI_FW empty definition (Gary) v3: - Use common FIRMWARE_IMX_INSTALL_IMAGES_CMDS for all i.MX8M platforms and let FIRMWARE_IMX_PREPARE_{DDR,HDMI}_FW be different according to the type of DDR mounted (BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW choice) or the eventual presence of HDMI, which is SoC dependant. (Gary) v2: - use BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW to extend the DDR firmware selection for 8M, 8MM and 8MN (suggested by Gary) fixup! package/freescale-imx/firmware-imx: add choice for DDR training binaries Signed-off-by: Stephane Viau --- package/freescale-imx/firmware-imx/Config.in | 24 ++++++++++++ package/freescale-imx/firmware-imx/firmware-imx.mk | 43 +++++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in index 56d5b80..4962992 100644 --- a/package/freescale-imx/firmware-imx/Config.in +++ b/package/freescale-imx/firmware-imx/Config.in @@ -8,3 +8,27 @@ config BR2_PACKAGE_FIRMWARE_IMX This library is provided by Freescale as-is and doesn't have an upstream. + +if BR2_PACKAGE_FREESCALE_IMX_NEED_DDR_FW + +choice + bool "DDR training binaries" + default BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4 + help + Choose the DDR training binaries to be used depending on the + kind of memory that is available on the target board (DDR4, + LPDDR4, etc...). + +config BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4 + bool "lpddr4" + help + Use LPDDR4 binaries (i.e.: lpddr4_pmu_train_*.bin) + +config BR2_PACKAGE_FIRMWARE_DDRFW_DDR4 + bool "DDR4" + help + Use DDR4 binaries (i.e.: ddr4_*_201810.bin). + +endchoice # DDR training FW + +endif diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk index cd0dafb..32f1bb1 100644 --- a/package/freescale-imx/firmware-imx/firmware-imx.mk +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk @@ -19,7 +19,8 @@ define FIRMWARE_IMX_EXTRACT_CMDS endef ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM)$(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN),y) -FIRMWARE_IMX_INSTALL_IMAGES = YES + +ifeq ($(BR2_PACKAGE_FIRMWARE_DDRFW_LPDDR4),y) FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys define FIRMWARE_IMX_PREPARE_LPDDR4_FW $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \ @@ -33,7 +34,7 @@ define FIRMWARE_IMX_PREPARE_LPDDR4_FW $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_$(1)_fw.bin endef -define FIRMWARE_IMX_INSTALL_IMAGES_CMDS +define FIRMWARE_IMX_PREPARE_DDR_FW # Create padded versions of lpddr4_pmu_* and generate lpddr4_pmu_train_fw.bin. # lpddr4_pmu_train_fw.bin is needed when generating imx8-boot-sd.bin # which is done in post-image script. @@ -42,9 +43,47 @@ define FIRMWARE_IMX_INSTALL_IMAGES_CMDS cat $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_1d_fw.bin \ $(FIRMWARE_IMX_DDRFW_DIR)/lpddr4_pmu_train_2d_fw.bin > \ $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin + ln -sf $(BINARIES_DIR)/lpddr4_pmu_train_fw.bin $(BINARIES_DIR)/ddr_fw.bin +endef +else ifeq ($(BR2_PACKAGE_FIRMWARE_DDRFW_DDR4),y) +FIRMWARE_IMX_DDRFW_DIR = $(@D)/firmware/ddr/synopsys +define FIRMWARE_IMX_PREPARE_DDR4_FW + $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_imem_$(1)_201810.bin \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_imem_$(1)_201810_pad.bin + $(TARGET_OBJCOPY) -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_dmem_$(1)_201810.bin \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_dmem_$(1)_201810_pad.bin + cat $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_imem_$(1)_201810_pad.bin \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_dmem_$(1)_201810_pad.bin > \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_$(1)_201810_fw.bin +endef + +define FIRMWARE_IMX_PREPARE_DDR_FW + # Create padded versions of ddr4_* and generate ddr4_fw.bin. + # ddr4_fw.bin is needed when generating imx8-boot-sd.bin + # which is done in post-image script. + $(call FIRMWARE_IMX_PREPARE_DDR4_FW,1d) + $(call FIRMWARE_IMX_PREPARE_DDR4_FW,2d) + cat $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_1d_201810_fw.bin \ + $(FIRMWARE_IMX_DDRFW_DIR)/ddr4_2d_201810_fw.bin > \ + $(BINARIES_DIR)/ddr4_201810_fw.bin + ln -sf $(BINARIES_DIR)/ddr4_201810_fw.bin $(BINARIES_DIR)/ddr_fw.bin +endef +endif + +ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y) +define FIRMWARE_IMX_PREPARE_HDMI_FW cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin \ $(BINARIES_DIR)/signed_hdmi_imx8m.bin endef +endif + +FIRMWARE_IMX_INSTALL_IMAGES = YES +define FIRMWARE_IMX_INSTALL_IMAGES_CMDS + $(FIRMWARE_IMX_PREPARE_DDR_FW) + $(FIRMWARE_IMX_PREPARE_HDMI_FW) +endef else ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8X),y) define FIRMWARE_IMX_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0644 $(@D)/firmware/vpu/vpu_fw_imx8_dec.bin \