Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
u-boot-2015.04
Commits
baaa4f9c
Commit
baaa4f9c
authored
14 years ago
by
Mike Frysinger
Browse files
Options
Downloads
Patches
Plain Diff
Blackfin: serial: clean up muxing a bit
Signed-off-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
dbb6d366
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arch/blackfin/cpu/serial.h
+20
-31
20 additions, 31 deletions
arch/blackfin/cpu/serial.h
with
20 additions
and
31 deletions
arch/blackfin/cpu/serial.h
+
20
−
31
View file @
baaa4f9c
...
@@ -74,23 +74,19 @@ struct bfin_mmr_serial {
...
@@ -74,23 +74,19 @@ struct bfin_mmr_serial {
};
};
#undef __BFP
#undef __BFP
#ifndef UART_LSR
#define __PASTE_UART(num, pfx, sfx) pfx##num##_##sfx
# if (CONFIG_UART_CONSOLE == 3)
#define _PASTE_UART(num, pfx, sfx) __PASTE_UART(num, pfx, sfx)
# define UART_BASE UART3_DLL
#define MMR_UART(mmr) _PASTE_UART(CONFIG_UART_CONSOLE, UART, DLL)
# elif (CONFIG_UART_CONSOLE == 2)
#define P_UART(pin) _PASTE_UART(CONFIG_UART_CONSOLE, P_UART, pin)
# define UART_BASE UART2_DLL
# elif (CONFIG_UART_CONSOLE == 1)
#ifndef UART_DLL
# define UART_BASE UART1_DLL
# define UART_DLL MMR_UART(DLL)
# elif (CONFIG_UART_CONSOLE == 0)
# define UART_BASE UART0_DLL
# endif
#else
#else
# if CONFIG_UART_CONSOLE != 0
# if CONFIG_UART_CONSOLE != 0
# error CONFIG_UART_CONSOLE must be 0 on parts with only one UART
# error CONFIG_UART_CONSOLE must be 0 on parts with only one UART
# endif
# endif
# define UART_BASE UART_DLL
#endif
#endif
#define pUART ((volatile struct bfin_mmr_serial *)UART_
BASE
)
#define pUART ((volatile struct bfin_mmr_serial *)UART_
DLL
)
#ifdef __ADSPBF54x__
#ifdef __ADSPBF54x__
# define ACCESS_LATCH()
# define ACCESS_LATCH()
...
@@ -106,18 +102,7 @@ __attribute__((always_inline))
...
@@ -106,18 +102,7 @@ __attribute__((always_inline))
static
inline
void
serial_do_portmux
(
void
)
static
inline
void
serial_do_portmux
(
void
)
{
{
if
(
!
BFIN_DEBUG_EARLY_SERIAL
)
{
if
(
!
BFIN_DEBUG_EARLY_SERIAL
)
{
const
unsigned
short
pins
[]
=
{
const
unsigned
short
pins
[]
=
{
P_UART
(
RX
),
P_UART
(
TX
),
0
,
};
#if CONFIG_UART_CONSOLE == 0
P_UART0_TX
,
P_UART0_RX
,
#elif CONFIG_UART_CONSOLE == 1
P_UART1_TX
,
P_UART1_RX
,
#elif CONFIG_UART_CONSOLE == 2
P_UART2_TX
,
P_UART2_RX
,
#elif CONFIG_UART_CONSOLE == 3
P_UART3_TX
,
P_UART3_RX
,
#endif
0
,
};
peripheral_request_list
(
pins
,
"bfin-uart"
);
peripheral_request_list
(
pins
,
"bfin-uart"
);
return
;
return
;
}
}
...
@@ -141,13 +126,11 @@ static inline void serial_do_portmux(void)
...
@@ -141,13 +126,11 @@ static inline void serial_do_portmux(void)
}
}
SSYNC
();
SSYNC
();
#elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
#elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
# define DO_MUX(func, tx, rx) \
const
uint16_t
func
[]
=
{
PFDE
,
PFTE
,
};
bfin_write_PORT_MUX(bfin_read_PORT_MUX() & ~(func)); \
bfin_write_PORT_MUX
(
bfin_read_PORT_MUX
()
&
~
func
[
CONFIG_UART_CONSOLE
]);
bfin_write_PORTF_FER(bfin_read_PORTF_FER() | PF##tx | PF##rx);
bfin_write_PORTF_FER
(
bfin_read_PORTF_FER
()
|
switch
(
CONFIG_UART_CONSOLE
)
{
(
1
<<
P_IDENT
(
P_UART
(
RX
)))
|
case
0
:
DO_MUX
(
PFDE
,
0
,
1
);
break
;
(
1
<<
P_IDENT
(
P_UART
(
TX
))));
case
1
:
DO_MUX
(
PFTE
,
2
,
3
);
break
;
}
SSYNC
();
SSYNC
();
#elif defined(__ADSPBF54x__)
#elif defined(__ADSPBF54x__)
# define DO_MUX(port, tx, rx) \
# define DO_MUX(port, tx, rx) \
...
@@ -160,6 +143,12 @@ static inline void serial_do_portmux(void)
...
@@ -160,6 +143,12 @@ static inline void serial_do_portmux(void)
case
3
:
DO_MUX
(
B
,
6
,
7
);
break
;
/* Port B; PB6 and PB7 */
case
3
:
DO_MUX
(
B
,
6
,
7
);
break
;
/* Port B; PB6 and PB7 */
}
}
SSYNC
();
SSYNC
();
#elif defined(__ADSPBF561__)
/* UART pins could be GPIO, but they aren't pin muxed. */
#else
# if (P_UART(RX) & P_DEFINED) || (P_UART(TX) & P_DEFINED)
# error "missing portmux logic for UART"
# endif
#endif
#endif
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment