blob: 1e2962fc4fa8ac19afa74bfcc7d930d3bce3d8ab [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 Bordugfc8e50e2006-09-21 22:37:58 +040020#define cpm2_map(member) \
21({ \
22 u32 offset = offsetof(cpm2_map_t, member); \
23 void *addr = ioremap (CPM_MAP_ADDR + offset, \
24 sizeof( ((cpm2_map_t*)0)->member)); \
25 addr; \
26})
27
28#define cpm2_map_size(member, size) \
29({ \
30 u32 offset = offsetof(cpm2_map_t, member); \
31 void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
32 addr; \
33})
34
35#define cpm2_unmap(addr) iounmap(addr)
Vitaly Bordugf2a0bd32007-01-24 22:41:24 +030036#endif
37
38#ifdef CONFIG_8xx
39#include <asm/8xx_immap.h>
40#include <asm/mpc8xx.h>
41
42#define immr_map(member) \
43({ \
44 u32 offset = offsetof(immap_t, member); \
45 void *addr = ioremap (IMAP_ADDR + offset, \
46 sizeof( ((immap_t*)0)->member)); \
47 addr; \
48})
49
50#define immr_map_size(member, size) \
51({ \
52 u32 offset = offsetof(immap_t, member); \
53 void *addr = ioremap (IMAP_ADDR + offset, size); \
54 addr; \
55})
56
57#define immr_unmap(addr) iounmap(addr)
58#endif
59
60static inline int uart_baudrate(void)
61{
62 return get_baudrate();
63}
64
65static inline int uart_clock(void)
66{
67 return ppc_proc_freq;
68}
Vitaly Bordugfc8e50e2006-09-21 22:37:58 +040069
Vitaly Bordug3dd0dcb2006-09-21 17:27:15 +040070#endif