From nobody Thu Nov 28 20:02:31 2024 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13CB717BEB7; Sun, 29 Sep 2024 14:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618899; cv=none; b=ohKq+DVlAGEBJ0mM282awoFodVGeLmAKF73yQvZANEl9cdadoNjyUyLsRFO8k3u2VRuxBYiMnpx5zR9XfhVnLH6L9fB2W6gfqq37koEtTBjPGqaCGo2/jsGxLI58PDNtAhqgM7vqh8ViBOyltlYUWp+33JLa4hbvuMu3eIqkkJE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618899; c=relaxed/simple; bh=vIZUmOhkctrpxNjE/bq31Se+xRGgI8VKyz9uNEv0GsQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uzcpDZUbKO0gmjJzzlhNMorT/hfZGmNy2u1LRJg928jI7J/WnOJj3YnbRY5pYz4kgcDw4OeMO54zHOszMJoDBGzOgoeZJgOytSYeDv7hVTD3BTM/IRU9ugyCk+4+GAgEYcxPYKNQ5TSiga1857ZUbGQHpoVsgcRLhuQaQUO3BM4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lrgLegqu; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lrgLegqu" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cb58d810eso27299535e9.0; Sun, 29 Sep 2024 07:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727618896; x=1728223696; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4T9c6jNuxQUPP/Rbzo55YkzEPcrdsPIICvkg9bn4/tM=; b=lrgLegquYAuTu6uY7eJJ1TIxn5FwaJ6WPpM44y1Y52NWLthB7LBG1w/tqSohVx9Huf E9GlIRSXa7MQhx1giItDrfl5qfLZh2DoRnudExgJJCLBNvsT1dwkiyJTocKf85SJUJJn ca9RSM0K3doyqGKjCGZNTQtEP0hsNliSYb0I0NZ/mqNemtYi+LMzHdtHgo/7bQz5bwv5 fxDVV6UMTcWAstZ09Cre3we36QQudm3h38iZt5WkWUk1USOV0UdjdqvO3E0mKWmZ70Mk 3jXdcZO5Y2KcRf1teIdtzJ2Xzoyic8zs/rUfvr5WXPfDHeKfStlWoGdrJjlKVnAN/odw A+iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727618896; x=1728223696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4T9c6jNuxQUPP/Rbzo55YkzEPcrdsPIICvkg9bn4/tM=; b=Stl27JDh4IRoUHn23nkKHDUfqhRh3KyS3fwW5bGNaT8k4hclHsUHKZmFa0YLL9gGIK hYBz1qvYt5sYVc8kKzZHcW/bwQoFXh8Kzjz8EdHSC5JMiwOdFPVxhyMr6EeDXGZaK2yy 8mDUh3CBIIvb5DUjN93d/SQYumFAOOh1NCpac2oAPYGQHUXTPYdudZ4SitDLEukBGrtf 2EOND3n3m5RETpRDOehmV4CRKZw4YcbiBtjkp6xXBEd0oCcdW1UsWl2ZcmoMPgIFLeNo /h6oHPHnAW0fPIIasdFOpkwGHk7lmaIHJ9Nd69pUrU+mAyFMczTZVTMeVAg0VwkJlsh5 3B6g== X-Forwarded-Encrypted: i=1; AJvYcCUHqepvQax5WQiLw+3FJUJ7AmdfMaLAO5QZMosWkSSJ1VtGIcbLe4RWJuv3GoAYirPw0530vzZyNunl@vger.kernel.org, AJvYcCUV1a4NwWx7/DYwluBVelaJlncHKqYvCA4+SB5ckeZgiOQ2TIaJpXS7sG22aW4MojsgM4WSI616hRcOyDGd@vger.kernel.org, AJvYcCVDBNOfcrnCjKpghtnoKArQehSKIgELP7c1lGwDRkid887EZvEzVxRrwL+hmVblFHFH9MwnffDI2U1p@vger.kernel.org, AJvYcCWVLAIPk7UdDf429USLaYqLwlrd4OP8fJTlZUnUwZN8bf9ucLqx6LgbwBFOgtCvWLFGN7ySNBFFQE2ZbtM=@vger.kernel.org, AJvYcCWv/MsqK3XR5vi8oNdDHIyt/f7OSqpg/g/hPAhGit53rfYA8sWK+Jp/EJFRRofpvrHyp7fSk3jyv4ie@vger.kernel.org X-Gm-Message-State: AOJu0YzS57zFc1XjdtogilU8fTpFj06efzfh9TLg+MeMtKbfN7MV7pY2 OqkF4UL4yr8pab/u0ZFI0oAI5V90RoLBxnNIAQIhtXBVynLBX8E/ X-Google-Smtp-Source: AGHT+IHXC9+7csQPIjoe/7saRtUaNLdxTZ+PIvoa34staMYR9XMAPk/Nqpjyg4a5WE1aJ21G12OGlA== X-Received: by 2002:a05:600c:5252:b0:424:8743:86b4 with SMTP id 5b1f17b1804b1-42f521ce279mr75719125e9.6.1727618896050; Sun, 29 Sep 2024 07:08:16 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f57dd3106sm77856005e9.7.2024.09.29.07.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 07:08:15 -0700 (PDT) From: Christian Marangi To: Jens Axboe , Jonathan Corbet , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , INAGAKI Hiroshi , Daniel Golle , Christian Brauner , Al Viro , Jan Kara , Li Lingfeng , Christian Heusel , linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Miquel Raynal , Lorenzo Bianconi , upstream@airoha.com Cc: Christoph Hellwig Subject: [PATCH v3 1/4] block: add support for defining read-only partitions Date: Sun, 29 Sep 2024 16:06:17 +0200 Message-ID: <20240929140713.6883-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929140713.6883-1-ansuelsmth@gmail.com> References: <20240929140713.6883-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for defining read-only partitions and complete support for it in the cmdline partition parser as the additional "ro" after a partition is scanned but never actually applied. Signed-off-by: Christian Marangi Reviewed-by: Christoph Hellwig --- block/blk.h | 1 + block/partitions/cmdline.c | 3 +++ block/partitions/core.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/block/blk.h b/block/blk.h index c718e4291db0..f300212d3e98 100644 --- a/block/blk.h +++ b/block/blk.h @@ -558,6 +558,7 @@ void blk_free_ext_minor(unsigned int minor); #define ADDPART_FLAG_NONE 0 #define ADDPART_FLAG_RAID 1 #define ADDPART_FLAG_WHOLEDISK 2 +#define ADDPART_FLAG_READONLY 4 int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, sector_t length); int bdev_del_partition(struct gendisk *disk, int partno); diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c index 152c85df92b2..da3e719d8e51 100644 --- a/block/partitions/cmdline.c +++ b/block/partitions/cmdline.c @@ -237,6 +237,9 @@ static int add_part(int slot, struct cmdline_subpart *s= ubpart, put_partition(state, slot, subpart->from >> 9, subpart->size >> 9); =20 + if (subpart->flags & PF_RDONLY) + state->parts[slot].flags |=3D ADDPART_FLAG_READONLY; + info =3D &state->parts[slot].info; =20 strscpy(info->volname, subpart->name, sizeof(info->volname)); diff --git a/block/partitions/core.c b/block/partitions/core.c index ab76e64f0f6c..abad6c83db8f 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -373,6 +373,9 @@ static struct block_device *add_partition(struct gendis= k *disk, int partno, goto out_del; } =20 + if (flags & ADDPART_FLAG_READONLY) + bdev_set_flag(bdev, BD_READ_ONLY); + /* everything is up and running, commence */ err =3D xa_insert(&disk->part_tbl, partno, bdev, GFP_KERNEL); if (err) --=20 2.45.2 From nobody Thu Nov 28 20:02:31 2024 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B884417C22F; Sun, 29 Sep 2024 14:08:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618901; cv=none; b=t6InaeivYa8279KmL/3DowkjrfRbE/Jmd5gDlYprU9I8SQcbNHUztGEgqmr0zbu53U41c6p9ZhNFxCQA4TTCfoVyJcCAI2EZB3Mx7vA4eqx3vTbfYghHLfeIqHTN3Zo6p1WWPoVY2fRzHyOMOlShgUkKToZud3GmNb+wy5mk+To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618901; c=relaxed/simple; bh=AvSpeRPjeVRXz5j8dQKUo3Zt1JFIF3gH9S62HhEmPeo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tjkxs8AFsPA4IAKVekhCFiyKwfwFE1SWseUo6j54maBIo/f36ZBgwy797NXdLHuY47oNm3e/y7ZZBaZyp+YIM0BcVHD3HrqMKVj1YP8e/olE79hpAGotsNL1Ai/8Q82GRXlGAvqqKRVdazNk3Hr1tq+QIhjBtYqgtz4wLbzJXO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bWMV7vNI; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bWMV7vNI" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-37cd1ccaf71so1608963f8f.0; Sun, 29 Sep 2024 07:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727618898; x=1728223698; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=36HmyHvoEEpKMI8/Stc+TIqGBije17bfud9rEk2jFTM=; b=bWMV7vNISrYcenySlT8Gp/OXmx/ARXtjxXumiv8RU2cUNbXmcRxy9E10G0r4HEBQfn RhEWpWepDEnrmHjS763KIixCPOOwkJlTtpkUP10AsPuxa85n70z7Fu05PYEtJ5WZKQ08 aX61MVZjhztHEAQKZm2/Zs/8dJ19oj6KQIuxs4+3fdgsMuDR9JyS94KyvmHeGrF58wzU N+h718h5B2Ph9g4V3QU/srHcFl/aS4Ke0ZUPpsRAVBcEY253ASlnbY2xWuTu7iBcr+Zx 1vn5XLSqTSb3Ll5q837wv2PQyxvdSuvpdKvV6yFcXgaQ3Hs3BRIl2j0da/E6T0zt5a1T 2jWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727618898; x=1728223698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=36HmyHvoEEpKMI8/Stc+TIqGBije17bfud9rEk2jFTM=; b=C+xJip9Qw8RDeTuYQJzmuXmb05+/1v0QtFE1jNYphRx0jN6fZSrON8Ow9ja/5orjRE 3lvDd7Q08l8S+KgAZhCTZZGQVjZX/ZeRhPShCir32phLFYD1R2wqBrawtSjKjvnE825d yRCtW1t+2LV+IDjDMbJUpwhWg8eNTFW7pnJiOrABx2/7inOTmS92yR8/4gFvTe+kcuc1 V/oZW0pUl3GTkOY6WYIm7LfLW0ovOn2/rS9xs7CJbjt7iTO6d3p3eIh/5ZXWmPmhF62C 8X4J+eY9oI2fNi4Ga65sZoL6E7ExYLW6woSOp2QtHV3w6ZZRSLi81OlcX38y4U+ROfn7 Zanw== X-Forwarded-Encrypted: i=1; AJvYcCVd0v+r05BVMnqOnTGzfU4Js5rXhSLL4UI/TgKheLBB9DvA++3r0ZzlC8Saan3bH9PCC3sE3wIE4aoK8uk=@vger.kernel.org, AJvYcCVrJEcYjsu2RlOH/7a6PhEGyb3ZAa34DUrOO+JTJfnS/IR971V6Q/uGk6mXj1veg4dncAf6eTrfy1ly@vger.kernel.org, AJvYcCVyJ4+XSRCcf+I6GB7EkUTnI0aJXHrvtCaiuf9DPnbu3q/iAo5RIHk4jUGLcfBez1XBWp7h1ISmEqn/@vger.kernel.org, AJvYcCWaB1YPmtgyWh+CLi/xMMM4G9N02IgEzWnc6r9V/koiJDsJ7pha9n1vkI4rPMHLzedjE3Vs85qssZTNFkZH@vger.kernel.org, AJvYcCXnKMXL1Q+cRQZ/QQAW8iHm0dGBxC5IWtj5WG2vGSZ0WQ/H/w+CBcmFmxw0rrYSn1lzDLwKV8OwflAs@vger.kernel.org X-Gm-Message-State: AOJu0YwKkzbVYvNcTeCbDzTMuGxP38xoAZGPU6cD4g0fx/kyfimTf76a vXR+7Xvzxw73KQxflyXBcbaOdtc4bi+vZ4iGk4WvWrYgz8mPwAoN X-Google-Smtp-Source: AGHT+IHjYS4dd74eVVCo58zMYH88HdXoSeT+yMiboR0ERx2snGOSj03c78zKXhZHjlAoxdI1msta7w== X-Received: by 2002:adf:a41d:0:b0:374:cd3c:db6d with SMTP id ffacd0b85a97d-37ccdb09a13mr7842135f8f.6.1727618897933; Sun, 29 Sep 2024 07:08:17 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f57dd3106sm77856005e9.7.2024.09.29.07.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 07:08:17 -0700 (PDT) From: Christian Marangi To: Jens Axboe , Jonathan Corbet , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , INAGAKI Hiroshi , Daniel Golle , Christian Brauner , Al Viro , Jan Kara , Li Lingfeng , Christian Heusel , linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Miquel Raynal , Lorenzo Bianconi , upstream@airoha.com Subject: [PATCH v3 2/4] docs: block: Document support for read-only partition in cmdline part Date: Sun, 29 Sep 2024 16:06:18 +0200 Message-ID: <20240929140713.6883-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929140713.6883-1-ansuelsmth@gmail.com> References: <20240929140713.6883-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document support for read-only partition in cmdline partition for block devices by appending "ro" after the (partition name). Signed-off-by: Christian Marangi --- Documentation/block/cmdline-partition.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/block/cmdline-partition.rst b/Documentation/bloc= k/cmdline-partition.rst index 530bedff548a..526ba201dddc 100644 --- a/Documentation/block/cmdline-partition.rst +++ b/Documentation/block/cmdline-partition.rst @@ -39,13 +39,16 @@ blkdevparts=3D[;] create a link to block device partition with the name "PARTNAME". User space application can access partition by partition name. =20 +ro + read-only. Flag the partition as read-only. + Example: =20 eMMC disk names are "mmcblk0" and "mmcblk0boot0". =20 bootargs:: =20 - 'blkdevparts=3Dmmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot),-(k= ernel)' + 'blkdevparts=3Dmmcblk0:1G(data0),1G(data1),-;mmcblk0boot0:1m(boot)ro,-= (kernel)' =20 dmesg:: =20 --=20 2.45.2 From nobody Thu Nov 28 20:02:31 2024 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1D0117E010; Sun, 29 Sep 2024 14:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618903; cv=none; b=hTg8jBj5MtFlK80i5TV0BF8832BfyrjWXN0fRtUSa4gckvqIn3wqY6P/2YGq+AQWrwl4gMg+JaJSo2Kr2RkfOkBJKhF14bpNNQmbaucbKnPzLFqgpCRQcYarbd9I3qR7hJPQGe727nPgSZAm0e+Y3lznhJM2eBR9T5fTz2c08iU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618903; c=relaxed/simple; bh=79+YTCuE+nGtBBK5CsMbE/fpmVU9X3PbsTZUsAU/s6k=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R4NKCVLSKXJGgRy2ghx7bqdtHvgEjiq3qK8C7wt7zv1+R1uXTyyvs+QvBEahMnQt9/XzmHMr/choDYPRM6K/aLDhnMHYLRbOIu1hwLsIUfLk53kj3hcDjLH3QmCvwc/Y//9LI9yia9VW1z+9raFbUk7GOj02oyvgHKvw8Ldquks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J1kdL71U; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J1kdL71U" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42e82f7f36aso28560045e9.0; Sun, 29 Sep 2024 07:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727618900; x=1728223700; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=q2aNy8YATrUKUVxCjxxfbuqSzgonHJFsBBqc3Ny2lq0=; b=J1kdL71UphO9j9GnCnPFSdFnbbrkXh60dLL6BxB+9rImxcIEJuCrd+JvJaP82lVbml wEGIDQixKUxFQgOOQ+ZsNkHBzmfc/owWiGrYXH/SM44PBdrZ+fUt3bm/FpqeZYo5B4DI wuhtmtft1sp48r3E0yqzp4n/KssFvwd/AJVGIopC2z0QmQ6kVwkA9QcC8l1HeMmUeAHs SaoelD+ax4FBMXrSj8lRzZ6MSiD0/PmzQQdguhxvDNC9k6SuaWzBaWSXiIZuFKwANp3Q FZvqu74vuI5a/7aowDqARQxGJ8HuLAOWQFIN6KPXOIazTNLtX4dIMm24dAP3+mUx6gvH NEcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727618900; x=1728223700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q2aNy8YATrUKUVxCjxxfbuqSzgonHJFsBBqc3Ny2lq0=; b=g47JLLnae+srDFH5mYzUyy/CJ777u4kr0tKhKUfguRsLSunzzTyJXGguCgiXthF3kg 6kGjnfgZtAxHv6981/YXn6Sv5+54v1uTBMrerjj+QxwS/m40y2XyGjqn/Q3ZEJzI+TtK LQMGyrFYDlskxJuQKHMJtEuXrCPqTqbCH8H+Dv13rJ5ETaz/awHc4Hk1ggTqn/4uHzyK U0UwfrmhX2cn2MXiezzetLKbK1Qw4plr16a3foNUXKsTj/X9ApiKMRwu9RHdZs+zkbPw atNXhiRRkYFIpYIKJNQZma6julemNJMOb2vJqxb5esoCMk6P1rXwXaNcAl1RAIZnk63N DZaw== X-Forwarded-Encrypted: i=1; AJvYcCVEtxg+sIxoQZVODItYZS2JF6o85kJ+PzxmiwUDVW4FArH0mHWSyER+uZn1AJ0XJBux7r8fvnMv2KLr6MAg@vger.kernel.org, AJvYcCVhmob7PGkDX2sYH6VXIN0lrqgNZfbzQx34xoBdWeLrxbLrlrjzlEqk4/M1jNmf0axgM9NScok3AZ1K@vger.kernel.org, AJvYcCWEgJVXNbBQTB1agHfSL1WzcYw1qOxgkipYoYtxUi2lErlwcOzhqA2oshoJWJnw7nAfZpBdGpwhK0vn@vger.kernel.org, AJvYcCX4WnK0n3EOv+3zHBRzt1paDBELi+mTxqIYcaVhJdCUJOZAeeQyqiigJOzPPtmPcBd6SleRI2CMtVGMQfk=@vger.kernel.org, AJvYcCXRmhL7qL1G5T5ohUK+lszFhkDPhGiQVLUDKbO4HTb9mZ/HMJ3c/SNDdNOuvV0DrTagIKdjdbDGOCA3@vger.kernel.org X-Gm-Message-State: AOJu0YyvoglFNdyAC4hJOKjQxiBl72+XOH9XjK8y507UgNVFYKD3UuQR dxQdpaAd86PRVUxsYaR5ew2pCh6in+Zz4iI7t1cLx81b6u6zj+8m X-Google-Smtp-Source: AGHT+IF5QLLtYkupxeYRXy9xFNBDsGm27nPREth8VQ0bhxdAXdenUSNHO+8sTvEjg5JLWzkylT8E3A== X-Received: by 2002:a05:600c:209:b0:42f:68e8:d874 with SMTP id 5b1f17b1804b1-42f68e8da4fmr9334735e9.31.1727618900053; Sun, 29 Sep 2024 07:08:20 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f57dd3106sm77856005e9.7.2024.09.29.07.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 07:08:18 -0700 (PDT) From: Christian Marangi To: Jens Axboe , Jonathan Corbet , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , INAGAKI Hiroshi , Daniel Golle , Christian Brauner , Al Viro , Jan Kara , Li Lingfeng , Christian Heusel , linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Miquel Raynal , Lorenzo Bianconi , upstream@airoha.com Subject: [PATCH v3 3/4] block: add support for partition table defined in OF Date: Sun, 29 Sep 2024 16:06:19 +0200 Message-ID: <20240929140713.6883-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929140713.6883-1-ansuelsmth@gmail.com> References: <20240929140713.6883-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for partition table defined in Device Tree. Similar to how it's done with MTD, add support for defining a fixed partition table in device tree. A common scenario for this is fixed block (eMMC) embedded devices that have no MBR or GPT partition table to save storage space. Bootloader access the block device with absolute address of data. This is to complete the functionality with an equivalent implementation with providing partition table with bootargs, for case where the booargs can't be modified and tweaking the Device Tree is the only solution to have an usabe partition table. The implementation follow the fixed-partitions parser used on MTD devices where a "partitions" node is expected to be declared with "fixed-partitions" compatible in the OF node of the disk device (mmc-card for eMMC for example) and each child node declare a label and a reg with offset and size. If label is not declared, the node name is used as fallback. Eventually is also possible to declare the read-only property to flag the partition as read-only. For eMMC block, driver scan the disk name and check if it's suffixed with "boot0" or "boot1". This is to handle the additional disk provided by eMMC as supported in JEDEC 4.4+. If this suffix is detected, "partitions-boot0" or "partitions-boot1" are used instead of the generic "partitions" for the relevant disk. Signed-off-by: Christian Marangi --- block/partitions/Kconfig | 8 ++ block/partitions/Makefile | 1 + block/partitions/check.h | 1 + block/partitions/core.c | 3 + block/partitions/of.c | 151 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 164 insertions(+) create mode 100644 block/partitions/of.c diff --git a/block/partitions/Kconfig b/block/partitions/Kconfig index 7aff4eb81c60..8534f7544f26 100644 --- a/block/partitions/Kconfig +++ b/block/partitions/Kconfig @@ -270,4 +270,12 @@ config CMDLINE_PARTITION Say Y here if you want to read the partition table from bootargs. The format for the command line is just like mtdparts. =20 +config OF_PARTITION + bool "Command line partition support" if PARTITION_ADVANCED + depends on OF + help + Say Y here if you want to enable support for partition table + defined in Device Tree. (mainly for eMMC) + The format for the command line is just like MTD fixed-partition schema. + endmenu diff --git a/block/partitions/Makefile b/block/partitions/Makefile index a7f05cdb02a8..25d424922c6e 100644 --- a/block/partitions/Makefile +++ b/block/partitions/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_CMDLINE_PARTITION) +=3D cmdline.o obj-$(CONFIG_MAC_PARTITION) +=3D mac.o obj-$(CONFIG_LDM_PARTITION) +=3D ldm.o obj-$(CONFIG_MSDOS_PARTITION) +=3D msdos.o +obj-$(CONFIG_OF_PARTITION) +=3D of.o obj-$(CONFIG_OSF_PARTITION) +=3D osf.o obj-$(CONFIG_SGI_PARTITION) +=3D sgi.o obj-$(CONFIG_SUN_PARTITION) +=3D sun.o diff --git a/block/partitions/check.h b/block/partitions/check.h index 8d70a880c372..e5c1c61eb353 100644 --- a/block/partitions/check.h +++ b/block/partitions/check.h @@ -62,6 +62,7 @@ int karma_partition(struct parsed_partitions *state); int ldm_partition(struct parsed_partitions *state); int mac_partition(struct parsed_partitions *state); int msdos_partition(struct parsed_partitions *state); +int of_partition(struct parsed_partitions *state); int osf_partition(struct parsed_partitions *state); int sgi_partition(struct parsed_partitions *state); int sun_partition(struct parsed_partitions *state); diff --git a/block/partitions/core.c b/block/partitions/core.c index abad6c83db8f..dc21734b00ec 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -43,6 +43,9 @@ static int (*const check_part[])(struct parsed_partitions= *) =3D { #ifdef CONFIG_CMDLINE_PARTITION cmdline_partition, #endif +#ifdef CONFIG_OF_PARTITION + of_partition, /* cmdline have priority to OF */ +#endif #ifdef CONFIG_EFI_PARTITION efi_partition, /* this must come before msdos */ #endif diff --git a/block/partitions/of.c b/block/partitions/of.c new file mode 100644 index 000000000000..bc6200eb86b3 --- /dev/null +++ b/block/partitions/of.c @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include +#include "check.h" + +#define BOOT0_STR "boot0" +#define BOOT1_STR "boot1" + +static struct device_node *get_partitions_node(struct device_node *disk_np, + struct gendisk *disk) +{ + const char *node_name =3D "partitions"; + + /* + * JEDEC specification 4.4 for eMMC introduced 3 additional partition + * present on every eMMC. These additional partition are always hardcoded + * from the eMMC driver as boot0, boot1 and rpmb. While rpmb is used to + * store keys and exposed as a char device, the other 2 are exposed as + * real separate disk with the boot0/1 appended to the disk name. + * + * Here we parse the disk_name in search for such suffix and select + * the correct partition node. + */ + if (disk->major =3D=3D MMC_BLOCK_MAJOR) { + const char *disk_name =3D disk->disk_name; + + if (!memcmp(disk_name + strlen(disk_name) - strlen(BOOT0_STR), + BOOT0_STR, sizeof(BOOT0_STR))) + node_name =3D "partitions-boot0"; + if (!memcmp(disk_name + strlen(disk_name) - strlen(BOOT1_STR), + BOOT1_STR, sizeof(BOOT1_STR))) + node_name =3D "partitions-boot1"; + } + + return of_get_child_by_name(disk_np, node_name); +} + +static int validate_of_partition(struct device_node *np, int slot) +{ + int a_cells, s_cells; + const __be32 *reg; + u64 offset, size; + int len; + + reg =3D of_get_property(np, "reg", &len); + + a_cells =3D of_n_addr_cells(np); + s_cells =3D of_n_size_cells(np); + + /* + * Validate offset conversion from bytes to sectors. + * Only the first partition is allowed to have offset 0. + */ + offset =3D of_read_number(reg, a_cells); + if (do_div(offset, SECTOR_SIZE) || + (slot > 1 && !offset)) + return -EINVAL; + + /* Validate size conversion from bytes to sectors */ + size =3D of_read_number(reg + a_cells, s_cells); + if (do_div(size, SECTOR_SIZE) || !size) + return -EINVAL; + + return 0; +} + +static void add_of_partition(struct parsed_partitions *state, int slot, + struct device_node *np) +{ + struct partition_meta_info *info; + char tmp[sizeof(info->volname) + 4]; + int a_cells, s_cells; + const char *partname; + const __be32 *reg; + u64 offset, size; + int len; + + reg =3D of_get_property(np, "reg", &len); + + a_cells =3D of_n_addr_cells(np); + s_cells =3D of_n_size_cells(np); + + /* Convert bytes to sector size */ + offset =3D of_read_number(reg, a_cells) / SECTOR_SIZE; + size =3D of_read_number(reg + a_cells, s_cells) / SECTOR_SIZE; + + put_partition(state, slot, offset, size); + + if (of_property_read_bool(np, "read-only")) + state->parts[slot].flags |=3D ADDPART_FLAG_READONLY; + + /* + * Follow MTD label logic, search for label property, + * fallback to node name if not found. + */ + info =3D &state->parts[slot].info; + partname =3D of_get_property(np, "label", &len); + if (!partname) + partname =3D of_get_property(np, "name", &len); + strscpy(info->volname, partname, sizeof(info->volname)); + + snprintf(tmp, sizeof(tmp), "(%s)", info->volname); + strlcat(state->pp_buf, tmp, PAGE_SIZE); +} + +int of_partition(struct parsed_partitions *state) +{ + struct device_node *disk_np, *partitions_np, *np; + struct device *ddev =3D disk_to_dev(state->disk); + int slot; + + disk_np =3D of_node_get(ddev->parent->of_node); + if (!disk_np) + return 0; + + partitions_np =3D get_partitions_node(disk_np, state->disk); + if (!partitions_np || + !of_device_is_compatible(partitions_np, "fixed-partitions")) + return 0; + + /* Check if child are over the limit */ + slot =3D of_get_child_count(partitions_np); + if (slot >=3D state->limit) + goto err; + + slot =3D 1; + /* Validate parition offset and size */ + for_each_child_of_node(partitions_np, np) { + if (validate_of_partition(np, slot)) + goto err; + + slot++; + } + + slot =3D 1; + for_each_child_of_node(partitions_np, np) { + add_of_partition(state, slot, np); + + slot++; + } + + strlcat(state->pp_buf, "\n", PAGE_SIZE); + + return 1; +err: + of_node_put(partitions_np); + of_node_put(disk_np); + return -1; +} --=20 2.45.2 From nobody Thu Nov 28 20:02:31 2024 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F87F18308A; Sun, 29 Sep 2024 14:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618905; cv=none; b=VQTen/o3iOvDV0EH6M63kACTuLEu8zGblxAhxzUveZmF3rFtG1mBCqzm68VqwmvfGT5N1Iy8e/j92A7gO6XgqDk9jDdJJN24dN6maOHjpVPVSytxoAqSgjYSKaPh/KpXJqpPCk2q3BUDK3UqMahAYNNYv85/kpTsuV+wuImYJlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727618905; c=relaxed/simple; bh=XY9CIJRo4kERP1f7gzDDtLEj6FCWJeCQbDTSD4GQKRc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MPJ5ZP+vUoeGYAr3Fxrj4tgpul3e3yJiK65YFe53YSpUlLw2GBqvxGlQFvUIcVru/68DPZNUWQSYiryfnBf9b5yR96dhAZZtsht9k1sr9FXrpt6+OMmXFEAghB6YMd2pYTvdtzgCQTqML24PfDBu1QD/ldlDrzO8kVAKekYPUls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nbh1lG4J; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nbh1lG4J" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-37cd0b5515fso1694048f8f.2; Sun, 29 Sep 2024 07:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727618902; x=1728223702; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xOC+2wly8ftj8TAYNwXd5GnLMEEgJdboLyIbx9/Qeyc=; b=Nbh1lG4JXUyS2CnNVv6Fbd6c1ZhY2NCMeZYzRNQy3TIrtRXyNnLs51SdA9W28jFecE tGP1AUVIxDMu7uC02oSBkGLXwmJd/oGronJcy2hPQyeVcwGrk7xU5ZzNGuRYJ3K//dgt n99DFHQTa2H0Yxc8BQxRVglDA69joJPrANur+ypvdmmbc8qkM2QKVPbCzy5u733uWDpe dW5Xb0E3scZkXlmrMPzq+BP6i5cDWDLGnWQ5b/eQnfQqpd1bqF/MbG5rJeHbR1w5QPWE thTY+iFIecO+asArkdz5GIa8Pj0tonxPnI1eNN/LtvpcGRxLiJD5g+R/ZSS2/grr4cAJ YefA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727618902; x=1728223702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xOC+2wly8ftj8TAYNwXd5GnLMEEgJdboLyIbx9/Qeyc=; b=uz5GFKNgKWTBm2KwP7lArg8kPCO5tkdwLzwaHXrLS7JhVviHfd3IDeFqYHVSAWgZxj VZ4+iRc2PI9nUhuhFS6z3287zTqVpMYZuIGRfqlmovbR+byv0HG2VX1kLjIhj/585pg5 CA4mwBe51ceQU8Hq3dhD6UCaTK9iPfRROsl0sOWwbMzOof/QkdxqfhLuApqSpH2b4oeP yrvIe8UQytjSyROgDZS88wzTL/A0JhNY0as7GQZBNzWQYWrRSV4kjTHNJFpq62NoF5sI ssXqE1CLL6Q0ROpVaAmwl5ebKzHR2h7z7BwPdWKJ23WD9WuY3cWFVHHYGYs2dXyyTg2j 8lvA== X-Forwarded-Encrypted: i=1; AJvYcCVg6f04T1xhzhaqaM8BaERxUX8Kk19kjXq3EYNIzpFhueSXNRXhbUbfo0s60ti0mTGe2xu9W2cn8UiI@vger.kernel.org, AJvYcCWClNnpn/CJsA9IFdK4663C0IKR+eWYozyB9jvqPQuhuEP8bHLa9lAv9tabsglCqFfJ6er7GNmkcDoj3dE=@vger.kernel.org, AJvYcCWVsLxcDzkkSQeX8SHs2H7lngWgFYOFnnXSaRNVTCtkhoI1bAXqi3bxPlqGi8Fx2pnsqE/2icIzcJw8@vger.kernel.org, AJvYcCWtew50d+LSv65ReIDi90HdCPf91Dg6tFxBZWhVfYRcBJ2CDv/IgzYsZ1+b7D4T0EtTBbilB4fxKKWx@vger.kernel.org, AJvYcCWylbpMtgTrJAX+KraVtOBYpl8x44AeOJH91EqrwWE2B5zI4OWsC+bFqZwNoEdZgL5V2iCoRxr61oidhP24@vger.kernel.org X-Gm-Message-State: AOJu0YxZW2DG+QRdzzStVuVqMrXJcypb0cX3DE+ATP3rzq/+z6+IJDbb Do2OYG5YaYDNTuXbHDkJWNIHLP2A2hYlh4OS5Cb41mIU2Ov6hsKC X-Google-Smtp-Source: AGHT+IEaTYIMtXLW2Fbsge2IBd7OpjCtDwOapaLlrUO9/SPaF5c7ADYuNz/90eGwtbd9dof1ZWtvqQ== X-Received: by 2002:a5d:6807:0:b0:37c:ce45:96f2 with SMTP id ffacd0b85a97d-37cd5b1f317mr4549697f8f.50.1727618902187; Sun, 29 Sep 2024 07:08:22 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42f57dd3106sm77856005e9.7.2024.09.29.07.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 07:08:21 -0700 (PDT) From: Christian Marangi To: Jens Axboe , Jonathan Corbet , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Christian Marangi , INAGAKI Hiroshi , Daniel Golle , Christian Brauner , Al Viro , Jan Kara , Li Lingfeng , Christian Heusel , linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Miquel Raynal , Lorenzo Bianconi , upstream@airoha.com Subject: [PATCH v3 4/4] dt-bindings: mmc: Document support for partition table in mmc-card Date: Sun, 29 Sep 2024 16:06:20 +0200 Message-ID: <20240929140713.6883-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240929140713.6883-1-ansuelsmth@gmail.com> References: <20240929140713.6883-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document support for defining a partition table in the mmc-card node. This is needed if the eMMC doesn't have a partition table written and the bootloader of the device load data by using absolute offset of the block device. This is common on embedded device that have eMMC installed to save space and have non removable block devices. If an OF partition table is detected, any partition table written in the eMMC will be ignored and won't be parsed. eMMC provide a generic disk for user data and if supported (JEDEC 4.4+) also provide two additional disk ("boot0" and "boot1") for special usage of boot operation where normally is stored the bootloader or boot info. Signed-off-by: Christian Marangi --- .../devicetree/bindings/mmc/mmc-card.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-card.yaml b/Document= ation/devicetree/bindings/mmc/mmc-card.yaml index fd347126449a..5f93bb77f246 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-card.yaml +++ b/Documentation/devicetree/bindings/mmc/mmc-card.yaml @@ -13,6 +13,10 @@ description: | This documents describes the devicetree bindings for a mmc-host controll= er child node describing a mmc-card / an eMMC. =20 + It's possible to define a fixed partition table for an eMMC for the user + partition and one of the 2 boot partition (boot0/boot1) if supported by = the + eMMC. + properties: compatible: const: mmc-card @@ -26,6 +30,24 @@ properties: Use this to indicate that the mmc-card has a broken hpi implementation, and that hpi should not be used. =20 +patternProperties: + "^partitions(-boot[01])?$": + $ref: /schemas/mtd/partitions/partitions.yaml + + patternProperties: + "^partition@[0-9a-f]+$": + $ref: /schemas/mtd/partitions/partition.yaml + + properties: + reg: + description: Must be multiple of 512 as it's converted + internally from bytes to SECTOR_SIZE (512 bytes) + + required: + - reg + + unevaluatedProperties: false + required: - compatible - reg @@ -42,6 +64,36 @@ examples: compatible =3D "mmc-card"; reg =3D <0>; broken-hpi; + + partitions { + compatible =3D "fixed-partitions"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + label =3D "kernel"; /* Kernel */ + reg =3D <0x0 0x2000000>; /* 32 MB */ + }; + + partition@2000000 { + label =3D "rootfs"; + reg =3D <0x2000000 0x40000000>; /* 1GB */ + }; + }; + + partitions-boot0 { + compatible =3D "fixed-partitions"; + + #address-cells =3D <1>; + #size-cells =3D <1>; + + partition@0 { + label =3D "bl"; + reg =3D <0x0 0x2000000>; /* 32MB */ + read-only; + }; + }; }; }; =20 --=20 2.45.2