From owner-freebsd-embedded@FreeBSD.ORG Thu Mar 13 13:56:54 2008 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E0571065675 for ; Thu, 13 Mar 2008 13:56:54 +0000 (UTC) (envelope-from jacques.fourie@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.174]) by mx1.freebsd.org (Postfix) with ESMTP id 1449C8FC2C for ; Thu, 13 Mar 2008 13:56:54 +0000 (UTC) (envelope-from jacques.fourie@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so3412127wfa.7 for ; Thu, 13 Mar 2008 06:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=0UeJTWW3so6vM2GZF8iKKoDKQQkMX8VePPJE7c/j4xo=; b=UK8szRLINlV2TmYcWZH6JGJKsT7ejCyIeyyXz8y/rafPg61IdGWi9r3KuhfvG2ye9sgQl3V7PO61sBmEX4bZH1FGxlOQuD2zbkSDNPujy7i/nBEzPEr3pgFPL8d32ym7y07jGxVvqmcvTuZBBB0son5JAzPBKMM5nLB78+gqTb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=pWgw292Xo9KshXH3nrVPOzJ0jWwxv2X7Sq6OznGxBzpWeyVrBLkmC5Zjtosrk9c08g3rYYtVkqZdygIjQ7nrkQga81tX6kjpcw2lz3p/rgV3yizYCovKJ60VUZC6WAv5iEzs0tbesLuMyCNEDPQETljqnYubUwjTd0f8iM8/l5k= Received: by 10.142.141.21 with SMTP id o21mr4119016wfd.84.1205416613755; Thu, 13 Mar 2008 06:56:53 -0700 (PDT) Received: by 10.142.204.7 with HTTP; Thu, 13 Mar 2008 06:56:53 -0700 (PDT) Message-ID: Date: Thu, 13 Mar 2008 15:56:53 +0200 From: "Jacques Fourie" To: freebsd-embedded@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Howto boot FreeBSD on MPC8540EVAL X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2008 13:56:54 -0000 Hi, For the benefit of the list I'll describe how I got FreeBSD current to boot on a MPC8540EVAL platform. This basically consisted of installing a newer version of u-boot onto the flash and some minor kernel modifications (thanks for all the help Rafal). u-boot installation --------------------- The MPC8540EVAL ships with u-boot pre-installed. Unfortunately the version on mine was too old to contain the api module used by the FreeBSD bootloader. Here is a short summary of how I installed a newer version: * Downloaded a snapshot of u-boot 1.3.2 (Close to release at time of writing) * Added the following to include/configs/MPC8540EVAL.h : #define CONFIG_MII 1 #define CONFIG_API 1 #define CONFIG_CMD_ELF #define CONFIG_CMD_CONSOLE #define CONFIG_CMD_MII * Compiled u-boot on a Linux box with the toolchain that ships with the Metrowerks BSP for this platform. I tried to compile using the FreeBSD cross compiler but ran into some problems with the binutils and gcc combination. * Setup a tftp server on a FreeBSD7.0 box by editing the appropriate entry in inetd.conf (and starting inetd). * Setup a dhcpd server * Copy the new u-boot.bin to the tftp root directory * Boot the MPC8540EVAL and write the new u-boot onto the flash : MPC8540EVAL=> tftpboot 0x100000 ubnew.bin MPC8540EVAL=> protect off 0xfff80000 0xffffffff MPC8540EVAL=> era 0xfff80000 0xffffffff MPC8540EVAL=> cp.b 0x100000 0xfff80000 ${filesize} MPC8540EVAL=> setenv filesize MPC8540EVAL=> saveenv MPC8540EVAL=> protect on 0xfff80000 0xffffffff MPC8540EVAL=> reset FreeBSD ----------- I performed the following steps on a FreeBSD 7.0-RELEASE installation. * Checkout latest sources from -current * Apply the following patch to src/sys/dev/tsec/if_tsec.c: index a5aff35..bd3854b 100644 --- a/sys/dev/tsec/if_tsec.c +++ b/sys/dev/tsec/if_tsec.c @@ -1561,7 +1561,7 @@ tsec_miibus_readreg(device_t dev, int ph sc = device_get_softc(dev); - if (device_get_unit(dev) != phy) + if (phy != 4 && phy != 7) return (0); sc = tsec0_sc; * Cross-compile FreeBSD powerpc world and kernel using MPC85XX kernel config * Do a 'make installworld DESTDIR=/some/dir' * Edit /some/dir/boot/loader.conf and add the line 'hw.uart.console="mm:0xfef04500"' * NFS export /some/dir * Added the 'root-path' option to the DHCP server to point to this directory. * Copy ubldr from src/sys/boot/powerpc/uboot/ubldr to the tftp root directory * Boot into new u-boot, download ubldr and execute it: MPC8540EVAL=> tftpboot 0x100000 ubldr MPC8540EVAL=> bootelf 0x100000 If all goes well you'll now see the boot loader loading and then booting the kernel. Jacques