thunderbolt: Extend NVM version fields to 32-bits
authorSzuying Chen <Chloe_Chen@asmedia.com.tw>
Fri, 2 Sep 2022 09:40:09 +0000 (17:40 +0800)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 7 Sep 2022 06:06:50 +0000 (09:06 +0300)
In order to support non-Intel NVM image formats extend the NVM major and
minor version to 32-bits to better accommondate different versioning
schemes.

No functional impact.

Signed-off-by: Szuying Chen <Chloe_Chen@asmedia.com.tw>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/retimer.c
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.h

index 8c29bd5..dc0fc90 100644 (file)
@@ -71,8 +71,8 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)
        if (ret)
                goto err_nvm;
 
-       nvm->major = val >> 16;
-       nvm->minor = val >> 8;
+       nvm->major = (val >> 16) & 0xff;
+       nvm->minor = (val >> 8) & 0xff;
 
        ret = usb4_port_retimer_nvm_read(rt->port, rt->index, NVM_FLASH_SIZE,
                                         &val, sizeof(val));
index bd815e2..ac8d714 100644 (file)
@@ -427,8 +427,8 @@ static int tb_switch_nvm_add(struct tb_switch *sw)
                if (ret)
                        goto err_nvm;
 
-               nvm->major = val >> 16;
-               nvm->minor = val >> 8;
+               nvm->major = (val >> 16) & 0xff;
+               nvm->minor = (val >> 8) & 0xff;
 
                ret = tb_nvm_add_active(nvm, nvm_size, tb_switch_nvm_read);
                if (ret)
index 87aefac..f8fbab1 100644 (file)
@@ -48,8 +48,8 @@
  */
 struct tb_nvm {
        struct device *dev;
-       u8 major;
-       u8 minor;
+       u32 major;
+       u32 minor;
        int id;
        struct nvmem_device *active;
        struct nvmem_device *non_active;