Name

Configuration — Platform-specific Configuration Options

Overview

The MPC8309KIT platform HAL package is loaded automatically when eCos is configured for an mpc8309kit target. It should never be necessary to load this package explicitly. Unloading the package should only happen as a side effect of switching target hardware.

Startup

The MPC8309KIT platform HAL package supports three separate startup types:

RAM
This is the startup type which is normally used during application development. The board has ROM RedBoot using RAM from 0x00000000 and applications will be loaded from 0x00100000. powerpc-eabi-gdb is used to load a RAM startup application into memory and debug it. It is assumed that the hardware has already been initialized by RedBoot. By default the application will use the eCos virtual vectors mechanism to obtain certain services from RedBoot, including diagnostic output.
ROM
This startup type can be used for finished applications which will be programmed into flash at location 0xFE000000. The application will be self-contained with no dependencies on services provided by other software. eCos startup code will perform all necessary hardware initialization.
JTAG

This startup type can be used for finished applications which will be loaded into external RAM via a JTAG debugger. The application will be self-contained with no dependencies on services provided by other software. The JTAG debugger should initialize the hardware enough to load the code into RAM, eCos startup code will perform any further hardware initialization.

RedBoot and Virtual Vectors

If the application is intended to act as a ROM monitor, providing services for other applications, then the configuration option CYGSEM_HAL_ROM_MONITOR should be set. Typically this option is set only when building RedBoot.

If the application is supposed to make use of services provided by a ROM monitor, via the eCos virtual vector mechanism, then the configuration option CYGSEM_HAL_USE_ROM_MONITOR should be set. By default this option is enabled when building for a RAM startup, disabled otherwise. It can be manually disabled for a RAM startup, making the application self-contained, as a testing step before switching to ROM startup.

If the application does not rely on a ROM monitor for diagnostic services then the serial port will be claimed for HAL diagnostics.

Flash Driver

The MPC8309KIT board contains 8MiB of flash memory. The CYGPKG_DEVS_FLASH_AMD_AM29XXXXX_V2 package contains all the code necessary to support access to the flash. The MPC8309KIT platform HAL package contains definitions that customize the driver to the MPC8309KIT board.

System Clock

By default, the system clock interrupts once every 10ms, corresponding to a 100Hz clock. This can be changed by the configuration option CYGNUM_HAL_RTC_DENOMINATOR which corresponds to the clock frequency. Other clock-related settings are recalculated automatically if the denominator is changed.

Ethernet Driver

The MPC8309KIT board uses the QUICC Engine UCC UEC1 Ethernet device attached to an external PHY. The CYGPKG_DEVS_ETH_POWERPC_UEC package contains all the code necessary to support this device. This driver only supports a single Ethernet interface at present: the RJ-45 socket on the SOM board. This driver is not active until the generic Ethernet support package, CYGPKG_IO_ETH_DRIVERS, is included in the configuration.

RTC Driver

The CYGPKG_DEVICES_WALLCLOCK_MPC83XX package supports the MPC8309 RTC device. The driver supports only clocking from the 32kHz RTC input clock. This driver is not active until the generic wallclock device support package, CYGPKG_IO_WALLCLOCK, is included in the configuration.

Watchdog Driver

The MPC8309KIT board uses the MPC8309 internal watchdog support. This device is compatible with the watchdog on the MPC512X family and so shares that device driver. The CYGPKG_DEVICES_WATCHDOG_MPC512X package contains the code necessary to support this device. Within that package the CYGNUM_DEVICES_WATCHDOG_POWERPC_MPC512X_DESIRED_TIMEOUT_MS configuration option controls the watchdog timeout, and by default will force a reset of the board upon timeout. This driver is not active until the generic watchdog device support package, CYGPKG_IO_WATCHDOG, is included in the configuration.

UART Serial Driver

The MPC8309KIT board uses the 16X5X compatible serial DUARTs. Two serial UART adaptors are available on the board. Only UART0 is actually brought out to a usable DB9 external connector via an RS232 transceiver; UART1 is delivered to the second DB9 via an RS485 transceiver. The generic 16X5X driver CYGPKG_IO_SERIAL_GENERIC_16X5X supports the 16X5X compatible DUARTs. The package CYGPKG_IO_SERIAL_POWERPC_MPC8309KIT provides definitions to configure the generic driver to the board.

I2C Driver

The MPC512X HAL contains a driver for the I²C busses on the board. There are several devices attached to the busses, see the board documentation for a description. The file mpc512x_i2c.c and the header plf_io.h contain definitions for some of these devices. The test programs pca9534_1.c and pca9534_2.c contain tests that exercise the I²C bus by flashing the LEDs on the carrier board.

Compiler Flags

The platform HAL defines the default compiler and linker flags for all packages, although it is possible to override these on a per-package basis. Most of the flags used are the same as for other architectures supported by eCos. There is one flag specific to this port:

-mcpu=e300c3
The powerpc-eabi-gcc compiler supports many variants of the PowerPC architecture. A -m option should be used to select the specific variant in use. The MPC8309 contains an e300c3 processor, and this option allows the compiler to optimize code for this processor variant.