-
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: 182154 b: refs/heads/master c: f1dd6ad h: refs/heads/master v: v3
- Loading branch information
Linus Torvalds
committed
Feb 28, 2010
1 parent
b07e9b3
commit 02c4474
Showing
157 changed files
with
6,161 additions
and
2,071 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: e10b234b3c4e255d3300a486c4ac15b43253ac6d | ||
refs/heads/master: f1dd6ad599732fc89f36fdd65a2c2cf3c63a8711 |
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,118 @@ | ||
This file explains the locking and exclusion scheme used in the PCCARD | ||
and PCMCIA subsystems. | ||
|
||
|
||
A) Overview, Locking Hierarchy: | ||
=============================== | ||
|
||
pcmcia_socket_list_rwsem - protects only the list of sockets | ||
- skt_mutex - serializes card insert / ejection | ||
- ops_mutex - serializes socket operation | ||
|
||
|
||
B) Exclusion | ||
============ | ||
|
||
The following functions and callbacks to struct pcmcia_socket must | ||
be called with "skt_mutex" held: | ||
|
||
socket_detect_change() | ||
send_event() | ||
socket_reset() | ||
socket_shutdown() | ||
socket_setup() | ||
socket_remove() | ||
socket_insert() | ||
socket_early_resume() | ||
socket_late_resume() | ||
socket_resume() | ||
socket_suspend() | ||
|
||
struct pcmcia_callback *callback | ||
|
||
The following functions and callbacks to struct pcmcia_socket must | ||
be called with "ops_mutex" held: | ||
|
||
socket_reset() | ||
socket_setup() | ||
|
||
struct pccard_operations *ops | ||
struct pccard_resource_ops *resource_ops; | ||
|
||
Note that send_event() and struct pcmcia_callback *callback must not be | ||
called with "ops_mutex" held. | ||
|
||
|
||
C) Protection | ||
============= | ||
|
||
1. Global Data: | ||
--------------- | ||
struct list_head pcmcia_socket_list; | ||
|
||
protected by pcmcia_socket_list_rwsem; | ||
|
||
|
||
2. Per-Socket Data: | ||
------------------- | ||
The resource_ops and their data are protected by ops_mutex. | ||
|
||
The "main" struct pcmcia_socket is protected as follows (read-only fields | ||
or single-use fields not mentioned): | ||
|
||
- by pcmcia_socket_list_rwsem: | ||
struct list_head socket_list; | ||
|
||
- by thread_lock: | ||
unsigned int thread_events; | ||
|
||
- by skt_mutex: | ||
u_int suspended_state; | ||
void (*tune_bridge); | ||
struct pcmcia_callback *callback; | ||
int resume_status; | ||
|
||
- by ops_mutex: | ||
socket_state_t socket; | ||
u_int state; | ||
u_short lock_count; | ||
pccard_mem_map cis_mem; | ||
void __iomem *cis_virt; | ||
struct { } irq; | ||
io_window_t io[]; | ||
pccard_mem_map win[]; | ||
struct list_head cis_cache; | ||
size_t fake_cis_len; | ||
u8 *fake_cis; | ||
u_int irq_mask; | ||
void (*zoom_video); | ||
int (*power_hook); | ||
u8 resource...; | ||
struct list_head devices_list; | ||
u8 device_count; | ||
struct pcmcia_state; | ||
|
||
|
||
3. Per PCMCIA-device Data: | ||
-------------------------- | ||
|
||
The "main" struct pcmcia_devie is protected as follows (read-only fields | ||
or single-use fields not mentioned): | ||
|
||
|
||
- by pcmcia_socket->ops_mutex: | ||
struct list_head socket_device_list; | ||
struct config_t *function_config; | ||
u16 _irq:1; | ||
u16 _io:1; | ||
u16 _win:4; | ||
u16 _locked:1; | ||
u16 allow_func_id_match:1; | ||
u16 suspended:1; | ||
u16 _removed:1; | ||
|
||
- by the PCMCIA driver: | ||
io_req_t io; | ||
irq_req_t irq; | ||
config_req_t conf; | ||
window_handle_t win; |
70 changes: 70 additions & 0 deletions
70
trunk/Documentation/powerpc/dts-bindings/fsl/mpc5121-psc.txt
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,70 @@ | ||
MPC5121 PSC Device Tree Bindings | ||
|
||
PSC in UART mode | ||
---------------- | ||
|
||
For PSC in UART mode the needed PSC serial devices | ||
are specified by fsl,mpc5121-psc-uart nodes in the | ||
fsl,mpc5121-immr SoC node. Additionally the PSC FIFO | ||
Controller node fsl,mpc5121-psc-fifo is requered there: | ||
|
||
fsl,mpc5121-psc-uart nodes | ||
-------------------------- | ||
|
||
Required properties : | ||
- compatible : Should contain "fsl,mpc5121-psc-uart" and "fsl,mpc5121-psc" | ||
- cell-index : Index of the PSC in hardware | ||
- reg : Offset and length of the register set for the PSC device | ||
- interrupts : <a b> where a is the interrupt number of the | ||
PSC FIFO Controller and b is a field that represents an | ||
encoding of the sense and level information for the interrupt. | ||
- interrupt-parent : the phandle for the interrupt controller that | ||
services interrupts for this device. | ||
|
||
Recommended properties : | ||
- fsl,rx-fifo-size : the size of the RX fifo slice (a multiple of 4) | ||
- fsl,tx-fifo-size : the size of the TX fifo slice (a multiple of 4) | ||
|
||
|
||
fsl,mpc5121-psc-fifo node | ||
------------------------- | ||
|
||
Required properties : | ||
- compatible : Should be "fsl,mpc5121-psc-fifo" | ||
- reg : Offset and length of the register set for the PSC | ||
FIFO Controller | ||
- interrupts : <a b> where a is the interrupt number of the | ||
PSC FIFO Controller and b is a field that represents an | ||
encoding of the sense and level information for the interrupt. | ||
- interrupt-parent : the phandle for the interrupt controller that | ||
services interrupts for this device. | ||
|
||
|
||
Example for a board using PSC0 and PSC1 devices in serial mode: | ||
|
||
serial@11000 { | ||
compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
cell-index = <0>; | ||
reg = <0x11000 0x100>; | ||
interrupts = <40 0x8>; | ||
interrupt-parent = < &ipic >; | ||
fsl,rx-fifo-size = <16>; | ||
fsl,tx-fifo-size = <16>; | ||
}; | ||
|
||
serial@11100 { | ||
compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc"; | ||
cell-index = <1>; | ||
reg = <0x11100 0x100>; | ||
interrupts = <40 0x8>; | ||
interrupt-parent = < &ipic >; | ||
fsl,rx-fifo-size = <16>; | ||
fsl,tx-fifo-size = <16>; | ||
}; | ||
|
||
pscfifo@11f00 { | ||
compatible = "fsl,mpc5121-psc-fifo"; | ||
reg = <0x11f00 0x100>; | ||
interrupts = <40 0x8>; | ||
interrupt-parent = < &ipic >; | ||
}; |
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,134 @@ | ||
GDB intends to support the following hardware debug features of BookE | ||
processors: | ||
|
||
4 hardware breakpoints (IAC) | ||
2 hardware watchpoints (read, write and read-write) (DAC) | ||
2 value conditions for the hardware watchpoints (DVC) | ||
|
||
For that, we need to extend ptrace so that GDB can query and set these | ||
resources. Since we're extending, we're trying to create an interface | ||
that's extendable and that covers both BookE and server processors, so | ||
that GDB doesn't need to special-case each of them. We added the | ||
following 3 new ptrace requests. | ||
|
||
1. PTRACE_PPC_GETHWDEBUGINFO | ||
|
||
Query for GDB to discover the hardware debug features. The main info to | ||
be returned here is the minimum alignment for the hardware watchpoints. | ||
BookE processors don't have restrictions here, but server processors have | ||
an 8-byte alignment restriction for hardware watchpoints. We'd like to avoid | ||
adding special cases to GDB based on what it sees in AUXV. | ||
|
||
Since we're at it, we added other useful info that the kernel can return to | ||
GDB: this query will return the number of hardware breakpoints, hardware | ||
watchpoints and whether it supports a range of addresses and a condition. | ||
The query will fill the following structure provided by the requesting process: | ||
|
||
struct ppc_debug_info { | ||
unit32_t version; | ||
unit32_t num_instruction_bps; | ||
unit32_t num_data_bps; | ||
unit32_t num_condition_regs; | ||
unit32_t data_bp_alignment; | ||
unit32_t sizeof_condition; /* size of the DVC register */ | ||
uint64_t features; /* bitmask of the individual flags */ | ||
}; | ||
|
||
features will have bits indicating whether there is support for: | ||
|
||
#define PPC_DEBUG_FEATURE_INSN_BP_RANGE 0x1 | ||
#define PPC_DEBUG_FEATURE_INSN_BP_MASK 0x2 | ||
#define PPC_DEBUG_FEATURE_DATA_BP_RANGE 0x4 | ||
#define PPC_DEBUG_FEATURE_DATA_BP_MASK 0x8 | ||
|
||
2. PTRACE_SETHWDEBUG | ||
|
||
Sets a hardware breakpoint or watchpoint, according to the provided structure: | ||
|
||
struct ppc_hw_breakpoint { | ||
uint32_t version; | ||
#define PPC_BREAKPOINT_TRIGGER_EXECUTE 0x1 | ||
#define PPC_BREAKPOINT_TRIGGER_READ 0x2 | ||
#define PPC_BREAKPOINT_TRIGGER_WRITE 0x4 | ||
uint32_t trigger_type; /* only some combinations allowed */ | ||
#define PPC_BREAKPOINT_MODE_EXACT 0x0 | ||
#define PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE 0x1 | ||
#define PPC_BREAKPOINT_MODE_RANGE_EXCLUSIVE 0x2 | ||
#define PPC_BREAKPOINT_MODE_MASK 0x3 | ||
uint32_t addr_mode; /* address match mode */ | ||
|
||
#define PPC_BREAKPOINT_CONDITION_MODE 0x3 | ||
#define PPC_BREAKPOINT_CONDITION_NONE 0x0 | ||
#define PPC_BREAKPOINT_CONDITION_AND 0x1 | ||
#define PPC_BREAKPOINT_CONDITION_EXACT 0x1 /* different name for the same thing as above */ | ||
#define PPC_BREAKPOINT_CONDITION_OR 0x2 | ||
#define PPC_BREAKPOINT_CONDITION_AND_OR 0x3 | ||
#define PPC_BREAKPOINT_CONDITION_BE_ALL 0x00ff0000 /* byte enable bits */ | ||
#define PPC_BREAKPOINT_CONDITION_BE(n) (1<<((n)+16)) | ||
uint32_t condition_mode; /* break/watchpoint condition flags */ | ||
|
||
uint64_t addr; | ||
uint64_t addr2; | ||
uint64_t condition_value; | ||
}; | ||
|
||
A request specifies one event, not necessarily just one register to be set. | ||
For instance, if the request is for a watchpoint with a condition, both the | ||
DAC and DVC registers will be set in the same request. | ||
|
||
With this GDB can ask for all kinds of hardware breakpoints and watchpoints | ||
that the BookE supports. COMEFROM breakpoints available in server processors | ||
are not contemplated, but that is out of the scope of this work. | ||
|
||
ptrace will return an integer (handle) uniquely identifying the breakpoint or | ||
watchpoint just created. This integer will be used in the PTRACE_DELHWDEBUG | ||
request to ask for its removal. Return -ENOSPC if the requested breakpoint | ||
can't be allocated on the registers. | ||
|
||
Some examples of using the structure to: | ||
|
||
- set a breakpoint in the first breakpoint register | ||
|
||
p.version = PPC_DEBUG_CURRENT_VERSION; | ||
p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
p.addr = (uint64_t) address; | ||
p.addr2 = 0; | ||
p.condition_value = 0; | ||
|
||
- set a watchpoint which triggers on reads in the second watchpoint register | ||
|
||
p.version = PPC_DEBUG_CURRENT_VERSION; | ||
p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
p.addr = (uint64_t) address; | ||
p.addr2 = 0; | ||
p.condition_value = 0; | ||
|
||
- set a watchpoint which triggers only with a specific value | ||
|
||
p.version = PPC_DEBUG_CURRENT_VERSION; | ||
p.trigger_type = PPC_BREAKPOINT_TRIGGER_READ; | ||
p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; | ||
p.condition_mode = PPC_BREAKPOINT_CONDITION_AND | PPC_BREAKPOINT_CONDITION_BE_ALL; | ||
p.addr = (uint64_t) address; | ||
p.addr2 = 0; | ||
p.condition_value = (uint64_t) condition; | ||
|
||
- set a ranged hardware breakpoint | ||
|
||
p.version = PPC_DEBUG_CURRENT_VERSION; | ||
p.trigger_type = PPC_BREAKPOINT_TRIGGER_EXECUTE; | ||
p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; | ||
p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; | ||
p.addr = (uint64_t) begin_range; | ||
p.addr2 = (uint64_t) end_range; | ||
p.condition_value = 0; | ||
|
||
3. PTRACE_DELHWDEBUG | ||
|
||
Takes an integer which identifies an existing breakpoint or watchpoint | ||
(i.e., the value returned from PTRACE_SETHWDEBUG), and deletes the | ||
corresponding breakpoint or watchpoint.. |
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
Oops, something went wrong.