SD/MMC mod on Buffalo model, help needed

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3  Next
Author Message
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Wed Nov 15, 2006 5:19    Post subject: SD/MMC mod on Buffalo model, help needed Reply with quote
This in particular is for the WHR-HP-G54. I have done the mod, however, the wiki doesn't list the actual functions of the GPIO's outside of the Input/Output, and the GPIO's don't/can't match up exactly to the G/GS mod. So, I'm hoping that the module can be edited by some means to conform to the pins I've done.

~ # nvram show | grep gpio
reset_gpio=7
gpio1=ses_led
wl0gpio0=0
wl0gpio1=0
wl0gpio2=2
wl0gpio3=0
size: 21052 bytes (11716 left)
gpio14=ses_button

What I have assigned using the gpio utility and verifying with a multimeter:
DI=GPIO6:AOSS LED
DO=GPIO5:bridge switch
CS=GPIO7:DIAG LED
CLK=GPIO3:next to extra LED slot
n/a=GPIO1:Bridge LED

Deviation from G/GS mods:
GPIO7==OUTPUT
GPIO5==OUTPUT**Substituted for GPIO6 as GPIO5 is input on WHR-HP-G54
GPIO3==OUTPUT
GPIO4==INPUT**Substituted for GPIO5 as this is the reset button functionality.
--------------------------------------------------------------------------------------------------
As the drivers/modules are included, and the FS is squashFS is my ONLY recourse to build the firmware myself with an altered mmc.o? Ideas, suggestions, volunteer to build it(as linux and I are still barely on speaking terms)?

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Sponsor
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Wed Nov 15, 2006 15:39    Post subject: Reply with quote
No one? *shoots at a cricket chirping*
_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Fri Nov 17, 2006 6:09    Post subject: Reply with quote
The GPIO's are listed at http://www.dd-wrt.com/wiki/index.php/WHR-HP-G54, but I am unclear on how to proceed.

Doesn't the GPIO have to corraspond on an input to output basis? DI=Data In, so it should HAVE to be on an designated output on the router, correct? IF this is so, then I can't hook up the connections the same as a G/GS linksys model, right? Given that, that means I have to build, or have built a custom mmc driver, yes?

Anyone?

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Cricri
DD-WRT User


Joined: 17 Nov 2006
Posts: 78

PostPosted: Sat Nov 18, 2006 20:54    Post subject: Reply with quote
I've gopt no idea what you are talking about. Is that something cool that I could do to my WHR-G54S as well? Cool
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Sat Nov 18, 2006 22:43    Post subject: Reply with quote
Cricri wrote:
I've gopt no idea what you are talking about. Is that something cool that I could do to my WHR-G54S as well? Cool


Someone else has already done it with your model, jnjn to be specific. Just look in the wiki under hardware mods, and a search for all the threads by my name, a previous one will show you how he wired his if you wish to do it at some point.


Somebody's has to either have done this already with this model, or at least has a better understanding of how the GPIO's work to give me a straightforward answer...

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Cricri
DD-WRT User


Joined: 17 Nov 2006
Posts: 78

PostPosted: Sun Nov 19, 2006 9:47    Post subject: Reply with quote
Checking the wiki now, sounds good. Thanks!
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Mon Nov 20, 2006 17:18    Post subject: Reply with quote
I refuse to give up on this, somebody's gotta know...
_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
JohnnyPrimus
DD-WRT User


Joined: 26 Oct 2006
Posts: 369

PostPosted: Tue Nov 21, 2006 0:36    Post subject: Reply with quote
i can compile mmc.o for you, i may not be able to get to it tonight, but the source modifications should be pretty trivial.
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Tue Nov 21, 2006 1:08    Post subject: Reply with quote
JohnnyPrimus wrote:
i can compile mmc.o for you, i may not be able to get to it tonight, but the source modifications should be pretty trivial.


That would certainly be appreciated, and welcomed. I am however still wondering if this is even what I should be doing, re-wiring it isn't an issue, but from what's listed I don't know if it will function if it was wired to the normal GPIO's.

Am I correct in the assumption that if they're listed as an output or input they can not and will not be changed by software means (mmc.o driver)? ie. DI(Data In) has to connect to a GPIO designated as output.

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
JohnnyPrimus
DD-WRT User


Joined: 26 Oct 2006
Posts: 369

PostPosted: Tue Nov 21, 2006 1:58    Post subject: Reply with quote
Referring to http://support.warwick.net/~ryan/wrt54g-v4/v4_sd_done.html I am under the impression that the functionality of a certain GPIO port can indeed be defined in the MMC.O module. I'm not an expert on GPIO, so don't quote me, but I believe each GPIO pin can be used for either input or output, as defined in the kernel driver that is using it, thus modifying the defines in the mmc as below ought to run your sd card.

Can anyone verify? I'd think that compiling the module and adding it to your firmware via the firmware mod utility would be fairly safe (it was on mine, despite errors in my initial defines), but I'd hate to blow up your house or something :D

#define SD_DI (1 << 6)
#define SD_DO (1 << 5)
#define SD_CLK (1 << 3)
#define SD_CS (1 << 7)
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Wed Nov 29, 2006 5:45    Post subject: Reply with quote
Trying to avoid re-find gpio's and the like I FINALLY got mmc.c to build on my ubuntu VM install. That said, it still doesn't work. Shocked

Here's what I changed, this is all I need to do from the one listed at http://kiel.kool.dk/mmc.c , right?:
#define SD_DI 0x40
#define SD_DO 0x20
#define SD_CLK 0x08
#define SD_CS 0x80

given that the above matches with this:
DI=GPIO6:AOSS LED
DO=GPIO5:bridge switch
CLK=GPIO3:next to extra LED slot
CS=GPIO7:DIAG LED

I thought I could just use the straightup hex values, am I wrong?

EDIT: Bleh, did it both ways, no joy...
<4>mmc Hardware init
<4>mmc Card init
<4>mmc Card init
<4>mmc: error in mmc_card_init (1)
<4>mmc: error in mmc_init (-1)

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Wed Nov 29, 2006 6:16    Post subject: Reply with quote
It is however compiling with warnings, which "seem" significant, perhaps it's simply not compiling correctly?:

yasha@laptopvm:~/mmcdriver$ make
/home/yasha/whiterussian/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -O2 -DMODULE -D__KERNEL__ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -fno-strict-aliasing -mips32 -isystem /home/yasha/whiterussian/openwrt/toolchain_build_mipsel/linux-2.4.30/include -fno-pic -mno-abicalls -mlong-calls -c -o mmc.o mmc.c
mmc.c: In function `mmc_open':
mmc.c:278: warning: unused variable `device'
mmc.c: At top level:
mmc.c:324: warning: unused parameter 'filp'
/home/yasha/whiterussian/openwrt/toolchain_build_mipsel/linux-2.4.30/include/asm/uaccess.h:130: warning: unused parameter 'type'
mmc.c:276: warning: unused parameter 'inode'
mmc.c:49: warning: 'gpioaddr_control' defined but not used
mmc.c:517: warning: 'mmc_check_media_change' defined but not used

_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
llowrey
DD-WRT Novice


Joined: 30 Nov 2006
Posts: 19

PostPosted: Thu Nov 30, 2006 2:04    Post subject: WHR-G54S has same issue Reply with quote
I am running into the same issue with my WHR-G54S. GPIO4 is the reset and not at all compatible with the stock mmc module.

I have not yet soldered any wires but I can help you test the module you built using my oscilloscope. I can at least verify that the right GPIOs are toggling. I'll probably get to wiring things up in a few days.

Your compiler warnings are not important, as far as I can tell. The code you changed to redefine the GPIOs looks correct to me. Can you send me the mmc.o file to test?
JohnnyPrimus
DD-WRT User


Joined: 26 Oct 2006
Posts: 369

PostPosted: Thu Nov 30, 2006 5:53    Post subject: re: Reply with quote
The mmc.c included with DD-WRT v23 SP1 and later includes some changes that may prevent the version you're compiling from working.

Here is the version from 23 sp2 source tree. I modified it such that it should work for wrt v1, wrt v4, and your buffalo setup.

type dmesg after booting to check that everything went well, it shoud look something like this:

<0>mmc: Device does not use v1 GPIO layout, trying to use v4 GPIO layout
<0>mmc: Device does not use v4 GPIO layout, trying to use Buffalo GPIO layout
<0>Size = 500224, hardsectsize = 512, sectors = 1000448
<6>Partition check:
<6> mmca: p1


to compile (you probably already know this), stick mmc.c from this archive in ~/DD-WRT/src/router/mmc, then:
cd ~/DD-WRT/src/router
make mmc

and mmc.o should compile.

The binary mmc.o is also included if you'd rather skip the compilation.

http://www.partners.biz/dd-wrt/mmc-buffalo.tar

-JP
Yasha
DD-WRT User


Joined: 08 Jun 2006
Posts: 217
Location: BFE, USA

PostPosted: Thu Nov 30, 2006 17:44    Post subject: Re: re: Reply with quote
For some reason I couldn't get to here last night, think it was my lovely ISP's DNS servers here. Anyhow, yeah, it seems to work just fine, I went ahead and replaced the working mmc.o on my other router with one I built, worked fine. But I'll try yours Jonnyprimus when I get home just to double-check, I'm fairly sure I hooked it up right, but it may just not that it doesn't like those GPIO's.
_________________
--It is no measure of health to be well adjusted in a profoundly sick society.
WRT-350N (Stock firmware 1.03.2) --WAP
WHR-HP-G54(Openwrt /w x-wrt) --Gateway
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum