Linux kernel PCMCIA linear flash memory card fix

Linux kernel PCMCIA linear flash memory card fix

Post by Tony Lindgre » Tue, 29 Jan 2002 03:40:13



Hi all,

Here's a little patch to fix the 2.4.17 PCMCIA to make linear flash
cards work. The patch should work with all the recent kernels.

Linear flash card are rarely used, but are needed to boot some embedded
systems, like the AMD ELAN. They are also used in some Cisco routers.

Just FYI, here's some Linux related projects where linear flash cards
may be used:

Wireless access points running Linux:
http://opensource.instant802.com/

Alios boot loader for AMD ELAN:
http://www.telos.de/linux/alios/default_e.htm

Read Cisco flash cards from Linux:
ftp://ftp.bbc.co.uk/pub/ciscoflash/

I'm CC'ing dhinds, as I guess he's taking care of the PCMCIA in
the kernel?

Here's a short description of the fix:

Basically there were two problems; The RegisterMTD ioctl was
accidentally dropped at some point, so the flash cards would not
register. Then the reference to the flash card memory window was  
incorrect, so the cards were not seen, and the flash drivers would
not unload after use.

Cheers,

Tony

diff -urN -X ./dontdiff linux-2.4.17-vanilla/drivers/pcmcia/bulkmem.c linux-2.4.17-tony/drivers/pcmcia/bulkmem.c
--- linux-2.4.17-vanilla/drivers/pcmcia/bulkmem.c       Sun Aug 12 17:37:53 2001

     {
        window_handle_t w;
         int ret = pcmcia_request_window(a1, a2, &w);
-        (window_handle_t *)a1 = w;
+        *(window_handle_t *)a1 = w;
        return  ret;
     }
         break;
diff -urN -X ./dontdiff linux-2.4.17-vanilla/drivers/pcmcia/cs.c linux-2.4.17-tony/drivers/pcmcia/cs.c
--- linux-2.4.17-vanilla/drivers/pcmcia/cs.c    Fri Dec 21 09:41:55 2001

         *(eraseq_handle_t *)a1 = w;
        return  ret;
     }
-        break;
-/*     return pcmcia_register_erase_queue(a1, a2); break; */
-
+       break;
+    case RegisterMTD:
        return pcmcia_register_mtd(a1, a2); break;
     case ReleaseConfiguration:
        return pcmcia_release_configuration(a1); break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. Resend: 2.4 PCMCIA linear flash memory card fix

Hi all,

Here's a resend of the patch to fix the 2.4 PCMCIA linear flash cards.
Looks like I was using the non-working sourceforge address for David
Hinds. CC:ing Marcelo Tosatti too.

The patch is against 2.4.17, but works on other recent kernels too.
(I just tested it against 2.4.19-pre4)

Linear flash card are rarely used, but are needed to boot some embedded
systems, like the AMD ELAN. They are also used in some Cisco routers.

Just FYI, here's some Linux related projects where linear flash cards
may be used:

Wireless access points running Linux:
http://opensource.instant802.com/

Alios boot loader for AMD ELAN:
http://www.telos.de/linux/alios/default_e.htm

Read Cisco flash cards from Linux:
ftp://ftp.bbc.co.uk/pub/ciscoflash/

Here's a short description of the fix:

Basically there were two problems; The RegisterMTD ioctl was
accidentally dropped at some point, so the flash cards would not
register. Then the reference to the flash card memory window was
incorrect, so the cards were not seen, and the flash drivers would
not unload after use.

Regards,

Tony

[ linux-2.4.17-pcmcia-mtd.patch 1K ]
diff -urN -X ./dontdiff linux-2.4.17-vanilla/drivers/pcmcia/bulkmem.c linux-2.4.17-tony/drivers/pcmcia/bulkmem.c
--- linux-2.4.17-vanilla/drivers/pcmcia/bulkmem.c       Sun Aug 12 17:37:53 2001

     {
        window_handle_t w;
         int ret = pcmcia_request_window(a1, a2, &w);
-        (window_handle_t *)a1 = w;
+        *(window_handle_t *)a1 = w;
        return  ret;
     }
         break;
diff -urN -X ./dontdiff linux-2.4.17-vanilla/drivers/pcmcia/cs.c linux-2.4.17-tony/drivers/pcmcia/cs.c
--- linux-2.4.17-vanilla/drivers/pcmcia/cs.c    Fri Dec 21 09:41:55 2001

         *(eraseq_handle_t *)a1 = w;
        return  ret;
     }
-        break;
-/*     return pcmcia_register_erase_queue(a1, a2); break; */
-
+       break;
+    case RegisterMTD:
        return pcmcia_register_mtd(a1, a2); break;
     case ReleaseConfiguration:
        return pcmcia_release_configuration(a1); break;

2. REQ:fli player?

3. WTB: PCMCIA Linear FLash card cheap

4. TV Card with MPEG encoder

5. IDE Booting from Flash - Positive report: Adton PCMCIA Card Drive - PCMCIA vs. Compact Flash

6. Just witch one to use <vmlinux>

7. Linux boot from PCMCIA flash memory card.

8. Embedded Linux Workshop

9. ? how make linux boot from pcmcia flash memory card.

10. ?how to make linux boot from PCMCIA flash memory card

11. Problems with Flash Memory Card with PCMCIA-Adapter

12. IBM flash memory PCMCIA cards

13. More on flash memory cards via PCMCIA