-
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.
metag: Add JTAG Debug Adapter (DA) support
Add basic JTAG Debug Adapter (DA) support so that drivers which communicate with the DA can detect whether one is actually present (otherwise the target will halt indefinitely). This allows the metag_da TTY driver and imgdafs filesystem driver to be built, updates defconfigs, and sets up the metag_da console early if it's configured in. Signed-off-by: James Hogan <james.hogan@imgtec.com>
- Loading branch information
James Hogan
committed
Mar 2, 2013
1 parent
690998b
commit ae85ac7
Showing
9 changed files
with
105 additions
and
0 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
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
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,43 @@ | ||
/* | ||
* Meta DA JTAG debugger control. | ||
* | ||
* Copyright 2012 Imagination Technologies Ltd. | ||
*/ | ||
|
||
#ifndef _METAG_DA_H_ | ||
#define _METAG_DA_H_ | ||
|
||
#ifdef CONFIG_METAG_DA | ||
|
||
#include <linux/init.h> | ||
#include <linux/types.h> | ||
|
||
extern bool _metag_da_present; | ||
|
||
/** | ||
* metag_da_enabled() - Find whether a DA is currently enabled. | ||
* | ||
* Returns: true if a DA was detected, false if not. | ||
*/ | ||
static inline bool metag_da_enabled(void) | ||
{ | ||
return _metag_da_present; | ||
} | ||
|
||
/** | ||
* metag_da_probe() - Try and detect a connected DA. | ||
* | ||
* This is used at start up to detect whether a DA is active. | ||
* | ||
* Returns: 0 on detection, -err otherwise. | ||
*/ | ||
int __init metag_da_probe(void); | ||
|
||
#else /* !CONFIG_METAG_DA */ | ||
|
||
#define metag_da_enabled() false | ||
#define metag_da_probe() do {} while (0) | ||
|
||
#endif | ||
|
||
#endif /* _METAG_DA_H_ */ |
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,23 @@ | ||
/* | ||
* Meta DA JTAG debugger control. | ||
* | ||
* Copyright 2012 Imagination Technologies Ltd. | ||
*/ | ||
|
||
|
||
#include <linux/io.h> | ||
#include <linux/kernel.h> | ||
#include <asm/da.h> | ||
#include <asm/metag_mem.h> | ||
|
||
bool _metag_da_present; | ||
|
||
int __init metag_da_probe(void) | ||
{ | ||
_metag_da_present = (metag_in32(T0VECINT_BHALT) == 1); | ||
if (_metag_da_present) | ||
pr_info("DA present\n"); | ||
else | ||
pr_info("DA not present\n"); | ||
return 0; | ||
} |
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