Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED U-Boot Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
KED Software Projects
Miscellaneous
KED U-Boot Fork
Commits
764e7417
Commit
764e7417
authored
17 years ago
by
Stefan Roese
Browse files
Options
Downloads
Patches
Plain Diff
ppc4xx: Correct UART input clock calculation and passing to fdt
Signed-off-by:
Stefan Roese
<
sr@denx.de
>
parent
211ea91a
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
cpu/ppc4xx/fdt.c
+0
-4
0 additions, 4 deletions
cpu/ppc4xx/fdt.c
cpu/ppc4xx/serial.c
+15
-0
15 additions, 0 deletions
cpu/ppc4xx/serial.c
with
15 additions
and
4 deletions
cpu/ppc4xx/fdt.c
+
0
−
4
View file @
764e7417
...
...
@@ -85,11 +85,7 @@ static void do_fixup_uart(void *fdt, int offset, int i, bd_t *bd)
debug
(
"Updating node UART%d
\n
"
,
i
);
#if defined(CFG_EXT_SERIAL_CLOCK)
val
=
cpu_to_fdt32
(
CFG_EXT_SERIAL_CLOCK
);
#else
val
=
cpu_to_fdt32
(
sys_info
.
freqUART
);
#endif
rc
=
fdt_setprop
(
fdt
,
offset
,
"clock-frequency"
,
&
val
,
4
);
if
(
rc
)
printf
(
"Unable to update node UART, err=%s
\n
"
,
fdt_strerror
(
rc
));
...
...
This diff is collapsed.
Click to expand it.
cpu/ppc4xx/serial.c
+
15
−
0
View file @
764e7417
...
...
@@ -528,12 +528,18 @@ int serial_init(void)
udiv
=
1
;
tmp
=
gd
->
baudrate
*
16
;
bdiv
=
(
CFG_EXT_SERIAL_CLOCK
+
tmp
/
2
)
/
tmp
;
gd
->
freqUART
=
CFG_EXT_SERIAL_CLOCK
;
#else
/* For 440, the cpu clock is on divider chain A, UART on divider
* chain B ... so cpu clock is irrelevant. Get the "optimized"
* values that are subject to the 1/2 opb clock constraint
*/
serial_divs
(
gd
->
baudrate
,
&
udiv
,
&
bdiv
);
/* Correct UART frequency in bd-info struct now that
* the UART divisor is available
*/
gd
->
freqUART
=
gd
->
freqUART
/
udiv
;
#endif
reg
|=
(
udiv
-
UDIV_SUBTRACT
)
<<
CR0_UDIV_POS
;
/* set the UART divisor */
...
...
@@ -644,6 +650,15 @@ int serial_init (void)
bdiv
=
(
clk
+
tmp
/
2
)
/
tmp
;
#endif
/* CONFIG_405EX */
/* Correct UART frequency in bd-info struct now that
* the UART divisor is available
*/
#ifdef CFG_EXT_SERIAL_CLOCK
gd
->
freqUART
=
CFG_EXT_SERIAL_CLOCK
;
#else
gd
->
freqUART
=
gd
->
freqUART
/
udiv
;
#endif
out8
(
UART_BASE
+
UART_LCR
,
0x80
);
/* set DLAB bit */
out8
(
UART_BASE
+
UART_DLL
,
bdiv
);
/* set baudrate divisor */
out8
(
UART_BASE
+
UART_DLM
,
bdiv
>>
8
);
/* set baudrate divisor */
...
...
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