From patchwork Thu Nov 8 08:36:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 150482 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp556671ljp; Thu, 8 Nov 2018 00:37:14 -0800 (PST) X-Google-Smtp-Source: AJdET5fHfmXnGA2BVafkn0FlxIwx4bM4qnDixS6Zg8dyOG0FmYOUeDGBYsF20O2HITDm0LLhQuW/ X-Received: by 2002:a50:ba4d:: with SMTP id 13-v6mr2918563eds.239.1541666234764; Thu, 08 Nov 2018 00:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541666234; cv=none; d=google.com; s=arc-20160816; b=gI7zaR/7gULn6rt7BU5jk1NFQk3ILjDrwQhFjZfEfbg5f9CWnkBJBUvkUA8LbVcuZT wvYGTOvHb3UBuYhT+JNfBJBjSWZkdoN1hnEAcaNAS/27AwPmUR+m8kvb6XE3Z6/5GOW0 NdC/uTNlzTU4SV530bK/1oGXfgaBWq1SOvMq5X85ipnQzaxWR0fW9t3DyJPIpY5FM+4c G02RiEYFvI7TR1Xh4u7P86hp7tgrI0Mo6MaewLGXKLEucoJPX1ft/nwWo6lVkWq3tGrE cOStDLGX7aOAJcE/rKXZdYw/3j0IR59SPLsgEJHD2FRbLwAnxRj0IYQLFntdX83CoK2K GNcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature; bh=ih3QxkEcm/UYPne0Xqu2eLfEoA7HDSIFwJXIfZI/QR8=; b=h7lWLKfyd2gMUQnpf62R9iCRiTzCH0DCDBeLij8VHsa1m/nWF6xpYbF7GuIhEUQn7j VWsHBaa1WxDOQs84VaoMm+bcx3AXL7jCidjvoQDQjvpf8Qi1MhisjlJVmLxPdM4dAlhm 9+Qzslu3CGZrTF/NfLXzYKp2YC2ACW6VSZ8mNluJdgnJeFOWAIeyMp0j1l2xT4rxq9iB RT4BBTGhkVVyn15FfAcsJ0r8uF8AHb8MpmWkB5MzxW9NlX+jcpDDu97J9A2d3jhPOhGy Sz6nBgP4OQfIYVTeyZSEiEa8eLf2aJVRHZxEHv2yuI9IPp4x9yEfods1CNcVqkcGt+V0 hdVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SqwDLbDg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id hh8-v6si894823ejb.41.2018.11.08.00.37.14; Thu, 08 Nov 2018 00:37:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SqwDLbDg; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 1B66DC22522; Thu, 8 Nov 2018 08:37:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5F160C21EBB; Thu, 8 Nov 2018 08:37:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A58FAC21EBB; Thu, 8 Nov 2018 08:37:08 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id F3305C21E0D for ; Thu, 8 Nov 2018 08:37:07 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id j13-v6so8985497pff.11 for ; Thu, 08 Nov 2018 00:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=M2nUF8qSg44S6ZISK2SaIMnP1AUxRbLi0pWpqmwMHcc=; b=SqwDLbDg3mchuMtGDnCuZEONYn+1WYJ0CZyz8DL8OHcCvp3BHKK7p1sFrO//OnT3YQ t2eReGw6aTQIENz7RpxPj3uyOcJ3Wk13s/ryjd68ComktWv5PH2NrZrchOwvCz2B4KDz lDNdJOHG+n3uHoPhd1Cm2eFMVUZ1RZFHRBRJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M2nUF8qSg44S6ZISK2SaIMnP1AUxRbLi0pWpqmwMHcc=; b=bG1prdNJgfr5KQbzQ7qugkp4Tv+OOhC7gdQMkviKE3pzR2xuoqDaKyACupq2kizXKr csBkTKImwtDow3/G36kCQdxMC+/hdacIfcqt8jRbK7FY/0hlkIa3g5lT+upzduDyoqRe v92ymKo1uBr4p5qcrQ0WgcdpZTz/e00WWFa+798EIlwGFiFx+nbLldiDyP6yzcREYp7r ryeAwutbJz1vya6J+YR/C+iDGLa0rK7ulpiHYZxJK+RwpVkShrkmeQJVo5HSM9dmq4o1 oIOmt4EcP1KHRf2Bx7Qc4ii5ev4/sNRZcP+beGw3lSKmPMRzAmHx8OzRnp1up2JrJeLl 0FwA== X-Gm-Message-State: AGRZ1gLw7f3FoDf+TynRpBl68jGZonTTXoK4i9bRN6QoGGR8YqvrYUn3 qqdfUv/ta6kIxlH6z9B5cCGBmg== X-Received: by 2002:a65:560e:: with SMTP id l14mr3077379pgs.168.1541666225995; Thu, 08 Nov 2018 00:37:05 -0800 (PST) Received: from localhost.localdomain (li90-197.members.linode.com. [74.207.248.197]) by smtp.gmail.com with ESMTPSA id c128-v6sm3379310pfb.147.2018.11.08.00.37.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Nov 2018 00:37:05 -0800 (PST) From: Jun Nie To: cschieli@gmail.com, agraf@suse.de, paulliu@debian.org Date: Thu, 8 Nov 2018 16:36:35 +0800 Message-Id: <1541666195-18256-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] rpi: Do not use dtb loaded by firmware X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Do not use dtb loaded by firmware if fit image signature is enabled. So that u-boot.dtb can be used. The u-boot.dtb contains the pulibc key that is to verify Linux kernel FIT image blob. The u-boot.dtb can be loaded by Arm Trusted Firmware(ATF) together with u-boot.bin to make sure the key is protected by ATF. Signed-off-by: Jun Nie --- board/raspberrypi/rpi/rpi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 649127c..f7041e3 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -283,6 +283,7 @@ int dram_init(void) return 0; } +#ifndef CONFIG_FIT_SIGNATURE static void set_fdtfile(void) { const char *fdtfile; @@ -318,6 +319,7 @@ unsigned long board_get_usable_ram_top(unsigned long total_size) return gd->ram_top; return fw_dtb_pointer & ~0xffff; } +#endif static void set_usbethaddr(void) { @@ -390,8 +392,10 @@ static void set_serial_number(void) int misc_init_r(void) { +#ifndef CONFIG_FIT_SIGNATURE set_fdt_addr(); set_fdtfile(); +#endif set_usbethaddr(); #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set_board_info(); @@ -467,6 +471,7 @@ int board_init(void) return bcm2835_power_on_module(BCM2835_MBOX_POWER_DEVID_USB_HCD); } +#ifndef CONFIG_FIT_SIGNATURE /* * If the firmware passed a device tree use it for U-Boot. */ @@ -476,6 +481,7 @@ void *board_fdt_blob_setup(void) return NULL; return (void *)fw_dtb_pointer; } +#endif int ft_board_setup(void *blob, bd_t *bd) {