U-boot on r7000?

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


Joined: 30 Aug 2021
Posts: 3

PostPosted: Fri Sep 03, 2021 22:40    Post subject: U-boot on r7000? Reply with quote
Hello Guru,
I am little new in this forum as you can see on post count Smile. I want to know can I port U-boot (Das U-boot) on r7000.
Like there is asus router with same specs using U-boot for antenna but I want to use U-boot as main bootloader. Is this possible if not can you please give some reasons.
Sponsor
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Mon Sep 06, 2021 14:49    Post subject: Re: U-boot on r7000? Reply with quote
ciggi wrote:
Hello Guru,
I am little new in this forum as you can see on post count Smile. I want to know can I port U-boot (Das U-boot) on r7000.
Like there is asus router with same specs using U-boot for antenna but I want to use U-boot as main bootloader. Is this possible if not can you please give some reasons.


You should be able to compile a different bootloader and have it run on the R7000. The problem is that the R7000 ships with a Broadcom CFE bootloader and DD-WRT piggy backs that with a newer CFE bootloader to do it's thing; making the core bootloader irrelevant for the most part. If the core bootloader is corrupt you end up with a irrecoverable door stop that will require a chip programmer to fix. The "Stock" bootloader is really old and both Netgear and Broadcom don't care. Switching to U-Boot could make DD-WRT and other firmwares including "Stock" not work at all. The other problem is the hardware has to match exactly or it wont work. The ASUS RT-AC68P/ASUS RT-AC68U firmware is compatible with the core hardware with some modification. The TP-LINK C9 V5 shares common hardware as well, I believe it uses a U-Boot bootloader, you might have to dig through the source code.

https://www.tp-link.com/us/support/download/archer-c9/v5/#GPL-Code
https://static.tp-link.com/resources/gpl/GPL_C9v5_EU_20170110.tar.gz

GPL_C9v5_EU_20170110.tar\GPL_C9v5_EU_20170110\boards\model_brcm_bcm470x\toolchain\hndtools-arm-linux-2.6.36-uclibc-4.5.3\src\buildroot-2012.02.tar\buildroot-2012.02\boot\uboot\uboot-2011.12

http://en.techinfodepot.shoutwiki.com/wiki/Netgear_R7000

https://openwrt.org/toh/netgear/r7000
https://wikidevi.wi-cat.ru/Broadcom/SoC

https://tinyurl.com/BCM4709A0-Search---WikiDevi

https://en.wikipedia.org/wiki/Das_U-Boot

https://openwrt.org/toh/hwdata/netgear/netgear_r7000


Last edited by twindragon6 on Tue Sep 07, 2021 6:06; edited 3 times in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Mon Sep 06, 2021 15:10    Post subject: Reply with quote
twindragon6 wrote:
The problem is that the R7000 ships with a Broadcom CFE bootloader and DD-WRT piggy backs that with a newer CFE bootloader to do it's thing; making the core bootloader irrelevant for the most part.....The TP-LINK C9 V5 shares common hardware as well, I believe it uses a U-Boot bootloader.


There are only certain devices where the bootloader is replaced (i.e. VxWorks WRT54* Linksys devices), AFAIK. Otherwise, all the how-tos would tell us to back up the CFE via serial console before loading DD-WRT. There is so much confused misinformation on this forum that continuing to purvey an across-the-board statement based on some posts or blog articles or someone's "expert" opinion without proof is what gets folks in trouble. If you can show picture proof that your R7000 CFE was one version before flashing DD-WRT and is a completely different version now, then that is one thing. I don't know of any in-firmware updates to the CFE nor have seen any code in the write mechanism that even touches that part of the flash as best I can tell. I could be wrong, but I would prefer proof of concept if you state something like that. Also, I do not know where the heck you go the info on the C9v5, but it doesn't use U-Boot , lol. WOW.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315680

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 5:07    Post subject: Reply with quote
kernel-panic69 wrote:
twindragon6 wrote:
The problem is that the R7000 ships with a Broadcom CFE bootloader and DD-WRT piggy backs that with a newer CFE bootloader to do it's thing; making the core bootloader irrelevant for the most part.....The TP-LINK C9 V5 shares common hardware as well, I believe it uses a U-Boot bootloader.


There are only certain devices where the bootloader is replaced (i.e. VxWorks WRT54* Linksys devices), AFAIK. Otherwise, all the how-tos would tell us to back up the CFE via serial console before loading DD-WRT. There is so much confused misinformation on this forum that continuing to purvey an across-the-board statement based on some posts or blog articles or someone's "expert" opinion without proof is what gets folks in trouble. If you can show picture proof that your R7000 CFE was one version before flashing DD-WRT and is a completely different version now, then that is one thing. I don't know of any in-firmware updates to the CFE nor have seen any code in the write mechanism that even touches that part of the flash as best I can tell. I could be wrong, but I would prefer proof of concept if you state something like that. Also, I do not know where the heck you go the info on the C9v5, but it doesn't use U-Boot , lol. WOW.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315680


I understand that, he's talking about replacing the bootloader altogether with U-Boot. It's not a good idea but is possible. Maybe he has a specific reason for doing it. It generally will break all compatibility with any firmware thereafter. As far as CFE replacement; people do it all the time, I just did! Here, see for yourself!

Checking your current version:
nvram show | grep version

CFEEdit instructions:

Don't touch advanced!!!

Change your MAC!

ETH MAC Address = Address from sticker
WL1 MAC Address = ETH MAC Address + 2
WL2 MAC Address = ETH MAC Address + 7

Save, Overwrite, Flash!



cfe_r7000_MOD.bin
 Description:
ASUS RT-AC68U C0 CFE V1.3.0.7 Configured as a Stock R7000

Download
 Filename:  cfe_r7000_MOD.bin
 Filesize:  512 KB
 Downloaded:  188 Time(s)


CFEEdit.zip
 Description:
Tool to change MAC's and edit Config before flashing (Do This First!!!)

Download
 Filename:  CFEEdit.zip
 Filesize:  607.74 KB
 Downloaded:  257 Time(s)



Last edited by twindragon6 on Sat Sep 25, 2021 0:05; edited 8 times in total
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 5:12    Post subject: Config Reply with quote
Modified Config and how to flash!
Backup your CFE first!!!

https://wiki.dd-wrt.com/wiki/index.php/Broadcom_CFE_backup

For the R7000:
You have to use (Via Telnet, SSH or Console):

Use WinSCP to transfer the file to the appropriate folder.

https://forum.dd-wrt.com/wiki/index.php/WinSCP

To unlock your CFE before writing with:
mtd unlock /dev/mtd0

Write it with:
mtd -f write /tmp/root/cfe_r7000_MOD.bin /dev/mtd0

This gives an unlock error but it writes anyway!

root@R7000:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "boot" <<== The CFE lives here.
mtd1: 00180000 00020000 "nvram"
mtd2: 02000000 00020000 "linux"
mtd3: 01ea0000 00020000 "rootfs"
mtd4: 00040000 00020000 "board_data"
mtd5: 05dc0000 00020000 "ddwrt"

Or you could use the "mtd0" label "boot"


Don't brick your $#!*!!!!



CONFIG.txt
 Description:
R7000 Slightly Tweaked From Stock Config.

Download
 Filename:  CONFIG.txt
 Filesize:  941 Bytes
 Downloaded:  158 Time(s)


CONFIG.txt
 Description:
Stock Netgear R7000 Config

Download
 Filename:  CONFIG.txt
 Filesize:  453 Bytes
 Downloaded:  220 Time(s)



Last edited by twindragon6 on Thu Sep 23, 2021 9:58; edited 4 times in total
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 6:11    Post subject: Netgear Nighthawk R7000 Reply with quote
Stock Untouched CFE


CFE.BIN
 Description:
Stock Netgear R7000 CFE

Download
 Filename:  CFE.BIN
 Filesize:  512 KB
 Downloaded:  251 Time(s)

kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Tue Sep 07, 2021 12:38    Post subject: Reply with quote
You didn't even read the thread I linked. It has the serial boot log for the C9v5 in a zip file on page 3.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315680&postdays=0&postorder=asc&start=30

Now, from what I understand, it has a weird flash layout that one bootloader loads a jffs image:
BrainSlayer wrote:
since the beginning. the firmware format is different from all others.
it contains a signature. and the rest is just a jffs file. within the
jffs file there is a ram cfe. the original bootloader loads this
bootloader from this

So, it's possible that the main bootloader is u-boot, considering your edited post; so in that respect, I stand partially corrected. You don't seem to understand that I was directly involved in trying to get that device supported and that BS and I are in constant email contact.

Again, making a blanket statement that flashing DD-WRT automagically replaces the bootloader on all routers is not correct and your extra posts were unnecessary. Rolling Eyes

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 16:58    Post subject: Reply with quote
kernel-panic69 wrote:
You didn't even read the thread I linked. It has the serial boot log for the C9v5 in a zip file on page 3.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=315680&postdays=0&postorder=asc&start=30

Now, from what I understand, it has a weird flash layout that one bootloader loads a jffs image:
BrainSlayer wrote:
since the beginning. the firmware format is different from all others.
it contains a signature. and the rest is just a jffs file. within the
jffs file there is a ram cfe. the original bootloader loads this
bootloader from this

So, it's possible that the main bootloader is u-boot, considering your edited post; so in that respect, I stand partially corrected. You don't seem to understand that I was directly involved in trying to get that device supported and that BS and I are in constant email contact.

Again, making a blanket statement that flashing DD-WRT automagically replaces the bootloader on all routers is not correct and your extra posts were unnecessary. Rolling Eyes


I never said it does! I said it chainloads another CFE! DD-WRT is one of the relatively safe firmwares to flash because of this. BS was tired of hitting the CFE wall.

