Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Sep 2011 17:32:53 +0200
From:      Matthieu Kraus <matthieu.kraus@s2008.tu-chemnitz.de>
To:        freebsd-arm@freebsd.org
Subject:   Re: freebsd-arm Digest, Vol 286, Issue 5
Message-ID:  <20110930173253.55166lqso9c8zvad@mail.tu-chemnitz.de>
In-Reply-To: <20110930120022.4ABAA10656A7@hub.freebsd.org>
References:  <20110930120022.4ABAA10656A7@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format.

--=_2v0lx7490r7
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

> Message: 4
> Date: Fri, 30 Sep 2011 20:06:23 +1000
> From: Mattia Rossi <mrossi@swin.edu.au>
> Subject: Re: GlobalScale DreamPlug + FreeBSD 8.2 release
> To: Naoyuki Tai <ntai@smartfruit.com>
> Cc: freebsd-arm@freebsd.org
> Message-ID: <4E85949F.1000004@swin.edu.au>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 21/09/11 00:42, Naoyuki Tai wrote:
>> On Tue, 20 Sep 2011 10:35:23 -0400, Aleksandr Rybalko <ray@dlink.ua> wrote:
>>
>>> On Tue, 20 Sep 2011 10:12:07 -0400
>>> "Naoyuki Tai" <ntai@smartfruit.com> wrote:
>>>
>>>>> On Tue, 20 Sep 2011 09:05:44 -0400, Aleksandr Rybalko <ray@dlink.ua>
>>>>> wrote:
>>>>>
>>>>> > On Tue, 20 Sep 2011 01:37:10 -0400
>>>>> > Naoyuki Tai <ntai@smartfruit.com> wrote:
>>>>> >
>>>>> >>> Hello,
>>>>> >>>
>>>>> >>> I'm new to the FreeBSD/arm, bought a DreamPlug from GlobalScale,
>>>>> >>> hoping to turn it into a FreeBSD file server.
>>>>> >>>
>>>>> >>> I followed the "http://wiki.freebsd.org/FreeBSDMarvell", and
>>>>> >>> created kernel.bin. After giving it a "go", it hangs.
>>>>> >>>
>>>>> >>> I must have built the kernel.bin wrong but I have no clue as to
>>>>> >>> what I did wrong.
>>>>> >>> Any clue/help is appreciated.
>>>>> >>>
>>>>> >>> Thanks!
>>>>> >>>
>>>>> >>> -- Tai
>>>>> >>>
>>>>> >>> U-Boot 2011.06-02334-g8f495d9-dirty (May 31 2011 - 02:06:26)
>>>>> >>> Marvell-DreamPlug
>>>>> >>>
>>>>> >>> SoC: Kirkwood 88F6281_A0
>>>>> >>> CPU running @ 1200Mhz L2 running @ 400Mhz
>>>>> >>> SysClock = 400Mhz , TClock = 200Mhz
>>>>> >>> DRAM: 512 MiB
>>>>> >>> SF: Detected MX25L1606 with page size 256, total 1 MiB
>>>>> >>> In: serial
>>>>> >>> Out: serial
>>>>> >>> Err: serial
>>>>> >>> Net: egiga0, egiga1
>>>>> >>> 88E1116 Initialized on egiga0
>>>>> >>> 88E1116 Initialized on egiga1
>>>>> >>> Hit any key to stop autoboot: 0
>>>>> >>> Marvell>> setenv serverip 192.168.10.3
>>>>> >>> Marvell>> setenv ipaddr 192.168.10.55
>>>>> >>> Marvell>> tftpboot 6400000 arm/kernel.bin
>>>>> >>> Using egiga0 device
>>>>> >>> TFTP from server 192.168.10.3; our IP address is 192.168.10.55
>>>>> >>> Filename 'arm/kernel.bin'.
>>>>> >>> Load address: 0x6400000
>>>>> >>> Loading:
>>>>> >>> #################################################################
>>>>> >>> #################################################################
>>>>> >>> #################################################################
>>>>> >>> ############################
>>>>> >>> done
>>>>> >>> Bytes transferred = 3272884 (31f0b4 hex)
>>>>> >>> Marvell>> go 0x6400000
>>>>> >>> ## Starting application at 0x06400000 ...
>>>>> >>>
>>>>> >
>>>>> > Hi,
>>>>> >
>>>>> > Did you try address 0x900000 instead of 6400000?
>>>>> >
>>>>> > WBW
>>>>>
>>>>> I tried 90000 and it works.
>>>>> Thanks.
>>>>>
>>>>> I don't understand the memory space allocation. 640000 is used
>>>>> for the linux, and I imagined that's the base address for kernel.
>>>>>
>>>>> Where can I learn the reason why it's 90000?
>>>
>>> 0x00000000 is physical memory location, so if MMU turned off, memory
>>> operations not translated (virtual <--> physical). Physical memory
>>> location may vary between different ARM CPUs, IIRC.
>>> But for Kirkwood - this is true.
>>>
>>> And also important which base we set in kernel while compiling,
>>> because code may start to work on every location, but first jump will
>>> call some black hole :)
>>>
>>>
>>>>> Thanks!
>>>>>
>>>>> -- Tai
>>
>>
>> Got it. It is mentioned in
>>
>> /usr/src/sys/arm/mv/kirkwood/std.kirkwood
>>
>> makeoptions KERNPHYSADDR=0x00900000
>>
>> Thanks.
>>
>
> I don't know.. it just doesn't work for me.
>
> U-Boot 2011.06-02334-g8f495d9-dirty (Mar 28 2011 - 05:21:06)
> 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:  0
> Marvell>> set ipaddr 192.168.12.80
> Marvell>> set serverip 192.168.12.81
> Marvell>> tftpboot 0x900000 kernel.bin
> No link on egiga0
> Using egiga1 device
> TFTP from server 192.168.12.81; our IP address is 192.168.12.80
> Filename 'kernel.bin'.
> Load address: 0x900000
> Loading: #################################################################
>           #################################################################
>           #################################################################
>           ###################################
> done
> Bytes transferred = 3366392 (335df8 hex)
> Marvell>> go 0x900000
> ## Starting application at 0x00900000 ...
>
>
> And there it just hangs.
> Kernel compiled with:
> KERNCONF=DB-88F6XXX
> TARGET=arm
> TARGET_ARCH=arm
>
> Help?
>
> Mat

