mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-29 12:50:43 +00:00
(mds) Fix eeprom size reporting. 'sensors' previously assumed
4 banks per memory chip. Add banks entry to libsensors and
use # of banks in calculation.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@839 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
8233fa6c7b
commit
a708ca6bf5
4 files changed
+18
-7
No files matched your search
@@ -14,11 +14,13 @@ ask CVS about it:
|
||||
cvs diff -r V2-0-0 -r V2-0-1 -u
|
||||
|
||||
2.5.2 (200007??)
|
||||
Programs: understand /dev/i2c* files (instead of /dev/i2c-*) too.
|
||||
Program sensors-detect: more robustness in case of unknown i2c adapters
|
||||
File sensors.conf.eg: Fix lm80 in8 calculation
|
||||
Module w83781d: W83783S no longer crashes on unloading
|
||||
Program sensors-detect: more robustness in case of unknown i2c adapters
|
||||
Program sensors-detect, libsensors: fix eeprom size reporting
|
||||
Program sensord: more flexility, support for alarm scanning etc.
|
||||
Program sensors: support for ignore setting on sensor alarms.
|
||||
Programs: understand /dev/i2c* files (instead of /dev/i2c-*) too.
|
||||
|
||||
2.5.1 (20000618)
|
||||
Library: Add adm1025 support
|
||||
|
||||
@@ -1758,6 +1758,7 @@ static sensors_chip_feature eeprom_features[] =
|
||||
{ SENSORS_EEPROM_TYPE, "Memory type",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, EEPROM_SYSCTL1, VALUE(3), 0 },
|
||||
/* cheat and use the row-address-bits label for the total size in sensors */
|
||||
{ SENSORS_EEPROM_ROWADDR, "SDRAM Size (MB)",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, EEPROM_SYSCTL1, VALUE(4), 0 },
|
||||
@@ -1767,6 +1768,9 @@ static sensors_chip_feature eeprom_features[] =
|
||||
{ SENSORS_EEPROM_NUMROWS, "num rows",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, EEPROM_SYSCTL1, VALUE(6), 0 },
|
||||
{ SENSORS_EEPROM_BANKS, "banks",
|
||||
SENSORS_NO_MAPPING, SENSORS_NO_MAPPING,
|
||||
SENSORS_MODE_R, EEPROM_SYSCTL2, VALUE(2), 0 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -815,5 +815,6 @@
|
||||
#define SENSORS_EEPROM_ROWADDR 12
|
||||
#define SENSORS_EEPROM_COLADDR 13
|
||||
#define SENSORS_EEPROM_NUMROWS 14
|
||||
#define SENSORS_EEPROM_BANKS 15
|
||||
|
||||
#endif /* def LIB_SENSORS_CHIPS_H */
|
||||
@@ -1756,7 +1756,7 @@ void print_ddcmon(const sensors_chip_name *name)
|
||||
void print_eeprom(const sensors_chip_name *name)
|
||||
{
|
||||
char *label = NULL;
|
||||
double a, b, c;
|
||||
double a, b, c, d;
|
||||
int valid, i;
|
||||
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_EEPROM_TYPE, &label,&valid) &&
|
||||
@@ -1774,14 +1774,18 @@ void print_eeprom(const sensors_chip_name *name)
|
||||
if (!sensors_get_label_and_valid(*name, SENSORS_EEPROM_ROWADDR, &label,&valid) &&
|
||||
!sensors_get_feature(*name, SENSORS_EEPROM_ROWADDR, &a) &&
|
||||
!sensors_get_feature(*name, SENSORS_EEPROM_COLADDR, &b) &&
|
||||
!sensors_get_feature(*name, SENSORS_EEPROM_NUMROWS, &c)) {
|
||||
!sensors_get_feature(*name, SENSORS_EEPROM_NUMROWS, &c) &&
|
||||
!sensors_get_feature(*name, SENSORS_EEPROM_BANKS, &d)) {
|
||||
if (valid) {
|
||||
print_label(label, 24);
|
||||
i = (((int) a) & 0x0f) + (((int) b) & 0x0f) + ((int) c) - 16;
|
||||
if(i > 0 && i <= 10)
|
||||
printf("%d\n", 1 << i);
|
||||
i = (((int) a) & 0x0f) + (((int) b) & 0x0f) - 17;
|
||||
if(i > 0 && i <= 12 && c <= 8 && d <= 8)
|
||||
printf("%d\n", (1 << i) * ((int) c) * ((int) d));
|
||||
else
|
||||
{
|
||||
printf("invalid\n");
|
||||
printf("%d %d %d %d\n", (int) a, (int) b, (int) c, (int) d);
|
||||
}
|
||||
}
|
||||
} else
|
||||
printf("ERROR: data 2\n");
|
||||
|
||||
Reference in new issue
Block a user