Liens de référence :\\
http://projects.doozan.com/uboot/build_uboot.htm\\
http://forum.doozan.com/read.php?3,1561\\
http://forum.doozan.com/read.php?3,6965,7162#msg-7162\\
http://forum.doozan.com/read.php?3,7477,7477#msg-7477
Après avoir installé une carte SD sur le DockStar, il faut réussir à démarrer dessus.\\
Pour se faire, il faut modifier U-Boot avec une prise en charge de la carte SD.
Commandes sur le Dockstar en liaison série : ''Marvell>>''\\
Commandes sur le PC : ''>''\\
==== Compilation ====
=== U-Boot 2010.09 ===
En partant d'une [[ftp://ftp.denx.de/pub/u-boot/u-boot-2010.09.tar.bz2|version 2010.09 de U-Boot]].\\
\\
Le patch complet (ajout support USB, MMC et configuration DockStar) à appliquer sur la version 2010.09 est {{:dockstar:boot:2010.09-sdio.patch|celui-ci}}.\\
>tar -xjf u-boot-2010.09.tar.bz2
>cp 2010.09-sdio.patch u-boot-2010.09/
>cd u-boot-2010.09
>patch -p1 < 2010.09-sdio.patch
>codesourcery-arm-2009q3.sh
>make distclean
>make dockstar_config
>make u-boot.kwb
>dd if=u-boot.kwb of=u-boot.mtd0.kwb bs=512k conv=sync
>exit
Modification de l'environnement précédent (u-boot.kwb de Jeff Doozan) :
Marvell>>setenv mmc_device 0:1
Marvell>>setenv mmc_root /dev/mmcblk0p1
Marvell>>setenv mmc_test if ext2load mmc \$mmc_device 0x800000 /boot/uImage 1\; then echo "Found bootable drive on SDCard"\; fi\; done
Marvell>>setenv mmc_init mmc init\; run mmc_test
Marvell>>setenv mmc_rootdelay 10
Marvell>>setenv mmc_rootfstype ext2
Marvell>>setenv mmc_set_bootargs setenv bootargs console=\$console root=\$mmc_root rootdelay=\$mmc_rootdelay rootfstype=\$mmc_rootfstype \$mtdparts
Marvell>>setenv mmc_boot "mw 0x800000 0 1\; ext2load mmc \$mmc_device 0x800000 /boot/uImage\; if ext2load mmc \$mmc_device 0x1100000 /boot/uInitrd\; then bootm 0x800000 0x1100000\; else bootm 0x800000\; fi"
Marvell>>setenv mmc_bootcmd run mmc_init\; run mmc_set_bootargs\; run mmc_boot
Marvell>>setenv usb_init usb start\; run usb_scan
Marvell>>setenv usb_bootcmd run usb_init\; run usb_set_bootargs\; run usb_boot
Marvell>>setenv bootcmd run mmc_bootcmd\; run usb_bootcmd\; usb stop\; run openwrt_bootcmd\; reset
=== U-Boot 2011.12 ===
Avec une [[ftp://ftp.denx.de/pub/u-boot/u-boot-2011.12.tar.bz2|version 2011.12]] plus récente.\\
\\
Application d'un patch {{:dockstar:boot:dockstar-uboot2011.12_dg.patch|créé par davygravy}} mais en enlevant la partie de configuration de l'environnement par défaut.\\
Un autre patch issu des travaux de Gérard Kerma sur le driver SDIO avec {{:dockstar:boot:kerma-kirkwood-mvsdio.diff|prise en compte de la carte SD}}.\\
>tar -xjf u-boot-2011.12.tar.bz2
>cp dockstar-uboot2011.12_dg.patch u-boot-2011.12/
>cp kerma-kirkwood-mvsdio.diff u-boot-2011.12/
>cd u-boot-2011.12
>patch -p1 < dockstar-uboot2011.12_dg.patch
>patch -p1 < kerma-kirkwood-mvsdio.diff
>codesourcery-arm-2009q3.sh
>make distclean
>make dockstar_config
>make u-boot.kwb
>dd if=u-boot.kwb of=u-boot.mtd0.kwb bs=512k conv=sync
>exit
==== Installation ====
**Faire un test de l'image u-boot.mtd0.kwb avant de l'installer.**\\
Ce test en RAM ne fonctionne pas toujours, les différentes tests réalisés sont les suivants (à confirmer, résultats de mémoire) :\\
| ^ 2010.09 ^^ 2011.12 ^^
|Fichier|/board/Marvell/dockstar/config.mk||/board/Seagate/dockstar/config.mk((Fichier à créer))||
|Variable| TEXT_BASE || CONFIG_SYS_TEXT_BASE ||
|Valeur| 0x00600000 | 0x00C00000 | 0x00600000 | 0x00C00000 |
|Résultat| OK | OK | KO((OK sans SDIO)) | KO((OK sans SDIO)) |
Pour tester, pas besoin d'installer un serveur TFTP (u-boot 2010.09 avec support USB ajouté et u-boot 2011.12 avec USB par défaut).\\
Copier les images u-boot.mtd0.kwb sur une clef USB.\\
Marvell>>usb start
Marvell>>ext2load usb 0:1 0x800000 uboot.mtd0.kwb
Marvell>>go 0x800200
U-Boot 2010.09 (Jul 07 2012 - 19:34:12)
Marvell-Dockstar - MMC/SD
SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
Marvell>>
**!!ATTENTION Toute erreur dans les lignes suivantes peut entrainer la perte du Dockstar!!\\
Bien vérifier les adresses avant de valider.**\\
Si l'application se lance à l'étape précédente, installation de l'image sur la NAND :
Marvell>>reset
Marvell>>usb start
Marvell>>ext2load usb 0:1 0x800000 uboot.mtd0.kwb
Marvell>>nand erase 0x0 0x80000
Marvell>>nand write.e 0x800000 0x0 0x80000
Marvell>>reset
resetting...
U-Boot 2010.09 (Jul 07 2012 - 19:34:12)
Marvell-Dockstar - MMC/SD
SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
Marvell>>
Si le Dockstar ne se lance plus après ces commandes, passage par la [[nas:dockstar:case_jtag]].
==== Problème rencontré ====
Erreur avec le pilote SDIO ou la lecture de la carte SD pour les versions 2010.09 et 2011.12 :\\
U-Boot 2011.12 (Jul 11 2012 - 19:03:43)
Seagate FreeAgent DockStar - SD/MMC
SoC: Kirkwood 88F6281_A0
DRAM: 128 MiB
WARNING: Caches not enabled
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Net: egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot: 0
SD found. Card desciption is:
Manufacturer: 0x03, OEM "SD"
Product name: "SU01G", revision 8.0
Serial number: 15472313
Manufacturing date: 9/2007
CRC: 0x00, b0 = 0
mmc block read error
mmc1 is available
No MMC card found
syntax error
mmc block read error
bad MBR sector signature 0x3135
** Bad partition 1 **
mmc block read error
bad MBR sector signature 0x0000
** Bad partition 1 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
**Brouillon**\\
Passer le driver SDIO en mode debug avec modification du fichier drivers/mmc/mv_sdio.c.\\
Le #define DEBUG est positionné au mauvais endroit dans le fichier mv_sdio.c, {{:dockstar:boot:debug-mv_sdio.diff|patch à appliquer}}.\\
>cp debug-mv_sdio.diff u-boot-2011.12
>cd u-boot-2011.12
>patch -p1 < debug-mv_sdio.diff
>codesourcery-arm-2009q3.sh
>make distclean
>make dockstar_config
>make u-boot.kwb
>dd if=u-boot.kwb of=u-boot.mtd0.kwb bs=512k conv=sync
>exit