summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c
blob: b1ca0eed6b6e00e3b0a4a3b11d4e55d0c316ba12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * cp.c
 *
 * MPC8xx CPM RISC Communication Processor routines.
 * 
 * Based on code (alloc860.c in eth_comm port) by
 * Jay Monkman (jmonkman@frasca.com),
 * which, in turn, is based on code by
 * W. Eric Norum (eric@skatter.usask.ca).
 *
 * Modifications by Darlene Stewart (Darlene.Stewart@iit.nrc.ca):
 * Copyright (c) 1999, National Research Council of Canada
 */

#include <rtems.h>
#include <mpc8xx.h>
#include <mpc8xx/cpm.h>

/*
 * Send a command to the CPM RISC processer
 */

void m8xx_cp_execute_cmd( unsigned16 command )
{
  rtems_unsigned16 lvl;
  
  rtems_interrupt_disable(lvl);
  while (m8xx.cpcr & M8xx_CR_FLG) {
    continue;
  }

  m8xx.cpcr = command | M8xx_CR_FLG;
  rtems_interrupt_enable (lvl);
}