Jump to content

MIDAM MPC5200 DB1

From HW wiki
Revision as of 10:11, 7 January 2009 by Samekm1 (talk | contribs)

Description

Two sets of the MIDAM MPC5200 was delivered by the Mikroklima s.r.o. for our purposes. Each set consist of the:

  • Shark MPC52000 CPU module (pin compatible with TQ Components TQM5200 module),
  • MPC5200 v1.1 2008/02 carrier board.

Set #1 has s/n: 008770 and set #2 has s/n: 008771.


Board overview

Serial line (system console)

  • Loader system console is attached to the ttyPSC0 port.
  • The ttyPSC0 port is done in the LVTTL 3.3V logic, so appropriate 3.3V to RS-232 converter (e.g. MAX3232) is required for the serial console.

Communication parameters:

  • baud rate: 115200 bps
  • bits: 8 bit
  • stop bits: 1 bit
  • Parity: none
  • Flow control: none

Boot loader

These boards are preinstalled with Das u-Boot boot loader. Behaviour of the u-Boot can be handled by its environment variables. Here are some useful commands:

  • printenv [variable] - prints complete environment or only given variable.
  • saveenv - commits whole environment in flash memory

For running linux kernel >2.6.25 it's necessary to upgrade u-Boot to newer version, which is able to hand over flat device tree to the kernel. Binary of u-Boot can be downloaded here: u-boot.bin.

U-Boot upgrade howto:

During the upgrade procedure it is necessary to proceed with utmost precaution, because there is no backup image of the u-Boot in the flash for recovery purposes. Fail-flash recovery isn't possible without JTAG interface. So, you have been warned. In future builds of the u-Boot there should be a support for recovery image. Follow this commands to upgrade U-Boot's image in flash memory:

dhcp
tftp 800000 u-boot.bin
protect off fc000000 fc09ffff
erase fc000000 fc09ffff
cp.b 800000 fc000000 ${filesize}
protect on fc000000 fc09ffff

Now reboot and than commit new default environment:

saveenv

Cross-tool chain

Necessary cross-tool chain for PowerPC platform can be build using Crossdev tool. You can install Crossdev on your Gentoo distro very simply:

emerge -av crossdev

Some dependencies may go before. Building of tool chain itself will take some time, so let's go to take some coffee.

crossdev --b 2.18-r3 --k 2.6.23-r3 --g 4.1.2 --without-headers -t powerpc-unknown-linux-gnu

The Linux kernel configuration

The Vanilla sources of the Linux kernel are suitable for MIDAM MPC5200 board. It's necessary to apply patch, which adds support for the Bestcomm DMA controller and FEC - Fast Ethernet Controller. I have tested this patch against the Vanilla sources version 2.6.23.17. For newer versions it might be necessary to do some modifications of the patch.

Media:linux-bestcomm-fec.patch

It is recommended to use quilt tool to manage series of patches.

Mini-Howto:

Quilt tool can be installed by emerge -av quilt.

Assuming kernel sources are in directory /usr/src/linux.

  1. cd /usr/src/linux
  2. mkdir patches
  3. Copy all patches you want to apply to patches subdirectory
  4. Create series file in patches subdirectory and write names of patch files each on separate line. The order the patches are stated in the file is significant!! The patch on the first line will be applied first followed by others.
  5. quilt push (quilt pop) - applies (unapplies) one patch from series file.
    To (un)apply all patches use quilt push -a (quilt pop -a).

Now let's begin with the kernel configuration. First of all set target platform as Power PC and generate default config for MPC5200 platform.

  1. export ARCH=ppc
  2. make lite5200_defconfig
  3. make menuconfig

How to build the Flat Device Tree file

Since kernel version 2.6.25 is description of the platform hardware provided trough the Flat Device Tree. Necessary sources are now part of the kernel sources. Appropriate image could be build with this command:

make ARCH=powerpc shark.dtb DTS_FLAGS="-S65536"

If DTS_FLAGS parameter omitted than following error will occur, because there is not enough space in the file, where the u-Boot can store some additional data about buses timing, etc.:

WARNING: could not create /chosen FDT_ERR_NOSPACE.
ERROR: /chosen node create failed - must RESET the board to recover.


Root filesystem

New root filesystem has been built for MIDAM MPC5200 board. It's based on:

  • Vanilla linux kernel v2.6.26.5
  • Busybox v1.12.1
  • Dropbear v0.51
  • thttpd v2.25b

SocketCan

make KERNELDIR=/home/marsark/src/linux-2.6.26.5/_build/mpc5200_ryu/ CONFIG_CAN_MPC52XX=m CONFIG_CAN_MSCAN=m

How to boot kernel from flash and mount root over NFS

bootcmd_nfsroot=set bootargs ${linux_console} ${bootargs_nfs}; dhcp; mw f0000b00 ${psc_cfg}; bootm fc120000 - fc100000;
bootargs_nfs=root=/dev/nfs nfsroot=/midam rw ip=dhcp
run bootcmd_nfsroot