From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9329DC433B4 for ; Mon, 19 Apr 2021 08:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EE7161157 for ; Mon, 19 Apr 2021 08:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232467AbhDSIzk (ORCPT ); Mon, 19 Apr 2021 04:55:40 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEF6CC433B4 for ; Mon, 19 Apr 2021 08:57:00 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5382C60FD8 for ; Mon, 19 Apr 2021 08:57:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5382C60FD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MBaeagBF3lR2RyD6dqdVYguSkyCsIW3eE0A2a9Qkkok=; b=CoyKULXS5QhRG8RKfYsIixxMV pgCCFLQ+bDLPR6/Bn3e9FwWGW9ncQBS9qmhQJ6nBlSSJNyCJMuDJ+wl1KX2iM2S56A8fxteejds3Q OOF/yeGwbvN3Q6DeXWcsW5ON8uNQgpSPhJo/KvESBhbHnYkGpeAGeP09f3klXuXqB3h3P4QOLFViE GAESjVjoom4YikOEAfnnWUfyuw5xiZfZLl7w8V3pA0Pf9SJL8hit1DLAcDd2jefjNm3fZnvTfuty7 +maVMJKgGhIXINnppW8kdbiPyljzMKdpZXrlV2o1N1MMoVb5qZT6yGBbeyHcJVSa7yn2axTG5rAoM rltScrayA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYPgd-009VFI-U0; Mon, 19 Apr 2021 08:55:20 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYPgb-009VF2-Ls for linux-arm-kernel@desiato.infradead.org; Mon, 19 Apr 2021 08:55:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=0zEN5fYjbcXEmWot7sg8lL5EK+k/G516mu8TRxURHdQ=; b=tczUrFy2Ujn4a4Z7RfbAp7iRGF VCqXtlD4gMABU4VZkHSOZF4do0WLK27sSH5cbm7IwZ5OefGrI1rY3rKgelzLF9P4eLF071Fmn/J1L bBLKwiiQXWvr7k8gRVWJfKeNcAPiRfFx8CkSJwkijL+T4p1ob51F+IrZdUBKph2QE1ghxHgULD1jx B+EG17aoAeI7L1qQIA0qMzylemkcqolJRDJgv2/nioLH+lAqogDIR0vz0GXYvX/1gdlMANA3QJMw3 IXUeqawym8Kg36Izyun/mUTziXBq3vPqafiGUvmrnNSzQUPbWdtK8KIdlz3sUHPzwYo7sdUrQ9/C3 0Dum/iTw==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYPgW-00BD5R-8i for linux-arm-kernel@lists.infradead.org; Mon, 19 Apr 2021 08:55:16 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210419_015512_392090_F654FE07 X-CRM114-Status: GOOD ( 22.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel