]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/nslu2-kernel/2.6.14/25-nslu2-arch-reset.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / nslu2-kernel / 2.6.14 / 25-nslu2-arch-reset.patch
1 # Work round problems with the flash being unreadable on boot.
2 #
3 --- linux-2.6.13/.pc/25-nslu2-arch-reset.patch/include/asm-arm/arch-ixp4xx/system.h     2005-08-28 16:41:01.000000000 -0700
4 +++ linux-2.6.13/include/asm-arm/arch-ixp4xx/system.h   2005-09-25 23:34:14.762872391 -0700
5 @@ -10,6 +10,7 @@
6   */
7  
8  #include <asm/hardware.h>
9 +#include <asm/mach-types.h>
10  
11  static inline void arch_idle(void)
12  {
13 @@ -22,6 +23,21 @@
14  
15  static inline void arch_reset(char mode)
16  {
17 +       /* On NSLU2 machines the flash is sometimes left in a non-read
18 +        * mode, such that attempting a read will cause problems - such as
19 +        * a hang.  This will prevent both hard and soft reboot since the
20 +        * first thing done is to read the first instruction from the flash!
21 +        * Therefore issue a flash reset command here.
22 +        */
23 +       if ( machine_is_nslu2()) {
24 +               /* Use the physical address here and write the reset command
25 +                * to the command address (not technically necessary).  See
26 +                * <linux/mtd/cfi.h> for how to calculate this for other
27 +                * systems.  The NSLU2 has one bank of 16 bit flash.
28 +                */
29 +               *(__u16*)(NSLU2_FLASH_BASE+0xAA/*command*/) = 0x00ff/*reset*/;
30 +       }
31 +
32         if ( 1 && mode == 's') {
33                 /* Jump into ROM at address 0 */
34                 cpu_reset(0);
35 @@ -39,4 +55,3 @@
36                 *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
37         }
38  }
39 -