mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Blackfin arch: gpio pinmux and resource allocation API required by BF537 on chip ethernet mac driver
Signed-off-by: Michael Hennerich <[email protected]> Signed-off-by: Bryan Wu <[email protected]>
This commit is contained in:
parent
0b95f22bd3
commit
c58c2140f0
6 changed files with 329 additions and 45 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/portmux.h>
|
||||
|
||||
#define NR_PORTS 1
|
||||
|
||||
|
|
@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
|
|||
}
|
||||
};
|
||||
|
||||
#define DRIVER_NAME "bfin-uart"
|
||||
|
||||
int nr_ports = NR_PORTS;
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
peripheral_request(P_UART0_TX, DRIVER_NAME);
|
||||
peripheral_request(P_UART0_RX, DRIVER_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_request(uart->cts_pin, DRIVER_NAME);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_request(uart->rts_pin, DRIVER_NAME);
|
||||
gpio_direction_input(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/portmux.h>
|
||||
|
||||
#define NR_PORTS 2
|
||||
|
||||
|
|
@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = {
|
|||
|
||||
int nr_ports = ARRAY_SIZE(bfin_serial_resource);
|
||||
|
||||
#define DRIVER_NAME "bfin-uart"
|
||||
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
unsigned short val;
|
||||
val = bfin_read16(BFIN_PORT_MUX);
|
||||
val &= ~(PFDE | PFTE);
|
||||
bfin_write16(BFIN_PORT_MUX, val);
|
||||
|
||||
val = bfin_read16(PORTF_FER);
|
||||
val |= 0xF;
|
||||
bfin_write16(PORTF_FER, val);
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
peripheral_request(P_UART0_TX, DRIVER_NAME);
|
||||
peripheral_request(P_UART0_RX, DRIVER_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART1
|
||||
peripheral_request(P_UART1_TX, DRIVER_NAME);
|
||||
peripheral_request(P_UART1_RX, DRIVER_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_request(uart->cts_pin, DRIVER_NAME);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_request(uart->rts_pin, DRIVER_NAME);
|
||||
gpio_direction_output(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -106,4 +106,4 @@
|
|||
#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1))
|
||||
#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2))
|
||||
|
||||
#endif /* _MACH_PORTMUX_H_ */
|
||||
#endif /* _MACH_PORTMUX_H_ */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <linux/serial.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/portmux.h>
|
||||
|
||||
#define NR_PORTS 1
|
||||
|
||||
|
|
@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = {
|
|||
}
|
||||
};
|
||||
|
||||
#define DRIVER_NAME "bfin-uart"
|
||||
|
||||
int nr_ports = NR_PORTS;
|
||||
static void bfin_serial_hw_init(struct bfin_serial_port *uart)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_UART0
|
||||
peripheral_request(P_UART0_TX, DRIVER_NAME);
|
||||
peripheral_request(P_UART0_RX, DRIVER_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
|
||||
if (uart->cts_pin >= 0) {
|
||||
gpio_request(uart->cts_pin, NULL);
|
||||
gpio_request(uart->cts_pin, DRIVER_NAME);
|
||||
gpio_direction_input(uart->cts_pin);
|
||||
}
|
||||
if (uart->rts_pin >= 0) {
|
||||
gpio_request(uart->rts_pin, NULL);
|
||||
gpio_request(uart->rts_pin, DRIVER_NAME);
|
||||
gpio_direction_input(uart->rts_pin);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@
|
|||
#define P_MAYSHARE 0x2000
|
||||
#define P_DONTCARE 0x1000
|
||||
|
||||
|
||||
int peripheral_request(unsigned short per, const char *label);
|
||||
void peripheral_free(unsigned short per);
|
||||
int peripheral_request_list(unsigned short per[], const char *label);
|
||||
void peripheral_free_list(unsigned short per[]);
|
||||
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/mach/portmux.h>
|
||||
|
||||
|
|
@ -145,6 +151,22 @@
|
|||
#define P_SPI2_SSEL3 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI2_SSEL4
|
||||
#define P_SPI2_SSEL4 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI2_SSEL5
|
||||
#define P_SPI2_SSEL5 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI2_SSEL6
|
||||
#define P_SPI2_SSEL6 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI2_SSEL7
|
||||
#define P_SPI2_SSEL7 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI2_SCK
|
||||
#define P_SPI2_SCK P_UNDEF
|
||||
#endif
|
||||
|
|
@ -513,6 +535,22 @@
|
|||
#define P_SPI0_SSEL3 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI0_SSEL4
|
||||
#define P_SPI0_SSEL4 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI0_SSEL5
|
||||
#define P_SPI0_SSEL5 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI0_SSEL6
|
||||
#define P_SPI0_SSEL6 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI0_SSEL7
|
||||
#define P_SPI0_SSEL7 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_UART0_TX
|
||||
#define P_UART0_TX P_UNDEF
|
||||
#endif
|
||||
|
|
@ -741,6 +779,23 @@
|
|||
#define P_SPI1_SSEL3 P_UNDEF
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef P_SPI1_SSEL4
|
||||
#define P_SPI1_SSEL4 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI1_SSEL5
|
||||
#define P_SPI1_SSEL5 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI1_SSEL6
|
||||
#define P_SPI1_SSEL6 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI1_SSEL7
|
||||
#define P_SPI1_SSEL7 P_UNDEF
|
||||
#endif
|
||||
|
||||
#ifndef P_SPI1_SCK
|
||||
#define P_SPI1_SCK P_UNDEF
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue