All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
@ 2016-12-02 15:05 Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup Vladimir Murzin
                   ` (25 more replies)
  0 siblings, 26 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

With transition to MULTIPLATFORM we lost capability to build NOMMU
configurations. Maybe not a big deal, but there is still interest in
building NOMMU configuration apart from M-class cores. Basically, I'm
talking about R-class cores which shares a lot with A-class except
MMU; there was little interest to run A-class with MMU disabled (or
1:1 MMU mapping) as well.  By now it is not even possible to build
such configurations without extra patches on top. Another aspect is
that some portion of NOMMU code have been (build) untested for a
while. All these makes it even harder to involve more people in using
NOMMU and build community around that.

This series is trying to make it possible to build NOMMU
configurations. It is done in PATCH 25/25 which allows to select
ARCH_MULTIPLATFORM even for NOMMU. This is controlled with EXPERT
config option. All patches prior 25/25 is an attempt to fix build
failures for NOMMU case. I don't claim they are 100% correct, so I'm
open to suggestion how they can be done in a better way.

It was build tested with allmodconfig and defconfigs [1] with
!MMU. Additionally, I've been running randconfig, so two more patches
have been added compared to RFC v2.
I had to keep following diff on top:

diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 40a7c4a..c737124 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -65,7 +65,7 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
                 */
                register uint64_t x asm ("r2");
 
-               asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base));
+//             asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base));
                buf64[i++] = x;
        }
        i *= 8;

Not sure all cases are fixed yet, so keep running randconfig.

Patches can be pulled from Git tree:

git://linux-arm.org/linux-vm.git (branch: nommu-rfc-v3)

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>

Thanks!

Vladimir Murzin (25):
  ARM: NOMMU: define stubs for fixup
  ARM: NOMMU: define debug_ll_io_ini
  ARM: debug: allow debug_ll_addr for NOMMU
  ARM: NOMMU: define SECTION_xxx macros
  ARM: NOMMU: define dummy user structure for feroceon
  ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions
  ARM: NOMMU: relax restriction on MPU existence
  ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs
  ARM: NOMMU: fix load of CONFIG_VECTORS_BASE
  ARM: NOMMU: implement secondary_startup_arm
  ARM: move arm_heavy_mb to MMU/noMMU neutral place
  ARM: tlbflush: drop dependency on CONFIG_SMP
  ARM: sleep: allow it to be build for R-class
  ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU
  ARM: kexec: disallow kexec for NOMMU builds
  ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only
  ARM: omap: do not select HIGHMEM explicitly
  ARM: sa1100: move CPU specific copy code under its own config
  ARM: sa11x0: assabet: add dependency on MMU
  ARM: i.MX: remove map_io callback
  PCI: tegra: limit to MMU build only
  IB: add dependency on MMU
  cnic: add dependency on MMU
  scsi: bnx2i: bnx2fc: add dependency on MMU
  ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU

 arch/arm/Kconfig                      |   25 +++++++++++++++++++----
 arch/arm/include/asm/fixmap.h         |    6 ++++++
 arch/arm/include/asm/mach/map.h       |    3 +++
 arch/arm/include/asm/page.h           |    2 +-
 arch/arm/include/asm/pgtable-nommu.h  |    6 ++++++
 arch/arm/include/asm/tlbflush.h       |    2 +-
 arch/arm/kernel/Makefile              |    5 +++++
 arch/arm/kernel/debug.S               |    6 ++++--
 arch/arm/kernel/head-nommu.S          |   30 +++++++++++++++++++++++-----
 arch/arm/kernel/setup.c               |    4 ++--
 arch/arm/kernel/sleep.S               |    8 ++++----
 arch/arm/mach-imx/mach-imx1.c         |    1 -
 arch/arm/mach-omap2/Kconfig           |    1 -
 arch/arm/mach-sa1100/Kconfig          |    1 +
 arch/arm/mm/Kconfig                   |    4 ++++
 arch/arm/mm/Makefile                  |    2 +-
 arch/arm/mm/flush.c                   |   15 --------------
 arch/arm/mm/iomap.c                   |   17 ++++++++++++++++
 arch/arm/mm/nommu.c                   |   35 +++++++++++++++++++++++++++++++++
 drivers/infiniband/Kconfig            |    1 +
 drivers/net/ethernet/broadcom/Kconfig |    1 +
 drivers/pci/host/Kconfig              |    2 +-
 drivers/scsi/bnx2fc/Kconfig           |    1 +
 drivers/scsi/bnx2i/Kconfig            |    1 +
 24 files changed, 141 insertions(+), 38 deletions(-)

[1] List of errors/warnings from defconfigs:

acs5k_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
acs5k_tiny_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
am200epdkit_defconfig
aspeed_g4_defconfig
aspeed_g5_defconfig
assabet_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
/work/tools/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: no machine record defined
make: *** [vmlinux] Error 1
at91_dt_defconfig
axm55xx_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
badge4_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/badge4.c:295:24: warning: 'badge4_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc badge4_io_desc[] __initdata = {
                        ^
bcm2835_defconfig
cerfcube_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/cerf.c:137:24: warning: 'cerf_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cerf_io_desc[] __initdata = {
                        ^
clps711x_defconfig
cm_x2xx_defconfig
cm_x300_defconfig
cns3420vb_defconfig
arch/arm/mach-cns3xxx/core.c:29:24: warning: 'cns3xxx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cns3xxx_io_desc[] __initdata = {
                        ^
arch/arm/mach-cns3xxx/cns3420vb.c:230:24: warning: 'cns3420_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cns3420_io_desc[] __initdata = {
                        ^
colibri_pxa270_defconfig
colibri_pxa300_defconfig
collie_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/collie.c:403:24: warning: 'collie_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc collie_io_desc[] __initdata = {
                        ^
corgi_defconfig
davinci_all_defconfig
dove_defconfig
arch/arm/mach-dove/common.c:50:24: warning: 'dove_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dove_io_desc[] __initdata = {
                        ^
ebsa110_defconfig
arch/arm/mach-ebsa110/core.c:72:24: warning: 'ebsa110_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa110_io_desc[] __initdata = {
                        ^
efm32_defconfig
em_x270_defconfig
ep93xx_defconfig
arch/arm/mach-ep93xx/core.c:56:24: warning: 'ep93xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ep93xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-ep93xx/ts72xx.c:32:24: warning: 'ts72xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ts72xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-ep93xx/vision_ep9307.c:51:24: warning: 'vision_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vision_io_desc[] __initdata = {
                        ^
eseries_pxa_defconfig
exynos_defconfig
arch/arm/mach-exynos/exynos.c:31:24: warning: 'exynos4_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc exynos4_iodesc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
ezx_defconfig
footbridge_defconfig
arch/arm/mach-footbridge/common.c:140:24: warning: 'fb_common_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc fb_common_io_desc[] __initdata = {
                        ^
arch/arm/mach-footbridge/common.c:153:24: warning: 'ebsa285_host_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa285_host_io_desc[] __initdata = {
                        ^
h3600_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/h3xxx.c:274:24: warning: 'h3600_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc h3600_io_desc[] __initdata = {
                        ^
h5000_defconfig
hackkit_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/hackkit.c:64:24: warning: 'hackkit_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hackkit_io_desc[] __initdata = {
                        ^
hisi_defconfig
arch/arm/mach-hisi/hisilicon.c:31:24: warning: 'hi3620_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hi3620_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
imote2_defconfig
imx_v4_v5_defconfig
arch/arm/mach-imx/mm-imx21.c:33:24: warning: 'imx21_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx21_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx27.c:33:24: warning: 'imx27_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx27_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx27ads.c:381:24: warning: 'mx27ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx27ads_io_desc[] __initdata = {
                        ^
imx_v6_v7_defconfig
arch/arm/mach-imx/mm-imx3.c:119:24: warning: 'mx31_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx3.c:216:24: warning: 'mx35_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx35_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
arch/arm/mach-imx/mach-mx31ads.c:542:24: warning: 'mx31ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31ads_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx31lite.c:236:24: warning: 'mx31lite_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx31lite_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-kzm_arm11_01.c:262:24: warning: 'kzm_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc kzm_io_desc[] __initdata = {
                        ^
integrator_defconfig
iop13xx_defconfig
iop32x_defconfig
iop33x_defconfig
ixp4xx_defconfig
jornada720_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/jornada720.c:277:24: warning: 'jornada720_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc jornada720_io_desc[] __initdata = {
                        ^
keystone_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
ks8695_defconfig
arch/arm/mach-ks8695/cpu.c:37:24: warning: 'ks8695_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ks8695_io_desc[] __initdata = {
                        ^
lart_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/lart.c:115:24: warning: 'lart_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc lart_io_desc[] __initdata = {
                        ^
lpc18xx_defconfig
lpc32xx_defconfig
arch/arm/mach-lpc32xx/common.c:70:24: warning: 'lpc32xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc lpc32xx_io_desc[] __initdata = {
                        ^
lpd270_defconfig
lubbock_defconfig
magician_defconfig
mainstone_defconfig
mini2440_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c244x.c:49:24: warning: 's3c244x_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c244x_iodesc[] __initdata = {
                        ^
mmp2_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
moxart_defconfig
mps2_defconfig
multi_v4t_defconfig
arch/arm/mach-clps711x/board-dt.c:33:24: warning: 'clps711x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc clps711x_io_desc __initdata = {
                        ^
multi_v5_defconfig
arch/arm/mach-imx/mm-imx21.c:33:24: warning: 'imx21_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx21_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mm-imx27.c:33:24: warning: 'imx27_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc imx27_io_desc[] __initdata = {
                        ^
arch/arm/mach-imx/mach-mx27ads.c:381:24: warning: 'mx27ads_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc mx27ads_io_desc[] __initdata = {
                        ^
multi_v7_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
arch/arm/mach-exynos/exynos.c:31:24: warning: 'exynos4_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc exynos4_iodesc[] __initdata = {
                        ^
arch/arm/mach-hisi/hisilicon.c:31:24: warning: 'hi3620_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc hi3620_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:141:24: warning: 'omap34xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap34xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:188:24: warning: 'omapti81xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapti81xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:199:24: warning: 'omapam33xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapam33xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:216:24: warning: 'omap44xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap44xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:239:24: warning: 'omap54xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap54xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:268:24: warning: 'dra7xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dra7xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
arch/arm/mach-vt8500/vt8500.c:52:24: warning: 'vt8500_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vt8500_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear13xx.c:60:24: warning: 'spear13xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear13xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear1310.c:43:24: warning: 'spear1310_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear1310_io_desc[] __initdata = {
                        ^
mv78xx0_defconfig
mvebu_v5_defconfig
mvebu_v7_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
mxs_defconfig
neponset_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
/work/tools/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: no machine record defined
make: *** [vmlinux] Error 1
netwinder_defconfig
arch/arm/mach-footbridge/common.c:140:24: warning: 'fb_common_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc fb_common_io_desc[] __initdata = {
                        ^
arch/arm/mach-footbridge/common.c:153:24: warning: 'ebsa285_host_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc ebsa285_host_io_desc[] __initdata = {
                        ^
In file included from sound/oss/os.h:20:0,
                 from sound/oss/sound_config.h:20,
                 from sound/oss/midibuf.c:21:
sound/oss/midibuf.c: In function 'MIDIbuf_read':
./arch/arm/include/asm/uaccess.h:530:38: warning: 'tmp_data' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define __copy_to_user(to, from, n) (memcpy((void __force *)to, from, n), 0)
                                      ^
sound/oss/midibuf.c:316:16: note: 'tmp_data' was declared here
  unsigned char tmp_data;
                ^
netx_defconfig
arch/arm/mach-netx/generic.c:33:24: warning: 'netx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc netx_io_desc[] __initdata = {
                        ^
nhk8815_defconfig
arch/arm/mach-nomadik/cpu-8815.c:86:24: warning: 'cpu8815_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc cpu8815_io_desc[] __initdata = {
                        ^
nuc910_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
nuc950_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
nuc960_defconfig
arch/arm/mach-w90x900/cpu.c:45:24: warning: 'nuc900_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc nuc900_iodesc[] __initdata = {
                        ^
omap1_defconfig
omap2plus_defconfig
arch/arm/mach-omap2/io.c:71:24: warning: 'omap24xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap24xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:87:24: warning: 'omap242x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap242x_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:111:24: warning: 'omap243x_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap243x_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:141:24: warning: 'omap34xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap34xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:188:24: warning: 'omapti81xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapti81xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:199:24: warning: 'omapam33xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omapam33xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:216:24: warning: 'omap44xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap44xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:239:24: warning: 'omap54xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc omap54xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-omap2/io.c:268:24: warning: 'dra7xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc dra7xx_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
orion5x_defconfig
palmz72_defconfig
pcm027_defconfig
pleb_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
prima2_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
pxa168_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
pxa255-idp_defconfig
pxa3xx_defconfig
pxa910_defconfig
arch/arm/mach-mmp/common.c:28:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
pxa_defconfig
qcom_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
raumfeld_defconfig
realview_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
rpc_defconfig
s3c2410_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2410.c:54:24: warning: 's3c2410_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2410_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2412.c:64:24: warning: 's3c2412_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2412_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2416.c:69:24: warning: 's3c2416_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2416_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c244x.c:49:24: warning: 's3c244x_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c244x_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2443.c:50:24: warning: 's3c2443_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2443_iodesc[] __initdata = {
                        ^
s3c6400_defconfig
arch/arm/mach-s3c64xx/common.c:106:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
s5pv210_defconfig
sama5_defconfig
shannon_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
shmobile_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
simpad_defconfig
arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/simpad.c:121:24: warning: 'simpad_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc simpad_io_desc[] __initdata = {
                        ^
socfpga_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
spear13xx_defconfig
arch/arm/mach-spear/spear13xx.c:60:24: warning: 'spear13xx_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear13xx_io_desc[] __initdata = {
                        ^
arch/arm/mach-spear/spear1310.c:43:24: warning: 'spear1310_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc spear1310_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
spear3xx_defconfig
spear6xx_defconfig
spitz_defconfig
stm32_defconfig
sunxi_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
tct_hammer_defconfig
arch/arm/mach-s3c24xx/common.c:155:24: warning: 's3c_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c_iodesc[] __initdata = {
                        ^
arch/arm/mach-s3c24xx/s3c2410.c:54:24: warning: 's3c2410_iodesc' defined but not used [-Wunused-variable]
 static struct map_desc s3c2410_iodesc[] __initdata = {
                        ^
tegra_defconfig
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
trizeps4_defconfig
u300_defconfig
u8500_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
versatile_defconfig
vexpress_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)
                      ^
vf610m4_defconfig
viper_defconfig
vt8500_v6_v7_defconfig
arch/arm/mach-vt8500/vt8500.c:52:24: warning: 'vt8500_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc vt8500_io_desc[] __initdata = {
                        ^
xcep_defconfig
zeus_defconfig
zx_defconfig
arch/arm/kernel/smp.c:93:22: warning: 'get_arch_pgd' defined but not used [-Wunused-function]
 static unsigned long get_arch_pgd(pgd_t *pgd)


-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 02/25] ARM: NOMMU: define debug_ll_io_ini Vladimir Murzin
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

When build for NOMMU following errors show up:

arch/arm/kernel/patch.c: In function 'patch_map':
arch/arm/kernel/patch.c:39:2: error: implicit declaration of function 'set_fixmap' [-Werror=implicit-function-declaration]
  set_fixmap(fixmap, page_to_phys(page));
  ^
arch/arm/kernel/patch.c:41:2: error: implicit declaration of function '__fix_to_virt' [-Werror=implicit-function-declaration]
  return (void *) (__fix_to_virt(fixmap) + (uintaddr & ~PAGE_MASK));
  ^
arch/arm/kernel/patch.c: In function 'patch_unmap':
arch/arm/kernel/patch.c:47:2: error: implicit declaration of function 'clear_fixmap' [-Werror=implicit-function-declaration]
  clear_fixmap(fixmap);
  ^
cc1: some warnings being treated as errors

Fixup does not make much sense in NOMMU configurations, so provide
stub definitions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/fixmap.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h
index 5c17d2d..0bfc2e3 100644
--- a/arch/arm/include/asm/fixmap.h
+++ b/arch/arm/include/asm/fixmap.h
@@ -59,6 +59,12 @@ enum fixed_addresses {
 
 #else
 
+#define set_fixmap(idx, phys)
+#define clear_fixmap(idx)
+
+#define __fix_to_virt(x)	(x)
+#define __virt_to_fix(x)	(x)
+
 static inline void early_fixmap_init(void) { }
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 02/25] ARM: NOMMU: define debug_ll_io_ini
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 03/25] ARM: debug: allow debug_ll_addr for NOMMU Vladimir Murzin
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

We do not need to do anything in debug_ll_io_init in case of NOMMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/mach/map.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 9b7c328..6b86b9c 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -62,6 +62,8 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
 #else
 #define iotable_init(map,num)	do { } while (0)
 #define vm_reserve_area_early(a,s,c)	do { } while (0)
+#define debug_ll_io_init() do { } while (0)
+
 #endif
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 03/25] ARM: debug: allow debug_ll_addr for NOMMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 02/25] ARM: NOMMU: define debug_ll_io_ini Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 04/25] ARM: NOMMU: define SECTION_xxx macros Vladimir Murzin
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for NOMMU the following warning shows up:

arch/arm/plat-samsung/pm-debug.c: In function 's3c_pm_uart_base':
arch/arm/plat-samsung/pm-debug.c:61:2: error: implicit declaration of function 'debug_ll_addr' [-Werror=implicit-function-declaration]
  debug_ll_addr(&paddr, &vaddr);
  ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/plat-samsung/pm-debug.o] Error 1

It seems that commit a73b59c51ab2 ("ARM: compile fix for DEBUG_LL=y &&
MMU=n") unnecessary disallows debug_ll_addr from being used for !MMU
configurations. Commit message there has a error description:

arch/arm/kernel/debug.S: Assembler messages:
arch/arm/kernel/debug.S:104: Error: too many positional arguments

In fact, the root reason for that problem is likely that machine
dependent addruart macro took less parameters than debug_ll_addr was
passing. For instance, commit 0e17226f7cd2 ("ARM: SAMSUNG: Fixup
commit 4e6d488af37980d224cbf298224db6173673f362") addresses the
similar issue with the same signs.

So, debug_ll_addr has no anti-dependency on NOMMU, but still needs to
be adjusted for NOMMU case. addruart populates first two arguments
with PA and VA of UART. In case of NOMMU the second parameter doesn't
make sense - modify debug_ll_addr that PA is used where VA is
expected.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/mach/map.h |    1 +
 arch/arm/kernel/debug.S         |    6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 6b86b9c..8832dbf 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -63,6 +63,7 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
 #define iotable_init(map,num)	do { } while (0)
 #define vm_reserve_area_early(a,s,c)	do { } while (0)
 #define debug_ll_io_init() do { } while (0)
+extern void debug_ll_addr(unsigned long *paddr, unsigned long *vaddr);
 
 #endif
 
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index ea9646c..681b046 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -100,14 +100,16 @@ ENTRY(printch)
 		b	1b
 ENDPROC(printch)
 
-#ifdef CONFIG_MMU
 ENTRY(debug_ll_addr)
 		addruart r2, r3, ip
 		str	r2, [r0]
+#ifdef CONFIG_MMU
 		str	r3, [r1]
+#else
+		str	r2, [r1]
+#endif
 		ret	lr
 ENDPROC(debug_ll_addr)
-#endif
 
 #else
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 04/25] ARM: NOMMU: define SECTION_xxx macros
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (2 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 03/25] ARM: debug: allow debug_ll_addr for NOMMU Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 05/25] ARM: NOMMU: define dummy user structure for feroceon Vladimir Murzin
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

SECTION_SIZE is referenced from several places which breaks NOMMU
build:

  CC      arch/arm/kernel/setup.o
arch/arm/kernel/setup.c: In function 'reserve_crashkernel':
arch/arm/kernel/setup.c:1001:25: error: 'SECTION_SIZE' undeclared (first use in this function)
             crash_size, SECTION_SIZE);
                         ^
arch/arm/kernel/setup.c:1001:25: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [arch/arm/kernel/setup.o] Error 1
make: *** [arch/arm/kernel] Error 2

...

In file included from ./include/linux/cache.h:4:0,
                 from ./include/linux/printk.h:8,
                 from ./include/linux/kernel.h:13,
                 from arch/arm/mach-omap2/omap-secure.c:15:
arch/arm/mach-omap2/omap-secure.c: In function 'omap_secure_ram_reserve_memblock':
arch/arm/mach-omap2/omap-secure.c:65:21: error: 'SECTION_SIZE' undeclared (first use in this function)
  size = ALIGN(size, SECTION_SIZE);
                     ^
./include/uapi/linux/kernel.h:10:47: note: in definition of macro '__ALIGN_KERNEL_MASK'
 #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
                                               ^
./include/linux/kernel.h:48:22: note: in expansion of macro '__ALIGN_KERNEL'
 #define ALIGN(x, a)  __ALIGN_KERNEL((x), (a))
                      ^
arch/arm/mach-omap2/omap-secure.c:65:9: note: in expansion of macro 'ALIGN'
  size = ALIGN(size, SECTION_SIZE);
         ^
arch/arm/mach-omap2/omap-secure.c:65:21: note: each undeclared identifier is reported only once for each function it appears in
  size = ALIGN(size, SECTION_SIZE);
                     ^
./include/uapi/linux/kernel.h:10:47: note: in definition of macro '__ALIGN_KERNEL_MASK'
 #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
                                               ^
./include/linux/kernel.h:48:22: note: in expansion of macro '__ALIGN_KERNEL'
 #define ALIGN(x, a)  __ALIGN_KERNEL((x), (a))
                      ^
arch/arm/mach-omap2/omap-secure.c:65:9: note: in expansion of macro 'ALIGN'
  size = ALIGN(size, SECTION_SIZE);
         ^
make[1]: *** [arch/arm/mach-omap2/omap-secure.o] Error 1

...

In file included from arch/arm/mach-tegra/io.c:31:0:
arch/arm/mach-tegra/iomap.h:116:22: error: 'SECTION_SIZE' undeclared here (not in a function)
 #define IO_PPSB_SIZE SECTION_SIZE
                      ^
arch/arm/mach-tegra/io.c:37:13: note: in expansion of macro 'IO_PPSB_SIZE'
   .length = IO_PPSB_SIZE,
             ^
arch/arm/mach-tegra/io.c:33:24: warning: 'tegra_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc tegra_io_desc[] __initdata = {
                        ^
make[1]: *** [arch/arm/mach-tegra/io.o] Error 1
make: *** [arch/arm/mach-tegra] Error 2

Pickup defines from pgtable-2level.h to make NOMMU build happy.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/pgtable-nommu.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index add094d..9115801 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -35,6 +35,11 @@
 
 #define PGDIR_SIZE		(1UL << PGDIR_SHIFT)
 #define PGDIR_MASK		(~(PGDIR_SIZE-1))
+
+#define SECTION_SHIFT           20
+#define SECTION_SIZE            (1UL << SECTION_SHIFT)
+#define SECTION_MASK            (~(SECTION_SIZE-1))
+
 /* FIXME */
 
 #define PAGE_NONE	__pgprot(0)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 05/25] ARM: NOMMU: define dummy user structure for feroceon
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (3 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 04/25] ARM: NOMMU: define SECTION_xxx macros Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 06/25] ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions Vladimir Murzin
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for NOMMU the following link time error shows up:

arch/arm/mm/built-in.o:(.proc.info.init+0x2c): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0x60): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0x94): undefined reference to `feroceon_user_fns'
arch/arm/mm/built-in.o:(.proc.info.init+0xc8): undefined reference to `feroceon_user_fns'

Define dummy feroceon_user_fns for !MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/pgtable-nommu.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/pgtable-nommu.h b/arch/arm/include/asm/pgtable-nommu.h
index 9115801..bc1f6aa 100644
--- a/arch/arm/include/asm/pgtable-nommu.h
+++ b/arch/arm/include/asm/pgtable-nommu.h
@@ -113,6 +113,7 @@
 #define v4wt_user_fns	(0)
 #define v6_user_fns	(0)
 #define xscale_mc_user_fns (0)
+#define feroceon_user_fns (0)
 
 #endif /*__ASSEMBLY__*/
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 06/25] ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (4 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 05/25] ARM: NOMMU: define dummy user structure for feroceon Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 07/25] ARM: NOMMU: relax restriction on MPU existence Vladimir Murzin
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Define __arm_ioremap_exec and pci_ioremap* functions fallowing pattern
for other ioremap functions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/nommu.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 2740967..681cec8 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -19,6 +19,7 @@
 #include <asm/cputype.h>
 #include <asm/mpu.h>
 #include <asm/procinfo.h>
+#include <asm/mach/map.h>
 
 #include "mm.h"
 
@@ -401,3 +402,37 @@ void iounmap(volatile void __iomem *addr)
 {
 }
 EXPORT_SYMBOL(iounmap);
+
+void __iomem *
+__arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached)
+{
+	unsigned int mtype;
+
+	if (cached)
+		mtype = MT_MEMORY_RWX;
+	else
+		mtype = MT_MEMORY_RWX_NONCACHED;
+
+	return __arm_ioremap_caller(phys_addr, size, mtype,
+			__builtin_return_address(0));
+}
+
+#ifdef CONFIG_PCI
+static int pci_ioremap_mem_type = MT_DEVICE;
+
+void pci_ioremap_set_mem_type(int mem_type)
+{
+	pci_ioremap_mem_type = mem_type;
+}
+
+int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
+{
+	BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
+
+	return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
+				  PCI_IO_VIRT_BASE + offset + SZ_64K,
+				  phys_addr,
+				  MT_DEVICE);
+}
+EXPORT_SYMBOL_GPL(pci_ioremap_io);
+#endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 07/25] ARM: NOMMU: relax restriction on MPU existence
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (5 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 06/25] ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 08/25] ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs Vladimir Murzin
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

MPU is must have if we run SMP configurations (since it sets Sharable
attribute), but for UP we can progress further if MPU is not presented.

This patch changes setup_mpu to return error code which we ignore for
boot cpu and only take into account for secondaries.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 6b4eb27..7317554 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -13,6 +13,7 @@
  */
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 #include <asm/assembler.h>
 #include <asm/ptrace.h>
@@ -112,6 +113,8 @@ ENTRY(secondary_startup)
 	/* Use MPU region info supplied by __cpu_up */
 	ldr	r6, [r7]			@ get secondary_data.mpu_szr
 	bl      __setup_mpu			@ Initialize the MPU
+	teq	r0, #0
+	bne     __error_p
 #endif
 
 	badr	lr, 1f				@ return (PIC) address
@@ -201,7 +204,8 @@ ENDPROC(__after_proc_init)
  * Region 3: Normal, shared, inaccessible from PL0 to protect the vectors page
  *
  * r6: Value to be written to DRSR (and IRSR if required) for MPU_RAM_REGION
-*/
+ * r0: non zero value indicates error
+ */
 
 ENTRY(__setup_mpu)
 
@@ -209,13 +213,13 @@ ENTRY(__setup_mpu)
 	mrc	p15, 0, r0, c0, c1, 4		@ Read ID_MMFR0
 	and	r0, r0, #(MMFR0_PMSA)		@ PMSA field
 	teq	r0, #(MMFR0_PMSAv7)		@ PMSA v7
-	bne	__error_p			@ Fail: ARM_MPU on NOT v7 PMSA
+	bne	__nompu
 
 	/* Determine whether the D/I-side memory map is unified. We set the
 	 * flags here and continue to use them for the rest of this function */
 	mrc	p15, 0, r0, c0, c0, 4		@ MPUIR
 	ands	r5, r0, #MPUIR_DREGION_SZMASK	@ 0 size d region => No MPU
-	beq	__error_p			@ Fail: ARM_MPU and no MPU
+	beq	__nompu
 	tst	r0, #MPUIR_nU			@ MPUIR_nU = 0 for unified
 
 	/* Setup second region first to free up r6 */
@@ -263,6 +267,11 @@ ENTRY(__setup_mpu)
 	orr	r0, r0, #CR_M			@ Set SCTRL.M (MPU on)
 	mcr	p15, 0, r0, c1, c0, 0		@ Enable MPU
 	isb
+
+	mov	r0, #0
+	ret	lr
+__nompu:
+	mov	r0, #-ENODEV
 	ret	lr
 ENDPROC(__setup_mpu)
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 08/25] ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (6 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 07/25] ARM: NOMMU: relax restriction on MPU existence Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 09/25] ARM: NOMMU: fix load of CONFIG_VECTORS_BASE Vladimir Murzin
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for pre-ARMv7 CPUs with ARM_MPU enabled following error
shows up:

  AS      arch/arm/kernel/head-nommu.o
arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:223: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:231: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:235: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:244: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:248: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:258: Error: selected processor does not support ARM mode `isb'
arch/arm/kernel/head-nommu.S:265: Error: selected processor does not support ARM mode `isb'
make[1]: *** [arch/arm/kernel/head-nommu.o] Error 1

MPU setup code is available for ARMv7 only, but head-nommu.S is
generic, so build head-nommu.S with -march=armv7-a (and armv7-m for
M-calss to avoid "Conflicting architecture profiles M/A" link time)
flag; in case pre-ARMv7 it detects there there is no MPU is avaliable,
so it will never reach those instructions.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/Makefile |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ad325a8..6da8b04 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -84,6 +84,11 @@ endif
 obj-$(CONFIG_PARAVIRT)	+= paravirt.o
 
 head-y			:= head$(MMUEXT).o
+ifeq ($(CONFIG_CPU_V7M),y)
+AFLAGS_head-nommu.o     :=-Wa,-march=armv7-m
+else
+AFLAGS_head-nommu.o     :=-Wa,-march=armv7-a
+endif
 obj-$(CONFIG_DEBUG_LL)	+= debug.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 09/25] ARM: NOMMU: fix load of CONFIG_VECTORS_BASE
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (7 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 08/25] ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 10/25] ARM: NOMMU: implement secondary_startup_arm Vladimir Murzin
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While running randconfig with NOMMU enabled following error shows up:

arch/arm/kernel/head-nommu.S: Assembler messages:
arch/arm/kernel/head-nommu.S:265: Error: invalid constant (ffffffffffff0000) after fixup
make[1]: *** [arch/arm/kernel/head-nommu.o] Error 1

That happens because CONFIG_VECTORS_BASE it is out of range of the mov
instruction. So use ldr pseudo instruction instead and let assembler
to figure out how to deal with that.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 7317554..ae80c71 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -251,7 +251,7 @@ ENTRY(__setup_mpu)
 	set_region_nr r0, #MPU_VECTORS_REGION
 	isb
 	/* Shared, inaccessible to PL0, rw PL1 */
-	mov	r0, #CONFIG_VECTORS_BASE	@ Cover from VECTORS_BASE
+	ldr	r0, =CONFIG_VECTORS_BASE	@ Cover from VECTORS_BASE
 	ldr	r5,=(MPU_AP_PL1RW_PL0NA | MPU_RGN_NORMAL)
 	/* Writing N to bits 5:1 (RSR_SZ) --> region size 2^N+1 */
 	mov	r6, #(((2 * PAGE_SHIFT - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 10/25] ARM: NOMMU: implement secondary_startup_arm
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (8 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 09/25] ARM: NOMMU: fix load of CONFIG_VECTORS_BASE Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 11/25] ARM: move arm_heavy_mb to MMU/noMMU neutral place Vladimir Murzin
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Mediatek's and Qualcomm's platform code has reference to
secondary_startup_arm and that breaks NOMMU build.

Since head-nommu.S is common, we need to take extra care of M-class
platforms since there are no ARM instructions avaliable there. Even
though secondary_startup_arm is build it in SMP configuration only
(which is not supported by M-class) it'd be better to be on the safe
side and handle Thumb-only case there - keep in Thumb mode and fall
through to secondary_startup.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/head-nommu.S |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index ae80c71..f5bb554 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -88,7 +88,17 @@ ENTRY(stext)
 ENDPROC(stext)
 
 #ifdef CONFIG_SMP
-	.text
+#ifdef CONFIG_CPU_THUMBONLY
+	.thumb
+ENTRY(secondary_startup_arm)
+#else
+	.arm
+ENTRY(secondary_startup_arm)
+	THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
+	THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
+	THUMB(	.thumb			)	@ switch to Thumb now.
+	THUMB(1:			)
+#endif
 ENTRY(secondary_startup)
 	/*
 	 * Common entry point for secondary CPUs.
@@ -126,6 +136,7 @@ ENTRY(secondary_startup)
 	mov	fp, #0
 	b	secondary_start_kernel
 ENDPROC(secondary_startup)
+ENDPROC(secondary_startup_arm)
 
 	.type	__secondary_data, %object
 __secondary_data:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 11/25] ARM: move arm_heavy_mb to MMU/noMMU neutral place
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (9 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 10/25] ARM: NOMMU: implement secondary_startup_arm Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 12/25] ARM: tlbflush: drop dependency on CONFIG_SMP Vladimir Murzin
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

So it can be referenced from both camps.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mm/flush.c |   15 ---------------
 arch/arm/mm/iomap.c |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 3cced84..0c73969 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -21,21 +21,6 @@
 
 #include "mm.h"
 
-#ifdef CONFIG_ARM_HEAVY_MB
-void (*soc_mb)(void);
-
-void arm_heavy_mb(void)
-{
-#ifdef CONFIG_OUTER_CACHE_SYNC
-	if (outer_cache.sync)
-		outer_cache.sync();
-#endif
-	if (soc_mb)
-		soc_mb();
-}
-EXPORT_SYMBOL(arm_heavy_mb);
-#endif
-
 #ifdef CONFIG_CPU_CACHE_VIPT
 
 static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c
index 4614208..1b601db 100644
--- a/arch/arm/mm/iomap.c
+++ b/arch/arm/mm/iomap.c
@@ -9,6 +9,8 @@
 #include <linux/ioport.h>
 #include <linux/io.h>
 
+#include <asm/outercache.h>
+
 unsigned long vga_base;
 EXPORT_SYMBOL(vga_base);
 
@@ -40,3 +42,18 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 }
 EXPORT_SYMBOL(pci_iounmap);
 #endif
+
+#ifdef CONFIG_ARM_HEAVY_MB
+void (*soc_mb)(void);
+
+void arm_heavy_mb(void)
+{
+#ifdef CONFIG_OUTER_CACHE_SYNC
+	if (outer_cache.sync)
+		outer_cache.sync();
+#endif
+	if (soc_mb)
+		soc_mb();
+}
+EXPORT_SYMBOL(arm_heavy_mb);
+#endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 12/25] ARM: tlbflush: drop dependency on CONFIG_SMP
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (10 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 11/25] ARM: move arm_heavy_mb to MMU/noMMU neutral place Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 13/25] ARM: sleep: allow it to be build for R-class Vladimir Murzin
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building NOMMU and UP following errors show up:

arch/arm/mach-mvebu/pmsu.c: In function 'armada_370_xp_pmsu_idle_enter':
arch/arm/mach-mvebu/pmsu.c:291:2: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
  local_flush_tlb_all();
  ^
  CC      arch/arm/mach-omap2/control.o
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-mvebu/pmsu.o] Error 1

...

arch/arm/mach-imx/pm-imx5.c: In function 'mx5_suspend_enter':
arch/arm/mach-imx/pm-imx5.c:227:3: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
   local_flush_tlb_all();
   ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-imx/pm-imx5.o] Error 1

...

arch/arm/mach-imx/pm-imx6.c: In function 'imx6q_suspend_finish':
arch/arm/mach-imx/pm-imx6.c:354:3: error: implicit declaration of function 'local_flush_tlb_all' [-Werror=implicit-function-declaration]
   local_flush_tlb_all();
   ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-imx/pm-imx6.o] Error 1

Make local_* stuff available for UP (even though it doesn't make
sense) so build can progress.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/tlbflush.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index def9e57..d9a6e2e 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -641,7 +641,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
 
 #endif
 
-#elif defined(CONFIG_SMP)	/* !CONFIG_MMU */
+#else /* !CONFIG_MMU */
 
 #ifndef __ASSEMBLY__
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 13/25] ARM: sleep: allow it to be build for R-class
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (11 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 12/25] ARM: tlbflush: drop dependency on CONFIG_SMP Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 14/25] ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU Vladimir Murzin
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

cpu_resume_arm was guarded with CONFIG_MMU in 2678bb9fa13 (ARM: fix
EFM32 build breakage caused by cpu_resume_arm) in response to broken
build for EFM32 platform which has M-class cpu. It turned out that
this dependency on MMU is quite strict and prevent R-class from being
built.

The root cause of build breakage for M-class is that there is no ARM
instructions supported there. So instead of limiting cpu_resume_arm to
MMU only build, lets handle M-class case properly - keep in Thumb mode
and fall through to cpu_resume.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/sleep.S |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 0f6c100..41b512d 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -119,7 +119,10 @@ ENDPROC(cpu_resume_after_mmu)
 	.text
 	.align
 
-#ifdef CONFIG_MMU
+#ifdef CONFIG_CPU_THUMBONLY
+	.thumb
+ENTRY(cpu_resume_arm)
+#else
 	.arm
 ENTRY(cpu_resume_arm)
  THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
@@ -159,10 +162,7 @@ THUMB(	ldmia	r0!, {r1, r2, r3}	)
 THUMB(	mov	sp, r2			)
 THUMB(	bx	r3			)
 ENDPROC(cpu_resume)
-
-#ifdef CONFIG_MMU
 ENDPROC(cpu_resume_arm)
-#endif
 
 	.align 2
 _sleep_save_sp:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 14/25] ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (12 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 13/25] ARM: sleep: allow it to be build for R-class Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 15/25] ARM: kexec: disallow kexec for NOMMU builds Vladimir Murzin
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for NOMMU link time error shows up:

arch/arm/kernel/built-in.o: In function `setup_arch':
arch/arm/kernel/smccc-call.o:(.init.text+0xa50): undefined reference to `erratum_a15_798181_init'

It happens because erratum_a15_798181_init() lives under smp_tlb.c
which is build only for MMU configurations. So do call this function
only if build with CONFIG_MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/kernel/setup.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 34e3f3c..2254396 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -717,9 +717,9 @@ static void __init setup_processor(void)
 #endif
 #ifdef CONFIG_MMU
 	init_default_cache_policy(list->__cpu_mm_mmu_flags);
-#endif
-	erratum_a15_798181_init();
 
+	erratum_a15_798181_init();
+#endif
 	elf_hwcap_fixup();
 
 	cacheid_init();
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 15/25] ARM: kexec: disallow kexec for NOMMU builds
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (13 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 14/25] ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 16/25] ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only Vladimir Murzin
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for NOMMU the following error shows up:

kernel/built-in.o: In function `kimage_free_entry':
memremap.c:(.text+0x4dafc): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4db04): undefined reference to `arch_phys_to_idmap_offset'
kernel/built-in.o: In function `kimage_alloc_page':
memremap.c:(.text+0x4dbc0): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4dbc8): undefined reference to `arch_phys_to_idmap_offset'
memremap.c:(.text+0x4dc1c): undefined reference to `arch_phys_to_idmap_offset'

