Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Jack Humbert
reform-boundary-uboot
Commits
9455b7f3
Commit
9455b7f3
authored
20 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
Fix CFG_HZ problems on AT91RM9200 systems
[Remember: CFG_HZ should be 1000 on ALL systems!]
parent
e1599e83
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+3
-0
3 additions, 0 deletions
CHANGELOG
cpu/at91rm9200/interrupts.c
+19
-7
19 additions, 7 deletions
cpu/at91rm9200/interrupts.c
include/configs/at91rm9200dk.h
+2
-1
2 additions, 1 deletion
include/configs/at91rm9200dk.h
include/configs/cmc_pu2.h
+4
-2
4 additions, 2 deletions
include/configs/cmc_pu2.h
with
28 additions
and
10 deletions
CHANGELOG
+
3
−
0
View file @
9455b7f3
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
Changes since U-Boot 1.1.1:
Changes since U-Boot 1.1.1:
======================================================================
======================================================================
* Fix CFG_HZ problems on AT91RM9200 systems
[Remember: CFG_HZ should be 1000 on ALL systems!]
* Patch by Gridish Shlomi, 30 Aug 2004:
* Patch by Gridish Shlomi, 30 Aug 2004:
- Add support to revA version of PQ27 and PQ27E.
- Add support to revA version of PQ27 and PQ27E.
- Reverted MPC8260ADS baudrate back to original 115200
- Reverted MPC8260ADS baudrate back to original 115200
...
...
This diff is collapsed.
Click to expand it.
cpu/at91rm9200/interrupts.c
+
19
−
7
View file @
9455b7f3
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
extern
void
reset_cpu
(
ulong
addr
);
extern
void
reset_cpu
(
ulong
addr
);
/*
we always count down the max.
*/
/*
the number of clocks per CFG_HZ
*/
#define TIMER_LOAD_VAL
0xffff
#define TIMER_LOAD_VAL
(CFG_HZ_CLOCK/CFG_HZ)
/* macro to read the 16 bit timer */
/* macro to read the 16 bit timer */
#define READ_TIMER (tmr->TC_CV & 0x0000ffff)
#define READ_TIMER (tmr->TC_CV & 0x0000ffff)
...
@@ -165,11 +165,13 @@ int interrupt_init (void)
...
@@ -165,11 +165,13 @@ int interrupt_init (void)
*
AT91C_TCB0_BCR
=
0
;
*
AT91C_TCB0_BCR
=
0
;
*
AT91C_TCB0_BMR
=
AT91C_TCB_TC0XC0S_NONE
|
AT91C_TCB_TC1XC1S_NONE
|
AT91C_TCB_TC2XC2S_NONE
;
*
AT91C_TCB0_BMR
=
AT91C_TCB_TC0XC0S_NONE
|
AT91C_TCB_TC1XC1S_NONE
|
AT91C_TCB_TC2XC2S_NONE
;
tmr
->
TC_CCR
=
AT91C_TC_CLKDIS
;
tmr
->
TC_CCR
=
AT91C_TC_CLKDIS
;
tmr
->
TC_CMR
=
AT91C_TC_TIMER_DIV1_CLOCK
;
/* set to MCLK/2 */
#define AT91C_TC_CMR_CPCTRG (1 << 14)
/* set to MCLK/2 and restart the timer when the vlaue in TC_RC is reached */
tmr
->
TC_CMR
=
AT91C_TC_TIMER_DIV1_CLOCK
|
AT91C_TC_CMR_CPCTRG
;
tmr
->
TC_IDR
=
~
0ul
;
tmr
->
TC_IDR
=
~
0ul
;
tmr
->
TC_RC
=
TIMER_LOAD_VAL
;
tmr
->
TC_RC
=
TIMER_LOAD_VAL
;
lastinc
=
TIMER_LOAD_VAL
;
lastinc
=
0
;
tmr
->
TC_CCR
=
AT91C_TC_SWTRG
|
AT91C_TC_CLKEN
;
tmr
->
TC_CCR
=
AT91C_TC_SWTRG
|
AT91C_TC_CLKEN
;
timestamp
=
0
;
timestamp
=
0
;
...
@@ -207,7 +209,7 @@ void reset_timer_masked (void)
...
@@ -207,7 +209,7 @@ void reset_timer_masked (void)
timestamp
=
0
;
timestamp
=
0
;
}
}
ulong
get_timer_
masked
(
void
)
ulong
get_timer_
raw
(
void
)
{
{
ulong
now
=
READ_TIMER
;
ulong
now
=
READ_TIMER
;
...
@@ -223,17 +225,27 @@ ulong get_timer_masked (void)
...
@@ -223,17 +225,27 @@ ulong get_timer_masked (void)
return
timestamp
;
return
timestamp
;
}
}
ulong
get_timer_masked
(
void
)
{
return
get_timer_raw
()
/
TIMER_LOAD_VAL
;
}
void
udelay_masked
(
unsigned
long
usec
)
void
udelay_masked
(
unsigned
long
usec
)
{
{
ulong
tmo
;
ulong
tmo
;
#if 0 /* doesn't work for usec < 1000 */
tmo = usec / 1000;
tmo = usec / 1000;
tmo
*=
CFG_HZ
;
tmo *= CFG_HZ_CLOCK;
#else
tmo
=
CFG_HZ_CLOCK
/
1000
;
tmo
*=
usec
;
#endif
tmo
/=
1000
;
tmo
/=
1000
;
reset_timer_masked
();
reset_timer_masked
();
while
(
get_timer_
masked
()
<
tmo
)
while
(
get_timer_
raw
()
<
tmo
)
/*NOP*/
;
/*NOP*/
;
}
}
...
...
This diff is collapsed.
Click to expand it.
include/configs/at91rm9200dk.h
+
2
−
1
View file @
9455b7f3
...
@@ -182,7 +182,8 @@ struct bd_info_ext {
...
@@ -182,7 +182,8 @@ struct bd_info_ext {
};
};
#endif
#endif
#define CFG_HZ AT91C_MASTER_CLOCK/2
/* AT91C_TC0_CMR is implicitly set to */
#define CFG_HZ 1000
#define CFG_HZ_CLOCK AT91C_MASTER_CLOCK/2
/* AT91C_TC0_CMR is implicitly set to */
/* AT91C_TC_TIMER_DIV1_CLOCK */
/* AT91C_TC_TIMER_DIV1_CLOCK */
#define CONFIG_STACKSIZE (32*1024)
/* regular stack */
#define CONFIG_STACKSIZE (32*1024)
/* regular stack */
...
...
This diff is collapsed.
Click to expand it.
include/configs/cmc_pu2.h
+
4
−
2
View file @
9455b7f3
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
#undef CONFIG_MODEM_SUPPORT
/* disable modem initialization stuff */
#undef CONFIG_MODEM_SUPPORT
/* disable modem initialization stuff */
#def
ine
CONFIG_HARD_I2C
#
un
def CONFIG_HARD_I2C
#ifdef CONFIG_HARD_I2C
#ifdef CONFIG_HARD_I2C
#define CFG_I2C_SPEED 0
/* not used */
#define CFG_I2C_SPEED 0
/* not used */
...
@@ -90,6 +90,7 @@
...
@@ -90,6 +90,7 @@
#define CONFIG_COMMANDS \
#define CONFIG_COMMANDS \
((CONFIG_CMD_DFL | \
((CONFIG_CMD_DFL | \
CFG_CMD_I2C | \
CFG_CMD_I2C | \
CFG_CMD_DATE | \
CFG_CMD_EEPROM | \
CFG_CMD_EEPROM | \
CFG_CMD_DHCP ) & \
CFG_CMD_DHCP ) & \
~(CFG_CMD_BDI | \
~(CFG_CMD_BDI | \
...
@@ -213,7 +214,8 @@ struct bd_info_ext {
...
@@ -213,7 +214,8 @@ struct bd_info_ext {
};
};
#endif
#endif
#define CFG_HZ AT91C_MASTER_CLOCK/2
/* AT91C_TC0_CMR is implicitly set to */
#define CFG_HZ 1000
#define CFG_HZ_CLOCK AT91C_MASTER_CLOCK/2
/* AT91C_TC0_CMR is implicitly set to */
/* AT91C_TC_TIMER_DIV1_CLOCK */
/* AT91C_TC_TIMER_DIV1_CLOCK */
#define CONFIG_STACKSIZE (32*1024)
/* regular stack */
#define CONFIG_STACKSIZE (32*1024)
/* regular stack */
...
...
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