smp86xx LZMA kernel loader for the pirelli/arcor stb ip100

Started by Hoernchen, 23. Feb 2009, 12:24

previous topic - next topic
Go Down

Hoernchen

23. Feb 2009, 12:24 Last Edit: 20. Jun 2009, 03:16 by Hoernchen
based on https://svn.openwrt.org/browser/trunk/target/linux/generic-2.6/image/lzma-loader/src/
includes the lzma sdk http://downloads.sourceforge.net/sevenzip/lzma432.tar.bz2

build lzma
Code: [Select]

tar xzf lzmaloader.tar.gz
cd lzmaloader
make -C lzma/C/7zip/Compress/LZMA_Alone -f makefile.gcc

then compress your vmlinux.bin
Code: [Select]
lzma/C/7zip/Compress/LZMA_Alone/lzma e /path/to/linux-2.6.15/arch/mips/boot/vmlinux.bin src/vmlinux.lzma -lc1 -lp2 -pb2
build the loader
Code: [Select]

cd src
make


then use yamon to load the resulting lzma.bin, for example by tftp:
Code: [Select]

net init; load -b tftp://192.168.2.3/path/to/lzma.bin 0x91400000; go


Caution: This will enable the usb ports before starting the kernel, so do not use it on a different smp based box without looking at the code first.

>>File<<

bringer of linux, conqueror of hdmi, jack of all trades.

Hoernchen

-fixed linker script and usb enable, previous version did not enable the usb ports. doh.
bringer of linux, conqueror of hdmi, jack of all trades.

dfox

Links are dead  :(

Hoernchen

bringer of linux, conqueror of hdmi, jack of all trades.

roleo

#4
03. Jun 2009, 19:03 Last Edit: 03. Jun 2009, 19:26 by roleo
Hi,
I'm trying to use your sources but when I run the last make I have the followinfg error:

Code: [Select]

mipsel-linux-uclibc-gcc -fno-builtin -Os -G 0 -ffunction-sections -mno-abicalls -fno-pic -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -Wall -DRAMSTART=0x92000000 -DRAMSIZE=0x00100000 -DKERNEL_ENTRY=0x90020000 -D_LZMA_IN_CB -c start.S -o start.o
mipsel-linux-uclibc-gcc -fno-builtin -Os -G 0 -ffunction-sections -mno-abicalls -fno-pic -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -Wall -DRAMSTART=0x92000000 -DRAMSIZE=0x00100000 -DKERNEL_ENTRY=0x90020000 -D_LZMA_IN_CB -c decompress.c -o decompress.o
decompress.c: In function `entry':
decompress.c:173: warning: assignment from incompatible pointer type
decompress.c:139: warning: unused variable `props'
mipsel-linux-uclibc-gcc -fno-builtin -Os -G 0 -ffunction-sections -mno-abicalls -fno-pic -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -Wall -DRAMSTART=0x92000000 -DRAMSIZE=0x00100000 -DKERNEL_ENTRY=0x90020000 -D_LZMA_IN_CB -c LzmaDecode.c -o LzmaDecode.o
sed -e 's,@LOADADDR@,0x91400000,g' -e 's,@ENTRY@,_start,g' lzma.lds.in >lzma.lds
mipsel-linux-uclibc-ld -r -b binary --oformat elf32-tradlittlemips -o kernel.o vmlinux.lzma
mipsel-linux-uclibc-gcc -fno-builtin -Os -G 0 -ffunction-sections -mno-abicalls -fno-pic -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -Wall -DRAMSTART=0x92000000 -DRAMSIZE=0x00100000 -DKERNEL_ENTRY=0x90020000 -D_LZMA_IN_CB -c uart.c -o uart.o
mipsel-linux-uclibc-ld -Map lzma.elf.map -s -Tlzma.lds -o lzma.elf start.o decompress.o LzmaDecode.o kernel.o uart.o
mipsel-linux-uclibc-objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S lzma.elf lzma.bin
BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0x91400000.
BFD: Warning: Writing section `.text.read_byte' to huge (ie negative) file offset 0x9151cdb4.
BFD: Warning: Writing section `.text.LzmaDecode' to huge (ie negative) file offset 0x9151cddc.
BFD: Warning: Writing section `.text.set_remap' to huge (ie negative) file offset 0x9151dd24.
BFD: Warning: Writing section `.text.gbus_readl' to huge (ie negative) file offset 0x9151dd5c.
BFD: Warning: Writing section `.text.gbus_writel' to huge (ie negative) file offset 0x9151ddf4.
BFD: Warning: Writing section `.text.uart_init_port' to huge (ie negative) file offset 0x9151de98.
BFD: Warning: Writing section `.text.uart_putc' to huge (ie negative) file offset 0x9151df44.
BFD: Warning: Writing section `.text.uart_puts' to huge (ie negative) file offset 0x9151dffc.
BFD: Warning: Writing section `.text.convert' to huge (ie negative) file offset 0x9151e03c.
BFD: Warning: Writing section `.text.myprintf' to huge (ie negative) file offset 0x9151e088.
BFD: Warning: Writing section `.reginfo' to huge (ie negative) file offset 0x9151e1f8.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset 0x9151e250.
mipsel-linux-uclibc-objcopy: lzma.bin: File truncated


Ideas?
Thank you.

--- EDIT ---

Partially solved.
Using a toolchain with gcc 4.0.4 works correctly.
Using a toolchain with gcc 3.4.2 doesn't work.

roleo

Hoernchen

How big is your vmlinux.lzma ?
bringer of linux, conqueror of hdmi, jack of all trades.

roleo


How big is your vmlinux.lzma ?


1165596

Could you explain me the meaning of the number 0xC in the following code

Code: [Select]

gpiodir = ((( 0xc & 0xffff) << 16) | 0xffff);
gpiodata = (( 0xc & 0xffff) << 16);
gbus_writel(0x10500, gpiodir);
gbus_writel(0x10504, gpiodata);


I'm trying to compare it with the commands inside a shell script in the pirelli original fw:

Code: [Select]

/bin/gpiotest WRITE 5 1 # usb reset high
/bin/gpiotest WRITE 2 0 # usbA enable (bottom USB slot on HY100 STB)
/bin/gpiotest WRITE 3 1 # usbB disable


but I can't understand.
Thank you for your support.

roleo

Hoernchen

0xc = 0b1100 ... gpio 2&3
bringer of linux, conqueror of hdmi, jack of all trades.

mce2222

update for SMP863x Rev C 

now USB ports are correctly enabled !


barth


update for SMP863x Rev C 

now USB ports are correctly enabled !



Many thanks to you mce2222 and to Hoernchen!
Now owners of STB HY100 are ables to load AZBox adapted fw following detailed informations in
http://hy100wiki.algasystems.net/wiki/doku.php/azbox_firmware
and using new lzmaloader from mce2222 instead of the one in the wiki!

I will try soon and I will be back to you with my results!

Regrds
Barth

roleo

#10
20. Jun 2009, 14:57 Last Edit: 20. Jun 2009, 15:00 by roleo

update for SMP863x Rev C 

now USB ports are correctly enabled !


It's working properly for me!!!
Thank you to mce2222 and Hoernchen :):):)


heimi666

I tried the loader and I found some solutions:

- To get around an
"unrecognized opcode `__asm__" Problem im e.g. asm/hazards.h:172
add "-D __ASSEMBLY__" to Make Rules

- The
"Warning: Writing section xxx to huge"
can be prevented by changing
*(.rodata)
to:
*(.rodata) *(.rodata.*)
in the linker script (lzma.lds.in)


heimi666

I finally
- compiled a 2.6 kernel
- added loader
but without success, my kernel won't boot and usb didn't work either. (coprocessor error)
So I decompresses the provided kernel compressed it again and added the loader. Booting was successfull, no usb but nfs was possible.
The coprocessor problem was fixed by building vmlinux.bin not vmlinux which was ELf (silly me).
After applying ltrace (patched to mips by freetz.org guys) to a programm called usb_enable in my rom firmware I could extract the sequence to enable usb on my plattform, but I also found out that this could be managed directly in YAMON with appropriate gw32 commands, but now I'm able to build a loader with usb enabled.

Go Up