diff mbox series

[v5,2/6] board/raspberrypicm4io: enable RTC and USB overlays

Message ID 20210921202137.7092-2-ps.report@gmx.net
State Accepted
Headers show
Series [v5,1/6] package/rpi-firmware: rework boot/config file handling | expand

Commit Message

Peter Seiderer Sept. 21, 2021, 8:21 p.m. UTC
- add RTC and USB dtoverlay entries to config_cm4io.txt

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v4 -> v5:
  - new patch
---
 board/raspberrypi/config_cm4io.txt | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Yann E. MORIN Oct. 17, 2021, 8:27 p.m. UTC | #1
Peter, All,

On 2021-09-21 22:21 +0200, Peter Seiderer spake thusly:
> - add RTC and USB dtoverlay entries to config_cm4io.txt

Why specifically the RTC and USB? And why only on the CM, and not the
other boards?

IIRC, dwc2 is an OTG chip, too, and it is also wired on the rpi0. Well,
by experience, I know that the rpi0 *can* do USB slave/OTG.

Regards,
Yann E. MORIN.

> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v4 -> v5:
>   - new patch
> ---
>  board/raspberrypi/config_cm4io.txt | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/board/raspberrypi/config_cm4io.txt b/board/raspberrypi/config_cm4io.txt
> index 01f60395b3..cf7e6df1a1 100644
> --- a/board/raspberrypi/config_cm4io.txt
> +++ b/board/raspberrypi/config_cm4io.txt
> @@ -24,3 +24,10 @@ gpu_mem_1024=100
>  
>  # fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
>  dtoverlay=miniuart-bt
> +
> +# enable RTC
> +dtparam=i2c_vc=on
> +dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
> +
> +# enable dwc2 USB controller (USB 2.0)
> +dtoverlay=dwc2,dr_mode=host
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Peter Seiderer Oct. 17, 2021, 8:54 p.m. UTC | #2
Hello Yann,

On Sun, 17 Oct 2021 22:27:17 +0200, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Peter, All,
>
> On 2021-09-21 22:21 +0200, Peter Seiderer spake thusly:
> > - add RTC and USB dtoverlay entries to config_cm4io.txt
>
> Why specifically the RTC and USB? And why only on the CM, and not the
> other boards?

The config is not for the CM4 standalone, but specific to the
CM4 IO Board, equipped (as the only RPi original one) with an
RTC chip....

>
> IIRC, dwc2 is an OTG chip, too, and it is also wired on the rpi0. Well,
> by experience, I know that the rpi0 *can* do USB slave/OTG.

And as far as I know the USB is enabled with all RPi's with
exception of the CM4: 'The  USB  interface  is  disabled  to  save  power  by
default  on  the  CM4' (see [1] page 5)

According to [2]:

	Name:   dwc-otg
	Info:   Selects the dwc_otg USB controller driver which has fiq support. This
	        is the default on all except the Pi Zero which defaults to dwc2.
	Load:   dtoverlay=dwc-otg
	Params: <None>


	Name:   dwc2
	Info:   Selects the dwc2 USB controller driver
	Load:   dtoverlay=dwc2,<param>=<val>
	Params: dr_mode                 Dual role mode: "host", "peripheral" or "otg"

	        g-rx-fifo-size          Size of rx fifo size in gadget mode

	        g-np-tx-fifo-size       Size of non-periodic tx fifo size in gadget
	                                mode

Would interpret 'defaults to dwc2' on Pi Zero as enabled by default...

Regards,
Peter

[1] https://datasheets.raspberrypi.com/cm4io/cm4io-datasheet.pdf
[2] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
>
>
> Regards,
> Yann E. MORIN.
>
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > ---
> > Changes v4 -> v5:
> >   - new patch
> > ---
> >  board/raspberrypi/config_cm4io.txt | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/board/raspberrypi/config_cm4io.txt b/board/raspberrypi/config_cm4io.txt
> > index 01f60395b3..cf7e6df1a1 100644
> > --- a/board/raspberrypi/config_cm4io.txt
> > +++ b/board/raspberrypi/config_cm4io.txt
> > @@ -24,3 +24,10 @@ gpu_mem_1024=100
> >
> >  # fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
> >  dtoverlay=miniuart-bt
> > +
> > +# enable RTC
> > +dtparam=i2c_vc=on
> > +dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
> > +
> > +# enable dwc2 USB controller (USB 2.0)
> > +dtoverlay=dwc2,dr_mode=host
> > --
> > 2.33.0
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@lists.buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
Yann E. MORIN Oct. 20, 2021, 7:47 p.m. UTC | #3
On 2021-10-17 22:54 +0200, Peter Seiderer spake thusly:
> On Sun, 17 Oct 2021 22:27:17 +0200, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> > On 2021-09-21 22:21 +0200, Peter Seiderer spake thusly:
> > > - add RTC and USB dtoverlay entries to config_cm4io.txt
> > Why specifically the RTC and USB? And why only on the CM, and not the
> > other boards?
> The config is not for the CM4 standalone, but specific to the
> CM4 IO Board, equipped (as the only RPi original one) with an
> RTC chip....

Ah, OK, that makes sense, then.

> > IIRC, dwc2 is an OTG chip, too, and it is also wired on the rpi0. Well,
> > by experience, I know that the rpi0 *can* do USB slave/OTG.
> And as far as I know the USB is enabled with all RPi's with
> exception of the CM4: 'The  USB  interface  is  disabled  to  save  power  by
> default  on  the  CM4' (see [1] page 5)
> 
> According to [2]:
> 
> 	Name:   dwc-otg
> 	Info:   Selects the dwc_otg USB controller driver which has fiq support. This
> 	        is the default on all except the Pi Zero which defaults to dwc2.
> 	Load:   dtoverlay=dwc-otg
> 	Params: <None>
> 
> 
> 	Name:   dwc2
> 	Info:   Selects the dwc2 USB controller driver
> 	Load:   dtoverlay=dwc2,<param>=<val>
> 	Params: dr_mode                 Dual role mode: "host", "peripheral" or "otg"
> 
> 	        g-rx-fifo-size          Size of rx fifo size in gadget mode
> 
> 	        g-np-tx-fifo-size       Size of non-periodic tx fifo size in gadget
> 	                                mode


> Would interpret 'defaults to dwc2' on Pi Zero as enabled by default...

Yes, it is enabled by default, as a host-only controller, not OTG, which
has to be explictly requested.

Regards,
Yann E. MORIN.
Thomas Petazzoni Jan. 13, 2022, 10:13 p.m. UTC | #4
On Tue, 21 Sep 2021 22:21:33 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> - add RTC and USB dtoverlay entries to config_cm4io.txt
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
> Changes v4 -> v5:
>   - new patch
> ---
>  board/raspberrypi/config_cm4io.txt | 7 +++++++
>  1 file changed, 7 insertions(+)

I have applied to master, after extending the commit log with more
details that explain the change. Thanks!

Thomas
diff mbox series

Patch

diff --git a/board/raspberrypi/config_cm4io.txt b/board/raspberrypi/config_cm4io.txt
index 01f60395b3..cf7e6df1a1 100644
--- a/board/raspberrypi/config_cm4io.txt
+++ b/board/raspberrypi/config_cm4io.txt
@@ -24,3 +24,10 @@  gpu_mem_1024=100
 
 # fixes rpi (3B, 3B+, 3A+, 4B and Zero W) ttyAMA0 serial console
 dtoverlay=miniuart-bt
+
+# enable RTC
+dtparam=i2c_vc=on
+dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
+
+# enable dwc2 USB controller (USB 2.0)
+dtoverlay=dwc2,dr_mode=host