Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] m68knommu: optimized local_irq_disable, and platform reboot code

Switch to a space optimized version of local_irq_disable() for ColdFire
platforms. Also add reboot support for the Freescale M5272 platform.
Patch originally submitted by Philippe De Muyter <phdm@macqel.be>.

Add reboot support for the Freescale M523x ColdFire platform. Patch originally
submitted by Jate Sujjavanich.

Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Greg Ungerer and committed by
Linus Torvalds
9c2aba48 9f575747

+48 -6
+48 -6
include/asm-m68knommu/system.h
··· 57 57 : "cc", "%d0", "memory") 58 58 #define local_irq_disable() __asm__ __volatile__ ( \ 59 59 "move %/sr,%%d0\n\t" \ 60 - "ori.l #0x0700,%%d0\n\t" \ 60 + "ori.l #0x0700,%%d0\n\t" \ 61 61 "move %%d0,%/sr\n" \ 62 - : /* no inputs */ \ 62 + : /* no outputs */ \ 63 + : \ 64 + : "cc", "%d0", "memory") 65 + /* For spinlocks etc */ 66 + #define local_irq_save(x) __asm__ __volatile__ ( \ 67 + "movew %%sr,%0\n\t" \ 68 + "movew #0x0700,%%d0\n\t" \ 69 + "or.l %0,%%d0\n\t" \ 70 + "movew %%d0,%/sr" \ 71 + : "=d" (x) \ 63 72 : \ 64 73 : "cc", "%d0", "memory") 65 74 #else ··· 84 75 #define local_irq_restore(x) asm volatile ("movew %0,%%sr": :"d" (x) : "memory") 85 76 86 77 /* For spinlocks etc */ 78 + #ifndef local_irq_save 87 79 #define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } while (0) 80 + #endif 88 81 89 82 #define irqs_disabled() \ 90 83 ({ \ ··· 245 234 #ifdef CONFIG_COLDFIRE 246 235 #if defined(CONFIG_M5272) && defined(CONFIG_NETtel) 247 236 /* 248 - * Need to account for broken early mask of 5272 silicon. So don't 249 - * jump through the original start address. Jump strait into the 250 - * known start of the FLASH code. 237 + * Need to account for broken early mask of 5272 silicon. So don't 238 + * jump through the original start address. Jump strait into the 239 + * known start of the FLASH code. 251 240 */ 252 241 #define HARD_RESET_NOW() ({ \ 253 242 asm(" \ ··· 255 244 jmp 0xf0000400; \ 256 245 "); \ 257 246 }) 258 - #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) 247 + #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ 248 + defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ 249 + defined(CONFIG_CLEOPATRA) 259 250 #define HARD_RESET_NOW() ({ \ 260 251 asm(" \ 261 252 movew #0x2700, %sr; \ ··· 269 256 moveal (%a0), %a0; \ 270 257 jmp (%a0); \ 271 258 "); \ 259 + }) 260 + #elif defined(CONFIG_M5272) 261 + /* 262 + * Retrieve the boot address in flash using CSBR0 and CSOR0 263 + * find the reset vector at flash_address + 4 (e.g. 0x400) 264 + * remap it in the flash's current location (e.g. 0xf0000400) 265 + * and jump there. 266 + */ 267 + #define HARD_RESET_NOW() ({ \ 268 + asm(" \ 269 + movew #0x2700, %%sr; \ 270 + move.l %0+0x40,%%d0; \ 271 + and.l %0+0x44,%%d0; \ 272 + andi.l #0xfffff000,%%d0; \ 273 + mov.l %%d0,%%a0; \ 274 + or.l 4(%%a0),%%d0; \ 275 + mov.l %%d0,%%a0; \ 276 + jmp (%%a0);" \ 277 + : /* No output */ \ 278 + : "o" (*(char *)MCF_MBAR) ); \ 272 279 }) 273 280 #elif defined(CONFIG_M528x) 274 281 /* ··· 302 269 reset = ((volatile unsigned short *)(MCF_IPSBAR + 0x110000)); \ 303 270 while(1) \ 304 271 *reset |= (0x01 << 7);\ 272 + }) 273 + #elif defined(CONFIG_M523x) 274 + #define HARD_RESET_NOW() ({ \ 275 + asm(" \ 276 + movew #0x2700, %sr; \ 277 + movel #0x01000000, %sp; \ 278 + moveal #0x40110000, %a0; \ 279 + moveb #0x80, (%a0); \ 280 + "); \ 305 281 }) 306 282 #else 307 283 #define HARD_RESET_NOW() ({ \