Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5083a63 authored by Johannes Weiner's avatar Johannes Weiner Committed by Chris Zankel
Browse files

xtensa: nommu support



Add support for !CONFIG_MMU setups.

Signed-off-by: default avatarJohannes Weiner <jw@emlix.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 7789f89a
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -65,13 +65,17 @@ extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
# define __flush_invalidate_dcache_range(p,s)	__invalidate_dcache_range(p,s)
#endif

#if (DCACHE_WAY_SIZE > PAGE_SIZE)
#if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE)
extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long);
#else
static inline void __flush_invalidate_dcache_page_alias(unsigned long virt,
							unsigned long phys) { }
#endif
#if (ICACHE_WAY_SIZE > PAGE_SIZE)
#if defined(CONFIG_MMU) && (ICACHE_WAY_SIZE > PAGE_SIZE)
extern void __invalidate_icache_page_alias(unsigned long, unsigned long);
#else
# define __invalidate_icache_page_alias(v,p)	do { } while(0)
static inline void __invalidate_icache_page_alias(unsigned long virt,
						unsigned long phys) { }
#endif

/*
+2 −1
Original line number Diff line number Diff line
@@ -44,8 +44,9 @@
 *	the value desired).
 */

#ifndef MAX_DMA_ADDRESS
#define MAX_DMA_ADDRESS		(PAGE_OFFSET + XCHAL_KIO_SIZE - 1)

#endif

/* Reserve and release a DMA channel */
extern int request_dma(unsigned int dmanr, const char * device_id);
+8 −1
Original line number Diff line number Diff line
@@ -69,21 +69,28 @@ static inline void * phys_to_virt(unsigned long address)

static inline void *ioremap(unsigned long offset, unsigned long size)
{
#ifdef CONFIG_MMU
	if (offset >= XCHAL_KIO_PADDR
	    && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
		return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);

	else
		BUG();
#else
	return (void *)offset;
#endif
}

static inline void *ioremap_nocache(unsigned long offset, unsigned long size)
{
#ifdef CONFIG_MMU
	if (offset >= XCHAL_KIO_PADDR
	    && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
		return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
	else
		BUG();
#else
	return (void *)offset;
#endif
}

static inline void iounmap(void *addr)
+5 −0
Original line number Diff line number Diff line
@@ -11,7 +11,12 @@
#ifndef _XTENSA_MMU_H
#define _XTENSA_MMU_H

#ifndef CONFIG_MMU
#include <asm/nommu.h>
#else

/* Default "unsigned long" context */
typedef unsigned long mm_context_t;

#endif /* CONFIG_MMU */
#endif	/* _XTENSA_MMU_H */
+5 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@
#ifndef _XTENSA_MMU_CONTEXT_H
#define _XTENSA_MMU_CONTEXT_H

#ifndef CONFIG_MMU
#include <asm/nommu_context.h>
#else

#include <linux/stringify.h>
#include <linux/sched.h>

@@ -133,4 +137,5 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)

}

#endif /* CONFIG_MMU */
#endif /* _XTENSA_MMU_CONTEXT_H */
Loading