From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Subject: Re: [PATCH 6/9] ARM: dts: wheat: Drop MTD partitioning from DT Date: Thu, 24 May 2018 16:52:59 +0200 Message-ID: <7e1563c3-3e13-235b-3071-c3936502530f@gmail.com> References: <20180522120257.13232-1-marek.vasut+renesas@gmail.com> <20180522120257.13232-6-marek.vasut+renesas@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Geert Uytterhoeven Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Geert Uytterhoeven , Wolfram Sang , Richard Weinberger , Linux-Renesas , Boris Brezillon , Laurent Pinchart , Simon Horman , Linux ARM , Marek Vasut List-Id: devicetree@vger.kernel.org On 05/23/2018 08:25 AM, Geert Uytterhoeven wrote: > Hi Marek, > > On Wed, May 23, 2018 at 12:01 AM, Marek Vasut wrote: >> On 05/22/2018 04:43 PM, Geert Uytterhoeven wrote: >>> On Tue, May 22, 2018 at 2:02 PM, Marek Vasut wrote: >>>> Drop the MTD partitioning from DT, since it does not describe HW >>>> and to give way to a more flexible kernel command line partition >>>> passing. >>>> >>>> To retain the original partitioning, assure you have enabled >>>> CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the >>>> following to your kernel command line: >>>> >>>> mtdparts=spi0.0:256k@0(loader),4096k(user),-(flash) >>> >>> I think the "@0" can be dropped, as it's optional? >>> 4m? >> >> My take on this is that the loader is actually at offset 0x0 of the MTD >> device and we explicitly state that in the mtdparts to anchor the first >> partition within the MTD device and all the other partitions are at >> offset +(sum of the sizes of all partitions listed before the current >> one) relative to that first partition. > > Where is this explicitly states for the first partition? > >> Removing the @0 feels fragile at best and it seems to depend on the >> current behavior of the code. > > Better, it also depends on the documented behavior: > > Documentation/admin-guide/kernel-parameters.txt refers to > drivers/mtd/cmdlinepart.c, which states: > > * := standard linux memsize > * if omitted the part will immediately follow the previous part > * or 0 if the first part > > None of the examples listed there or under the MTD_CMDLINE_PARTS Kconfig > help text, or in a defconfig bundled with the kernel, use @0 for the first > partition. I think this is exceptionally fragile and dangerous to depend on this, but so be it. -- Best regards, Marek Vasut From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 6/9] ARM: dts: wheat: Drop MTD partitioning from DT To: Geert Uytterhoeven Cc: Linux ARM , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Marek Vasut , Geert Uytterhoeven , Laurent Pinchart , Simon Horman , Wolfram Sang , Linux-Renesas , Richard Weinberger , Boris Brezillon References: <20180522120257.13232-1-marek.vasut+renesas@gmail.com> <20180522120257.13232-6-marek.vasut+renesas@gmail.com> From: Marek Vasut Message-ID: <7e1563c3-3e13-235b-3071-c3936502530f@gmail.com> Date: Thu, 24 May 2018 16:52:59 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: devicetree-owner@vger.kernel.org List-ID: On 05/23/2018 08:25 AM, Geert Uytterhoeven wrote: > Hi Marek, > > On Wed, May 23, 2018 at 12:01 AM, Marek Vasut wrote: >> On 05/22/2018 04:43 PM, Geert Uytterhoeven wrote: >>> On Tue, May 22, 2018 at 2:02 PM, Marek Vasut wrote: >>>> Drop the MTD partitioning from DT, since it does not describe HW >>>> and to give way to a more flexible kernel command line partition >>>> passing. >>>> >>>> To retain the original partitioning, assure you have enabled >>>> CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the >>>> following to your kernel command line: >>>> >>>> mtdparts=spi0.0:256k@0(loader),4096k(user),-(flash) >>> >>> I think the "@0" can be dropped, as it's optional? >>> 4m? >> >> My take on this is that the loader is actually at offset 0x0 of the MTD >> device and we explicitly state that in the mtdparts to anchor the first >> partition within the MTD device and all the other partitions are at >> offset +(sum of the sizes of all partitions listed before the current >> one) relative to that first partition. > > Where is this explicitly states for the first partition? > >> Removing the @0 feels fragile at best and it seems to depend on the >> current behavior of the code. > > Better, it also depends on the documented behavior: > > Documentation/admin-guide/kernel-parameters.txt refers to > drivers/mtd/cmdlinepart.c, which states: > > * := standard linux memsize > * if omitted the part will immediately follow the previous part > * or 0 if the first part > > None of the examples listed there or under the MTD_CMDLINE_PARTS Kconfig > help text, or in a defconfig bundled with the kernel, use @0 for the first > partition. I think this is exceptionally fragile and dangerous to depend on this, but so be it. -- Best regards, Marek Vasut From mboxrd@z Thu Jan 1 00:00:00 1970 From: marek.vasut@gmail.com (Marek Vasut) Date: Thu, 24 May 2018 16:52:59 +0200 Subject: [PATCH 6/9] ARM: dts: wheat: Drop MTD partitioning from DT In-Reply-To: References: <20180522120257.13232-1-marek.vasut+renesas@gmail.com> <20180522120257.13232-6-marek.vasut+renesas@gmail.com> Message-ID: <7e1563c3-3e13-235b-3071-c3936502530f@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 05/23/2018 08:25 AM, Geert Uytterhoeven wrote: > Hi Marek, > > On Wed, May 23, 2018 at 12:01 AM, Marek Vasut wrote: >> On 05/22/2018 04:43 PM, Geert Uytterhoeven wrote: >>> On Tue, May 22, 2018 at 2:02 PM, Marek Vasut wrote: >>>> Drop the MTD partitioning from DT, since it does not describe HW >>>> and to give way to a more flexible kernel command line partition >>>> passing. >>>> >>>> To retain the original partitioning, assure you have enabled >>>> CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the >>>> following to your kernel command line: >>>> >>>> mtdparts=spi0.0:256k at 0(loader),4096k(user),-(flash) >>> >>> I think the "@0" can be dropped, as it's optional? >>> 4m? >> >> My take on this is that the loader is actually at offset 0x0 of the MTD >> device and we explicitly state that in the mtdparts to anchor the first >> partition within the MTD device and all the other partitions are at >> offset +(sum of the sizes of all partitions listed before the current >> one) relative to that first partition. > > Where is this explicitly states for the first partition? > >> Removing the @0 feels fragile at best and it seems to depend on the >> current behavior of the code. > > Better, it also depends on the documented behavior: > > Documentation/admin-guide/kernel-parameters.txt refers to > drivers/mtd/cmdlinepart.c, which states: > > * := standard linux memsize > * if omitted the part will immediately follow the previous part > * or 0 if the first part > > None of the examples listed there or under the MTD_CMDLINE_PARTS Kconfig > help text, or in a defconfig bundled with the kernel, use @0 for the first > partition. I think this is exceptionally fragile and dangerous to depend on this, but so be it. -- Best regards, Marek Vasut