From 7f72b47cedd1efc301576ff1050ec0a26c57eb48 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 28 Apr 2009 14:13:21 +1000 Subject: m68knommu: fix system reset for ColdFire 527x family The sofwtare reset control for the 527x ColdFire family is based on the same Reset Control Unit as the 528x ColdFire family. So use the same reset code for both. Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/system_no.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/system_no.h b/arch/m68k/include/asm/system_no.h index 4496c0aa8379..5fbc96d933ce 100644 --- a/arch/m68k/include/asm/system_no.h +++ b/arch/m68k/include/asm/system_no.h @@ -264,18 +264,18 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz : /* No output */ \ : "o" (*(char *)MCF_MBAR) ); \ }) -#elif defined(CONFIG_M528x) +#elif defined(CONFIG_M528x) || defined(CONFIG_M527x) /* - * The MCF528x has a bit (SOFTRST) in memory (Reset Control Register RCR), - * that when set, resets the MCF528x. + * Most of the newer ColdFire family members have a proper RESET unit. + * Use the software reset control bit in the Reset Control Register (RCR). */ #define HARD_RESET_NOW() \ -({ \ - unsigned char volatile *reset; \ - asm("move.w #0x2700, %sr"); \ +({ \ + unsigned char volatile *reset; \ + asm("move.w #0x2700, %sr"); \ reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \ - while(1) \ - *reset |= (0x01 << 7);\ + while (1) \ + *reset |= (0x01 << 7); \ }) #elif defined(CONFIG_M523x) #define HARD_RESET_NOW() ({ \ -- cgit v1.2.3 From 293ca0f75415dd8373c716bf9755569daca7ba5d Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Tue, 28 Apr 2009 16:56:03 +1000 Subject: m68knommu: merge system reset for code ColdFire 523x family The sofwtare reset control code for the 523x ColdFire family uses the same Reset unit hardware as the 527x and 528x ColdFire parts. So they should all use the same code. Merge them. Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/system_no.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/system_no.h b/arch/m68k/include/asm/system_no.h index 5fbc96d933ce..a0a1ae8b1524 100644 --- a/arch/m68k/include/asm/system_no.h +++ b/arch/m68k/include/asm/system_no.h @@ -264,7 +264,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz : /* No output */ \ : "o" (*(char *)MCF_MBAR) ); \ }) -#elif defined(CONFIG_M528x) || defined(CONFIG_M527x) +#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) || defined(CONFIG_M527x) /* * Most of the newer ColdFire family members have a proper RESET unit. * Use the software reset control bit in the Reset Control Register (RCR). @@ -275,16 +275,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz asm("move.w #0x2700, %sr"); \ reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \ while (1) \ - *reset |= (0x01 << 7); \ -}) -#elif defined(CONFIG_M523x) -#define HARD_RESET_NOW() ({ \ - asm(" \ - movew #0x2700, %sr; \ - movel #0x01000000, %sp; \ - moveal #0x40110000, %a0; \ - moveb #0x80, (%a0); \ - "); \ + *reset |= 0x80; \ }) #elif defined(CONFIG_M520x) /* -- cgit v1.2.3 From 384feb91319766298c6358f23f54873d44c9d8cb Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 30 Apr 2009 22:03:43 +1000 Subject: m68knommu: add CPU reset code for the 532x ColdFire Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/m532xsim.h | 12 ++++++++++++ arch/m68knommu/platform/532x/config.c | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/m532xsim.h b/arch/m68k/include/asm/m532xsim.h index ce603451b55e..eb7fd4448947 100644 --- a/arch/m68k/include/asm/m532xsim.h +++ b/arch/m68k/include/asm/m532xsim.h @@ -125,6 +125,18 @@ #define ACR_CM_OFF_IMP (3<<5) #define ACR_WPROTECT (1<<2) +/********************************************************************* + * + * Reset Controller Module + * + *********************************************************************/ + +#define MCF_RCR 0xFC0A0000 +#define MCF_RSR 0xFC0A0001 + +#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ +#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ + /********************************************************************* * * Inter-IC (I2C) Module diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c index 591f2f801134..cdb761971f7a 100644 --- a/arch/m68knommu/platform/532x/config.c +++ b/arch/m68knommu/platform/532x/config.c @@ -31,8 +31,6 @@ /***************************************************************************/ -void coldfire_reset(void); - extern unsigned int mcf_timervector; extern unsigned int mcf_profilevector; extern unsigned int mcf_timerlevel; @@ -164,6 +162,14 @@ void mcf_settimericr(unsigned int timer, unsigned int level) /***************************************************************************/ +static void m532x_cpu_reset(void) +{ + local_irq_disable(); + __raw_writeb(MCF_RCR_SWRESET, MCF_RCR); +} + +/***************************************************************************/ + void __init config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); @@ -181,7 +187,7 @@ void __init config_BSP(char *commandp, int size) mcf_timervector = 64+32; mcf_profilevector = 64+33; - mach_reset = coldfire_reset; + mach_reset = m532x_cpu_reset; #ifdef CONFIG_BDM_DISABLE /* -- cgit v1.2.3 From 25ce4a908abebf8c7d2e89908d36050e1de9cbec Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 30 Apr 2009 22:39:50 +1000 Subject: m68knommu: move CPU reset code for the 520x ColdFire into its platform code Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/m520xsim.h | 9 +++++++++ arch/m68knommu/platform/520x/config.c | 15 +++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h index 49d016e6391a..83bbcfd6e8f2 100644 --- a/arch/m68k/include/asm/m520xsim.h +++ b/arch/m68k/include/asm/m520xsim.h @@ -59,5 +59,14 @@ #define MCFPIT_IMR MCFINTC_IMRL #define MCFPIT_IMR_IBIT (1 << MCFINT_PIT1) +/* + * Reset Controll Unit. + */ +#define MCF_RCR 0xFC0A0000 +#define MCF_RSR 0xFC0A0001 + +#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ +#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ + /****************************************************************************/ #endif /* m520xsim_h */ diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c index 855fc6a79d72..1c43a8aec69b 100644 --- a/arch/m68knommu/platform/520x/config.c +++ b/arch/m68knommu/platform/520x/config.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -23,10 +22,6 @@ /***************************************************************************/ -void coldfire_reset(void); - -/***************************************************************************/ - static struct mcf_platform_uart m520x_uart_platform[] = { { .mapbase = MCF_MBAR + MCFUART_BASE1, @@ -169,9 +164,17 @@ void mcf_autovector(unsigned int vec) /***************************************************************************/ +static void m520x_cpu_reset(void) +{ + local_irq_disable(); + __raw_writeb(MCF_RCR_SWRESET, MCF_RCR); +} + +/***************************************************************************/ + void __init config_BSP(char *commandp, int size) { - mach_reset = coldfire_reset; + mach_reset = m520x_cpu_reset; m520x_uarts_init(); m520x_fec_init(); } -- cgit v1.2.3 From 55b33f316d25c1ffb13a65de7f846b950b5ef5a6 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 30 Apr 2009 22:58:35 +1000 Subject: m68knommu: move CPU reset code for the 523x ColdFire into its platform code Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/m523xsim.h | 9 +++++++++ arch/m68knommu/platform/523x/config.c | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/m523xsim.h b/arch/m68k/include/asm/m523xsim.h index bf397313e93f..55183b5df1b8 100644 --- a/arch/m68k/include/asm/m523xsim.h +++ b/arch/m68k/include/asm/m523xsim.h @@ -41,5 +41,14 @@ #define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */ #define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */ +/* + * Reset Controll Unit (relative to IPSBAR). + */ +#define MCF_RCR 0x110000 +#define MCF_RSR 0x110001 + +#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ +#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ + /****************************************************************************/ #endif /* m523xsim_h */ diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c index 74133f27b30c..961fefebca14 100644 --- a/arch/m68knommu/platform/523x/config.c +++ b/arch/m68knommu/platform/523x/config.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -24,10 +23,6 @@ /***************************************************************************/ -void coldfire_reset(void); - -/***************************************************************************/ - static struct mcf_platform_uart m523x_uart_platform[] = { { .mapbase = MCF_MBAR + MCFUART_BASE1, @@ -145,13 +140,20 @@ void mcf_autovector(unsigned int vec) { /* Everything is auto-vectored on the 523x */ } +/***************************************************************************/ + +static void m523x_cpu_reset(void) +{ + local_irq_disable(); + __raw_writeb(MCF_RCR_SWRESET, MCF_IPSBAR + MCF_RCR); +} /***************************************************************************/ void __init config_BSP(char *commandp, int size) { mcf_disableall(); - mach_reset = coldfire_reset; + mach_reset = m523x_cpu_reset; m523x_uarts_init(); m523x_fec_init(); } -- cgit v1.2.3 From 4c0b008d49e728735f54419e60446480017bfe1b Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 30 Apr 2009 23:06:45 +1000 Subject: m68knommu: move CPU reset code for the 527x ColdFire into its platform code Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/m527xsim.h | 9 +++++++++ arch/m68knommu/platform/527x/config.c | 15 +++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h index 1f63ab3fb3e6..95f4f8ee8f7c 100644 --- a/arch/m68k/include/asm/m527xsim.h +++ b/arch/m68k/include/asm/m527xsim.h @@ -70,5 +70,14 @@ #define UART2_ENABLE_MASK 0x3f00 #endif +/* + * Reset Controll Unit (relative to IPSBAR). + */ +#define MCF_RCR 0x110000 +#define MCF_RSR 0x110001 + +#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ +#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ + /****************************************************************************/ #endif /* m527xsim_h */ diff --git a/arch/m68knommu/platform/527x/config.c b/arch/m68knommu/platform/527x/config.c index 428b15922ef5..f746439cfd3e 100644 --- a/arch/m68knommu/platform/527x/config.c +++ b/arch/m68knommu/platform/527x/config.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -24,10 +23,6 @@ /***************************************************************************/ -void coldfire_reset(void); - -/***************************************************************************/ - static struct mcf_platform_uart m527x_uart_platform[] = { { .mapbase = MCF_MBAR + MCFUART_BASE1, @@ -227,10 +222,18 @@ void mcf_autovector(unsigned int vec) /***************************************************************************/ +static void m527x_cpu_reset(void) +{ + local_irq_disable(); + __raw_writeb(MCF_RCR_SWRESET, MCF_IPSBAR + MCF_RCR); +} + +/***************************************************************************/ + void __init config_BSP(char *commandp, int size) { mcf_disableall(); - mach_reset = coldfire_reset; + mach_reset = m527x_cpu_reset; m527x_uarts_init(); m527x_fec_init(); } -- cgit v1.2.3 From dd65b1de553ddfd85e8fea9d3aa9db7479ccf2aa Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 30 Apr 2009 23:15:56 +1000 Subject: m68knommu: move CPU reset code for the 528x ColdFire into its platform code Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/m528xsim.h | 8 ++++++++ arch/m68knommu/platform/528x/config.c | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/m528xsim.h b/arch/m68k/include/asm/m528xsim.h index 28bf783a5d6d..d79c49f8134a 100644 --- a/arch/m68k/include/asm/m528xsim.h +++ b/arch/m68k/include/asm/m528xsim.h @@ -56,6 +56,14 @@ #define MCF5282_INTC0_ICR17 (volatile u8 *) (MCF_IPSBAR + 0x0C51) +/* + * Reset Control Unit (relative to IPSBAR). + */ +#define MCF_RCR 0x110000 +#define MCF_RSR 0x110001 + +#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ +#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ /********************************************************************* * diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c index bee526f4d1af..a1d1a61c4fe6 100644 --- a/arch/m68knommu/platform/528x/config.c +++ b/arch/m68knommu/platform/528x/config.c @@ -31,10 +31,6 @@ /***************************************************************************/ -void coldfire_reset(void); - -/***************************************************************************/ - static struct mcf_platform_uart m528x_uart_platform[] = { { .mapbase = MCF_MBAR + MCFUART_BASE1, @@ -171,6 +167,14 @@ void mcf_autovector(unsigned int vec) /***************************************************************************/ +static void m528x_cpu_reset(void) +{ + local_irq_disable(); + __raw_writeb(MCF_RCR_SWRESET, MCF_IPSBAR + MCF_RCR); +} + +/***************************************************************************/ + #ifdef CONFIG_WILDFIRE void wildfire_halt(void) { @@ -214,6 +218,7 @@ void __init config_BSP(char *commandp, int size) static int __init init_BSP(void) { + mach_reset = m528x_cpu_reset; m528x_uarts_init(); m528x_fec_init(); platform_add_devices(m528x_devices, ARRAY_SIZE(m528x_devices)); -- cgit v1.2.3 From fb29ad7949aeed3d464ba8d2c9772835f456d4c4 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 1 May 2009 16:09:17 +1000 Subject: m68knommu: remove obsolete reset code All ColdFire and non-MMU 68k code has custom reset routines. Remove the obsolete and now un-used reset macros. Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/system_no.h | 98 ------------------------------ arch/m68knommu/platform/coldfire/vectors.c | 7 --- 2 files changed, 105 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/system_no.h b/arch/m68k/include/asm/system_no.h index a0a1ae8b1524..3c0718d74398 100644 --- a/arch/m68k/include/asm/system_no.h +++ b/arch/m68k/include/asm/system_no.h @@ -203,104 +203,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz #include #endif -#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ - defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) -#define HARD_RESET_NOW() ({ \ - local_irq_disable(); \ - asm(" \ - moveal #0x10c00000, %a0; \ - moveb #0, 0xFFFFF300; \ - moveal 0(%a0), %sp; \ - moveal 4(%a0), %a0; \ - jmp (%a0); \ - "); \ -}) -#endif - -#ifdef CONFIG_COLDFIRE -#if defined(CONFIG_M5272) && defined(CONFIG_NETtel) -/* - * Need to account for broken early mask of 5272 silicon. So don't - * jump through the original start address. Jump strait into the - * known start of the FLASH code. - */ -#define HARD_RESET_NOW() ({ \ - asm(" \ - movew #0x2700, %sr; \ - jmp 0xf0000400; \ - "); \ -}) -#elif defined(CONFIG_NETtel) || \ - defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) -#define HARD_RESET_NOW() ({ \ - asm(" \ - movew #0x2700, %sr; \ - moveal #0x10000044, %a0; \ - movel #0xffffffff, (%a0); \ - moveal #0x10000001, %a0; \ - moveb #0x00, (%a0); \ - moveal #0xf0000004, %a0; \ - moveal (%a0), %a0; \ - jmp (%a0); \ - "); \ -}) -#elif defined(CONFIG_M5272) -/* - * Retrieve the boot address in flash using CSBR0 and CSOR0 - * find the reset vector at flash_address + 4 (e.g. 0x400) - * remap it in the flash's current location (e.g. 0xf0000400) - * and jump there. - */ -#define HARD_RESET_NOW() ({ \ - asm(" \ - movew #0x2700, %%sr; \ - move.l %0+0x40,%%d0; \ - and.l %0+0x44,%%d0; \ - andi.l #0xfffff000,%%d0; \ - mov.l %%d0,%%a0; \ - or.l 4(%%a0),%%d0; \ - mov.l %%d0,%%a0; \ - jmp (%%a0);" \ - : /* No output */ \ - : "o" (*(char *)MCF_MBAR) ); \ -}) -#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) || defined(CONFIG_M527x) -/* - * Most of the newer ColdFire family members have a proper RESET unit. - * Use the software reset control bit in the Reset Control Register (RCR). - */ -#define HARD_RESET_NOW() \ -({ \ - unsigned char volatile *reset; \ - asm("move.w #0x2700, %sr"); \ - reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \ - while (1) \ - *reset |= 0x80; \ -}) -#elif defined(CONFIG_M520x) - /* - * The MCF5208 has a bit (SOFTRST) in memory (Reset Control Register - * RCR), that when set, resets the MCF5208. - */ -#define HARD_RESET_NOW() \ -({ \ - unsigned char volatile *reset; \ - asm("move.w #0x2700, %sr"); \ - reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000)); \ - while(1) \ - *reset |= 0x80; \ -}) -#else -#define HARD_RESET_NOW() ({ \ - asm(" \ - movew #0x2700, %sr; \ - moveal #0x4, %a0; \ - moveal (%a0), %a0; \ - jmp (%a0); \ - "); \ -}) -#endif -#endif #define arch_align_stack(x) (x) diff --git a/arch/m68knommu/platform/coldfire/vectors.c b/arch/m68knommu/platform/coldfire/vectors.c index 6cf894620234..bdca0297fa9a 100644 --- a/arch/m68knommu/platform/coldfire/vectors.c +++ b/arch/m68knommu/platform/coldfire/vectors.c @@ -96,10 +96,3 @@ void ack_vector(unsigned int irq) } /***************************************************************************/ - -void coldfire_reset(void) -{ - HARD_RESET_NOW(); -} - -/***************************************************************************/ -- cgit v1.2.3 From 4f308e35a9bde9d6b671e8409157edb9065f117c Mon Sep 17 00:00:00 2001 From: Jaswinder Singh Rajput Date: Wed, 10 Jun 2009 18:47:47 +0530 Subject: headers_check fix: m68k, swab.h fix the following 'make headers_check' warnings: usr/include/asm-m68k/swab.h:4: include of is preferred over usr/include/asm-m68k/swab.h:10: found __[us]{8,16,32,64} type without #include Signed-off-by: Jaswinder Singh Rajput Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/swab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h index 9e3054ea59e9..5b754aace744 100644 --- a/arch/m68k/include/asm/swab.h +++ b/arch/m68k/include/asm/swab.h @@ -1,7 +1,7 @@ #ifndef _M68K_SWAB_H #define _M68K_SWAB_H -#include +#include #include #define __SWAB_64_THRU_32__ -- cgit v1.2.3 From 9d4f94135385b565e2ce4a37f71b53d0fd3664e8 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Thu, 11 Jun 2009 13:05:00 +1000 Subject: m68knommu: enumerate INIT_THREAD fields properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use proper field value setting init INIT_THREAD macro. Fixes this: arch/m68knommu/kernel/init_task.c:27: warning: excess elements in array initializer arch/m68knommu/kernel/init_task.c:27: warning: (near initialization for ‘init_task.thread.fpstate’) Signed-off-by: Greg Ungerer --- arch/m68k/include/asm/processor_no.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/include/asm/processor_no.h b/arch/m68k/include/asm/processor_no.h index 91cba18acdd3..7a1e0ba35f5a 100644 --- a/arch/m68k/include/asm/processor_no.h +++ b/arch/m68k/include/asm/processor_no.h @@ -72,10 +72,10 @@ struct thread_struct { unsigned char fpstate[FPSTATESIZE]; /* floating point state */ }; -#define INIT_THREAD { \ - sizeof(init_stack) + (unsigned long) init_stack, 0, \ - PS_S, __KERNEL_DS, \ - {0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \ +#define INIT_THREAD { \ + .ksp = sizeof(init_stack) + (unsigned long) init_stack, \ + .sr = PS_S, \ + .fs = __KERNEL_DS, \ } /* -- cgit v1.2.3