From patchwork Fri Oct 19 07:06:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149241 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2948886lji; Fri, 19 Oct 2018 00:07:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV61M/ewldo+iAZtmPRJzFTJO4i6XySxjBsE3Xi5hhSOpLi6iXJZkx1WuGQ2/1NMsp5gvGVUr X-Received: by 2002:a17:902:24c:: with SMTP id 70-v6mr23401938plc.324.1539932826229; Fri, 19 Oct 2018 00:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539932826; cv=none; d=google.com; s=arc-20160816; b=P7dtDZebJLKe64k7/GAxuo4P7DJkGl/KLOz+Fhr4+w7VL1zlBuH9IasX4I3l68ZQmy rRMmeepBjaK+h7lHLKcjIgwGil8eXbqjNsdNEsv/G7GWTlqs7KqR0ZjyKQGnGqAzBfpC F4jznhq5VomtiEV8jRQ71ekxTgxQk/zjzDcNwDpNjNmrxcAVWRSHzx7P9crLVTFWfbuj 5LmKKHgNiwcUMqr6yWbVEk8cG7kafX9z/inn2ZsyHZCrvkUraiFAeWh/N3W82Au3aYAS 0Z8/S3Qb/kcveyWks6x+K9I/mSDSZkhQvyLeFybXcNTp59MiAX70UykjDjHflC6aheiG e8Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :dkim-signature; bh=XcKhjGZ1tTyr1BsYogj0K7BRrS8cqHFDJZiid8nzktk=; b=a4TinNEg97dgiNTwd8UaAHDgjUkpLOmvM0Y9zucdC1p3+rGzJbQ+KN78w9tcMbf38E 9U9t3uzBXm3qIofSDgokJ6wingIdatXpNIVN+qtPSFbBE9dm4Hy2gnAPdTkQNsCTZh45 OxxVQYXpthzuR1BPkktn4iI7rYJD/RVDFmtOjP1OLxmkklMDJ3oyXoBXJcH3mFth5yOg yV8zh69RMqcGXX/Lhi8wadjuoiC+//W4KlHxx3VWDNg2ExejSpZU1QT8WF+VTafK68P+ nLSIWWrQ4UyGUHcLUxdAdTztzmwD8uZp2FBl1Pi1s0A4oRkdb/LJ8t/q5jNp+NULT1WW 99bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=OujGfeT4; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UF3y5vOj; 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 u66-v6si23992074pgu.94.2018.10.19.00.07.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 00:07:06 -0700 (PDT) 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=OujGfeT4; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UF3y5vOj; 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=XcKhjGZ1tTyr1BsYogj0K7BRrS8cqHFDJZiid8nzktk=; b=Ouj GfeT4Lc8V4a4MN2KwGYQcAq+TiWBwcHc/CZh0QFIYzk0yct6BXDiktED7rxyco3xdhQlSlfAhokBN ZDFivY53ttYWsZMHe/cbMdtJgf00f1ZVjRt0oHVUi1q6TV3ZGneC2UEWyruU8vDH6iSmg+LQ1nO8M srZj3y/HjpX9itVm73naaaN6gjCRsz2fqnzTZCXLRbxzTx/cmjeej9p+XrTBujEEUYn8r5vbDqVMb IvOy7OzS4H3/0dHMAlInk7cfs2uzOEVcTihNcJrUxyUMxk7mzKLm++xnNVM9JQ2QwxAQfVzc+ncrr b8UhXAk+pZ5De5UODlRmzI1pGuvG83A==; 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 1gDOrt-0003gY-IV; Fri, 19 Oct 2018 07:06:45 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gDOro-0003dW-Sm for linux-mtd@lists.infradead.org; Fri, 19 Oct 2018 07:06:42 +0000 Received: by mail-lj1-x244.google.com with SMTP id j4-v6so29912035ljc.12 for ; Fri, 19 Oct 2018 00:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Zvmdz3n7BsO+Xv43kO7eT02mt7NsHGctgglnzRqWYeY=; b=UF3y5vOjQySXVeUhNwPA2INR7ofUv6Hr5EUYHFmbMMYizaYOBGDX2EEMHKIlR4/2/W 8MUfJHoNzNlD11+9baC5GEnbd1jqod34O0+QtDrDy+0xA3WibrjowVeuEluqSDp1wSuD YwkYdx/L8dSHvIX275InqNEuUvf7vf5XPsjW4= 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; bh=Zvmdz3n7BsO+Xv43kO7eT02mt7NsHGctgglnzRqWYeY=; b=FnLAh7Gc/nVDDITgumDCPwB9WuWbCBPssdfzYWFhqzH5fGPPpX4oVhNFw92y3mu2Px uB/5FMykcVclT6whMBNplO7D3ii1S12CO4RH5L+Jk7cLmVNRVYIvMpMEoSX5kA0r0uu+ AaEQCWYc7R1EQEbzLCyzdQd814/6t5TqklfCUsse091lEhk+og2ew5t+TPODqB8S72dA jTOrnZ+EHr2DaCzsUv4RH6xqJ5b/LVRkeOTU1yRr1hSCtiMnkqRljJkTG9QBZN58WEuf OEQRCvGQbwiRQaSv7yhOGa3vBP1XPLiJt3O4RHHAbsijRgKMCkrHOX+vfhdjROzVMiO+ lKlQ== X-Gm-Message-State: ABuFfohyo5pEeCjQv+9+jpoW5/ZRdj0EN0pD186pvfNsWbFTVy0w1EGY dNLovBu0QLJkkDO2mStUOgEozQ== X-Received: by 2002:a2e:990a:: with SMTP id v10-v6mr22709105lji.22.1539932786061; Fri, 19 Oct 2018 00:06:26 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id m12-v6sm5537lfj.39.2018.10.19.00.06.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 00:06:24 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 1/3] mtd: Move Redboot partition parser Date: Fri, 19 Oct 2018 09:06:20 +0200 Message-Id: <20181019070622.26661-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181019_000640_936662_C270853D X-CRM114-Status: GOOD ( 19.10 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 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:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 MIME-Version: 1.0 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 --- 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.17.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index c77f537323ec..4523c875f29a 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 Fri Oct 19 07:06:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149242 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2949674lji; Fri, 19 Oct 2018 00:08:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV611RfYIRT/NQ4MkV9IDl1b1cYEF/gNO34nCLRNp89bSw/lI6/BfjjZ5Szq0VMUEpAiDw+ii X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr32286976plb.71.1539932881723; Fri, 19 Oct 2018 00:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539932881; cv=none; d=google.com; s=arc-20160816; b=vl1JnL3PhzSfY/j/f+Y/H6OFGyr6McG+NSwvyl13tsOrzFSsPv+NlzuaL2RYed9Bep kQUqHA7pCv3u82hCQyGXLAmkjDiuWmE1arkk2qmS/fuLNAIXyfEjTYiIRcqNmx3OfOlP l+FRzBnDrJNQYuJjYjQsDZklQlM+T22+uj0HKNUYeXejJlmOKop4HEuZbkMyqPt93iRg nbikKxl4AaVEhHIfB7EZQHSZQJFnvgRthQVOOfr8nr6Kharifv2tyzIDuyaYXpbsjfno +u4Hn9C/QvDuMZjlsP15rnrjP525Fg7ktnAVtrOUSH5AxZye0AN6I43q26Or1HedJJMe mhYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-signature; bh=zBug2SjwnVnXtUd1B9wABESgEQG4em+ZamevW+I2x1c=; b=adlL86IWPlFw6HCsqb3q0QVCcXBxWY4MXwcVDvSSAAehFR7ClLD498Dq7RLpKT+iK+ 8z3Xg+WQeC5WRqQzd94m7pfzLuIoojeY/hjeEOsioRCVWftiML182NSGFaYHikNM40fX HU5v/dO/yQUZmQUM6j0SPTXFINysTMvFCF0hY2Xa0dsUBvo+F9bzOw4CVFwUqqUU5GUq fuRumepe6aBZtMPNQbk0Dg1dx5j0TUGNuGV6fV/dEQdVBPjXiIJkxv/biizRah+iRX+f 5GqWUSAsbd0GmfWoKcuBM9DSxhjIQ+0w3cP8U/FDbIXphvu71ZgEdtZpbOY5xYcA34j3 WlgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=WSjnm0Ux; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P1TNKeyP; 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 h18-v6si21363665pgv.47.2018.10.19.00.08.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 00:08:01 -0700 (PDT) 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=WSjnm0Ux; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P1TNKeyP; 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=zBug2SjwnVnXtUd1B9wABESgEQG4em+ZamevW+I2x1c=; b=WSjnm0UxTsF9jPftDUpF2Htjsp rg8A2aCYYBgzq37Anx2xUdeet20jzSam5hQebWNtdQvgzUh69DwxjjYZL5zTy6Uy73P4YVoOiztIV WYroEJ+xdUQ7A1MT/KGnK6cHi5lS4b3fgUBG1jU+qZ+e45KQO30AloYJm/3qN+PcxMBCAS9dBJxPT TgvhIm8irNjksv2PgpDmM6hGxf3pjjnguS9zx4MiLBZAID42nubL3Tl6FIfuJFhThD+UmfVsHmYKW 5+XtEftp5++BajCB12T/1/gXpFbz0v+X1qVg/QjiTbLF/ZrMYffGfVg0RRpxI9fnBHbtDySHo5zvS thCRafig==; 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 1gDOst-0004AA-Df; Fri, 19 Oct 2018 07:07:47 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gDOrr-0003e5-O7 for linux-mtd@lists.infradead.org; Fri, 19 Oct 2018 07:06:45 +0000 Received: by mail-lf1-x142.google.com with SMTP id l1-v6so4663952lfc.3 for ; Fri, 19 Oct 2018 00:06:33 -0700 (PDT) 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; bh=t99Q+i/SoyorLvc8faum8S770uSZRfnM+qqD2AM2ppI=; b=P1TNKeyPvyDiNwGhk5p8DVsytN+Q7+jD6G4vRBbr47j2UkbqFossmZ/ydVZUUV6PVf wLCElWkgUKCb4OQjl4/pDYAVXX2kFUIV4XtFo68j1i6xx5jq01+2YO8K8y62JSANS01m kgPXSrG0pvjjSsXGcxZfGFppLq7TjtIdiKOsI= 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; bh=t99Q+i/SoyorLvc8faum8S770uSZRfnM+qqD2AM2ppI=; b=SWM1MkmQWypJLU+QF0k8lpKR0yNGYY/w/uzMKOGxhM9IES1BXfuLEpgaBrz24gR4Zr VclkFeHftzxFApVrLkz2+dx0l2q2/v8RzXt0pU9O5Z3IXOm/L9ZW6JOE5pPA6rQPOTqA TzGAaFTCp+TEObhlUy7MI7Kra6c3hNvr+Zbq915NBcbCKBMV47fQkunXmfyMtkMm41aa u3vuKkgo0cvomBCkfGxiDJLis7GoFskEUBM2DmVSM1UyXRVdEsKvTkQQ2gvHua31ea+f W6LJg5HdQVYQOI6UIgKfOwg/UIOwHcK/C0o5lyBaMXOfDTH8yJ3Vb6xscv52W2u8U/zs QFFQ== X-Gm-Message-State: ABuFfoiF07Hp+QkHBx7IUUbtMH9vYocJIZ5N7KQt5ov8r/jYdxShJuSB yZJPGLIoxVS5d/cPJDfXVpXVXQ== X-Received: by 2002:a19:771b:: with SMTP id s27-v6mr2149756lfc.84.1539932791622; Fri, 19 Oct 2018 00:06:31 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id m12-v6sm5537lfj.39.2018.10.19.00.06.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 00:06:30 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 3/3] mtd: partitions: Add OF support to RedBoot partitions Date: Fri, 19 Oct 2018 09:06:22 +0200 Message-Id: <20181019070622.26661-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181019070622.26661-1-linus.walleij@linaro.org> References: <20181019070622.26661-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181019_000643_778812_7538904A X-CRM114-Status: GOOD ( 20.54 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 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:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 MIME-Version: 1.0 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 --- drivers/mtd/parsers/redboot.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.17.2 ______________________________________________________ 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);