drivers: tpm2: update reset gpio semantics
PATCH 1/1 drivers: tpm2: update reset gpio semantics
Use the more generic reset-gpios propery name.
--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1 -1
@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:
drivers/tpm/tpm2_tis_spi.c +1 -1
@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",
Signature · 1 line
2.31.1
Quoted 27 lines · Jorge Ramirez-Ortiz
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1
-1@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:drivers/tpm/tpm2_tis_spi.c +0
-0
drivers/tpm/tpm2_tis_spi.c static int tpm_tis_spi_probe(struct udevice *dev) · line 595
Quoted 8 lines
drivers/tpm/tpm2_tis_spi.c +1
-1@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",
I think you should deprecate gpio-reset but keep supporting that option with any warning and add code for reset-gpios.
Also would be good to add it as optional property to Linux kernel to keep it in sync.
Thanks,
Michal
Den tor. 27. maj 2021 kl. 09.15 skrev Michal Simek <[email protected]>:
Quoted 43 lines · Jorge Ramirez-Ortiz
Quoted 27 lines
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1
-1@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:drivers/tpm/tpm2_tis_spi.c +0
-0drivers/tpm/tpm2_tis_spi.c static int tpm_tis_spi_probe(struct udevice *dev) · line 595
Quoted 8 lines
drivers/tpm/tpm2_tis_spi.c +1
-1@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",I think you should deprecate gpio-reset but keep supporting that option with any warning and add code for reset-gpios.
Quoted 2 lines
Also would be good to add it as optional property to Linux kernel to keep it in sync.
Hi
The reason the Linux kernel does not have a TPM reset signal, is that being able to reset the chip from software is a vulnerability. There was a discussion on it over on the Barebox mailing list a while ago.
TLDR: TPM reset needs to follow SOC reset.
/Bruno
Quoted 47 lines · Bruno Thomsen
Den tor. 27. maj 2021 kl. 09.15 skrev Michal Simek <[email protected]>:
Quoted 43 lines · Jorge Ramirez-Ortiz
Quoted 27 lines
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1
-1@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:drivers/tpm/tpm2_tis_spi.c +0
-0drivers/tpm/tpm2_tis_spi.c static int tpm_tis_spi_probe(struct udevice *dev) · line 595
Quoted 8 lines
drivers/tpm/tpm2_tis_spi.c +1
-1@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",I think you should deprecate gpio-reset but keep supporting that option with any warning and add code for reset-gpios.
Quoted 2 lines
Also would be good to add it as optional property to Linux kernel to keep it in sync.
Quoted 8 lines
Hi
The reason the Linux kernel does not have a TPM reset signal, is that being able to reset the chip from software is a vulnerability. There was a discussion on it over on the Barebox mailing list a while ago.
TLDR: TPM reset needs to follow SOC reset.
I expect chip has the reset in both cases and it is just about who should be calling it. But we should be using the same DT for u-boot and Linux. It means it should be handled properly but described properly.
Thanks,
Michal
Quoted 57 lines · Michal Simek
Quoted 54 lines · Bruno Thomsen
Den tor. 27. maj 2021 kl. 09.15 skrev Michal Simek <[email protected]>:
Quoted 43 lines · Jorge Ramirez-Ortiz
Quoted 27 lines
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1
-1@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:drivers/tpm/tpm2_tis_spi.c +0
-0drivers/tpm/tpm2_tis_spi.c static int tpm_tis_spi_probe(struct udevice *dev) · line 595
Quoted 8 lines
drivers/tpm/tpm2_tis_spi.c +1
-1@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",I think you should deprecate gpio-reset but keep supporting that option with any warning and add code for reset-gpios.
Quoted 2 lines
Also would be good to add it as optional property to Linux kernel to keep it in sync.
Hi
The reason the Linux kernel does not have a TPM reset signal, is that being able to reset the chip from software is a vulnerability. There was a discussion on it over on the Barebox mailing list a while ago.
Quoted 5 lines
Quoted 1 line
TLDR: TPM reset needs to follow SOC reset.
I expect chip has the reset in both cases and it is just about who should be calling it. But we should be using the same DT for u-boot and Linux. It means it should be handled properly but described properly.
right, I agree that it should be described properly (that was the patch intent).
but do we need to keep the legacy property?
Quoted 5 lines
Thanks,
Michal
Quoted 60 lines · Foundries
Quoted 59 lines · Michal Simek
Quoted 55 lines · Bruno Thomsen
Den tor. 27. maj 2021 kl. 09.15 skrev Michal Simek <[email protected]>:
Quoted 43 lines · Jorge Ramirez-Ortiz
Quoted 27 lines
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +1
-1@@ -6,7 +6,7 @@ Required properties: - reg : SPI Chip select Optional properties: -- gpio-reset : Reset GPIO (if not connected to the SoC reset line) +- reset-gpios : Reset GPIO (if not connected to the SoC reset line) - spi-max-frequency : See spi-bus.txt Example:drivers/tpm/tpm2_tis_spi.c +0
-0drivers/tpm/tpm2_tis_spi.c static int tpm_tis_spi_probe(struct udevice *dev) · line 595
Quoted 8 lines
drivers/tpm/tpm2_tis_spi.c +1
-1@@ -589,7 +589,7 @@ static int tpm_tis_spi_probe(struct udevice *dev)if (CONFIG_IS_ENABLED (DM_GPIO )) {struct gpio_desc reset_gpio; - ret =gpio_request_by_name (dev,"gpio-reset" ,0 , + ret =gpio_request_by_name (dev,"reset-gpios" ,0 , &reset_gpio,GPIOD_IS_OUT );if (ret) { log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",I think you should deprecate gpio-reset but keep supporting that option with any warning and add code for reset-gpios.
Quoted 2 lines
Also would be good to add it as optional property to Linux kernel to keep it in sync.
Hi
The reason the Linux kernel does not have a TPM reset signal, is that being able to reset the chip from software is a vulnerability. There was a discussion on it over on the Barebox mailing list a while ago.
TLDR: TPM reset needs to follow SOC reset.
Quoted 8 lines
Quoted 3 lines
I expect chip has the reset in both cases and it is just about who should be calling it. But we should be using the same DT for u-boot and Linux. It means it should be handled properly but described properly.
right, I agree that it should be described properly (that was the patch intent).
but do we need to keep the legacy property?
I prefer all the time to have some time for transition. It means add support for new property. Keep there old one with message that this will be removed in near future. Not aware if there is any time defined. We normally keep it there for a year.
Thanks,
Michal
Quoted 8 lines · Jorge Ramirez-Ortiz
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 11 lines · Simon Glass
Quoted 8 lines · Jorge Ramirez-Ortiz
Use the more generic reset-gpios propery name.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>--- doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Reviewed-by Simon Glass <[email protected]>
thanks.
should I add your reviewed-by by and resubmit the patch or do I also need to include the change proposed by Michal Simek (keeping the legacy property)?
TIA