mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: linux-am33-list@redhat.com
Cc: linux-kernel@vger.kernel.org,
	Akira Takeuchi <takeuchi.akr@jp.panasonic.com>,
	Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Subject: [PATCH 13/43] MN10300: Add CPU register bits for AM34
Date: Tue, 26 Oct 2010 03:54:11 +0100	[thread overview]
Message-ID: <20101026025411.23512.67442.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20101026025301.23512.24525.stgit@warthog.procyon.org.uk>

From: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>

Add CPU register declarations for the AM34 subarch.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 arch/mn10300/Kconfig                |    7 +++
 arch/mn10300/include/asm/cpu-regs.h |   72 +++++++++++++++++++++++++++++++++--
 2 files changed, 74 insertions(+), 5 deletions(-)


diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig
index 275963e..eab0c2a 100644
--- a/arch/mn10300/Kconfig
+++ b/arch/mn10300/Kconfig
@@ -17,6 +17,7 @@ config AM33_3
 
 config AM34_2
 	def_bool n
+	select MN10300_HAS_ATOMIC_OPS_UNIT
 
 config MMU
 	def_bool y
@@ -124,6 +125,12 @@ config MN10300_CPU_AM33V2
 
 endchoice
 
+config MN10300_HAS_ATOMIC_OPS_UNIT
+	def_bool n
+	help
+	  This should be enabled if the processor has an atomic ops unit
+	  capable of doing LL/SC equivalent operations.
+
 config FPU
 	bool "FPU present"
 	default y
diff --git a/arch/mn10300/include/asm/cpu-regs.h b/arch/mn10300/include/asm/cpu-regs.h
index 757e9b5..00e306c 100644
--- a/arch/mn10300/include/asm/cpu-regs.h
+++ b/arch/mn10300/include/asm/cpu-regs.h
@@ -15,7 +15,6 @@
 #include <linux/types.h>
 #endif
 
-#ifdef CONFIG_MN10300_CPU_AM33V2
 /* we tell the compiler to pretend to be AM33 so that it doesn't try and use
  * the FP regs, but tell the assembler that we're actually allowed AM33v2
  * instructions */
@@ -24,7 +23,6 @@ asm(" .am33_2\n");
 #else
 .am33_2
 #endif
-#endif
 
 #ifdef __KERNEL__
 
@@ -58,6 +56,9 @@ asm(" .am33_2\n");
 #define EPSW_nAR		0x00040000	/* register bank control */
 #define EPSW_ML			0x00080000	/* monitor level */
 #define EPSW_FE			0x00100000	/* FPU enable */
+#define EPSW_IM_SHIFT		8		/* EPSW_IM_SHIFT determines the interrupt mode */
+
+#define NUM2EPSW_IM(num)	((num) << EPSW_IM_SHIFT)
 
 /* FPU registers */
 #define FPCR_EF_I		0x00000001	/* inexact result FPU exception flag */
@@ -99,9 +100,11 @@ asm(" .am33_2\n");
 #define CPUREV			__SYSREGC(0xc0000050, u32)	/* CPU revision register */
 #define CPUREV_TYPE		0x0000000f	/* CPU type */
 #define CPUREV_TYPE_S		0
-#define CPUREV_TYPE_AM33V1	0x00000000	/* - AM33 V1 core, AM33/1.00 arch */
-#define CPUREV_TYPE_AM33V2	0x00000001	/* - AM33 V2 core, AM33/2.00 arch */
-#define CPUREV_TYPE_AM34V1	0x00000002	/* - AM34 V1 core, AM33/2.00 arch */
+#define CPUREV_TYPE_AM33_1	0x00000000	/* - AM33-1 core, AM33/1.00 arch */
+#define CPUREV_TYPE_AM33_2	0x00000001	/* - AM33-2 core, AM33/2.00 arch */
+#define CPUREV_TYPE_AM34_1	0x00000002	/* - AM34-1 core, AM33/2.00 arch */
+#define CPUREV_TYPE_AM33_3	0x00000003	/* - AM33-3 core, AM33/2.00 arch */
+#define CPUREV_TYPE_AM34_2	0x00000004	/* - AM34-2 core, AM33/3.00 arch */
 #define CPUREV_REVISION		0x000000f0	/* CPU revision */
 #define CPUREV_REVISION_S	4
 #define CPUREV_ICWAY		0x00000f00	/* number of instruction cache ways */
@@ -180,6 +183,21 @@ asm(" .am33_2\n");
 #define CHCTR_ICWMD		0x0f00		/* instruction cache way mode */
 #define CHCTR_DCWMD		0xf000		/* data cache way mode */
 
