This is an old revision of the document!


Basic Device Setup

~-U-Boot Defaults-~

~-sda=internal-sd  sdb=external-sd   sdc=first usb/or esata device  sdd=2nd usb device sde=esata drive-~

~-U-Boot 2011.06-02334-g8f495d9-dirty (Mar 01 2011 - 06:57:05)-~
~-Marvell-DreamPlug-~

~-SoC:   Kirkwood 88F6281_A0-~
~-DRAM:  512 MiB-~
~-SF: Detected MX25L1606 with page size 256, total 1 MiB-~
~-In:    serial-~
~-Out:   serial-~
~-Err:   serial-~
~-Net:   egiga0, egiga1-~
~-88E1121 Initialized on egiga0-~
~-88E1121 Initialized on egiga1-~
~-Hit any key to stop autoboot:  3-~

Marvell>> printenv
bootargs=console=ttyS0,115200 rw root=/dev/sda2 rootdelay=10
bootcmd=setenv ethact egiga0; ${x_bootcmd_ethernet}; setenv ethact egiga1; ${x_bootcmd_ethernet}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; bootm 0x6400000;
bootdelay=3
baudrate=115200
x_bootcmd_usb=usb start
ethact=egiga0
x_bootcmd_kernel=ext2load usb 0 0x6400000 uImage
ethaddr=F0:AD:4E:01:42:18
eth1addr=F0:AD:4E:01:42:19
netmask=255.255.255.0
gatewayip=192.168.123.1
ipaddr=192.168.123.5
x_bootcmd_ethernet=ping 192.168.123.10
serverip=192.168.123.10
stdin=serial
stdout=serial
stderr=serial

Hit any key to stop autoboot:  3

Marvell>> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
date    - get/set/reset date & time
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
go      - start application at address 'addr'
help    - print command description/usage
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sf      - SPI flash sub-system
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor version

# Used for bootp/dhcp/tftp/nfs booting

setenv serverip  <server-ip>
setenv ipaddr    <board-ip-addr>
saveenv

use for external bootp/dhcp/tftp/nfs booting

setenv netmask   <netmask>
setenv gatewayip <gateway-ip>
saveenv

U-Boot MultiBoot

this setup will allow you to boot off usb/esata/external-sd/internal-sd. 
It will auto test all 3 in order of sdb >> sdb >> sda

Enter the following lines to enable multiboot:

external usb-hd:

setenv bootcmd_sdb 'setenv bootargs console=ttyS0,115200 root=/dev/da2s2 panic=10 rootwait; usb start; run boot_sdc;'

setenv boot_sdb 'fatload usb 2:1 0x00900000 kernel-head; go 0x00900000;'

external-sd:

setenv bootcmd_sdb 'setenv bootargs console=ttyS0,115200 root=/dev/da2s2 panic=10 rootwait; usb start; run boot_sdb;'

setenv boot_sdb 'fatload usb 1:1 0x00900000 kernel-head; go 0x00900000;'

internal-sd:

setenv bootcmd_sda '${bootcmd_eth}; ${x_bootcmd_usb}; ${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;'

setenv bootcmd_eth 'setenv ethact egiga0; ${x_bootcmd_ethernet}'

setenv clear_kernel_in_mem 'echo Purging kernel in memory; mw 0x6400000 0x0 0x300000'

setenv bootcmd 'run clear_kernel_in_mem; run bootcmd_sdc; run bootcmd_sdb; run bootcmd_sda'

finally save the changes:
saveenv

Build Script for 10-current:

#!/bin/sh
#
#Version : 9
#date Julu 9, 2012
#writen By RNeese (r.neese@gmail.com)
#

set -eu                                 # reports errors in the script

###### Edit only these lines ######
DEVICE_NAME="dreamplug"                 # Device base name
DEVICE_ARCH="arm"                       # Device Archutecture
DEVICE_KERNEL="DREAMPLUG"		# ls /usr/src/sys/conf and find your cpu
drive=da0
                               # da0/da1/da2/da3
######### DO NOT EDIT ############### Envirmental settings for build ################
OBJDIR="/usr/obj/${DEVICE_ARCH}.${DEVICE_ARCH}/usr/"
kernel="/mnt/1"
export DESTDIR="/mnt/2"
#####################################################################################

####Build SD/HD########
dd if=/dev/zero of=/dev/${drive} bs=512 count=1
gpart create -s mbr da0
gpart add -s64m -t \!14 ${drive}
gpart set -a active -i 1 ${drive}
gpart add -t freebsd ${drive}
newfs_msdos -F 16 /dev/${drive}s1
newfs /dev/${drive}s2
mount -t msdosfs /dev/${drive}s1 /mnt/1
mount /dev/${drive}s2 /mnt/2

######## port checking script ########
port_is_installed(){
[ -x "/usr/local/bin/$1" ] || pkg_add -r $1
}

#check to see needed pkgs are installed
#Add svn
[ -x "/usr/local/bin/svn" ] || pkg_add -r subversion

####### fetch/update /usr/src dir ###########
fetch_src-head(){
svn co http://svn.freebsd.org/base/head /usr/src-head
}
[ -e "/usr/src-head/Makefile" ] || fetch_src-head

cd /usr/src-head
make clean
make ARCH=arm TARGET_ARCH=arm kernel-toolchain
make -j 8 buildworld TARGET_ARCH="${DEVICE_ARCH}" WITHOUT_IPX=1
make installworld -DWITHOUT_SHAREDOCS -DWITHOUT_EXAMPLES -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_INFO -DWITHOUT_MAN TARGET_ARCH="${DEVICE_ARCH}" WITHOUT_IPX=1
make distrib-dirs TARGET_ARCH="${DEVICE_ARCH}" WITHOUT_IPX=1
make distribution TARGET_ARCH="${DEVICE_ARCH}" WITHOUT_IPX=1

cd /usr/src-head
make buildkernel TARGET_ARCH=${DEVICE_ARCH} KERNCONF=${DEVICE_KERNEL}
cp "${OBJDIR}/src-head/sys/${DEVICE_KERNEL}/kernel.bin" "${kernel}"
}

echo '/dev/${driver}s2 / ufs rw,noclusterr,noclusterw 0 0' >> $DESTDIR/etc/fstab

#### Add Daemons to the devices /etc/rc.conf for startup ########
cat << EOF > "$DESTDIR/etc/rc.conf"
hostname="dreamplug"
ifconfig_mge0="DHCP"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
dumpdev="NO"
fsck_y_enable="YES"
background_fsck="NO"
force_fsck="YES"
force_fsck_list="/"
EOF
}
echo 'WITHOUT_X11=yes' >> $DESTDIR/etc/make.conf
  • arm/dreamplugbasics.1342309614.txt.gz
  • Last modified: 2012/07/14 23:46
  • by RichardNeese