Amiko Alien2 Enigma2 BOOT problem

amiko bootAfter Amiko Alien2 bought, I tried to install AR-P image of Enigma2/PLI. But unfortunaly there was a problem with flash IC and bootloader.

 I able to boot only SPARK image, and even if I choose boot from enigma [ENIG] that i wrote to flash - tuner can't boot to it.
 

 

 

 

 

 

 

 

 

Author is not liable for any damage caused to the equipment during the following this how-to, do it on your own risk!

 

 

Symptomes:

The message that I see after I choose "Boot To E2" in "Reset To Factory Defaults" menu saying this:

Board: STx7105-PDK  [32-bit mode]                                                                                    


U-Boot 1.3.1 (Jun 19 2012 - 17:10:44) - stm23_0051 - YW_1.1.005 overclock

DRAM:  256 MiB
Panel: VFD
NAND:  Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
512 MiB
SPI:  ERROR: Unknown SPI Device detected, devid = 0x01, 0x02, 0x14
ERROR: Offset out of range (max=0xffffffff)
In:    serial
Out:   serial
Err:   serial
Ident ic exist
Ident ic get stb id
IdentID : 0c 00 0a 00 00 2b c1 
PDK7105>

So, before I set "Boot To E2", the bootloader's environment variables area (0x0a0000...0x0c0000) was totally clean, and now it have env data, but bootloader ignoring it, and fails.

After studying U-Boot sources I found that Amiko's manufacture changed Flash-IC, It was at the 2nd-time, since they started selling that device!

Here is list of SPI-flash chips, used in this tuner:

  • Spansion S25FL016K (2MB) with JEDEC ID: 0xEF4015 (This flash chip is originally supported by U-Boot)
  • Atmel AT25DF161 (2MB) with JEDEC ID: 0x1F4602 (This flash chip support added in U-Boot of AMIKO_ALIEN2_1.2.51_E2_Boot_Upgrade.rar firmware)
  • Spansion S25FL016A (2MB) with JEDEC ID: 0x010214 (This flash chip is not supported by U-Boot)

So my tuner have last IC and it's not supported by any U-Boot versions, provided by vendor. Just imagine one last letter do whole trick: S25FL016K vs S25FL016A

 

So, if you are seeing exactly this message in console:

SPI:  ERROR: Unknown SPI Device detected, devid = 0x01, 0x02, 0x14 

Then you are have SPI-flash that does not supported by U-Boot.

WARNING: if you see different numbers on devid, DO NOT FOLLOW THIS GUIDE, you will brick it!

 

 

Solution description:

 

To add support for this chip, patched version of U-Boot is needed, here is changes t:

RAM:8FF21D5C ; ---------------------------------------------------------------------------
RAM:8FF21D5C
RAM:8FF21D5C loc_8FF21D5C:                           ; CODE XREF: sub_8FF21B64:loc_8FF21CB8j
RAM:8FF21D5C                 mov.w   #h'EF, r2       ; EF => 01
RAM:8FF21D5E                 cmp/eq  r2, r5
RAM:8FF21D60                 bf/s    loc_8FF21D94
RAM:8FF21D62                 mov     r15, r2
RAM:8FF21D64                 add     #6, r2
RAM:8FF21D66                 mov.b   @r2, r2
RAM:8FF21D68                 mov     r2, r0
RAM:8FF21D6A                 cmp/eq  #h'40, r0       ; 40 => 02
RAM:8FF21D6C                 bf/s    loc_8FF21DD0
RAM:8FF21D6E                 mov     r15, r2
RAM:8FF21D70                 add     #7, r2
RAM:8FF21D72                 mov.b   @r2, r2
RAM:8FF21D74                 mov     r2, r0
RAM:8FF21D76                 cmp/eq  #h'15, r0       ; 15 => 14
RAM:8FF21D78                 bf/s    loc_8FF21DD0
RAM:8FF21D7A                 mov     r15, r2
RAM:8FF21D7C                 mov.w   #h'100, r3
RAM:8FF21D7E                 mov.l   #pageSize_8FF4A6B0, r2
RAM:8FF21D80                 mov.l   r3, @r2
RAM:8FF21D82                 mov.l   #h'10000, r3
RAM:8FF21D84                 mov.l   #eraseSize_8FF4A6A8, r2
RAM:8FF21D86                 mov.l   r3, @r2
RAM:8FF21D88                 mov.l   #h'200000, r3
RAM:8FF21D8A                 mov.l   #deviceSize_8FF4A6AC, r2
RAM:8FF21D8C                 mov.l   r3, @r2
RAM:8FF21D8E                 mov.l   #aS25fl016k, r3 ; "S25FL016K"  (change to S25FL016A)
RAM:8FF21D90                 bra     loc_8FF21C0C
RAM:8FF21D92                 nop

 

