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
880c59e5
Commit
880c59e5
authored
15 years ago
by
Graeme Russ
Committed by
Wolfgang Denk
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
eNET: Implement eNET Watchdog
Signed-off-by:
Graeme Russ
<
graeme.russ@gmail.com
>
parent
f2a55055
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
board/eNET/eNET.c
+45
-0
45 additions, 0 deletions
board/eNET/eNET.c
board/eNET/hardware.h
+1
-0
1 addition, 0 deletions
board/eNET/hardware.h
include/configs/eNET.h
+1
-9
1 addition, 9 deletions
include/configs/eNET.h
with
47 additions
and
9 deletions
board/eNET/eNET.c
+
45
−
0
View file @
880c59e5
...
@@ -45,6 +45,9 @@ DECLARE_GLOBAL_DATA_PTR;
...
@@ -45,6 +45,9 @@ DECLARE_GLOBAL_DATA_PTR;
unsigned
long
monitor_flash_len
=
CONFIG_SYS_MONITOR_LEN
;
unsigned
long
monitor_flash_len
=
CONFIG_SYS_MONITOR_LEN
;
static
void
enet_timer_isr
(
void
);
static
void
enet_toggle_run_led
(
void
);
void
init_sc520_enet
(
void
)
void
init_sc520_enet
(
void
)
{
{
/* Set CPU Speed to 100MHz */
/* Set CPU Speed to 100MHz */
...
@@ -160,6 +163,10 @@ int last_stage_init(void)
...
@@ -160,6 +163,10 @@ int last_stage_init(void)
major
=
minor
=
0
;
major
=
minor
=
0
;
outb
(
0x00
,
LED_LATCH_ADDRESS
);
register_timer_isr
(
enet_timer_isr
);
printf
(
"Serck Controls eNET
\n
"
);
printf
(
"Serck Controls eNET
\n
"
);
return
0
;
return
0
;
...
@@ -218,3 +225,41 @@ void setup_pcat_compatibility()
...
@@ -218,3 +225,41 @@ void setup_pcat_compatibility()
writeb
(
SC520_IRQ_DISABLED
,
&
sc520_mmcr
->
wpvmap
);
writeb
(
SC520_IRQ_DISABLED
,
&
sc520_mmcr
->
wpvmap
);
writeb
(
SC520_IRQ_DISABLED
,
&
sc520_mmcr
->
icemap
);
writeb
(
SC520_IRQ_DISABLED
,
&
sc520_mmcr
->
icemap
);
}
}
void
enet_timer_isr
(
void
)
{
static
long
enet_ticks
=
0
;
enet_ticks
++
;
/* Toggle Watchdog every 100ms */
if
((
enet_ticks
%
100
)
==
0
)
hw_watchdog_reset
();
/* Toggle Run LED every 500ms */
if
((
enet_ticks
%
500
)
==
0
)
enet_toggle_run_led
();
}
void
hw_watchdog_reset
(
void
)
{
/* Watchdog Reset must be atomic */
long
flag
=
disable_interrupts
();
if
(
sc520_mmcr
->
piodata15_0
&
WATCHDOG_PIO_BIT
)
sc520_mmcr
->
pioclr15_0
=
WATCHDOG_PIO_BIT
;
else
sc520_mmcr
->
pioset15_0
=
WATCHDOG_PIO_BIT
;
if
(
flag
)
enable_interrupts
();
}
void
enet_toggle_run_led
(
void
)
{
unsigned
char
leds_state
=
inb
(
LED_LATCH_ADDRESS
);
if
(
leds_state
&
LED_RUN_BITMASK
)
outb
(
leds_state
&~
LED_RUN_BITMASK
,
LED_LATCH_ADDRESS
);
else
outb
(
leds_state
|
LED_RUN_BITMASK
,
LED_LATCH_ADDRESS
);
}
This diff is collapsed.
Click to expand it.
board/eNET/hardware.h
+
1
−
0
View file @
880c59e5
...
@@ -31,5 +31,6 @@
...
@@ -31,5 +31,6 @@
#define LED_RX_BITMASK 0x08
#define LED_RX_BITMASK 0x08
#define LED_TX_BITMASK 0x10
#define LED_TX_BITMASK 0x10
#define LED_ERR_BITMASK 0x20
#define LED_ERR_BITMASK 0x20
#define WATCHDOG_PIO_BIT 0x8000
#endif
/* HARDWARE_H_ */
#endif
/* HARDWARE_H_ */
This diff is collapsed.
Click to expand it.
include/configs/eNET.h
+
1
−
9
View file @
880c59e5
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
* bottom (processor) board MUST be removed!
* bottom (processor) board MUST be removed!
*/
*/
#undef CONFIG_WATCHDOG
#undef CONFIG_WATCHDOG
#
un
def CONFIG_HW_WATCHDOG
#def
ine
CONFIG_HW_WATCHDOG
/*-----------------------------------------------------------------------
/*-----------------------------------------------------------------------
* Serial Configuration
* Serial Configuration
...
@@ -233,14 +233,6 @@
...
@@ -233,14 +233,6 @@
#define CONFIG_NET_MULTI
#define CONFIG_NET_MULTI
#define CONFIG_RTL8139
#define CONFIG_RTL8139
/*-----------------------------------------------------------------------
* Hardware watchdog configuration
*/
#define CONFIG_SYS_WATCHDOG_PIO_BIT 0x8000
#define CONFIG_SYS_WATCHDIG_PIO_DATA SC520_PIODATA15_0
#define CONFIG_SYS_WATCHDIG_PIO_CLR SC520_PIOCLR15_0
#define CONFIG_SYS_WATCHDIG_PIO_SET SC520_PIOSET15_0
/*-----------------------------------------------------------------------
/*-----------------------------------------------------------------------
* FPGA configuration
* FPGA configuration
*/
*/
...
...
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