linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
@ 2022-04-14 21:43 Linus Walleij
  2022-04-18 11:19 ` Dmitry Osipenko
  2022-04-19 18:11 ` Rob Herring
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2022-04-14 21:43 UTC (permalink / raw)
  To: Johan Hovold, Rob Herring; +Cc: linux-kernel, Linus Walleij, devicetree

The Broadcom BCM4751 family of (A-)GPS chips have been around for
some years. The latest iteration BCM4753 is for example mounted
on the Huawei HiKey970.

Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../bindings/gnss/brcm,bcm4751.yaml           | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml

diff --git a/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml b/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
new file mode 100644
index 000000000000..f06a4acf21cf
--- /dev/null
+++ b/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gnss/brcm,bcm4751.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom BCM4751 family GNSS Receiver Device Tree Bindings
+
+maintainers:
+  - Johan Hovold <johan@kernel.org>
+  - Linus Walleij <linus.walleij@linaro.org>
+
+description:
+  Broadcom GPS chips can be used over the UART or I2C bus. The UART
+  bus requires CTS/RTS support. The number of the capsule is more
+  elaborate than the compatibles BCM4751 may be printed
+  BCM4751IFBG for example.
+
+allOf:
+  - $ref: gnss-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - brcm,bcm4751
+      - brcm,bcm4752
+      - brcm,bcm4753
+
+  reg:
+    description:
+      The I2C Address, not required on UART buses.
+
+  vdd-auxin-supply:
+    description:
+      Main voltage supply, pin name VDD_AUXIN, typically connected
+      directly to a battery such as LiIon 3.8V battery or a 2.6V supply.
+
+  vddio-supply:
+    description:
+      IO voltage supply, pin name VDDIO, typically 1.8V
+
+  reset-gpios:
+    maxItems: 1
+    description: An optional active low reset line, should be flagged with
+      GPIO_ACTIVE_LOW.
+
+  enable-gpios:
+    description: Enable GPIO line, connected to pins named REGPU or NSTANDBY.
+      If the line is active low such as NSTANDBY, it should be tagged
+      GPIO_ACTIVE_LOW.
+
+required:
+  - compatible
+  - enable-gpios
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    serial {
+        gnss {
+            compatible = "brcm,bcm4751";
+            vdd-auxin-supply = <&vbat>;
+            reset-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+            enable-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
+            current-speed = <38400>;
+        };
+    };
-- 
2.35.1


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

* Re: [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
  2022-04-14 21:43 [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings Linus Walleij
@ 2022-04-18 11:19 ` Dmitry Osipenko
  2022-04-22 21:50   ` Linus Walleij
  2022-04-19 18:11 ` Rob Herring
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Osipenko @ 2022-04-18 11:19 UTC (permalink / raw)
  To: Linus Walleij, Johan Hovold, Rob Herring, David Heidelberg,
	Svyatoslav Ryhel
  Cc: linux-kernel, devicetree

Hi Linus,

On 4/15/22 00:43, Linus Walleij wrote:
> The Broadcom BCM4751 family of (A-)GPS chips have been around for
> some years. The latest iteration BCM4753 is for example mounted
> on the Huawei HiKey970.
> 
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../bindings/gnss/brcm,bcm4751.yaml           | 69 +++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml

What are the chances of seeing the kernel driver for BCM4751+? There are
myriads of Android devices using that GPS chip. Previously the
proprietary firmware interface of BCM4751 was an obstacle for addition
of the driver to upstream kernel, did anything change?

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

* Re: [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
  2022-04-14 21:43 [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings Linus Walleij
  2022-04-18 11:19 ` Dmitry Osipenko
@ 2022-04-19 18:11 ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2022-04-19 18:11 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Johan Hovold, linux-kernel, devicetree

On Thu, Apr 14, 2022 at 11:43:37PM +0200, Linus Walleij wrote:
> The Broadcom BCM4751 family of (A-)GPS chips have been around for
> some years. The latest iteration BCM4753 is for example mounted
> on the Huawei HiKey970.
> 
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../bindings/gnss/brcm,bcm4751.yaml           | 69 +++++++++++++++++++
>  1 file changed, 69 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml b/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
> new file mode 100644
> index 000000000000..f06a4acf21cf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
> @@ -0,0 +1,69 @@
> +# SPDX-License-Identifier: GPL-2.0

Dual license.

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gnss/brcm,bcm4751.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom BCM4751 family GNSS Receiver Device Tree Bindings
> +
> +maintainers:
> +  - Johan Hovold <johan@kernel.org>
> +  - Linus Walleij <linus.walleij@linaro.org>
> +
> +description:
> +  Broadcom GPS chips can be used over the UART or I2C bus. The UART
> +  bus requires CTS/RTS support. The number of the capsule is more
> +  elaborate than the compatibles BCM4751 may be printed
> +  BCM4751IFBG for example.
> +
> +allOf:
> +  - $ref: gnss-common.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - brcm,bcm4751
> +      - brcm,bcm4752
> +      - brcm,bcm4753
> +
> +  reg:
> +    description:
> +      The I2C Address, not required on UART buses.
> +
> +  vdd-auxin-supply:
> +    description:
> +      Main voltage supply, pin name VDD_AUXIN, typically connected
> +      directly to a battery such as LiIon 3.8V battery or a 2.6V supply.
> +
> +  vddio-supply:
> +    description:
> +      IO voltage supply, pin name VDDIO, typically 1.8V
> +
> +  reset-gpios:
> +    maxItems: 1
> +    description: An optional active low reset line, should be flagged with
> +      GPIO_ACTIVE_LOW.
> +
> +  enable-gpios:
> +    description: Enable GPIO line, connected to pins named REGPU or NSTANDBY.
> +      If the line is active low such as NSTANDBY, it should be tagged
> +      GPIO_ACTIVE_LOW.
> +
> +required:
> +  - compatible
> +  - enable-gpios
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    serial {
> +        gnss {
> +            compatible = "brcm,bcm4751";
> +            vdd-auxin-supply = <&vbat>;
> +            reset-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
> +            enable-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
> +            current-speed = <38400>;
> +        };
> +    };
> -- 
> 2.35.1
> 
> 

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

* Re: [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
  2022-04-18 11:19 ` Dmitry Osipenko
@ 2022-04-22 21:50   ` Linus Walleij
  2022-04-23 14:12     ` Dmitry Osipenko
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2022-04-22 21:50 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Johan Hovold, Rob Herring, David Heidelberg, Svyatoslav Ryhel,
	linux-kernel, devicetree

On Mon, Apr 18, 2022 at 1:19 PM Dmitry Osipenko
<dmitry.osipenko@collabora.com> wrote:

> What are the chances of seeing the kernel driver for BCM4751+?

The kernel does not normally drive the GPS. The kernel has a small driver
dealing with hardware power on/off of the GPS and exposing
/dev/gnss0 to userspace.

See Johans lecture at:
https://events19.linuxfoundation.org/wp-content/uploads/2017/12/The-GNSS-Subsystem-Johan-Hovold-Hovold-Consulting-AB.pdf

>  There are
> myriads of Android devices using that GPS chip. Previously the
> proprietary firmware interface of BCM4751 was an obstacle for addition
> of the driver to upstream kernel, did anything change?

Actually there is nothing stopping us from anyway merging device tree
bindings, even if no driver is on the horizon for Linux. The DT bindings
are not a Linux kernel thing. Actually we merged bindings like that in
the past. It makes it possible to create complete device trees, which
is nice. A driver for Linux can be slotted in at a later point.

Anyway, that is the boring answer.

Many if not all GPS:es (as all Wireless chips) have proprietary firmware
interfaces. This is normal. GPS:es are special since by tradition the
stack using them is in userspace. There exist free software userspace
stacks for misc GPS:es.

gpsd is the most common userspace daemon for GPS.
gpsd will then talk to /dev/gnss0 as any other TTY IIUC.

Replicant has a free implementation of the "MEIF" API for this GPS,
I think what is needed is really for someone to pick up, polish and
contribute that to gpsd
https://git.replicant.us/contrib/PaulK/bcm4751/

Yours,
Linus Walleij

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

* Re: [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
  2022-04-22 21:50   ` Linus Walleij
@ 2022-04-23 14:12     ` Dmitry Osipenko
  2022-04-23 15:09       ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Osipenko @ 2022-04-23 14:12 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Johan Hovold, Rob Herring, David Heidelberg, Svyatoslav Ryhel,
	linux-kernel, devicetree

On 4/23/22 00:50, Linus Walleij wrote:
> On Mon, Apr 18, 2022 at 1:19 PM Dmitry Osipenko
> <dmitry.osipenko@collabora.com> wrote:
> 
>> What are the chances of seeing the kernel driver for BCM4751+?
> 
> The kernel does not normally drive the GPS. The kernel has a small driver
> dealing with hardware power on/off of the GPS and exposing
> /dev/gnss0 to userspace.
> 
> See Johans lecture at:
> https://events19.linuxfoundation.org/wp-content/uploads/2017/12/The-GNSS-Subsystem-Johan-Hovold-Hovold-Consulting-AB.pdf

IIUC, driver also should be needed for the firmware uploading, similarly
to the BCM WiFi/BT chips, isn't it?

>>  There are
>> myriads of Android devices using that GPS chip. Previously the
>> proprietary firmware interface of BCM4751 was an obstacle for addition
>> of the driver to upstream kernel, did anything change?
> 
> Actually there is nothing stopping us from anyway merging device tree
> bindings, even if no driver is on the horizon for Linux. The DT bindings
> are not a Linux kernel thing. Actually we merged bindings like that in
> the past. It makes it possible to create complete device trees, which
> is nice. A driver for Linux can be slotted in at a later point.
> 
> Anyway, that is the boring answer.
> 
> Many if not all GPS:es (as all Wireless chips) have proprietary firmware
> interfaces. This is normal. GPS:es are special since by tradition the
> stack using them is in userspace. There exist free software userspace
> stacks for misc GPS:es.
> 
> gpsd is the most common userspace daemon for GPS.
> gpsd will then talk to /dev/gnss0 as any other TTY IIUC.
> 
> Replicant has a free implementation of the "MEIF" API for this GPS,
> I think what is needed is really for someone to pick up, polish and
> contribute that to gpsd
> https://git.replicant.us/contrib/PaulK/bcm4751/

My main curiosity is about whether you already have a working driver
prototype, something you could share with us all, so we could start
playing with it too :)

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

* Re: [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings
  2022-04-23 14:12     ` Dmitry Osipenko
@ 2022-04-23 15:09       ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2022-04-23 15:09 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Johan Hovold, Rob Herring, David Heidelberg, Svyatoslav Ryhel,
	linux-kernel, devicetree

On Sat, Apr 23, 2022 at 4:12 PM Dmitry Osipenko
<dmitry.osipenko@collabora.com> wrote:
> On 4/23/22 00:50, Linus Walleij wrote:
> > On Mon, Apr 18, 2022 at 1:19 PM Dmitry Osipenko
> > <dmitry.osipenko@collabora.com> wrote:
> >
> >> What are the chances of seeing the kernel driver for BCM4751+?
> >
> > The kernel does not normally drive the GPS. The kernel has a small driver
> > dealing with hardware power on/off of the GPS and exposing
> > /dev/gnss0 to userspace.
> >
> > See Johans lecture at:
> > https://events19.linuxfoundation.org/wp-content/uploads/2017/12/The-GNSS-Subsystem-Johan-Hovold-Hovold-Consulting-AB.pdf
>
> IIUC, driver also should be needed for the firmware uploading, similarly
> to the BCM WiFi/BT chips, isn't it?

As far as I can tell from the filesystem on this phone there is no firmware
so it is flashed into the GPS chip.

> > gpsd is the most common userspace daemon for GPS.
> > gpsd will then talk to /dev/gnss0 as any other TTY IIUC.
> >
> > Replicant has a free implementation of the "MEIF" API for this GPS,
> > I think what is needed is really for someone to pick up, polish and
> > contribute that to gpsd
> > https://git.replicant.us/contrib/PaulK/bcm4751/
>
> My main curiosity is about whether you already have a working driver
> prototype, something you could share with us all, so we could start
> playing with it too :)

It's on my TODO whenever there is time, but I have small kids so not
so much time... I was hoping for the jolly people in postmarketOS to
chime in because they seem to have a bunch of people with lots of
time on their hands available :D

Yours,
Linus Walleij

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

end of thread, other threads:[~2022-04-23 15:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 21:43 [PATCH] dt-bindings: gnss: Add Broacom BCM4751 family bindings Linus Walleij
2022-04-18 11:19 ` Dmitry Osipenko
2022-04-22 21:50   ` Linus Walleij
2022-04-23 14:12     ` Dmitry Osipenko
2022-04-23 15:09       ` Linus Walleij
2022-04-19 18:11 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).