mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for safeboot pin to UBlox GNSS driver
@ 2025-05-14 13:54 Alejandro Enrique via B4 Relay
  2025-05-14 13:54 ` [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding Alejandro Enrique via B4 Relay
  2025-05-14 13:54 ` [PATCH 2/2] gnss: ubx: add support for the safeboot gpio Alejandro Enrique via B4 Relay
  0 siblings, 2 replies; 6+ messages in thread
From: Alejandro Enrique via B4 Relay @ 2025-05-14 13:54 UTC (permalink / raw)
  To: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-kernel, Alejandro Enrique

U-Blox M9 and M8 chips have a pin to start it in safeboot mode, to be
used to recover from situations where the flash content has become
corrupted and needs to be restored. If this pin is asserted at power
up or reset, the receiver starts in safeboot mode and GNSS operation
is disabled.

If this pin is wired to a GPIO in the host it should be deasserted
before powering up or resetting the GNSS.

This series adds support for handling the safeboot pin when probing
the driver.

Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
---
Alejandro Enrique (2):
      dt-bindings: gnss: u-blox: add "safeboot-gpios" binding
      gnss: ubx: add support for the safeboot gpio

 Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 4 ++++
 drivers/gnss/ubx.c                                        | 8 ++++++++
 2 files changed, 12 insertions(+)
---
base-commit: 9c32cda43eb78f78c73aee4aa344b777714e259b
change-id: 20250514-ubx-safeboot-3758f22225ec

Best regards,
-- 
Alejandro Enrique <alejandroe1@geotab.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding
  2025-05-14 13:54 [PATCH 0/2] Add support for safeboot pin to UBlox GNSS driver Alejandro Enrique via B4 Relay
