Skip to content

Commit

Permalink
fby4: wf: Adjust the E1S-related GPIO settings and sensors access time
Browse files Browse the repository at this point in the history
Summary:
\#Description
- Some of the E1S-related board GPIO settings are not compatible with the corresponding GPIO table.
- Adjust the access time of E1S-related sensors after the E1S power is good.

\#Motivation
- The conflict between the board GPIO settings and the GPIO table will cause the GPIO pin to be set to LOW after the WF BIC update.
- E1S-related sensors should only be read after the E1S is power good.

Test Plan:
Build Code - PASS
Sensor Access - PASS
  • Loading branch information
SeanHe-wiwynn committed Oct 29, 2024
1 parent d0ae72b commit 5c5887f
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 124 deletions.
24 changes: 24 additions & 0 deletions common/lib/power_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ static bool is_DC_off_delayed = false;
static bool is_CPU_power_good = false;
static bool is_post_complete = false;
static bool vr_monitor_status = true;
static bool is_P3V3_E1S_power_good = false;
static bool is_P12V_E1S_power_good = false;

void set_DC_status(uint8_t gpio_num)
{
Expand Down Expand Up @@ -114,3 +116,25 @@ bool get_vr_monitor_status()
{
return vr_monitor_status;
}

void set_P3V3_E1S_power_status(uint8_t gpio_num)
{
is_P3V3_E1S_power_good = gpio_get(gpio_num);
LOG_WRN("P3V3_E1S_PWR_GOOD: %s", (is_P3V3_E1S_power_good) ? "yes" : "no");
}

bool P3V3_E1S_power_good()
{
return is_P3V3_E1S_power_good;
}

void set_P12V_E1S_power_status(uint8_t gpio_num)
{
is_P12V_E1S_power_good = gpio_get(gpio_num);
LOG_WRN("P12V_E1S_PWR_GOOD: %s", (is_P12V_E1S_power_good) ? "yes" : "no");
}

bool P12V_E1S_power_good()
{
return is_P12V_E1S_power_good;
}
4 changes: 4 additions & 0 deletions common/lib/power_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ bool CPU_power_good();
void set_post_thread();
void set_vr_monitor_status(bool value);
bool get_vr_monitor_status();
void set_P3V3_E1S_power_status(uint8_t gpio_num);
bool P3V3_E1S_power_good();
void set_P12V_E1S_power_status(uint8_t gpio_num);
bool P12V_E1S_power_good();

#endif
5 changes: 5 additions & 0 deletions common/service/sensor/sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,11 @@ bool dc_access(uint8_t sensor_num)
return get_DC_on_delayed_status();
}

bool e1s_pwrgd_access(uint8_t sensor_num)
{
return P3V3_E1S_power_good() && P12V_E1S_power_good();
}

bool post_access(uint8_t sensor_num)
{
return get_post_status();
Expand Down
1 change: 1 addition & 0 deletions common/service/sensor/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ uint8_t get_sensor_reading(sensor_cfg *cfg_table, uint8_t cfg_count, uint8_t sen
void pal_set_sensor_poll_interval(int *interval_ms);
bool stby_access(uint8_t sensor_num);
bool dc_access(uint8_t sensor_num);
bool e1s_pwrgd_access(uint8_t sensor_num);
bool post_access(uint8_t sensor_num);
bool me_access(uint8_t sensor_num);
bool vr_access(uint8_t sensor_num);
Expand Down
Loading

0 comments on commit 5c5887f

Please sign in to comment.