~ubuntu-branches/ubuntu/utopic/linux-ti-omap/utopic

« back to all changes in this revision

Viewing changes to arch/mn10300/kernel/mn10300-debug.c

  • Committer: Bazaar Package Importer
  • Author(s): Amit Kucheria, Amit Kucheria
  • Date: 2010-03-10 02:28:15 UTC
  • Revision ID: james.westby@ubuntu.com-20100310022815-7sd3gwvn5kenaq33
Tags: 2.6.33-500.1
[ Amit Kucheria ]

* Initial release of a 2.6.33-based OMAP kernel
* UBUNTU: [Upstream] Fix omap 1-wire driver compilation
* UBUNTU: ubuntu: AppArmor -- update to mainline 2010-03-04

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Debugging stuff for the MN10300-based processors
 
2
 *
 
3
 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
 
4
 * Written by David Howells (dhowells@redhat.com)
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public Licence
 
8
 * as published by the Free Software Foundation; either version
 
9
 * 2 of the Licence, or (at your option) any later version.
 
10
 */
 
11
#include <linux/sched.h>
 
12
#include <asm/serial-regs.h>
 
13
 
 
14
#undef MN10300_CONSOLE_ON_SERIO
 
15
 
 
16
/*
 
17
 * write a string directly through one of the serial ports on-board the MN10300
 
18
 */
 
19
#ifdef MN10300_CONSOLE_ON_SERIO
 
20
void debug_to_serial_mnser(const char *p, int n)
 
21
{
 
22
        char ch;
 
23
 
 
24
        for (; n > 0; n--) {
 
25
                ch = *p++;
 
26
 
 
27
#if MN10300_CONSOLE_ON_SERIO == 0
 
28
                while (SC0STR & (SC01STR_TBF)) continue;
 
29
                SC0TXB = ch;
 
30
                while (SC0STR & (SC01STR_TBF)) continue;
 
31
                if (ch == 0x0a) {
 
32
                        SC0TXB = 0x0d;
 
33
                        while (SC0STR & (SC01STR_TBF)) continue;
 
34
                }
 
35
 
 
36
#elif MN10300_CONSOLE_ON_SERIO == 1
 
37
                while (SC1STR & (SC01STR_TBF)) continue;
 
38
                SC1TXB = ch;
 
39
                while (SC1STR & (SC01STR_TBF)) continue;
 
40
                if (ch == 0x0a) {
 
41
                        SC1TXB = 0x0d;
 
42
                        while (SC1STR & (SC01STR_TBF)) continue;
 
43
                }
 
44
 
 
45
#elif MN10300_CONSOLE_ON_SERIO == 2
 
46
                while (SC2STR & (SC2STR_TBF)) continue;
 
47
                SC2TXB = ch;
 
48
                while (SC2STR & (SC2STR_TBF)) continue;
 
49
                if (ch == 0x0a) {
 
50
                        SC2TXB = 0x0d;
 
51
                        while (SC2STR & (SC2STR_TBF)) continue;
 
52
                }
 
53
 
 
54
#endif
 
55
        }
 
56
}
 
57
#endif
 
58