All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Socfpga preloader signing patch
@ 2014-04-04 14:02 Pavel Machek
  2014-04-04 20:47 ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2014-04-04 14:02 UTC (permalink / raw)
  To: u-boot

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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Socfpga preloader signing patch
  2014-04-04 14:02 [U-Boot] Socfpga preloader signing patch Pavel Machek
@ 2014-04-04 20:47 ` Pavel Machek
  2014-04-07 13:17   ` Gerhard Sittig
  2014-04-07 19:51   ` Charles Manning
  0 siblings, 2 replies; 5+ messages in thread
From: Pavel Machek @ 2014-04-04 20:47 UTC (permalink / raw)
  To: u-boot

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

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Socfpga preloader signing patch
  2014-04-04 20:47 ` Pavel Machek
@ 2014-04-07 13:17   ` Gerhard Sittig
  2014-04-07 19:51   ` Charles Manning
  1 sibling, 0 replies; 5+ messages in thread
From: Gerhard Sittig @ 2014-04-07 13:17 UTC (permalink / raw)
  To: u-boot

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
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Socfpga preloader signing patch
  2014-04-04 20:47 ` Pavel Machek
  2014-04-07 13:17   ` Gerhard Sittig
@ 2014-04-07 19:51   ` Charles Manning
  2014-04-07 20:24     ` Gerhard Sittig
  1 sibling, 1 reply; 5+ messages in thread
From: Charles Manning @ 2014-04-07 19:51 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] Socfpga preloader signing patch
  2014-04-07 19:51   ` Charles Manning
@ 2014-04-07 20:24     ` Gerhard Sittig
  0 siblings, 0 replies; 5+ messages in thread
From: Gerhard Sittig @ 2014-04-07 20:24 UTC (permalink / raw)
  To: u-boot

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
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-07 20:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04 14:02 [U-Boot] Socfpga preloader signing patch Pavel Machek
2014-04-04 20:47 ` Pavel Machek
2014-04-07 13:17   ` Gerhard Sittig
2014-04-07 19:51   ` Charles Manning
2014-04-07 20:24     ` Gerhard Sittig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.