greybus: Add BeaglePlay Greybus Driver
Subsystems (5)
Ayush Singh
maintainerv9 cover greybus: Add BeaglePlay Greybus Driver
BeagleConnect is both a technology concept and a line of board designs that implement the technology. Born from Greybus, a mechanism for dynamically extending a Linux system with embedded peripherals, BeagleConnect adds two key elements: a 6LoWPAN transport and mikroBUS manifests. The 6LoWPAN transport provides for arbitrary connections, including the IEEE802.15.4g long-range wireless transport supported between BeaglePlay and BeagleConnect Freedom (the first BeagleConnect board design). The mikroBUS manifests provide for rapid prototyping and low-node-count production with sensor boards following the mikroBUS freely-licensable embedded bus standard such that existing Linux drivers can be loaded upon Greybus discovery of the nodes. This patch set provides the Linux-side hooks required for the 6LoWPAN transport for BeagleConnect on BeaglePlay. Also adds required devicetree additions.
Tested over next-20230825.
Changes in Patch v9
v8 -> v9:
- Some capitalization in dt-bindings
- add reset-gpios and vdds-supply to beagleplay device tree
v7 -> v8:
- fix clocks
- fix reset-gpios
- depend on serdev
v6 -> v7:
- Drop speed variable
- Fix commit message
- add clock-names and descriptions
- fix power lines
v5 -> v6:
- Rename compatible to ti,cc1352p7
- Fix formatting
- Use kerneldoc
- Add clocks, power-gpios, reset-gpios to dt bindings
v4 -> v5:
- Move DT Bindings to net
- Rename compatible to beagle,play-cc1352
- Expose CC1352 as MCU
- Remove redundant tracing messages
- Fix memory leaks
v3 -> v4:
- Add DT Bindings
- Reorder commits
- Improve commit messages
v2 -> v3:
- Move gb-beagleplay out of staging
v1 -> v2:
- Combine the driver into a single file
- Remove redundant code
- Fix Checkpatch complaints
- Other suggested changes
Ayush Singh (3):
dt-bindings: net: Add ti,cc1352p7
greybus: Add BeaglePlay Linux Driver
dts: ti: k3-am625-beagleplay: Add beaglecc1352
.../devicetree/bindings/net/ti,cc1352p7.yaml | 51 ++ MAINTAINERS | 7 + .../arm64/boot/dts/ti/k3-am625-beagleplay.dts | 6 + drivers/greybus/Kconfig | 10 + drivers/greybus/Makefile | 2 + drivers/greybus/gb-beagleplay.c | 501 ++++++++++++++++++ 6 files changed, 577 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ti,cc1352p7.yaml create mode 100644 drivers/greybus/gb-beagleplay.c
base-commit: 6269320850097903b30be8f07a5c61d9f7592393
Signature · 1 line
2.41.0
Ayush Singh
maintainerPATCH v9 1/3 dt-bindings: net: Add ti,cc1352p7
Add DT bindings for Texas Instruments Simplelink CC1352P7 wireless MCU
BeaglePlay has CC1352P7 co-processor connected to the main AM62 (running Linux) over UART. In the BeagleConnect Technology, CC1352 is responsible for handling 6LoWPAN communication with beagleconnect freedom nodes as well as their discovery.
--- .../devicetree/bindings/net/ti,cc1352p7.yaml | 51 +++++++++++++++++++ MAINTAINERS | 6 +++ 2 files changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ti,cc1352p7.yaml
Documentation/devicetree/bindings/net/ti,cc1352p7.yaml new file +51 -0
@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/ti,cc1352p7.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments Simplelink CC1352P7 wireless MCU + +description: + The CC1352P7 MCU can be connected via SPI or UART. + +maintainers: + - Ayush Singh <[email protected]> + +properties: + compatible: + const: ti,cc1352p7 + + clocks: + items: + - description: high-frequency main system (MCU and peripherals) clock + - description: low-frequency system clock + + clock-names: + items: + - const: sclk_hf + - const: sclk_lf + + reset-gpios: + maxItems: 1 + + vdds-supply: true + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + serial { + mcu { + compatible = "ti,cc1352p7"; + clocks = <&sclk_hf 0>, <&sclk_lf 25>; + clock-names = "sclk_hf", "sclk_lf"; + reset-gpios = <&pio 35 GPIO_ACTIVE_LOW>; + vdds-supply = <&vdds>; + }; + };
MAINTAINERS +6 -0
@@ -8969,6 +8969,12 @@ F: drivers/staging/greybus/sdio.c F: drivers/staging/greybus/spi.c F: drivers/staging/greybus/spilib.c +GREYBUS BEAGLEPLAY DRIVERS +M: Ayush Singh <[email protected]> +L: [email protected] (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/net/ti,cc1352p7.yaml + GREYBUS SUBSYSTEM M: Johan Hovold <[email protected]> M: Alex Elder <[email protected]>
Signature · 1 line
2.41.0
kernel test robot
build botRe: [PATCH v9 1/3] dt-bindings: net: Add ti,cc1352p7
kernel test robot noticed the following build warnings:
Hi Ayush,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 6269320850097903b30be8f07a5c61d9f7592393]
url: https://github.com/intel-lab-lkp/linux/commits/Ayush-Singh/dt-bindings-net-Add-ti-cc1352p7/20231017-181305 base: 6269320850097903b30be8f07a5c61d9f7592393 patch link: https://lore.kernel.org/r/20231017101116.178041-2-ayushdevel1325%40gmail.com patch subject: [PATCH v9 1/3] dt-bindings: net: Add ti,cc1352p7 compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231026/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
dtcheck warnings: (new ones prefixed by >>)
>> Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml:70:27: [error] string value is redundantly quoted with any quotes (quoted-strings)
Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml:71:28: [error] string value is redundantly quoted with any quotes (quoted-strings)
vim +70 Documentation/devicetree/bindings/mtd/amlogic,meson-nand.yaml
fbc00b5e746f13 Liang Yang 2022-09-07 8 fbc00b5e746f13 Liang Yang 2022-09-07 9 allOf: fbc00b5e746f13 Liang Yang 2022-09-07 10 - $ref: nand-controller.yaml fbc00b5e746f13 Liang Yang 2022-09-07 11 fbc00b5e746f13 Liang Yang 2022-09-07 12 maintainers: fbc00b5e746f13 Liang Yang 2022-09-07 13 - [email protected] fbc00b5e746f13 Liang Yang 2022-09-07 14 fbc00b5e746f13 Liang Yang 2022-09-07 15 properties: fbc00b5e746f13 Liang Yang 2022-09-07 16 compatible: fbc00b5e746f13 Liang Yang 2022-09-07 17 enum: fbc00b5e746f13 Liang Yang 2022-09-07 18 - amlogic,meson-gxl-nfc fbc00b5e746f13 Liang Yang 2022-09-07 19 - amlogic,meson-axg-nfc fbc00b5e746f13 Liang Yang 2022-09-07 20 fbc00b5e746f13 Liang Yang 2022-09-07 21 reg: fbc00b5e746f13 Liang Yang 2022-09-07 22 maxItems: 2 fbc00b5e746f13 Liang Yang 2022-09-07 23 fbc00b5e746f13 Liang Yang 2022-09-07 24 reg-names: fbc00b5e746f13 Liang Yang 2022-09-07 25 items: fbc00b5e746f13 Liang Yang 2022-09-07 26 - const: nfc fbc00b5e746f13 Liang Yang 2022-09-07 27 - const: emmc fbc00b5e746f13 Liang Yang 2022-09-07 28 fbc00b5e746f13 Liang Yang 2022-09-07 29 interrupts: fbc00b5e746f13 Liang Yang 2022-09-07 30 maxItems: 1 fbc00b5e746f13 Liang Yang 2022-09-07 31 fbc00b5e746f13 Liang Yang 2022-09-07 32 clocks: fbc00b5e746f13 Liang Yang 2022-09-07 33 minItems: 2 fbc00b5e746f13 Liang Yang 2022-09-07 34 fbc00b5e746f13 Liang Yang 2022-09-07 35 clock-names: fbc00b5e746f13 Liang Yang 2022-09-07 36 items: fbc00b5e746f13 Liang Yang 2022-09-07 37 - const: core fbc00b5e746f13 Liang Yang 2022-09-07 38 - const: device fbc00b5e746f13 Liang Yang 2022-09-07 39 fbc00b5e746f13 Liang Yang 2022-09-07 40 patternProperties: fbc00b5e746f13 Liang Yang 2022-09-07 41 "^nand@[0-7]$": fbc00b5e746f13 Liang Yang 2022-09-07 42 type: object e37eaf5ebc5be6 Miquel Raynal 2023-06-19 43 $ref: raw-nand-chip.yaml fbc00b5e746f13 Liang Yang 2022-09-07 44 properties: fbc00b5e746f13 Liang Yang 2022-09-07 45 reg: fbc00b5e746f13 Liang Yang 2022-09-07 46 minimum: 0 fbc00b5e746f13 Liang Yang 2022-09-07 47 maximum: 1 fbc00b5e746f13 Liang Yang 2022-09-07 48 fbc00b5e746f13 Liang Yang 2022-09-07 49 nand-ecc-mode: fbc00b5e746f13 Liang Yang 2022-09-07 50 const: hw fbc00b5e746f13 Liang Yang 2022-09-07 51 fbc00b5e746f13 Liang Yang 2022-09-07 52 nand-ecc-step-size: c3519aed2a3faf Arseniy Krasnov 2023-07-11 53 enum: [512, 1024] fbc00b5e746f13 Liang Yang 2022-09-07 54 fbc00b5e746f13 Liang Yang 2022-09-07 55 nand-ecc-strength: fbc00b5e746f13 Liang Yang 2022-09-07 56 enum: [8, 16, 24, 30, 40, 50, 60] fbc00b5e746f13 Liang Yang 2022-09-07 57 description: | fbc00b5e746f13 Liang Yang 2022-09-07 58 The ECC configurations that can be supported are as follows. fbc00b5e746f13 Liang Yang 2022-09-07 59 meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60 fbc00b5e746f13 Liang Yang 2022-09-07 60 meson-axg-nfc 8 fbc00b5e746f13 Liang Yang 2022-09-07 61 262bc0096b7c91 Arseniy Krasnov 2023-06-08 62 nand-rb: 262bc0096b7c91 Arseniy Krasnov 2023-06-08 63 maxItems: 1 262bc0096b7c91 Arseniy Krasnov 2023-06-08 64 items: 262bc0096b7c91 Arseniy Krasnov 2023-06-08 65 maximum: 0 262bc0096b7c91 Arseniy Krasnov 2023-06-08 66 e37eaf5ebc5be6 Miquel Raynal 2023-06-19 67 unevaluatedProperties: false e37eaf5ebc5be6 Miquel Raynal 2023-06-19 68 350301a3d73b21 Arseniy Krasnov 2023-07-17 69 dependencies: 350301a3d73b21 Arseniy Krasnov 2023-07-17 @70 nand-ecc-strength: ['nand-ecc-step-size'] 350301a3d73b21 Arseniy Krasnov 2023-07-17 71 nand-ecc-step-size: ['nand-ecc-strength'] 350301a3d73b21 Arseniy Krasnov 2023-07-17 72 e37eaf5ebc5be6 Miquel Raynal 2023-06-19 73 fbc00b5e746f13 Liang Yang 2022-09-07 74 required: fbc00b5e746f13 Liang Yang 2022-09-07 75 - compatible fbc00b5e746f13 Liang Yang 2022-09-07 76 - reg fbc00b5e746f13 Liang Yang 2022-09-07 77 - interrupts fbc00b5e746f13 Liang Yang 2022-09-07 78 - clocks fbc00b5e746f13 Liang Yang 2022-09-07 79 - clock-names fbc00b5e746f13 Liang Yang 2022-09-07 80
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Ayush Singh
maintainerPATCH v9 2/3 greybus: Add BeaglePlay Linux Driver
In reply to Ayush SinghAdd the Greybus host driver for BeaglePlay board by BeagleBoard.org.
The current greybus setup involves running SVC in a user-space application (GBridge) and using netlink to communicate with kernel space. GBridge itself uses wpanusb kernel driver, so the greybus messages travel from kernel space (gb_netlink) to user-space (GBridge) and then back to kernel space (wpanusb) before reaching CC1352.
This driver directly communicates with CC1352 (running SVC Zephyr application). Thus, it simplifies the complete greybus setup eliminating user-space GBridge.
This driver is responsible for the following:
- Start SVC (CC1352) on driver load.
- Send/Receive Greybus messages to/from CC1352 using HDLC over UART.
- Print Logs from CC1352.
- Stop SVC (CC1352) on driver load.
--- MAINTAINERS | 1 + drivers/greybus/Kconfig | 10 + drivers/greybus/Makefile | 2 + drivers/greybus/gb-beagleplay.c | 501 ++++++++++++++++++++++++++++++++ 4 files changed, 514 insertions(+) create mode 100644 drivers/greybus/gb-beagleplay.c
MAINTAINERS +1 -0
@@ -8974,6 +8974,7 @@ M: Ayush Singh <[email protected]> L: [email protected] (moderated for non-subscribers) S: Maintained F: Documentation/devicetree/bindings/net/ti,cc1352p7.yaml +F: drivers/greybus/gb-beagleplay.c GREYBUS SUBSYSTEM M: Johan Hovold <[email protected]>
drivers/greybus/Kconfig +10 -0
@@ -17,6 +17,16 @@ menuconfig GREYBUS if GREYBUS +config GREYBUS_BEAGLEPLAY + tristate "Greybus BeaglePlay driver" + depends on SERIAL_DEV_BUS + help + Select this option if you have a BeaglePlay where CC1352 + co-processor acts as Greybus SVC. + + To compile this code as a module, chose M here: the module + will be called gb-beagleplay.ko + config GREYBUS_ES2 tristate "Greybus ES3 USB host controller" depends on USB
drivers/greybus/Makefile +2 -0
@@ -18,6 +18,8 @@ obj-$(CONFIG_GREYBUS) += greybus.o # needed for trace events ccflags-y += -I$(src) +obj-$(CONFIG_GREYBUS_BEAGLEPLAY) += gb-beagleplay.o + # Greybus Host controller drivers gb-es2-y := es2.o
drivers/greybus/gb-beagleplay.c new file +501 -0
501 lines not on this page · raw message
Signature · 1 line
2.41.0
Ayush Singh
maintainerPATCH v9 3/3 dts: ti: k3-am625-beagleplay: Add beaglecc1352
In reply to Ayush SinghThe BeaglePlay board by BeagleBoard.org has a CC1352P7 co-processor connected to the main AM62 (running Linux) over UART. In the BeagleConnect Technology, CC1352 is responsible for handling 6LoWPAN communication with beagleconnect freedom nodes as well as their discovery.
This mcu is used by gb-beagleplay, a Greybus driver for BeaglePlay.
--- arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts +6 -0
@@ -870,6 +870,12 @@ &main_uart6 { pinctrl-names = "default"; pinctrl-0 = <&wifi_debug_uart_pins_default>; status = "okay"; + + mcu { + compatible = "ti,cc1352p7"; + reset-gpios = <&main_gpio0 72 GPIO_ACTIVE_LOW>; + vdds-supply = <&vdd_3v3>; + }; }; &dss {
Signature · 1 line
2.41.0
Greg KH
maintainerQuoted 25 lines · Ayush Singh
BeagleConnect is both a technology concept and a line of board designs that implement the technology. Born from Greybus, a mechanism for dynamically extending a Linux system with embedded peripherals, BeagleConnect adds two key elements: a 6LoWPAN transport and mikroBUS manifests. The 6LoWPAN transport provides for arbitrary connections, including the IEEE802.15.4g long-range wireless transport supported between BeaglePlay and BeagleConnect Freedom (the first BeagleConnect board design). The mikroBUS manifests provide for rapid prototyping and low-node-count production with sensor boards following the mikroBUS freely-licensable embedded bus standard such that existing Linux drivers can be loaded upon Greybus discovery of the nodes. This patch set provides the Linux-side hooks required for the 6LoWPAN transport for BeagleConnect on BeaglePlay. Also adds required devicetree additions.
Tested over
next-20230825.Link https://programmershideaway.xyz/tags/gsoc23/ GSoC23 BlogLink https://git.beagleboard.org/gsoc/greybus/cc1352-firmware Zephyr AppLink https://github.com/Ayush1325/linux/tree/gb-beagleplay GitHub BranchLink https://docs.beagleboard.org/latest/boards/beagleconnect/index.html BeagleConnectLink https://docs.beagleboard.org/latest/boards/beagleplay/index.html BeaglePlayLink https://github.com/Ayush1325/linux/tree/gb-beagleplay Github Repo
Quoted 4 lines
Changes in Patch v9
v8 -> v9:
- Some capitalization in dt-bindings
- add reset-gpios and vdds-supply to beagleplay device tree
Given a lack of objections, and nothing I could find wrong with this, I've now applied this to my tree, thanks for sticking with this.
Now the real work begins! :)
thanks,
greg k-h