From: Johan Hovold <johan@kernel.org>
To: alejandroe1@geotab.com
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH v3 2/2] gnss: ubx: add support for the safeboot gpio
Date: Fri, 14 Nov 2025 15:59:23 +0100 [thread overview]
Message-ID: <aRdDyyIA9Z4e8mBz@hovoldconsulting.com> (raw)
In-Reply-To: <20250911-ubx-safeboot-v3-2-32fe6b882a3c@geotab.com>
On Thu, Sep 11, 2025 at 02:58:29PM +0200, Alejandro Enrique via B4 Relay wrote:
> From: Alejandro Enrique <alejandroe1@geotab.com>
>
> U-Blox 8/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.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Alejandro Enrique <alejandroe1@geotab.com>
Sorry about the late feedback on this. I had to think about how best to
handle this, given that we don't have an interface yet to actually
assert these pins.
I guess we can go ahead and request them at probe as you're doing here
and add an interface for controlling them later if needed (instead of
not claiming them and allowing emergency control through gpiolib).
> @@ -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");
Note that the driver is not enabling the supply until open() so I moved
the deassert to after the supplies have been requested (but before reset
is deasserted).
Note however that both the RESET_N and SAFEBOOT_N pins should be
declared as open-drain to avoid driving them while the main supply is
off.
I added a comment about this to the commit message about this when
applying and will send a follow-on patch to update the binding example.
> if (IS_ERR(data->vcc)) {
> ret = PTR_ERR(data->vcc);
Johan
next prev parent reply other threads:[~2025-11-14 14:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 12:58 [PATCH v3 0/2] Add support for safeboot pin to UBlox GNSS driver Alejandro Enrique via B4 Relay
2025-09-11 12:58 ` [PATCH v3 1/2] dt-bindings: gnss: u-blox: add "safeboot-gpios" binding Alejandro Enrique via B4 Relay
2025-11-14 14:42 ` Johan Hovold
2025-09-11 12:58 ` [PATCH v3 2/2] gnss: ubx: add support for the safeboot gpio Alejandro Enrique via B4 Relay
2025-11-14 14:59 ` Johan Hovold [this message]
2025-11-17 16:33 ` Alejandro Enrique
2025-11-20 15:51 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRdDyyIA9Z4e8mBz@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=alejandroe1@geotab.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox