Skip to content

Commit

Permalink
Merge pull request #74 from SW-CSA/cel_develop
Browse files Browse the repository at this point in the history
Cel develop
  • Loading branch information
MickeyZhan authored May 5, 2019
2 parents 8643166 + 764b8bc commit 5823b6a
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 48 deletions.
2 changes: 1 addition & 1 deletion classes/openbmc_version.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_openbmc_version(d):
gitdir = os.path.join(cur, '.git')
if cur and is_openbmc_root:
cmd = ['git', '--git-dir=%s' % gitdir , '--work-tree=%s' % cur,
'describe', '--tags', '--dirty', '--always']
'describe', '--tags', '--always']
exitstatus, output = oe.utils.getstatusoutput(' '.join(cmd))
if exitstatus != 0:
output = ''
Expand Down
2 changes: 1 addition & 1 deletion meta-aspeed/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DEPENDS = "mtd-utils"
SRCBRANCH = "openbmc/helium/v2016.07"
SRCREV = "AUTOINC"

SRC_URI = "git://github.com/theopolis/u-boot.git;branch=${SRCBRANCH};protocol=https \
SRC_URI = "git://github.com/SW-CSA/u-boot.git;branch=${SRCBRANCH};protocol=https \
file://fw_env.config \
file://0001-Support-Celestica-Questone2-and-AS58XX-CL-projects.patch \
"
Expand Down
2 changes: 1 addition & 1 deletion meta-aspeed/recipes-bsp/u-boot/u-boot-mkimage_2016.07.bb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DEPENDS = "openssl"
SRCBRANCH = "openbmc/helium/v2016.07"
SRCREV = "AUTOINC"

SRC_URI = "git://github.com/theopolis/u-boot.git;branch=${SRCBRANCH};protocol=https \
SRC_URI = "git://github.com/SW-CSA/u-boot.git;branch=${SRCBRANCH};protocol=https \
file://fw_env.config \
"

Expand Down
2 changes: 1 addition & 1 deletion meta-aspeed/recipes-bsp/u-boot/u-boot_2016.07.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DEPENDS += "dtc-native bc-native"
SRCBRANCH = "openbmc/helium/v2016.07"
SRCREV = "AUTOINC"

SRC_URI = "git://github.com/theopolis/u-boot.git;branch=${SRCBRANCH};protocol=https \
SRC_URI = "git://github.com/SW-CSA/u-boot.git;branch=${SRCBRANCH};protocol=https \
file://fw_env.config \
file://fw_env.config.full \
file://0001-Support-Celestica-Questone2-and-AS58XX-CL-projects.patch \
Expand Down
2 changes: 1 addition & 1 deletion meta-aspeed/recipes-kernel/linux/linux-aspeed_4.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SRCBRANCH = "openbmc/helium/4.1"
SRCREV = "AUTOINC"

SRC_URI = "git://github.com/theopolis/linux.git;branch=${SRCBRANCH};protocol=https \
SRC_URI = "git://github.com/SW-CSA/linux.git;branch=${SRCBRANCH};protocol=https \
"

LINUX_VERSION ?= "4.1.51"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,10 @@ static int get_fan_direction(void)
syslog(LOG_INFO, "%s direction changed to [Rear to front]", fantray->name);
} else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
} else {
if(find_sub_string(buffer, DELTA_PSU_DIR_F2B_STR, sizeof(buffer))) {
Expand All @@ -2142,7 +2145,10 @@ static int get_fan_direction(void)
syslog(LOG_INFO, "%s direction changed to [Rear to front]", fantray->name);
} else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
}
fantray->read_eeprom = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,10 @@ static int get_fan_direction(void)
}
} */else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
} else {
if(find_sub_string(buffer, DELTA_PSU_DIR_F2B_STR, sizeof(buffer))) {
Expand All @@ -2327,7 +2330,10 @@ static int get_fan_direction(void)
syslog(LOG_INFO, "%s direction changed to [Rear to front]", fantray->name);
} else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
}
fantray->read_eeprom = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,10 @@ static int get_fan_direction(void)
syslog(LOG_INFO, "%s direction changed to [Rear to front]", fantray->name);
} else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
} else {
if(find_sub_string(buffer, DELTA_PSU_DIR_F2B_STR, sizeof(buffer))) {
Expand All @@ -2138,7 +2141,10 @@ static int get_fan_direction(void)
syslog(LOG_INFO, "%s direction changed to [Rear to front]", fantray->name);
} else {
fantray->direction = FAN_DIR_FAULT;
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
if(strlen(buffer) > 0)
syslog(LOG_WARNING, "%s wrong module inserted!", fantray->name);
else
syslog(LOG_WARNING, "%s module unrecognized, set to [Fault]", fantray->name);
}
}
fantray->read_eeprom = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,11 @@ static const i2c_dev_attr_st syscpld_attr_table_fishbone[] = {
"0x1: SUS_S3_N\n"
"0x2: SUS_S4_N\n"
"0x4: SUS_S5_N\n"
"0x8: SUS_STAT_N",
"0x8: SUS_STAT_N\n"
"0x10: SUS_S0_N",
I2C_DEV_ATTR_SHOW_DEFAULT,
NULL,
0x22, 0, 4,
0x22, 0, 5,
},
{
"bios_cs",
Expand Down Expand Up @@ -1384,7 +1385,7 @@ int reset_i2c_mux(int bus)
if(syscpld_client == NULL)
return -ENODEV;

printk(KERN_WARNING "bus %d is huang, try to reset the PCA9548\n", bus);
printk(KERN_WARNING "bus %d is hanged, try to reset the PCA9548\n", bus);
data = i2c_get_clientdata(syscpld_client);
mutex_lock(&data->idd_lock);
/* get reset reigster status */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ static int mca_high = 0;
static struct workqueue_struct *mca_wq = NULL;
static struct delayed_work mca_dwq;

static int aer_0_assert = 0;
static int aer_1_assert = 0;
static int aer_2_assert = 0;
static int mca_assert = 0;

static irqreturn_t cpu_error_handler(int irq, void *dev_id)
{
int gpio;
Expand All @@ -73,22 +78,34 @@ static irqreturn_t cpu_error_handler(int irq, void *dev_id)
CPU_ERROR_DEBUG("irq=%d, gpio=%d, value=%d\n", irq, gpio, value);
switch(gpio) {
case CPU_AER_0_GPIO:
if(value)
printk(KERN_ALERT "AER ERR[0] is recovered\n");
else
if(value) {
if(aer_0_assert == 1)
printk(KERN_ALERT "AER ERR[0] is recovered\n");
aer_0_assert = 0;
} else {
printk(KERN_ALERT "AER ERR[0] is asserted\n");
aer_0_assert = 1;
}
break;
case CPU_AER_1_GPIO:
if(value)
printk(KERN_ALERT "AER ERR[1] is recovered\n");
else
if(value) {
if(aer_1_assert == 1)
printk(KERN_ALERT "AER ERR[1] is recovered\n");
aer_1_assert = 0;
} else {
printk(KERN_ALERT "AER ERR[1] is asserted\n");
aer_1_assert = 1;
}
break;
case CPU_AER_2_GPIO:
if(value)
printk(KERN_ALERT "AER ERR[2] is recovered\n");
else
if(value) {
if(aer_2_assert == 1)
printk(KERN_ALERT "AER ERR[2] is recovered\n");
aer_2_assert = 0;
} else {
printk(KERN_ALERT "AER ERR[2] is asserted\n");
aer_2_assert = 1;
}
break;
case CPU_MCA_GPIO:
if(value) {
Expand All @@ -108,12 +125,16 @@ static void mca_error_delay_worker(struct work_struct *work)

if(mca_low == 1) {
printk(KERN_ALERT "CATERR# remains asserted\n");
mca_assert = 1;
} else if(mca_low >= 8) {
printk(KERN_ALERT "CATERR# is asserted for 16 BCLKs\n");
mca_assert = 1;
}

if(mca_high == 1) {
printk(KERN_ALERT "CATERR# is recovered\n");
if(mca_assert == 1)
printk(KERN_ALERT "CATERR# is recovered\n");
mca_assert = 0;
}
mca_low = 0;
mca_high = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ wedge_is_us_on() {
((val=$(cat $USRV_STATUS_SYSFS 2> /dev/null | head -n 1)))
if [ -z "$val" ]; then
return $default
elif [ $val -eq 15 ]; then
elif [ $val -eq 31 ]; then
return 0 # powered on
elif [ $val -eq 8 ]; then
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ def get_psu_power_type(self, num):
sys.stdout.flush()
recv = os.popen(cmd).read()
if self.name == 'dps1100-i2c-24-58':
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 260000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 264000'
else:
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 260000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 264000'
sys.stdout.flush()
recv = os.popen(cmd).read()
update_psu_threshold(num)
Expand All @@ -265,15 +265,15 @@ def get_psu_power_type(self, num):
syslog.syslog(syslog.LOG_INFO, 'PSU' + str(num + 1) + ' power type: DC')
self.power_type = 2
if self.name == 'dps1100-i2c-24-58':
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_min 90000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_min 200000'
else:
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_min 90000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_min 200000'
sys.stdout.flush()
recv = os.popen(cmd).read()
if self.name == 'dps1100-i2c-24-58':
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 310000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 280000'
else:
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 310000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 280000'
sys.stdout.flush()
recv = os.popen(cmd).read()
update_psu_threshold(num)
Expand All @@ -288,9 +288,9 @@ def get_psu_power_type(self, num):
sys.stdout.flush()
recv = os.popen(cmd).read()
if self.name == 'dps1100-i2c-24-58':
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 260000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 264000'
else:
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 260000'
cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 59 in1_max 264000'
sys.stdout.flush()
recv = os.popen(cmd).read()
update_psu_threshold(num)
Expand Down Expand Up @@ -319,6 +319,8 @@ def psu_init(item):
if psu_obj[i].power_on == 0:
continue

psu_obj[i].get_psu_power_type(i)

cmd = '/usr/bin/sensors ' + item[i + 1]
sys.stdout.flush()
recv = os.popen(cmd).read()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,26 +242,28 @@ def get_psu_power_type(self, num):
max_threshold_cmd = ''
if num == 0:
cmd = 'i2cget -f -y 27 0x58 0xd8'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 27 58 in1_min 90000'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 27 58 in1_max 260000'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 27 58 in1_min'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 27 58 in1_max'
elif num == 1:
cmd = 'i2cget -f -y 26 0x58 0xd8'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 26 58 in1_min 90000'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 26 58 in1_max 260000'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 26 58 in1_min'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 26 58 in1_max'
elif num == 2:
cmd = 'i2cget -f -y 25 0x58 0xd8'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 58 in1_min 90000'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 58 in1_max 260000'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 58 in1_min'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 25 58 in1_max'
elif num == 3:
cmd = 'i2cget -f -y 24 0x58 0xd8'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_min 90000'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max 260000'
min_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_min'
max_threshold_cmd = 'source /usr/local/bin/openbmc-utils.sh;set_hwmon_threshold 24 58 in1_max'
sys.stdout.flush()
recv = os.popen(cmd).read()
if recv.strip() == '0x00':
if self.power_type != 1:
syslog.syslog(syslog.LOG_INFO, 'PSU' + psu_rename(num + 1) + ' power type: AC')
self.power_type = 1
min_threshold_cmd += ' 90000'
max_threshold_cmd += ' 264000'
sys.stdout.flush()
recv = os.popen(min_threshold_cmd).read()
sys.stdout.flush()
Expand All @@ -271,6 +273,8 @@ def get_psu_power_type(self, num):
if self.power_type != 2:
syslog.syslog(syslog.LOG_INFO, 'PSU' + psu_rename(num + 1) + ' power type: DC')
self.power_type = 2
min_threshold_cmd += ' 200000'
max_threshold_cmd += ' 280000'
sys.stdout.flush()
recv = os.popen(min_threshold_cmd).read()
sys.stdout.flush()
Expand All @@ -280,6 +284,8 @@ def get_psu_power_type(self, num):
if self.power_type != 0:
syslog.syslog(syslog.LOG_WARNING, 'PSU' + psu_rename(num + 1) + ' power type: Unknown')
self.power_type = 0
min_threshold_cmd += ' 90000'
max_threshold_cmd += ' 264000'
sys.stdout.flush()
recv = os.popen(min_threshold_cmd).read()
sys.stdout.flush()
Expand Down Expand Up @@ -310,6 +316,8 @@ def psu_init(item):
if psu_obj[i].power_on == 0:
continue

psu_obj[i].get_psu_power_type(i)

cmd = '/usr/bin/sensors ' + item[i + 1]
sys.stdout.flush()
recv = os.popen(cmd).read()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ set_value 8 0d fan8_max 30000
val=$(get_hwmon_id 24 58 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 24 58 $val in1_min 90000
set_hwmon_value 24 58 $val in1_max 310000
set_hwmon_value 24 58 $val in1_max 264000
set_hwmon_value 24 58 $val in2_min 11640
set_hwmon_value 24 58 $val in2_max 12360
set_hwmon_value 24 58 $val fan1_min 1000
Expand All @@ -134,7 +134,7 @@ fi
val=$(get_hwmon_id 25 59 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 25 59 $val in1_min 90000
set_hwmon_value 25 59 $val in1_max 310000
set_hwmon_value 25 59 $val in1_max 264000
set_hwmon_value 25 59 $val in2_min 11640
set_hwmon_value 25 59 $val in2_max 12360
set_hwmon_value 25 59 $val fan1_min 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fi
val=$(get_hwmon_id 24 58 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 24 58 $val in1_min 90000
set_hwmon_value 24 58 $val in1_max 310000
set_hwmon_value 24 58 $val in1_max 264000
set_hwmon_value 24 58 $val in2_min 11640
set_hwmon_value 24 58 $val in2_max 12360
set_hwmon_value 24 58 $val fan1_min 1000
Expand All @@ -223,7 +223,7 @@ fi
val=$(get_hwmon_id 25 58 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 25 58 $val in1_min 90000
set_hwmon_value 25 58 $val in1_max 310000
set_hwmon_value 25 58 $val in1_max 264000
set_hwmon_value 25 58 $val in2_min 11640
set_hwmon_value 25 58 $val in2_max 12360
set_hwmon_value 25 58 $val fan1_min 1000
Expand All @@ -244,7 +244,7 @@ fi
val=$(get_hwmon_id 26 58 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 26 58 $val in1_min 90000
set_hwmon_value 26 58 $val in1_max 310000
set_hwmon_value 26 58 $val in1_max 264000
set_hwmon_value 26 58 $val in2_min 11640
set_hwmon_value 26 58 $val in2_max 12360
set_hwmon_value 26 58 $val fan1_min 1000
Expand All @@ -265,7 +265,7 @@ fi
val=$(get_hwmon_id 27 58 in1_min)
if [ "$val" -gt "0" ] ; then
set_hwmon_value 27 58 $val in1_min 90000
set_hwmon_value 27 58 $val in1_max 310000
set_hwmon_value 27 58 $val in1_max 264000
set_hwmon_value 27 58 $val in2_min 11640
set_hwmon_value 27 58 $val in2_max 12360
set_hwmon_value 27 58 $val fan1_min 1000
Expand Down
Loading

0 comments on commit 5823b6a

Please sign in to comment.