diff options
Diffstat (limited to 'utils/hwstub/stub/pp/target.c')
-rw-r--r-- | utils/hwstub/stub/pp/target.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/utils/hwstub/stub/pp/target.c b/utils/hwstub/stub/pp/target.c new file mode 100644 index 0000000000..14eab80080 --- /dev/null +++ b/utils/hwstub/stub/pp/target.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2014 by Amaury Pouly | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "stddef.h" | ||
22 | #include "target.h" | ||
23 | #include "system.h" | ||
24 | #include "logf.h" | ||
25 | #include "memory.h" | ||
26 | |||
27 | /** | ||
28 | * | ||
29 | * Global | ||
30 | * | ||
31 | */ | ||
32 | |||
33 | /* FIXME wrong for PP500x */ | ||
34 | #define USEC_TIMER (*(volatile unsigned long *)(0x60005010)) | ||
35 | |||
36 | struct hwstub_target_desc_t __attribute__((aligned(2))) target_descriptor = | ||
37 | { | ||
38 | sizeof(struct hwstub_target_desc_t), | ||
39 | HWSTUB_DT_TARGET, | ||
40 | HWSTUB_TARGET_PP, | ||
41 | "PP500x / PP502x / PP610x" | ||
42 | }; | ||
43 | |||
44 | void target_init(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | void target_get_desc(int desc, void **buffer) | ||
49 | { | ||
50 | *buffer = NULL; | ||
51 | } | ||
52 | |||
53 | void target_get_config_desc(void *buffer, int *size) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | void target_udelay(int us) | ||
58 | { | ||
59 | uint32_t end = USEC_TIMER + us; | ||
60 | while(USEC_TIMER <= end); | ||
61 | } | ||
62 | |||
63 | void target_mdelay(int ms) | ||
64 | { | ||
65 | return target_udelay(ms * 1000); | ||
66 | } | ||