/* 16550 serial driver for gdbstub I/O * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence * as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ #include <linux/string.h> #include <linux/kernel.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/console.h> #include <linux/init.h> #include <linux/nmi.h> #include <asm/pgtable.h> #include <asm/gdb-stub.h> #include <asm/exceptions.h> #include <asm/serial-regs.h> #include <unit/serial.h> #include <asm/smp.h> /* * initialise the GDB stub */
void gdbstub_io_init(void) { u16 tmp; /* set up the serial port */ GDBPORT_SERIAL_LCR = UART_LCR_WLEN8; /* 1N8 */ GDBPORT_SERIAL_FCR = (UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); FLOWCTL_CLEAR(DTR); FLOWCTL_SET(RTS); gdbstub_io_set_baud(115200); /* we want to get serial receive interrupts */ XIRQxICR(GDBPORT_SERIAL_IRQ) = 0; tmp = XIRQxICR(GDBPORT_SERIAL_IRQ); #if CONFIG_GDBSTUB_IRQ_LEVEL == 0 IVAR0 = EXCEP_IRQ_LEVEL0; #elif CONFIG_GDBSTUB_IRQ_LEVEL == 1 IVAR1 = EXCEP_IRQ_LEVEL1; #elif CONFIG_GDBSTUB_IRQ_LEVEL == 2 IVAR2 = EXCEP_IRQ_LEVEL2; #elif CONFIG_GDBSTUB_IRQ_LEVEL == 3 IVAR3 = EXCEP_IRQ_LEVEL3; #elif CONFIG_GDBSTUB_IRQ_LEVEL == 4 IVAR4 = EXCEP_IRQ_LEVEL4; #elif CONFIG_GDBSTUB_IRQ_LEVEL == 5 IVAR5 = EXCEP_IRQ_LEVEL5; #else #error "Unknown irq level for gdbstub." #endif set_intr_stub(NUM2EXCEP_IRQ_LEVEL(CONFIG_GDBSTUB_IRQ_LEVEL), gdbstub_io_rx_handler); XIRQxICR(GDBPORT_SERIAL_IRQ) &= ~GxICR_REQUEST; XIRQxICR(GDBPORT_SERIAL_IRQ) = GxICR_ENABLE | NUM2GxICR_LEVEL(CONFIG_GDBSTUB_IRQ_LEVEL); tmp = XIRQxICR(GDBPORT_SERIAL_IRQ); GDBPORT_SERIAL_IER = UART_IER_RDI | UART_IER_RLSI; /* permit level 0 IRQs to take place */ arch_local_change_intr_mask_level( NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); }Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 97 | 56.73% | 2 | 66.67% |
Akira Takeuchi | 74 | 43.27% | 1 | 33.33% |
Total | 171 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 50 | 100.00% | 1 | 100.00% |
Total | 50 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 172 | 86.43% | 2 | 66.67% |
Akira Takeuchi | 27 | 13.57% | 1 | 33.33% |
Total | 199 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 47 | 100.00% | 1 | 100.00% |
Total | 47 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 22 | 100.00% | 1 | 100.00% |
Total | 22 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 433 | 80.63% | 4 | 80.00% |
Akira Takeuchi | 104 | 19.37% | 1 | 20.00% |
Total | 537 | 100.00% | 5 | 100.00% |