2018-12-28 18:59:22

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 0/4] Add driver for globaltop GNSS receivers

Hello !

This patch series adds a new GNSS driver for the globaltop GNSS receivers.
These receivers transmits NMEA output sequence as soon as they have booted.
Power management can be done via the main supply and optional backup supply
as defined in the device tree.

The driver has been tested using a GlobalTop pa6h chipset on a Libretech-cc
board using the expansion header. Changes made in the board device tree can
be found below for reference and testing.

Loys

Loys Ollivier (4):
dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."
dt-bindings: gnss: add gtop binding
gnss: add gtop receiver type support
gnss: add driver for globaltop receivers

Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/gnss/Kconfig | 13 ++
drivers/gnss/Makefile | 3 +
drivers/gnss/core.c | 1 +
drivers/gnss/gtop.c | 152 +++++++++++++++++++++
include/linux/gnss.h | 1 +
7 files changed, 204 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gnss/gtop.txt
create mode 100644 drivers/gnss/gtop.c

---
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
index 90a56af967a7..3b3d4dcc47aa 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
@@ -17,6 +17,7 @@

aliases {
serial0 = &uart_AO;
+ serial1 = &uart_A;
ethernet0 = &ethmac;
};

@@ -269,7 +270,20 @@
pinctrl-names = "default";
};

+/* This is brought out on the UART_A_TX (8) and UART_A_RX (10) pins: */
+&uart_A {
+ status = "okay";
+ pinctrl-0 = <&uart_a_pins>;
+ pinctrl-names = "default";
+
+ gnss {
+ compatible = "globaltop,pa6h";
+ v-bckp-supply = <&vcc_3v3>;
+ vcc-supply = <&vcc_3v3>;
+ current-speed = <9600>;
+ };
+};
+
&usb0 {
status = "okay";
};
--
2.7.4



2018-12-28 19:00:05

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 1/4] dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."

Add globaltop vendor definition.

Signed-off-by: Loys Ollivier <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 4b1a2a8fcc16..a9214767afa8 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -153,6 +153,7 @@ goodix Shenzhen Huiding Technology Co., Ltd.
google Google, Inc.
grinn Grinn
grmn Garmin Limited
+globaltop GlobalTop Technology, Inc.
gumstix Gumstix, Inc.
gw Gateworks Corporation
hannstar HannStar Display Corporation
--
2.7.4


2018-12-28 19:01:18

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 2/4] dt-bindings: gnss: add gtop binding

Add binding for GlobalTop GNSS receivers.

Signed-off-by: Loys Ollivier <[email protected]>
---
Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gnss/gtop.txt

diff --git a/Documentation/devicetree/bindings/gnss/gtop.txt b/Documentation/devicetree/bindings/gnss/gtop.txt
new file mode 100644
index 000000000000..24c86703aa46
--- /dev/null
+++ b/Documentation/devicetree/bindings/gnss/gtop.txt
@@ -0,0 +1,33 @@
+GlobalTop GNSS Receiver DT binding
+
+The GlobalTop GNSS receivers uses UART interfaces.
+
+Please see Documentation/devicetree/bindings/gnss/gnss.txt for generic
+properties.
+
+Required properties:
+
+- compatible : Must be
+
+ "globaltop,pa6h"
+
+- vcc-supply : Main voltage regulator
+
+Optional properties:
+
+- timepulse-gpios : Time pulse GPIO
+- v-bckp-supply : Backup voltage regulator
+
+Example:
+
+&uart_A {
+ status = "okay";
+ pinctrl-0 = <&uart_a_pins>;
+ pinctrl-names = "default";
+
+ gnss {
+ compatible = "globaltop,pa6h";
+ vcc-supply = <&vcc_3v3>;
+ current-speed = <9600>;
+ };
+};
--
2.7.4


2018-12-28 19:47:30

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 4/4] gnss: add driver for globaltop receivers

Add driver for serial-connected GlobalTop GNSS receivers.

These devices typically boot transmitting vendor specific NMEA output
sequences. The serial port bit rate is read from the device tree
"current-speed".

Note that the driver uses the generic GNSS serial implementation and
therefore essentially only manages power abstracted into three power
states: ACTIVE, STANDBY, and OFF.

For globaltop receivers with a main supply and no enable-gpios, this simply
means that the main supply is disabled in STANDBY and OFF (the optional
backup supply is kept enabled while the driver is bound).

Note that the timepulse-support is left unimplemented.

Signed-off-by: Loys Ollivier <[email protected]>
---
drivers/gnss/Kconfig | 13 +++++
drivers/gnss/Makefile | 3 +
drivers/gnss/core.c | 1 +
drivers/gnss/gtop.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 169 insertions(+)
create mode 100644 drivers/gnss/gtop.c

diff --git a/drivers/gnss/Kconfig b/drivers/gnss/Kconfig
index 6abc88514512..c93ad134656b 100644
--- a/drivers/gnss/Kconfig
+++ b/drivers/gnss/Kconfig
@@ -40,4 +40,17 @@ config GNSS_UBX_SERIAL

If unsure, say N.

+config GNSS_GTOP_SERIAL
+ tristate "GlobalTop GNSS receiver support"
+ depends on SERIAL_DEV_BUS
+ select GNSS_SERIAL
+ help
+ Say Y here if you have a GlobalTop GNSS receiver which uses a serial
+ interface.
+
+ To compile this driver as a module, choose M here: the module will
+ be called gnss-gtop.
+
+ If unsure, say N.
+
endif # GNSS
diff --git a/drivers/gnss/Makefile b/drivers/gnss/Makefile
index 5cf0ebe0330a..becc45f24b8b 100644
--- a/drivers/gnss/Makefile
+++ b/drivers/gnss/Makefile
@@ -14,3 +14,6 @@ gnss-sirf-y := sirf.o

obj-$(CONFIG_GNSS_UBX_SERIAL) += gnss-ubx.o
gnss-ubx-y := ubx.o
+
+obj-$(CONFIG_GNSS_GTOP_SERIAL) += gnss-gtop.o
+gnss-gtop-y := gtop.o
diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c
index 4291a0dd22aa..0b5cd82b1fb7 100644
--- a/drivers/gnss/core.c
+++ b/drivers/gnss/core.c
@@ -334,6 +334,7 @@ static const char * const gnss_type_names[GNSS_TYPE_COUNT] = {
[GNSS_TYPE_NMEA] = "NMEA",
[GNSS_TYPE_SIRF] = "SiRF",
[GNSS_TYPE_UBX] = "UBX",
+ [GNSS_TYPE_GTOP] = "GTOP",
};

static const char *gnss_type_name(struct gnss_device *gdev)
diff --git a/drivers/gnss/gtop.c b/drivers/gnss/gtop.c
new file mode 100644
index 000000000000..6fa7b425d711
--- /dev/null
+++ b/drivers/gnss/gtop.c
@@ -0,0 +1,152 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * GlobalTop GNSS receiver driver
+ *
+ * Copyright (C) 2018 Loys Ollivier <[email protected]>
+ */
+
+#include <linux/errno.h>
+#include <linux/gnss.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+#include <linux/serdev.h>
+
+#include "serial.h"
+
+struct gtop_data {
+ struct regulator *v_bckp;
+ struct regulator *vcc;
+};
+
+static int gtop_set_active(struct gnss_serial *gserial)
+{
+ struct gtop_data *data = gnss_serial_get_drvdata(gserial);
+ int ret;
+
+ ret = regulator_enable(data->vcc);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static int gtop_set_standby(struct gnss_serial *gserial)
+{
+ struct gtop_data *data = gnss_serial_get_drvdata(gserial);
+ int ret;
+
+ ret = regulator_disable(data->vcc);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static int gtop_set_power(struct gnss_serial *gserial,
+ enum gnss_serial_pm_state state)
+{
+ switch (state) {
+ case GNSS_SERIAL_ACTIVE:
+ return gtop_set_active(gserial);
+ case GNSS_SERIAL_OFF:
+ case GNSS_SERIAL_STANDBY:
+ return gtop_set_standby(gserial);
+ }
+
+ return -EINVAL;
+}
+
+static const struct gnss_serial_ops gtop_gserial_ops = {
+ .set_power = gtop_set_power,
+};
+
+static int gtop_probe(struct serdev_device *serdev)
+{
+ struct gnss_serial *gserial;
+ struct gtop_data *data;
+ int ret;
+
+ gserial = gnss_serial_allocate(serdev, sizeof(*data));
+ if (IS_ERR(gserial)) {
+ ret = PTR_ERR(gserial);
+ return ret;
+ }
+
+ gserial->ops = &gtop_gserial_ops;
+
+ gserial->gdev->type = GNSS_TYPE_GTOP;
+
+ data = gnss_serial_get_drvdata(gserial);
+
+ data->vcc = devm_regulator_get(&serdev->dev, "vcc");
+ if (IS_ERR(data->vcc)) {
+ ret = PTR_ERR(data->vcc);
+ goto err_free_gserial;
+ }
+
+ data->v_bckp = devm_regulator_get_optional(&serdev->dev, "v-bckp");
+ if (IS_ERR(data->v_bckp)) {
+ ret = PTR_ERR(data->v_bckp);
+ if (ret == -ENODEV)
+ data->v_bckp = NULL;
+ else
+ goto err_free_gserial;
+ }
+
+ if (data->v_bckp) {
+ ret = regulator_enable(data->v_bckp);
+ if (ret)
+ goto err_free_gserial;
+ }
+
+ ret = gnss_serial_register(gserial);
+ if (ret)
+ goto err_disable_v_bckp;
+
+ return 0;
+
+err_disable_v_bckp:
+ if (data->v_bckp)
+ regulator_disable(data->v_bckp);
+err_free_gserial:
+ gnss_serial_free(gserial);
+
+ return ret;
+}
+
+static void gtop_remove(struct serdev_device *serdev)
+{
+ struct gnss_serial *gserial = serdev_device_get_drvdata(serdev);
+ struct gtop_data *data = gnss_serial_get_drvdata(gserial);
+
+ gnss_serial_deregister(gserial);
+ if (data->v_bckp)
+ regulator_disable(data->v_bckp);
+ gnss_serial_free(gserial);
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id gtop_of_match[] = {
+ { .compatible = "globaltop,pa6h" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, gtop_of_match);
+#endif
+
+static struct serdev_device_driver gtop_driver = {
+ .driver = {
+ .name = "gnss-gtop",
+ .of_match_table = of_match_ptr(gtop_of_match),
+ .pm = &gnss_serial_pm_ops,
+ },
+ .probe = gtop_probe,
+ .remove = gtop_remove,
+};
+module_serdev_device_driver(gtop_driver);
+
+MODULE_AUTHOR("Loys Ollivier <[email protected]>");
+MODULE_DESCRIPTION("GlobalTop GNSS receiver driver");
+MODULE_LICENSE("GPL v2");
--
2.7.4


2018-12-28 20:03:11

by Loys Ollivier

[permalink] [raw]
Subject: [PATCH 3/4] gnss: add gtop receiver type support

Add a gtop type to the "GNSS_TYPE" attribute.

Note that GTOP receveirs support a subset of NMEA 0183 with vendor
extensions (e.g. to allow switching to the vendor protocol).

Signed-off-by: Loys Ollivier <[email protected]>
---
include/linux/gnss.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/linux/gnss.h b/include/linux/gnss.h
index 43546977098c..adbbacc00278 100644
--- a/include/linux/gnss.h
+++ b/include/linux/gnss.h
@@ -22,6 +22,7 @@ enum gnss_type {
GNSS_TYPE_NMEA = 0,
GNSS_TYPE_SIRF,
GNSS_TYPE_UBX,
+ GNSS_TYPE_GTOP,

GNSS_TYPE_COUNT
};
--
2.7.4


2019-01-03 22:06:52

by Loys Ollivier

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers


As suggested by Neil Armstrong - this GNSS device seems to behave
like
most generic GNSS receivers.
I'll send a v2 with a generic driver that works for both GlobalTop
and
u-blox.

Please ignore this serie.

Thanks,

Loys

Loys Ollivier writes:

> Hello !
>
> This patch series adds a new GNSS driver for the globaltop GNSS
> receivers.
> These receivers transmits NMEA output sequence as soon as they
> have booted.
> Power management can be done via the main supply and optional
> backup supply
> as defined in the device tree.
>
> The driver has been tested using a GlobalTop pa6h chipset on a
> Libretech-cc
> board using the expansion header. Changes made in the board
> device tree can
> be found below for reference and testing.
>
> Loys
>
> Loys Ollivier (4):
> dt-bindings: Add vendor prefix for "GlobalTop Technology,
> Inc."
> dt-bindings: gnss: add gtop binding
> gnss: add gtop receiver type support
> gnss: add driver for globaltop receivers
>
> Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++
> .../devicetree/bindings/vendor-prefixes.txt | 1 +
> drivers/gnss/Kconfig | 13 ++
> drivers/gnss/Makefile | 3 +
> drivers/gnss/core.c | 1 +
> drivers/gnss/gtop.c | 152
> +++++++++++++++++++++
> include/linux/gnss.h | 1 +
> 7 files changed, 204 insertions(+)
> create mode 100644
> Documentation/devicetree/bindings/gnss/gtop.txt
> create mode 100644 drivers/gnss/gtop.c
>
> ---
> diff --git
> a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> index 90a56af967a7..3b3d4dcc47aa 100644
> ---
> a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> +++
> b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> @@ -17,6 +17,7 @@
>
> aliases {
> serial0 = &uart_AO;
> + serial1 = &uart_A;
> ethernet0 = &ethmac;
> };
>
> @@ -269,7 +270,20 @@
> pinctrl-names = "default";
> };
>
> +/* This is brought out on the UART_A_TX (8) and UART_A_RX (10)
> pins: */
> +&uart_A {
> + status = "okay";
> + pinctrl-0 = <&uart_a_pins>;
> + pinctrl-names = "default";
> +
> + gnss {
> + compatible = "globaltop,pa6h";
> + v-bckp-supply = <&vcc_3v3>;
> + vcc-supply = <&vcc_3v3>;
> + current-speed = <9600>;
> + };
> +};
> +
> &usb0 {
> status = "okay";
> };


--
-L

2019-01-04 11:39:39

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers

On Thu, Jan 03, 2019 at 05:04:35PM +0100, Loys Ollivier wrote:
>
> As suggested by Neil Armstrong - this GNSS device seems to behave like
> most generic GNSS receivers.
> I'll send a v2 with a generic driver that works for both GlobalTop and
> u-blox.

That doesn't sound right to me. Judging from a quick look, this device
appears to be based on a mediatek chipset, so I suggest reworking
(renaming) this as a Mediatek driver (gnss type would be MTK, reflecting
the vendor protocol) even if it happens to look a lot like the current
u-blox driver.

If we ever add more features, like support for some part of the vendor
protocol or maybe 1pps, things will start diverging. As you noticed you
already have the generic serial gnss implementation to handle a lot of
the common bits.

> Loys Ollivier writes:
>
> > Hello !
> >
> > This patch series adds a new GNSS driver for the globaltop GNSS
> > receivers. These receivers transmits NMEA output sequence as soon
> > as they have booted. Power management can be done via the main
> > supply and optional backup supply as defined in the device tree.
> >
> > The driver has been tested using a GlobalTop pa6h chipset on a
> > Libretech-cc board using the expansion header. Changes made in the
> > board device tree can be found below for reference and testing.

Thanks,
Johan

2019-01-04 19:04:37

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers

On Fri, Dec 28, 2018 at 4:51 AM Loys Ollivier <[email protected]> wrote:
>
> Hello !
>
> This patch series adds a new GNSS driver for the globaltop GNSS receivers.
> These receivers transmits NMEA output sequence as soon as they have booted.
> Power management can be done via the main supply and optional backup supply
> as defined in the device tree.
>
> The driver has been tested using a GlobalTop pa6h chipset on a Libretech-cc
> board using the expansion header. Changes made in the board device tree can
> be found below for reference and testing.
>
> Loys
>
> Loys Ollivier (4):
> dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."
> dt-bindings: gnss: add gtop binding
> gnss: add gtop receiver type support
> gnss: add driver for globaltop receivers
>
> Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++
> .../devicetree/bindings/vendor-prefixes.txt | 1 +
> drivers/gnss/Kconfig | 13 ++
> drivers/gnss/Makefile | 3 +
> drivers/gnss/core.c | 1 +
> drivers/gnss/gtop.c | 152 +++++++++++++++++++++
> include/linux/gnss.h | 1 +
> 7 files changed, 204 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/gnss/gtop.txt
> create mode 100644 drivers/gnss/gtop.c
>
> ---
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> index 90a56af967a7..3b3d4dcc47aa 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
> @@ -17,6 +17,7 @@
>
> aliases {
> serial0 = &uart_AO;
> + serial1 = &uart_A;

You should not need this as the UART is not used as a tty. It could be
that the serial driver requires aliases, but that should be fixed.
There should be some examples of fixing this in other serial drivers.

> ethernet0 = &ethmac;
> };

2019-01-07 17:58:13

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers

On Mon, Jan 07, 2019 at 05:21:58PM +0100, Loys Ollivier wrote:
>
> On Fri 04 Jan 2019 at 09:19, Johan Hovold wrote:
>
> > On Thu, Jan 03, 2019 at 05:04:35PM +0100, Loys Ollivier wrote:
> >>
> >> As suggested by Neil Armstrong - this GNSS device seems to behave like
> >> most generic GNSS receivers.
> >> I'll send a v2 with a generic driver that works for both GlobalTop and
> >> u-blox.
> >
> > That doesn't sound right to me. Judging from a quick look, this device
> > appears to be based on a mediatek chipset, so I suggest reworking
> > (renaming) this as a Mediatek driver (gnss type would be MTK, reflecting
> > the vendor protocol) even if it happens to look a lot like the current
> > u-blox driver.
> >
> OK, agreed - will rename the driver as Mediatek.
> Would you recommend keeping any reference to Globaltop ? Such as in the
> devicetree gnss bindings.
> Or only keep "mediatek,mt3339" for any solution based on that chipset.

Yes, I suggest keeping the globaltop compatible (cf. the sirf driver for
devices based on sirf chipsets).

Thanks,
Johan

2019-01-07 18:49:47

by Loys Ollivier

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers


On Fri 04 Jan 2019 at 09:19, Johan Hovold wrote:

> On Thu, Jan 03, 2019 at 05:04:35PM +0100, Loys Ollivier wrote:
>>
>> As suggested by Neil Armstrong - this GNSS device seems to behave like
>> most generic GNSS receivers.
>> I'll send a v2 with a generic driver that works for both GlobalTop and
>> u-blox.
>
> That doesn't sound right to me. Judging from a quick look, this device
> appears to be based on a mediatek chipset, so I suggest reworking
> (renaming) this as a Mediatek driver (gnss type would be MTK, reflecting
> the vendor protocol) even if it happens to look a lot like the current
> u-blox driver.
>
OK, agreed - will rename the driver as Mediatek.
Would you recommend keeping any reference to Globaltop ? Such as in the
devicetree gnss bindings.
Or only keep "mediatek,mt3339" for any solution based on that chipset.
> If we ever add more features, like support for some part of the vendor
> protocol or maybe 1pps, things will start diverging. As you noticed you
> already have the generic serial gnss implementation to handle a lot of
> the common bits.
Yes, I would like indeed to look into 1pps after that patch series.
>
>> Loys Ollivier writes:
>>
>> > Hello !
>> >
>> > This patch series adds a new GNSS driver for the globaltop GNSS
>> > receivers. These receivers transmits NMEA output sequence as soon
>> > as they have booted. Power management can be done via the main
>> > supply and optional backup supply as defined in the device tree.
>> >
>> > The driver has been tested using a GlobalTop pa6h chipset on a
>> > Libretech-cc board using the expansion header. Changes made in the
>> > board device tree can be found below for reference and testing.
>
> Thanks,
> Johan

Will send a v2.

--
-L

2019-01-11 20:46:33

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/4] dt-bindings: gnss: add gtop binding

On Fri, Dec 28, 2018 at 11:50:33AM +0100, Loys Ollivier wrote:
> Add binding for GlobalTop GNSS receivers.
>
> Signed-off-by: Loys Ollivier <[email protected]>
> ---
> Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/gnss/gtop.txt
>
> diff --git a/Documentation/devicetree/bindings/gnss/gtop.txt b/Documentation/devicetree/bindings/gnss/gtop.txt
> new file mode 100644
> index 000000000000..24c86703aa46
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gnss/gtop.txt
> @@ -0,0 +1,33 @@
> +GlobalTop GNSS Receiver DT binding
> +
> +The GlobalTop GNSS receivers uses UART interfaces.
> +
> +Please see Documentation/devicetree/bindings/gnss/gnss.txt for generic
> +properties.
> +
> +Required properties:
> +
> +- compatible : Must be
> +
> + "globaltop,pa6h"
> +
> +- vcc-supply : Main voltage regulator
> +
> +Optional properties:
> +
> +- timepulse-gpios : Time pulse GPIO
> +- v-bckp-supply : Backup voltage regulator
> +
> +Example:
> +
> +&uart_A {
> + status = "okay";

Don't show status in examples.

> + pinctrl-0 = <&uart_a_pins>;
> + pinctrl-names = "default";
> +
> + gnss {
> + compatible = "globaltop,pa6h";
> + vcc-supply = <&vcc_3v3>;
> + current-speed = <9600>;

Shouldn't the driver know what speed the device operates at?

If you do use this, then it needs to be documented as to when it is
needed.

> + };
> +};
> --
> 2.7.4
>

2019-01-11 20:47:04

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."

On Fri, Dec 28, 2018 at 11:50:32AM +0100, Loys Ollivier wrote:
> Add globaltop vendor definition.
>
> Signed-off-by: Loys Ollivier <[email protected]>
> ---
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
> index 4b1a2a8fcc16..a9214767afa8 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -153,6 +153,7 @@ goodix Shenzhen Huiding Technology Co., Ltd.
> google Google, Inc.
> grinn Grinn
> grmn Garmin Limited
> +globaltop GlobalTop Technology, Inc.

Alphabetical order please.

> gumstix Gumstix, Inc.
> gw Gateworks Corporation
> hannstar HannStar Display Corporation
> --
> 2.7.4
>

2019-01-15 10:02:34

by Loys Ollivier

[permalink] [raw]
Subject: Re: [PATCH 0/4] Add driver for globaltop GNSS receivers

On Fri 04 Jan 2019 at 11:51, Rob Herring <[email protected]> wrote:

> On Fri, Dec 28, 2018 at 4:51 AM Loys Ollivier <[email protected]> wrote:
>>
>> Hello !
>>
>> This patch series adds a new GNSS driver for the globaltop GNSS receivers.
>> These receivers transmits NMEA output sequence as soon as they have booted.
>> Power management can be done via the main supply and optional backup supply
>> as defined in the device tree.
>>
>> The driver has been tested using a GlobalTop pa6h chipset on a Libretech-cc
>> board using the expansion header. Changes made in the board device tree can
>> be found below for reference and testing.
>>
>> Loys
>>
>> Loys Ollivier (4):
>> dt-bindings: Add vendor prefix for "GlobalTop Technology, Inc."
>> dt-bindings: gnss: add gtop binding
>> gnss: add gtop receiver type support
>> gnss: add driver for globaltop receivers
>>
>> Documentation/devicetree/bindings/gnss/gtop.txt | 33 +++++
>> .../devicetree/bindings/vendor-prefixes.txt | 1 +
>> drivers/gnss/Kconfig | 13 ++
>> drivers/gnss/Makefile | 3 +
>> drivers/gnss/core.c | 1 +
>> drivers/gnss/gtop.c | 152 +++++++++++++++++++++
>> include/linux/gnss.h | 1 +
>> 7 files changed, 204 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/gnss/gtop.txt
>> create mode 100644 drivers/gnss/gtop.c
>>
>> ---
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
>> index 90a56af967a7..3b3d4dcc47aa 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
>> @@ -17,6 +17,7 @@
>>
>> aliases {
>> serial0 = &uart_AO;
>> + serial1 = &uart_A;
>
> You should not need this as the UART is not used as a tty. It could be
> that the serial driver requires aliases, but that should be fixed.
> There should be some examples of fixing this in other serial drivers.
>

Thanks Rob,
Followed up on that [0].

[0]: https://lore.kernel.org/linux-amlogic/[email protected]/
>> ethernet0 = &ethmac;
>> };
>
> _______________________________________________
> linux-amlogic mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-amlogic