That comes from Kexec, add dependency on MMU there.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5d529f..90c91de 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2019,7 +2019,7 @@ config XIP_PHYS_ADDR
 config KEXEC
 	bool "Kexec system call (EXPERIMENTAL)"
 	depends on (!SMP || PM_SLEEP_SMP)
-	depends on !CPU_V7M
+	depends on MMU
 	select KEXEC_CORE
 	help
 	  kexec is a system call that implements the ability to shutdown your
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 16/25] ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (14 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 15/25] ARM: kexec: disallow kexec for NOMMU builds Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 17/25] ARM: omap: do not select HIGHMEM explicitly Vladimir Murzin
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Building in NOMMU configurations lead to the following splat:

warning: (ARCH_INTEGRATOR && ARCH_MULTIPLATFORM && ARCH_EP93XX) selects ARM_PATCH_PHYS_VIRT which has unmet direct dependencies (!XIP_KERNEL && MMU)

Make sure ARM_PATCH_PHYS_VIRT is selected for MMU builds only.

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 90c91de..b3fa6e9 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -380,7 +380,7 @@ config ARCH_EP93XX
 	bool "EP93xx-based"
 	select ARCH_HAS_HOLES_MEMORYMODEL
 	select ARM_AMBA
-	select ARM_PATCH_PHYS_VIRT
+	select ARM_PATCH_PHYS_VIRT if MMU
 	select ARM_VIC
 	select AUTO_ZRELADDR
 	select CLKDEV_LOOKUP
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 17/25] ARM: omap: do not select HIGHMEM explicitly
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (15 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 16/25] ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 18/25] ARM: sa1100: move CPU specific copy code under its own config Vladimir Murzin
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Explicit selection of HIGHMEM breaks NOMMU builds. It seems that
HIGHMEM is user selectable option, so probably it would be better to
let user to make a decision on this options or, at least, move it to
defconfig.

Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/Kconfig |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 0465338..daddddc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -121,7 +121,6 @@ config ARCH_OMAP2PLUS_TYPICAL
 	bool "Typical OMAP configuration"
 	default y
 	select AEABI
-	select HIGHMEM
 	select I2C
 	select I2C_OMAP
 	select MENELAUS if ARCH_OMAP2
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 18/25] ARM: sa1100: move CPU specific copy code under its own config
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (16 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 17/25] ARM: omap: do not select HIGHMEM explicitly Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 19/25] ARM: sa11x0: assabet: add dependency on MMU Vladimir Murzin
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

By now there is no way to limit sa1100 specific copy code to MMU only
builds and that leads to the following error when built for NOMMU

arch/arm/mm/copypage-v4mc.c:26:35: error: 'L_PTE_PRESENT' undeclared (first use in this function)
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                   ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c:26:51: error: 'L_PTE_YOUNG' undeclared (first use in this function)
 #define minicache_pgprot __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | \
                                                   ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c:27:7: error: 'L_PTE_MT_MINICACHE' undeclared (first use in this function)
       L_PTE_MT_MINICACHE)
       ^
./arch/arm/include/asm/page-nommu.h:41:26: note: in definition of macro '__pgprot'
 #define __pgprot(x)     (x)
                          ^
arch/arm/mm/copypage-v4mc.c:77:47: note: in expansion of macro 'minicache_pgprot'
  set_top_pte(COPYPAGE_MINICACHE, mk_pte(from, minicache_pgprot));
                                               ^
