diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2007-10-03 12:35:05 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-03 12:35:05 -0400 |
commit | c58c2140f08de4ad0b0dbd48f6e78168dc321042 (patch) | |
tree | ee7381b9db76340295229c56350adcca44d218b1 /include/asm-blackfin/mach-bf537 | |
parent | 0b95f22bd3b91c7114c6892bbfbb5a8576b27fbe (diff) |
Blackfin arch: gpio pinmux and resource allocation API required by BF537 on chip ethernet mac driver
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin/mach-bf537')
-rw-r--r-- | include/asm-blackfin/mach-bf537/bfin_serial_5xx.h | 23 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf537/portmux.h | 2 |
2 files changed, 15 insertions, 10 deletions
diff --git a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h index 8f5d9c4d8d5b..6fb328f5186a 100644 --- a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/serial.h> | 1 | #include <linux/serial.h> |
2 | #include <asm/dma.h> | 2 | #include <asm/dma.h> |
3 | #include <asm/portmux.h> | ||
3 | 4 | ||
4 | #define NR_PORTS 2 | 5 | #define NR_PORTS 2 |
5 | 6 | ||
@@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = { | |||
122 | 123 | ||
123 | int nr_ports = ARRAY_SIZE(bfin_serial_resource); | 124 | int nr_ports = ARRAY_SIZE(bfin_serial_resource); |
124 | 125 | ||
126 | #define DRIVER_NAME "bfin-uart" | ||
127 | |||
125 | static void bfin_serial_hw_init(struct bfin_serial_port *uart) | 128 | static void bfin_serial_hw_init(struct bfin_serial_port *uart) |
126 | { | 129 | { |
127 | unsigned short val; | ||
128 | val = bfin_read16(BFIN_PORT_MUX); | ||
129 | val &= ~(PFDE | PFTE); | ||
130 | bfin_write16(BFIN_PORT_MUX, val); | ||
131 | 130 | ||
132 | val = bfin_read16(PORTF_FER); | 131 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
133 | val |= 0xF; | 132 | peripheral_request(P_UART0_TX, DRIVER_NAME); |
134 | bfin_write16(PORTF_FER, val); | 133 | peripheral_request(P_UART0_RX, DRIVER_NAME); |
134 | #endif | ||
135 | |||
136 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
137 | peripheral_request(P_UART1_TX, DRIVER_NAME); | ||
138 | peripheral_request(P_UART1_RX, DRIVER_NAME); | ||
139 | #endif | ||
135 | 140 | ||
136 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS | 141 | #ifdef CONFIG_SERIAL_BFIN_CTSRTS |
137 | if (uart->cts_pin >= 0) { | 142 | if (uart->cts_pin >= 0) { |
138 | gpio_request(uart->cts_pin, NULL); | 143 | gpio_request(uart->cts_pin, DRIVER_NAME); |
139 | gpio_direction_input(uart->cts_pin); | 144 | gpio_direction_input(uart->cts_pin); |
140 | } | 145 | } |
141 | 146 | ||
142 | if (uart->rts_pin >= 0) { | 147 | if (uart->rts_pin >= 0) { |
143 | gpio_request(uart->rts_pin, NULL); | 148 | gpio_request(uart->rts_pin, DRIVER_NAME); |
144 | gpio_direction_output(uart->rts_pin); | 149 | gpio_direction_output(uart->rts_pin); |
145 | } | 150 | } |
146 | #endif | 151 | #endif |
diff --git a/include/asm-blackfin/mach-bf537/portmux.h b/include/asm-blackfin/mach-bf537/portmux.h index 23e13c5abc4d..7daa2479a731 100644 --- a/include/asm-blackfin/mach-bf537/portmux.h +++ b/include/asm-blackfin/mach-bf537/portmux.h | |||
@@ -106,4 +106,4 @@ | |||
106 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) | 106 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) |
107 | #define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2)) | 107 | #define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2)) |
108 | 108 | ||
109 | #endif /* _MACH_PORTMUX_H_ */ | 109 | #endif /* _MACH_PORTMUX_H_ */ |