Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3011181ybv; Mon, 24 Feb 2020 16:20:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxy3KLxvwtUsioIMB3z0IpO8YQxRYAZIGPqmkUxyWUVkEL/EiCEw8lkQ/h3RTNiq+wNtb7R X-Received: by 2002:a05:6808:84:: with SMTP id s4mr1360243oic.147.1582590028894; Mon, 24 Feb 2020 16:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582590028; cv=none; d=google.com; s=arc-20160816; b=hwGPRamsPMR8Jb83NnK93jTKKWBlcvtUqqYLWKCsPKcrQi87qp1wlvkcDUFhlg07Te STO/vZY8WwvEynJAPITzJc7i4j2rnnHIiVT7c1GS1BqSA+RfZRmq+ERqwpJH7MGMt1nJ d656Nm+9m5cD5v4MXp5gEqVgfYldhtR1NgsCcXaWKO3oIxZqpZZ0/rpC0h2XTrW/+h4l t/ao9z+HkTDi9ZSsy+k3oRSzW1QYw99cmw0Pe4jVaabFhKKScNVyb14ncbe0D1OkT6zR 9v5kZYdKu88KVk46BmXJpZohHZOkapphJi1+eyS5jJ8NWDthvaK7ByzAk1I0PQWlk6N6 ZQDg== 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=QZZtNDFa5MlgA4oiYW84JmksxUStniPtBUoPDx0CiNA=; b=gideTzhZmqykZO9RI7kO12C08Kl1gvnQWSTBRQ9c05kS8mfDoEuJDN+jNkvylwGHT2 iYbhKvcDi66KcsMJT35BhsOImkfkVptNNtdBI03WZVkOe5Of4Oj6XWsMAF/HPgP7vi6i KmRjICYcIx9E+ZcUF8b3HaRZolK2He7hWomzzsSBepk35mrG8aXsqHKKVonNchySqmyP LszI9nf/tepPUQJF+NIY9W1TcnEqgBo9h5ea5wIYRnD25+8XG2C4lql+TfR/OIlbVxzA 0mOG4fAQ8+HTYGn0hpNKoaYS5I+tbwderC97jacgjBqSC6rKCxvMrx1JiGrB9I2cSwoD XcgQ== 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 m25si6908510otn.208.2020.02.24.16.20.15; Mon, 24 Feb 2020 16:20: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 S1728402AbgBYAUK (ORCPT + 99 others); Mon, 24 Feb 2020 19:20:10 -0500 Received: from avon.wwwdotorg.org ([104.237.132.123]:53770 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBYAUK (ORCPT ); Mon, 24 Feb 2020 19:20:10 -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 DD3721C03C9; Mon, 24 Feb 2020 17:20:07 -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: Dmitry Osipenko Cc: Jens Axboe , Thierry Reding , Jonathan Hunter , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , David Heidelberg , Peter Geis , Nicolas Chauvet , Ulf Hansson , Adrian Hunter , Billy Laws , linux-tegra@vger.kernel.org, linux-block@vger.kernel.org, Andrey Danin , Gilles Grandou , Ryan Grachek , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200224231841.26550-1-digetx@gmail.com> <20200224231841.26550-4-digetx@gmail.com> From: Stephen Warren Message-ID: <44c22925-a14e-96d0-1f93-1979c0c60525@wwwdotorg.org> Date: Mon, 24 Feb 2020 17:20:05 -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: <20200224231841.26550-4-digetx@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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().