arch/arm/mm/copypage-v4mc.c: At top level:
arch/arm/mm/copypage-v4mc.c:112:8: error: variable 'v4_mc_user_fns' has initializer but incomplete type
 struct cpu_user_fns v4_mc_user_fns __initdata = {
        ^
arch/arm/mm/copypage-v4mc.c:113:2: error: unknown field 'cpu_clear_user_highpage' specified in initializer
  .cpu_clear_user_highpage = v4_mc_clear_user_highpage,
  ^
arch/arm/mm/copypage-v4mc.c:113:2: warning: excess elements in struct initializer
arch/arm/mm/copypage-v4mc.c:113:2: warning: (near initialization for 'v4_mc_user_fns')
arch/arm/mm/copypage-v4mc.c:114:2: error: unknown field 'cpu_copy_user_highpage' specified in initializer
  .cpu_copy_user_highpage = v4_mc_copy_user_highpage,
  ^
arch/arm/mm/copypage-v4mc.c:114:2: warning: excess elements in struct initializer
arch/arm/mm/copypage-v4mc.c:114:2: warning: (near initialization for 'v4_mc_user_fns')
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mm/copypage-v4mc.o] Error 1
make: *** [arch/arm/mm] Error 2

Move that code under CPU_COPY_V4MC config option which we can guard
against NOMMU configuration.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/page.h |    2 +-
 arch/arm/mm/Kconfig         |    4 ++++
 arch/arm/mm/Makefile        |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 4355f0e..6ec7bb6 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -75,7 +75,7 @@
 # endif
 #endif
 
-#ifdef CONFIG_CPU_SA1100
+#ifdef CONFIG_CPU_COPY_V4MC
 # ifdef _USER
 #  define MULTI_USER 1
 # else
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index c1799dd..6dffbe4 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -290,6 +290,7 @@ config CPU_SA1100
 	select CPU_ABRT_EV4
 	select CPU_CACHE_V4WB
 	select CPU_CACHE_VIVT
+	select CPU_COPY_V4MC if MMU
 	select CPU_CP15_MMU
 	select CPU_PABRT_LEGACY
 	select CPU_TLB_V4WB if MMU
@@ -524,6 +525,9 @@ config CPU_CACHE_V7M
 
 if MMU
 # The copy-page model
+config CPU_COPY_V4MC
+	bool
+
 config CPU_COPY_V4WT
 	bool
 
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index e869824..2ac7988 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -53,7 +53,7 @@ obj-$(CONFIG_CPU_COPY_V4WT)	+= copypage-v4wt.o
 obj-$(CONFIG_CPU_COPY_V4WB)	+= copypage-v4wb.o
 obj-$(CONFIG_CPU_COPY_FEROCEON)	+= copypage-feroceon.o
 obj-$(CONFIG_CPU_COPY_V6)	+= copypage-v6.o context.o
