From patchwork Mon May 25 16:02:07 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: 1297417 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.136; helo=silver.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=ZmrlW+oe; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49W21C2bGxz9sSd for ; Tue, 26 May 2020 02:02:39 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B1BB720492; Mon, 25 May 2020 16:02:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4Aoj-ev1ezuK; Mon, 25 May 2020 16:02:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7E8AD226A9; Mon, 25 May 2020 16:02:25 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C81E61BF378 for ; Mon, 25 May 2020 16:02:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C323487E6E for ; Mon, 25 May 2020 16:02:21 +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 5vOgu4pPs1KN for ; Mon, 25 May 2020 16:02:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5AF4F87C76 for ; Mon, 25 May 2020 16:02:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iV+XOTNpf5QVJBoQGm7eNojAsgRmLRNr2eC7vp8uxHJTihhcllA2n6/WjT2xh/3l75PFvIbMcBs5iPqb3DVWwM1NFo19+bgN5YWC6kXpdw0re2Ffs5wWkky6f9j+GwLwut0IVzc0CkMSIGS71jH923Z5vU4mVBL/XAdJW0Tr9Y36PY9tcDvv9PQC+pOdPKQHn9jXiOH96MzMRSY+uNCWG0ItYQYIYw4ETD6c4TLf+enDI0atrgA+PSksysZzY5f+a72YXN9s5KLdDTFzJpeaGm/5GmvpdFVI2LvRNS8f3xKCV3jUAsJB8K7xnRxixOhhpsIOQs+8wGjShUub3KKN6w== 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=ihKNMyl6O7ZDUosz8uQdUIMBnyNoktnnxA9SOZfBCIY=; b=Wzfun1cvZ8qJ4qNrKxpDgcpjIgEaaU0Y8CYoEyHnnT8NQEMlWU6YDLxkz1PHQI5U2MHNPsht2JHntK8skpOfSRYlcBrtNDwEA6VuI5sQ96xFzJezaiTWKs3POhiA3oCaOFfuXK7CMXscY3EkF9l/0hLm7GWMQJOAOMSJeMLzKQmzNGlNGMkjQN43SQpsdJkRYnes4B3byIaK8KEumEnX2D2ECY3SOFfmjDNAREk7OCjHYfLkLZwMP7phdmyZwyru3w4ehCUFqeSiwYoskVMqDmrNqqvxvfdaRjg75JOutMjYqRWnoRCN+1TeG9Ng3uHhlzIcFZ3iu7JFnqm1Wa5+8Q== 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=ihKNMyl6O7ZDUosz8uQdUIMBnyNoktnnxA9SOZfBCIY=; b=ZmrlW+oeAs/Yc4wey8R318F68EYHMo+4sacoo5jX833m4/UK/x5wuRzHQBPuAmO0nl4Oa7rkSMOyAWaMNr1q3c5GMjfPAuZcjP3maXBlP5L0Es9x6N7OKEmnR0NpuBKYr6U/uFrhZKb3E7brfFiHnysqx1Vd0apTwnp6yhVLaZo= 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 AM0PR04MB5908.eurprd04.prod.outlook.com (2603:10a6:208:134::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.27; Mon, 25 May 2020 16:02:18 +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; Mon, 25 May 2020 16:02:18 +0000 From: Stephane Viau To: buildroot@buildroot.org Date: Mon, 25 May 2020 18:02:07 +0200 Message-Id: <1590422530-4788-3-git-send-email-stephane.viau@oss.nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590422530-4788-1-git-send-email-stephane.viau@oss.nxp.com> References: <1590422530-4788-1-git-send-email-stephane.viau@oss.nxp.com> X-ClientProxiedBy: AM0PR03CA0056.eurprd03.prod.outlook.com (2603:10a6:208::33) 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 AM0PR03CA0056.eurprd03.prod.outlook.com (2603:10a6:208::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Mon, 25 May 2020 16:02:17 +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: 49f6f635-f20a-4956-aa85-08d800c4ffad X-MS-TrafficTypeDiagnostic: AM0PR04MB5908: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0414DF926F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3+zNEbNG4FkvSJcqJ2Okpleesy8ZZ2KVWVx7qeRWS5c3Moki8F7mfRZs2hkVDaEElvWAJIfgsrNEK7VsWrLEP/SUJZ1zMsPGUGeEblZ1pk6Lsnm7S4NQQnqmF7rWZ957dyWVeZQwOs2kiaF8Pa+kOh1soYXf5ahcWB1SjbOuvxu5fGyLWMq/NzzxlrnVZ9WQVNh5xR7fU3yJVqyoylJTTH26rx7ixiUMuSGiQISVso4Rg5sZlwmXChMI9PsHWPsvUwPfl0aFGexrzZe7gr/Gs8fLCqth0UGKNP+/A7THLXbYq9sQAOUVBYO557+fAPja8SOtWeIY+OpNUWdONOkBAyeefcXgM2e/fdqRxTBgrFW//bzHceRxXewLy+HhD+e6 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)(366004)(376002)(136003)(396003)(346002)(39860400002)(478600001)(2616005)(2906002)(54906003)(66476007)(69590400007)(66556008)(86362001)(4326008)(6506007)(8936002)(44832011)(66946007)(186003)(6512007)(6916009)(16526019)(316002)(6666004)(52116002)(5660300002)(6486002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: p9hv4YmfabsDGVtEMWVpfPNgx3v8D8okxSOTZWzLNFJym1ZGnmRFrG7DfZsv/SeHL1K6S8yMHl4o40tDhZXTfotjDKMRo3zkbsiEMXqxwT+fVWXt80XVuP13gJelQJZPINhrV3hmafBS5M6664X3FtR81hmuoO5RLF3q16lvj/NB3TtqX4AJEQS7Zeu7w5YgY+1ex07WU/p9GYDbBr8fR+N0UHXaKGT4juLW5FwfP4YJLojVVadvxrg0Ui4AdaEax+kCA8SUQPmdYNhSS0o85lcpYuskPOh0PAabWXw400QGAZV78rf0h0UEhDAU4daUFiRRhZNVUMhFy74MI63gS+4t+Xp/YG3x+7A5Y0QwLmotQIeOB11FMZJ3YiQY72Bp/ffWys2noo+W+qCKb1cMfOpiSooEpGVes5sG4wNkWeI9rA83UzywSuVaRjSmIfzzNKDS1ZK8/PQN2gcSkIL/CzZQUiBONWK09yhTLsqVXb5jo9uI8YMJm/+chHKCxU7UlDq7QcmQGB66BrdtUl8Zd4PmD+seAdYffyL2Ux1+puU= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49f6f635-f20a-4956-aa85-08d800c4ffad X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2020 16:02:18.0704 (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: eYXCxNSFbJf2Jzmy9mBgHqC/GA2EKq9ZO1475TgWXCsH8JymTbChEwHTYDSVyu5cr9Nro++VdCTqXEbJCy2x7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5908 Subject: [Buildroot] [PATCH v3 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. Signed-off-by: Stephane Viau Reviewed-by: Maeva Manuel Reviewed-by: Julien Olivain --- 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) Signed-off-by: Stephane Viau --- package/freescale-imx/firmware-imx/Config.in | 24 +++++++++++ package/freescale-imx/firmware-imx/firmware-imx.mk | 47 ++++++++++++++++++++-- 2 files changed, 68 insertions(+), 3 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..bd87baa 100644 --- a/package/freescale-imx/firmware-imx/firmware-imx.mk +++ b/package/freescale-imx/firmware-imx/firmware-imx.mk @@ -18,8 +18,7 @@ define FIRMWARE_IMX_EXTRACT_CMDS $(call FREESCALE_IMX_EXTRACT_HELPER,$(FIRMWARE_IMX_DL_DIR)/$(FIRMWARE_IMX_SOURCE)) 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 +32,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 +41,51 @@ 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 +else +define FIRMWARE_IMX_PREPARE_HDMI_FW +endef +endif + +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 +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 \