Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
9216288c
Commit
9216288c
authored
Feb 12, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timer: define timer_delay_ms(), header minor cleanup
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
6f9c296b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
board-wrc.h
include/board-wrc.h
+1
-0
board-wrs.h
include/board-wrs.h
+2
-1
syscon.h
include/syscon.h
+9
-9
No files found.
include/board-wrc.h
View file @
9216288c
...
...
@@ -8,6 +8,7 @@
#include <hw/memlayout.h>
/* Board-specific parameters */
#define TICS_PER_SECOND 1000
/* WR Core system/CPU clock frequency in Hz */
#define CPU_CLOCK 62500000ULL
...
...
include/board-wrs.h
View file @
9216288c
#ifndef __BOARD_H
#define __BOARD_H
/* RT CPU Memory layout */
#define TICS_PER_SECOND 100000
#define CPU_CLOCK 62500000
#define REF_CLOCK_FREQ_HZ 62500000
...
...
@@ -9,6 +9,7 @@
#define UART_BAUDRATE 115200
/* RT CPU Memory layout */
#define BASE_UART 0x10000
#define BASE_SOFTPLL 0x10100
#define BASE_SPI 0x10200
...
...
include/syscon.h
View file @
9216288c
...
...
@@ -3,17 +3,20 @@
#include <inttypes.h>
#include <sys/types.h>
#ifdef CONFIG_WR_SWITCH
#define TICS_PER_SECOND 100000
#include "board.h"
uint32_t
timer_get_tics
(
void
);
void
timer_delay
(
uint32_t
tics
);
#else
/* CONFIG_WR_NODE */
/* This can be used for up to 2^32 / TICS_PER_SECONDS == 42 seconds in wrs */
static
inline
void
timer_delay_ms
(
int
ms
)
{
timer_delay
(
ms
*
TICS_PER_SECOND
/
1000
);
}
#ifdef CONFIG_WR_NODE
#include "board.h"
#undef PACKED
/* if we already included a regs file, we'd get a warning */
#include <hw/wrc_syscon_regs.h>
...
...
@@ -43,10 +46,7 @@ struct s_i2c_if {
extern
struct
s_i2c_if
i2c_if
[
2
];
#define TICS_PER_SECOND 1000
void
timer_init
(
uint32_t
enable
);
uint32_t
timer_get_tics
(
void
);
void
timer_delay
(
uint32_t
tics
);
/* usleep.c */
extern
void
usleep_init
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment