Skip to contentSkip to conversation

I2c Detect Function for Teutates HWMon

DISCUSSION [email protected] 2 participants 3 messages Aug 10, 2016 – Aug 16, 2016 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

Hey!

The Firmware developer of the Teutates Chip will implement more "detect"-register so the ftsteutates module can add a i2c detect function.

Would it be sufficient to have 3 register with specific content (0x54,0x54,0x54) plus the Device ID Reg shown below to identify the chip? Or do you advise another mechanism to identify it?

Quoted 13 lines
Quoted 13 lines
(quoted diff) +13 -0
+static int ftsteutates_detect(struct i2c_client *client,
+             struct i2c_board_info *info)
+{
+     int val = ftsteutates_read_byte(client, FTSTEUTATES_DEVICE_ID_REG);
+
+     /* Baseboard Management Controller */
+     if ((val & 0xF0) == 0x10) {
+             switch (val & 0x0F) {
+             case 0x01:
+                     strlcpy(info->type, ftsteutates_id[teutates].name,
+                     I2C_NAME_SIZE);
+                     info->flags = 0;
+                     return 0;
Quoted 9 lines
Quoted 4 lines

+             }
+     }
+     return -ENODEV;
+}

This is not sufficient for a detect function; it would result in many false positives. Please drop it unless a much better means to detect the chip is available.

Cheers,
Thilo

maintainer
#1 lore raw
Quoted 7 lines · On 08/10/2016 12:08 AM, [email protected] wrote:

Hey!

The Firmware developer of the Teutates Chip will implement more "detect"-register so the ftsteutates module can add a i2c detect function.

Would it be sufficient to have 3 register with specific content (0x54,0x54,0x54) plus the Device ID Reg shown below to identify the chip? Or do you advise another mechanism to identify it?

Registers should have different values. One or two should reflect a Fujitsu manufacturer Id, one should reflect the device Id. 4 bit for the device is a bit limited; I would prefer device and version in separate registers. It would also be great if you could use common manufacturer/device ID registers (such as 0xfd for the device ID and 0xfe/0xff for the manufacturer ID).

I see that 0x10CF is used as Fujitsu PCI Id. Unless Fujitsu has a well defined I2C Manufacturer Id, maybe you could use that in two registers (0xfe/0xff).

Thanks,
Guenter

Quoted 27 lines
Quoted 13 lines
Quoted 13 lines
(quoted diff) +13 -0
+static int ftsteutates_detect(struct i2c_client *client,
+             struct i2c_board_info *info)
+{
+     int val = ftsteutates_read_byte(client, FTSTEUTATES_DEVICE_ID_REG);
+
+     /* Baseboard Management Controller */
+     if ((val & 0xF0) == 0x10) {
+             switch (val & 0x0F) {
+             case 0x01:
+                     strlcpy(info->type, ftsteutates_id[teutates].name,
+                     I2C_NAME_SIZE);
+                     info->flags = 0;
+                     return 0;
Quoted 9 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+             }
+     }
+     return -ENODEV;
+}

This is not sufficient for a detect function; it would result in many false positives. Please drop it unless a much better means to detect the chip is available.

Cheers,
Thilo

#2 lore raw

Hey Guenter!

Thanks for your hints!

So the registers now have the content 0x17,0x34,0x54 as 0x1734 is Fujitsu Technology Solutions's PCI Id and the 0x54 is for Teutates. Sadly we couldn't take registers above 0x80 as they are potentially paged and that would need a i2c-write. So they are 0x0c-0x0e now. The version is already there. It's called revision and used in the detect function.

Hope thats sufficient!

Cheers,
Thilo

Quoted 53 lines · Guenter Roeck
Quoted 8 lines · On 08/10/2016 12:08 AM, [email protected] wrote:

Hey!

The Firmware developer of the Teutates Chip will implement more "detect"-register so the ftsteutates module can add a i2c detect function.

Would it be sufficient to have 3 register with specific content (0x54,0x54,0x54) plus the Device ID Reg shown below to identify the chip? Or do you advise another mechanism to identify it?

Registers should have different values. One or two should reflect a Fujitsu manufacturer Id, one should reflect the device Id. 4 bit for the device is a bit limited; I would prefer device and version in separate registers. It would also be great if you could use common manufacturer/device ID registers (such as 0xfd for the device ID and 0xfe/0xff for the manufacturer ID).

I see that 0x10CF is used as Fujitsu PCI Id. Unless Fujitsu has a well defined I2C Manufacturer Id, maybe you could use that in two registers (0xfe/0xff).

Thanks,
Guenter

Quoted 30 lines
Quoted 16 lines
Quoted 16 lines
(quoted diff) +13 -0
+static int ftsteutates_detect(struct i2c_client *client,
+             struct i2c_board_info *info)
+{
+     int val = ftsteutates_read_byte(client, FTSTEUTATES_DEVICE_ID_REG);
+
+     /* Baseboard Management Controller */
+     if ((val & 0xF0) == 0x10) {
+             switch (val & 0x0F) {
+             case 0x01:
+                     strlcpy(info->type, ftsteutates_id[teutates].name,
+                     I2C_NAME_SIZE);
+                     info->flags = 0;
+                     return 0;
Quoted 9 lines
Quoted 4 lines

+             }
+     }
+     return -ENODEV;
+}

This is not sufficient for a detect function; it would result in many false positives. Please drop it unless a much better means to detect the chip is available.

Cheers,
Thilo