Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7022141ybf; Fri, 6 Mar 2020 08:53:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vtwHj0wdNziGSt/S3VF5mv8nMpssKC6yX4ouxBgZQpVwhF0gepNds2Si+qxsKecE3fCCmdc X-Received: by 2002:aca:abc6:: with SMTP id u189mr3142903oie.151.1583513608099; Fri, 06 Mar 2020 08:53:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583513608; cv=none; d=google.com; s=arc-20160816; b=OlPNIYm9Q2SeHNpJOzmxix/akEvMeD2rQTAOKLCcGzdpif1qqzY4ZdQ4VKoPkKRF5E ua6942EZAOZUMydBA26WYcttKOYzaMkLRpAtSMelPkX/cz68L8iuitpwUajOFaZ4XQdX xjteRmGF2/slxsv3GrBzizqzIP5rJiruPMFuir5Qt3jfJgSWqSme/QjYemy6gfWSD8Cc u5WEUfzVDQJI5nJwM7TPMALbmU+JlQoPo94Kex1K6BJoW2wxCkS+yQrP+k4/FmHnBKmg DVQYllbMYVsYbE9RMvOXIjCGG7NpvOZ3xvcFuDSS1CGJhA0bQvS2/u29Lvvr8rlUd3qy emzw== 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; bh=+jjPDbNHZeNzsVwi2GVbAXDE/r0T6QiUuS1u+sxuknE=; b=EzyzhuYcKgZ3m+8hHpSTFXdaENnqF2zOEqHQAENPK1WWax3h7oQIX6AlbU0TjFiAqv BXfbQTHd3ju3ajN59aSEc7uXtrgjnNJbEI3J5pz06SReAqhRHOeIaTkqZPx5cC0PhmiV n24q0L1gDgnexZBvokcu9CA09c6h3fGHgokLU+6ubn8Uw+RpQ33eiIMG+PhnyQ6qfAda VimBPD6GFGQJDhDPYKsOw96oMDYuDafj4vIZgGYb+ebUa4hrzpkaQPqos24MjaRc1/uj UKeQhQo5UzKsujf+ah4CR4fc2JC/oTuwD+mMWMMrMFxO5HD7VECLBP0RNV+ZebdE//ko H/Jg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si1743998ots.79.2020.03.06.08.53.15; Fri, 06 Mar 2020 08:53:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726382AbgCFQxB (ORCPT + 99 others); Fri, 6 Mar 2020 11:53:01 -0500 Received: from avon.wwwdotorg.org ([104.237.132.123]:42428 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbgCFQxB (ORCPT ); Fri, 6 Mar 2020 11:53:01 -0500 Received: from [10.20.204.51] (unknown [216.228.112.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPSA id DD1AD1C01BF; Fri, 6 Mar 2020 09:52:58 -0700 (MST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.1 at avon.wwwdotorg.org Subject: Re: [PATCH v1 3/3] partitions: Introduce NVIDIA Tegra Partition Table To: Ulf Hansson , Dmitry Osipenko , 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> From: Stephen Warren Message-ID: <6fe6d262-c6b0-52d8-0150-4c32a4c36cbd@wwwdotorg.org> Date: Fri, 6 Mar 2020 09:52:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed 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 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.