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
0c056f0e
Commit
0c056f0e
authored
18 years ago
by
Marian Balakowicz
Browse files
Options
Downloads
Patches
Plain Diff
Fix serial console support for MCF5271.
parent
483a0cf8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
cpu/mcf52x2/serial.c
+16
-6
16 additions, 6 deletions
cpu/mcf52x2/serial.c
with
18 additions
and
6 deletions
CHANGELOG
+
2
−
0
View file @
0c056f0e
...
...
@@ -2,6 +2,8 @@
Changes since U-Boot 1.1.4:
======================================================================
* Fix serial console support for MCF5271.
* Fixes for gcc 3.4 based m68k toolchain,
based on patch by Jate Sujjavanich.
...
...
This diff is collapsed.
Click to expand it.
cpu/mcf52x2/serial.c
+
16
−
6
View file @
0c056f0e
...
...
@@ -44,7 +44,7 @@
DECLARE_GLOBAL_DATA_PTR
;
#ifdef
CONFIG_M5249
#if
def
ined(
CONFIG_M5249
) || defined(CONFIG_M5271)
#define DoubleClock(a) ((double)(CFG_CLK/2) / 32.0 / (double)(a))
#else
#define DoubleClock(a) ((double)(CFG_CLK) / 32.0 / (double)(a))
...
...
@@ -54,7 +54,10 @@ void rs_serial_setbaudrate(int port,int baudrate)
{
#if defined(CONFIG_M5272) || defined(CONFIG_M5249) || defined(CONFIG_M5271)
volatile
unsigned
char
*
uartp
;
double
clock
,
fraction
;
#ifndef CONFIG_M5271
double
fraction
;
#endif
double
clock
;
if
(
port
==
0
)
uartp
=
(
volatile
unsigned
char
*
)
(
CFG_MBAR
+
MCFUART_BASE1
);
...
...
@@ -63,11 +66,11 @@ void rs_serial_setbaudrate(int port,int baudrate)
clock
=
DoubleClock
(
baudrate
);
/* Set baud above */
fraction
=
((
clock
-
(
int
)
clock
)
*
16
.
0
)
+
0
.
5
;
uartp
[
MCFUART_UBG1
]
=
(((
int
)
clock
>>
8
)
&
0xff
);
/* set msb baud */
uartp
[
MCFUART_UBG2
]
=
((
int
)
clock
&
0xff
);
/* set lsb baud */
#ifndef CONFIG_M5271
fraction
=
((
clock
-
(
int
)
clock
)
*
16
.
0
)
+
0
.
5
;
uartp
[
MCFUART_UFPD
]
=
((
int
)
fraction
&
0xf
);
/* set baud fraction adjust */
#endif
#endif
...
...
@@ -85,8 +88,9 @@ void rs_serial_init(int port,int baudrate)
else
uartp
=
(
volatile
unsigned
char
*
)
(
CFG_MBAR
+
MCFUART_BASE2
);
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_CMDRESETRX
;
/* reset RX */
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_CMDRESETTX
;
/* reset TX */
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_CMDRESETRX
;
/* reset RX */
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_CMDRESETMRPTR
;
/* reset MR pointer */
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_CMDRESETERR
;
/* reset Error pointer */
...
...
@@ -96,9 +100,15 @@ void rs_serial_init(int port,int baudrate)
uartp
[
MCFUART_UMR
]
=
MCFUART_MR1_PARITYNONE
|
MCFUART_MR1_CS8
;
uartp
[
MCFUART_UMR
]
=
MCFUART_MR2_STOP1
;
rs_serial_setbaudrate
(
port
,
baudrate
);
/* Mask UART interrupts */
uartp
[
MCFUART_UIMR
]
=
0
;
/* Set clock Select Register: Tx/Rx clock is timer */
uartp
[
MCFUART_UCSR
]
=
MCFUART_UCSR_RXCLKTIMER
|
MCFUART_UCSR_TXCLKTIMER
;
rs_serial_setbaudrate
(
port
,
baudrate
);
/* Enable Tx/Rx */
uartp
[
MCFUART_UCR
]
=
MCFUART_UCR_RXENABLE
|
MCFUART_UCR_TXENABLE
;
return
;
...
...
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