-obj-$(CONFIG_CPU_SA1100)	+= copypage-v4mc.o
+obj-$(CONFIG_CPU_COPY_V4MC)	+= copypage-v4mc.o
 obj-$(CONFIG_CPU_XSCALE)	+= copypage-xscale.o
 obj-$(CONFIG_CPU_XSC3)		+= copypage-xsc3.o
 obj-$(CONFIG_CPU_COPY_FA)	+= copypage-fa.o
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 19/25] ARM: sa11x0: assabet: add dependency on MMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (17 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 18/25] ARM: sa1100: move CPU specific copy code under its own config Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback Vladimir Murzin
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Building for NOMMU configuration leads to following error:

arch/arm/mach-sa1100/generic.c:350:24: warning: 'standard_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc standard_io_desc[] __initdata = {
                        ^
arch/arm/mach-sa1100/assabet.c: In function 'map_sa1100_gpio_regs':
arch/arm/mach-sa1100/assabet.c:496:38: error: 'PMD_MASK' undeclared (first use in this function)
  unsigned long phys = __PREG(GPLR) & PMD_MASK;
                                      ^
arch/arm/mach-sa1100/assabet.c:496:38: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./include/linux/list.h:7:0,
                 from ./include/linux/module.h:9,
                 from arch/arm/mach-sa1100/assabet.c:14:
./arch/arm/include/asm/pgtable-2level-hwdef.h:22:29: error: 'pmdval_t' undeclared (first use in this function)
 #define PMD_TYPE_SECT  (_AT(pmdval_t, 2) << 0)
                             ^
./include/uapi/linux/const.h:21:20: note: in definition of macro '_AT'
 #define _AT(T,X) ((T)(X))
                    ^
arch/arm/mach-sa1100/assabet.c:498:13: note: in expansion of macro 'PMD_TYPE_SECT'
  int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
             ^
arch/arm/mach-sa1100/assabet.c:503:2: error: implicit declaration of function 'flush_pmd_entry' [-Werror=implicit-function-declaration]
  flush_pmd_entry(pmd);
  ^
arch/arm/mach-sa1100/assabet.c:497:16: warning: unused variable 'virt' [-Wunused-variable]
  unsigned long virt = (unsigned long)io_p2v(phys);
                ^
arch/arm/mach-sa1100/assabet.c: At top level:
arch/arm/mach-sa1100/assabet.c:620:24: warning: 'assabet_io_desc' defined but not used [-Wunused-variable]
 static struct map_desc assabet_io_desc[] __initdata = {
                        ^
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-sa1100/assabet.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [arch/arm/mach-sa1100] Error 2
make: *** Waiting for unfinished jobs....

The code there performs the manual selection of page flags which makes
it dependant on MMU.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mach-sa1100/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index 36e3c79..af8cd56 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -4,6 +4,7 @@ menu "SA11x0 Implementations"
 
 config SA1100_ASSABET
 	bool "Assabet"
+	depends on MMU
 	select ARM_SA1110_CPUFREQ
 	help
 	  Say Y here if you are using the Intel(R) StrongARM(R) SA-1110
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (18 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 19/25] ARM: sa11x0: assabet: add dependency on MMU Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-16  1:39   ` Shawn Guo
  2016-12-02 15:05 ` [RFC v3 PATCH 21/25] PCI: tegra: limit to MMU build only Vladimir Murzin
                   ` (5 subsequent siblings)
  25 siblings, 1 reply; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

There is no need to define map_io only for debug_ll_io_init() since it
is already called in devicemaps_init() if map_io is NULL.

Apart from that, for NOMMU build debug_ll_io_init() is a nop which
leads to following error:

CC      arch/arm/mach-imx/mach-imx1.o
arch/arm/mach-imx/mach-imx1.c:40:13: error: 'debug_ll_io_init' undeclared here (not in a function)
  .map_io  = debug_ll_io_init,
             ^
make[1]: *** [arch/arm/mach-imx/mach-imx1.o] Error 1

Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/mach-imx/mach-imx1.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-imx/mach-imx1.c b/arch/arm/mach-imx/mach-imx1.c
index de5ab8d..3a8406e 100644
--- a/arch/arm/mach-imx/mach-imx1.c
+++ b/arch/arm/mach-imx/mach-imx1.c
@@ -37,7 +37,6 @@ static void __init imx1_init_irq(void)
 };
 
 DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)")
-	.map_io		= debug_ll_io_init,
 	.init_early	= imx1_init_early,
 	.init_irq	= imx1_init_irq,
 	.dt_compat	= imx1_dt_board_compat,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 21/25] PCI: tegra: limit to MMU build only
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (19 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 22/25] IB: add dependency on MMU Vladimir Murzin
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

This driver rely on MMU for virtual address space optimisations (see
comment around tegra_pcie_bus_alloc()) and breaks NOMMU build, thus
add dependency on MMU.

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 drivers/pci/host/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
index d7e7c0a..836fa02 100644
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
@@ -69,7 +69,7 @@ config PCI_IMX6
 
 config PCI_TEGRA
 	bool "NVIDIA Tegra PCIe controller"
-	depends on ARCH_TEGRA && !ARM64
+	depends on ARCH_TEGRA && !ARM64 && MMU
 	help
 	  Say Y here if you want support for the PCIe host controller found
 	  on NVIDIA Tegra SoCs.
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 22/25] IB: add dependency on MMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (20 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 21/25] PCI: tegra: limit to MMU build only Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 23/25] cnic: " Vladimir Murzin
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

While building for NOMMU several link time issues were seen:

mm/built-in.o: In function `do_mmu_notifier_register':
usercopy.c:(.text+0x34d10): undefined reference to `mm_take_all_locks'
usercopy.c:(.text+0x34d9c): undefined reference to `mm_drop_all_locks'
usercopy.c:(.text+0x34de4): undefined reference to `mm_take_all_locks'
...
ERROR: "zap_vma_ptes" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined!
ERROR: "zap_vma_ptes" [drivers/infiniband/hw/mlx4/mlx4_ib.ko] undefined!
ERROR: "can_do_mlock" [drivers/infiniband/core/ib_core.ko] undefined!
...
ERROR: "can_do_mlock" [drivers/infiniband/core/ib_core.ko] undefined!
...
ERROR: "zap_vma_ptes" [drivers/infiniband/hw/mlx4/mlx4_ib.ko] undefined!

It seems that Infiniband assumes that is it used in MMU configurations
only, so add dependency on CONFUG_MMU.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 drivers/infiniband/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index fb3fb89..5f17955 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -4,6 +4,7 @@ menuconfig INFINIBAND
 	depends on HAS_IOMEM
 	depends on NET
 	depends on INET
+	depends on MMU
 	depends on m || IPV6 != m
 	select IRQ_POLL
 	---help---
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 23/25] cnic: add dependency on MMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (21 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 22/25] IB: add dependency on MMU Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 24/25] scsi: bnx2i: bnx2fc: " Vladimir Murzin
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

CNIC selects UIO framework which has dependency on MMU, so for NOMMU
builds following warning shows up:

warning: (CNIC) selects UIO which has unmet direct dependencies (MMU)

Fix it with making CNIC dependant on MMU.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 drivers/net/ethernet/broadcom/Kconfig |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index bd8c80c..ea04b36 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -83,6 +83,7 @@ config BNX2
 config CNIC
 	tristate "QLogic CNIC support"
 	depends on PCI && (IPV6 || IPV6=n)
+	depends on MMU
 	select BNX2
 	select UIO
 	---help---
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 24/25] scsi: bnx2i: bnx2fc: add dependency on MMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (22 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 23/25] cnic: " Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-02 15:05 ` [RFC v3 PATCH 25/25] ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU Vladimir Murzin
  2016-12-10 18:16 ` [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Afzal Mohammed
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Both SCSI_BNX2_ISCSI and SCSI_BNX2X_FCOE select CNIC which it turn
select UIO. The later one is dependant on MMU, so while fixing CNIC
for NOMMU build (by adding explicit dependency on MMU) following
warning shows up:

warning: (SCSI_BNX2_ISCSI && SCSI_BNX2X_FCOE) selects CNIC which has
unmet direct dependencies (NETDEVICES && ETHERNET &&
NET_VENDOR_BROADCOM && PCI && (IPV6 || IPV6=n) && MMU)

Fix it with making SCSI_BNX2_ISCSI and SCSI_BNX2X_FCOE dependant on
MMU.

Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 drivers/scsi/bnx2fc/Kconfig |    1 +
 drivers/scsi/bnx2i/Kconfig  |    1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/scsi/bnx2fc/Kconfig b/drivers/scsi/bnx2fc/Kconfig
index d401a09..7862f72 100644
--- a/drivers/scsi/bnx2fc/Kconfig
+++ b/drivers/scsi/bnx2fc/Kconfig
@@ -1,5 +1,6 @@
 config SCSI_BNX2X_FCOE
 	tristate "QLogic FCoE offload support"
+	depends on MMU
 	depends on PCI
 	depends on (IPV6 || IPV6=n)
 	depends on LIBFC
diff --git a/drivers/scsi/bnx2i/Kconfig b/drivers/scsi/bnx2i/Kconfig
index ba30ff8..0549267 100644
--- a/drivers/scsi/bnx2i/Kconfig
+++ b/drivers/scsi/bnx2i/Kconfig
@@ -1,5 +1,6 @@
 config SCSI_BNX2_ISCSI
 	tristate "QLogic NetXtreme II iSCSI support"
+	depends on MMU
 	depends on NET
 	depends on PCI
 	depends on (IPV6 || IPV6=n)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 25/25] ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (23 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 24/25] scsi: bnx2i: bnx2fc: " Vladimir Murzin
@ 2016-12-02 15:05 ` Vladimir Murzin
  2016-12-10 18:16 ` [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Afzal Mohammed
  25 siblings, 0 replies; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-02 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

With this patch applied potentially any platform can be built in NOMMU
configurations if CONFIG_EXPERT is selected. However, there is no
guarantee that platform can successfully run such Image. So the main
motivation behind of this patch:
- bring build coverage for NOMMU configurations
- allow known working NOMMU platforms (like R-class) to be used
- pave a way to add support for single address space (aka 1:1 mapping)
  for MMU platforms, so they can be usable in NOMMU configurations

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b3fa6e9..9c90b81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -327,9 +327,9 @@ choice
 
 config ARCH_MULTIPLATFORM
 	bool "Allow multiple platforms to be selected"
-	depends on MMU
+	depends on MMU || EXPERT
 	select ARM_HAS_SG_CHAIN
-	select ARM_PATCH_PHYS_VIRT
+	select ARM_PATCH_PHYS_VIRT if MMU
 	select AUTO_ZRELADDR
 	select CLKSRC_OF
 	select COMMON_CLK
@@ -339,6 +339,23 @@ config ARCH_MULTIPLATFORM
 	select PCI_DOMAINS if PCI
 	select SPARSE_IRQ
 	select USE_OF
+	help
+	  Please, read carefully if you've selected CONFIG_MMU=n!
+
+	  Multiplatform with !MMU configuration *is not* meant that
+	  kernel built to support every platform will boot on them. It
+	  is because physical address space layouts (particularly where
+	  RAM is located) are different between platforms and there is
+	  no MMU to work that around.
+
+	  You must specify where RAM start (via DRAM_BASE config
+	  option) and appropriate size of RAM (via DRAM_SIZE config
+	  option) which are valid for the platform you are building
+	  for.
+
+	  This feature is *EXPERIMENTAL*, please, consider building
+	  with CONFIG_MMU=y unless you know what you do or want to
+	  help with testing.
 
 config ARM_SINGLE_ARMV7M
 	bool "ARMv7-M based platforms (Cortex-M0/M3/M4)"
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
                   ` (24 preceding siblings ...)
  2016-12-02 15:05 ` [RFC v3 PATCH 25/25] ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU Vladimir Murzin
@ 2016-12-10 18:16 ` Afzal Mohammed
  2016-12-10 19:19   ` Arnd Bergmann
  2016-12-10 21:15   ` Peter Korsgaard
  25 siblings, 2 replies; 38+ messages in thread
From: Afzal Mohammed @ 2016-12-10 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Dec 02, 2016 at 03:05:18PM +0000, Vladimir Murzin wrote:

> there was little interest to run A-class with MMU disabled (or
> 1:1 MMU mapping) as well.

With a few more changes, on a Cortex-A platform, Kernel reached
maximum it can proceed w/o user space help, i.e. upto,

"Kernel panic - not syncing: No working init found."

Creating user space executables suitable for Cortex-A !MMU is the
distance to reach prompt.

Seems no !MMU A-class suitable toolchains are available, the existing
!MMU toolchains available are for either M or R class. Looks like
FDPIC one's also are so (cc'ing Maxime & Mickeal in case they have
some input here).

