Dies ist eine alte Version des Dokuments!


flink on Phytec PCM032 Board (mpc5200)

The following example describes in detail how a Phytec PCM032 Board containing a mpc5200 and a FPGA is configured to be used with flink. The FPGA will contain a single channel PWM module and a single channel GPIO modul. flink was tested with the FPGA on the mpc5200io module as well as with an external FPGA connected through a SPI interface.

External FPGA connected through SPI interface

The pmc5200 offers a dedicated SPI (8 bit transfers) which can be routed onto the pins of the timer group or the PSC3 group. The PSC1, PSC2, PSC3 or PSC6 can operate as an SPI with 32 bit transfers.

Setup

  • Configure the board with a working Linux kernel and root file system or use the system described in Installation von Emdebian Grip auf den Phytec phyCORE-MPC5200B. Make sure to have the SPI properly configured.
  • Make sure that the device tree blob is up-to-date. It must contain a node for the hardware SPI (spi@f00) or a PSC-SPI (e.g. spi: psc@2000).
  • Get necessary sources for the flink project.
    git clone https://github.com/flink-project/flinkvhdl.git
    git clone https://github.com/flink-project/flinklinux.git
    git clone https://github.com/flink-project/flinklib.git

Configure the FPGA

Proceed as described in VHDL.

  • In 5: add a block gpio and a block pwm to the system. Also add a spi_to_avalon module. Leave the standard values as they are except for the PWM module, whose base clock depends on your FPGA clock. Set unique_id of the gpio subdevice to 0x20 and the unique_id of the pwm subdevice to 0x30
    Invalid Link
    Adding an interface block

    TODO improve picture

  • In 6: set the unique id of the info subdevice to 0x10 and the ….
  • After 10: the System should now look like:
    Invalid Link
    Complete system

    TODO improve picture

Loading the kernel modules

There are several ways to properly drive the SPI from the mpc5200.

Build into kernel

Compile kernel modules (see flink Linux Kernel Modules and add them to your kernel image. Add a subnode flink_spi to your device tree under the node spi. In the compatible statement you must specify which protokoll driver to load (compatible = „flink_spi“). You can also specify the clock frequency. When booting the SPI-subsystem will automatically

Onboard FPGA connected through Local Plus Bus

Setup

  • Configure the board with a working Linux kernel and root file system or use the system described in Installation von Emdebian Grip auf den Phytec phyCORE-MPC5200B
  • Make sure that the device tree blob is up-to-date. It must contain a node for the FPGA sitting on the local plus bus.
  • Get necessary sources for the flink project.
    git clone https://github.com/flink-project/flinkvhdl.git
    git clone https://github.com/flink-project/flinklinux.git
    git clone https://github.com/flink-project/flinklib.git

Configure the FPGA

Proceed as described in VHDL.

  • In 5: add a block gpio and a block pwm to the system. Also add a lpb_mpc5200b_to_avalon module. Leave the standard values as they are except for the PWM module, whose base clock should be 33000000. Set unique_id of the gpio subdevice to 0x20 and the unique_id of the pwm subdevice to 0x30
    Invalid Link
    Adding an interface block

    TODO improve picture

  • In 6: set the unique id of the info subdevice to 0x10 and the ….
  • After 10: the System should now look like:
    Invalid Link
    Complete system

    TODO improve picture

  • In 15: assign the pins as follows:
signaldirpin
clk_clkinPIN_H2
lpb_ack_noutPIN_T11
lpb_ad[31]bidirPIN_T6
lpb_ad[30]bidirPIN_N8
lpb_ad[29]bidirPIN_R9
lpb_ad[28]bidirPIN_T9
lpb_ad[27]bidirPIN_R8
lpb_ad[26]bidirPIN_T8
lpb_ad[25]bidirPIN_L8
lpb_ad[24]bidirPIN_L7
lpb_ad[23]bidirPIN_R7
lpb_ad[22]bidirPIN_T7
lpb_ad[21]bidirPIN_R5
lpb_ad[20]bidirPIN_T5
lpb_ad[19]bidirPIN_R4
lpb_ad[18]bidirPIN_T4
lpb_ad[17]bidirPIN_P4
lpb_ad[16]bidirPIN_P5
lpb_ad[15]bidirPIN_R3
lpb_ad[14]bidirPIN_T3
lpb_ad[13]bidirPIN_P11
lpb_ad[12]bidirPIN_N11
lpb_ad[11]bidirPIN_L11
lpb_ad[10]bidirPIN_M11
lpb_ad[9]bidirPIN_R14
lpb_ad[8]bidirPIN_T14
lpb_ad[7]bidirPIN_R13
lpb_ad[6]bidirPIN_T13
lpb_ad[5]bidirPIN_R12
lpb_ad[4]bidirPIN_T12
lpb_ad[3]bidirPIN_P13
lpb_ad[2]bidirPIN_P12
lpb_ad[1]bidirPIN_K10
lpb_ad[0]bidirPIN_K11
lpb_ale_ninPIN_R11
lpb_cs_n[0]inPIN_N10
lpb_intoutPIN_R6
lpb_oe_ninPIN_L9
lpb_rdwr_ninPIN_L10
lpb_ts_ninPIN_T10
reset_reset_ninPIN_N9

The pins for the PWM output and the GPIO have to be assigned according to your hardware. The FPGA can be loaded through the onboard PROM or through serial loading from the processor, see Installation von Emdebian Grip auf den Phytec phyCORE-MPC5200B.

Überschrift

Compile the Linux kernel modules (flink Linux Kernel Modules), transfer them to the target and load them