mbox series

[v7,0/3] greybus: Add BeaglePlay Greybus Driver

Message ID 20231004184639.462510-1-ayushdevel1325@gmail.com
Headers show
Series greybus: Add BeaglePlay Greybus Driver | expand

Message

Ayush Singh Oct. 4, 2023, 6:46 p.m. UTC
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 Blog
Link: https://git.beagleboard.org/gsoc/greybus/cc1352-firmware Zephyr App
Link: https://github.com/Ayush1325/linux/tree/gb-beagleplay GitHub Branch
Link: https://docs.beagleboard.org/latest/boards/beagleconnect/index.html BeagleConnect
Link: https://docs.beagleboard.org/latest/boards/beagleplay/index.html BeaglePlay
Link: https://github.com/Ayush1325/linux/tree/gb-beagleplay Github Repo
Link: https://lists.linaro.org/archives/list/greybus-dev@lists.linaro.org/thread/NYA3N2JYG3WIRCDXHYINNXYOCSVYRTSF/ Patch v6

Changes in Patch v7
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 |   4 +
 drivers/greybus/Kconfig                       |  10 +
 drivers/greybus/Makefile                      |   2 +
 drivers/greybus/gb-beagleplay.c               | 501 ++++++++++++++++++
 6 files changed, 575 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/ti,cc1352p7.yaml
 create mode 100644 drivers/greybus/gb-beagleplay.c


base-commit: 6269320850097903b30be8f07a5c61d9f7592393

Comments

Greg KH Oct. 5, 2023, 9:08 a.m. UTC | #1
On Thu, Oct 05, 2023 at 12:16:37AM +0530, Ayush Singh wrote:
> Add 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.
> 
> Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
> ---
>  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
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5467669d7963..d87e30626a6a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -8974,6 +8974,7 @@ M:	Ayush Singh <ayushdevel1325@gmail.com>
>  L:	greybus-dev@lists.linaro.org (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 <johan@kernel.org>
> diff --git a/drivers/greybus/Kconfig b/drivers/greybus/Kconfig
> index 78ba3c3083d5..fd4f26d09c53 100644
> --- a/drivers/greybus/Kconfig
> +++ b/drivers/greybus/Kconfig
> @@ -17,6 +17,16 @@ menuconfig GREYBUS
>  
>  if GREYBUS
>  
> +config GREYBUS_BEAGLEPLAY
> +	tristate "Greybus BeaglePlay driver"
> +	depends on TTY

What you want to depend on here is serdev, not tty, right?  Or am I
mis-reading the code requirements?

thanks,

greg k-h
Ayush Singh Oct. 5, 2023, 9:48 a.m. UTC | #2
On 10/5/23 14:38, Greg KH wrote:
> On Thu, Oct 05, 2023 at 12:16:37AM +0530, Ayush Singh wrote:
>> Add 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.
>>
>> Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
>> ---
>>   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
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 5467669d7963..d87e30626a6a 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -8974,6 +8974,7 @@ M:	Ayush Singh <ayushdevel1325@gmail.com>
>>   L:	greybus-dev@lists.linaro.org (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 <johan@kernel.org>
>> diff --git a/drivers/greybus/Kconfig b/drivers/greybus/Kconfig
>> index 78ba3c3083d5..fd4f26d09c53 100644
>> --- a/drivers/greybus/Kconfig
>> +++ b/drivers/greybus/Kconfig
>> @@ -17,6 +17,16 @@ menuconfig GREYBUS
>>   
>>   if GREYBUS
>>   
>> +config GREYBUS_BEAGLEPLAY
>> +	tristate "Greybus BeaglePlay driver"
>> +	depends on TTY
> What you want to depend on here is serdev, not tty, right?  Or am I
> mis-reading the code requirements?
>
> thanks,
>
> greg k-h

Yes, it was dependent on tty in the past, but not anymore. I think it 
should be changed to `SERIAL_DEV_BUS` now?


Sincerely,

Ayush Singh
Greg KH Oct. 5, 2023, 10:39 a.m. UTC | #3
On Thu, Oct 05, 2023 at 03:18:15PM +0530, Ayush Singh wrote:
> 
> On 10/5/23 14:38, Greg KH wrote:
> > On Thu, Oct 05, 2023 at 12:16:37AM +0530, Ayush Singh wrote:
> > > Add 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.
> > > 
> > > Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
> > > ---
> > >   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
> > > 
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index 5467669d7963..d87e30626a6a 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -8974,6 +8974,7 @@ M:	Ayush Singh <ayushdevel1325@gmail.com>
> > >   L:	greybus-dev@lists.linaro.org (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 <johan@kernel.org>
> > > diff --git a/drivers/greybus/Kconfig b/drivers/greybus/Kconfig
> > > index 78ba3c3083d5..fd4f26d09c53 100644
> > > --- a/drivers/greybus/Kconfig
> > > +++ b/drivers/greybus/Kconfig
> > > @@ -17,6 +17,16 @@ menuconfig GREYBUS
> > >   if GREYBUS
> > > +config GREYBUS_BEAGLEPLAY
> > > +	tristate "Greybus BeaglePlay driver"
> > > +	depends on TTY
> > What you want to depend on here is serdev, not tty, right?  Or am I
> > mis-reading the code requirements?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Yes, it was dependent on tty in the past, but not anymore. I think it should
> be changed to `SERIAL_DEV_BUS` now?

Yes, otherwise you will get build errors.

thanks,

greg k-h