part_ext.h revision 296177
1306196Sjkim/* Copyright (c) 2008-2011 Freescale Semiconductor, Inc.
2110010Smarkm * All rights reserved.
3110010Smarkm *
4160819Ssimon * Redistribution and use in source and binary forms, with or without
5110010Smarkm * modification, are permitted provided that the following conditions are met:
6110010Smarkm *     * Redistributions of source code must retain the above copyright
7110010Smarkm *       notice, this list of conditions and the following disclaimer.
8110010Smarkm *     * Redistributions in binary form must reproduce the above copyright
9110010Smarkm *       notice, this list of conditions and the following disclaimer in the
10110010Smarkm *       documentation and/or other materials provided with the distribution.
11110010Smarkm *     * Neither the name of Freescale Semiconductor nor the
12110010Smarkm *       names of its contributors may be used to endorse or promote products
13110010Smarkm *       derived from this software without specific prior written permission.
14110010Smarkm *
15110010Smarkm *
16110010Smarkm * ALTERNATIVELY, this software may be distributed under the terms of the
17110010Smarkm * GNU General Public License ("GPL") as published by the Free Software
18110010Smarkm * Foundation, either version 2 of that License or (at your option) any
19110010Smarkm * later version.
20215698Ssimon *
21215698Ssimon * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22215698Ssimon * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23215698Ssimon * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24215698Ssimon * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25110010Smarkm * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26110010Smarkm * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27110010Smarkm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28110010Smarkm * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29110010Smarkm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30110010Smarkm * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31110010Smarkm */
32110010Smarkm
33110010Smarkm/**************************************************************************//**
34110010Smarkm
35110010Smarkm @File          part_ext.h
36110010Smarkm
37110010Smarkm @Description   Definitions for the part (integration) module.
38110010Smarkm*//***************************************************************************/
39110010Smarkm
40110010Smarkm#ifndef __PART_EXT_H
41276864Sjkim#define __PART_EXT_H
42276864Sjkim
43110010Smarkm#include "std_ext.h"
44110010Smarkm#include "part_integration_ext.h"
45215698Ssimon
46215698Ssimon
47215698Ssimon#if !(defined(MPC8306) || \
48215698Ssimon      defined(MPC8309) || \
49160819Ssimon      defined(MPC834x) || \
50215698Ssimon      defined(MPC836x) || \
51160819Ssimon      defined(MPC832x) || \
52160819Ssimon      defined(MPC837x) || \
53276864Sjkim      defined(MPC8568) || \
54276864Sjkim      defined(MPC8569) || \
55276864Sjkim      defined(P1020)   || \
56110010Smarkm      defined(P1021)   || \
57276864Sjkim      defined(P1022)   || \
58276864Sjkim      defined(P1023)   || \
59276864Sjkim      defined(P2020)   || \
60276864Sjkim      defined(P2040)   || \
61276864Sjkim      defined(P2041)   || \
62276864Sjkim      defined(P3041)   || \
63215698Ssimon      defined(P4080)   || \
64276864Sjkim      defined(SC4080)  || \
65276864Sjkim      defined(P5020)   || \
66276864Sjkim      defined(MSC814x))
67276864Sjkim#error "unable to proceed without chip-definition"
68276864Sjkim#endif /* !(defined(MPC834x) || ... */
69215698Ssimon
70276864Sjkim
71110010Smarkm/**************************************************************************//*
72110010Smarkm @Description   Part data structure - must be contained in any integration
73110010Smarkm                data structure.
74110010Smarkm*//***************************************************************************/
75110010Smarkmtypedef struct t_Part
76110010Smarkm{
77110010Smarkm    uintptr_t   (* f_GetModuleBase)(t_Handle h_Part, e_ModuleId moduleId);
78110010Smarkm                /**< Returns the address of the module's memory map base. */
79110010Smarkm    e_ModuleId  (* f_GetModuleIdByBase)(t_Handle h_Part, uintptr_t baseAddress);
80110010Smarkm                /**< Returns the module's ID according to its memory map base. */
81110010Smarkm} t_Part;
82110010Smarkm
83110010Smarkm
84110010Smarkm#endif /* __PART_EXT_H */
85110010Smarkm