From patchwork Tue Jan 2 11:47:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123126 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8867857qgn; Tue, 2 Jan 2018 03:50:23 -0800 (PST) X-Google-Smtp-Source: ACJfBovsgsvx+FGxIsoiIGysvvnbVtGLDJHtulOJ1CqVK0QV5XIwWd1sQdGkNvLH2E4JdVw+GF6R X-Received: by 10.98.7.27 with SMTP id b27mr38218021pfd.240.1514893823255; Tue, 02 Jan 2018 03:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514893823; cv=none; d=google.com; s=arc-20160816; b=d9ksAMDHfawRI9Isv88kGT7d3TW/445zBf/MHL4XZvtLMdzfxxs2axfu7yThcrmLtg 7HOkj5V6thaMqTdTSuPlHj7rKVp2l5anTYLx1PQwxSJwloctti6v65m+pQkE0WSLXMtY /FgCsmwzD1/Ba6VL4T2I8kJgbhn6kvepLRTpM2IUjJQnoN5SowZfnJDPYu/pSE95ugsl KClCD9I+IrHnxrzddV4gaDzEIlwZGeGSWh7nWUYxOL9BWcE7AepiruXDmCVOhbmzdu7R dsHJ2ESEzuwN6unIpEEeOLCg15jtKUAHwrDtBDQaZlvn1rRicmFu07cGJZHTmXW+FBs+ DVcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9Wc66wiPJqfjaa9YYivvtq4dCKLKOJbibZFnlxvBg4g=; b=L+LwsC51K4ZsRjE4hC7HeamPpN4GwEo1OjIY7DCErDhrRf/1F4DPx/GIXexnW8rD00 xEa/nvqtAo8yKOOq6GuVGrGctx+V5lXm0aa7pm51m7ymdr2Jn5Hu+uM2SmRXIZAEoed7 N+wARGGr249zCISwKYbxEpjARGd8otUxdkFXKLhwSgd670Tv8+ACkDan/kOuTt9gIt/1 U8egUWUY9jCTawRuuvUL9SBz95tbTk7NL/v70D9cOLZXpeFIL3Vzw34BPzFbmALkzAed FL76XOvyCHs3qAZkHeaw7JZwRKiJp8oICzlt6ZHgTM4qdDWm5+tM+Ym6geqWURZo8nK5 7CxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si33928255pln.582.2018.01.02.03.50.22; Tue, 02 Jan 2018 03:50:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850AbeABLuU (ORCPT + 28 others); Tue, 2 Jan 2018 06:50:20 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:58850 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbeABLrb (ORCPT ); Tue, 2 Jan 2018 06:47:31 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LdL6H-1fEABO04u1-00iSA5; Tue, 02 Jan 2018 12:47:23 +0100 From: Arnd Bergmann To: Michal Simek Cc: Andrew Morton , linux-arch@vger.kernel.org, Babu Moger , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 1/2] microblaze: fix endian handling Date: Tue, 2 Jan 2018 12:47:19 +0100 Message-Id: <20180102114720.3408356-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 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5hKAuB7NEQHrycGXgqsamS04= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building an allmodconfig kernel fails horribly because of endian mismatch. It turns out that the -mlittle-endian switch was not honored at all as we were using the wrong Kconfig symbol and failing to apply CPUFLAGS to the CFLAGS. Finally, the linker flags did not get set right. This addresses all three of those issues, which now lets me build both big-endian and little-endian kernels for testing. Fixes: 428dbf156cc5 ("arch: change default endian for microblaze") Fixes: 206d3642d8ee ("arch/microblaze: add choice for endianness and update Makefile") Signed-off-by: Arnd Bergmann --- arch/microblaze/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 830ee7d42fa0..d269dd4b8279 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile @@ -36,16 +36,21 @@ endif CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare -CPUFLAGS-$(CONFIG_BIG_ENDIAN) += -mbig-endian -CPUFLAGS-$(CONFIG_LITTLE_ENDIAN) += -mlittle-endian + +ifdef CONFIG_CPU_BIG_ENDIAN +KBUILD_CFLAGS += -mbig-endian +KBUILD_AFLAGS += -mbig-endian +LD += -EB +else +KBUILD_CFLAGS += -mlittle-endian +KBUILD_AFLAGS += -mlittle-endian +LD += -EL +endif CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) # r31 holds current when in kernel mode -KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) - -LDFLAGS := -LDFLAGS_vmlinux := +KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-y) $(CPUFLAGS-1) $(CPUFLAGS-2) head-y := arch/microblaze/kernel/head.o libs-y += arch/microblaze/lib/ From patchwork Tue Jan 2 11:47:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 123127 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8868195qgn; Tue, 2 Jan 2018 03:50:51 -0800 (PST) X-Google-Smtp-Source: ACJfBov6S6Z/bwmXksBzkGiKIMmtUVDOpMBcgV0QMwiTpE62ybr+ShlgZDJqWl1SCYDfOfq70pww X-Received: by 10.84.211.143 with SMTP id c15mr45959848pli.100.1514893851392; Tue, 02 Jan 2018 03:50:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514893851; cv=none; d=google.com; s=arc-20160816; b=Ivfq6q2RewNFzLkYqs/lsh/CXOHqnvSD13rZ801N+hbzQkb7j9yHHu5otwq4rNomSa QUz93/am64nMWbhlBQ8nXH0BuO1n/FLl95J6ZKaGUUI4sBkY15os0V2GmZyFUBJBKYDS vMj0hZGRqMKhgQ3CxPrWTa1SuOzesIgvMSuy3sQY0HjMnChQAM0P1O62DfuXWWRYjuMz oAsrdpSmMjaR7hy1Wwbrzr9OxYtLZO0Y7ORdOVVIHHTfEIsfzgXl9SjXzmym9FSRHh9/ fmxulRHhMVyY6TLREkAsXzuA3CC+9EEJpVNvcClFXvgoyFZvbhrVbNNQ9V4VHxCaghan sEzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=zjvNNH/RPksdkE3SfsnO7KXdGG+cbUgC7cAV7/eRYgA=; b=zdXctiXoMsdMGmF5gr4skTiI55KeQOxGtDgkfbxCc8qK3cfEiDVtiB2U0VwIpvnxre 0pjOAdXFFP46o8zSwfpDEZ2ZpzDHsSdBWmLYqxAizV51UtEfvnnzF7NeiUI+ErYSM4UI hDE5qX674Tpdgp0EnWqw1jymnV4z38SbgofGDM6KPeX74ntsHrg4jmxhcxHBiiUWilZZ FSFOrVBCi2PBvyz9zpC0kQZ8pzlESHAbio1UfQi4eTzbk9onLFmggAcsdymv2IkZtBmT ED6ZAlO9LE6wj6eFTiw/RkJ2wwg975NVTZWmIBi5tey8mT0RRkj6QFQ2mnMEs7CsRqPG 8vjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si31366479ply.264.2018.01.02.03.50.51; Tue, 02 Jan 2018 03:50:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345AbeABLuQ (ORCPT + 28 others); Tue, 2 Jan 2018 06:50:16 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:54330 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067AbeABLrb (ORCPT ); Tue, 2 Jan 2018 06:47:31 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lby3Y-1fFXlH1Ato-00jHVc; Tue, 02 Jan 2018 12:47:23 +0100 From: Arnd Bergmann To: Michal Simek Cc: Andrew Morton , linux-arch@vger.kernel.org, Babu Moger , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 2/2] microblaze: fix iounmap prototype Date: Tue, 2 Jan 2018 12:47:20 +0100 Message-Id: <20180102114720.3408356-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180102114720.3408356-1-arnd@arndb.de> References: <20180102114720.3408356-1-arnd@arndb.de> X-Provags-ID: V03:K0:JASaFF5gs+ayoO6GIykISDsqZ4qYG6Qym/m/epxEZyjg+TkBfO4 r4nsbz/vfKY/bHDYdUZIYi447YSDTcEFpkYVj3MKNnNcAoCM4IHPSqwRPsLNPXTVmyEPCai xmfleHSlJ6TP5tBOpj7nmWEE9Ah3PL3g5eHe0DVri5MvRMVpV2mXNwO26f+EamBnuw1nm2k HWe6hocINZleMAZM/0JuQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:cGE3hJUPVas=:KYzLf+xYdV4LfsXskbemdS lnwB3iO6e6+3RiPqQi7fS/koaWJaYQOwCF9NWVk9i72VwtCa7A7nA6gnKCkfj+domf4XRn7Fx gwQBd/Wxkmu7UhD+u2SaUEnXZob4g1MEqIY05jJMsp//yY1HedJq5eQJBZDX0N7VcucYj/KP1 ZhcW83Nn/8GHQFHvlwATYJdV4J6EYDFFnlvGdV52ReAOBD9vn2bWvoSt9exL2U+3KiURIgkJH L6XbGZ81OaHNrbFWaEeFW7EzsL8UZY+gpIbwGPQ/uheqR5Qj/xxXjQhwmb6nBe6eGa8q8wSJ4 eBekDCXJz4p1pzO+Y6HWDzTn9XKmtvaVFtiG+xV7pC72BV4VDkVL2e1JkN6E/rYwnZ1kS3gZb RBbyRbIkj/aShRGbA8Uxw6H1ZZusFcyQUmvFp7QQeTjzWKoSf9BQ5tkPs3PCyT5w3JWgj2TrT fJNwQKCQJR19W+19yE63g+A7ISiyS9kQyGd9CYfua8P/+GXHFTI0TsRSTDVnBfXe/2deidfdb lHljzHfkIR05l3DjXntI3pqbRGIbncXrQvgGd6ImxbNbocvpuV687Q7Y3IVxRNErf/nTNZB68 r2HRqFXT7PNH9ou67ZQjW+ZxERsvaGk9+MA6zytO4ZzHwZ7Y8bomkbwzb+oLdU6fFp5v34SWz 85Bf1GA1BT+onkK0+XMBSpLfAp9tr4ekBeEzOvqpz804jdcrYncJOGmLNV0BR/gn5HVXBWrVP 9E/13A+ODfOCxxNsugn7xcFg0QnJn1s/S5za43VWHRAIjgPMx6g/DMtYsXA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The missing 'volatile' keyword on the iounmap argument leads to lots of harmless warnings in an allmodconfig build: sound/pci/echoaudio/echoaudio.c:1879:10: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] Signed-off-by: Arnd Bergmann --- arch/microblaze/include/asm/io.h | 2 +- arch/microblaze/mm/pgtable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 39b6315db82e..c7968139486f 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h @@ -36,7 +36,7 @@ extern resource_size_t isa_mem_base; #ifdef CONFIG_MMU #define page_to_bus(page) (page_to_phys(page)) -extern void iounmap(void __iomem *addr); +extern void iounmap(volatile void __iomem *addr); extern void __iomem *ioremap(phys_addr_t address, unsigned long size); #define ioremap_nocache(addr, size) ioremap((addr), (size)) diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c index 4c0599239915..7f525962cdfa 100644 --- a/arch/microblaze/mm/pgtable.c +++ b/arch/microblaze/mm/pgtable.c @@ -127,7 +127,7 @@ void __iomem *ioremap(phys_addr_t addr, unsigned long size) } EXPORT_SYMBOL(ioremap); -void iounmap(void __iomem *addr) +void iounmap(volatile void __iomem *addr) { if ((__force void *)addr > high_memory && (unsigned long) addr < ioremap_bot)