From 0fc1b4b6fda8f64385f3932984cf2f651c735eb3 Mon Sep 17 00:00:00 2001 From: Alejandro Enrique Date: Wed, 14 May 2025 15:54:41 +0200 Subject: [PATCH 1/5] dt-bindings: gnss: u-blox: add safeboot gpio 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. Signed-off-by: Alejandro Enrique Signed-off-by: Johan Hovold --- 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 c0c2bfaa606f..9f14cfe7efd1 100644 --- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml @@ -36,6 +36,9 @@ properties: reset-gpios: maxItems: 1 + safeboot-gpios: + maxItems: 1 + vcc-supply: description: > Main voltage regulator @@ -65,5 +68,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>; }; }; From 955cd0545b6abcefd297832e38f90f6851fc2ada Mon Sep 17 00:00:00 2001 From: Alejandro Enrique Date: Wed, 14 May 2025 15:54:42 +0200 Subject: [PATCH 2/5] gnss: ubx: add support for the safeboot gpio 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 Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20250911-ubx-safeboot-v3-2-32fe6b882a3c@geotab.com [ johan: deassert after requesting supplies ] Signed-off-by: Johan Hovold --- drivers/gnss/ubx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c index 92402f6082c4..23894ff75ff9 100644 --- a/drivers/gnss/ubx.c +++ b/drivers/gnss/ubx.c @@ -66,6 +66,7 @@ static const struct gnss_serial_ops ubx_gserial_ops = { static int ubx_probe(struct serdev_device *serdev) { struct gnss_serial *gserial; + struct gpio_desc *safeboot; struct gpio_desc *reset; struct ubx_data *data; int ret; @@ -92,6 +93,13 @@ static int ubx_probe(struct serdev_device *serdev) if (ret < 0 && ret != -ENODEV) goto err_free_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; + } + /* Deassert reset */ reset = devm_gpiod_get_optional(&serdev->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(reset)) { From 094f33935009832fc4e40cc7396049703f2dd05b Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 14 Nov 2025 16:54:13 +0100 Subject: [PATCH 3/5] dt-bindings: gnss: u-blox: use open-drain reset and safeboot in example The RESET_N and SAFEBOOT_N pins should typically be left open and only be connected to ground in rare cases where a device is misbehaving. Specify GPIO_OPEN_DRAIN in the example as this is what should generally be used. Acked-by: Conor Dooley Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml index 9f14cfe7efd1..d016808f65cb 100644 --- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml @@ -67,7 +67,7 @@ examples: compatible = "u-blox,neo-8"; 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>; + reset-gpios = <&gpio 1 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; + safeboot-gpios = <&gpio 2 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; }; }; From 4af167d8037d91f39e59475d02de03b45254493d Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 14 Nov 2025 16:05:29 +0100 Subject: [PATCH 4/5] dt-bindings: gnss: u-blox: use lowercase company name The u-blox company name is written in lowercase so restore the style that was used before the binding was converted to YAML. Acked-by: Conor Dooley Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml index d016808f65cb..b349b7bc0412 100644 --- a/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml +++ b/Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/gnss/u-blox,neo-6m.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: U-blox GNSS Receiver +title: u-blox GNSS receiver allOf: - $ref: gnss-common.yaml# @@ -14,7 +14,7 @@ maintainers: - Johan Hovold description: > - The U-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces. + The u-blox GNSS receivers can use UART, DDC (I2C), SPI and USB interfaces. properties: compatible: From f5ef3f722d76eb8fdd11be3f1f1f1cc4fefbf45b Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 14 Nov 2025 16:06:28 +0100 Subject: [PATCH 5/5] dt-bindings: gnss: fix timepulse description The timepulse pin is an output that can be used to generate a pulse at a (configurable) frequency (i.e. it is not an input). Fixes: dba529605f55 ("dt-bindings: gnss: Rewrite common bindings in YAML") Acked-by: Conor Dooley Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/gnss/gnss-common.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/gnss/gnss-common.yaml b/Documentation/devicetree/bindings/gnss/gnss-common.yaml index d4430d2d6855..354c0524089c 100644 --- a/Documentation/devicetree/bindings/gnss/gnss-common.yaml +++ b/Documentation/devicetree/bindings/gnss/gnss-common.yaml @@ -31,8 +31,7 @@ properties: maxItems: 1 timepulse-gpios: - description: When a timepulse is provided to the GNSS device using a - GPIO line, this is used. + description: Timepulse signal maxItems: 1 additionalProperties: true