Following assumes that SD card is identified on your host machine as /dev/sd1
destroy contents of the card
dd if=/dev/zero of=/dev/da1 bs=512 count=1
create MBR
gpart create -s mbr da1
create FAT16 partition for U-Boot and kernel and make it active
gpart add -s64m -t \!14 da1
gpart set -a active -i 1 da1
create FreeBSD partition
gpart add -t freebsd da1
create FAT16 file system on the boot partition
newfs_msdos -F 16 /dev/da1s1
create root file system
sudo newfs /dev/da1s2
Take U-Boot source from TI / Arago Project U-Boot GIT repository: http://arago-project.org/git/projects/U-Boot-am33x.git
Install some ARM cross tools (i.e. CodeSourcery)
Modify boot command by changing #define CONFIG_BOOTCOMMAND
in include/configs/am335x_evm.h
#define CONFIG_BOOTCOMMAND \
"if mmc rescan; then " \
"echo SD/MMC found on device ${mmc_dev};" \
"fatload mmc 0 0x80200000 kernel.bin;" \
"go 0x80200000;" \
"fi;" \
Compile U-Boot
make -j3 ARCH=arm CROSS_COMPILE=/opt/arm-cs-tools/bin/arm-none-eabi- am335x_evm
Alternatively you can download U-Boot binaries here:
Take beaglebone code from projects/armv6 in SVN: svn://svn.freebsd.org/base/projects/armv6/
build kenel:
make TARGET_ARCH=arm KERNCONF=BEAGLEBONE buildkernel
mount boot (FAT16) partition
mount -t msdosfs /dev/da1s1 /dest
copy U-Boot files
cp MLO /dest
cp U-Boot.img /dest
copy FreeBSD kernel and unmount
cp kernel.bin /dest
umount /dest
build world using the same source tree
make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 buildworld
mount root partition
mkdir /dest
mount /dev/da1s2 /dest
install world
make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 DESTDIR=/dest installworld
make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 DESTDIR=/dest distrib-dirs
make TARGET_ARCH=arm TARGET_CPUTYPE=armv6 DESTDIR=/dest distribution
To make installation faster some stuff can be excluded by passing -DWITHOUT_SHAREDOCS -DWITHOUT_EXAMPLES -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_INFO -DWITHOUT_MAN
to installworld.
create /etc/rc.conf
echo 'hostname="beaglebone"' > /dest/etc/rc.conf
echo 'ifconfig_cpsw0="DHCP"' >> /dest/etc/rc.conf
echo 'sshd_enable="YES"' >> /dest/etc/rc.conf
create /etc/fstab
echo '/dev/mmcsd0s2 / ufs rw 1 1' > /dest/etc/fstab
unmount
umount /dest
U-Boot SPL 2011.09-00002-gd0e52e5-dirty (Apr 16 2012 - 20:16:49)
Texas Instruments Revision detection unimplemented
No AC power, disabling frequency switch
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img
U-Boot 2011.09-00002-gd0e52e5-dirty (Apr 16 2012 - 20:16:49)
I2C: ready
DRAM: 256 MiB
WARNING: Caches not enabled
No daughter card present
NAND: HW ECC Hamming Code selected
nand_get_flash_type: second ID read did not match 10,10 against 00,10
No NAND device found!!!
0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
Net: cpsw
Hit any key to stop autoboot: 0
SD/MMC found on device
reading kernel.bin
3193528 bytes read
## Starting application at 0x80200000 ...
initarm: console initialized
arg1 mdp = 0x00000000
boothowto = 0x00000000
dtbp = 0xc04e6fb0
kernel image addresses:
kernbase = 0xc0000000
_etext (sdata) = 0xc0453c14
_edata = 0xc050bab8
__bss_start = 0xc050bab8
_end = 0xc0682d50
loader passed (static) kenv:
no env, null ptr
processing avail regions:
80000000-90000000 -> 80000000-80200000 = 200000
80737000-90000000 -> 80737000-90000000 = f8c9000
fill in phys_avail:
region: 0x80000000 - 0x80200000 (0x00200000)
region: 0x80737000 - 0x90000000 (0x0f8c9000)
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #107 r234344+aa4e685-dirty: Mon Apr 16 20:15:08 CEST 2012
damarion@damarion-mac:/data/tmp/BEAGLEBONE arm
WARNING: WITNESS option enabled, expect reduced performance.
CPU: Cortex A8-r3 rev 2 (Cortex-A core)
Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext
WB disabled EABT branch prediction enabled
LoUU:2 LoC:2 LoUIS:1
Cache level 1:
32KB/64B 4-way data cache WT WB Read-Alloc
32KB/64B 4-way instruction cache Read-Alloc
Cache level 2:
256KB/64B 8-way unified cache WT WB Read-Alloc Write-Alloc
real memory = 268435456 (256 MB)
avail memory = 256237568 (244 MB)
Texas Instruments AM3358 Processor, Revision ES1.0
random device not loaded; using insecure entropy
simplebus0: <Flattened device tree simple bus> on fdtbus0
aintc0: <TI AINTC Interrupt Controller> mem 0xca595000-0xca595fff on simplebus0
aintc0: Revision 5.0
ti_scm0: <TI Control Module> mem 0xe4e10000-0xe4e11fff on simplebus0
am335x_prcm0: <AM335x Power and Clock Management> mem 0xe4e00000-0xe4e012ff on simplebus0
am335x_prcm0: Clocks: System 24.0 MHz, CPU 500 MHz
am335x_dmtimer0: <AM335x DMTimer> mem 0xe4e05000-0xe4e05fff,0xe4e31000-0xe4e31fff,0xca596000-0xca596fff,0xca597000-0xca597fff,0xca598000-0xca598fff,0xca599000-0xca599fff,0xca59a000-0xca59afff,0xca59b000-0xca0
Timecounter "AM335x Timecouter" frequency 24000000 Hz quality 1000
Event timer "AM335x Eventtimer0" frequency 24000000 Hz quality 1000
gpio0: <TI General Purpose I/O (GPIO)> mem 0xe4e07000-0xe4e07fff,0xca59c000-0xca59cfff,0xca59d000-0xca59dfff,0xca59e000-0xca59efff irq 17,19,21,23 on simplebus0
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
uart0: <16750 or compatible> mem 0xe4e09000-0xe4e09fff irq 72 on simplebus0
uart0: console (115384,n,8,1)
ti_edma30: <TI EDMA Controller> mem 0xca59f000-0xca69efff,0xca69f000-0xca79efff,0xca79f000-0xca89efff,0xca89f000-0xca99efff irq 12,13,14 on simplebus0
ti_edma30: EDMA revision 40014c00
ti_mmchs0: <TI MMC/SD/SDIO High Speed Interface> mem 0xca99f000-0xca99ffff irq 64 on simplebus0
mmc0: <MMC/SD bus> on ti_mmchs0
cpsw0: <3-port Switch Ethernet Subsystem> mem 0xca9a0000-0xca9a2fff irq 40,41,42,43 on simplebus0
cpsw0: Version 1.12 (0)
cpsw0: Ethernet address: 7c:ba:30:c0:a8:37
miibus0: <MII bus> on cpsw0
smcphy0: <SMC LAN8710A 10/100 interface> PHY 0 on miibus0
smcphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
iichb0: <TI I2C Controller> mem 0xe4e0b000-0xe4e0bfff irq 70 on simplebus0
iichb0: I2C revision 4.0
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
am335x_pmic0: <TI TPS65217 Power Management IC> at addr 0x24 on iicbus0
Timecounters tick every 10.000 msec
ti_mmchs_update_ios: TWL unimplemented
mmcsd0: 1882MB <SD Memory Card> at mmc0 30MHz/4bit
am335x_pmic0: TPS65217A ver 1.0 powered by USB
WARNING: WITNESS option enabled, expect reduced performance.
Trying to mount root from ufs:mmcsd0s2 []...
warning: no time-of-day clock registered, system time will not be set accurately
lock order reversal:
1st 0xc1b420b0 pmap (pmap) @ /data/src/freebsd/armv6/sys/arm/arm/pmap-v6.c:667
2nd 0xc0776608 PV ENTRY (UMA zone) @ /data/src/freebsd/armv6/sys/vm/uma_core.c:2087
KDB: stack backtrace:
db_read_token() at db_read_token+0x5c8
scp=0xc02267a4 rlv=0xc064ff80 (0xc064ff80)
rsp=0xc0431b84 rfp=0xc9b679f0
Bad frame pointer: 0xc9b679f0
Setting hostuuid: fbeaced4-881d-11e1-b9b6-7cba30c0a837.
Setting hostid: 0x3e3764a1.
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_point kickstart.
Starting file system checks:
/dev/mmcsd0s2: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/mmcsd0s2: clean, 411898 free (1522 frags, 51297 blocks, 0.3% fragmentation)
Mounting local file systems:.
Setting hostname: beaglebone.
cpsw_ioctl: SIOCSIFFLAGS cpsw_init_locked
Starting Network: lo0 cpsw0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet 127.0.0.1 netmask 0xff000000
cpsw0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
ether 7c:ba:30:c0:a8:37
cpsw0: link state changed to UP
media: Ethernet autoselect (10baseT/UTP <full-duplex>)
status: active
Starting devd.
Starting dhclient.
Can't find free bpf: No such file or directory
exiting.
/etc/rc.d/dhclient: WARNING: failed to start dhclient
Generating host.conf.
Waiting 30s for the default route interface: .....
Creating and/or trimming log files.
Starting syslogd.
/etc/rc: WARNING: Dump device does not exist. Savecore not run.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Clearing /tmp (X related).
Updating motd:.
Generating public/private ecdsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_ecdsa_key.
Your public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pub.
The key fingerprint is:
64:89:c2:71:52:ed:d5:f4:80:e1:3a:52:99:3f:a8:7c root@beaglebone
The key's randomart image is:
+--[ECDSA 256]---+
| o.o. .=o |
| . + ..=o .o |
| o ..B.. . |
| . +.+ |
| . S o |
| . o . . |
| o E |
| . |
| |
+-----------------+
Starting sshd.
Starting cron.
Starting background file system checks in 60 seconds.
Mon Apr 16 23:54:09 UTC 2012
FreeBSD/arm (beaglebone) (ttyu0)
login: