FreeBSD/powerpc on MPC8540EVAL board

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:

#define CONFIG_MII               1
#define CONFIG_API              1
#define CONFIG_CMD_ELF
#define CONFIG_CMD_CONSOLE
#define CONFIG_CMD_MII

  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.

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;

hw.uart.console="mm:0xfef04500"

  MPC8540EVAL=> tftpboot 0x100000 ubldr
  MPC8540EVAL=> bootelf 0x100000

If all goes well you'll now see the boot loader loading and then booting the kernel.

This page based on a message to freebsd-embedded by Jacques Fourie

Eval8540Boot (last edited 2008-06-17 21:37:28 by localhost)