Realtek

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Generic Questions
Goto page Previous  1, 2, 3, 4, 5  Next
Author Message
egxpxhoi
DD-WRT Novice


Joined: 11 Apr 2011
Posts: 38

PostPosted: Sun May 15, 2011 15:55    Post subject: Reply with quote
Hello...? Smile
Sponsor
loyukfai
DD-WRT Novice


Joined: 20 May 2011
Posts: 19

PostPosted: Fri May 20, 2011 16:47    Post subject: Reply with quote
Have been watching this thread for some time. Have a RB-1132 myself which was recently "bricked" due to firmware upgrade. The inside looks like this...

Link to large image

Link to large image

(Sorry for the poor quality, were snapped with a phone.)

There's apparently the UART connector between the USB and the RJ45 connectors.

How could I flash DD-WRT or at least the stock firmware back on it...? My box doesn't have a serial connection so I need a USB->Serial converter...?

Cheers.
mgranja
DD-WRT Novice


Joined: 22 Nov 2010
Posts: 3

PostPosted: Wed May 25, 2011 14:12    Post subject: Reply with quote
Sorry, I'm a noob at this. I just want to change some scripts on the rootfs. Can someone explain how to unpack the files from the .bin file provided, and pack them again so I can upload the modified firmware through the web interface and have my changes there?
Wi Fi Nathan
DD-WRT Novice


Joined: 14 Jul 2010
Posts: 2

PostPosted: Sun Oct 16, 2011 18:31    Post subject: MB-1132 source Reply with quote
Hi gurus, im new to forum here. Love you all guys Smile

I bought a Sapido MB-1132 recently, and wanna DD it
Does someone have the required sources and guidelines ?

MB-1132 = RB-1132
except AC power changed to Li batteries as i know,
but the factory firmwares arent the same in version and size

Thanks
conjur
DD-WRT Novice


Joined: 06 Nov 2010
Posts: 42
Location: Harlem, GA

PostPosted: Sun Nov 13, 2011 16:05    Post subject: Reply with quote
Does anyone happen to still have a copy of the source that amigo released? both sites are down now :/

V/r,
Mike
murdock57
DD-WRT Novice


Joined: 14 Nov 2011
Posts: 4

PostPosted: Mon Nov 14, 2011 21:12    Post subject: Reply with quote
I would be really interested to see if this project could be resurrected. I bought a Sapido RB-1132 this summer. The few reviews I could find didn't have much technical info and the sapido website and pdf manual online is full of the company's weird jargon which makes its way into the stock firmware. Stock firmware also seemed to be pretty buggy and I lost all of my settings every time I changed 'modes' with the manual toggle on the device.
I kind of gave up on the thing but it still sits in my bag (since it is tiny) in case I need it for temporary, basic wifi. People have spoke about using the repeater function (one of the main reasons I bought the thing) through the stock firmware but I could never get it to connect which was pretty disappointing. Man, the form factor is so awesome, the software just sucks. Here's hoping DD-WRT can bring this thing up to a 10.
conjur
DD-WRT Novice


Joined: 06 Nov 2010
Posts: 42
Location: Harlem, GA

PostPosted: Mon Nov 14, 2011 22:11    Post subject: Reply with quote
There is hope in the future; I found someone's shoulders to stand on :p

http://invyl.ath.cx/cgit/cgit.cgi/openwrt/

This guy has the Realtek SDK, and managed to mostly integrate it into a buildable openwrt!

Unfortunately I don't have an RB-1132 with me to test any of it on tho :/

Might want to git this before he looses interest too :/

V/r,
Conjur
merrykid
DD-WRT Novice


Joined: 04 Jul 2011
Posts: 1

PostPosted: Tue Nov 15, 2011 4:22    Post subject: Reply with quote
conjur wrote:
Does anyone happen to still have a copy of the source that amigo released? both sites are down now :/

V/r,
Mike

I search by GPL site:amigo.com.tw
And found the GPL source for BR183n it's the rtl819x-sdk-v2.2 it can be downloaded here http://www.amigo.com.tw/en/news.php?act=view&no=10
The BR183n is an 3G HSPA Built-in Router the same with SAPIDO MB1112.
The built-in module only support WCDMA network not what I'm using is TD-SCDMA network.

I'm using SAPIDO MB1132 which is the same with BR182n. I need to connect it with an usb modem to work with the TD-SCDMA network.

I'm wondering if we can get an TD-SCDMA PCI-E module for example ZTE MU301 to built in to the 1132 so I don't need an extra usb stick. There are spaces on the PCB for mini PCI-E slot and SIM card slot.
Also running DD-WRT on it would be also interesting.

Here is some pictures of the teardown of 1132 I found originally posted in this website http://www.pcpop.com/doc/0/615/615942_all.shtml

