[U-Boot] Socfpga preloader signing patch

Hi!
I'm trying to get custom preloader to work (on EBV Socrates)... I tried applying old patch from mail archives, but a) applying patch from mail archives is not fun and b) it did not seem to do the trick.
Do you have newer version of the socfpga image signing patch by chance? (Or v7 in format more suitable for application than web archive?)
Thanks, Pavel

Hi!
I'm trying to get custom preloader to work (on EBV Socrates)... I tried applying old patch from mail archives, but a) applying patch from mail archives is not fun and b) it did not seem to do the trick.
Just to make sure... right way to use the socfpga-signed-preloader.bin is
dd if=socfpga-signed-preloader.bin of=/dev/mmcblk0p1 bs=64k seek=0 dd if=u-boot.img of=/dev/mmcblk0p1 bs=64K seek=4
right?
Thanks, Pavel

On Fri, 2014-04-04 at 22:47 +0200, Pavel Machek wrote:
Hi!
I'm trying to get custom preloader to work (on EBV Socrates)... I tried applying old patch from mail archives, but a) applying patch from mail archives is not fun and b) it did not seem to do the trick.
Just to make sure... right way to use the socfpga-signed-preloader.bin is
dd if=socfpga-signed-preloader.bin of=/dev/mmcblk0p1 bs=64k seek=0 dd if=u-boot.img of=/dev/mmcblk0p1 bs=64K seek=4
Assuming that mmcblk0p1 is the raw partition (type A2) on your disk, then yes these are the correct instructions. You only update one of the four preloader copies, but this is fine as well. Cannot spot a problem here.
virtually yours Gerhard Sittig

On Saturday 05 April 2014 09:47:02 Pavel Machek wrote:
Hi!
I'm trying to get custom preloader to work (on EBV Socrates)... I tried applying old patch from mail archives, but a) applying patch from mail archives is not fun and b) it did not seem to do the trick.
Just to make sure... right way to use the socfpga-signed-preloader.bin is
dd if=socfpga-signed-preloader.bin of=/dev/mmcblk0p1 bs=64k seek=0 dd if=u-boot.img of=/dev/mmcblk0p1 bs=64K seek=4
Almost right.
It must be partition 3, which must be of type A2.
dd .....of=/dev/mmcblk0p3 ...
I use the following script to set up an sd card with some useful partitions:
#!/bin/bash # Script to partition an SDCard for the SoCFPGA # /dev/sdx3 MUST be type A2. It is used for the bootloaders. # # We also make /dev/sdx1 - FAT, then the rest is ext2 #
#set -e -x
DEVICE=$1 THIS_DIR="$( cd "$( dirname "$0" )" && pwd )" BASE_DIR="${THIS_DIR}/.."
errmsg() { echo "Error: $@" 2>&1 }
errdie() { errmsg "$@" exit 1 }
log() { echo '----' echo "$@" echo '----' }
usage() { echo "Usage: $1 <sd/mmc device file>" }
if [ $# -ne 1 ]; then errmsg "incorrect usage" usage $0 exit 1 fi
DEVICE=$1
# precondition checks
if [ ! -b ${DEVICE} ]; then errdie "${DEVICE} is not an accessable block device" fi
# confirm
read -p "The ${DEVICE} device will be formatted. Continue? [y/n] " answer if [ "$answer" != "y" ]; then exit 0; fi
# umount if device partitions are mounted
for partition in `mount | grep ${DEVICE} | cut -d ' ' -f 1`; do echo "Umounting ${partition} ..." umount $partition if [ $? -ne 0 ]; then errdie "failed to umount ${partition}" fi done
# go
log 'Repartitioning...'
# # Set up 3 partitions, then set their type. # /dev/sdx3 is the bootloader partition and must be type A2 # We add a small FAT partition, as /dev/sdx1 then the rest is # an ext2 partition. # fdisk $DEVICE << EOF o n p 3 2048 +8M n p 1
+20M n p 2
t 1 4 t 2 83 t 3 a2 p w EOF
if [ $? -ne 0 ]; then errdie "repartitioning failed" fi
log 'Formatting...'
echo "Formatting FAT aprtition..."
mkfs.vfat ${DEVICE}1 if [ $? -ne 0 ]; then errdie "formatting failed" fi
echo "Formatting Linux partition ..."
mkfs.ext2 ${DEVICE}2 if [ $? -ne 0 ]; then errdie "formatting failed" fi
log 'Done'
exit 0 #end of script

On Tue, 2014-04-08 at 07:51 +1200, Charles Manning wrote:
On Saturday 05 April 2014 09:47:02 Pavel Machek wrote:
Hi!
I'm trying to get custom preloader to work (on EBV Socrates)... I tried applying old patch from mail archives, but a) applying patch from mail archives is not fun and b) it did not seem to do the trick.
Just to make sure... right way to use the socfpga-signed-preloader.bin is
dd if=socfpga-signed-preloader.bin of=/dev/mmcblk0p1 bs=64k seek=0 dd if=u-boot.img of=/dev/mmcblk0p1 bs=64K seek=4
Almost right.
It must be partition 3, which must be of type A2.
dd .....of=/dev/mmcblk0p3 ...
FYI: It's not strictly necessary that partition 3 is the raw partition of type A2. That's just a common practice or a previous default, but not the only valid setup. I'm aware of setups where the FAT partition was omitted, p1 is raw and p2 is Linux. These work equally fine.
virtually yours Gerhard Sittig
participants (3)
-
Charles Manning
-
Gerhard Sittig
-
Pavel Machek