From patchwork Fri Jan 25 08:16:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1030853 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="rQTeY0kz"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mBk50Mv6z9s55 for ; Fri, 25 Jan 2019 19:18:36 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5BDECC21DD3; Fri, 25 Jan 2019 08:18:33 +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_H2, 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 9C742C21DA6; Fri, 25 Jan 2019 08:18:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 73AE7C21DD4; Fri, 25 Jan 2019 08:17:59 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id AB056C21D72 for ; Fri, 25 Jan 2019 08:16:48 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id w7so3888143pgp.13 for ; Fri, 25 Jan 2019 00:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hQ2oBjxrBi0AYGMWSbPkc8PSoCGyi3DNUZzBHBXSJfo=; b=rQTeY0kzDAYkbe0a3c7B+0IizzQGpovWRgtXyv8bazmHa1uwH6TWowPqp+0JnirJYw alGq0KQvIKzPLyRFwUvhXhp7xXrhQ9QbyzLJOXeoE/sqTuZn3LxdpFi1u5uGP42HcJFl uy2/usPlss+zZBjLH8JEBJsy7LDpaayNS6mNA= 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:mime-version :content-transfer-encoding; bh=hQ2oBjxrBi0AYGMWSbPkc8PSoCGyi3DNUZzBHBXSJfo=; b=Adg8nz+RymVFmMntvSOw4XaAVw0AEOEPLOTNtbRI+HpPDDIKRUnJ18PqlNGBYd7k5v Dsdb6PvcETBYBcVbMucAp294oH6Cbfep9XDYNjAU5mU89RAyDFS5ZOV2EtrCE4ubYOCt qe/zoHySV0EqRwKONBP6mz+88Xif6yXgqAeneBq1Tik6wlM8G+0B9RTcRVnL6joM4Azg QtF9VFLpkE2TOkxFwhmGzajbtJoAeNzQyTmh/BH97f9iGNLXrcRCuNVwWbuhZuK3H8Sm Dct85ZZsEggY1M9QZWORnWcXR2z4JQrQ6utrMlJ9MV610Z5dQVcdhM1qE3huZeYrEjNS TFBQ== X-Gm-Message-State: AJcUukcbQ2CDQzGv5dGBdtZVvEZUEVCqVZrPwNRLeJLfdY29g/NefCJX 3UzCz0+Zlj2VTU+ai9diPJT88Z/mvHY= X-Google-Smtp-Source: ALg8bN4Kz7x8su58mSzJpdTERrplPR8/XZj61elUILQuHnFBZZ7XAqLdYx3hrNJo2XxnWyjdcXWlYQ== X-Received: by 2002:a63:83c1:: with SMTP id h184mr8997370pge.437.1548404206909; Fri, 25 Jan 2019 00:16:46 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id e16sm30168075pfn.46.2019.01.25.00.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 00:16:46 -0800 (PST) From: Jagan Teki To: u-boot@lists.denx.de Date: Fri, 25 Jan 2019 13:46:38 +0530 Message-Id: <20190125081638.12727-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 Cc: Maxime Ripard , Andre Przywara , linux-sunxi@googlegroups.com, Jagan Teki Subject: [U-Boot] [PATCH v3.1 9/9] arm: dts: sunxi: Alter mmc2 auto-numbering to mmc1 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Environment and fastboot mmc devices are configured based on the number of mmc slots defined on particular board configs, MMC_SUNXI_SLOT_EXTRA. If MMC_SUNXI_SLOT_EXTRA is more than 1, the default env and fastboot mmc devices is mmc1 by assuming mmc0 is SD and mmc1 is emmc device. But with DM_MMC the mmc devices are numbered as per the dts node enablement. If there is a chance of having enabling all mmc nodes in dts say mmc0, mmc1, mmc2 then the default env and fastboot devices will failed to assign proper emmc device since mmc2 is emmc in most of the Allwinner platforms. So, we need to alter the auto-numbering by aliasing mmc2 to mmc1 since aliases take precedence over auto-numbering. If the dts enables mmc0, mmc1, mmc2, then all the nodes will probe sequentially and auto-numbered as it is. but when aliases mmc1 with mmc2 the resulting number should be that mmc0 is till mmc0, mmc2 become mmc1 and mmc2 become mmc1 Without aliases of mmc1 = &mmc2; ================================ MMC: mmc@1c0f000: 0, mmc@1c10000: 1, mmc@1c11000: 2 With aliases of mmc1 = &mmc2; ================================ MMC: Device 'mmc@1c11000': seq 1 is in use by 'mmc@1c10000' mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1 Loading Environment from FAT... OK Some platforms like A20 has mmc0...mmc3, but there is no usecases now for enabling all mmc controllers in any of A20 board dts files. Signed-off-by: Jagan Teki --- Changes for v3.1: - add proper commit message details along with example of how aliases alter the mmc numbering. arch/arm/dts/sunxi-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 8a9f2a6417..fdd4c80aa4 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -1,6 +1,10 @@ #include / { + aliases { + mmc1 = &mmc2; + }; + binman { filename = "u-boot-sunxi-with-spl.bin"; pad-byte = <0xff>;