Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7269365ybf; Fri, 6 Mar 2020 13:57:41 -0800 (PST) X-Google-Smtp-Source: ADFU+vvv/n+k+AZexEdbIYTzlrVF2ULTsYWiQ1oxOUKAxcxR3wWQATJ5MBxs7Kg8n6Eb4L+KXsbH X-Received: by 2002:aca:5007:: with SMTP id e7mr4276147oib.99.1583531861728; Fri, 06 Mar 2020 13:57:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583531861; cv=none; d=google.com; s=arc-20160816; b=nwxvTU9EdZM8+Ztf7EsmdKjMUw/h+5F9Kg0okT9tyUzYmGEgLwxWG2ZdS+ODqKPX+6 BLRZAiYR6vBPqxsyaUWp8W3VqiQWtdtCPV32OdAYU2IlFlTIhJ037nc66IFw3r6yKbUM yqv+9GS2FLmWAVXgg99C9JtNM8EznHLy9x6Ukix1+rnayjG3735kyS80to+2rB64odFL YaGh2z7QQn9d1M5y5sU0/Q9gfo3ryPYKEXhyh9I/v2Pu1cBK6Q5uECfNZ3RjGi1nxW0C NyAn3cSjRWOzhcIhQtH30Ihmmq67uc/j1hNNS1HbqLmqRmmK4WhlTG1WnL9VAUUkJusH 7UBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bHMaQl8LS+kUipNNyOSSMitpE/YaBqFWVsAjUSuCc2c=; b=L52oynyNrfqnMicF1nn4AkFLheHMrjOVeFN9XLd13SDJhsuyv9keMQ8qVdz0rI5qh1 decEPIuA51f5XwYpMBBPA6NfsMQbxxEA3fkp2K5PDptvwHVsyJsYoGgu6tRzc9CX46Dd WUGcCjky10hLNcWN6gB1xB/VEHWYDeuRrwJm4w+hZxUuFXNCjbYTTCurQHtn2EiqevGK PeSDFw2AKhsfR4ChgG+pRYDdsQjfB82woW9xfbZyt6uMbR4qmRS7WtxhP/02hwF1DUV4 uBRlClBbnuP6orr/oINJ4WuTb97cxKREChS73dXnHvlJj+R4vc7KUNE3VoAYTIRo1U0C NcUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T6dZB2LI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si375648oie.63.2020.03.06.13.57.15; Fri, 06 Mar 2020 13:57:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T6dZB2LI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726269AbgCFV4R (ORCPT + 99 others); Fri, 6 Mar 2020 16:56:17 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34221 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgCFV4Q (ORCPT ); Fri, 6 Mar 2020 16:56:16 -0500 Received: by mail-lf1-f66.google.com with SMTP id w27so3120728lfc.1; Fri, 06 Mar 2020 13:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bHMaQl8LS+kUipNNyOSSMitpE/YaBqFWVsAjUSuCc2c=; b=T6dZB2LI8Slsj0freZ731/RtEkdC6/kteNUVd9ADzIXfHsT2dD3kdH/PM+QX7JSrVR krPy0dsJLFfriBt7G60gPfLzXj96UZ0aq4Yb/8ZtDHLXcmDabgD93eBbMKhzRIBPYGsd juWUwZ6xsfFxPsk82UglwDyUL0ZiYP6gbYowohPr2FK0P4oCtsOoLDOCz2grv/ihc5Pg BlTEcPxcFuUcSS0K2mVn7p0I2a8o1lA6Q6tNwLG6ieulrC7tr2afGDMB6sKYPOe3rViF NZuNK+QWhM4MOQR70hYL0gfVgjQ8sSjmbh+oq3ITKiJi4NlQceBWj2jnplesQ4ZRI8yt EzRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bHMaQl8LS+kUipNNyOSSMitpE/YaBqFWVsAjUSuCc2c=; b=g7V6ncQPYGs2yUHVivvsaJJEvX8j6s97tufKyaATKBoLq3O9LxpOlawILDU1oHN+WX iQH3VTVSts1hR/yOSFZpHC45FMidMJ/qASGUc7Pd9x+n9mdSnITYnhVv38tw9CaVeQ3U 514w3cKzeMuhfOUVHA6MatbZ0h9Tk9g4bxvK4uPBIfn47lW7RTRKbepZsDMuUb298ces L+QpQU0EcBVWzM4UKkLMaiA83WrgAMRgxRApEgJpt/ZMHHr+xN3QQOeLsuW98CeU5/Vr AjzgFoDf5OCxyOYUgibr4e3ZhT5GCQJsNr1e+hh2jrhHqOTqnRFteCa0nwIdQK0WtOr7 2vlw== X-Gm-Message-State: ANhLgQ3NruvJXGhqw09liRdvQZyU/gd39JsDl5L1o5xFw7EGW7bF81Jd szcpKGANUndbWaMly25J/fYH2495 X-Received: by 2002:a19:ca15:: with SMTP id a21mr3099252lfg.67.1583531772370; Fri, 06 Mar 2020 13:56:12 -0800 (PST) Received: from [192.168.2.145] (94-29-39-224.dynamic.spd-mgts.ru. [94.29.39.224]) by smtp.googlemail.com with ESMTPSA id d12sm1409006lfi.86.2020.03.06.13.56.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2020 13:56:11 -0800 (PST) Subject: Re: [PATCH v1 3/3] partitions: Introduce NVIDIA Tegra Partition Table To: Stephen Warren , Ulf Hansson , Jens Axboe Cc: Thierry Reding , Jonathan Hunter , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , David Heidelberg , Peter Geis , Nicolas Chauvet , Adrian Hunter , Billy Laws , linux-tegra , linux-block , Andrey Danin , Gilles Grandou , Ryan Grachek , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List References: <20200224231841.26550-1-digetx@gmail.com> <20200224231841.26550-4-digetx@gmail.com> <44c22925-a14e-96d0-1f93-1979c0c60525@wwwdotorg.org> <824a4d5f-8280-8860-3e80-68188a13aa3d@gmail.com> <6fe6d262-c6b0-52d8-0150-4c32a4c36cbd@wwwdotorg.org> From: Dmitry Osipenko Message-ID: <82974dbe-9e6c-95fd-dd4d-b1cedc33f8ea@gmail.com> Date: Sat, 7 Mar 2020 00:56:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <6fe6d262-c6b0-52d8-0150-4c32a4c36cbd@wwwdotorg.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 06.03.2020 19:52, Stephen Warren пишет: > On 3/6/20 6:37 AM, Ulf Hansson wrote: >> On Wed, 4 Mar 2020 at 18:09, Dmitry Osipenko wrote: >>> >>> 04.03.2020 19:36, Ulf Hansson пишет: >>>> On Tue, 25 Feb 2020 at 01:20, Stephen Warren >>>> wrote: >>>>> >>>>> On 2/24/20 4:18 PM, Dmitry Osipenko wrote: >>>>>> All NVIDIA Tegra devices use a special partition table format for the >>>>>> internal storage partitioning. Most of Tegra devices have GPT >>>>>> partition >>>>>> in addition to TegraPT, but some older Android consumer-grade >>>>>> devices do >>>>>> not or GPT is placed in a wrong sector, and thus, the TegraPT is >>>>>> needed >>>>>> in order to support these devices properly in the upstream kernel. >>>>>> This >>>>>> patch adds support for NVIDIA Tegra Partition Table format that is >>>>>> used >>>>>> at least by all NVIDIA Tegra20 and Tegra30 devices. >>>>> >>>>>> diff --git a/arch/arm/mach-tegra/tegra.c >>>>>> b/arch/arm/mach-tegra/tegra.c >>>>> >>>>>> +static void __init tegra_boot_config_table_init(void) >>>>>> +{ >>>>>> +     void __iomem *bct_base; >>>>>> +     u16 pt_addr, pt_size; >>>>>> + >>>>>> +     bct_base = IO_ADDRESS(TEGRA_IRAM_BASE) + TEGRA_IRAM_BCT_OFFSET; >>>>> >>>>> This shouldn't be hard-coded. IIRC, the boot ROM writes a BIT (Boot >>>>> Information Table) to a fixed location in IRAM, and there's some value >>>>> in the BIT that points to where the BCT is in IRAM. In practice, it >>>>> might work out that the BCT is always at the same place in IRAM, but >>>>> this certainly isn't guaranteed. I think there's code in U-Boot which >>>>> extracts the BCT location from the BIT? Yes, see >>>>> arch/arm/mach-tegra/ap.c:get_odmdata(). >>>> >>>> So, have you considered using the command line partition option, >>>> rather than adding yet another partition scheme to the kernel? >>>> >>>> In principle, you would let the boot loader scan for the partitions, >>>> likely from machine specific code in U-boot. Then you append these to >>>> the kernel command line and let block/partitions/cmdline.c scan for >>>> it. >>> >>> The bootloader is usually locked-down on a consumer Tegra machines (it's >>> signed / encrypted). >> >> Right, you are you talking about this from a developer point of view, >> not from an end product user? >> >> I mean, for sure you can upgrade the bootloader on Nvidia products? >> No, really? > > For developer-oriented products like Jetson developer kits, you can > upgrade the bootloader, and luckily they haven't used this partition > table format for many versions. > > However, commercial Android products typically have secure boot enabled, > so you can't replace the bootloader unless you know the secure boot > keys, which only the manufacturer knows. Dmitry is working on > re-purposing such products. Thank you very much for the good clarification :)