blob: c624915b757e0ee7d75c2bf8a3f58560b8289d53 [file] [log] [blame]
Vitaly Bordug3dd0dcb2006-09-21 17:27:15 +04001/*
2 * Platform information definitions.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_PD_H
13#define FS_PD_H
14#include <sysdev/fsl_soc.h>
15#include <asm/time.h>
16
Vitaly Bordugf2a0bd32007-01-24 22:41:24 +030017#ifdef CONFIG_CPM2
18#include <asm/cpm2.h>
Vitaly Bordug3dd0dcb2006-09-21 17:27:15 +040019
Vitaly Bordug54278282007-01-31 02:09:00 +030020#if defined(CONFIG_8260)
21#include <asm/mpc8260.h>
22#elif defined(CONFIG_85xx)
23#include <asm/mpc85xx.h>
24#endif
25
Vitaly Bordugfc8e50e2006-09-21 22:37:58 +040026#define cpm2_map(member) \
27({ \
28 u32 offset = offsetof(cpm2_map_t, member); \
29 void *addr = ioremap (CPM_MAP_ADDR + offset, \
30 sizeof( ((cpm2_map_t*)0)->member)); \
31 addr; \
32})
33
34#define cpm2_map_size(member, size) \
35({ \
36 u32 offset = offsetof(cpm2_map_t, member); \
37 void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
38 addr; \
39})
40
41#define cpm2_unmap(addr) iounmap(addr)
Vitaly Bordugf2a0bd32007-01-24 22:41:24 +030042#endif
43
44#ifdef CONFIG_8xx
45#include <asm/8xx_immap.h>
46#include <asm/mpc8xx.h>
47
48#define immr_map(member) \
49({ \
50 u32 offset = offsetof(immap_t, member); \
51 void *addr = ioremap (IMAP_ADDR + offset, \
52 sizeof( ((immap_t*)0)->member)); \
53 addr; \
54})
55
56#define immr_map_size(member, size) \
57({ \
58 u32 offset = offsetof(immap_t, member); \
59 void *addr = ioremap (IMAP_ADDR + offset, size); \
60 addr; \
61})
62
63#define immr_unmap(addr) iounmap(addr)
64#endif
65
66static inline int uart_baudrate(void)
67{
68 return get_baudrate();
69}
70
71static inline int uart_clock(void)
72{
73 return ppc_proc_freq;
74}
Vitaly Bordugfc8e50e2006-09-21 22:37:58 +040075
Vitaly Bordug3dd0dcb2006-09-21 17:27:15 +040076#endif