-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3296688
commit 9489d3b
Showing
15 changed files
with
1,253 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// ------------------------------------------------------------ | ||
// Cortex-A MPCore - Private timer functions | ||
// | ||
// Copyright ARM Ltd 2009. All rights reserved. | ||
// ------------------------------------------------------------ | ||
|
||
.text | ||
.align 3 | ||
|
||
// PPI ID 29 | ||
|
||
|
||
// Typical set of calls to enable Timer: | ||
// init_private_timer(0xXXXX, 0) <-- Counter down value of 0xXXXX, with auto-reload | ||
// start_private_timer() | ||
|
||
// Timer offset from base of private peripheral space --> 0x600 | ||
|
||
// ------------------------------------------------------------ | ||
|
||
.global init_private_timer | ||
.type init_private_timer,function | ||
// void init_private_timer(unsigned int load_value, unsigned int auto_reload) | ||
// Sets up the private timer | ||
// r0: initial load value | ||
// r1: IF 0 (AutoReload) ELSE (SingleShot) | ||
init_private_timer: | ||
|
||
// Setup timeout value (CNTP_TVAL) | ||
MCR p15, 0, r0, c14, c2, 0 | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void start_private_timer(void) | ||
// Starts the private timer | ||
.global start_private_timer | ||
.type start_private_timer,function | ||
start_private_timer: | ||
|
||
MOV r0, #0x1 | ||
|
||
// Enable timer (CNTP_CTL) | ||
MCR p15, 0, r0, c14, c2, 1 | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void stop_private_timer(void) | ||
// Stops the private timer | ||
.global stop_private_timer | ||
.type stop_private_timer,function | ||
stop_private_timer: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// unsigned int read_private_timer(void) | ||
// Reads the current value of the timer count register | ||
.global get_private_timer_count | ||
.type get_private_timer_count,function | ||
get_private_timer_count: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void clear_private_timer_irq(void) | ||
// Clears the private timer interrupt | ||
.global clear_private_timer_irq | ||
.type clear_private_timer_irq,function | ||
clear_private_timer_irq: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
// End of code | ||
// ------------------------------------------------------------ | ||
|
||
// ------------------------------------------------------------ | ||
// End of MP_PrivateTimer.s | ||
// ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ------------------------------------------------------------ | ||
// Cortex-A MPCore - Private timer functions | ||
// Header Filer | ||
// | ||
// Copyright ARM Ltd 2009. All rights reserved. | ||
// ------------------------------------------------------------ | ||
|
||
#ifndef _CORTEXA_PRIVATE_TIMER_ | ||
#define _CORTEXA_PRIVATE_TIMER_ | ||
|
||
// Typical set of calls to enable Timer: | ||
// init_private_timer(0xXXXX, 0) <-- Counter down value of 0xXXXX, with auto-reload | ||
// start_private_timer() | ||
|
||
// Sets up the private timer | ||
// r0: initial load value | ||
// r1: IF 0 (AutoReload) ELSE (SingleShot) | ||
void init_private_timer(unsigned int load_value, unsigned int auto_reload); | ||
|
||
// Starts the private timer | ||
void start_private_timer(void); | ||
|
||
// Stops the private timer | ||
void stop_private_timer(void); | ||
|
||
// Reads the current value of the timer count register | ||
unsigned int get_private_timer_count(void); | ||
|
||
// Clears the private timer interrupt | ||
void clear_private_timer_irq(void); | ||
|
||
#endif | ||
|
||
// ------------------------------------------------------------ | ||
// End of MP_PrivateTimer.h | ||
// ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// ------------------------------------------------------------ | ||
// Cortex-A MPCore - Private timer functions | ||
// | ||
// Copyright ARM Ltd 2009. All rights reserved. | ||
// ------------------------------------------------------------ | ||
|
||
.text | ||
.align 3 | ||
|
||
// PPI ID 29 | ||
|
||
|
||
// Typical set of calls to enable Timer: | ||
// init_private_timer(0xXXXX, 0) <-- Counter down value of 0xXXXX, with auto-reload | ||
// start_private_timer() | ||
|
||
// Timer offset from base of private peripheral space --> 0x600 | ||
|
||
// ------------------------------------------------------------ | ||
|
||
.global init_private_timer | ||
.type init_private_timer,function | ||
// void init_private_timer(unsigned int load_value, unsigned int auto_reload) | ||
// Sets up the private timer | ||
// r0: initial load value | ||
// r1: IF 0 (AutoReload) ELSE (SingleShot) | ||
init_private_timer: | ||
|
||
// Setup timeout value (CNTP_TVAL) | ||
MCR p15, 0, r0, c14, c2, 0 | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void start_private_timer(void) | ||
// Starts the private timer | ||
.global start_private_timer | ||
.type start_private_timer,function | ||
start_private_timer: | ||
|
||
MOV r0, #0x1 | ||
|
||
// Enable timer (CNTP_CTL) | ||
MCR p15, 0, r0, c14, c2, 1 | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void stop_private_timer(void) | ||
// Stops the private timer | ||
.global stop_private_timer | ||
.type stop_private_timer,function | ||
stop_private_timer: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// unsigned int read_private_timer(void) | ||
// Reads the current value of the timer count register | ||
.global get_private_timer_count | ||
.type get_private_timer_count,function | ||
get_private_timer_count: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
|
||
// void clear_private_timer_irq(void) | ||
// Clears the private timer interrupt | ||
.global clear_private_timer_irq | ||
.type clear_private_timer_irq,function | ||
clear_private_timer_irq: | ||
|
||
BX lr | ||
|
||
// ------------------------------------------------------------ | ||
// End of code | ||
// ------------------------------------------------------------ | ||
|
||
// ------------------------------------------------------------ | ||
// End of MP_PrivateTimer.s | ||
// ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ------------------------------------------------------------ | ||
// Cortex-A MPCore - Private timer functions | ||
// Header Filer | ||
// | ||
// Copyright ARM Ltd 2009. All rights reserved. | ||
// ------------------------------------------------------------ | ||
|
||
#ifndef _CORTEXA_PRIVATE_TIMER_ | ||
#define _CORTEXA_PRIVATE_TIMER_ | ||
|
||
// Typical set of calls to enable Timer: | ||
// init_private_timer(0xXXXX, 0) <-- Counter down value of 0xXXXX, with auto-reload | ||
// start_private_timer() | ||
|
||
// Sets up the private timer | ||
// r0: initial load value | ||
// r1: IF 0 (AutoReload) ELSE (SingleShot) | ||
void init_private_timer(unsigned int load_value, unsigned int auto_reload); | ||
|
||
// Starts the private timer | ||
void start_private_timer(void); | ||
|
||
// Stops the private timer | ||
void stop_private_timer(void); | ||
|
||
// Reads the current value of the timer count register | ||
unsigned int get_private_timer_count(void); | ||
|
||
// Clears the private timer interrupt | ||
void clear_private_timer_irq(void); | ||
|
||
#endif | ||
|
||
// ------------------------------------------------------------ | ||
// End of MP_PrivateTimer.h | ||
// ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.