Path: blob/master/arch/mn10300/kernel/mn10300-debug.c
10817 views
/* Debugging stuff for the MN10300-based processors1*2* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/10#include <linux/sched.h>11#include <asm/serial-regs.h>1213#undef MN10300_CONSOLE_ON_SERIO1415/*16* write a string directly through one of the serial ports on-board the MN1030017*/18#ifdef MN10300_CONSOLE_ON_SERIO19void debug_to_serial_mnser(const char *p, int n)20{21char ch;2223for (; n > 0; n--) {24ch = *p++;2526#if MN10300_CONSOLE_ON_SERIO == 027while (SC0STR & (SC01STR_TBF)) continue;28SC0TXB = ch;29while (SC0STR & (SC01STR_TBF)) continue;30if (ch == 0x0a) {31SC0TXB = 0x0d;32while (SC0STR & (SC01STR_TBF)) continue;33}3435#elif MN10300_CONSOLE_ON_SERIO == 136while (SC1STR & (SC01STR_TBF)) continue;37SC1TXB = ch;38while (SC1STR & (SC01STR_TBF)) continue;39if (ch == 0x0a) {40SC1TXB = 0x0d;41while (SC1STR & (SC01STR_TBF)) continue;42}4344#elif MN10300_CONSOLE_ON_SERIO == 245while (SC2STR & (SC2STR_TBF)) continue;46SC2TXB = ch;47while (SC2STR & (SC2STR_TBF)) continue;48if (ch == 0x0a) {49SC2TXB = 0x0d;50while (SC2STR & (SC2STR_TBF)) continue;51}5253#endif54}55}56#endif57585960