Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2288997pxb; Mon, 19 Apr 2021 01:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyT+77G6jDJyTikcBnEs2LQLruM3GdaW5hg6S0b3CIw4pdazty5dmPMwDeAVMqpRHbVnXU X-Received: by 2002:a05:6402:354d:: with SMTP id f13mr24549536edd.228.1618822612838; Mon, 19 Apr 2021 01:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618822612; cv=none; d=google.com; s=arc-20160816; b=KuEcl7JOvsSLUp3Wp7ydNw0MWmA3n8Q/QXAyi9fj/6x3Bp6Dd85+YaNKhvgWLGO37o qVq6zM6iZgkSL1KRJ7QcViRGoV4u6YvcQpKhfjjKvfuAun/YIqeK5O60XbzyA5NgrH+b xvGv1gToD+2fvpsKM8D7ukp3lbNfYRunAu6VUGGX9tstu1IlAVWdlI4TUUdTHKwRqMV5 sfTbY9h5jvPuBSdP6gnO4rqlRIzP6QzUrqQvq2Y4xjjYAbrA7wlS/0OpfByDuezspRUh Ckipg4VYqo40T+HXWA8loUehZ+M2O7BT+uMcEsFy93MqBtcsTaAbPq4DekpDfmWq7Wy5 QnwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=0zEN5fYjbcXEmWot7sg8lL5EK+k/G516mu8TRxURHdQ=; b=oYWsmPeAHuaFiNK4On5d5NVCXF7cYNiFiDreAwlrqUfYjTO7hebubnv4liNUJf7vq4 2aiYalKGcHB7iqvqJAaGJUDypaCYa0bHk6TOm6btUQTxju+KKQwyVVkWLDRi3h6KgGO5 ZJwzIpX5K8KYI4DHTFEGLuvxbYAzdtWxE5knU96KJtj17AFPCt+NikIP+iJSuyLk8aPL sgsAXim9Oa5lTB3CSYPiXnSaZwdUKmiTgzSv+3uho3a7WZolQ2m1/eBNEQdJbUs7PdGm SLz0ZxMJr2vpi0IoN9PVYxpcJsDGC9eJdX8h0dhlwtaE6qxZa+k2LX5/H377Q4uV36c4 H8hQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si11256483eda.91.2021.04.19.01.56.29; Mon, 19 Apr 2021 01:56:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233403AbhDSIzi (ORCPT + 99 others); Mon, 19 Apr 2021 04:55:38 -0400 Received: from foss.arm.com ([217.140.110.172]:38622 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhDSIzg (ORCPT ); Mon, 19 Apr 2021 04:55:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2BDA51FB; Mon, 19 Apr 2021 01:55:07 -0700 (PDT) Received: from slackpad.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C81B3F85F; Mon, 19 Apr 2021 01:55:05 -0700 (PDT) Date: Mon, 19 Apr 2021 09:54:43 +0100 From: Andre Przywara To: Chen-Yu Tsai Cc: Samuel Holland , Maxime Ripard , Jernej Skrabec , devicetree , linux-arm-kernel , linux-sunxi@lists.linux.dev, linux-kernel Subject: Re: [PATCH 0/2] sunxi: Enforce consistent MMC numbering Message-ID: <20210419095443.1548432e@slackpad.fritz.box> In-Reply-To: References: <20210419025246.21722-1-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Apr 2021 11:17:19 +0800 Chen-Yu Tsai wrote: Hi, > On Mon, Apr 19, 2021 at 10:52 AM Samuel Holland wrote: > > > > Dealing with the inconsistent numbering has been a major pain, and > > there is a solution with (as far as I can tell) no tangible downsides. > > So let's use it. Thanks Samuel for sending this! > > Yes, I know the kernel supports UUIDs for root=. But UUIDs do not help > > when referencing the whole, unpartitioned device, like is needed for > > updating the bootloader and firmware. So for the use case of "write a > > bootloader to the SD card, regardless of where the board is currently > > booted from", I know of two options: > > - Dig around in sysfs to find the mmc number from the MMIO address, > > which means I have to know the MMIO addresses for every SoC, or > > - Apply patches like these. > > > > Samuel Holland (2): > > ARM: dts: sunxi: h3/h5: Enforce consistent MMC numbering > > arm64: dts: allwinner: Enforce consistent MMC numbering > > > > arch/arm/boot/dts/sunxi-h3-h5.dtsi | 6 ++++++ > > arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++++++ > > arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 6 ++++++ > > At least with Rockchip this is now done at the board level. IIRC it was > a request from other people to not do it at the SoC level. I don't recall > exactly who though. FWIW, I am very much in favour of these patches, at a SoC level: The *SoC* BootROM imposes an order, by probing the first (by MMIO address order) MMC controller first for boot devices. IIRC that's a different story for Rockchip? And if people really don't care about the order, then having a certain order doesn't hurt, so we could as well use the "natural" order, as it was before. Also UUIDs only help if you boot with an initramfs to resolve them, which proves to be extra pain if you don't compile kernels on the device, or not inside a distribution environment. One thing I was wondering about though is that U-Boot currently defines "mmc1 = &mmc2;", so that the eMMC is always MMC device 1. This is also the BootROM probe order (MMC1 is never touched). I wonder if we should mimic this here, since MMC2 is clearly the device for eMMC (due to 8-bit bus width support)? So from a block device perspective we would have always have mmcblk0 and mmcblk1. Otherwise it would conflict with U-Boot's current fixup[1], so U-Boot's DT would either need to deviate or create boot script breakages there. Cheers, Andre [1] https://source.denx.de/u-boot/u-boot/-/blob/master/arch/arm/dts/sunxi-u-boot.dtsi#L14-16