I've been playing around a bit with FreeBSD on the Dreamplug during  
the last few days and had some issues as well, however here's what I  
got so far:

first I didn't manage to get it to work with a dynamic fdt, so you'll  
need a static one (see attachment).

second I found a somewhat customized and pretty stripped kernel config  
more useful, so I'll attach mine as well to give you some guidance.

finally for booting on the plug:
there are basically two options here:
first is to boot via go as you already tried
second (which I find nicer) is to use mkimage from the ports  
collection to create an image file uboot can read which should be  
issues like this:
mkimage -A arm -O linux -T kernel -C none -a 900000 -e 900000 -n  
"FreeBSD" -d kernel.bin image_name
or if you have a compressed kernel:
mkimage -A arm -O linux -T kernel -C gzip -a 900000 -e 900000 -n  
"FreeBSD" -d kernel.bin.gz image_name

if you go for the image, you can use the default boot options as  
guidance (just load the image at 640000 or whatever and boot it -  
it'll be moved to the prroper place and executed there)

note that -O linux isn't required - e.g. -O netbsd works as well -  
however -O FreeBSD doesn't work as u-boot recognizes it, but doesn't  
have a bootcmd implemented for it.

following that I got most things to work so far (except libertas chip  
in ap mode as that one is lacking a proper driver - especially an sdio  
one).

RlyDontKnow

--=_2v0lx7490r7
Content-Type: text/plain;
 charset=UTF-8;
 name="DREAMPLUG"
Content-Disposition: attachment;
 filename="DREAMPLUG"
Content-Transfer-Encoding: 7bit

#
# Custom kernel for Marvell DB-88F6xxx boards.
#
# $FreeBSD: src/sys/arm/conf/DB-88F6XXX,v 1.12 2011/08/07 20:16:46 rmacklem Exp $
#

ident		DREAMPLUG
include		"../mv/kirkwood/std.dreamplug"

options 	SOC_MV_KIRKWOOD
makeoptions	MODULES_OVERRIDE="zfs opensolaris zlib"

#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
makeoptions	WERROR="-Werror"

# SCHEDULER
options 	SCHED_4BSD

# InterNETworking 
options 	INET
options 	INET6

# Filesystems
options 	FFS			# Berkeley Fast Filesystem
options		CD9660			# ISO 9660 Filesystem
options		MSDOSFS
options		PSEUDOFS

# NFS
options 	NFSCL
options		NFSD
options 	NFSLOCKD
options 	NFS_ROOT

# netboot
#options 	BOOTP
#options 	BOOTP_NFSROOT
#options 	BOOTP_WIRED_TO=mge0

options 	ROOTDEVNAME=\"ufs:/dev/da1s3a\"

# core options
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options 	MUTEX_NOINLINE
options 	RWLOCK_NOINLINE
options 	NO_FFS_SNAPSHOT
options 	NO_SWAPPING

# Debugging
#options 	ALT_BREAK_TO_DEBUGGER
#options 	DDB
#options 	DEADLKRES		#Enable the deadlock resolver
#options 	DIAGNOSTIC
#options 	INVARIANTS		#Enable calls of extra sanity checking
#options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
#options 	KDB
#options 	WITNESS			#Enable checks to detect deadlocks and cycles
#options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed
#options 	WITNESS_KDB

# PCI
device		pci

# Pseudo devices
device		loop
device		md
device		pty
device		random
device		firmware
device		crypto
device		bpf		# Berkley Packet Filter - required for dhcp

# Serial ports
device		uart

# Networking
device		ether
device		mii		# required by mge
device		mge		# Marvell Gigabit Ethernet controller

# USB
options		USB_DEBUG
device		usb
device		ehci
device		umass
device		usfs
device		cdce

# USB audio (requires USB)
device		sound
device		snd_uaudio

# I2C (TWSI)
device		iic
device		iicbus

# SATA
device		mvs

# CAM/SCSI
device		scbus
device		da
device		ch

# WLAN
device          wlan            # 802.11 support
device          wlan_wep        # 802.11 WEP support
device          wlan_ccmp       # 802.11 CCMP support
device          wlan_tkip       # 802.11 TKIP support
device		malo		# Marvell Libertas Chipset

# Flattened Device Tree
options 	FDT
options		FDT_DTB_STATIC
makeoptions	FDT_DTS_FILE=dreamplug.dts

# PF
device		pf
device		pflog
device		pfsync

# ALTQ
options         ALTQ
options         ALTQ_CBQ        # Class Bases Queuing (CBQ)
options         ALTQ_RED        # Random Early Detection (RED)
options         ALTQ_RIO        # RED In/Out
options         ALTQ_HFSC       # Hierarchical Packet Scheduler (HFSC)
options         ALTQ_PRIQ       # Priority Queuing (PRIQ)

# IPSEC
options         IPSEC
options         IPSEC_NAT_T

# GEOM
options		GEOM_PART_MBR
options		GEOM_PART_GPT
options		GEOM_PART_BSD
options		GEOM_LABEL
options		GEOM_ELI


--=_2v0lx7490r7--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110930173253.55166lqso9c8zvad>