Skip to content

Commit 875287c

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: remove unecessary include of thread_info.h in entry.S m68knommu: enumerate INIT_THREAD fields properly headers_check fix: m68k, swab.h arch/m68knommu: Convert #ifdef DEBUG printk(KERN_DEBUG to pr_debug( m68knommu: remove obsolete reset code m68knommu: move CPU reset code for the 5272 ColdFire into its platform code m68knommu: move CPU reset code for the 528x ColdFire into its platform code m68knommu: move CPU reset code for the 527x ColdFire into its platform code m68knommu: move CPU reset code for the 523x ColdFire into its platform code m68knommu: move CPU reset code for the 520x ColdFire into its platform code m68knommu: add CPU reset code for the 532x ColdFire m68knommu: add CPU reset code for the 5249 ColdFire m68knommu: add CPU reset code for the 5206e ColdFire m68knommu: add CPU reset code for the 5206 ColdFire m68knommu: add CPU reset code for the 5407 ColdFire m68knommu: add CPU reset code for the 5307 ColdFire m68knommu: merge system reset for code ColdFire 523x family m68knommu: fix system reset for ColdFire 527x family
2 parents aee74f3 + 193e984 commit 875287c

File tree

23 files changed

+178
-187
lines changed

23 files changed

+178
-187
lines changed

arch/m68k/include/asm/m520xsim.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,14 @@
5959
#define MCFPIT_IMR MCFINTC_IMRL
6060
#define MCFPIT_IMR_IBIT (1 << MCFINT_PIT1)
6161

62+
/*
63+
* Reset Controll Unit.
64+
*/
65+
#define MCF_RCR 0xFC0A0000
66+
#define MCF_RSR 0xFC0A0001
67+
68+
#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
69+
#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
70+
6271
/****************************************************************************/
6372
#endif /* m520xsim_h */

arch/m68k/include/asm/m523xsim.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,14 @@
4141
#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
4242
#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
4343

44+
/*
45+
* Reset Controll Unit (relative to IPSBAR).
46+
*/
47+
#define MCF_RCR 0x110000
48+
#define MCF_RSR 0x110001
49+
50+
#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
51+
#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
52+
4453
/****************************************************************************/
4554
#endif /* m523xsim_h */

arch/m68k/include/asm/m527xsim.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,14 @@
7070
#define UART2_ENABLE_MASK 0x3f00
7171
#endif
7272

73+
/*
74+
* Reset Controll Unit (relative to IPSBAR).
75+
*/
76+
#define MCF_RCR 0x110000
77+
#define MCF_RSR 0x110001
78+
79+
#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
80+
#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
81+
7382
/****************************************************************************/
7483
#endif /* m527xsim_h */

arch/m68k/include/asm/m528xsim.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
#define MCF5282_INTC0_ICR17 (volatile u8 *) (MCF_IPSBAR + 0x0C51)
5757

5858

59+
/*
60+
* Reset Control Unit (relative to IPSBAR).
61+
*/
62+
#define MCF_RCR 0x110000
63+
#define MCF_RSR 0x110001
64+
65+
#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
66+
#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
5967

6068
/*********************************************************************
6169
*

arch/m68k/include/asm/m532xsim.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@
125125
#define ACR_CM_OFF_IMP (3<<5)
126126
#define ACR_WPROTECT (1<<2)
127127

128+
/*********************************************************************
129+
*
130+
* Reset Controller Module
131+
*
132+
*********************************************************************/
133+
134+
#define MCF_RCR 0xFC0A0000
135+
#define MCF_RSR 0xFC0A0001
136+
137+
#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
138+
#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
139+
128140
/*********************************************************************
129141
*
130142
* Inter-IC (I2C) Module

arch/m68k/include/asm/processor_no.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ struct thread_struct {
7272
unsigned char fpstate[FPSTATESIZE]; /* floating point state */
7373
};
7474

75-
#define INIT_THREAD { \
76-
sizeof(init_stack) + (unsigned long) init_stack, 0, \
77-
PS_S, __KERNEL_DS, \
78-
{0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \
75+
#define INIT_THREAD { \
76+
.ksp = sizeof(init_stack) + (unsigned long) init_stack, \
77+
.sr = PS_S, \
78+
.fs = __KERNEL_DS, \
7979
}
8080

8181
/*

arch/m68k/include/asm/swab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _M68K_SWAB_H
22
#define _M68K_SWAB_H
33

4-
#include <asm/types.h>
4+
#include <linux/types.h>
55
#include <linux/compiler.h>
66

77
#define __SWAB_64_THRU_32__

arch/m68k/include/asm/system_no.h

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -203,113 +203,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
203203
#include <asm-generic/cmpxchg.h>
204204
#endif
205205

206-
#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \
207-
defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 )
208-
#define HARD_RESET_NOW() ({ \
209-
local_irq_disable(); \
210-
asm(" \
211-
moveal #0x10c00000, %a0; \
212-
moveb #0, 0xFFFFF300; \
213-
moveal 0(%a0), %sp; \
214-
moveal 4(%a0), %a0; \
215-
jmp (%a0); \
216-
"); \
217-
})
218-
#endif
219-
220-
#ifdef CONFIG_COLDFIRE
221-
#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
222-
/*
223-
* Need to account for broken early mask of 5272 silicon. So don't
224-
* jump through the original start address. Jump strait into the
225-
* known start of the FLASH code.
226-
*/
227-
#define HARD_RESET_NOW() ({ \
228-
asm(" \
229-
movew #0x2700, %sr; \
230-
jmp 0xf0000400; \
231-
"); \
232-
})
233-
#elif defined(CONFIG_NETtel) || \
234-
defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
235-
#define HARD_RESET_NOW() ({ \
236-
asm(" \
237-
movew #0x2700, %sr; \
238-
moveal #0x10000044, %a0; \
239-
movel #0xffffffff, (%a0); \
240-
moveal #0x10000001, %a0; \
241-
moveb #0x00, (%a0); \
242-
moveal #0xf0000004, %a0; \
243-
moveal (%a0), %a0; \
244-
jmp (%a0); \
245-
"); \
246-
})
247-
#elif defined(CONFIG_M5272)
248-
/*
249-
* Retrieve the boot address in flash using CSBR0 and CSOR0
250-
* find the reset vector at flash_address + 4 (e.g. 0x400)
251-
* remap it in the flash's current location (e.g. 0xf0000400)
252-
* and jump there.
253-
*/
254-
#define HARD_RESET_NOW() ({ \
255-
asm(" \
256-
movew #0x2700, %%sr; \
257-
move.l %0+0x40,%%d0; \
258-
and.l %0+0x44,%%d0; \
259-
andi.l #0xfffff000,%%d0; \
260-
mov.l %%d0,%%a0; \
261-
or.l 4(%%a0),%%d0; \
262-
mov.l %%d0,%%a0; \
263-
jmp (%%a0);" \
264-
: /* No output */ \
265-
: "o" (*(char *)MCF_MBAR) ); \
266-
})
267-
#elif defined(CONFIG_M528x)
268-
/*
269-
* The MCF528x has a bit (SOFTRST) in memory (Reset Control Register RCR),
270-
* that when set, resets the MCF528x.
271-
*/
272-
#define HARD_RESET_NOW() \
273-
({ \
274-
unsigned char volatile *reset; \
275-
asm("move.w #0x2700, %sr"); \
276-
reset = ((volatile unsigned char *)(MCF_IPSBAR + 0x110000)); \
277-
while(1) \
278-
*reset |= (0x01 << 7);\
279-
})
280-
#elif defined(CONFIG_M523x)
281-
#define HARD_RESET_NOW() ({ \
282-
asm(" \
283-
movew #0x2700, %sr; \
284-
movel #0x01000000, %sp; \
285-
moveal #0x40110000, %a0; \
286-
moveb #0x80, (%a0); \
287-
"); \
288-
})
289-
#elif defined(CONFIG_M520x)
290-
/*
291-
* The MCF5208 has a bit (SOFTRST) in memory (Reset Control Register
292-
* RCR), that when set, resets the MCF5208.
293-
*/
294-
#define HARD_RESET_NOW() \
295-
({ \
296-
unsigned char volatile *reset; \
297-
asm("move.w #0x2700, %sr"); \
298-
reset = ((volatile unsigned char *)(MCF_IPSBAR + 0xA0000)); \
299-
while(1) \
300-
*reset |= 0x80; \
301-
})
302-
#else
303-
#define HARD_RESET_NOW() ({ \
304-
asm(" \
305-
movew #0x2700, %sr; \
306-
moveal #0x4, %a0; \
307-
moveal (%a0), %a0; \
308-
jmp (%a0); \
309-
"); \
310-
})
311-
#endif
312-
#endif
313206
#define arch_align_stack(x) (x)
314207

315208

arch/m68knommu/kernel/entry.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include <linux/sys.h>
2828
#include <linux/linkage.h>
29-
#include <asm/thread_info.h>
3029
#include <asm/errno.h>
3130
#include <asm/setup.h>
3231
#include <asm/segment.h>

arch/m68knommu/kernel/setup.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,13 @@ void __init setup_arch(char **cmdline_p)
166166
printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n");
167167
#endif
168168

169-
#ifdef DEBUG
170-
printk(KERN_DEBUG "KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
171-
"BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext,
172-
(int) &_sdata, (int) &_edata,
173-
(int) &_sbss, (int) &_ebss);
174-
printk(KERN_DEBUG "MEMORY -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x\n ",
175-
(int) &_ebss, (int) memory_start,
176-
(int) memory_start, (int) memory_end);
177-
#endif
169+
pr_debug("KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
170+
"BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext,
171+
(int) &_sdata, (int) &_edata,
172+
(int) &_sbss, (int) &_ebss);
173+
pr_debug("MEMORY -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x\n ",
174+
(int) &_ebss, (int) memory_start,
175+
(int) memory_start, (int) memory_end);
178176

179177
/* Keep a copy of command line */
180178
*cmdline_p = &command_line[0];

arch/m68knommu/mm/init.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ void __init mem_init(void)
126126
unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
127127
unsigned long end_mem = memory_end; /* DAVIDM - this must not include kernel stack at top */
128128

129-
#ifdef DEBUG
130-
printk(KERN_DEBUG "Mem_init: start=%lx, end=%lx\n", start_mem, end_mem);
131-
#endif
129+
pr_debug("Mem_init: start=%lx, end=%lx\n", start_mem, end_mem);
132130

133131
end_mem &= PAGE_MASK;
134132
high_memory = (void *) end_mem;

arch/m68knommu/platform/5206/config.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <linux/kernel.h>
1313
#include <linux/param.h>
1414
#include <linux/init.h>
15-
#include <linux/interrupt.h>
1615
#include <linux/io.h>
1716
#include <asm/machdep.h>
1817
#include <asm/coldfire.h>
@@ -21,10 +20,6 @@
2120

2221
/***************************************************************************/
2322

24-
void coldfire_reset(void);
25-
26-
/***************************************************************************/
27-
2823
static struct mcf_platform_uart m5206_uart_platform[] = {
2924
{
3025
.mapbase = MCF_MBAR + MCFUART_BASE1,
@@ -109,10 +104,21 @@ void mcf_settimericr(unsigned int timer, unsigned int level)
109104

110105
/***************************************************************************/
111106

107+
void m5206_cpu_reset(void)
108+
{
109+
local_irq_disable();
110+
/* Set watchdog to soft reset, and enabled */
111+
__raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
112+
for (;;)
113+
/* wait for watchdog to timeout */;
114+
}
115+
116+
/***************************************************************************/
117+
112118
void __init config_BSP(char *commandp, int size)
113119
{
114120
mcf_setimr(MCFSIM_IMR_MASKALL);
115-
mach_reset = coldfire_reset;
121+
mach_reset = m5206_cpu_reset;
116122
}
117123

118124
/***************************************************************************/

arch/m68knommu/platform/5206e/config.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/kernel.h>
1212
#include <linux/param.h>
1313
#include <linux/init.h>
14-
#include <linux/interrupt.h>
1514
#include <linux/io.h>
1615
#include <asm/machdep.h>
1716
#include <asm/coldfire.h>
@@ -21,10 +20,6 @@
2120

2221
/***************************************************************************/
2322

24-
void coldfire_reset(void);
25-
26-
/***************************************************************************/
27-
2823
static struct mcf_platform_uart m5206e_uart_platform[] = {
2924
{
3025
.mapbase = MCF_MBAR + MCFUART_BASE1,
@@ -109,6 +104,17 @@ void mcf_settimericr(unsigned int timer, unsigned int level)
109104

110105
/***************************************************************************/
111106

107+
void m5206e_cpu_reset(void)
108+
{
109+
local_irq_disable();
110+
/* Set watchdog to soft reset, and enabled */
111+
__raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
112+
for (;;)
113+
/* wait for watchdog to timeout */;
114+
}
115+
116+
/***************************************************************************/
117+
112118
void __init config_BSP(char *commandp, int size)
113119
{
114120
mcf_setimr(MCFSIM_IMR_MASKALL);
@@ -119,7 +125,7 @@ void __init config_BSP(char *commandp, int size)
119125
commandp[size-1] = 0;
120126
#endif /* CONFIG_NETtel */
121127

122-
mach_reset = coldfire_reset;
128+
mach_reset = m5206e_cpu_reset;
123129
}
124130

125131
/***************************************************************************/

arch/m68knommu/platform/520x/config.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/kernel.h>
1515
#include <linux/param.h>
1616
#include <linux/init.h>
17-
#include <linux/interrupt.h>
1817
#include <linux/io.h>
1918
#include <asm/machdep.h>
2019
#include <asm/coldfire.h>
@@ -23,10 +22,6 @@
2322

2423
/***************************************************************************/
2524

26-
void coldfire_reset(void);
27-
28-
/***************************************************************************/
29-
3025
static struct mcf_platform_uart m520x_uart_platform[] = {
3126
{
3227
.mapbase = MCF_MBAR + MCFUART_BASE1,
@@ -169,9 +164,17 @@ void mcf_autovector(unsigned int vec)
169164

170165
/***************************************************************************/
171166

167+
static void m520x_cpu_reset(void)
168+
{
169+
local_irq_disable();
170+
__raw_writeb(MCF_RCR_SWRESET, MCF_RCR);
171+
}
172+
173+
/***************************************************************************/
174+
172175
void __init config_BSP(char *commandp, int size)
173176
{
174-
mach_reset = coldfire_reset;
177+
mach_reset = m520x_cpu_reset;
175178
m520x_uarts_init();
176179
m520x_fec_init();
177180
}

0 commit comments

Comments
 (0)