xtensa: nommu: provide correct KIO addresses
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 24 Sep 2015 20:36:45 +0000 (23:36 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 2 Nov 2015 15:03:02 +0000 (18:03 +0300)
KIO region location is different for noMMU cores. Provide different
default physical address and make KIO virtual address equal to physical.

Move xtensa_get_kio_paddr function close to XCHAL_KIO_PADDR definition
and define it not only for MMUv3, but for all MMU options except MMUv2.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/include/asm/io.h
arch/xtensa/include/asm/vectors.h
arch/xtensa/kernel/setup.c

index 867840f5400f4d2d584505682bf089c7cfe694cc..74fed0b4e2c2b58a84bd0bbc699d7bca74f422de 100644 (file)
 
 #ifdef CONFIG_MMU
 
-#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
-extern unsigned long xtensa_kio_paddr;
-
-static inline unsigned long xtensa_get_kio_paddr(void)
-{
-       return xtensa_kio_paddr;
-}
-#endif
-
 /*
  * Return the virtual address for the specified bus memory.
  * Note that we currently don't support any address outside the KIO segment.
index a46c53f3611336bd2367f675ea0dba9943f66c3e..e34eaecc9f3d73edf78a697587e40f715f61ab97 100644 (file)
 #include <variant/core.h>
 #include <platform/hardware.h>
 
+#if XCHAL_HAVE_PTP_MMU
 #define XCHAL_KIO_CACHED_VADDR         0xe0000000
 #define XCHAL_KIO_BYPASS_VADDR         0xf0000000
 #define XCHAL_KIO_DEFAULT_PADDR                0xf0000000
+#else
+#define XCHAL_KIO_BYPASS_VADDR         XCHAL_KIO_PADDR
+#define XCHAL_KIO_DEFAULT_PADDR                0x90000000
+#endif
 #define XCHAL_KIO_SIZE                 0x10000000
 
-#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
+#if (!XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY) && defined(CONFIG_OF)
 #define XCHAL_KIO_PADDR                        xtensa_get_kio_paddr()
+#ifndef __ASSEMBLY__
+extern unsigned long xtensa_kio_paddr;
+
+static inline unsigned long xtensa_get_kio_paddr(void)
+{
+       return xtensa_kio_paddr;
+}
+#endif
 #else
 #define XCHAL_KIO_PADDR                        XCHAL_KIO_DEFAULT_PADDR
 #endif
index 28fc57ef5b8664cae500185ae705845234cd9b8a..149d372a935042a968bca44f09801dceedb447e7 100644 (file)
@@ -190,7 +190,7 @@ static int __init parse_bootparam(const bp_tag_t* tag)
 #ifdef CONFIG_OF
 bool __initdata dt_memory_scan = false;
 
-#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
+#if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY
 unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR;
 EXPORT_SYMBOL(xtensa_kio_paddr);