And compiling a suitable compiler failed.

Let know if any signposts to travel the remaining distance.

PS: Version used was v2 instead of this v3 series.

Regards
afzal

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-10 18:16 ` [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Afzal Mohammed
@ 2016-12-10 19:19   ` Arnd Bergmann
  2016-12-11  6:33     ` Afzal Mohammed
  2016-12-10 21:15   ` Peter Korsgaard
  1 sibling, 1 reply; 38+ messages in thread
From: Arnd Bergmann @ 2016-12-10 19:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, December 10, 2016 11:46:39 PM CET Afzal Mohammed wrote:
> Hi,
> 
> On Fri, Dec 02, 2016 at 03:05:18PM +0000, Vladimir Murzin wrote:
> 
> > there was little interest to run A-class with MMU disabled (or
> > 1:1 MMU mapping) as well.
> 
> With a few more changes, on a Cortex-A platform, Kernel reached
> maximum it can proceed w/o user space help, i.e. upto,
> 
> "Kernel panic - not syncing: No working init found."
> 
> Creating user space executables suitable for Cortex-A !MMU is the
> distance to reach prompt.
> 
> Seems no !MMU A-class suitable toolchains are available, the existing
> !MMU toolchains available are for either M or R class. Looks like
> FDPIC one's also are so (cc'ing Maxime & Mickeal in case they have
> some input here).
> 
> And compiling a suitable compiler failed.
> 
> Let know if any signposts to travel the remaining distance.
> 
> PS: Version used was v2 instead of this v3 series.

What's wrong with the R class toolchain?

	Arnd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-10 18:16 ` [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Afzal Mohammed
  2016-12-10 19:19   ` Arnd Bergmann
@ 2016-12-10 21:15   ` Peter Korsgaard
  2016-12-11  7:01     ` Afzal Mohammed
  1 sibling, 1 reply; 38+ messages in thread
From: Peter Korsgaard @ 2016-12-10 21:15 UTC (permalink / raw)
  To: linux-arm-kernel

>>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:

Hi,

 > Creating user space executables suitable for Cortex-A !MMU is the
 > distance to reach prompt.

 > Seems no !MMU A-class suitable toolchains are available, the existing
 > !MMU toolchains available are for either M or R class. Looks like
 > FDPIC one's also are so (cc'ing Maxime & Mickeal in case they have
 > some input here).

 > And compiling a suitable compiler failed.

 > Let know if any signposts to travel the remaining distance.

You can build a toolchain and initramfs with Buildroot. Have a look at
the stm32f429 nommu config:

https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-10 19:19   ` Arnd Bergmann
@ 2016-12-11  6:33     ` Afzal Mohammed
  0 siblings, 0 replies; 38+ messages in thread
From: Afzal Mohammed @ 2016-12-11  6:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sat, Dec 10, 2016 at 08:19:19PM +0100, Arnd Bergmann wrote:
> On Saturday, December 10, 2016 11:46:39 PM CET Afzal Mohammed wrote:

> > Seems no !MMU A-class suitable toolchains are available, the existing
> > !MMU toolchains available are for either M or R class. Looks like
> > FDPIC one's also are so (cc'ing Maxime & Mickeal in case they have
> > some input here).
> > 
> > And compiling a suitable compiler failed.
> > 
> > Let know if any signposts to travel the remaining distance.

> What's wrong with the R class toolchain?

Yes, hoping that R class toochain for Linux would help here. After a
sleep, the same thing came to my mind.

The search for R class toolchains turned up baremetal ones only
(including Linaro's), but seems there are people using R class with
Linux, so the journey now is to get/create R class Linux toolchain.

Regards
afzal

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-10 21:15   ` Peter Korsgaard
@ 2016-12-11  7:01     ` Afzal Mohammed
  2016-12-11 20:01       ` Peter Korsgaard
  2016-12-13 17:10       ` Russell King - ARM Linux
  0 siblings, 2 replies; 38+ messages in thread
From: Afzal Mohammed @ 2016-12-11  7:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sat, Dec 10, 2016 at 10:15:35PM +0100, Peter Korsgaard wrote:
> >>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:

>  > Seems no !MMU A-class suitable toolchains are available, the existing
>  > !MMU toolchains available are for either M or R class. Looks like
>  > FDPIC one's also are so (cc'ing Maxime & Mickeal in case they have
>  > some input here).
> 
>  > And compiling a suitable compiler failed.
> 
>  > Let know if any signposts to travel the remaining distance.

> You can build a toolchain and initramfs with Buildroot. Have a look at
> the stm32f429 nommu config:
> 
> https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig

iiuc, it builds one for Cortex-M. i already had a file system w/
busybox compiled using a Cortex-M toolchain (stolen from
Pengutronix's OSELAS.Toolchain), which works on Cortex M4 (Vybrid
VF610 M4 core). But it does not work here, i.e. on Cortex A, seems the
above mentioned also would have the same effect. And in buildroot,
couldn't see Cortex R option in menuconfig, and selecting Cortex-A's
excludes flat binary target & presents only with ELF.

Here compiler was attempted to be built using crosstool-NG, target
selected was "arm-unknown-linux-gnueabi", and in crosstool-NG
menuconfig, MMU was deselected, upon building target got changed to
"arm-unknown-linux-uclibcgnueabi". After building binutils & pass 1
compiler, it failed while building multilib. Probably would have to
dive into toolchain details now.

Regards
afzal

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-11  7:01     ` Afzal Mohammed
@ 2016-12-11 20:01       ` Peter Korsgaard
  2016-12-12  7:07         ` mickael guene
  2016-12-12 18:15         ` Afzal Mohammed
  2016-12-13 17:10       ` Russell King - ARM Linux
  1 sibling, 2 replies; 38+ messages in thread
From: Peter Korsgaard @ 2016-12-11 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

>>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:

Hi,

 >> You can build a toolchain and initramfs with Buildroot. Have a look at
 >> the stm32f429 nommu config:
 >> 
 >> https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig

 > iiuc, it builds one for Cortex-M. i already had a file system w/
 > busybox compiled using a Cortex-M toolchain (stolen from
 > Pengutronix's OSELAS.Toolchain), which works on Cortex M4 (Vybrid
 > VF610 M4 core). But it does not work here, i.e. on Cortex A, seems the
 > above mentioned also would have the same effect.

Hmm, I'm not sure why a cortex-M toolchain wouldn't work on cortex-A, I
thought the 'M' instruction set was a pure subset of the 'A'.

 > And in buildroot, couldn't see Cortex R option in menuconfig, and
 > selecting Cortex-A's excludes flat binary target & presents only with
 > ELF.

We indeed don't have cortex-R support. I'm not aware of any cortex-R
Linux support.

When you select a cortex-A variant, then we enable MMU support by
default, but you can disable it under toolchain options (Enable MMU) and
then the flat binary option is available.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-11 20:01       ` Peter Korsgaard
@ 2016-12-12  7:07         ` mickael guene
  2016-12-12  9:28           ` Vladimir Murzin
  2016-12-12 18:15         ` Afzal Mohammed
  1 sibling, 1 reply; 38+ messages in thread
From: mickael guene @ 2016-12-12  7:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

  You can find an R toolchain here:
https://github.com/mickael-guene/fdpic_manifest/releases/download/v7-r-1.0.1/toolset-v7-r-1.0.1-0-gbdcc6a7c-armv7-r.tgz

  It's an fdpic toolset for cortex-r cpu class. gcc version is
quite old (4.7).

  Note also that generated code may crash on class A cpu due to
generation of udiv/sdiv which is optional for class A.
(cortex a15 is ok but not a9).

Hope it helps

Regards
Mickael

On 12/11/2016 09:01 PM, Peter Korsgaard wrote:
>>>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:
>
> Hi,
>
>  >> You can build a toolchain and initramfs with Buildroot. Have a look at
>  >> the stm32f429 nommu config:
>  >>
>  >> https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig
>
>  > iiuc, it builds one for Cortex-M. i already had a file system w/
>  > busybox compiled using a Cortex-M toolchain (stolen from
>  > Pengutronix's OSELAS.Toolchain), which works on Cortex M4 (Vybrid
>  > VF610 M4 core). But it does not work here, i.e. on Cortex A, seems the
>  > above mentioned also would have the same effect.
>
> Hmm, I'm not sure why a cortex-M toolchain wouldn't work on cortex-A, I
> thought the 'M' instruction set was a pure subset of the 'A'.
>
>  > And in buildroot, couldn't see Cortex R option in menuconfig, and
>  > selecting Cortex-A's excludes flat binary target & presents only with
>  > ELF.
>
> We indeed don't have cortex-R support. I'm not aware of any cortex-R
> Linux support.
>
> When you select a cortex-A variant, then we enable MMU support by
> default, but you can disable it under toolchain options (Enable MMU) and
> then the flat binary option is available.
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-12  7:07         ` mickael guene
@ 2016-12-12  9:28           ` Vladimir Murzin
  2016-12-12  9:44             ` mickael guene
  0 siblings, 1 reply; 38+ messages in thread
From: Vladimir Murzin @ 2016-12-12  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 12/12/16 07:07, mickael guene wrote:
> Hi all,
> 
>  You can find an R toolchain here:
> https://github.com/mickael-guene/fdpic_manifest/releases/download/v7-r-1.0.1/toolset-v7-r-1.0.1-0-gbdcc6a7c-armv7-r.tgz
> 
>  It's an fdpic toolset for cortex-r cpu class. gcc version is
> quite old (4.7).
> 
>  Note also that generated code may crash on class A cpu due to
> generation of udiv/sdiv which is optional for class A.
> (cortex a15 is ok but not a9).
> 
> Hope it helps

Unfortunately, it doesn't help because it depends on FDPIC Linux patches
which are out of tree and no link has been given.

