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