+#ifdef CONFIG_AM34_2
+#define ICIVCR			__SYSREG(0xc0000c00, u32)	/* icache area invalidate control */
+#define ICIVCR_ICIVBSY		0x00000008			/* icache area invalidate busy */
+#define ICIVCR_ICI		0x00000001			/* icache area invalidate */
+
+#define ICIVMR			__SYSREG(0xc0000c04, u32)	/* icache area invalidate mask */
+
+#define	DCPGCR			__SYSREG(0xc0000c10, u32)	/* data cache area purge control */
+#define	DCPGCR_DCPGBSY		0x00000008			/* data cache area purge busy */
+#define	DCPGCR_DCP		0x00000002			/* data cache area purge */
+#define	DCPGCR_DCI		0x00000001			/* data cache area invalidate */
+
+#define	DCPGMR			__SYSREG(0xc0000c14, u32)	/* data cache area purge mask */
+#endif /* CONFIG_AM34_2 */
+
 /* MMU control registers */
 #define MMUCTR			__SYSREG(0xc0000090, u32)	/* MMU control register */
 #define MMUCTR_IRP		0x0000003f	/* instruction TLB replace pointer */
@@ -203,6 +221,9 @@ asm(" .am33_2\n");
 #define MMUCTR_DTL_LOCK0_3	0x03000000	/* - entry 0-3 locked */
 #define MMUCTR_DTL_LOCK0_7	0x04000000	/* - entry 0-7 locked */
 #define MMUCTR_DTL_LOCK0_15	0x05000000	/* - entry 0-15 locked */
+#ifdef CONFIG_AM34_2
+#define MMUCTR_WTE		0x80000000	/* write-through cache TLB entry bit enable */
+#endif
 
 #define PIDR			__SYSREG(0xc0000094, u16)	/* PID register */
 #define PIDR_PID		0x00ff		/* process identifier */
@@ -285,6 +306,47 @@ asm(" .am33_2\n");
 #define MMUFCR_xFC_PR_RWK_RWU	0x01c0		/* - R/W kernel and R/W user */
 #define MMUFCR_xFC_ILLADDR	0x0200		/* illegal address excep flag */
 
+#ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT
+/* atomic operation registers */
+#define AAR		__SYSREG(0xc0000a00, u32)	/* cacheable address */
+#define AAR2		__SYSREG(0xc0000a04, u32)	/* uncacheable address */
+#define ADR		__SYSREG(0xc0000a08, u32)	/* data */
+#define ASR		__SYSREG(0xc0000a0c, u32)	/* status */
+#define AARU		__SYSREG(0xd400aa00, u32)	/* user address */
+#define ADRU		__SYSREG(0xd400aa08, u32)	/* user data */
+#define ASRU		__SYSREG(0xd400aa0c, u32)	/* user status */
+
+#define ASR_RW		0x00000008	/* read */
+#define ASR_BW		0x00000004	/* bus error */
+#define ASR_IW		0x00000002	/* interrupt */
+#define ASR_LW		0x00000001	/* bus lock */
+
+#define ASRU_RW		ASR_RW		/* read */
+#define ASRU_BW		ASR_BW		/* bus error */
+#define ASRU_IW		ASR_IW		/* interrupt */
+#define ASRU_LW		ASR_LW		/* bus lock */
+
+/* in inline ASM, we stick the base pointer in to a reg and use offsets from
+ * it */
+#define ATOMIC_OPS_BASE_ADDR 0xc0000a00
+#ifndef __ASSEMBLY__
+asm(
+	"_AAR	= 0\n"
+	"_AAR2	= 4\n"
+	"_ADR	= 8\n"
+	"_ASR	= 12\n");
+#else
+#define _AAR		0
+#define _AAR2		4
+#define _ADR		8
+#define _ASR		12
+#endif
+
+/* physical page address for userspace atomic operations registers */
+#define USER_ATOMIC_OPS_PAGE_ADDR  0xd400a000
+
+#endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_CPU_REGS_H */


  parent reply	other threads:[~2010-10-26  2:54 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26  2:53 [PATCH 00/43] MN10300: Add SMP support and AM34 CPU core support David Howells
2010-10-26  2:53 ` [PATCH 01/43] Partially revert patch that encloses asm-offset.h numbers in brackets David Howells
2010-10-26  2:53 ` [PATCH 02/43] MN10300: BUG to BUG_ON changes David Howells
2010-10-26  2:53 ` [PATCH 03/43] bitops: Change the bitmap index from int to unsigned long [mn10300] David Howells
2010-10-26  2:53 ` [PATCH 04/43] mn10300: Use pci_claim_resource David Howells
2010-10-26  2:53 ` [PATCH 05/43] MN10300: Prevent cnt32_to_63() from being preempted in sched_clock() David Howells
2010-10-26  2:53 ` [PATCH 06/43] Typedef SMP call function pointer David Howells
2010-10-26  2:53 ` [PATCH 07/43] MN10300: Don't cast away the volatile in test_bit() David Howells
2010-10-26  2:53 ` [PATCH 08/43] MN10300: Add reads[bwl]() and writes[bwl]() David Howells
2010-10-26  2:53 ` [PATCH 09/43] MN10300: Provide the functions to fully disable maskable interrupts David Howells
2010-10-26  2:53 ` [PATCH 10/43] MN10300: Differentiate AM33_2 and AM33_3 in config David Howells
2010-10-26  2:54 ` [PATCH 11/43] MN10300: Move DMA engine control reg defs to MN103E010 processor directory David Howells
2010-10-26  2:54 ` [PATCH 12/43] MN10300: Don't hard code the cacheline size in register defs David Howells
2010-10-26  2:54 ` David Howells [this message]
2010-10-26  2:54 ` [PATCH 14/43] MN10300: Remove monitor/JTAG functions David Howells
2010-10-26  2:54 ` [PATCH 15/43] MN10300: Cache: Split cache bits out of arch Kconfig David Howells
2010-10-26  2:54 ` [PATCH 16/43] MN10300: Provide a MN10300_CACHE_ENABLED config option David Howells
2010-10-26  2:54 ` [PATCH 17/43] MN10300: Reorder asm/cacheflush.h to put primitives first David Howells
2010-10-26  2:54 ` [PATCH 18/43] MN10300: AM34: The current cacheflush routines operate by controlling tag regs David Howells
2010-10-26  2:54 ` [PATCH 19/43] MN10300: Cacheflush functions should take unsigned long addresses David Howells
2010-10-26  2:54 ` [PATCH 20/43] MN10300: SMP: Differentiate local cache flushing David Howells
2010-10-26  2:54 ` [PATCH 21/43] MN10300: AM34: Add cacheflushing by using the AM34 purge registers David Howells
2010-10-26  2:54 ` [PATCH 22/43] MN10300: Allow some cacheflushes to be avoided if cache snooping is available David Howells
2010-10-26  2:55 ` [PATCH 23/43] MN10300: Cache: Implement SMP global cache flushing David Howells
2010-10-26  2:55 ` [PATCH 24/43] MN10300: Make the boot wrapper able to use writeback caching David Howells
2010-10-26  2:55 ` [PATCH 25/43] MN10300: AM34 erratum requires MMUCTR read and write on exception entry David Howells
2010-10-26  2:55 ` [PATCH 26/43] MN10300: Rename __flush_tlb*() to local_flush_tlb*() David Howells
2010-10-26  2:55 ` [PATCH 27/43] MN10300: Make the use of PIDR to mark TLB entries controllable David Howells
2010-10-26  2:55 ` [PATCH 28/43] MN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control David Howells
2010-10-26  2:55 ` [PATCH 29/43] MN10300: SMP TLB flushing David Howells
2010-10-26  2:55 ` [PATCH 30/43] MN10300: Make the FPU operate in non-lazy mode under SMP David Howells
2010-10-26  2:55 ` [PATCH 31/43] MN10300: Implement atomic ops using atomic ops unit David Howells
2010-10-26  2:55 ` [PATCH 32/43] MN10300: Optimise do_csum() David Howells
2010-10-26  2:55 ` [PATCH 33/43] MN10300: Make various interrupt priority settings configurable David Howells
2010-10-26  2:56 ` [PATCH 34/43] MN10300: Delete idle_timestamp from irq_cpustat_t David Howells
2010-10-26  2:56 ` [PATCH 35/43] MN10300: And Panasonic AM34 subarch and implement SMP David Howells
2010-10-27 13:31   ` [Linux-am33-list] " Suzuki Takashi
2010-10-27 14:33   ` David Howells
2010-10-26  2:56 ` [PATCH 36/43] MN10300: ASB2364: Add support for SMSC911X and SMC911X David Howells
2010-10-26  2:56 ` [PATCH 37/43] MN10300: Map userspace atomic op regs as a vmalloc page David Howells
2010-10-26  2:56 ` [PATCH 38/43] MN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support David Howells
2010-10-26  2:56 ` [PATCH 39/43] MN10300: Generic time support David Howells
2010-10-26  2:56 ` [PATCH 40/43] MN10300: Update the ASB2303 defconfig David Howells
2010-10-26  2:56 ` [PATCH 41/43] MN10300: Create a defconfig for the ASB2364 board David Howells
2010-10-26  2:56 ` [PATCH 42/43] MN10300: Change "Matsushita" to "Panasonic" David Howells
2010-10-26  2:56 ` [PATCH 43/43] MN10300: Save frame pointer in thread_info struct rather than global var David Howells
2010-10-26  3:07 ` [PATCH 00/43] MN10300: Add SMP support and AM34 CPU core support David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101026025411.23512.67442.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-am33-list@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=owada.kiyoshi@jp.panasonic.com \
    --cc=takeuchi.akr@jp.panasonic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®