From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38739C07E95 for ; Tue, 13 Jul 2021 10:11:46 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66C6F6120A for ; Tue, 13 Jul 2021 10:11:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66C6F6120A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9B6BB83169; Tue, 13 Jul 2021 12:11:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="CgTr65JE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 68CB583169; Tue, 13 Jul 2021 12:11:41 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20630.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::630]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D894B83163 for ; Tue, 13 Jul 2021 12:11:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michals@xilinx.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K+jtGRz75RlUQ1TiZcwyHcrjoTJqoAur9M9BmIl1KQFMRQ2VKeEA4+KB+PgsmumgWjofmAM1mOX4klx/NvGl/CUiy9PLNAeEWsRxZrFzanM3WhU9lg8/NMjuJOjEZPVUqB8dniq0z6J/q61qnkUXb16UrfMJNYfWcT2ik9HVMXlc08uMVpD3z23BmcvWIuA8sgE1kKPI4k4EUkaXtc8/umpEOpjjLYnP4823PcsA3LESeE+9HNVM6SzhWa99puaF5oW1E+TdZ2iJ+37yMJi/eVthMdR2o8XuC0frJQbRVQk4+I+Kj3Ge41Up2H/Sp/LzjFxIWhUtFEKjYEOuFKG1Aw== 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=ygs+vYF/eYXMTGmY/WOiH1ekIc5f8trCPXUGuJUi03I=; b=nAIx0UE7kC2Hv+u6o9EVNSUG554d2H/7Y98iAa0LZW0cGgKB7CmyZlzFcFBppP6+4PnDuUMRJB2JoiBtx6pxvJ8FyyMNDy4wV9Be/jHW+3RdprMSPhskk4Aocss0WaoCtgwqhPaMSiE3kUcLJNkT3x8t1OAqJB9OvpuYRbZSLNTHOpf5caeSmHiCRkBSYyWdyvLonXeI8jKzIiDRMO6mIbN5p6uY6HNxiYxJ4/h+0MXmiJTuZsrv8Hy2VD0V7e6SVwEtdkbtQxL9F2VQ/NJBk0lrrptMwTvt9K2nfKLcruD9YMxki7Wf8qRfdvRDDsVfJZ+PIaLMUxEp24ENUPpKyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=foundries.io smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ygs+vYF/eYXMTGmY/WOiH1ekIc5f8trCPXUGuJUi03I=; b=CgTr65JEWxGJI8kxeH7/D6/HUUSgv608Tpnof/fYAF2tCKR8CocwQ1vvG6hJtY4Gwv4CwL/r1SIZAfJSJ3GRRCS8Rh/2yCSPjGDBgepv/7WRig41qb7gFyBI2Vx+2jXoq+8L2V94kj5Ac625RtbWXYAxgub+fzanfPS0tfKlPEQ= Received: from DM6PR03CA0001.namprd03.prod.outlook.com (2603:10b6:5:40::14) by SJ0PR02MB7279.namprd02.prod.outlook.com (2603:10b6:a03:2a1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Tue, 13 Jul 2021 10:11:32 +0000 Received: from DM3NAM02FT021.eop-nam02.prod.protection.outlook.com (2603:10b6:5:40:cafe::b7) by DM6PR03CA0001.outlook.office365.com (2603:10b6:5:40::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 10:11:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; foundries.io; dkim=none (message not signed) header.d=none;foundries.io; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT021.mail.protection.outlook.com (10.13.4.249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4308.20 via Frontend Transport; Tue, 13 Jul 2021 10:11:32 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 13 Jul 2021 03:11:31 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Tue, 13 Jul 2021 03:11:31 -0700 Envelope-to: ricardo@foundries.io, u-boot@lists.denx.de, jorge@foundries.io Received: from [172.30.17.109] (port=59676) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1m3FNz-0004CE-7Z; Tue, 13 Jul 2021 03:11:31 -0700 Subject: Re: zynqmpbif - sample To: "Jorge Ramirez-Ortiz, Foundries" CC: Michal Simek , , References: <20210712174043.GA18753@trex> <20210713073229.GA9771@trex> <20210713092528.GA25779@trex> From: Michal Simek Message-ID: <68f42006-bdbe-bfef-5499-3a51e45c4030@xilinx.com> Date: Tue, 13 Jul 2021 12:11:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210713092528.GA25779@trex> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6c66667-35e0-48eb-3b9b-08d945e6969c X-MS-TrafficTypeDiagnostic: SJ0PR02MB7279: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V1BEaXih1HDceA0wF22jmR6vAUQx7SHeiVhSeFwjpaHjEOpESEZVztyddzsj0WBQQ92za97lHQRrCWWO5pXRSKoV0dU0OyqMISYIDLalb80hnDqLc98gHZbqjvXhOQ1WS+b68Lx6iXJpx/3vBT4CbGA52uxwczIRgs3kRcpM+AYizm1x2Y4B8QfczKJIY8QjnyTEwTKMiG8DcEhwVA6vrz2dsZMySnnmH3dRxSSZoxRD4oJwDyBsQ7DY0eBTMm495Py6Knq1aJ7/QQcdXf4uKl98i8b19fmFfSaZb1+Sb5ntZLlj4pLEnPf5Kmhrrq4QTx8AORuaTjC4XU9aBp5HkFpPSpoYXIlCKNd9DxGoPpBhE0YPEbg62L7YicqAwB32L4nt3Gv1Y2KOsuD+eAqlNWaAA8MmSAhpt/kppjz3/V0k9q7goD1jFW55a1HAqeCdR61d7iJgUqNni3wrzIap8c4nsMdLRidoTaA/oynHfFi66NNfbp5pKNES5/a85BBMEfkDIU3U+/qFGFHuBVgICl7EDNyhj2CSy0KoqhN6H6K6v+1LP0TWk+QzRtKQwWGA/aoA3uy8fR8TCX5/FFI6WO11ZWBHFUb9lcSNvg1pKM5YJlkg87pf4X0IjM4hBHJ+GEv/I0z4mQ5a84OPN6tKhbhUEKXktVISo4Q+jk/urioD1/mABoQt7C8v8iXPNBCUC9zt3jgR8FSjY2LA/hkyF5YD5OiJCCEsH4gInhEwsSE15Ogu6C9A7xWqZbCsbtWw+MN15zqqzZNCR8yqWYVm8Q== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(39850400004)(376002)(36840700001)(46966006)(336012)(426003)(4326008)(478600001)(2616005)(36906005)(316002)(9786002)(26005)(44832011)(31686004)(31696002)(36756003)(186003)(2906002)(6916009)(7636003)(356005)(54906003)(82740400003)(83380400001)(36860700001)(82310400003)(53546011)(8676002)(8936002)(47076005)(5660300002)(70586007)(70206006)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 10:11:32.0342 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6c66667-35e0-48eb-3b9b-08d945e6969c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT021.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR02MB7279 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 7/13/21 11:25 AM, Jorge Ramirez-Ortiz, Foundries wrote: > On 13/07/21, Jorge Ramirez-Ortiz, Foundries wrote: >> On 13/07/21, Michal Simek wrote: >>> Hi, >>> >>> On 7/12/21 7:40 PM, Jorge Ramirez-Ortiz, Foundries wrote: >>>> hi Michal, >>>> >>>> Would you have some sample/reference code to generate a SPL boot image >>>> using zynqmpbif instead of zynqmpimage? I cant find any documentation >>>> and I see no option to enable it (I was expecting to find some config >>>> in Makefile.spl but I see none). >>>> >>>> What is the expected way of building these images? >>> >>> Alex implemented it for Xilinx bif format after origin zynqmpimage >>> format. But usage is just like this. >>> >>> [u-boot](debian-sent)$ ./tools/mkimage -T zynqmpbif -d /tmp/bif >>> /tmp/boot.bin >>> Image Type : Xilinx ZynqMP Boot Image support >>> Image Offset : 0x000009c0 >>> Image Size : 147216 bytes (147216 bytes packed) >>> PMUFW Size : 129792 bytes (129792 bytes packed) >>> Image Load : 0xfffc0000 >>> Checksum : 0xfd15d661 >>> [u-boot](debian-sent)$ cat /tmp/bif >>> image : { >>> [pmufw_image, load=0xffdc0000] /mnt/disk/u-boot-bins/zynqmp/pmu.elf >>> [destination_cpu=a53-0, load=0xfffc0000, bootloader] spl/u-boot-spl.bin >>> } >> >> awesome, exactly what I needed to start with. > > So I can boot using the steps you mentioned above. > > But shouldnt the same bif work with bootgen? > > ****** Xilinx Bootgen v2019.2 > **** Build date : Oct 23 2019-22:59:42 > ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved. > > [TRACE] : Command Line parsing started > [TRACE] : Command: -arch zynqmp -image ./bif -w -o bootbif.bin -log trace > [INFO] : Command line parsing completed successfully > [TRACE] : BIF File: ./bif > [TRACE] : BIF file parsing started > [TRACE] : Setting PMU FW Image file as pmu.elf > [INFO] : BIF file parsing completed successfully > [INFO] : Parsing Partition Data to Image > [INFO] : Building image - image > [INFO] : Building the Partition Header Table > [INFO] : After build > -- Dump of Binary Image ---- > 00000000 Len: 000008b8 Res: 00000000 "BootHeader" > 00000000 Len: 00000040 Res: 00000000 "ImageHeaderTable" > 00000000 Len: 00000024 Res: 00000800 "ImageHeader u-boot-spl.bin" > 00000000 Len: 00000040 Res: 00000000 "PartitionHeader u-boot-spl.bin.0" > 00000000 Len: 00000040 Res: 000016c0 "PartitionHeader Null" > 00000000 Len: 00020574 Res: 00000000 "u-boot-spl.bin.0" > -- End of Dump > [INFO] : After align > -- Dump of Binary Image ---- > 00000000 Len: 000008b8 Res: 00000000 "BootHeader" > 000008c0 Len: 00000040 Res: 00000000 "ImageHeaderTable" > 00000900 Len: 00000024 Res: 00000800 "ImageHeader u-boot-spl.bin" > 00001100 Len: 00000040 Res: 00000000 "PartitionHeader u-boot-spl.bin.0" > 00001140 Len: 00000040 Res: 000016c0 "PartitionHeader Null" > 00002800 Len: 00020574 Res: 00000000 "u-boot-spl.bin.0" > -- End of Dump > [INFO] : Partition Information: > [INFO] : Image: u-boot-spl.bin > [INFO] : Partition 0: u-boot-spl.bin.0, Size: 132467 > [INFO] : After Link > -- Dump of Binary Image ---- > 00000000 Len: 000008b8 Res: 00000000 "BootHeader" > 000008c0 Len: 00000040 Res: 00000000 "ImageHeaderTable" > 00000900 Len: 00000024 Res: 00000800 "ImageHeader u-boot-spl.bin" > 00001100 Len: 00000040 Res: 00000000 "PartitionHeader u-boot-spl.bin.0" > 00001140 Len: 00000040 Res: 000016c0 "PartitionHeader Null" > 00002800 Len: 00020574 Res: 00000000 "u-boot-spl.bin.0" > -- End of Dump > > > however when I boot and inspect the processor state, xsdb returns "APU > L2 cache is held in reset" > > Since the functionality to support RSA authentication is missing from > mkimage (I'll have to add that), I would first like to see it > functional with SPL using bootgen. > > However the same bif doesnt even boot - is this to be expected? > > also the layouts generated from the bif using mkimage and bootgen are > completely different (it seems that naively I expected them to be the > same); is there any information on the different layouts used for the > bootrom? I tested it and it works fine for me. Take a look at the code what exactly is [u-boot]$ cat /tmp/bif image : { [pmufw_image] /mnt/disk/u-boot-bins/zynqmp/pmu.bin [destination_cpu=a53-0, load=0xfffc0000, bootloader] spl/u-boot-spl-align.bin } Didn't try the latest bootgen but format is changing over years but none is updating this tool. Feel free to take a look at it. Thanks, Michal