[Samsung Galaxy Note 8 ROMs, Kernels, Recoveries, &] BigCountry907:
Guide -->>> EDL Flashing Single Partitions

Using the Firehose​

1) General rules.

YOU NEED THE QUALCOMM EDL DRIVERS INSTALLED BEFORE YOU DO ANYTHING.

SEE HERE IF YOU DON'T HAVE THEM INSTALLED.

https://xdaforums.com/galaxy-note-8/how-to/note-8-n950u-qdl9008-edl-mode-unbrick-t3851345

A)

Be careful what you flash with the firehose. Keep in mind that as shown in the log there is a MAX PAYLOAD. ( MaxPayloadSizeToTargetInBytes="1048576" ).

For partitions over 1048576 bytes they have to first be converted to sparse chunks and the patch.xml will need to be used as well. This is beyond the scope of this guide and due to connection unreliability it is not recommended to use Firehose for flashing /system /data /Cache ect. If its flagged as sparse try to avid flashing it with the firehose. USE ODIN.

B) Pay extra attention to the (physical_partition_number: ???). The UFS is provisioned into multiple disks and if you set the physical_partition_number wrong you flash the wrong disk. :crying:

C) Double check Triple Check by any means make 100% sure that you get the

program start_sector="xxxxxx" start_byte_hex="xxxxx" and everything else in the xml file right.

The firehose don't check where you told it to write it just writes. Getting an address wrong is equivalent to flashing sda1 to sda10. Brick almost for sure.

:cowboy::cowboy::cowboy::cowboy::cowboy:

-----------------------------------------------------------------------------------------------------------------------

OK lets have some fun and actually put to use the goodies Iv'e left here for you guys.

Steps.

Copy all the files we need to one folder for the flash we want.

That way we don't accidentally flash anything we didn't intend to.

The Files needed:

The partition backup or firmware image you want to flash.

In this example it is devinfo.bin

Files from the EDL UNBRICK Package.

emmcdl

prog_ufs_firehose_8998_ddr.elf

One of the rawprogram.xml files <---- Preferably the one that list the partition you are trying to flash.

Make a copy of the rawprogram.xml

For my example it is ->> TEST1.xml

Make a text file so you can write the command we will use in it after you find the comm port for your edl device.

Now we need to edit our XML to flash only the partition we are trying to flash.

Open up the GPT Spreadsheet so you can get the addresses we need.

Open the file TEST1.xml in wordpad / notepad / gedit whatever u like.

For this example open up the rawprogram3.xml thats in the EDL package. The devinfo partition is in there so we will use that line to start with.

Clear out all the data in the TEST1.xml so it looks like this.

Now looking in rawprogram3.xml find the code for the devinfo partition. Copy it to the clipboard. ( ya know copy paste i hope ).

Now paste that line into the TEST1.xml do save as and make sure you select ALL FILES as type

Test1.xml should look like this DOUBLE CLICK TO OPEN IT in explorer.

Make sure it stays as an xml and not a .txt file.

Now we need to edit.

filename="" to filename"devinfo.bin" <--- (The name of your file)

num_partition_sectors="1" to num_partition_sectors="1" <--- (comes from spreadsheet)

physical_partition_number="3" <---- Double Check EDL Rawprogram.xml files for partition.

size_in_KB="4.0" to size_in_KB="4.0" <--- (comes from spreadsheet)

start_byte_hex="0x290a000" to start_byte_hex="0x298a000" <--- (comes from spreadsheet)

start_sector="10506" to start_sector="10634"

Your xml should look like this now.

Double Triple Multiple check Everything.

I will show you where the data is in the spreadsheet

The Spreadsheet ( GPT-Decoder )

So all the information we need is in the GPT. ( Partition Table )

The spreadsheet I made re-arranges the raw dump into the data we need.

The Primary Data.

There are several sheets in the workbook.

The GPT-Decoder-# is the sheet where the hex data from the gpt dump is first read in.

The GPT-Decoder-# is linked to the gpt_main# sheet. So if you paste gpt data into the gpt_main# it is automatically pulled into the GPT-Decoder-#.

This is the block for the devinfo GPT data. It is on sheet GPT-Decoder-3 because it is on /dev/block/sdd. Each block device has its own GPT. Lets take a look.

The Raw Data

This is showing the left side only so things fit nicer.

Everything is color coded.

Each block color is a set of data.

The right hand side where things start to get decoded.

To B Continued. <<<----- This is a big writeup.

The spreadsheet also contains the sheet in the workbook called RAWPROGRAM.XML.:cowboy::D

The rawprogram.xml sheet arranges the data from the GPT-Decoder sheet into a format where we can make a few of the needed files for using the Qualcomm Source Code Tools.

These files include PARTITION.xml / RAWPROGRAM.xml / and PARTITIONS.txt.

I'm still working on this spreadsheet so not all of it is in the sheet yet. But the data we need is IN THE SHEET.

Rawprogram.xml

A) Used by emmcdl.exe to flash partitions in EDL mode.

B) Created by qualcomm source tools it is generated with partition.xml that we can also make with the spreadsheet.

This is where we can get our data and actually make the spreadsheet build our xml,s.

The Partition.xml sheet in the workbook.

Find the partition you are going to flash.

Were working on devinfo in this example.

I will go through the process in more detail when I get a chance.

Time is always the limitation.

For someone pretty much knowing what there doing there should be enough information here to do this. You need one more piece.

Basically to wrap this up till i have more time.

1) Get all files put into one folder. Put it straight on c:\edl or something. (Make sure the backup is in the folder) IE....(devinfo.bin)

2) Make the rawprogram.xml file getting the data you need from the spreadsheet.

Mostly rawprogram.xml sheet in the workbook.

But check the GPT-Decoder sheet too and make sure everything matches and no errors.

3) Open Command prompt (AS ADMINISTRATOR) rt click run as ADMINISTRATOR.

Im assuming u have adb installed.

4) cd to the directory with all the files. ( cd c:\edl )

5) Open device manager and look under ports find the port for HSUSB QDL device.

6) complete the command string by putting the port number in it.

7) execute this command

emmcdl.exe -p COM5 -f prog_ufs_firehose_8998_ddr.elf -MemoryName ufs -SetActivePartition 1 -x TEST1.xml

make sure the com port is set right. Make sure the filename for the .xml is your filaname.

After flash reboot to download mode. Select boot to system to get out of download. If you didnt fry anything all should be well.

Have Fun.

Files attached.

EDL Files

http://www.mediafire.com/file/8ec1z74362d63f6/Unbrick-Samsung-Qualcom-9008-Files.zip/file

Just a side note if you want more information about the sources and whatnot.

Yopu probably should take the time to look at this.

A good read for sure if you are interested in this further.

IF you see GET THESE FILES NOW !!! IF YOU WAIT THEY MIGHT NOT BE THERE

You might want to download that stuffs. You can find it all and more here.

https://xdaforums.com/desire-526/orig-development/wip-rom-msm8909-service-rom-source-qpst-t3544178

These tools are a little older. (more for emmc than ufs but still useful for generating some things.

For the 8916 I have the complete sources in SRC format.

Theese tools are a little newer.

For the msm8909 I have a good chunk of the SRC.

For our chip and our build someone was nice enough to share a little pc of the SRC.

One last quick snippet then we got to get back on track.

This stuff gets me excited. Its all very high level but to some of us it is invaluable.

Addresses are always valuable. Just like the GPT. And especially RAM Addressing.

----------------------------------------------------------------------------------------

-- Memory: SYSTEM_IMEM

----------------------------------------------------------------------------------------

SYSTEM_IMEM MEM START=0x14680000 END=0x146BFFFF

----------------------------------------------------------------------------------------

-- Memory: LPASS_LPM

----------------------------------------------------------------------------------------

LPASS_LPM MEM START=0x17120000 END=0x1712FFFF

----------------------------------------------------------------------------------------

-- Memory: MMSS_VMEM

----------------------------------------------------------------------------------------

MMSS_VMEM MEM START=0x14800000 END=0x1487FFFF

----------------------------------------------------------------------------------------

-- Memory: PIMEM

----------------------------------------------------------------------------------------

PIMEM MEM START=0x1C000000 END=0x1FFFFFFF

----------------------------------------------------------------------------------------

-- Memory: BOOT_ROM

----------------------------------------------------------------------------------------

BOOT_ROM MEM START=0x00300000 END=0x0033BFFF

----------------------------------------------------------------------------------------

-- Memory: RPM_CODE_RAM

----------------------------------------------------------------------------------------

RPM_CODE_RAM MEM START=0x00200000 END=0x00227FFF

----------------------------------------------------------------------------------------

-- Memory: RPM_DATA_RAM

----------------------------------------------------------------------------------------

RPM_DATA_RAM MEM START=0x00290000 END=0x002A3FFF

----------------------------------------------------------------------------------------

-- Memory: RPM_SS_MSG_RAM

----------------------------------------------------------------------------------------

RPM_SS_MSG_RAM MEM START=0x00778000 END=0x0077EFFF

----------------------------------------------------------------------------------------

-- Memory: DCC_RAM

----------------------------------------------------------------------------------------

DCC_RAM MEM START=0x010B4000 END=0x010B47FF

----------------------------------------------------------------------------------------

-- Memory: MSS_QDSP6_TCM

----------------------------------------------------------------------------------------

MSS_QDSP6_TCM MEM START=0x04400000 END=0x047FFFFF

----------------------------------------------------------------------------------------

-- Memory: SSC_QDSP6_TCM

----------------------------------------------------------------------------------------

SSC_QDSP6_TCM MEM START=0x05800000 END=0x05BFFFFF

----------------------------------------------------------------------------------------

-- Memory: SSC_STM

----------------------------------------------------------------------------------------

SSC_STM MEM START=0x05D00000 END=0x05DFFFFF

----------------------------------------------------------------------------------------

-- Memory: LPASS_QDSP6_TCM

----------------------------------------------------------------------------------------

LPASS_QDSP6_TCM MEM START=0x17400000 END=0x177FFFFF

----------------------------------------------------------------------------------------

-- Memory: SSC_RAM

----------------------------------------------------------------------------------------

SSC_RAM MEM START=0x05EC0000 END=0x05EC67FF

----------------------------------------------------------------------------------------

-- Memory: QDSS_STM

----------------------------------------------------------------------------------------

QDSS_STM MEM START=0x16000000 END=0x16FFFFFF

----------------------------------------------------------------------------------------

-- Memory: L2_TCM

----------------------------------------------------------------------------------------

L2_TCM MEM START=0x14000000 END=0x140FFFFF

----------------------------------------------------------------------------------------

-- Memory: WCSS_CMEM

----------------------------------------------------------------------------------------

WCSS_CMEM MEM START=0x189C0000 END=0x189CFFFF

----------------------------------------------------------------------------------------

-- Memory: DDR_MEM

----------------------------------------------------------------------------------------

DDR_MEM MEM START=0x80000000 END=0x1FFFFFFFF