Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fby3.5: hd: Add ISR #488

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/service/ipmi/include/libipmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#define IPMI_OEM_SENSOR_TYPE_CPU_DIMM_HOT 0xC7
#define IPMI_OEM_SENSOR_TYPE_SYS_STA 0xC9
#define IPMI_OEM_SENSOR_TYPE_SYS_BOOT_STA 0xCA
#define IPMI_OEM_SENSOR_TYPE_VR 0xCB
#define IPMI_OEM_SENSOR_TYPE_HDT 0xCC

/* event/reading type, see IPMI spec 42.1, table 42-1 */
#define IPMI_EVENT_TYPE_THRESHOLD 0x01
Expand Down
1 change: 1 addition & 0 deletions common/shell/commands/sensor_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const char *const sensor_type_name[] = {
sensor_name_to_num(apml_mailbox)
sensor_name_to_num(xdpe19283b)
sensor_name_to_num(g788p81u)
sensor_name_to_num(mp2856gut)
};

const char *const sensor_status_name[] = {
Expand Down
79 changes: 0 additions & 79 deletions meta-facebook/yv35-hd/src/platform/plat_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#define I2C_DATA_SIZE 5
#define NUMBER_OF_ADC_CHANNEL 16
#define AST1030_ADC_BASE_ADDR 0x7e6e9000
#define ILIM_ADJUST_DEFAULT 0b001
#define ILIM_ADJUST_2OU_EXP 0b011

static uint8_t system_class = SYS_CLASS_1;
static uint8_t board_revision = 0x3F;
Expand Down Expand Up @@ -280,39 +278,6 @@ void init_platform_config()
if (cnt == ARRAY_SIZE(_1ou_card_mapping_table)) {
printf("Unknown the 1OU card type, the voltage of ADC channel-6 is %fV\n",
voltage);
} else if (_1ou_status.card_type == TYPE_1OU_RAINBOW_FALLS) {
if (hsc_module == HSC_MODULE_ADM1278) {
gpio_set(HSC_OCP_GPIO1_R, GPIO_HIGH);
} else if (hsc_module == HSC_MODULE_LTC4282) {
uint8_t ilim_adjust_data = 0;

tx_len = 1;
rx_len = 1;
memset(data, 0, I2C_DATA_SIZE);
data[0] = LTC4282_ILIM_ADJUST_OFFSET;
i2c_msg = construct_i2c_message(I2C_BUS5, LTC4282_ADDR,
tx_len, data, rx_len);
if (!i2c_master_read(&i2c_msg, retry)) {
ilim_adjust_data = i2c_msg.data[0];
} else {
printf("Failed to read ILIM_ADJUST from LTC4282\n");
}
/* Set ILIM to 15.625mV by writing 0b001 to bits[7:0] */
tx_len = 2;
rx_len = 0;
memset(data, 0, I2C_DATA_SIZE);
data[0] = LTC4282_ILIM_ADJUST_OFFSET;
data[1] = (ilim_adjust_data & 0x1f) | 0x20;
i2c_msg = construct_i2c_message(I2C_BUS5, LTC4282_ADDR,
tx_len, data, rx_len);
if (i2c_master_write(&i2c_msg, retry)) {
printf("Failed to set ILIM_ADJUST to LTC4282\n");
}
} else {
printf("Unsupported HSC module %d\n", hsc_module);
}
} else {
printf("Unsupported 1ou card type %d\n", _1ou_status.card_type);
}
}
}
Expand All @@ -339,49 +304,5 @@ void init_platform_config()
}
}

/* Set HSC OCP */
uint8_t ilim_adjust = ILIM_ADJUST_DEFAULT;
if (_2ou_status.present) {
if (hsc_module == HSC_MODULE_ADM1278) {
gpio_set(HSC_OCP_GPIO1_R, GPIO_LOW);
gpio_set(HSC_OCP_GPIO2_R, GPIO_LOW);
gpio_set(HSC_OCP_GPIO3_R, GPIO_HIGH);
} else if (hsc_module == HSC_MODULE_LTC4282) {
ilim_adjust = ILIM_ADJUST_2OU_EXP;
} else {
printf("Unsupported HSC module %d\n", hsc_module);
}
} else if ((!_1ou_status.present && !_2ou_status.present) ||
(_1ou_status.present && (_1ou_status.card_type == TYPE_1OU_RAINBOW_FALLS))) {
printf("Default HSC OCP setting\n");
} else {
printf("Unsupported configuration, 1ou card type %d\n", _1ou_status.card_type);
}

if (hsc_module == HSC_MODULE_LTC4282) {
uint8_t ilim_register_data = 0;

tx_len = 1;
rx_len = 1;
memset(data, 0, I2C_DATA_SIZE);
data[0] = LTC4282_ILIM_ADJUST_OFFSET;
i2c_msg = construct_i2c_message(I2C_BUS5, LTC4282_ADDR, tx_len, data, rx_len);
if (!i2c_master_read(&i2c_msg, retry)) {
ilim_register_data = i2c_msg.data[0];
} else {
printf("Failed to read ILIM_ADJUST from LTC4282\n");
}
/* Set OCP by writing ilim_adjust to bits[7:5] */
tx_len = 2;
rx_len = 0;
memset(data, 0, I2C_DATA_SIZE);
data[0] = LTC4282_ILIM_ADJUST_OFFSET;
data[1] = (ilim_register_data & 0x1f) | ((ilim_adjust << 5) & 0xe0);
i2c_msg = construct_i2c_message(I2C_BUS5, LTC4282_ADDR, tx_len, data, rx_len);
if (i2c_master_write(&i2c_msg, retry)) {
printf("Failed to set ILIM_ADJUST to LTC4282\n");
}
}

SAFE_FREE(data);
}
481 changes: 164 additions & 317 deletions meta-facebook/yv35-hd/src/platform/plat_gpio.c

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions meta-facebook/yv35-hd/src/platform/plat_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ void pal_set_sys_status()
{
set_DC_status(PWRGD_CPU_LVC3);
set_DC_on_delayed_status();
set_DC_off_delayed_status();
set_post_status(FM_BIOS_POST_CMPLT_BIC_N);
set_CPU_power_status(PWRGD_CPU_LVC3);
set_sys_ready_pin(BIC_READY);
Expand Down
Loading