0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// omap3530/assp/inc/omap3530_hardware_base.h
|
|
15 |
// Linear base addresses for hardware peripherals on the beagle board.
|
|
16 |
// This file is part of the Beagle Base port
|
|
17 |
//
|
|
18 |
|
|
19 |
#ifndef OMAP3530_HARDWARE_BASE_INL__
|
|
20 |
# define OMAP3530_HARDWARE_BASE_INL__
|
|
21 |
|
|
22 |
|
|
23 |
// **** TEST CODE ****
|
|
24 |
//# define HEADER_OMAP3530_HARDWARE_BASE_H_DO_COMPILE_TIME_CHECK_TESTS 1
|
|
25 |
# ifdef HEADER_OMAP3530_HARDWARE_BASE_H_DO_COMPILE_TIME_CHECK_TESTS
|
|
26 |
# warning HEADER_OMAP3530_HARDWARE_BASE_H_DO_COMPILE_TIME_CHECK_TESTS defined in __FILE__
|
|
27 |
namespace OMAP3530
|
|
28 |
{
|
|
29 |
|
|
30 |
namespace CompileTimeTest
|
|
31 |
{
|
|
32 |
|
|
33 |
inline void CompileTimeChecks(void)
|
|
34 |
{
|
|
35 |
__ASSERT_COMPILE((OMAP3530::TBit<0>::KValue == 0x00000001)) ;
|
|
36 |
__ASSERT_COMPILE((OMAP3530::TBit<1>::KValue == 0x00000002)) ;
|
|
37 |
__ASSERT_COMPILE((OMAP3530::TBit<30>::KValue == 0x40000000)) ;
|
|
38 |
__ASSERT_COMPILE((OMAP3530::TBit<31>::KValue == 0x80000000u)) ;
|
|
39 |
|
|
40 |
__ASSERT_COMPILE((0 == OMAP3530::TBitFieldBase<0, 1>::KShift)) ;
|
|
41 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<0, 1>::KValueMask)) ;
|
|
42 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<0, 1>::KFieldMask)) ;
|
|
43 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<0, 1>::KValueMax)) ;
|
|
44 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<0, 1>::KFieldMax)) ;
|
|
45 |
|
|
46 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<1, 1>::KShift)) ;
|
|
47 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<1, 1>::KValueMask)) ;
|
|
48 |
__ASSERT_COMPILE((0x00000002 == OMAP3530::TBitFieldBase<1, 1>::KFieldMask)) ;
|
|
49 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<1, 1>::KValueMax)) ;
|
|
50 |
__ASSERT_COMPILE((0x00000002 == OMAP3530::TBitFieldBase<1, 1>::KFieldMax)) ;
|
|
51 |
|
|
52 |
__ASSERT_COMPILE((16 == OMAP3530::TBitFieldBase<16, 1>::KShift)) ;
|
|
53 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<16, 1>::KValueMask)) ;
|
|
54 |
__ASSERT_COMPILE((0x00010000 == OMAP3530::TBitFieldBase<16, 1>::KFieldMask)) ;
|
|
55 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<16, 1>::KValueMax)) ;
|
|
56 |
__ASSERT_COMPILE((0x00010000 == OMAP3530::TBitFieldBase<16, 1>::KFieldMax)) ;
|
|
57 |
|
|
58 |
__ASSERT_COMPILE((30 == OMAP3530::TBitFieldBase<30, 1>::KShift)) ;
|
|
59 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<30, 1>::KValueMask)) ;
|
|
60 |
__ASSERT_COMPILE((0x40000000 == OMAP3530::TBitFieldBase<30, 1>::KFieldMask)) ;
|
|
61 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<30, 1>::KValueMax)) ;
|
|
62 |
__ASSERT_COMPILE((0x40000000 == OMAP3530::TBitFieldBase<30, 1>::KFieldMax)) ;
|
|
63 |
|
|
64 |
__ASSERT_COMPILE((31 == OMAP3530::TBitFieldBase<31, 1>::KShift)) ;
|
|
65 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<31, 1>::KValueMask)) ;
|
|
66 |
__ASSERT_COMPILE((0x80000000 == OMAP3530::TBitFieldBase<31, 1>::KFieldMask)) ;
|
|
67 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<31, 1>::KValueMax)) ;
|
|
68 |
__ASSERT_COMPILE((0x80000000 == OMAP3530::TBitFieldBase<31, 1>::KFieldMax)) ;
|
|
69 |
|
|
70 |
__ASSERT_COMPILE((0 == OMAP3530::TBitFieldBase<0, 3>::KShift)) ;
|
|
71 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<0, 3>::KValueMask)) ;
|
|
72 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<0, 3>::KFieldMask)) ;
|
|
73 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<0, 3>::KValueMax)) ;
|
|
74 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<0, 3>::KFieldMax)) ;
|
|
75 |
|
|
76 |
__ASSERT_COMPILE((1 == OMAP3530::TBitFieldBase<1, 2>::KShift)) ;
|
|
77 |
__ASSERT_COMPILE((3 == OMAP3530::TBitFieldBase<1, 2>::KValueMask)) ;
|
|
78 |
__ASSERT_COMPILE((0x00000006 == OMAP3530::TBitFieldBase<1, 2>::KFieldMask)) ;
|
|
79 |
__ASSERT_COMPILE((3 == OMAP3530::TBitFieldBase<1, 2>::KValueMax)) ;
|
|
80 |
__ASSERT_COMPILE((0x00000006 == OMAP3530::TBitFieldBase<1, 2>::KFieldMax)) ;
|
|
81 |
|
|
82 |
__ASSERT_COMPILE((29 == OMAP3530::TBitFieldBase<29, 3>::KShift)) ;
|
|
83 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<29, 3>::KValueMask)) ;
|
|
84 |
__ASSERT_COMPILE((0xE0000000 == OMAP3530::TBitFieldBase<29, 3>::KFieldMask)) ;
|
|
85 |
__ASSERT_COMPILE((7 == OMAP3530::TBitFieldBase<29, 3>::KValueMax)) ;
|
|
86 |
__ASSERT_COMPILE((0xE0000000 == OMAP3530::TBitFieldBase<29, 3>::KFieldMax)) ;
|
|
87 |
|
|
88 |
__ASSERT_COMPILE((0x00000000 == OMAP3530::TBitFieldValue<15, 3, 0>::KValue)) ;
|
|
89 |
__ASSERT_COMPILE((0x00008000 == OMAP3530::TBitFieldValue<15, 3, 1>::KValue)) ;
|
|
90 |
__ASSERT_COMPILE((0x00038000 == OMAP3530::TBitFieldValue<15, 3, 7>::KValue)) ;
|
|
91 |
|
|
92 |
typedef OMAP3530::TBitField<8, 2> TBitField89 ;
|
|
93 |
__ASSERT_COMPILE((0 == TBitField89::TConstVal<0>::KValue)) ;
|
|
94 |
__ASSERT_COMPILE((0x00000100 == TBitField89::TConstVal<1>::KValue)) ;
|
|
95 |
__ASSERT_COMPILE((0x00000300 == TBitField89::TConstVal<3>::KValue)) ;
|
|
96 |
|
|
97 |
typedef OMAP3530::TSingleBitField<0> TBit0 ;
|
|
98 |
__ASSERT_COMPILE((0 == TBit0::KOff)) ;
|
|
99 |
__ASSERT_COMPILE((1 == TBit0::KOn)) ;
|
|
100 |
typedef OMAP3530::TSingleBitField<1> TBit1 ;
|
|
101 |
__ASSERT_COMPILE((0 == TBit1::KOff)) ;
|
|
102 |
__ASSERT_COMPILE((2 == TBit1::KOn)) ;
|
|
103 |
typedef OMAP3530::TSingleBitField<16> TBit16 ;
|
|
104 |
__ASSERT_COMPILE((0 == TBit16::KOff)) ;
|
|
105 |
__ASSERT_COMPILE((0x00010000 == TBit16::KOn)) ;
|
|
106 |
typedef OMAP3530::TSingleBitField<31> TBit31 ;
|
|
107 |
__ASSERT_COMPILE((0 == TBit31::KOff)) ;
|
|
108 |
__ASSERT_COMPILE((0x80000000 == TBit31::KOn)) ;
|
|
109 |
|
|
110 |
__ASSERT_COMPILE((Omap3530HwBase::TVirtual<0x48318000>::KIsL4Core)) ;
|
|
111 |
__ASSERT_COMPILE((OMAP3530::TVirtual<0x48318000>::KIsL4WakeUp)) ;
|
|
112 |
__ASSERT_COMPILE((!OMAP3530::TVirtual<0x48318000>::KIsL4Emu)) ;
|
|
113 |
__ASSERT_COMPILE((!OMAP3530::TVirtual<0x0000FFFF>::KIsConvertable)) ;
|
|
114 |
__ASSERT_COMPILE((OMAP3530::TLinearCheck< OMAP3530::TVirtual<0x48318000>::Value >::KIsMapped)) ;
|
|
115 |
__ASSERT_COMPILE((!OMAP3530::TLinearCheck< OMAP3530::TVirtual<0x0000FFFF>::Value >::KIsMapped)) ;
|
|
116 |
const TLinAddr mapped(OMAP3530::TVirtual<0x48318000>::Value) ;
|
|
117 |
const TLinAddr unmapped(OMAP3530::TVirtual<0x0000FFFF>::Value) ;
|
|
118 |
__ASSERT_COMPILE((OMAP3530::TLinearCheck< mapped >::KIsMapped)) ;
|
|
119 |
__ASSERT_COMPILE((!OMAP3530::TLinearCheck< unmapped >::KIsMapped)) ;
|
|
120 |
__ASSERT_COMPILE((0)) ; // Prove that testing is happening
|
|
121 |
}
|
|
122 |
|
|
123 |
} ; // namespace CompileTimeTest
|
|
124 |
|
|
125 |
} ; // namespace OMAP3530
|
|
126 |
# endif
|
|
127 |
|
|
128 |
#endif // !OMAP3530_HARDWARE_BASE_INL__
|