All times are UTC - 5 hours [ DST ]


Forum rules


Please do not post questions about data recovery cases here (use this forum instead). This forum is for topics on finding new ways to recover data. Accessing firmware, writing programs, reading bits off the platter, recovering data from dust...



Post new topic Reply to topic  [ 87 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Marvell 88i6745n JTAG
PostPosted: August 19th, 2011, 5:34 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
Hello,

Is there anyone who have pinouts of 88i6745n JTAG?
or PASS for RAR file: http://www.griol.com/ftp/WD/88I6745.rar ?
or a way to rewrite broken ROM in 88i6745n ?
or a way to boot from external U12 EEPROM 24p10, 24p20 ?

B.R.
Dex


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 25th, 2011, 6:27 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
It seems that nobody wants to help me, so I've find JTAG pins by my self!
Hope that somebody will be interested.

JTAG pins are on board CON1 and it seems that is same on all boards?!!
I tested on 2061-701335-c00 Marvell 88i6545 and 2061-701499-e00 Marvell 88i6745n.
Both chips have same ID 0x259663d3 !!!

Here is connection to 2061-701499-e00.

Image

And closeup connection to JTAG test points.

Image

And closeup connection to JTAG CON1.

Image


B.R.
Dejan


Attachments:
wd_scorpio_blue_con1.JPG
wd_scorpio_blue_con1.JPG [ 46.43 KiB | Viewed 48090 times ]
88i6745n_jtag_tp.JPG
88i6745n_jtag_tp.JPG [ 67.33 KiB | Viewed 48090 times ]
88i6745n_jtag.JPG
88i6745n_jtag.JPG [ 85.33 KiB | Viewed 48090 times ]
Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 25th, 2011, 11:44 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
Good work

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 25th, 2011, 12:28 
Offline
User avatar

Joined: May 5th, 2004, 20:06
Posts: 2770
Location: England
I like it too :D

_________________
All went well until I plugged the drive in.


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 6:10 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
OK. I was interested in rewriting damaged EEPROM(ROM) inside Marvell 88i6745n.
It seems that lots of people here have solution for it, but they wont to share?!!!
Am I on wrong forum? Isn't information have to be free?
Anyway, that means that I have to find by myself solution,... if someone wants to hellp, it will be nice.

First we can use OPENOCD
http://openocd.berlios.de/
Last version is 0.5.0 but I'm using 0.4.0
For those with Linux, I do not have to explain what to do.
For those with Windows, look on Google for: openocd 0.4.0 windows installer

Next we have to find some JTAG interface. Look in OPENOCD what JTAG interfaces are
supported and get one.

I'm using simple LPT Xilinx III cable which can be made at home.


CONNECTION TO Marvell 88i6745n:
---------------------------------
As you can see in my previous post there are JTAG pins:

Pins that MUST be used!

GND
TDI
TMS
CLK in
TDO

Pins that can be used or not depend on your JTAG interface!

Vcc 3.3v - for powering JTAG interface or for reference.
CLK out - for VERY FAST JTAG interface that support CLK out
RST - for JTAG interface that support RST


For Xilinx III JTAG interface only GND, TDI, TMS, CLK in, TDO, Vcc 3.3 is used!
-----------------------------------------

Starting:
--------
1. Copy to openocd\bin "feroceon.cfg" from openocd\target
2. Copy or create jtag.cfg to openocd\bin depend on your JTAG interface.

In my case for Xilinx III JTAG interface file is:

#*******************************
#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface parport
parport_cable dlc5
parport_port 0x378
#*******************************

3. Copy to openocd\bin "putty.exe" or use your favorite telnet.
http://www.putty.org/

4. In my example I used only board (removed from HDD) that have corrupted EEPROM(ROM)
2061-701499-e00 Marvell 88i6745n.
I'm not sure is it important but I have set board to test mode (First 3 pins are soldered to GND)
Connect JTAG interface to board.
Connect SATA power to board.

5. Go to openocd\bin and type: openocd.exe -f jtag.cfg.txt -f feroceon.cfg

If everything is ok you have to get something like this:

Image

As you can see device ID is 0x259663d3 and since OPENOCD do not have appropriate loader
we can use "feroceon.cfg".

If you get ANY other error try to read OPENOCD documents!!!

6. Now run telnet. Go to openocd\bin and type: putty.exe
Once opened, in "Host name (or IP address)" type: local host
select in "Connection type" Telnet
in "Port" type: 4444
and hit "Open" button

If everything is ok, it will open new window like this:

Image

7. In telnet type: halt

If everything is ok, it will look something like this:

Image

That means that you have FULL controll over Marvell 88i6745n !!!

B.R.

Dejan


Attachments:
openocd3.JPG
openocd3.JPG [ 23.22 KiB | Viewed 48026 times ]
openocd2.JPG
openocd2.JPG [ 15.41 KiB | Viewed 48026 times ]
openocd1.JPG
openocd1.JPG [ 54.08 KiB | Viewed 48026 times ]
Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 6:31 
Offline
User avatar

Joined: May 3rd, 2011, 9:52
Posts: 178
Location: France
[OFF TOPIC]
Are you the Dejan who plays with SIM card and phones ?
[OFF TOPIC]
Great Job by the way !

_________________
Lemmy


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 11:04 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
_dex_ wrote:
OK. I was interested in rewriting damaged EEPROM(ROM) inside Marvell 88i6745n.
It seems that lots of people here have solution for it, but they wont to share?!!!
Am I on wrong forum? Isn't information have to be free?
Anyway, that means that I have to find by myself solution,... if someone wants to hellp, it will be nice.

Actually I think very few people know how to do that
I personally don't know that
From my understanding to re-flash it you have to run some kind of procedure inside the drive which unlikely exists in the kernel code
I think you need a loader of some kind to flash it
Anyway the kernel code usually located at FFFF0000
The internal flash projection usually lives at FFF00000 (addressing has to be ebabled)
Something like this
Kernel:FFFF0C32 LDR R0, =Flash_Base ; jumptable FFFF0C20 case 1
Kernel:FFFF0C34 LDRH R1, [R0,#2]
Kernel:FFFF0C36 LSRS R1, R1, #1
Kernel:FFFF0C38 LSLS R1, R1, #1
Kernel:FFFF0C3A STRH R1, [R0,#2]
Kernel:FFFF0C3C LDRH R1, [R0,#2]
Kernel:FFFF0C3E MOVS R2, #0x80 ; 'А'
Kernel:FFFF0C40 ORRS R1, R2
Kernel:FFFF0C42 STRH R1, [R0,#2]
Kernel:FFFF0C44 LDR R0, =0xFFF00000
Kernel:FFFF0C46 B loc_FFFF0C5E

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 11:27 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
But I don't think that FFF00000 will contain exact flash image because flash has a header and it cannot be run as is

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 14:12 
Offline

Joined: March 7th, 2009, 12:43
Posts: 794
Location: World wide remote RAID help
_dex_ wrote:
OK. I was interested in rewriting damaged EEPROM(ROM) inside Marvell 88i6745n.
It seems that lots of people here have solution for it, but they wont to share?!!!


I remembered anecdote about "elusive Joe" :)
Why we need break through the wall when we can get inside from the side?

This pass much easy :
Quote:
or a way to boot from external U12 EEPROM 24p10, 24p20 ?


External Rom + two resistors the key to success ;)

Any way, nice work, i like :D

_________________
http://www.angeldatarecovery.com/contact-us/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 15:15 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
DR-Kiev wrote:
External Rom + two resistors the key to success ;)

I have some 701590 PCBs with killed internal flash
Do you know who to make external flash work on those?

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 15:34 
Offline
User avatar

Joined: May 13th, 2010, 11:17
Posts: 2188
Location: Kuwait
Doomer wrote:
DR-Kiev wrote:
External Rom + two resistors the key to success ;)

I have some 701590 PCBs with killed internal flash
Do you know who to make external flash work on those?



PM sent...
:idea:

_________________
Kuwait Data Recovery - UNIX GTC
The only reason for time is so that everything doesn't happen at once. By: Albert Einstein


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 26th, 2011, 21:13 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
@Doomer
It is called "bootstrap" it is OTP or mask programmable ROM.
It is on addr 0xffff0000 in size of less than 0x2000

@All
To dump bootstrap from Marvell chip, after "halt" from OPENOCD type
dump_image ffff0000.bin 0xffff0000 0x10000

If everything is ok, it will be something like this:

Image

And file "ffff0000.bin" will be created in openocd\bin dir.

In my case SHA1 of "ffff0000.bin" is 5ab6b58869a6cf40aaa60626e8440c0abc186ae8

Now you can use any ARM disassembler to analize code!!!

Some addresses:
0xffff0000 HW RESET vector
0x04000000-0x04007fff internal SRAM for STACK.
0x00000000-SDRAM 8-32Mb ???
0x1c00xxxx-ports?

0x1c00a6xx serial port
0x1c00a8xx I/O port ?

For "ffff0000.bin" sha1=5ab6b58869a6cf40aaa60626e8440c0abc186ae8
CODE rutines:

FFFF1A70: start tiny console thumb
FFFF01B4: start tiny console arm
FFFF1944: send_asciiz_string
FFFF1A16: receive_and_resend_CMD
FFFF18E2: send_byte
FFFF1A06: receive_byte
etc etc

Function "start tiny console"
After HW reset, CPU test port 0x1C00A84E. If bit 13 is set it runs "start tiny console"!!!

Tiny console have only 3 function:
----------------------------------
r <32bit address> ;read one half word(16 bit) from address
w <32bit address> <16bit data> ;write one half word(16 bit) to address
j <32bit address> ;jump or call code on address

With those 3 functions we can do everyting with CPU on low level.

Problem is how to set bit 13 on 0x1C00A84E.
Port 0x1C00A84E is connected to 4 pin (8 pin on 3.5'') jumper header, so bit 13 have to be
connected to some pin or by using some combination of jumper header!!!

I tested tiny console by calling it using JTAG:

Connect COM or USB to COM port with 3.3v levels to board:

Image

Set you COM port on PC to 115200 8 N 1 using Hyper Terminal and run.
Now, run openocd:
halt
reg sp_usr 0x4005000
reg pc 0xffff1a70
resume

If everything is ok, it will be something like this:

Image

Hyper Terminal will be prompted! Now you can switch to Hyper Terminal and type for test:

Image

If we can find a way to run tiny console, then we can access CPU without JTAG!


B.R

Dejan


Attachments:
terminal2.JPG
terminal2.JPG [ 44.01 KiB | Viewed 47945 times ]
terminal1.JPG
terminal1.JPG [ 52.49 KiB | Viewed 47945 times ]
terminal3.JPG
terminal3.JPG [ 50.58 KiB | Viewed 47945 times ]
bootstrap.JPG
bootstrap.JPG [ 31.67 KiB | Viewed 47945 times ]
Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 27th, 2011, 10:32 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
_dex_ wrote:
Problem is how to set bit 13 on 0x1C00A84E.
Port 0x1C00A84E is connected to 4 pin (8 pin on 3.5'') jumper header

I doubt that
More likely it will live on CON1

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 27th, 2011, 23:23 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
_dex_ wrote:
Tiny console have only 3 function:

mine drive has 4 commands

Kernel:FFFF19C6 Kernel_s_cmd ; CODE XREF: Kernel_debug_mode+70j
Kernel:FFFF19C6 LDR R1, =unk_1C00A020
Kernel:FFFF19C8 MOVS R0, #6
Kernel:FFFF19CA STRH R0, [R1,#0x1A]
Kernel:FFFF19CC
Kernel:FFFF19CC loc_FFFF19CC ; CODE XREF: Kernel_debug_mode+98j
Kernel:FFFF19CC LDRH R0, [R7,#4]
Kernel:FFFF19CE LSLS R0, R0, #0x1F
Kernel:FFFF19D0 BPL loc_FFFF19CC
Kernel:FFFF19D2 LDRH R0, [R7,#4]
Kernel:FFFF19D4 ORRS R0, R6
Kernel:FFFF19D6 STRH R0, [R7,#4]
Kernel:FFFF19D8 B loc_FFFF1966

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 27th, 2011, 23:34 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
You might like port 1C00A846, especially bit 2 in it
If you manage to enter this mode - flashing will be much easier
But I would hate to go there through jtag

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 29th, 2011, 21:18 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
Image of internal FLASH(EEPROM) is on address: 0xfff00000, size 0x30000.
Bootstrap looks for first part of FLASH. We can call it "kernel loader"

Header of "kernel loader" is on 0x00000000 of Flash (physical addr: 0xfff00000)
in size of 0x20 with CHK
---------------------------
0x5a ;Header ID
04,0,0 ;?
0xd,0xc,0,0 ;=0x00000c0d size of "kernel loader" + CHK
0xc,0xc,0,0 ;=0x00000c0c size of "kernel loader"
0x20,1,0,0 ;=0x00000120 start of "kernel loader" data in FLASH (physical addr 0xfff00120)
0x80,0xa,1,0 ;=0x00010a80 physical addr where "kernel loader" have to be loaded
0x80,0xa,1,0 ;=0x00010a80 physical addr of execute start once "kernel loader" is loaded
0,0,0 ;?
0xd1 ;Header ID CHK 8-bit cheksum of first 0x1f bytes of "kernel loader" header

For this case bootstrap loads "kernel loader" to addr: 0x0x00010a80 in size 0x00000c0c
calculate 8 bit cheksum and compare with next byte (offset + 0x00000c0c)

IF both cheksum are OK then bootstrap RUNS "kernel loader" (in this case from 0x00010a80),
OTHERWISE it runs "terminal" rutine.

For "ffff0000.bin" sha1=5ab6b58869a6cf40aaa60626e8440c0abc186ae8
"terminal" rutine:= 0xFFFF0A50

This rutine using same serial port like "tiny console" only protocol is different.
Once started it sends every second byte 0x15 to serial port and waits for appropriate
command.

So, if on your WD board, in internal FLASH is corrupted part of "kernel loader", then you can
simple connect board on serial port. If everything is ok, bord will start to send 0x15, and
you can using "terminal" protocol to repair internal FLASH without JTAG!!!

In my case "kernel loader" data is correct and I have to find other solution.

B.R.

Dejan


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 30th, 2011, 1:22 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
_dex_ wrote:
Once started it sends every second byte 0x15 to serial port and waits for appropriate
command.

It's called X-modem. And Hyperterminal is hacker's best friend :mrgreen:

_dex_ wrote:
So, if on your WD board, in internal FLASH is corrupted part of "kernel loader", then you can
simple connect board on serial port. If everything is ok, bord will start to send 0x15, and
you can using "terminal" protocol to repair internal FLASH without JTAG!!!

Which is never the case
If "loader" is corrupted then almost definitely the rest of the flash is corrupted too
And uploading just a flash to memory using x-modem will not help because "loader" from loaded flash image will try to access mapped internal flash at 0xFFF00000 but it remains corrupted.

_dex_ wrote:
In my case "kernel loader" data is correct and I have to find other solution.

Which is usually the case - incompatible flash from another drive kills PCB logically

We back to port 1C00A846
Anyway if you find where 1C00A846 is connected it might be useful. It must be related to resistors which responsible for external flash
But of course next step will be reversing drive's FW to find internal flash writing commands and then creating loader which will program internal flash from a file. You still want to do that?

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 30th, 2011, 3:20 
Offline
User avatar

Joined: May 5th, 2004, 20:06
Posts: 2770
Location: England
I recon he will :@)

_________________
All went well until I plugged the drive in.


Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 30th, 2011, 14:11 
Offline

Joined: August 18th, 2011, 4:55
Posts: 24
"Tiny Console" is activated!

Connect resistor 4k7 to P1 test point (+3.3v) and E6 test point.

Image

Connect Rx and Tx line to COM port.

Image

Connect SATA POWER conector.

Run Hyper Terminal on PC with setings 115200 8 N 1.

Image

And that is it!!!

B.R.

Dejan


Attachments:
enabling_tiny_console.JPG
enabling_tiny_console.JPG [ 80.5 KiB | Viewed 47764 times ]
Top
 Profile  
 
 Post subject: Re: Marvell 88i6745n JTAG
PostPosted: August 30th, 2011, 15:29 
Offline
User avatar

Joined: September 29th, 2005, 12:02
Posts: 3136
Location: Chicago
_dex_ wrote:
"Tiny Console" is activated!
Connect resistor 4k7 to P1 test point (+3.3v) and E6 test point.

So you made "5" (or maybe it was 0x1C00A84E)
If you make it "3" you'll get X-Modem
Great work

_________________
https://www.linkedin.com/in/artemrubtsov/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 87 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group