Update: I searched and seems to found a newer version of the sdk
http://sourceforge.net/projects/rtl819x/files/rtl819x-sdk-v2.5_2.5.1_2.5.2_boa.tar.gz



001783622.jpg
 Description:
 Filesize:  51.13 KB
 Viewed:  15103 Time(s)

001783622.jpg



001783626.jpg
 Description:
 Filesize:  74.51 KB
 Viewed:  15104 Time(s)

001783626.jpg



001783630.jpg
 Description:
 Filesize:  42.81 KB
 Viewed:  15104 Time(s)

001783630.jpg




Last edited by merrykid on Tue Nov 15, 2011 15:45; edited 2 times in total
conjur
DD-WRT Novice


Joined: 06 Nov 2010
Posts: 42
Location: Harlem, GA

PostPosted: Tue Nov 15, 2011 9:11    Post subject: Reply with quote
merrykid,
That would be too easy- If you can get the TD-SCDMA PCI-E card to physically work with the BR183n; you already have the SDK; just use the toolchain to compile a kernel module for it; and drop it in the squashfs.. I'd say it would be much easier to strip a USB based one, and solder onto the unused USB bus; less pins to worry about.

I'm stuck at work, and can't wait to see this infamous Realtek SDK in it's entirety Smile

V/r,
Conjur
murdock57
DD-WRT Novice


Joined: 14 Nov 2011
Posts: 4

PostPosted: Tue Nov 15, 2011 14:38    Post subject: Reply with quote
Glad to see there is still some hope for the RB-1132. Not even sure where to begin to help with building a driver for this thing though...
conjur
DD-WRT Novice


Joined: 06 Nov 2010
Posts: 42
Location: Harlem, GA

PostPosted: Tue Nov 15, 2011 20:06    Post subject: Reply with quote
I've been running diff's to the linux-2.6.30 in the new realtek sdk and vanilla; and my eyes are already bleeding.. This is ALOT cleaner than the previous source tree; but I'm more of a cracker than a programmer- I can reverse engineer pretty decently; but putting it back together properly will take some time :/

I ordered another RB-1132 today; should be here in Kuwait in 2 weeks Smile

V/r,
Conjur
murdock57
DD-WRT Novice


Joined: 14 Nov 2011
Posts: 4

PostPosted: Wed Nov 16, 2011 15:51    Post subject: Reply with quote
Conjur, which version of the RB-1132 are you building this for? Will it make a difference? I currently have the RB-1132v2. Appreciate you working on this man!
tux_fan
DD-WRT Novice


Joined: 01 Dec 2011
Posts: 21

PostPosted: Sun Dec 18, 2011 1:05    Post subject: What about Trendnet? Reply with quote
Hi folks,

Does anyone have any insight on the Trendnet TEW-652BRP V2.xR? I compiled and modified their GPL source to run the router in client mode, but it would be awesome to port dd-wrt to it. The default firmware is one of the weakest I have seen but the 330MHz CPU (8196B), 4M flash and 32M ram could make it a reasonable candidate for dd-wrt, especially since V1 hardware is Atheros based (I believe) and supported by dd-wrt.
I've been poking through the Trendnet source and the driver is binary. Other sources are available for the 818x chip, but compatibility may not be there.
I am not very strong with kernels, beyond compiling additional modules for various Linux distros, but this is a great opportunity to learn.
So, back to the original question, what do you think would be the safest and easiest way to approach porting this SoC?
Thank you.
A340
DD-WRT Novice


Joined: 23 Oct 2007
Posts: 30

PostPosted: Wed Dec 21, 2011 20:27    Post subject: Reply with quote
http://aliosa27.net/?p=13

Was able to get into the secret login page of the RB-1132. After reading this Hack. Can this be a start, to finally put DD-WRT on this Sapido, and reverse Engineer this router. Now you have root access.
conjur
DD-WRT Novice


Joined: 06 Nov 2010
Posts: 42
Location: Harlem, GA

PostPosted: Mon Jan 16, 2012 1:36    Post subject: Reply with quote
I've found a recovery method for bricks using the Realtek bootloader; as long as the first 5k of the flash has not been manipulated.

extract "webpages-gw.bin", "linux.bin", and "root.bin" from one of the firmware images

option 1:
connect a console cable to the serial headers
open a console to the device, and power it on
Hit ESC when booting, to get into the bootloader
you should now be at the <RealTek> prompt

option 2:
plug the device in
between 3 and 9 seconds (6 second window) of the "POWER" light coming on; briefly tap the RESET switch. This does the same as above, but you have no way of seeing the status of the uploads.

connect an ethernet cable from the LAN port to a computer
set the computer's ip to 192.168.1.1/255.255.255.0
use a tftp client to tftp PUT the 3 files to 192.168.1.6 (in binary mode). Make sure you do linux.bin (bootloader and kernel) last; as uploading linux.bin initiates a reboot.
wait for "Flash Write Successed!" between uploading each file (about 1 minute for webpages, 2-3 minutes for rootfs, and 6-8 minutes for linux.bin)
power-cycle the device.

I've un-bricked 4 of mine using this method.

Now, I can actually get somewhere Smile

BTW, here is the source for my rtkcsum.c.

Works best when the last 2 bytes in the file are 0x0000; or the correct checksum.
get the 3 files from the current firmware:
# dd if=RB-1132_EN_v1.0.36.bin of=webpages-gw.bin ibs=1 count=293444 skip=32918
# dd if=RB-1132_EN_v1.0.36.bin of=linux.bin ibs=1 count=1116178 skip=326362
# dd if=RB-1132_EN_v1.0.36.bin of=root.bin ibs=1 count=5922834 skip=1442540

Code:

// Realtek 8196B F/W Checksum Tool v0.1
// Compile: gcc rtkcsum.c -o rtkcsum
// Usage: rtkcsum <webpages-gw.bin|linux.bin|root.bin>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>

#define MIPSWORD(v) ((unsigned short)(((v>>8)&0xff) | ((v<<8)&0xff00)))

static unsigned short bootChecksum(char *buf, int len)
{
  unsigned short sum=0;
  int i=0, j=0;

  j = (len/2)*2;

  for (i=0; i<j; i+=2) {
   sum += MIPSWORD(*((unsigned short *)(buf + i)));
  }
  if ( len % 2 ) {
   sum += MIPSWORD(buf[len-1]);
  }
  return sum;
}



static unsigned char webChecksum(char *buf, int len)
{
  unsigned char sum=0;
  int i=0, j=0;

  j = (len/2)*2;

  for (i=0; i<j; i+=1) {
   sum += *((unsigned char *)(buf + i));
  }
  return sum;
}



int main(int argc, char *argv[])
{
  FILE *fp;
  unsigned short n=0, x=0, checksum=0, csum=0, ecsum;
  int intFwLen=0;
  char *buf, head[4], startAddr[4], burnAddr[4], fwLen[4];
  struct stat status;
  if((fp = fopen(argv[ 1 ],"r"))==NULL) {
    printf("Cannot open file.\n");
    exit(1);
  }

  stat(argv[1],&status);
  fread(head, 4, 1, fp);
  fread(startAddr, 4, 1, fp);
  fread(burnAddr, 4, 1, fp);


  fread(fwLen, 4, 1, fp);
  // Calculate appropriate Data Block Length
  intFwLen = (fwLen[0]*16777216)+(fwLen[1]*65536)+(fwLen[2]*256)+fwLen[3];
  printf("Realtek SPI Checksum:\nFile: %s SIZE: 0x%x (%ib)\nHeader: %s, ", argv[1], (unsigned int)status.st_size,(unsigned int)status.st_size,head);
  printf("Start: 0x%02x%02x%02x%02x, ", (unsigned int)startAddr[0],(unsigned int)startAddr[1],(unsigned int)startAddr[2],(unsigned int)startAddr[3]);
  printf("Burn: 0x%02x%02x%02x%02x, ", (unsigned int)burnAddr[0],(unsigned int)burnAddr[1],(unsigned int)burnAddr[2],(unsigned int)burnAddr[3]);
  printf("LEN: 0x%02x%02x%02x%02x (%ib)\n", (unsigned int)fwLen[0],(unsigned int)fwLen[1],(unsigned int)fwLen[2],(unsigned int)fwLen[3], intFwLen);

  //Allocate Memory, and copy data block into *buf
  buf = malloc(intFwLen);
  fread(buf,intFwLen,1,fp);

  /* Retrieve existing checksum */
  ecsum=buf[intFwLen-2]+(buf[intFwLen-1]*256);

  if (strcmp(head, "r6br") == 0) {
    csum = bootChecksum(buf, intFwLen);
    checksum = MIPSWORD(~csum)+256;
    printf("Root Filesystem (r6br)...\n");
  }
  if (strcmp(head, "cr6b") == 0) {
    csum = bootChecksum(buf, intFwLen);
    checksum = MIPSWORD(~csum)+256;
    printf("Linux Kernel (root-fs) (cr6b)...\n");
  }
  if (strcmp(head, "w6bg") == 0) {
    csum = webChecksum(buf, intFwLen);
    checksum = MIPSWORD(~csum)+1;
    printf("Webpages (w6bg)...\n");
  }

  if (!csum) {
    printf("Checksum Valid!\n");
  }
  else {
    printf("Checksum Failed (0x%04x)!! Correct Checksum: 0x%04x (read 0x%04x)\n", MIPSWORD(csum), MIPSWORD(checksum+ecsum), MIPSWORD(ecsum));
  }
  return 0;
}



V/r,
Conjur
Goto page Previous  1, 2, 3, 4, 5  Next Display posts from previous:    Page 3 of 5
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Generic Questions 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