XINU
Functions
platinit.c File Reference
#include <xinu.h>
Include dependency graph for platinit.c:

Go to the source code of this file.

Functions

void counterinit ()
 
void platinit (void)
 

Function Documentation

◆ counterinit()

void counterinit ( )

Definition at line 9 of file platinit.c.

Referenced by platinit().

10 {
11  /* Program the performance-counter control-register: */
12  /* Enable all counters: */
13  asm volatile ("MCR p15, 0, %0, c9, c12, 0\t\n" :: "r"
14  (0x00000011));
15 
16  /* Program the count enable set control-register: */
17  /* Enable all counters: */
18  asm volatile ("MCR p15, 0, %0, c9, c12, 1\t\n" :: "r"
19  (0x80000003));
20 
21  /* Program the overflow flag status-register: */
22  /* Clear overflows: */
23  asm volatile ("MCR p15, 0, %0, c9, c12, 3\t\n" :: "r"
24  (0x80000003));
25 }
Here is the caller graph for this function:

◆ platinit()

void platinit ( void  )

Definition at line 31 of file platinit.c.

References am335x_padctl, AM335X_PADCTL_RXTX, AM335X_PADCTL_TX, CONSOLE, counterinit(), devtab, initintc(), uart_csreg::sysc, uart_csreg::syss, UART0_PADRX_ADDR, UART0_PADRX_MODE, UART0_PADTX_ADDR, UART0_PADTX_MODE, UART_SYSC_SOFTRESET, UART_SYSS_RESETDONE, WDTADDR, watchdog_csreg::wspr, and watchdog_csreg::wwps.

Referenced by sysinit().

32 {
33 
34  struct uart_csreg *uptr; /* Address of UART's CSRs */
35  struct watchdog_csreg *wdtptr; /* Watchdog registers */
36 
37  /* Disable the watchdog timer */
38 
39  wdtptr = (struct watchdog_csreg *)WDTADDR;
40  wdtptr->wspr = 0x0000aaaa;
41  while(wdtptr->wwps & 0x00000010);
42  wdtptr->wspr = 0x00005555;
43  while(wdtptr->wwps & 0x00000010);
44 
45  /* Initialize the Interrupt Controller */
46 
47  initintc();
48 
49  /* Initialize the Performance Counters */
50 
51  counterinit();
52 
53  /* Pad control for CONSOLE */
54 
59 
60  /* Reset the UART device */
61 
62  uptr = (struct uart_csreg *)devtab[CONSOLE].dvcsr;
63  uptr->sysc |= UART_SYSC_SOFTRESET;
64  while((uptr->syss & UART_SYSS_RESETDONE) == 0);
65 }
volatile uint32 wspr
開始/終了レジスタ
#define UART0_PADRX_ADDR
Definition: uart.h:126
volatile uint32 wwps
ポストBitレジスタの書き込み
void counterinit()
Definition: platinit.c:9
#define UART0_PADTX_ADDR
Definition: uart.h:127
int32 initintc(void)
Definition: evec.c:18
#define CONSOLE
Definition: conf.h:28
#define AM335X_PADCTL_TX
出力限定モード
struct dentry devtab[]
Definition: conf.c:11
#define UART0_PADRX_MODE
Definition: uart.h:128
#define am335x_padctl(addr, val)
引数で指定されたアドレスに値を代入する。
Watchdog CSREG(制御/状態)レジスタ操作用の構造体
#define UART0_PADTX_MODE
Definition: uart.h:129
volatile uint32 syss
Definition: uart.h:28
#define AM335X_PADCTL_RXTX
入力モードもしくは出力モード
#define WDTADDR
Watchdogタイマに割り当てられたアドレス
#define UART_SYSS_RESETDONE
Definition: uart.h:119
volatile uint32 sysc
Definition: uart.h:27
#define UART_SYSC_SOFTRESET
Definition: uart.h:115
Here is the call graph for this function:
Here is the caller graph for this function: