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
a234b87f
Commit
a234b87f
authored
May 11, 2021
by
Raptor Engineering Development Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set platform status LEDs during IPL
parent
47e20429
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
7 deletions
+60
-7
kestrel/src/kestrel.c
kestrel/src/kestrel.c
+60
-7
No files found.
kestrel/src/kestrel.c
View file @
a234b87f
...
...
@@ -51,6 +51,7 @@ LOG_MODULE_REGISTER(kestrel_core, LOG_LEVEL_DBG);
// General RCS platform registers
#define HOST_PLATFORM_FPGA_I2C_REG_STATUS 0x7
#define HOST_PLATFORM_FPGA_I2C_REG_STA_LED 0x10
#define HOST_PLATFORM_FPGA_I2C_REG_MFR_OVR 0x33
// Host platform configuration
...
...
@@ -386,6 +387,60 @@ static void set_led_bank_display(uint8_t bitfield)
gpio1_out_write
(
~
bitfield
);
}
static
void
display_post_code
(
uint16_t
post_code
)
{
uint8_t
host_status_led_post_code
;
uint8_t
major_istep
=
((
post_code
>>
8
)
&
0xff
);
uint8_t
led_post_code
=
(((
post_code
>>
8
)
&
0xf
)
<<
4
)
|
(
post_code
&
0xf
);
if
(
post_code
==
0xfefe
)
{
// IPL complete!
set_led_bank_display
(
0
);
i2c_write_register_byte
((
uint8_t
*
)
I2CMASTER4_BASE
,
HOST_PLATFORM_FPGA_I2C_ADDRESS
,
HOST_PLATFORM_FPGA_I2C_REG_STA_LED
,
0x00
);
}
else
if
(
post_code
==
0x0
)
{
// System offline
set_led_bank_display
(
0
);
i2c_write_register_byte
((
uint8_t
*
)
I2CMASTER4_BASE
,
HOST_PLATFORM_FPGA_I2C_ADDRESS
,
HOST_PLATFORM_FPGA_I2C_REG_STA_LED
,
0x00
);
}
else
{
// Show major ISTEP on LED bank
// On Talos we only have three LEDs plus a fourth indicator modification bit, but the major ISTEPs range from 2 to 21
// Try to condense that down to something more readily displayable
switch
(
major_istep
)
{
case
2
:
host_status_led_post_code
=
1
;
break
;
case
3
:
host_status_led_post_code
=
1
;
break
;
case
4
:
host_status_led_post_code
=
2
;
break
;
case
5
:
host_status_led_post_code
=
2
;
break
;
case
6
:
host_status_led_post_code
=
3
;
break
;
case
7
:
host_status_led_post_code
=
3
;
break
;
case
8
:
host_status_led_post_code
=
4
;
break
;
case
9
:
host_status_led_post_code
=
4
;
break
;
case
10
:
host_status_led_post_code
=
5
;
break
;
case
11
:
host_status_led_post_code
=
5
;
break
;
case
12
:
host_status_led_post_code
=
6
;
break
;
case
13
:
host_status_led_post_code
=
6
;
break
;
case
14
:
host_status_led_post_code
=
7
;
break
;
case
15
:
host_status_led_post_code
=
7
;
break
;
case
16
:
host_status_led_post_code
=
9
;
break
;
case
17
:
host_status_led_post_code
=
9
;
break
;
case
18
:
host_status_led_post_code
=
10
;
break
;
case
19
:
host_status_led_post_code
=
10
;
break
;
case
20
:
host_status_led_post_code
=
11
;
break
;
case
21
:
host_status_led_post_code
=
11
;
break
;
case
22
:
host_status_led_post_code
=
12
;
break
;
case
23
:
host_status_led_post_code
=
12
;
break
;
default:
host_status_led_post_code
=
0
;
}
set_led_bank_display
(
led_post_code
);
i2c_write_register_byte
((
uint8_t
*
)
I2CMASTER4_BASE
,
HOST_PLATFORM_FPGA_I2C_ADDRESS
,
HOST_PLATFORM_FPGA_I2C_REG_STA_LED
,
0x80
|
host_status_led_post_code
);
}
}
static
void
gpio_init
(
void
)
{
// Set up discrete LED bank
...
...
@@ -1748,13 +1803,11 @@ static int process_interrupts_stage2(void)
while
(
read_position
<
post_code_incoming_interrupt_transient_buffer_pos
)
{
uint16_t
post_code
=
post_code_incoming_interrupt_transient_buffer
[
read_position
];
uint8_t
led_post_code
=
(((
post_code
>>
8
)
&
0xf
)
<<
4
)
|
(
post_code
&
0xf
);
set_led_bank_display
(
led_post_code
);
display_post_code
(
post_code
);
if
(
post_code
==
0xfefe
)
{
host_power_status
=
HOST_POWER_STATUS_RUNNING
;
set_led_bank_display
(
0
);
display_character
(
'0'
+
2
+
host_power_status
,
0
);
// STATUS CODE
}
...
...
@@ -1874,7 +1927,7 @@ static void run_pre_ipl_bmc_peripheral_setup(void)
// Reset POST codes and display
post_code_high
=
0
;
post_code_low
=
0
;
set_led_bank_display
(
0x
00
);
display_post_code
(
0x00
00
);
// Deactivate interrupts on entering critical section
int
key
=
irq_lock
();
...
...
@@ -2058,7 +2111,7 @@ static void run_post_shutdown_bmc_peripheral_teardown(void)
// Reset POST codes and display
post_code_high
=
0
;
post_code_low
=
0
;
set_led_bank_display
(
0x
00
);
display_post_code
(
0x00
00
);
}
static
int
apply_avsbus_workarounds_cpu
(
const
cpu_info_t
*
cpu
)
...
...
@@ -2564,7 +2617,7 @@ static int host_background_service_task_event_loop(void)
else
if
(
address
==
0x82
)
{
post_code_low
=
post_code
;
set_led_bank_display
(((
post_code_high
&
0xf
)
<<
4
)
|
(
post_code_low
&
0x
f
));
display_post_code
(((
post_code_high
&
0xff
)
<<
8
)
|
(
post_code_low
&
0xf
f
));
if
(
enable_post_code_console_output
)
{
...
...
@@ -2709,7 +2762,7 @@ int host_console_event_loop(const struct shell *shell)
switch
(
escape_sequence_state
)
{
case
0
:
if
(
character
==
'\n'
)
if
(
(
character
==
'\n'
)
||
(
character
==
'\r'
)
)
{
escape_sequence_state
=
1
;
}
...
...
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