1

Temat: Kompilacja U-Boot od pepe2k

Przymierzam się do aktualizacji Gargoyle i przy okazji chciałem zabezpieczyć się na przyszłość nowym boot loaderem.
Możecie zerknąć czy dobrze skompilowałem, wolę się upewnić zanim wrzucę to do routera smile

Ściągnąłem "Sourcery CodeBench Lite Edition for MIPS GNU/Linux" i wrzuciłem do /toolchain w głównym katalogu ze źródłami.
Edytowałem makefile:

export BUILD_TOPDIR=$(PWD)
export STAGING_DIR=$(BUILD_TOPDIR)/tmp

# export MAKECMD=make --silent ARCH=mips CROSS_COMPILE=mips-linux-gnu-
export MAKECMD=make --silent ARCH=mips CROSS_COMPILE=mipsel-unknown-linux-gnu-
export PATH:=$(BUILD_TOPDIR)/toolchain/bin/:$(PATH)

Kompilacja przebiegła następująco; przejmować się tymi "warningami" ?

phenom Pobrane # 
phenom u-boot_mod-master # make tplink_wdr3600_43x0
======= Configuring for TP-Link TL-WDR3600/43x0 at: czw, 1 maj 2014, 13:04:40 CEST =======
Makefile:219: uwaga: polecenia zakrywające dla obiektu `board/ar7240/db12x/libdb12x.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `board/ar7240/db12x/libdb12x.a'
Makefile:219: uwaga: polecenia zakrywające dla obiektu `cpu/mips/libmips.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `cpu/mips/libmips.a'
Makefile:219: uwaga: polecenia zakrywające dla obiektu `cpu/mips/ar7240/libar7240.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `cpu/mips/ar7240/libar7240.a'
a - crc32.o
a - ctype.o
a - display_options.o
a - ldiv.o
a - string.o
a - vsprintf.o
a - LzmaWrapper.o
a - LzmaDecode.o
a - main.o
a - cmd_bootm.o
a - cmd_boot.o
a - cmd_flash.o
a - cmd_mem.o
a - cmd_custom.o
a - cmd_net.o
a - cmd_nvedit.o
a - cmd_itest.o
a - command.o
a - console.o
a - devices.o
a - dlmalloc.o
a - environment.o
a - env_common.o
a - env_nowhere.o
a - exports.o
a - flash.o
a - lists.o
a - env_flash.o
a - hush.o
a - db12x.o
a - ../common/ar7240_pci.o
a - ../common/ar7240_flash.o
a - ../common/athrs17_phy.o
a - ../common/lowlevel_init_934x.o
a - cpu.o
a - cache.o
meminit.c: In function 'wasp_ddr_initial_config':
meminit.c:77: warning: 'type' may be used uninitialized in this function
meminit.c:77: warning: 'tap_val' may be used uninitialized in this function
meminit.c:77: warning: 'cycle_val' may be used uninitialized in this function
meminit.c:77: warning: 'ext_mod' may be used uninitialized in this function
meminit.c:77: warning: 'ddr_config2' may be used uninitialized in this function
meminit.c:77: warning: 'ddr_config' may be used uninitialized in this function
ar7240_serial.c: In function 'ar7240_sys_frequency':
ar7240_serial.c:51: warning: unused variable 'frac'
ar7240_serial.c:51: warning: unused variable 'nfrac'
a - meminit.o
a - ar7240_serial.o
a - ag934x.o
a - board.o
a - time.o
a - mips_linux.o
a - netconsole.o
a - pci.o
a - net.o
a - tftp.o
a - rarp.o
a - eth.o
a - bootp.o
a - sntp.o
a - httpd.o
a - date.o
a - uip.o
a - uip_arch.o
a - uip_arp.o
a - httpd.o
a - fs.o
a - bootstrap_board.o
a - LzmaDecode.o
a - string.o
a - crc32.o
a - LzmaWrapper.o
a - time.o
Image Name:   u-boot image
Created:      Thu May  1 13:04:49 2014
Image Type:   MIPS Linux Firmware (lzma compressed)
Data Size:    44749 Bytes = 43.70 kB = 0.04 MB
Load Address: 0x80010000
Entry Point:  0x80010000
make[1]: Wejście do katalogu `/home/cinek/Pobrane/u-boot_mod-master'
-e 
======= Preparing 64KB file filled with 0xFF... =======
64+0 przeczytanych recordów
128+0 zapisanych recordów
skopiowane 65536 bajtów (66 kB), 0,000982175 s, 66,7 MB/s
-e 
======= Copying U-Boot image... =======
115+1 przeczytanych recordów
115+1 zapisanych recordów
skopiowane 59229 bajtów (59 kB), 0,000653015 s, 90,7 MB/s
-e 
======= U-Boot image ready, size: 65536 bytes =======

make[1]: Opuszczenie katalogu `/home/cinek/Pobrane/u-boot_mod-master'
phenom u-boot_mod-master # 
APU2 @ OpenWrt 18.06-SNAPSHOT, r7852-7ac6044632

2

Odp: Kompilacja U-Boot od pepe2k

A dlaczego edytowałeś Makefile i przestawiłeś sobie na LE, skoro powinno być BE?

3

Odp: Kompilacja U-Boot od pepe2k

Witaj pepe2k, czy jest już dostępna twoja modyfikacja u-boot na mr3220/mr4320 ver 1.2?

4

Odp: Kompilacja U-Boot od pepe2k

TranceEX napisał/a:

Witaj pepe2k, czy jest już dostępna twoja modyfikacja u-boot na mr3220/mr4320 ver 1.2?

Nie i nie przewiduję modyfikacji na stary, już nieprodukowany sprzęt.

5 (edytowany przez Graffy 2014-05-02 14:42:55)

Odp: Kompilacja U-Boot od pepe2k

pepe2k napisał/a:

A dlaczego edytowałeś Makefile i przestawiłeś sobie na LE, skoro powinno być BE?

No i wszystko jasne, ściągnąłem toolchain który polecałeś a użyłem od Synology, który akurat przypadkiem był w tym samym katalogu smile
Ściągnąłem toolchain w wersji instalacyjnej i teraz bez edycji makefile :

cinek@phenom ~/Pobrane/u-boot_mod.git/trunk $ make tplink_wdr3600_43x0
======= Configuring for TP-Link TL-WDR3600/43x0 at: pią, 2 maj 2014, 15:33:15 CEST =======
Makefile:219: uwaga: polecenia zakrywające dla obiektu `board/ar7240/db12x/libdb12x.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `board/ar7240/db12x/libdb12x.a'
Makefile:219: uwaga: polecenia zakrywające dla obiektu `cpu/mips/libmips.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `cpu/mips/libmips.a'
Makefile:219: uwaga: polecenia zakrywające dla obiektu `cpu/mips/ar7240/libar7240.a'
Makefile:188: uwaga: ignoruję stare polecenia dla obiektu `cpu/mips/ar7240/libar7240.a'
a - crc32.o
a - ctype.o
a - display_options.o
a - ldiv.o
a - string.o
a - vsprintf.o
a - LzmaWrapper.o
a - LzmaDecode.o
a - main.o
a - cmd_bootm.o
a - cmd_boot.o
a - cmd_flash.o
a - cmd_mem.o
a - cmd_custom.o
a - cmd_net.o
a - cmd_nvedit.o
a - cmd_itest.o
a - command.o
a - console.o
a - devices.o
a - dlmalloc.o
a - environment.o
a - env_common.o
a - env_nowhere.o
a - exports.o
a - flash.o
a - lists.o
a - env_flash.o
a - hush.o
a - db12x.o
a - ../common/ar7240_pci.o
a - ../common/ar7240_flash.o
a - ../common/athrs17_phy.o
a - ../common/lowlevel_init_934x.o
a - cpu.o
a - cache.o
meminit.c: In function 'wasp_ddr_initial_config':
meminit.c:242:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return(type);
  ^
In file included from meminit.c:54:0:
/home/cinek/Pobrane/u-boot_mod.git/trunk/u-boot/include/ar7240_soc.h:590:85: warning: 'tap_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define ar7240_reg_wr_nf(_phys, _val) ((*(volatile unsigned int *)KSEG1ADDR(_phys)) = (_val))
                                                                                     ^
meminit.c:77:74: note: 'tap_val' was declared here
  int ddr_config, ddr_config2, ext_mod, mod_val, mod_val_init, cycle_val, tap_val, type;
                                                                          ^
In file included from meminit.c:54:0:
/home/cinek/Pobrane/u-boot_mod.git/trunk/u-boot/include/ar7240_soc.h:590:85: warning: 'cycle_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define ar7240_reg_wr_nf(_phys, _val) ((*(volatile unsigned int *)KSEG1ADDR(_phys)) = (_val))
                                                                                     ^
meminit.c:77:63: note: 'cycle_val' was declared here
  int ddr_config, ddr_config2, ext_mod, mod_val, mod_val_init, cycle_val, tap_val, type;
                                                               ^
In file included from meminit.c:54:0:
/home/cinek/Pobrane/u-boot_mod.git/trunk/u-boot/include/ar7240_soc.h:590:85: warning: 'ext_mod' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define ar7240_reg_wr_nf(_phys, _val) ((*(volatile unsigned int *)KSEG1ADDR(_phys)) = (_val))
                                                                                     ^
meminit.c:77:31: note: 'ext_mod' was declared here
  int ddr_config, ddr_config2, ext_mod, mod_val, mod_val_init, cycle_val, tap_val, type;
                               ^
meminit.c:164:51: warning: 'ddr_config2' may be used uninitialized in this function [-Wmaybe-uninitialized]
  ar7240_reg_wr_nf(AR7240_DDR_CONFIG2, ddr_config2 | 0x80);
                                                   ^
In file included from meminit.c:54:0:
/home/cinek/Pobrane/u-boot_mod.git/trunk/u-boot/include/ar7240_soc.h:590:85: warning: 'ddr_config' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define ar7240_reg_wr_nf(_phys, _val) ((*(volatile unsigned int *)KSEG1ADDR(_phys)) = (_val))
                                                                                     ^
meminit.c:77:6: note: 'ddr_config' was declared here
  int ddr_config, ddr_config2, ext_mod, mod_val, mod_val_init, cycle_val, tap_val, type;
      ^
ar7240_serial.c: In function 'ar7240_sys_frequency':
ar7240_serial.c:51:52: warning: unused variable 'frac' [-Wunused-variable]
  u32 ref_rate, pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv, cpu_pll, ddr_pll;
                                                    ^
ar7240_serial.c:51:45: warning: unused variable 'nfrac' [-Wunused-variable]
  u32 ref_rate, pll, out_div, ref_div, nint, nfrac, frac, clk_ctrl, postdiv, cpu_pll, ddr_pll;
                                             ^
a - meminit.o
a - ar7240_serial.o
a - ag934x.o
a - board.o
a - time.o
a - mips_linux.o
a - netconsole.o
a - pci.o
a - net.o
a - tftp.o
a - rarp.o
a - eth.o
a - bootp.o
a - sntp.o
a - httpd.o
a - date.o
a - uip.o
a - uip_arch.o
a - uip_arp.o
a - httpd.o
a - fs.o
a - bootstrap_board.o
a - LzmaDecode.o
a - string.o
a - crc32.o
a - LzmaWrapper.o
a - time.o
Image Name:   u-boot image
Created:      Fri May  2 15:33:23 2014
Image Type:   MIPS Linux Firmware (lzma compressed)
Data Size:    48383 Bytes = 47.25 kB = 0.05 MB
Load Address: 0x80010000
Entry Point:  0x80010000
make[1]: Wejście do katalogu `/home/cinek/Pobrane/u-boot_mod.git/trunk'
-e 
======= Preparing 64KB file filled with 0xFF... =======
64+0 przeczytanych recordów
128+0 zapisanych recordów
skopiowane 65536 bajtów (66 kB), 0,000251416 s, 261 MB/s
-e 
======= Copying U-Boot image... =======
123+1 przeczytanych recordów
123+1 zapisanych recordów
skopiowane 63023 bajty (63 kB), 0,000198325 s, 318 MB/s
-e 
======= U-Boot image ready, size: 65536 bytes =======

make[1]: Opuszczenie katalogu `/home/cinek/Pobrane/u-boot_mod.git/trunk'
cinek@phenom ~/Pobrane/u-boot_mod.git/trunk $ 

Teraz jest OK ?

APU2 @ OpenWrt 18.06-SNAPSHOT, r7852-7ac6044632

6

Odp: Kompilacja U-Boot od pepe2k

Ostrzeżenia nie mają znaczenia, po prostu nie przejrzałem jeszcze tego kodu i nie poprawiłem co tam ewentualnie można poprawić. A to co Ty zrobiłeś wcześniej, to skompilowałeś kod na Little Endian... MIPS może pracować w obu trybach.

Nie masz żadnej możliwości sprawdzenia tego przed wgraniem do routera. Kompilacja przeszła bez problemów, a czy będzie działać - dowiesz się po wgraniu do FLASH i uruchomieniu routera smile

7

Odp: Kompilacja U-Boot od pepe2k

Ufff, router żyje smile
Dzięki @pepe2k za wskazówki.

APU2 @ OpenWrt 18.06-SNAPSHOT, r7852-7ac6044632