blob: a8880bfc034b2ac05da5392e16e4c247258b734a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
19#include <asm/immap_cpm2.h>
20#include <asm/mpc8260.h>
21#include <asm/machdep.h>
22
23static int
24tqm8260_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
32static unsigned long
33tqm8260_get_rtc_time(void)
34{
35 return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt;
36}
37
38void __init
39m82xx_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}