-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 27690 b: refs/heads/master c: 35189fa h: refs/heads/master v: v3
- Loading branch information
Ralf Baechle
committed
Jun 19, 2006
1 parent
d07a9e5
commit d01f516
Showing
28 changed files
with
3,529 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 355c471f2ff324c21f8a1fb8e2e242a0f2a4aa68 | ||
refs/heads/master: 35189fad3cb5f6e3ab66c8321928a851de0cd2b1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Makefile for Basler eXcite | ||
# | ||
|
||
obj-$(CONFIG_BASLER_EXCITE) += excite_irq.o excite_prom.o excite_setup.o \ | ||
excite_device.o excite_procfs.o | ||
|
||
obj-$(CONFIG_KGDB) += excite_dbg_io.o | ||
obj-m += excite_iodev.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* | ||
* Copyright (C) 2004 by Basler Vision Technologies AG | ||
* Author: Thomas Koeller <thomas.koeller@baslerweb.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
*/ | ||
|
||
#include <linux/config.h> | ||
#include <linux/linkage.h> | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <asm/gdb-stub.h> | ||
#include <asm/rm9k-ocd.h> | ||
#include <excite.h> | ||
|
||
#if defined(CONFIG_SERIAL_8250) && CONFIG_SERIAL_8250_NR_UARTS > 1 | ||
#error Debug port used by serial driver | ||
#endif | ||
|
||
#define UART_CLK 25000000 | ||
#define BASE_BAUD (UART_CLK / 16) | ||
#define REGISTER_BASE_0 0x0208UL | ||
#define REGISTER_BASE_1 0x0238UL | ||
|
||
#define REGISTER_BASE_DBG REGISTER_BASE_1 | ||
|
||
#define CPRR 0x0004 | ||
#define UACFG 0x0200 | ||
#define UAINTS 0x0204 | ||
#define UARBR (REGISTER_BASE_DBG + 0x0000) | ||
#define UATHR (REGISTER_BASE_DBG + 0x0004) | ||
#define UADLL (REGISTER_BASE_DBG + 0x0008) | ||
#define UAIER (REGISTER_BASE_DBG + 0x000c) | ||
#define UADLH (REGISTER_BASE_DBG + 0x0010) | ||
#define UAIIR (REGISTER_BASE_DBG + 0x0014) | ||
#define UAFCR (REGISTER_BASE_DBG + 0x0018) | ||
#define UALCR (REGISTER_BASE_DBG + 0x001c) | ||
#define UAMCR (REGISTER_BASE_DBG + 0x0020) | ||
#define UALSR (REGISTER_BASE_DBG + 0x0024) | ||
#define UAMSR (REGISTER_BASE_DBG + 0x0028) | ||
#define UASCR (REGISTER_BASE_DBG + 0x002c) | ||
|
||
#define PARITY_NONE 0 | ||
#define PARITY_ODD 0x08 | ||
#define PARITY_EVEN 0x18 | ||
#define PARITY_MARK 0x28 | ||
#define PARITY_SPACE 0x38 | ||
|
||
#define DATA_5BIT 0x0 | ||
#define DATA_6BIT 0x1 | ||
#define DATA_7BIT 0x2 | ||
#define DATA_8BIT 0x3 | ||
|
||
#define STOP_1BIT 0x0 | ||
#define STOP_2BIT 0x4 | ||
|
||
#define BAUD_DBG 57600 | ||
#define PARITY_DBG PARITY_NONE | ||
#define DATA_DBG DATA_8BIT | ||
#define STOP_DBG STOP_1BIT | ||
|
||
/* Initialize the serial port for KGDB debugging */ | ||
void __init excite_kgdb_init(void) | ||
{ | ||
const u32 divisor = BASE_BAUD / BAUD_DBG; | ||
|
||
/* Take the UART out of reset */ | ||
titan_writel(0x00ff1cff, CPRR); | ||
titan_writel(0x00000000, UACFG); | ||
titan_writel(0x00000002, UACFG); | ||
|
||
titan_writel(0x0, UALCR); | ||
titan_writel(0x0, UAIER); | ||
|
||
/* Disable FIFOs */ | ||
titan_writel(0x00, UAFCR); | ||
|
||
titan_writel(0x80, UALCR); | ||
titan_writel(divisor & 0xff, UADLL); | ||
titan_writel((divisor & 0xff00) >> 8, UADLH); | ||
titan_writel(0x0, UALCR); | ||
|
||
titan_writel(DATA_DBG | PARITY_DBG | STOP_DBG, UALCR); | ||
|
||
/* Enable receiver interrupt */ | ||
titan_readl(UARBR); | ||
titan_writel(0x1, UAIER); | ||
} | ||
|
||
int getDebugChar(void) | ||
{ | ||
while (!(titan_readl(UALSR) & 0x1)); | ||
return titan_readl(UARBR); | ||
} | ||
|
||
int putDebugChar(int data) | ||
{ | ||
while (!(titan_readl(UALSR) & 0x20)); | ||
titan_writel(data, UATHR); | ||
return 1; | ||
} | ||
|
||
/* KGDB interrupt handler */ | ||
asmlinkage void excite_kgdb_inthdl(struct pt_regs *regs) | ||
{ | ||
if (unlikely( | ||
((titan_readl(UAIIR) & 0x7) == 4) | ||
&& ((titan_readl(UARBR) & 0xff) == 0x3))) | ||
set_async_breakpoint(®s->cp0_epc); | ||
} |
Oops, something went wrong.