diff options
Diffstat (limited to 'arch/mips/include/asm/mach-malta')
| -rw-r--r-- | arch/mips/include/asm/mach-malta/cpu-feature-overrides.h | 10 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/irq.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/kernel-entry-init.h | 103 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/mach-gt64120.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/malta-pm.h | 37 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/spaces.h | 46 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-malta/war.h | 1 | 
7 files changed, 184 insertions, 17 deletions
diff --git a/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h b/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h index 2848cea42bc..de3b66a3723 100644 --- a/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h @@ -23,8 +23,8 @@  /* #define cpu_has_watch	? */  #define cpu_has_divec		1  #define cpu_has_vce		0 -/* #define cpu_has_cache_cdex_p	? */ -/* #define cpu_has_cache_cdex_s	? */ +/* #define cpu_has_cache_cdex_p ? */ +/* #define cpu_has_cache_cdex_s ? */  /* #define cpu_has_prefetch	? */  #define cpu_has_mcheck		1  /* #define cpu_has_ejtag	? */ @@ -32,6 +32,7 @@  /* #define cpu_has_vtag_icache	? */  /* #define cpu_has_dc_aliases	? */  /* #define cpu_has_ic_fills_f_dc ? */ +#define cpu_has_clo_clz		1  #define cpu_has_nofpuex		0  /* #define cpu_has_64bits	? */  /* #define cpu_has_64bit_zero_reg ? */ @@ -49,8 +50,8 @@  /* #define cpu_has_watch	? */  #define cpu_has_divec		1  #define cpu_has_vce		0 -/* #define cpu_has_cache_cdex_p	? */ -/* #define cpu_has_cache_cdex_s	? */ +/* #define cpu_has_cache_cdex_p ? */ +/* #define cpu_has_cache_cdex_s ? */  /* #define cpu_has_prefetch	? */  #define cpu_has_mcheck		1  /* #define cpu_has_ejtag	? */ @@ -58,6 +59,7 @@  /* #define cpu_has_vtag_icache	? */  /* #define cpu_has_dc_aliases	? */  /* #define cpu_has_ic_fills_f_dc ? */ +#define cpu_has_clo_clz		1  #define cpu_has_nofpuex		0  /* #define cpu_has_64bits	? */  /* #define cpu_has_64bit_zero_reg ? */ diff --git a/arch/mips/include/asm/mach-malta/irq.h b/arch/mips/include/asm/mach-malta/irq.h index 9b9da26683c..47cfe64efbb 100644 --- a/arch/mips/include/asm/mach-malta/irq.h +++ b/arch/mips/include/asm/mach-malta/irq.h @@ -2,7 +2,7 @@  #define __ASM_MACH_MIPS_IRQ_H -#define NR_IRQS	256 +#define NR_IRQS 256  #include_next <irq.h> diff --git a/arch/mips/include/asm/mach-malta/kernel-entry-init.h b/arch/mips/include/asm/mach-malta/kernel-entry-init.h index 0b793e7bf67..77eeda77e73 100644 --- a/arch/mips/include/asm/mach-malta/kernel-entry-init.h +++ b/arch/mips/include/asm/mach-malta/kernel-entry-init.h @@ -5,27 +5,104 @@   *   * Chris Dearman (chris@mips.com)   * Copyright (C) 2007 Mips Technologies, Inc. + * Copyright (C) 2014 Imagination Technologies Ltd.   */  #ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H  #define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H +	/* +	 * Prepare segments for EVA boot: +	 * +	 * This is in case the processor boots in legacy configuration +	 * (SI_EVAReset is de-asserted and CONFIG5.K == 0) +	 * +	 * On entry, t1 is loaded with CP0_CONFIG +	 * +	 * ========================= Mappings ============================= +	 * Virtual memory           Physical memory           Mapping +	 * 0x00000000 - 0x7fffffff  0x80000000 - 0xfffffffff   MUSUK (kuseg) +	 *                          Flat 2GB physical memory +	 * +	 * 0x80000000 - 0x9fffffff  0x00000000 - 0x1ffffffff   MUSUK (kseg0) +	 * 0xa0000000 - 0xbf000000  0x00000000 - 0x1ffffffff   MUSUK (kseg1) +	 * 0xc0000000 - 0xdfffffff             -                 MK  (kseg2) +	 * 0xe0000000 - 0xffffffff             -                 MK  (kseg3) +	 * +	 * +	 * Lowmem is expanded to 2GB +	 */ +	.macro	eva_entry +	/* +	 * Get Config.K0 value and use it to program +	 * the segmentation registers +	 */ +	andi	t1, 0x7 /* CCA */ +	move	t2, t1 +	ins	t2, t1, 16, 3 +	/* SegCtl0 */ +	li      t0, ((MIPS_SEGCFG_MK << MIPS_SEGCFG_AM_SHIFT) |		\ +		(0 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) |				\ +		(((MIPS_SEGCFG_MK << MIPS_SEGCFG_AM_SHIFT) |		\ +		(0 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) << 16) +	or	t0, t2 +	mtc0	t0, $5, 2 + +	/* SegCtl1 */ +	li      t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) |	\ +		(0 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(2 << MIPS_SEGCFG_C_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) |				\ +		(((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) |		\ +		(0 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) << 16) +	ins	t0, t1, 16, 3 +	mtc0	t0, $5, 3 + +	/* SegCtl2 */ +	li	t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) |	\ +		(6 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) |				\ +		(((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) |		\ +		(4 << MIPS_SEGCFG_PA_SHIFT) |				\ +		(1 << MIPS_SEGCFG_EU_SHIFT)) << 16) +	or	t0, t2 +	mtc0	t0, $5, 4 + +	jal	mips_ihb +	mfc0    t0, $16, 5 +	li      t2, 0x40000000      /* K bit */ +	or      t0, t0, t2 +	mtc0    t0, $16, 5 +	sync +	jal	mips_ihb +	.endm +  	.macro	kernel_entry_setup -#ifdef CONFIG_MIPS_MT_SMTC -	mfc0	t0, CP0_CONFIG -	bgez	t0, 9f + +#ifdef CONFIG_EVA +	sync +	ehb + +	mfc0    t1, CP0_CONFIG +	bgez    t1, 9f  	mfc0	t0, CP0_CONFIG, 1  	bgez	t0, 9f  	mfc0	t0, CP0_CONFIG, 2  	bgez	t0, 9f  	mfc0	t0, CP0_CONFIG, 3 -	and	t0, 1<<2 -	bnez	t0, 0f +	sll     t0, t0, 6   /* SC bit */ +	bgez    t0, 9f + +	eva_entry +	b       0f  9:  	/* Assume we came from YAMON... */  	PTR_LA	v0, 0x9fc00534	/* YAMON print */  	lw	v0, (v0)  	move	a0, zero -	PTR_LA	a1, nonmt_processor +	PTR_LA  a1, nonsc_processor  	jal	v0  	PTR_LA	v0, 0x9fc00520	/* YAMON exit */ @@ -34,19 +111,25 @@  	jal	v0  1:	b	1b - +	nop  	__INITDATA -nonmt_processor: -	.asciz	"SMTC kernel requires the MT ASE to run\n" +nonsc_processor: +	.asciz  "EVA kernel requires a MIPS core with Segment Control implemented\n"  	__FINIT +#endif /* CONFIG_EVA */  0: -#endif  	.endm  /*   * Do SMP slave processor setup necessary before we can safely execute C code.   */  	.macro	smp_slave_setup +#ifdef CONFIG_EVA +	sync +	ehb +	mfc0    t1, CP0_CONFIG +	eva_entry +#endif  	.endm  #endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */ diff --git a/arch/mips/include/asm/mach-malta/mach-gt64120.h b/arch/mips/include/asm/mach-malta/mach-gt64120.h index 0f863148f3b..62a4b2889fa 100644 --- a/arch/mips/include/asm/mach-malta/mach-gt64120.h +++ b/arch/mips/include/asm/mach-malta/mach-gt64120.h @@ -1,6 +1,6 @@  /*   *  This is a direct copy of the ev96100.h file, with a global - * search and replace.  The numbers are the same. + * search and replace.	The numbers are the same.   *   *  The reason I'm duplicating this is so that the 64120/96100   * defines won't be confusing in the source code. diff --git a/arch/mips/include/asm/mach-malta/malta-pm.h b/arch/mips/include/asm/mach-malta/malta-pm.h new file mode 100644 index 00000000000..c2c2e201013 --- /dev/null +++ b/arch/mips/include/asm/mach-malta/malta-pm.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 Imagination Technologies + * Author: Paul Burton <paul.burton@imgtec.com> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation;  either version 2 of the  License, or (at your + * option) any later version. + */ + +#ifndef __ASM_MIPS_MACH_MALTA_PM_H__ +#define __ASM_MIPS_MACH_MALTA_PM_H__ + +#include <asm/mips-boards/piix4.h> + +#ifdef CONFIG_MIPS_MALTA_PM + +/** + * mips_pm_suspend - enter a suspend state + * @state: the state to enter, one of PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_* + * + * Enters a suspend state via the Malta's PIIX4. If the state to be entered + * is one which loses context (eg. SOFF) then this function will never + * return. + */ +extern int mips_pm_suspend(unsigned state); + +#else /* !CONFIG_MIPS_MALTA_PM */ + +static inline int mips_pm_suspend(unsigned state) +{ +	return -EINVAL; +} + +#endif /* !CONFIG_MIPS_MALTA_PM */ + +#endif /* __ASM_MIPS_MACH_MALTA_PM_H__ */ diff --git a/arch/mips/include/asm/mach-malta/spaces.h b/arch/mips/include/asm/mach-malta/spaces.h new file mode 100644 index 00000000000..d7e54971ec6 --- /dev/null +++ b/arch/mips/include/asm/mach-malta/spaces.h @@ -0,0 +1,46 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2014 Imagination Technologies Ltd. + */ + +#ifndef _ASM_MALTA_SPACES_H +#define _ASM_MALTA_SPACES_H + +#ifdef CONFIG_EVA + +/* + * Traditional Malta Board Memory Map for EVA + * + * 0x00000000 - 0x0fffffff: 1st RAM region, 256MB + * 0x10000000 - 0x1bffffff: GIC and CPC Control Registers + * 0x1c000000 - 0x1fffffff: I/O And Flash + * 0x20000000 - 0x7fffffff: 2nd RAM region, 1.5GB + * 0x80000000 - 0xffffffff: Physical memory aliases to 0x0 (2GB) + * + * The kernel is still located in 0x80000000(kseg0). However, + * the physical mask has been shifted to 0x80000000 which exploits the alias + * on the Malta board. As a result of which, we override the __pa_symbol + * to peform direct mapping from virtual to physical addresses. In other + * words, the 0x80000000 virtual address maps to 0x80000000 physical address + * which in turn aliases to 0x0. We do this in order to be able to use a flat + * 2GB of memory (0x80000000 - 0xffffffff) so we can avoid the I/O hole in + * 0x10000000 - 0x1fffffff. + * The last 64KB of physical memory are reserved for correct HIGHMEM + * macros arithmetics. + * + */ + +#define PAGE_OFFSET	_AC(0x0, UL) +#define PHYS_OFFSET	_AC(0x80000000, UL) +#define HIGHMEM_START	_AC(0xffff0000, UL) + +#define __pa_symbol(x)	(RELOC_HIDE((unsigned long)(x), 0)) + +#endif /* CONFIG_EVA */ + +#include <asm/mach-generic/spaces.h> + +#endif /* _ASM_MALTA_SPACES_H */ diff --git a/arch/mips/include/asm/mach-malta/war.h b/arch/mips/include/asm/mach-malta/war.h index 7c6931d5f45..d068fc411f4 100644 --- a/arch/mips/include/asm/mach-malta/war.h +++ b/arch/mips/include/asm/mach-malta/war.h @@ -17,7 +17,6 @@  #define MIPS4K_ICACHE_REFILL_WAR	1  #define MIPS_CACHE_SYNC_WAR		1  #define TX49XX_ICACHE_INDEX_INV_WAR	0 -#define RM9000_CDEX_SMP_WAR		0  #define ICACHE_REFILLS_WORKAROUND_WAR	1  #define R10000_LLSC_WAR			0  #define MIPS34K_MISSED_ITLB_WAR		0  | 
