From patchwork Sat Nov 10 20:01:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 150745 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1367317ljp; Sat, 10 Nov 2018 12:02:24 -0800 (PST) X-Google-Smtp-Source: AJdET5dbs9K5lP6XIJw/XxXRRdZfnau/+Hn03+2uQwaaWclMlhMyaZKSuphc2MFZ25bV/3yWdUhb X-Received: by 2002:a63:65c7:: with SMTP id z190mr12020600pgb.249.1541880144008; Sat, 10 Nov 2018 12:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541880144; cv=none; d=google.com; s=arc-20160816; b=0OPcKEkKdDXvSxq3+oBp6WZ1FgZswquX18rKcHYNopx2G7xAGZ5Cy4TP1VU/izsOi2 YTJMCD6nzrE8+Lt6D5PZO0ujOcnD1RVnd8plvNPM9TZcd8auOflDOlwQT00GnkrIyjsX uKJOevcNPYHwOci7QBZo3uWSgFSL5EcqvmLnrJY2VXwBHAExk2LqRpWCMVnb7Mzqb3Mx R39RSSdummGYyskEyxhGIuDc75XSJWS9c9tqUZeNQQcgU5TX84pFvUrm6jN7ZNDjpB7K p3UfCyyviFJDDdpXM7OV0RIDDCHWkbR4AF9/Q0uNt7gwcvYIx76IeWWBjQ0S8NeIev8P sctA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=hL2A9X3pe6od/zJcQnY4mwiVwUYG0XAgx0yRfMDGiZc=; b=yDqrCymPEvFBdXnI1lVIqYAAFD2bPXSDdAPFF4QXJ8LK6nU+HibwpqAbb3g2impz/0 LfqdVA7yAVzWr2qZJdlrVks+p8Q5fFvHLSZ0VWmx1AQCJ0fCSmLA0Yqpa7CkLJJ2FqDl y+8sTOHY3O4avBO97fF+yL8X8PPwsKUM9HpUhGP/J0cKOj32RQT+YhE6+v7tSuAHhBqE mxC3Flsn/49qVTvmavrcQJDT1MUH1anLwL+dzryKIP8wEKYorfHeOrXafLbNlsjRTaxF 6NCMGdhcFq6nktBDOX5xLfpKVZbMewMqRIKql7ZPmzABmXohQLJ4dFtDxTEFFrTe1XVp vWVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rkMMvgQb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RW2bdfw0; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id f22si1862091pgm.81.2018.11.10.12.02.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:02:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rkMMvgQb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RW2bdfw0; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hL2A9X3pe6od/zJcQnY4mwiVwUYG0XAgx0yRfMDGiZc=; b=rkMMvgQbK0Msox HhPNoxjeIy/gclU9huEVJSwpj5s5U7zooFUog+Yb3xtxezlj++X72OTNbHVN/eGAMzWAPxtI97kPO lmVlvo7ZT8A3vmJrmewiUjhbJjYzuNGd9Ke1efq5Onu9hvu3oAuoLAgJqsj8Moco1D1rgTw30dVwo dJrCDoji/DRuZeqZcNw0vsIunFdn0dKYVXPpQ73vINc7e3TPePBfHu7Tf1baXlAiSXW9P5DVTjflB mD6tKXlfZ1m20jdJaFL1lTPaXOUdP8zcJiAC3HGTR390S3SPcTOl3RiLdZh1r810lBNjhW58gMJJa 5ZZKs+pdgsJ8KVXwus2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZSK-000898-3j; Sat, 10 Nov 2018 20:02:08 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZS2-000887-GS for linux-mtd@lists.infradead.org; Sat, 10 Nov 2018 20:01:52 +0000 Received: by mail-lj1-x243.google.com with SMTP id u6-v6so4389319ljd.1 for ; Sat, 10 Nov 2018 12:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9bhYEXDohJCV7Hp7nDLyA0Lvi50vflNn7VkpAavDDTk=; b=RW2bdfw0TYb6JP+FRlEkuNgUwX4S2VTglAs4L0R/YRirSRJtWC7MZp5IJ4PhwgAkxf 1KDAl63sr/bwnqDdI7WdnKxqNbOxu5X+8qGZwjB/q9Hl52Mab34otyzCeB7N/UJv6WLI 7OwDx72p0+QqVBwgRi9o1NGXX8JmcbxjujuwY= 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=9bhYEXDohJCV7Hp7nDLyA0Lvi50vflNn7VkpAavDDTk=; b=fsN5nolBfi2VEQgW6Nk1O6u74ekiXE+qzkPLz0XGv1g80+gallQh+I+Q5vORLG78+T YLt4Pz1srp5uL44EWXaks1MyLsaLfk9PUZZETga+v9hT2TkMysC2++1C0j5hxxo3UJrt xKEvjRkfZsPiGXzNjxTa/r9wgo4RYLN06Qm1v6u83YVkzl2nleqQrKRt/lqQj/XVhnNw eaT6C0F+K8MnKdjnxFT6U8ykfjvINiC63U/OOOz6NzbMsMiTlq5TLCYPbW1zw3H96G7f g+VDSt7l3VBziHQo4Ua47wObU6Quqb31XSlsm/n5JTnQ/RsCtvLKG4txYqnQDTBYiuhG ZCgA== X-Gm-Message-State: AGRZ1gLyMzW2w6jS1ZdkYzJDNCiA3VrkOaGGHXMl9LKn7jlnVdaYi/Cb 1uJ/M4SI7IUlS48fyIrNa7conQ== X-Received: by 2002:a2e:302:: with SMTP id 2-v6mr8585869ljd.152.1541880097867; Sat, 10 Nov 2018 12:01:37 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 75-v6sm2234606ljs.50.2018.11.10.12.01.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:01:36 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 1/3 v2] mtd: Move Redboot partition parser Date: Sat, 10 Nov 2018 21:01:25 +0100 Message-Id: <20181110200127.13847-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181110_120150_546729_EDC76078 X-CRM114-Status: GOOD ( 18.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This moves the Redboot partition parser down to the parsers subdirectory. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on linux-mtd-next for v4.21 --- drivers/mtd/Kconfig | 50 ----------------------------- drivers/mtd/Makefile | 1 - drivers/mtd/parsers/Kconfig | 50 +++++++++++++++++++++++++++++ drivers/mtd/parsers/Makefile | 1 + drivers/mtd/{ => parsers}/redboot.c | 0 5 files changed, 51 insertions(+), 51 deletions(-) rename drivers/mtd/{ => parsers}/redboot.c (100%) -- 2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index a7736c1947e7..1e18c9639c3e 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -22,56 +22,6 @@ config MTD_TESTS WARNING: some of the tests will ERASE entire MTD device which they test. Do not use these tests unless you really know what you do. -config MTD_REDBOOT_PARTS - tristate "RedBoot partition table parsing" - help - RedBoot is a ROM monitor and bootloader which deals with multiple - 'images' in flash devices by putting a table one of the erase - blocks on the device, similar to a partition table, which gives - the offsets, lengths and names of all the images stored in the - flash. - - If you need code which can detect and parse this table, and register - MTD 'partitions' corresponding to each image in the table, enable - this option. - - You will still need the parsing functions to be called by the driver - for your particular device. It won't happen automatically. The - SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for - example. - -if MTD_REDBOOT_PARTS - -config MTD_REDBOOT_DIRECTORY_BLOCK - int "Location of RedBoot partition table" - default "-1" - help - This option is the Linux counterpart to the - CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time - option. - - The option specifies which Flash sectors holds the RedBoot - partition table. A zero or positive value gives an absolute - erase block number. A negative value specifies a number of - sectors before the end of the device. - - For example "2" means block number 2, "-1" means the last - block and "-2" means the penultimate block. - -config MTD_REDBOOT_PARTS_UNALLOCATED - bool "Include unallocated flash regions" - help - If you need to register each unallocated flash region as a MTD - 'partition', enable this option. - -config MTD_REDBOOT_PARTS_READONLY - bool "Force read-only for RedBoot system images" - help - If you need to force read-only for 'RedBoot', 'RedBoot Config' and - 'FIS directory' images, enable this option. - -endif # MTD_REDBOOT_PARTS - config MTD_CMDLINE_PARTS tristate "Command line partition table parsing" depends on MTD diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile index 93473d215a38..58fc327a5276 100644 --- a/drivers/mtd/Makefile +++ b/drivers/mtd/Makefile @@ -8,7 +8,6 @@ obj-$(CONFIG_MTD) += mtd.o mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o -obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o obj-$(CONFIG_MTD_AFS_PARTS) += afs.o obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o diff --git a/drivers/mtd/parsers/Kconfig b/drivers/mtd/parsers/Kconfig index ee5ab994132f..fccf1950e92d 100644 --- a/drivers/mtd/parsers/Kconfig +++ b/drivers/mtd/parsers/Kconfig @@ -14,3 +14,53 @@ config MTD_SHARPSL_PARTS This provides the read-only FTL logic necessary to read the partition table from the NAND flash of Sharp SL Series (Zaurus) and the MTD partition parser using this code. + +config MTD_REDBOOT_PARTS + tristate "RedBoot partition table parsing" + help + RedBoot is a ROM monitor and bootloader which deals with multiple + 'images' in flash devices by putting a table one of the erase + blocks on the device, similar to a partition table, which gives + the offsets, lengths and names of all the images stored in the + flash. + + If you need code which can detect and parse this table, and register + MTD 'partitions' corresponding to each image in the table, enable + this option. + + You will still need the parsing functions to be called by the driver + for your particular device. It won't happen automatically. The + SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for + example. + +if MTD_REDBOOT_PARTS + +config MTD_REDBOOT_DIRECTORY_BLOCK + int "Location of RedBoot partition table" + default "-1" + help + This option is the Linux counterpart to the + CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time + option. + + The option specifies which Flash sectors holds the RedBoot + partition table. A zero or positive value gives an absolute + erase block number. A negative value specifies a number of + sectors before the end of the device. + + For example "2" means block number 2, "-1" means the last + block and "-2" means the penultimate block. + +config MTD_REDBOOT_PARTS_UNALLOCATED + bool "Include unallocated flash regions" + help + If you need to register each unallocated flash region as a MTD + 'partition', enable this option. + +config MTD_REDBOOT_PARTS_READONLY + bool "Force read-only for RedBoot system images" + help + If you need to force read-only for 'RedBoot', 'RedBoot Config' and + 'FIS directory' images, enable this option. + +endif # MTD_REDBOOT_PARTS diff --git a/drivers/mtd/parsers/Makefile b/drivers/mtd/parsers/Makefile index 5b1bcc3d90d9..d8418bf6804a 100644 --- a/drivers/mtd/parsers/Makefile +++ b/drivers/mtd/parsers/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o obj-$(CONFIG_MTD_SHARPSL_PARTS) += sharpslpart.o +obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o diff --git a/drivers/mtd/redboot.c b/drivers/mtd/parsers/redboot.c similarity index 100% rename from drivers/mtd/redboot.c rename to drivers/mtd/parsers/redboot.c From patchwork Sat Nov 10 20:01:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 150746 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1367432ljp; Sat, 10 Nov 2018 12:02:33 -0800 (PST) X-Google-Smtp-Source: AJdET5ePMjyX0cYZuH7yLbR15kd7LSHDC2MHU99o2vxERyEYhiOF9JZ7ZIJhX0NnTKyvxjDDn0Bm X-Received: by 2002:a62:d148:: with SMTP id t8-v6mr13917490pfl.212.1541880153258; Sat, 10 Nov 2018 12:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541880153; cv=none; d=google.com; s=arc-20160816; b=l3dQe/BRQ26LFFSoIjtG1XBMybkBidFdkfTG0+AfdGf21Or6iQToksgtBSqMx4kLFV L9UuP6T3V+ZVXisS6C3hJDFSNUdFIaPeupX5tFOeCKSyJkA+9UQpPgYNZJ7Jqg8lxiqc X2RywtkfwPmn5KB5WVyrPl2zG93SpiWHgvpWqb6Qr0SIRSLZXgHOzuICUCc5d9eYrBVL l0Ll+mnp00Am9mKP+IH/+wzq82yTWFY6hixBDcEGobazKzXnkWjML9MIlcewKtJEmY0l hvCeW+GFpjYkpyFh2x5BboLgxkEcfPlDhP1qz0DqwcZxep7RAY2tX6hvPyuVx+shsesj OvAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=S4tetLgG+YUmsu9jTNwKjSlxLPg2eOC84raQ9SZlvXM=; b=RubH9zRSlma/MOCVi6dYl4t4f+PHYOvAjpN+UTESLYj5RdUuP1jnEQUhMZj+JBsmlp 75cfSBh2QSdBBAKtiOGkX7H2AjJ8lz/BuklgH9hnjAYjwmtxFswuOfGj+BmVDnVWNqrx hclMbjZtjIkyl5fbjufn+gJwztAuNVwU+ptFnaFmHn1ZUOn3CA0/C0GUklAXMUYs6t2c IqHDhueK7rtco/CA+OFYs5KXUWFwPHjeNnSGutmhxeDsE5H4V/BvCFEIGy22fI9ErfsA 4eODv2XKqSMaTvpqArmtHl0xw/AgwPrjR82ci2qUSWTAHHXOXgJnxCE+ekobEv7ORYzQ FDSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=FYrxH6Aa; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ib5lJQwq; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 22si10101978pgl.107.2018.11.10.12.02.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:02:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=FYrxH6Aa; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ib5lJQwq; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S4tetLgG+YUmsu9jTNwKjSlxLPg2eOC84raQ9SZlvXM=; b=FYrxH6AazBnfez 1GsDWlN/+H0GACf9ajCbdhI4KO7P8caw3MIUKzV7xteOWL0LMsO3dBQY8jrXp++wSMutiWHy954JT NpTJa92Daf/Duj83XLGadne0djFUEjo12+cl06SoeYUSGQtqBTkrLIA9WZqRYP+0hEMLHQm8T8Bxj BJAl8m5vFnHo+OuNkPIWNgIq/s5dmJ0lzpHuUgjTf5vRxtJN5mRynOblXSvPJ7mkZxin+dLZr3cCN V20J7yGgHwpP4IqCJUSQcER3iSmPuPzPUgoO5RrHutjYMdCvdOlsqdDeh/SuYE223GTmt/8jrVYpb ubvOJtyiKjD/qvr2b9yw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZSY-0008Te-7K; Sat, 10 Nov 2018 20:02:22 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLZS8-00088R-Cj for linux-mtd@lists.infradead.org; Sat, 10 Nov 2018 20:01:57 +0000 Received: by mail-lf1-x141.google.com with SMTP id f23so3608647lfc.13 for ; Sat, 10 Nov 2018 12:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WgT1oSEcBV7fiD22HGBOrPHrPcqRjdIDraFAdxJP7qg=; b=ib5lJQwqr22yHt/0qlNPsF2Y5J6SDcDmDh8B4jMSlIihvCwnQGctIp37Dw1a80nGv0 OdWaZmqElN7J1rTeskmHZvAxelOz4P9yyoTWxCeQAjpe256pr1PYwNu/eNvJkxuAEqMT ueTyPe0U5E48diHX9iRzV9Pprk4DJQTtyI9zg= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WgT1oSEcBV7fiD22HGBOrPHrPcqRjdIDraFAdxJP7qg=; b=QdYVIzZ0LpjNDpSh08DPt/vpQ/DA/9tGrEP7/fPO8Sj54qnLY6mkLIVyKyaI1uh1Fd AZ4hZ+qqUilBrg/Uk4s0Gxr21SijPEMF0x2v2+Xddw8gIsf74aN7WiXydTMy6FGWoLgA bC88+4Fc78Wp8lMtLP3RssJ14m5R5YiIzMoIhVPbByccttM/zrVER9fvuqo6kDFHbtaj PMT8B9dus3r6czDOgXeG2uzZwIUBTPiwFWftvcUV4ERHuqKGonxrdPHEbmdbZjQD4Red vjQ/r5sNuPMjynoHhDeEQX81dN5Smn+kDrqdurB9at0lQcroNVe/F9dE3GcYCcQZ7KVd MYQA== X-Gm-Message-State: AGRZ1gIROQi7MBPmWEBuz8Lxsn7wuzlMi5MTTKJCFyZAuhagb2/VV/+n SfC7r/sE3f/jCYlRtwZ7Gv7COg== X-Received: by 2002:a19:1d0d:: with SMTP id d13mr7684185lfd.74.1541880103515; Sat, 10 Nov 2018 12:01:43 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id 75-v6sm2234606ljs.50.2018.11.10.12.01.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Nov 2018 12:01:42 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 3/3 v2] mtd: partitions: Add OF support to RedBoot partitions Date: Sat, 10 Nov 2018 21:01:27 +0100 Message-Id: <20181110200127.13847-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181110200127.13847-1-linus.walleij@linaro.org> References: <20181110200127.13847-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181110_120156_425918_E5D224AA X-CRM114-Status: GOOD ( 20.24 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:141 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This adds device tree support for RedBoot partitioning. We read out the FIS directory block information from the device tree and then parse the partition table from there. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebased on linux-mtd-next for v4.21 --- drivers/mtd/parsers/redboot.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c index 7623ac5fc586..fb816825aa19 100644 --- a/drivers/mtd/parsers/redboot.c +++ b/drivers/mtd/parsers/redboot.c @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include #include @@ -56,6 +56,31 @@ static inline int redboot_checksum(struct fis_image_desc *img) return 1; } +#ifdef CONFIG_OF +static void parse_redboot_of(struct mtd_info *master) +{ + struct device_node *np; + u32 dirblock; + int ret; + + np = mtd_get_of_node(master); + if (!np) + return; + ret = of_property_read_u32(np, "fis-index-block", &dirblock); + if (ret) + return; + /* + * Assign the block found in the device tree to the local + * directory block pointer. + */ + directory = dirblock; +} +#else +static void parse_redboot_of(struct mtd_info *master) +{ +} +#endif + static int parse_redboot_partitions(struct mtd_info *master, const struct mtd_partition **pparts, struct mtd_part_parser_data *data) @@ -75,6 +100,7 @@ static int parse_redboot_partitions(struct mtd_info *master, #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED static char nullstring[] = "unallocated"; #endif + parse_redboot_of(master); if ( directory < 0 ) { offset = master->size + directory * master->erasesize; @@ -289,9 +315,16 @@ static int parse_redboot_partitions(struct mtd_info *master, return ret; } +static const struct of_device_id mtd_parser_redboot_of_match_table[] = { + { .compatible = "redboot-fis" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mtd_parser_trx_of_match_table); + static struct mtd_part_parser redboot_parser = { .parse_fn = parse_redboot_partitions, .name = "RedBoot", + .of_match_table = mtd_parser_redboot_of_match_table, }; module_mtd_part_parser(redboot_parser);