M-class toolchain should just work with A-class; you don't even need to
disable MMU to try it out after d782e42 ("ARM: 8594/1: enable binfmt_flat on
systems with an MMU").

Cheers
Vladimir

> 
> Regards
> Mickael
> 
> On 12/11/2016 09:01 PM, Peter Korsgaard wrote:
>>>>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:
>>
>> Hi,
>>
>>  >> You can build a toolchain and initramfs with Buildroot. Have a look at
>>  >> the stm32f429 nommu config:
>>  >>
>>  >> https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig
>>
>>  > iiuc, it builds one for Cortex-M. i already had a file system w/
>>  > busybox compiled using a Cortex-M toolchain (stolen from
>>  > Pengutronix's OSELAS.Toolchain), which works on Cortex M4 (Vybrid
>>  > VF610 M4 core). But it does not work here, i.e. on Cortex A, seems the
>>  > above mentioned also would have the same effect.
>>
>> Hmm, I'm not sure why a cortex-M toolchain wouldn't work on cortex-A, I
>> thought the 'M' instruction set was a pure subset of the 'A'.
>>
>>  > And in buildroot, couldn't see Cortex R option in menuconfig, and
>>  > selecting Cortex-A's excludes flat binary target & presents only with
>>  > ELF.
>>
>> We indeed don't have cortex-R support. I'm not aware of any cortex-R
>> Linux support.
>>
>> When you select a cortex-A variant, then we enable MMU support by
>> default, but you can disable it under toolchain options (Enable MMU) and
>> then the flat binary option is available.
>>
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-12  9:28           ` Vladimir Murzin
@ 2016-12-12  9:44             ` mickael guene
  0 siblings, 0 replies; 38+ messages in thread
From: mickael guene @ 2016-12-12  9:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vladimir,

  At the end of https://github.com/mickael-guene/fdpic_manifest you can
find a set of patch to apply for kernel fdpic support. Unfortunately
they are quite old ... But I have done some test on May for
stm32f469-disco platform and I have attached patches against more
recent kernel.

  I also remove Maxime address since he quit st few month ago and his
address is no more valid.

Regards
Mickael

On 12/12/2016 10:28 AM, Vladimir Murzin wrote:
> Hi,
>
> On 12/12/16 07:07, mickael guene wrote:
>> Hi all,
>>
>>  You can find an R toolchain here:
>> https://github.com/mickael-guene/fdpic_manifest/releases/download/v7-r-1.0.1/toolset-v7-r-1.0.1-0-gbdcc6a7c-armv7-r.tgz
>>
>>  It's an fdpic toolset for cortex-r cpu class. gcc version is
>> quite old (4.7).
>>
>>  Note also that generated code may crash on class A cpu due to
>> generation of udiv/sdiv which is optional for class A.
>> (cortex a15 is ok but not a9).
>>
>> Hope it helps
>
> Unfortunately, it doesn't help because it depends on FDPIC Linux patches
> which are out of tree and no link has been given.
>
> M-class toolchain should just work with A-class; you don't even need to
> disable MMU to try it out after d782e42 ("ARM: 8594/1: enable binfmt_flat on
> systems with an MMU").
>
> Cheers
> Vladimir
>
>>
>> Regards
>> Mickael
>>
>> On 12/11/2016 09:01 PM, Peter Korsgaard wrote:
>>>>>>>> "Afzal" == Afzal Mohammed <afzal.mohd.ma@gmail.com> writes:
>>>
>>> Hi,
>>>
>>>  >> You can build a toolchain and initramfs with Buildroot. Have a look at
>>>  >> the stm32f429 nommu config:
>>>  >>
>>>  >> https://git.buildroot.net/buildroot/tree/configs/stm32f429_disco_defconfig
>>>
>>>  > iiuc, it builds one for Cortex-M. i already had a file system w/
>>>  > busybox compiled using a Cortex-M toolchain (stolen from
>>>  > Pengutronix's OSELAS.Toolchain), which works on Cortex M4 (Vybrid
>>>  > VF610 M4 core). But it does not work here, i.e. on Cortex A, seems the
>>>  > above mentioned also would have the same effect.
>>>
>>> Hmm, I'm not sure why a cortex-M toolchain wouldn't work on cortex-A, I
>>> thought the 'M' instruction set was a pure subset of the 'A'.
>>>
>>>  > And in buildroot, couldn't see Cortex R option in menuconfig, and
>>>  > selecting Cortex-A's excludes flat binary target & presents only with
>>>  > ELF.
>>>
>>> We indeed don't have cortex-R support. I'm not aware of any cortex-R
>>> Linux support.
>>>
>>> When you select a cortex-A variant, then we enable MMU support by
>>> default, but you can disable it under toolchain options (Enable MMU) and
>>> then the flat binary option is available.
>>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-fdpic-Add-support-for-fdpic-binaries-loading.patch
Type: text/x-patch
Size: 10273 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/39f2c4af/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-fdpic-add-support-to-return-to-thumb2-code-from-sign.patch
Type: text/x-patch
Size: 2673 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/39f2c4af/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-fdpic-Add-get_tls-syscall.patch
Type: text/x-patch
Size: 1430 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/39f2c4af/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-fdpic-Add-tls-support-for-cortex-m-cpu-family.patch
Type: text/x-patch
Size: 894 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/39f2c4af/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-fdpic-Workaround-to-fix-futex-bug-on-mmu-less.patch
Type: text/x-patch
Size: 3635 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161212/39f2c4af/attachment-0009.bin>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-11 20:01       ` Peter Korsgaard
  2016-12-12  7:07         ` mickael guene
@ 2016-12-12 18:15         ` Afzal Mohammed
  1 sibling, 0 replies; 38+ messages in thread
From: Afzal Mohammed @ 2016-12-12 18:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Dec 11, 2016 at 09:01:59PM +0100, Peter Korsgaard wrote:

> When you select a cortex-A variant, then we enable MMU support by
> default, but you can disable it under toolchain options (Enable MMU) and
> then the flat binary option is available.

Thank You Peter Korsgaard, that did the trick, able to boot to
prompt!, logs at the end.

> Hmm, I'm not sure why a cortex-M toolchain wouldn't work on cortex-A, I
> thought the 'M' instruction set was a pure subset of the 'A'.

On Mon, Dec 12, 2016 at 09:28:03AM +0000, Vladimir Murzin wrote:

> M-class toolchain should just work with A-class; you don't even need to
> disable MMU to try it out after d782e42 ("ARM: 8594/1: enable binfmt_flat on
> systems with an MMU").

Earlier, there was a nonsense done by me in not enabling flat binary
support in Kernel.

But even after that, it didn't work, dunno why, upon enabling flat
binary support in Kernel, it ended up instead with,

Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

The exit code probably refers to interrupted system call

On Mon, Dec 12, 2016 at 08:07:16AM +0100, mickael guene wrote:

>  You can find an R toolchain here:
> https://github.com/mickael-guene/fdpic_manifest/releases/download/v7-r-1.0.1/toolset-v7-r-1.0.1-0-gbdcc6a7c-armv7-r.tgz
> 
>  It's an fdpic toolset for cortex-r cpu class. gcc version is
> quite old (4.7).
> 
>  Note also that generated code may crash on class A cpu due to
> generation of udiv/sdiv which is optional for class A.
> (cortex a15 is ok but not a9).
> 
> Hope it helps

On Mon, Dec 12, 2016 at 10:44:45AM +0100, mickael guene wrote:

>  At the end of https://github.com/mickael-guene/fdpic_manifest you can
> find a set of patch to apply for kernel fdpic support. Unfortunately
> they are quite old ... But I have done some test on May for
> stm32f469-disco platform and I have attached patches against more
> recent kernel.

Thanks Mickael.

Earlier had tried syncing the repo, download was getting interrupted
frequently, though persisting on it would have fetched it fully. But
seeing the Kernel patches parallely, pushed the plan aside for the
time being as context of the changes was very much different with the
version of Kernel (4.9-rc7) used here.

But the attached patches seems can be applied w/o any/much difficulty.

As already reached the prompt, will keep note of these details, might
help later.

And Vladimir, Thanks.

Regards
afzal


[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-rc7-00026-g7a142ca8231b (afzal at debian) (gcc version 6.2.0 (GCC) ) #26 Mon Dec 12 22:32:33 IST 2016
[    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=00c50478
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: TI AM437x Industrial Development Kit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] AM437x ES1.2 (sgx neon)
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyO0,115200n8 earlyprintk
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1029196K/1048576K available (6562K kernel code, 523K rwdata, 2096K rodata, 712K init, 274K bss, 19380K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0x80000000 - 0x80001000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]       .text : 0x80008000 - 0x80670b88   (6563 kB)
[    0.000000]       .init : 0x8087e000 - 0x80930000   ( 712 kB)
[    0.000000]       .data : 0x80930000 - 0x809b2f60   ( 524 kB)
[    0.000000]        .bss : 0x809b2f60 - 0x809f7a9c   ( 275 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] OMAP clockevent source: timer1 at 32786 Hz
[    0.000259] sched_clock: 64 bits at 500MHz, resolution 2ns, wraps every 4398046511103ns
[    0.009660] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0xe6a171a037, max_idle_ns: 881590485102 ns
[    0.022315] Switching to timer-based delay loop, resolution 2ns
[    0.141364] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
[    0.152415] OMAP clocksource: 32k_counter at 32768 Hz
[    0.231362] Console: colour dummy device 80x30
[    0.236920] Calibrating delay loop (skipped), value calculated using timer frequency.. 1000.00 BogoMIPS (lpj=5000000)
[    0.249062] pid_max: default: 32768 minimum: 301
[    0.256668] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.264524] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.323801] devtmpfs: initialized
[    0.935615] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.951495] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.963940] pinctrl core: initialized pinctrl subsystem
[    1.014378] NET: Registered protocol family 16
[    2.111659] cpuidle: using governor menu
[    2.176928] omap_l3_noc 44000000.ocp: L3 debug error: target 8 mod:0 (unclearable)
[    2.186840] omap_l3_noc 44000000.ocp: L3 application error: target 8 mod:0 (unclearable)
[    2.494565] OMAP GPIO hardware version 0.1
[    2.883468] platform 53701000.des: Cannot lookup hwmod 'des'
[    2.900195] platform 48310000.rng: Cannot lookup hwmod 'rng'
[    3.046777] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    3.055998] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    3.072570] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[    3.080942] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[    4.016395] edma 49000000.edma: TI EDMA DMA engine driver
[    4.042166] V3_3D: supplied by V24_0D
[    4.056616] VDD_COREREG: supplied by V24_0D
[    4.072516] VDD_CORE: supplied by VDD_COREREG
[    4.088252] V1_8DREG: supplied by V24_0D
[    4.103897] V1_8D: supplied by V1_8DREG
[    4.118796] V1_5DREG: supplied by V24_0D
[    4.134236] V1_5D: supplied by V1_5DREG
[    4.288700] vgaarb: loaded
[    4.326444] SCSI subsystem initialized
[    4.345255] usbcore: registered new interface driver usbfs
[    4.354345] usbcore: registered new interface driver hub
[    4.362195] usbcore: registered new device driver usb
[    4.383412] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp at 44000000/l4_wkup at 44c00000/scm at 210000/pinmux at 800/i2c0_pins_default, deferring probe
[    4.400047] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp at 44000000/l4_wkup at 44c00000/scm at 210000/pinmux at 800/i2c2_pins_default, deferring probe
[    4.420788] pps_core: LinuxPPS API ver. 1 registered
[    4.426744] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    4.437776] PTP clock support registered
[    4.449669] EDAC MC: Ver: 3.0.0
[    4.507254] clocksource: Switched to clocksource arm_global_timer
[    4.891236] NET: Registered protocol family 2
[    4.920504] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    4.934239] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    4.947220] TCP: Hash tables configured (established 8192 bind 8192)
[    4.956856] UDP hash table entries: 512 (order: 1, 8192 bytes)
[    4.965035] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
[    4.976320] NET: Registered protocol family 1
[    4.988215] RPC: Registered named UNIX socket transport module.
[    4.994956] RPC: Registered udp transport module.
[    5.000656] RPC: Registered tcp transport module.
[    5.006103] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    6.371750] workingset: timestamp_bits=30 max_order=18 bucket_order=0
[    6.835038] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.888403] NFS: Registering the id_resolver key type
[    6.894459] Key type id_resolver registered
[    6.899596] Key type id_legacy registered
[    6.905432] ntfs: driver 2.1.32 [Flags: R/O].
[    6.961089] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 248)
[    6.969706] io scheduler noop registered
[    6.974328] io scheduler deadline registered
[    6.989359] io scheduler cfq registered (default)
[    7.085244] pinctrl-single 44e10800.pinmux: 199 pins at pa 44e10800 size 796
[    9.483420] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    9.593419] omap_uart 44e09000.serial: no wakeirq for uart0
[    9.600384] omap_uart 44e09000.serial: No clock speed specified: using default: 48000000
[    9.612215] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 29, base_baud = 3000000) is a OMAP UART0
[    9.623241] console [ttyO0] enabled
[    9.623241] console [ttyO0] enabled
[    9.631603] bootconsole [earlycon0] disabled
[    9.631603] bootconsole [earlycon0] disabled
[    9.657952] STMicroelectronics ASC driver initialized
[    9.703627] omap_rng 48310000.rng: _od_fail_runtime_resume: FIXME: missing hwmod/omap_dev info
[    9.714158] omap_rng 48310000.rng: Failed to runtime_get device: -19
[    9.722078] omap_rng 48310000.rng: initialization failed.
[   10.149265] brd: module loaded
[   10.379026] loop: module loaded
[   10.549954] libphy: Fixed MDIO Bus: probed
[   10.621367] CAN device driver interface
[   10.696022] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[   10.703201] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[   10.713426] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
[   10.721901] igb: Copyright (c) 2007-2014 Intel Corporation.
[   10.937883] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[   10.945298] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[   10.963397] libphy: 4a101000.mdio: probed
[   10.968744] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ9031 Gigabit PHY
[   11.002569] cpsw 4a100000.ethernet: Detected MACID = c4:be:84:cc:f8:b2
[   11.059455] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[   11.070237] usbcore: registered new interface driver pegasus
[   11.079659] usbcore: registered new interface driver asix
[   11.088196] usbcore: registered new interface driver ax88179_178a
[   11.097524] usbcore: registered new interface driver cdc_ether
[   11.107046] usbcore: registered new interface driver smsc75xx
[   11.116880] usbcore: registered new interface driver smsc95xx
[   11.125813] usbcore: registered new interface driver net1080
[   11.134794] usbcore: registered new interface driver cdc_subset
[   11.143940] usbcore: registered new interface driver zaurus
[   11.153558] usbcore: registered new interface driver cdc_ncm
[   11.224727] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.232713] ehci-pci: EHCI PCI platform driver
[   11.240224] ehci-platform: EHCI generic platform driver
[   11.256349] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[   11.264046] ohci-pci: OHCI PCI platform driver
[   11.271558] ohci-platform: OHCI generic platform driver
[   11.284180] ohci-omap3: OHCI OMAP3 driver
[   11.325702] usbcore: registered new interface driver usb-storage
[   11.400750] mousedev: PS/2 mouse device common for all mice
[   11.447930] i2c /dev entries driver
[   11.615616] sdhci: Secure Digital Host Controller Interface driver
[   11.623170] sdhci: Copyright(c) Pierre Ossman
[   11.647533] omap_hsmmc 48060000.mmc: Got CD GPIO
[   11.734930] Synopsys Designware Multimedia Card Interface Driver
[   11.764020] sdhci-pltfm: SDHCI platform and OF driver helper
[   11.812878] ledtrig-cpu: registered to indicate activity on CPUs
[   11.827153] usbcore: registered new interface driver usbhid
[   11.834026] usbhid: USB HID core driver
[   11.882277] NET: Registered protocol family 10
[   11.934153] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[   11.971848] NET: Registered protocol family 17
[   11.977629] can: controller area network core (rev 20120528 abi 9)
[   11.987031] NET: Registered protocol family 29
[   11.992658] can: raw protocol (rev 20120528)
[   11.998072] can: broadcast manager protocol (rev 20161123 t)
[   12.004962] can: netlink gateway (rev 20130117) max_hops=1
[   12.025921] Key type dns_resolver registered
[   12.035682] omap_voltage_late_init: Voltage driver support not added
[   12.048436] ThumbEE CPU extension supported.
[   12.280999] mmc0: host does not support reading read-only switch, assuming write-enable
[   12.293776] mmc0: new high speed SDHC card at address 0002
[   12.318060] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[   12.340744] mmcblk0: mmc0:0002 00000 3.66 GiB 
[   12.366577] omap_i2c 44e0b000.i2c: bus 0 rev0.12 at 400 kHz
[   12.393428]  mmcblk0: p1 p2
[   12.433995] omap_i2c 4819c000.i2c: bus 2 rev0.12 at 100 kHz
[   12.464867] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[   12.479679] hctosys: unable to open rtc device (rtc0)
[   12.564936] Freeing unused kernel memory: 712K (8087e000 - 80930000)
[   12.572725] This architecture does not have kernel memory protection.
Initializing random number generator... [   14.422674] random: dd: uninitialized urandom read (512 bytes read)
done.

Welcome to Buildroot
buildroot login: root
Jan  1 00:00:16 login[81]: root login on 'ttyO0'
~ # uname -a
Linux buildroot 4.9.0-rc7-00026-g7a142ca8231b #26 Mon Dec 12 22:32:33 IST 2016 armv7l GNU/Linux
~ # 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM
  2016-12-11  7:01     ` Afzal Mohammed
  2016-12-11 20:01       ` Peter Korsgaard
@ 2016-12-13 17:10       ` Russell King - ARM Linux
  1 sibling, 0 replies; 38+ messages in thread
From: Russell King - ARM Linux @ 2016-12-13 17:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 11, 2016 at 12:31:04PM +0530, Afzal Mohammed wrote:
> And in buildroot,
> couldn't see Cortex R option in menuconfig, and selecting Cortex-A's
> excludes flat binary target & presents only with ELF.

That's something which has changed in the kernel - you can now build
for MMUful platforms, and run flat binaries.  See commit d782e426b835
("ARM: 8594/1: enable binfmt_flat on systems with an MMU").

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback
  2016-12-02 15:05 ` [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback Vladimir Murzin
@ 2016-12-16  1:39   ` Shawn Guo
  0 siblings, 0 replies; 38+ messages in thread
From: Shawn Guo @ 2016-12-16  1:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Dec 02, 2016 at 03:05:38PM +0000, Vladimir Murzin wrote:
> There is no need to define map_io only for debug_ll_io_init() since it
> is already called in devicemaps_init() if map_io is NULL.
> 
> Apart from that, for NOMMU build debug_ll_io_init() is a nop which
> leads to following error:
> 
> CC      arch/arm/mach-imx/mach-imx1.o
> arch/arm/mach-imx/mach-imx1.c:40:13: error: 'debug_ll_io_init' undeclared here (not in a function)
>   .map_io  = debug_ll_io_init,
>              ^
> make[1]: *** [arch/arm/mach-imx/mach-imx1.o] Error 1
> 
> Cc: Alexander Shiyan <shc_work@mail.ru>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>

It looks like a cleanup which can be applied separately.

Applied, thanks.

Shawn

> ---
>  arch/arm/mach-imx/mach-imx1.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/mach-imx1.c b/arch/arm/mach-imx/mach-imx1.c
> index de5ab8d..3a8406e 100644
> --- a/arch/arm/mach-imx/mach-imx1.c
> +++ b/arch/arm/mach-imx/mach-imx1.c
> @@ -37,7 +37,6 @@ static void __init imx1_init_irq(void)
>  };
>  
>  DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)")
> -	.map_io		= debug_ll_io_init,
>  	.init_early	= imx1_init_early,
>  	.init_irq	= imx1_init_irq,
>  	.dt_compat	= imx1_dt_board_compat,
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2016-12-16  1:39 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02 15:05 [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 01/25] ARM: NOMMU: define stubs for fixup Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 02/25] ARM: NOMMU: define debug_ll_io_ini Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 03/25] ARM: debug: allow debug_ll_addr for NOMMU Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 04/25] ARM: NOMMU: define SECTION_xxx macros Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 05/25] ARM: NOMMU: define dummy user structure for feroceon Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 06/25] ARM: NOMMU: define __arm_ioremap_exec and pci_ioremap functions Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 07/25] ARM: NOMMU: relax restriction on MPU existence Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 08/25] ARM: NOMMU: fix head-nommu build for pre-ARMv7 CPUs Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 09/25] ARM: NOMMU: fix load of CONFIG_VECTORS_BASE Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 10/25] ARM: NOMMU: implement secondary_startup_arm Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 11/25] ARM: move arm_heavy_mb to MMU/noMMU neutral place Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 12/25] ARM: tlbflush: drop dependency on CONFIG_SMP Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 13/25] ARM: sleep: allow it to be build for R-class Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 14/25] ARM: setup: move call to erratum_a15_798181_init under CONFIG_MMU Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 15/25] ARM: kexec: disallow kexec for NOMMU builds Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 16/25] ARM: ep93xx: select ARM_PATCH_PHYS_VIRT for MMU builds only Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 17/25] ARM: omap: do not select HIGHMEM explicitly Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 18/25] ARM: sa1100: move CPU specific copy code under its own config Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 19/25] ARM: sa11x0: assabet: add dependency on MMU Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 20/25] ARM: i.MX: remove map_io callback Vladimir Murzin
2016-12-16  1:39   ` Shawn Guo
2016-12-02 15:05 ` [RFC v3 PATCH 21/25] PCI: tegra: limit to MMU build only Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 22/25] IB: add dependency on MMU Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 23/25] cnic: " Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 24/25] scsi: bnx2i: bnx2fc: " Vladimir Murzin
2016-12-02 15:05 ` [RFC v3 PATCH 25/25] ARM: Allow ARCH_MULTIPLATFORM to be selected for NOMMU Vladimir Murzin
2016-12-10 18:16 ` [RFC v3 PATCH 00/25] Allow NOMMU for MULTIPLATFORM Afzal Mohammed
2016-12-10 19:19   ` Arnd Bergmann
2016-12-11  6:33     ` Afzal Mohammed
2016-12-10 21:15   ` Peter Korsgaard
2016-12-11  7:01     ` Afzal Mohammed
2016-12-11 20:01       ` Peter Korsgaard
2016-12-12  7:07         ` mickael guene
2016-12-12  9:28           ` Vladimir Murzin
2016-12-12  9:44             ` mickael guene
2016-12-12 18:15         ` Afzal Mohammed
2016-12-13 17:10       ` Russell King - ARM Linux

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.