1 | /** |
---|
2 | * @file |
---|
3 | * @ingroup arm_gp32 |
---|
4 | * @brief Global BSP definitons. |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * Copyright (c) Canon Research France SA.] |
---|
9 | * Emmanuel Raguet, mailto:raguet@crf.canon.fr |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _BSP_H |
---|
17 | #define _BSP_H |
---|
18 | |
---|
19 | #include <bspopts.h> |
---|
20 | #include <bsp/default-initial-extension.h> |
---|
21 | |
---|
22 | #include <rtems.h> |
---|
23 | #include <rtems/iosupp.h> |
---|
24 | #include <rtems/console.h> |
---|
25 | #include <rtems/clockdrv.h> |
---|
26 | #include <s3c24xx.h> |
---|
27 | |
---|
28 | #ifdef __cplusplus |
---|
29 | extern "C" { |
---|
30 | #endif |
---|
31 | |
---|
32 | #define BSP_FEATURE_IRQ_EXTENSION |
---|
33 | |
---|
34 | #define gp32_initButtons() {rPBCON=0x0;} |
---|
35 | #define gp32_getButtons() \ |
---|
36 | ( (((~rPEDAT >> 6) & 0x3 )<<8) | (((~rPBDAT >> 8) & 0xFF)<<0) ) |
---|
37 | |
---|
38 | /** |
---|
39 | * @defgroup arm_gp32 GP32 Support |
---|
40 | * @ingroup bsp_arm |
---|
41 | * @brief GP32 Support Pacakge |
---|
42 | * @{ |
---|
43 | */ |
---|
44 | |
---|
45 | /** |
---|
46 | * @brief functions to get the differents s3c2400 clks |
---|
47 | * @{ |
---|
48 | */ |
---|
49 | |
---|
50 | uint32_t get_FCLK(void); |
---|
51 | uint32_t get_HCLK(void); |
---|
52 | uint32_t get_PCLK(void); |
---|
53 | uint32_t get_UCLK(void); |
---|
54 | |
---|
55 | /** @} */ |
---|
56 | |
---|
57 | void gp32_setPalette( unsigned char pos, uint16_t color); |
---|
58 | |
---|
59 | /* What is the input clock freq in hertz? */ |
---|
60 | /** @brief 12 MHz oscillator */ |
---|
61 | #define BSP_OSC_FREQ 12000000 |
---|
62 | /** @brief FCLK=133Mhz */ |
---|
63 | #define M_MDIV 81 |
---|
64 | #define M_PDIV 2 |
---|
65 | #define M_SDIV 1 |
---|
66 | /** @brief HCLK=FCLK/2, PCLK=FCLK/2 */ |
---|
67 | #define M_CLKDIVN 2 |
---|
68 | /** @brief enable refresh */ |
---|
69 | #define REFEN 0x1 |
---|
70 | /** @brief CBR(CAS before RAS)/auto refresh */ |
---|
71 | #define TREFMD 0x0 |
---|
72 | /** @brief 2 clk */ |
---|
73 | #define Trp 0x0 |
---|
74 | /** @brief 7 clk */ |
---|
75 | #define Trc 0x3 |
---|
76 | /** @brief 3 clk */ |
---|
77 | #define Tchr 0x2 |
---|
78 | |
---|
79 | /** |
---|
80 | * @brief This BSP provides its own IDLE thread to override the RTEMS one. |
---|
81 | * |
---|
82 | * So we prototype it and define the constant confdefs.h expects |
---|
83 | * to configure a BSP specific one. |
---|
84 | */ |
---|
85 | void *bsp_idle_thread(uintptr_t ignored); |
---|
86 | |
---|
87 | /** @} */ |
---|
88 | |
---|
89 | #define BSP_IDLE_TASK_BODY bsp_idle_thread |
---|
90 | |
---|
91 | #ifdef __cplusplus |
---|
92 | } |
---|
93 | #endif |
---|
94 | |
---|
95 | #endif /* _BSP_H */ |
---|
96 | |
---|