(Don't Flash The cfe_600.bin!!!)



cfe_600.bin
 Description:
Extracted From DD-WRT Firmware.

Download
 Filename:  cfe_600.bin
 Filesize:  237.79 KB
 Downloaded:  176 Time(s)



Last edited by twindragon6 on Tue Sep 07, 2021 18:24; edited 1 time in total
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Tue Sep 07, 2021 17:24    Post subject: Reply with quote
Which partition is that from? I am not finding it in any .chk or .bin file. Full proof of concept would do wonders.

And let us know if you lose your settings when you reboot with the modified CFE or not.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 18:21    Post subject: Reply with quote
kernel-panic69 wrote:
Which partition is that from? I am not finding it in any .chk or .bin file. Full proof of concept would do wonders.

And let us know if you lose your settings when you reboot with the modified CFE or not.


ftp://ftp.dd-wrt.com/betas/2021/09-03-2021-r47305/netgear-r7000/factory-to-dd-wrt.chk

\factory-to-dd-wrt\etc\cfe

(Don't Flash the cfe_600.bin!!!)


So far so good with the cfe_r7000_MOD.bin

It's based on XWRT-VORTEX/OpenWRT toolchain and source but instead of trying to make the R7000 into a Asus RT-AC68U;
I modified the CFE to be as close to a stock R7000 as possible without breaking compatibility with "Stock" and other firmwares.
I'll write something up in a new post.


Misc Supporting Links:

https://downloads.openwrt.org/releases/21.02.0/targets/bcm53xx/generic/

http://xvtx.ru/xwrt/download.htm

https://mega.nz/folder/ct9zUaCS#lG4g5i5SDhSzG_NH-QSl1g

https://raw.githubusercontent.com/RMerl/asuswrt-merlin/master/release/src-rt-6.x.4708/cfe/build/broadcom/bcm947xx/compressed/rt-ac68u_nvram.txt

https://dlcdnets.asus.com/pub/ASUS/wireless/RT-AC68U/FW_RT_AC68U_300438643129.zip

FW_RT_AC68U_300438643129\Firmware_Release\RT-AC68U_3.0.0.4_386_43129-g60defb2\rom\cfe

https://www.downloads.netgear.com/files/GPL/R7000-V1.0.11.126_10.2.112_src.tar.zip
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Tue Sep 07, 2021 19:08    Post subject: Reply with quote
Okay, because I am painfully anal about specifics: What method did you use to extract the CFE_600.bin? Binwalk? You have to realize that people reading along are not inside your head and don't know exactly what process(es) you're using.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Tue Sep 07, 2021 19:38    Post subject: Reply with quote
kernel-panic69 wrote:
Okay, because I am painfully anal about specifics: What method did you use to extract the CFE_600.bin? Binwalk? You have to realize that people reading along are not inside your head and don't know exactly what process(es) you're using.


Oops! Sorry about that *.chk files are basically *.zip files. I used 7-Zip or UniExtract 2. I downloaded the factory-to-dd-wrt.chk from DD-WRT's FTP and then extracted it.

https://www.7-zip.org/download.html

https://sourceforge.net/projects/sevenzip/files/

https://github.com/Bioruebe/UniExtract2/releases
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Tue Sep 07, 2021 22:15    Post subject: Reply with quote
Upon further investigation, this extra cfe_600.bin doesn't seem to apply to all Broadcom devices as best I can tell (can't extract .trx or .bin files in a straightforward manner and I haven't taken the time to use binwalk); it was also not present in <Kong> builds.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
twindragon6
DD-WRT User


Joined: 29 Jun 2008
Posts: 332

PostPosted: Wed Sep 08, 2021 1:21    Post subject: Reply with quote
kernel-panic69 wrote:
Upon further investigation, this extra cfe_600.bin doesn't seem to apply to all Broadcom devices as best I can tell (can't extract .trx or .bin files in a straightforward manner and I haven't taken the time to use binwalk); it was also not present in <Kong> builds.
That's the piggy back CFE to get DD-WRT up and running on the R7000. Dig into the source code.

svn co svn://svn.dd-wrt.com/DD-WRT
https://github.com/mirror/dd-wrt
ftp://ftp.dd-wrt.com/../toolchains/toolchains.tar.xz
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14208
Location: Texas, USA

PostPosted: Wed Sep 08, 2021 2:57    Post subject: Reply with quote
One of my R7000s was flashed with <Kong> .chk for initial flash and has been upgraded to Official and Community builds without issue.



But since you wish to go there...
Makefile.northstar
build_northstar.sh
.config_northstar
https://svn.dd-wrt.com/browser/src/router/rules/all.mk
https://svn.dd-wrt.com/browser/src/router/others/Makefile <--- winner winner big chicken dinner.
BUT, this is only specific to BS builds.... see attachment of extracted view of 06-08-2019 <Kong> build.
None of his Northstar builds had that file in it as best I recall.



dd-wrt.K3_R7000.chk.png
 Description:
 Filesize:  44.17 KB
 Viewed:  5023 Time(s)

dd-wrt.K3_R7000.chk.png



_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
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