At the link below, you can download patched version of U-Boot (original Spark 1.2.54 U-Boot used as source):

alien2.u-boot.S25FL016A.bin.zip

 

 

Solution Guide:

To flash this U-Boot to your tuner:

  1. Download and unzip that file to the root directory of the flash drive.
  2. Run spark, if your tuner is not able to run it, force running by setting this commands in console:
    setenv bootargs "console=ttyAS1,115200 rw ramdisk_size=6144 root=/dev/ram0 init=/linuxrc nwhwconf=device:eth0,hwaddr:00:80:E1:12:40:69 ip=192.168.0.69:192.168.3.119:192.168.3.1:255.255.0.0:Spark:eth0:off stmmaceth=msglvl:0,phyaddr:1,watchdog:5000 bigphysarea=7000"
    nboot.i 0x80000000 0 0x00100000 ;bootm 0x80000000

    After this commands, spark must boot...

  3. After Spark booted, insert USB-flash frive to the back USB-port of tuner.
  4. Connect tuner to network and configure it.
  5. Run Putty/telnet on the host PC, and get access to the tuner.
  6. make sure you have u-boot on USB-flash drive:
    ls -la /storage/c/u-boot.S25FL016A.bin

    The output of this command must be like this:

    -rwxr-xr-x    1 root     root       1048576 Oct 12  2013 /storage/c/u-boot.S25FL016A.bin
  7. insert i2s.ko module:
    insmod /root/spark/modules/i2s.ko
  8. Burn flash with new U-Boot:
    flash_eraseall /dev/mtd7; flashcp -v /storage/c/u-boot.S25FL016A.bin /dev/mtd7; sync
  9. Reboot the tuner:
    reboot

 

 

Results:

 

After flashing new bootloader, You will see that spi-flash detected correctly:

Board: STx7105-PDK  [32-bit mode]


U-Boot 1.3.1 (Jun 19 2012 - 17:10:44) - stm23_0051 - YW_1.1.005 overclock

DRAM:  256 MiB
Panel: VFD
NAND:  Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
512 MiB
SPI:  info: found S25FL016A (2MiB) device (page=256,erase=65536)
warning: SPI device may be write-protected (status=0x9c)
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Ident ic exist
Ident ic get stb id
IdentID : 0c 00 0a 00 00 2b c1 
Hit ESC to stop autoboot:  0 

The message

*** Warning - bad CRC, using default environment

means that environment partition - is clean yet.

 

 

Booting to Enigma:

 

So let's try to set boot from enigma now:

  1. Turn off tuner
  2. push [OK] and keep pushed
  3. Turn on tuner, you'l have to see [FORC] on display.
  4. release [OK] button
  5. push [DOWN], you'll have to see [ENIG]
  6. push [OK] and release (the tuner successfuly sets env variables, and boot to enigma)

The sample of successful setting of enigma-related environment variables:

DRAM:  256 MiB
Panel: VFD
NAND:  Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
512 MiB
SPI:  info: found S25FL016A (2MiB) device (page=256,erase=65536)
warning: SPI device may be write-protected (status=0x9c)
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Ident ic exist
Ident ic get stb id
IdentID : 0c 00 0a 00 00 2b c1 
Hit ESC to stop autoboot:  3 
Force command mode:Select boot (current boot system : spark):
1. spark(up key)
2. enigma2(down key)
3. RS232 Upgrade u-boot(left key)
4. Force into factory mode(right key)
Input Select:
set bootargs to bootargs_enigma2
..
SUCC
 0 

Congratulations, now your U-Boot understands environment variables, and there is no more "bad CRC" warnings related to environment vars.

Sahar (not verified)

Thu, 10/17/2013 - 22:45

Thanks for sharing!

Do you know what I can do if with this error: SPI: ERROR: Unknown SPI Device detected, devid = 0x1f, 0x46, 0x02 ?

Happen after trying those command in effort to fix Alien2 stuck on boot:

PDK7105> set bootargs console=ttyAS0,115200 rw ramdisk_size=6144 init=/linuxrc root=/dev/ram0 nwhwconf=device:eth0,hwaddr:00:06:37:04:15:00 ip=192.168.40.83:192.168.40.19:192.168.40.1:255.255.0.0:lh:eth0:off stmmaceth=msglvl:0,phyaddr:1,watchdog:5000 bigphysarea=6000

PDK7105> nboot.i 0x80000000 0 0x00100000 ;bootm 0x80000000