@ 2025-05-14 13:54 ` Alejandro Enrique via B4 Relay
  2025-05-21  9:27   ` Krzysztof Kozlowski
  2025-05-14 13:54 ` [PATCH 2/2] gnss: ubx: add support for the safeboot gpio Alejandro Enrique via B4 Relay
  1 sibling, 1 reply; 6+ messages in thread
From: Alejandro Enrique via B4 Relay @ 2025-05-14 13:54 UTC (permalink / raw)
  To: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-kernel, Alejandro Enrique

From: Alejandro Enrique <alejandroe1@geotab.com>

U-Blox M8/M9 chip have a pin to start it in safeboot mode, to be used
to recover from situations where the flash content has become
corrupted and needs to be restored. Introduce a binding to support
this safeboot pin.

Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
---
 Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
index 7d4b6d49e5eea2201ac05ba6d54b1c1721172f26..16d922279def99257c194520a7ac820f2a26e9c7 100644
--- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
+++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
@@ -32,6 +32,9 @@ properties:
   reset-gpios:
     maxItems: 1
 
+  safeboot-gpios:
+    maxItems: 1
+
   vcc-supply:
     description: >
       Main voltage regulator
@@ -61,5 +64,6 @@ examples:
             v-bckp-supply = <&gnss_v_bckp_reg>;
             vcc-supply = <&gnss_vcc_reg>;
             reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+            safeboot-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
         };
     };

-- 
2.34.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] gnss: ubx: add support for the safeboot gpio
  2025-05-14 13:54 [PATCH 0/2] Add support for safeboot pin to UBlox GNSS driver Alejandro Enrique via B4 Relay
  2025-05-14 13:54 ` [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding Alejandro Enrique via B4 Relay
@ 2025-05-14 13:54 ` Alejandro Enrique via B4 Relay
  2025-05-21  9:29   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 6+ messages in thread
From: Alejandro Enrique via B4 Relay @ 2025-05-14 13:54 UTC (permalink / raw)
  To: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-kernel, Alejandro Enrique

From: Alejandro Enrique <alejandroe1@geotab.com>

U-Blox M8/M9 chip have a pin to start it in safeboot mode, to be used
to recover from situations where the flash content has become
corrupted and needs to be restored. If this pin is asserted at power
up/reset, the receiver starts in safeboot mode and GNSS operation is
disabled.

Deassert the safeboot pin when probing this driver.

Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
---
 drivers/gnss/ubx.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c
index 92402f6082c415c7b9051338eef5406b09e09455..1d6acace84f76f8d5d2eacdbbf5ab7a934b33486 100644
--- a/drivers/gnss/ubx.c
+++ b/drivers/gnss/ubx.c
@@ -67,6 +67,7 @@ static int ubx_probe(struct serdev_device *serdev)
 {
 	struct gnss_serial *gserial;
 	struct gpio_desc *reset;
+	struct gpio_desc *safeboot;
 	struct ubx_data *data;
 	int ret;
 
@@ -82,6 +83,13 @@ static int ubx_probe(struct serdev_device *serdev)
 
 	data = gnss_serial_get_drvdata(gserial);
 
+	/* Deassert safeboot */
+	safeboot = devm_gpiod_get_optional(&serdev->dev, "safeboot", GPIOD_OUT_LOW);
+	if (IS_ERR(safeboot)) {
+		ret = PTR_ERR(safeboot);
+		goto err_free_gserial;
+	}
+
 	data->vcc = devm_regulator_get(&serdev->dev, "vcc");
 	if (IS_ERR(data->vcc)) {
 		ret = PTR_ERR(data->vcc);

-- 
2.34.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding
  2025-05-14 13:54 ` [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding Alejandro Enrique via B4 Relay
@ 2025-05-21  9:27   ` Krzysztof Kozlowski
  2025-05-22 16:32     ` Alejandro Enrique
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-21  9:27 UTC (permalink / raw)
  To: Alejandro Enrique
  Cc: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree, linux-kernel

On Wed, May 14, 2025 at 03:54:41PM GMT, Alejandro Enrique wrote:
> U-Blox M8/M9 chip have a pin to start it in safeboot mode, to be used
> to recover from situations where the flash content has become
> corrupted and needs to be restored. Introduce a binding to support
> this safeboot pin.
> 
> Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
> ---
>  Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
> index 7d4b6d49e5eea2201ac05ba6d54b1c1721172f26..16d922279def99257c194520a7ac820f2a26e9c7 100644
> --- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
> +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml
> @@ -32,6 +32,9 @@ properties:
>    reset-gpios:
>      maxItems: 1
>  
> +  safeboot-gpios:
> +    maxItems: 1
> +

You need if:then: disallowing (:false) this for 6m and 8. Move entire allOf down
and add there new if: clause. (see example schema)

>    vcc-supply:
>      description: >
>        Main voltage regulator
> @@ -61,5 +64,6 @@ examples:
>              v-bckp-supply = <&gnss_v_bckp_reg>;
>              vcc-supply = <&gnss_vcc_reg>;
>              reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
> +            safeboot-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;

Thats 8, not 8m?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] gnss: ubx: add support for the safeboot gpio
  2025-05-14 13:54 ` [PATCH 2/2] gnss: ubx: add support for the safeboot gpio Alejandro Enrique via B4 Relay
@ 2025-05-21  9:29   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-21  9:29 UTC (permalink / raw)
  To: Alejandro Enrique
  Cc: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree, linux-kernel

On Wed, May 14, 2025 at 03:54:42PM GMT, Alejandro Enrique wrote:
> U-Blox M8/M9 chip have a pin to start it in safeboot mode, to be used
> to recover from situations where the flash content has become
> corrupted and needs to be restored. If this pin is asserted at power
> up/reset, the receiver starts in safeboot mode and GNSS operation is
> disabled.
> 
> Deassert the safeboot pin when probing this driver.
> 
> Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
> ---
>  drivers/gnss/ubx.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

<form letter>
This is an automated instruction, just in case, because many review tags
are being ignored. If you know the process, you can skip it (please do
not feel offended by me posting it here - no bad intentions intended).
If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions of patchset, under or above your Signed-off-by tag, unless
patch changed significantly (e.g. new properties added to the DT
bindings). Tag is "received", when provided in a message replied to you
on the mailing list. Tools like b4 can help here. However, there's no
need to repost patches *only* to add the tags. The upstream maintainer
will do that for tags received on the version they apply.

https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
</form letter>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding
  2025-05-21  9:27   ` Krzysztof Kozlowski
@ 2025-05-22 16:32     ` Alejandro Enrique
  0 siblings, 0 replies; 6+ messages in thread
From: Alejandro Enrique @ 2025-05-22 16:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Johan Hovold, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree, linux-kernel

On Wed, May 21, 2025 at 11:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> You need if:then: disallowing (:false) this for 6m and 8. Move entire allOf down
> and add there new if: clause. (see example schema)

I see, I will add that.
>
> >    vcc-supply:
> >      description: >
> >        Main voltage regulator
> > @@ -61,5 +64,6 @@ examples:
> >              v-bckp-supply = <&gnss_v_bckp_reg>;
> >              vcc-supply = <&gnss_vcc_reg>;
> >              reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
> > +            safeboot-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
>
> Thats 8, not 8m?
My bad. Anyway I now checked the integration manual and it seems the
neo-8 also supports it. So I will send a version 2 of the patch
disallowing safeboot-gpios just for the neo-6m.
Thanks for the review..

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-22 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-14 13:54 [PATCH 0/2] Add support for safeboot pin to UBlox GNSS driver Alejandro Enrique via B4 Relay
2025-05-14 13:54 ` [PATCH 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding Alejandro Enrique via B4 Relay
2025-05-21  9:27   ` Krzysztof Kozlowski
2025-05-22 16:32     ` Alejandro Enrique
2025-05-14 13:54 ` [PATCH 2/2] gnss: ubx: add support for the safeboot gpio Alejandro Enrique via B4 Relay
2025-05-21  9:29   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®