OpenWrt Forum Archive

Topic: Kamikaze mmc.o hotplug

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi Guys,

I have a WRT54GL with SD Card Mod, running Kamikaze.  I compiled the mmc.o driver with the following gpio definitions:

#define SD_DI (1 << 2)
#define SD_DO (1 << 4)
#define SD_CLK (1 << 3)
#define SD_CS (1 << 7 )

I know the SD Card Mod works as I have used it before with DD-WRT.  When I load the mmc.o module and the ext2.o module (SD Card was formated as EXT2), I can mount and read the card correctly without issues, however, within a few seconds, the load on the router goes up to 18+, and there are a log of "/bin/sh /sbin/hotplug button" processes going on.  I am assuming that someone the mmc.o driver might be causing hotplug to trigger thinking there the button on the front of the unit was pressed. 

Has anyone had this issue before with any mod to the WRT54GL router and hotplug interfering?  Is there a way to tell hotplug to ignore specific actions like the pressing of the button on the front of the router?

Anything else I can try, do?

Thanks,

William.

Well, it appears I had the wrong gpio pins defined.  I recompiled the mmc.o driver using the following gpio definition:

SD_DI  0x04  GPIO 2
SD_DO  0x10  GPIO 4
SD_CLK 0x08  GPIO 3
SD_CS  0x80  GPIO 7

and ran the following command on the router:
echo "0x9c" > /proc/diag/gpiomask

Loaded the mmc.o module and mounted the sd card... no issues with hotplug anymore... read/write to the sd card works perfectly.

-William

Many thanks it works for me too !!!

I would never have found this I guess :-)

@ wcastillo
can u send me your mmc.o ?
i use kamikaze 7.06 on a WRT54GL v1.1

thx

Rizzi

Hi there,
just a question for wcastillo, where did you get source code for mmc module ?
I'm using kamikaze with 2.6 kernel, today i've just synced and i've found broadcom-mmc package inside trunk repository, did you used that source code or do you have your own ?
I'm very interested in your work, i've made a lot of questions to everybody but a real mmc driver doesn't seems to be present (of course i need to test this new broadcom-mmc package).
Can you provide us more details on your job ?

Thank you in advance for your reply
Andrea (Ben) Benini

what does it do -> "echo "0x9c" > /proc/diag/gpiomask"

Hi Santosh0705,

The command  'echo 0x9c > /proc/diag/gpiomask' is to avoid hotplug issues.  The 0x9c could also be 0x8e, it all depends on which gpio pins you use for your mmc module.  Basically you can determine the hex value by using the bitwise left shift of the gpio pins you used. Example, on my setup:

SD_DI  0x04  GPIO 2                       1 << 2 =   4
SD_DO  0x10  GPIO  4                    1 << 4 =   16
SD_CLK 0x08  GPIO 3                     1 << 3 =  8
SD_CS  0x80  GPIO 7                      1 << 7 = 128
                                                        -------------------
                                                                        156 in hex is 0x9c 

Source (http://forum.openwrt.org/viewtopic.php?id=8543).  When I missed this step, my router kept acting strange, can't remember the error that I got in dmesg, but it was annoying and prevent me from being able to read/write to the sd card.

Hi ben72,

The mmc source code I used was found in one of the how-to's in google.  Its been a while, but I believe it was "http://kiel.kool.dk/mmc.c" (source: http://wiki.openwrt.org/OpenWrtDocs/Cus … dware/MMC).  I don't know if there is an official mmc driver.  When I first did this, I was a new to openwrt (whiterussian and kamikaze).  I need to re-do this for both of my new wrt54gl routers.  I should have them done by Friday at which point I will post more information.  FYI there are plenty of how-to's on this subject.

Hi Rizzi,

I don't have the module at this moment, but as soon as I compile it, I will send it to you.

Thanks all, if I missed something or didn't answer your question, I do apologize, my workload increased rapidly in the past few minutes while I was replying.  Let me know if you guys need anything else.

William

The discussion might have continued from here.