Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zephyr Firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Zephyr Firmware
Commits
8aa01010
Commit
8aa01010
authored
Jul 17, 2021
by
Raptor Engineering Development Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set host power LED based on chassis power status
parent
49908f27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
kestrel/src/kestrel.c
kestrel/src/kestrel.c
+28
-0
No files found.
kestrel/src/kestrel.c
View file @
8aa01010
...
...
@@ -385,6 +385,27 @@ static void display_character(char character, int dp)
gpio3_out_write
(
~
(
value
|
((
dp
==
0
)
?
0x0000
:
0x4000
)));
}
static
void
host_power_status_changed
(
void
)
{
uint32_t
dword
;
int
power_led_on
=
0
;
// Set power LED based on host status
if
(
host_power_status
==
HOST_POWER_STATUS_OFFLINE
)
{
power_led_on
=
0
;
}
else
{
power_led_on
=
1
;
}
// Write power LED status to GPIO register
dword
=
gpio3_out_read
();
dword
&=
~
(
0x1
<<
15
);
dword
|=
(
power_led_on
&
0x1
)
<<
15
;
gpio3_out_write
(
dword
);
}
static
void
set_led_bank_display
(
uint8_t
bitfield
)
{
gpio1_out_write
(
~
bitfield
);
...
...
@@ -1811,6 +1832,7 @@ static int process_interrupts_stage2(void)
if
(
post_code
==
0xfefe
)
{
host_power_status
=
HOST_POWER_STATUS_RUNNING
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
}
...
...
@@ -2267,6 +2289,7 @@ void power_off_chassis(int has_lock)
}
host_power_status
=
HOST_POWER_STATUS_POWERING_OFF
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
// Disable PMBUS
...
...
@@ -2281,6 +2304,7 @@ void power_off_chassis(int has_lock)
run_post_shutdown_bmc_peripheral_teardown
();
host_power_status
=
HOST_POWER_STATUS_OFFLINE
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
if
(
!
has_lock
)
{
...
...
@@ -2304,6 +2328,7 @@ int power_on_chassis(int has_lock)
}
host_power_status
=
HOST_POWER_STATUS_POWERING_ON
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
// Verify communication with platform control FPGA
...
...
@@ -2311,6 +2336,7 @@ int power_on_chassis(int has_lock)
if
(
platform_fpga_identifier
[
0
]
==
0xff
)
{
host_power_status
=
HOST_POWER_STATUS_OFFLINE
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
if
(
!
has_lock
)
{
k_sem_give
(
&
chassis_control_semaphore
);
...
...
@@ -2324,6 +2350,7 @@ int power_on_chassis(int has_lock)
(
platform_fpga_identifier
[
3
]
!=
0x20
))
{
host_power_status
=
HOST_POWER_STATUS_OFFLINE
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
if
(
!
has_lock
)
{
k_sem_give
(
&
chassis_control_semaphore
);
...
...
@@ -2400,6 +2427,7 @@ int power_on_chassis(int has_lock)
}
host_power_status
=
HOST_POWER_STATUS_IPLING
;
host_power_status_changed
();
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
if
(
!
has_lock
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment