From patchwork Tue Jan 26 11:12:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 60436 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1889782lbb; Tue, 26 Jan 2016 03:13:51 -0800 (PST) X-Received: by 10.98.13.197 with SMTP id 66mr32429106pfn.125.1453806831298; Tue, 26 Jan 2016 03:13:51 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id rb5si1394651pab.125.2016.01.26.03.13.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2016 03:13:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aO1Z9-0002yn-L1; Tue, 26 Jan 2016 11:13:43 +0000 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aO1YS-0002Mz-8i for linux-mtd@lists.infradead.org; Tue, 26 Jan 2016 11:13:02 +0000 Received: by mail-lb0-x230.google.com with SMTP id oh2so89696904lbb.3 for ; Tue, 26 Jan 2016 03:12: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:in-reply-to:references; bh=x8fZ+Sy68XAhxrGcRdEy3bejo2CbrZ2v9f/sfRbI9zQ=; b=RiIhByrvDSaUff3MCEQ8iDP5xn7NvJTJm2+WihxkiLItAov7NmsPqXeopzFdcleIQH 8aYk3qunaZRnHPXYNB9kADd6iNfI+0P7RLw0gKDrBdjOf1hygc4G8FS9guTfduGA2LSa yftqSw7MuJonxIPV4SsNJNjuA6VfV28ayVw74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x8fZ+Sy68XAhxrGcRdEy3bejo2CbrZ2v9f/sfRbI9zQ=; b=IZ1ZSjbeHJaCn59RGLjAS0V3VlWfiU5guvlD1bk9RlW5knNzMt0n8w+lGkew/4WgjW ZzFJkMxJgmPWkg2UJi5tKlrEsyKHXBHAx5ZWU+UIxyMtwX84/KjGjE7K/5v73G9ybY+a 0bfihTxx9QkHrggw1uq3YJXkJhOYdM+gU0AlVcmhXgI+TEse45DyvZionPrzmpmEWeZ6 Azs+Es3+X0MO1/9c1OES3fKs6RD9YmQzKadiKZLVlEK+RLrCE1A2Kpt0gayyJVHd/OYY BVhMSHL41fHj6C3TH4AE3b/EByYzJGpqTk3hlpWRN4taMgEN8qkfKtD95KcKKjYrHCzZ V6AQ== X-Gm-Message-State: AG10YOQaS/4OzKC86hlVBfDzhNJt0xr2zwVLTDE3x5M4oB/DCiOeT45HO3jXCjN4RjeOvBUU X-Received: by 10.112.126.229 with SMTP id nb5mr7004310lbb.28.1453806758133; Tue, 26 Jan 2016 03:12:38 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id i192sm119832lfb.14.2016.01.26.03.12.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jan 2016 03:12:37 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH 3/6] ARM: versatile: move flash registration to the device tree Date: Tue, 26 Jan 2016 12:12:02 +0100 Message-Id: <1453806725-4880-4-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1453806725-4880-1-git-send-email-linus.walleij@linaro.org> References: <1453806725-4880-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160126_031300_718930_A12E73F0 X-CRM114-Status: GOOD ( 19.32 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c04:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Grant Likely , Rob Herring , Linus Walleij , Arnd Bergmann , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This moves the boardfile definition of the flash memory in the Versatile board into the device tree. The flash was already defined with the property "arm,versatile-flash" which was not handled by the kernel: instead define it as compatible also with "cfi-flash" so it detects properly, and delete the corresponding boardfile code so we get a smooth transition. The old compatible string "arm,versatile-flash" is reused to indicate to the MTD physmap subsystem that this flash requires special VPP handling. (See separate patch.) Cc: Grant Likely Cc: Rob Herring Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- arch/arm/boot/dts/versatile-ab.dts | 5 ++-- arch/arm/mach-versatile/versatile_dt.c | 47 ---------------------------------- 2 files changed, 3 insertions(+), 49 deletions(-) -- 2.4.3 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts index 6fd7efbead34..28253ee84404 100644 --- a/arch/arm/boot/dts/versatile-ab.dts +++ b/arch/arm/boot/dts/versatile-ab.dts @@ -119,8 +119,9 @@ }; flash@34000000 { - compatible = "arm,versatile-flash"; - reg = <0x34000000 0x4000000>; + /* 64 MiB NOR flash in non-interleaved chips */ + compatible = "arm,versatile-flash", "cfi-flash"; + reg = <0x34000000 0x04000000>; bank-width = <4>; }; diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index dff1c0595b67..d643b9210dbd 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -42,27 +41,15 @@ #define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n)) /* - * Memory definitions - */ -#define VERSATILE_FLASH_BASE 0x34000000 -#define VERSATILE_FLASH_SIZE SZ_64M - -/* * ------------------------------------------------------------------------ * Versatile Registers * ------------------------------------------------------------------------ */ #define VERSATILE_SYS_PCICTL_OFFSET 0x44 #define VERSATILE_SYS_MCI_OFFSET 0x48 -#define VERSATILE_SYS_FLASH_OFFSET 0x4C #define VERSATILE_SYS_CLCD_OFFSET 0x50 /* - * VERSATILE_SYS_FLASH - */ -#define VERSATILE_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */ - -/* * VERSATILE peripheral addresses */ #define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */ @@ -86,39 +73,6 @@ static void __iomem *versatile_sys_base; static void __iomem *versatile_ib2_ctrl; -static void versatile_flash_set_vpp(struct platform_device *pdev, int on) -{ - u32 val; - - val = readl(versatile_sys_base + VERSATILE_SYS_FLASH_OFFSET); - if (on) - val |= VERSATILE_FLASHPROG_FLVPPEN; - else - val &= ~VERSATILE_FLASHPROG_FLVPPEN; - writel(val, versatile_sys_base + VERSATILE_SYS_FLASH_OFFSET); -} - -static struct physmap_flash_data versatile_flash_data = { - .width = 4, - .set_vpp = versatile_flash_set_vpp, -}; - -static struct resource versatile_flash_resource = { - .start = VERSATILE_FLASH_BASE, - .end = VERSATILE_FLASH_BASE + VERSATILE_FLASH_SIZE - 1, - .flags = IORESOURCE_MEM, -}; - -struct platform_device versatile_flash_device = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &versatile_flash_data, - }, - .num_resources = 1, - .resource = &versatile_flash_resource, -}; - unsigned int mmc_status(struct device *dev) { struct amba_device *adev = container_of(dev, struct amba_device, dev); @@ -390,7 +344,6 @@ static void __init versatile_dt_init(void) versatile_dt_pci_init(); - platform_device_register(&versatile_flash_device); of_platform_populate(NULL, of_default_bus_match_table, versatile_auxdata_lookup, NULL); }