Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4683412ybf; Wed, 4 Mar 2020 08:38:21 -0800 (PST) X-Google-Smtp-Source: ADFU+vuEev0Nk0Xyo3t5HnPEJzySDDah1DdC1SkLlclaAWhEffHhsu+iT2+tKaj1VR4o4rMr0X3B X-Received: by 2002:aca:5c46:: with SMTP id q67mr2356100oib.75.1583339901684; Wed, 04 Mar 2020 08:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583339901; cv=none; d=google.com; s=arc-20160816; b=nkiyvmShxVJYCwo6zpRLNKtsUXJACiG+4IiwYL/hCFSjf9YBXKAE85peJKvi41PNIH mm790ua//+clwkaqE843jUKNlJVIlrRH+oC/EWeMKngNMCzHgc9np5zvYKYva2bjrt0j dT66Uh3ept400TvVdyh3YIej4VoKCujgc+ZViJq4n4ng5AdpDiJgYOO970gEVgkEDZeq XMlSpmjG0byh8L3JC8xmcGS1db0Sf3UEfkpbqjSy6s0uW53IkYUcEaoHZE2w7l7d1Yxk DJdU4vxz2GHPtsIDblKk/sk9y8wrSF1eLo8UQX4EVrsFFNYpArXl2RTWWNuX4wgou9GR o1vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hABaqSyYZLOUCpK2+i1NqdTSDdnUnv1VCEKCW00h9WI=; b=eZi0Gb8abLCaLraGlgqcveUQgQ7R5AVAeCnXvvJB/+xg0s7VWoom7SUOaUaEFUiAGa xptQ8YEwnZtQxJMm86tdbpm47lbNDaynrbz7bllDHTFztFfdBkKnnQQXRuvGZq8/GQsx NxKRaeV6XviQijU1tIr3LGgEfr+HtsQ+/fHAToftezonsdE1oAHKxK5YebUph7lNj5hl Wv3xDLauZL3k5fprfHu8LJmRsXKgmvENqxNNjucqQaYFb+6Ii0u+8QI+n1rNwppVssiU vM3sxmfT2WePA1Mo3VqKeRiTlSEBbfuwq0TdaDHwHsJRZlL0oNrjTT1NkAvfqJoz6/Ts VmKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="b/h5yz5w"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e206si1433393oib.210.2020.03.04.08.37.46; Wed, 04 Mar 2020 08:38:21 -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=@linaro.org header.s=google header.b="b/h5yz5w"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729754AbgCDQhY (ORCPT + 99 others); Wed, 4 Mar 2020 11:37:24 -0500 Received: from mail-vs1-f68.google.com ([209.85.217.68]:34197 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbgCDQhY (ORCPT ); Wed, 4 Mar 2020 11:37:24 -0500 Received: by mail-vs1-f68.google.com with SMTP id y204so1577872vsy.1 for ; Wed, 04 Mar 2020 08:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hABaqSyYZLOUCpK2+i1NqdTSDdnUnv1VCEKCW00h9WI=; b=b/h5yz5wlSBuj4Lbv+kbPLguRwtFdV5HC/ap61En5X/K6/4YD+4zRyFLn78H9qD27V 7GAA7Uuczidrny2Vt2luLVc9+Ex0aJ/lGNQ8tEBs+DmWPecQpoBQb9F4JV2uw2bgipSd CAvK4wsRbKO/d+Z9hQUQmcLpGcMtuAroXiK2hFYLHgxsa0Ifiu+7sZ7f5dG1zniuK5l+ zPvvbaNW6IJT2P4KEmZdKgwZ2kGkOtvy8B3ZjXOvKK+D2Ptk8sh8yVy91lCEUh+rSHVp 1UwsYKyiQMqvc89tkSoFnVWGIhC5EDiBTZ9whQR4DYCLTFMHOLW8XrXJrII2HeibgVs6 W4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hABaqSyYZLOUCpK2+i1NqdTSDdnUnv1VCEKCW00h9WI=; b=JsFTFn8GaHh2eDl0e7YseS1OA/ebMjzqFMS+9ywMvoSyTxn+9TfgJ4LZHpui1agTch vJCqIl9tLdrpOfvFGCvUdhBZQ7c+mtjUdJrpGPSFUwVUXcn0r4BPUw2pP/bzPDMeDB6+ c9QO8zr8LhLLF9HoijmUd7iLHHOweZzWejZOfv+Xgw74a2U3QhXzHHAK588wCov6A9Oq c2VgVnV/XaOslIAIMHTJU1T20OPKlwW/m9iZ2hx8col2IdzB6NftBr4X1QEv1o4Bhvur bJXElJIzh34WvUBusSO+fMs4tzPWBuRnmTU6yOBnqudWibueOr7qvMltik9r5h+FF8ro HyoA== X-Gm-Message-State: ANhLgQ0HnJ+wSCayvTlIjZGQ9grUZMlB6jvT1sibWV58bXHm24601APd Xom+hvJ4zVAtVGwp6qExJs326q1HTlctftogHf7/6g== X-Received: by 2002:a67:7fd0:: with SMTP id a199mr2328053vsd.200.1583339842981; Wed, 04 Mar 2020 08:37:22 -0800 (PST) MIME-Version: 1.0 References: <20200224231841.26550-1-digetx@gmail.com> <20200224231841.26550-4-digetx@gmail.com> <44c22925-a14e-96d0-1f93-1979c0c60525@wwwdotorg.org> In-Reply-To: <44c22925-a14e-96d0-1f93-1979c0c60525@wwwdotorg.org> From: Ulf Hansson Date: Wed, 4 Mar 2020 17:36:46 +0100 Message-ID: Subject: Re: [PATCH v1 3/3] partitions: Introduce NVIDIA Tegra Partition Table To: Stephen Warren , Dmitry Osipenko Cc: Jens Axboe , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Kind regards Uffe