diff options
author | Mikael Starvik <mikael.starvik@axis.com> | 2005-07-27 14:44:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:26:00 -0400 |
commit | 63245d2cde2be64f172388c2c50862f233c05700 (patch) | |
tree | c5f41dca80044bf4820e9c65eaa9844eb89493f6 /include | |
parent | 7e9204265b4ec6680fad9abc7a78b94087983916 (diff) |
[PATCH] CRIS update: I/O and DMA allocator
Added I/O and DMA allocators to be used by drivers.
Signed-off-by: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-cris/arch-v10/dma.h | 28 | ||||
-rw-r--r-- | include/asm-cris/arch-v10/io.h | 1 | ||||
-rw-r--r-- | include/asm-cris/arch-v10/io_interface_mux.h | 75 |
3 files changed, 104 insertions, 0 deletions
diff --git a/include/asm-cris/arch-v10/dma.h b/include/asm-cris/arch-v10/dma.h index 9e078b9bc93..ecb9dba6fa4 100644 --- a/include/asm-cris/arch-v10/dma.h +++ b/include/asm-cris/arch-v10/dma.h | |||
@@ -44,3 +44,31 @@ | |||
44 | #define USB_RX_DMA_NBR 9 | 44 | #define USB_RX_DMA_NBR 9 |
45 | 45 | ||
46 | #endif | 46 | #endif |
47 | |||
48 | enum dma_owner | ||
49 | { | ||
50 | dma_eth, | ||
51 | dma_ser0, | ||
52 | dma_ser1, /* Async and sync */ | ||
53 | dma_ser2, | ||
54 | dma_ser3, /* Async and sync */ | ||
55 | dma_ata, | ||
56 | dma_par0, | ||
57 | dma_par1, | ||
58 | dma_ext0, | ||
59 | dma_ext1, | ||
60 | dma_int6, | ||
61 | dma_int7, | ||
62 | dma_usb, | ||
63 | dma_scsi0, | ||
64 | dma_scsi1 | ||
65 | }; | ||
66 | |||
67 | /* Masks used by cris_request_dma options: */ | ||
68 | #define DMA_VERBOSE_ON_ERROR (1<<0) | ||
69 | #define DMA_PANIC_ON_ERROR ((1<<1)|DMA_VERBOSE_ON_ERROR) | ||
70 | |||
71 | int cris_request_dma(unsigned int dmanr, const char * device_id, | ||
72 | unsigned options, enum dma_owner owner); | ||
73 | |||
74 | void cris_free_dma(unsigned int dmanr, const char * device_id); | ||
diff --git a/include/asm-cris/arch-v10/io.h b/include/asm-cris/arch-v10/io.h index 0bc38a0313c..dd39198ec67 100644 --- a/include/asm-cris/arch-v10/io.h +++ b/include/asm-cris/arch-v10/io.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | /* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ | 7 | /* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ |
8 | 8 | ||
9 | extern unsigned long gen_config_ii_shadow; | ||
9 | extern unsigned long port_g_data_shadow; | 10 | extern unsigned long port_g_data_shadow; |
10 | extern unsigned char port_pa_dir_shadow; | 11 | extern unsigned char port_pa_dir_shadow; |
11 | extern unsigned char port_pa_data_shadow; | 12 | extern unsigned char port_pa_data_shadow; |
diff --git a/include/asm-cris/arch-v10/io_interface_mux.h b/include/asm-cris/arch-v10/io_interface_mux.h new file mode 100644 index 00000000000..d9250008088 --- /dev/null +++ b/include/asm-cris/arch-v10/io_interface_mux.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* IO interface mux allocator for ETRAX100LX. | ||
2 | * Copyright 2004, Axis Communications AB | ||
3 | * $Id: io_interface_mux.h,v 1.1 2004/12/13 12:21:53 starvik Exp $ | ||
4 | */ | ||
5 | |||
6 | |||
7 | #ifndef _IO_INTERFACE_MUX_H | ||
8 | #define _IO_INTERFACE_MUX_H | ||
9 | |||
10 | |||
11 | /* C.f. ETRAX100LX Designer's Reference 20.9 */ | ||
12 | |||
13 | /* The order in enum must match the order of interfaces[] in | ||
14 | * io_interface_mux.c */ | ||
15 | enum cris_io_interface { | ||
16 | /* Begin Non-multiplexed interfaces */ | ||
17 | if_eth = 0, | ||
18 | if_serial_0, | ||
19 | /* End Non-multiplexed interfaces */ | ||
20 | if_serial_1, | ||
21 | if_serial_2, | ||
22 | if_serial_3, | ||
23 | if_sync_serial_1, | ||
24 | if_sync_serial_3, | ||
25 | if_shared_ram, | ||
26 | if_shared_ram_w, | ||
27 | if_par_0, | ||
28 | if_par_1, | ||
29 | if_par_w, | ||
30 | if_scsi8_0, | ||
31 | if_scsi8_1, | ||
32 | if_scsi_w, | ||
33 | if_ata, | ||
34 | if_csp, | ||
35 | if_i2c, | ||
36 | if_usb_1, | ||
37 | if_usb_2, | ||
38 | /* GPIO pins */ | ||
39 | if_gpio_grp_a, | ||
40 | if_gpio_grp_b, | ||
41 | if_gpio_grp_c, | ||
42 | if_gpio_grp_d, | ||
43 | if_gpio_grp_e, | ||
44 | if_gpio_grp_f, | ||
45 | if_max_interfaces, | ||
46 | if_unclaimed | ||
47 | }; | ||
48 | |||
49 | int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id); | ||
50 | |||
51 | void cris_free_io_interface(enum cris_io_interface ioif); | ||
52 | |||
53 | /* port can be 'a', 'b' or 'g' */ | ||
54 | int cris_io_interface_allocate_pins(const enum cris_io_interface ioif, | ||
55 | const char port, | ||
56 | const unsigned start_bit, | ||
57 | const unsigned stop_bit); | ||
58 | |||
59 | /* port can be 'a', 'b' or 'g' */ | ||
60 | int cris_io_interface_free_pins(const enum cris_io_interface ioif, | ||
61 | const char port, | ||
62 | const unsigned start_bit, | ||
63 | const unsigned stop_bit); | ||
64 | |||
65 | int cris_io_interface_register_watcher(void (*notify)(const unsigned int gpio_in_available, | ||
66 | const unsigned int gpio_out_available, | ||
67 | const unsigned char pa_available, | ||
68 | const unsigned char pb_available)); | ||
69 | |||
70 | void cris_io_interface_delete_watcher(void (*notify)(const unsigned int gpio_in_available, | ||
71 | const unsigned int gpio_out_available, | ||
72 | const unsigned char pa_available, | ||
73 | const unsigned char pb_available)); | ||
74 | |||
75 | #endif /* _IO_INTERFACE_MUX_H */ | ||