blob: 21507277118aaf851249ddfe665ff43016c5cedc [file] [log] [blame]
Linus Nielsen Feltzing5f655c92006-07-13 07:40:30 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Ulrich Pegelow
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Linus Nielsen Feltzing5f655c92006-07-13 07:40:30 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "system.h"
24#include "logf.h"
25#include "m5636-target.h"
26
27void m5636_device_init(void)
28{
29 and_l(~0x00004000, &GPIO_INT_EN); /* probably redundant: disable
30 interrupt; just in case ... */
31 and_l(~0x00000004, &GPIO1_OUT); /* probably redundant: set GPIO34 low */
32 or_l( 0x00000004, &GPIO1_ENABLE); /* GPIO34 enable (see above) */
33 or_l( 0x00000004, &GPIO1_FUNCTION); /* GPIO34 function (see above) */
34}
35
36/* for debugging purposes only */
37void m5636_dump_regs(void)
38{
39 unsigned short *address;
40
41 for (address = (unsigned short *)M5636_BASE;
42 address < (unsigned short *)(M5636_BASE + 0x100);
43 address++)
44 {
Michael Sevakis33545312007-03-20 13:53:23 +000045 logf("m5636 A:%08lX D:%04lX", (uintptr_t)address,
46 (uintptr_t)*address);
Linus Nielsen Feltzing5f655c92006-07-13 07:40:30 +000047 }
48
Michael Sevakis33545312007-03-20 13:53:23 +000049 logf("GPIO_INT_EN %08lX", GPIO_INT_EN);
50 logf("GPIO1_OUT %08lX", GPIO1_OUT);
51 logf("GPIO1_ENABLE %08lX", GPIO1_ENABLE);
52 logf("GPIO1_FUNCTION %08lX", GPIO1_FUNCTION);
Linus Nielsen Feltzing5f655c92006-07-13 07:40:30 +000053}