Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * arch/ppc/platforms/tqm8260_setup.c | |
3 | * | |
4 | * TQM8260 platform support | |
5 | * | |
6 | * Author: Allen Curtis <acurtis@onz.com> | |
7 | * Derived from: m8260_setup.c by Dan Malek, MVista | |
8 | * | |
9 | * Copyright 2002 Ones and Zeros, Inc. | |
10 | * | |
11 | * This program is free software; you can redistribute it and/or modify it | |
12 | * under the terms of the GNU General Public License as published by the | |
13 | * Free Software Foundation; either version 2 of the License, or (at your | |
14 | * option) any later version. | |
15 | */ | |
16 | ||
17 | #include <linux/init.h> | |
18 | ||
1da177e4 | 19 | #include <asm/mpc8260.h> |
c64d7b4c | 20 | #include <asm/cpm2.h> |
1da177e4 LT |
21 | #include <asm/machdep.h> |
22 | ||
23 | static int | |
24 | tqm8260_set_rtc_time(unsigned long time) | |
25 | { | |
26 | ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt = time; | |
27 | ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcntsc = 0x3; | |
28 | ||
29 | return(0); | |
30 | } | |
31 | ||
32 | static unsigned long | |
33 | tqm8260_get_rtc_time(void) | |
34 | { | |
35 | return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt; | |
36 | } | |
37 | ||
38 | void __init | |
39 | m82xx_board_init(void) | |
40 | { | |
41 | /* Anything special for this platform */ | |
42 | ppc_md.set_rtc_time = tqm8260_set_rtc_time; | |
43 | ppc_md.get_rtc_time = tqm8260_get_rtc_time; | |
44 | } |