mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: rpi: add CM4S device id
@ 2023-12-14 16:35 Sebastien Bourdelin
  2023-12-14 17:17 ` Ahmad Fatoum
  2023-12-18  6:53 ` Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Sebastien Bourdelin @ 2023-12-14 16:35 UTC (permalink / raw)
  To: barebox; +Cc: a.fatoum, Sebastien Bourdelin

Introduce the device id for the raspberry CM4S accordingly to [1].

 [1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@rtone.fr>
---
 arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++++
 include/mach/bcm283x/mbox.h               | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index c2b273c5c3..597e2d2d0e 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -650,6 +650,9 @@ static const struct rpi_machine_data rpi_4_ids[] = {
 	}, {
 		.hw_id = BCM2711_BOARD_REV_CM4,
 		.init = rpi_eth_init,
+	}, {
+		.hw_id = BCM2711_BOARD_REV_CM4_S,
+		.init = rpi_eth_init,
 	}, {
 		.hw_id = U8_MAX
 	},
@@ -682,6 +685,7 @@ static const struct of_device_id rpi_of_match[] = {
 	/* BCM2711 based Boards */
 	{ .compatible = "raspberrypi,4-model-b", .data = rpi_4_ids },
 	{ .compatible = "raspberrypi,4-compute-module", .data = rpi_4_ids },
+	{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
 	{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
 
 	{ /* sentinel */ },
diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
index 908ba17dba..cf5143673a 100644
--- a/include/mach/bcm283x/mbox.h
+++ b/include/mach/bcm283x/mbox.h
@@ -175,6 +175,7 @@ struct bcm2835_mbox_tag_hdr {
 #define BCM2837B0_BOARD_REV_ZERO_2	0x12
 #define BCM2711_BOARD_REV_400		0x13
 #define BCM2711_BOARD_REV_CM4		0x14
+#define BCM2711_BOARD_REV_CM4_S		0x15
 
 struct bcm2835_mbox_tag_get_board_rev {
 	struct bcm2835_mbox_tag_hdr tag_hdr;
-- 
2.42.0




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

* Re: [PATCH] ARM: rpi: add CM4S device id
  2023-12-14 16:35 [PATCH] ARM: rpi: add CM4S device id Sebastien Bourdelin
@ 2023-12-14 17:17 ` Ahmad Fatoum
  2023-12-15  8:27   ` Sebastien Bourdelin
  2023-12-15  8:32   ` Sebastien Bourdelin
  2023-12-18  6:53 ` Sascha Hauer
  1 sibling, 2 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2023-12-14 17:17 UTC (permalink / raw)
  To: Sebastien Bourdelin, barebox; +Cc: Sebastien Bourdelin

Hello Sebastien,

On 14.12.23 17:35, Sebastien Bourdelin wrote:
> Introduce the device id for the raspberry CM4S accordingly to [1].
> 
>  [1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@rtone.fr>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

One comment below:

> +	}, {
> +		.hw_id = BCM2711_BOARD_REV_CM4_S,
> +		.init = rpi_eth_init,

Did you check that this is equally applicable on the RPI4?
This ends up calling rpi_get_usbethaddr(), but that one
calls GET_MAC_ADDRESS on the mbox interface, so I am not
sure whether this is applicable to bcmgenet or not.

Cheers,
Ahmad

>  	}, {
>  		.hw_id = U8_MAX
>  	},
> @@ -682,6 +685,7 @@ static const struct of_device_id rpi_of_match[] = {
>  	/* BCM2711 based Boards */
>  	{ .compatible = "raspberrypi,4-model-b", .data = rpi_4_ids },
>  	{ .compatible = "raspberrypi,4-compute-module", .data = rpi_4_ids },
> +	{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
>  	{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
>  
>  	{ /* sentinel */ },
> diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
> index 908ba17dba..cf5143673a 100644
> --- a/include/mach/bcm283x/mbox.h
> +++ b/include/mach/bcm283x/mbox.h
> @@ -175,6 +175,7 @@ struct bcm2835_mbox_tag_hdr {
>  #define BCM2837B0_BOARD_REV_ZERO_2	0x12
>  #define BCM2711_BOARD_REV_400		0x13
>  #define BCM2711_BOARD_REV_CM4		0x14
> +#define BCM2711_BOARD_REV_CM4_S		0x15
>  
>  struct bcm2835_mbox_tag_get_board_rev {
>  	struct bcm2835_mbox_tag_hdr tag_hdr;

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




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

* Re: [PATCH] ARM: rpi: add CM4S device id
  2023-12-14 17:17 ` Ahmad Fatoum
@ 2023-12-15  8:27   ` Sebastien Bourdelin
  2023-12-15  8:32   ` Sebastien Bourdelin
  1 sibling, 0 replies; 5+ messages in thread
From: Sebastien Bourdelin @ 2023-12-15  8:27 UTC (permalink / raw)
  To: Ahmad Fatoum

On Thu Dec 14, 2023 at 6:17 PM CET, Ahmad Fatoum wrote:
> Hello Sebastien,
>
> On 14.12.23 17:35, Sebastien Bourdelin wrote:
> > Introduce the device id for the raspberry CM4S accordingly to [1].
> > 
> >  [1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
> > 
> > Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@rtone.fr>
>
> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>
> One comment below:
>
> > +	}, {
> > +		.hw_id = BCM2711_BOARD_REV_CM4_S,
> > +		.init = rpi_eth_init,
>
> Did you check that this is equally applicable on the RPI4?
> This ends up calling rpi_get_usbethaddr(), but that one
> calls GET_MAC_ADDRESS on the mbox interface, so I am not
> sure whether this is applicable to bcmgenet or not.
>

Hello Ahmad,

No i didn't check specifically for the CM4S, i assumed the CM4S is not
different then the CM4 and RPI4 on that part and kept the same logic
then:
https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/raspberry-pi/rpi-common.c#n646

I'm actually not sure how to validate that.

Cheers,
Sebastien.

> Cheers,
> Ahmad
>
> >  	}, {
> >  		.hw_id = U8_MAX
> >  	},
> > @@ -682,6 +685,7 @@ static const struct of_device_id rpi_of_match[] = {
> >  	/* BCM2711 based Boards */
> >  	{ .compatible = "raspberrypi,4-model-b", .data = rpi_4_ids },
> >  	{ .compatible = "raspberrypi,4-compute-module", .data = rpi_4_ids },
> > +	{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
> >  	{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
> >  
> >  	{ /* sentinel */ },
> > diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
> > index 908ba17dba..cf5143673a 100644
> > --- a/include/mach/bcm283x/mbox.h
> > +++ b/include/mach/bcm283x/mbox.h
> > @@ -175,6 +175,7 @@ struct bcm2835_mbox_tag_hdr {
> >  #define BCM2837B0_BOARD_REV_ZERO_2	0x12
> >  #define BCM2711_BOARD_REV_400		0x13
> >  #define BCM2711_BOARD_REV_CM4		0x14
> > +#define BCM2711_BOARD_REV_CM4_S		0x15
> >  
> >  struct bcm2835_mbox_tag_get_board_rev {
> >  	struct bcm2835_mbox_tag_hdr tag_hdr;





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

* Re: [PATCH] ARM: rpi: add CM4S device id
  2023-12-14 17:17 ` Ahmad Fatoum
  2023-12-15  8:27   ` Sebastien Bourdelin
@ 2023-12-15  8:32   ` Sebastien Bourdelin
  1 sibling, 0 replies; 5+ messages in thread
From: Sebastien Bourdelin @ 2023-12-15  8:32 UTC (permalink / raw)
  To: Ahmad Fatoum, Sebastien Bourdelin, barebox

On Thu Dec 14, 2023 at 6:17 PM CET, Ahmad Fatoum wrote:
> Hello Sebastien,
>
> On 14.12.23 17:35, Sebastien Bourdelin wrote:
> > Introduce the device id for the raspberry CM4S accordingly to [1].
> > 
> >  [1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
> > 
> > Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@rtone.fr>
>
> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>
> One comment below:
>
> > +	}, {
> > +		.hw_id = BCM2711_BOARD_REV_CM4_S,
> > +		.init = rpi_eth_init,
>
> Did you check that this is equally applicable on the RPI4?
> This ends up calling rpi_get_usbethaddr(), but that one
> calls GET_MAC_ADDRESS on the mbox interface, so I am not
> sure whether this is applicable to bcmgenet or not.
>
> Cheers,
> Ahmad
>

Hello Ahmad,

No i didn't check specifically for the CM4S, i assumed the CM4S is not
different then the CM4 and RPI4 on that part and kept the same logic
then:
https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/raspberry-pi/rpi-common.c#n646

I'm actually not sure how to validate that.

Cheers,
Sebastien.

> >  	}, {
> >  		.hw_id = U8_MAX
> >  	},
> > @@ -682,6 +685,7 @@ static const struct of_device_id rpi_of_match[] = {
> >  	/* BCM2711 based Boards */
> >  	{ .compatible = "raspberrypi,4-model-b", .data = rpi_4_ids },
> >  	{ .compatible = "raspberrypi,4-compute-module", .data = rpi_4_ids },
> > +	{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
> >  	{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
> >  
> >  	{ /* sentinel */ },
> > diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
> > index 908ba17dba..cf5143673a 100644
> > --- a/include/mach/bcm283x/mbox.h
> > +++ b/include/mach/bcm283x/mbox.h
> > @@ -175,6 +175,7 @@ struct bcm2835_mbox_tag_hdr {
> >  #define BCM2837B0_BOARD_REV_ZERO_2	0x12
> >  #define BCM2711_BOARD_REV_400		0x13
> >  #define BCM2711_BOARD_REV_CM4		0x14
> > +#define BCM2711_BOARD_REV_CM4_S		0x15
> >  
> >  struct bcm2835_mbox_tag_get_board_rev {
> >  	struct bcm2835_mbox_tag_hdr tag_hdr;




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

* Re: [PATCH] ARM: rpi: add CM4S device id
  2023-12-14 16:35 [PATCH] ARM: rpi: add CM4S device id Sebastien Bourdelin
  2023-12-14 17:17 ` Ahmad Fatoum
@ 2023-12-18  6:53 ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2023-12-18  6:53 UTC (permalink / raw)
  To: Sebastien Bourdelin; +Cc: barebox, a.fatoum, Sebastien Bourdelin

On Thu, Dec 14, 2023 at 05:35:20PM +0100, Sebastien Bourdelin wrote:
> Introduce the device id for the raspberry CM4S accordingly to [1].
> 
>  [1]: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-revision-codes
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@rtone.fr>
> ---
>  arch/arm/boards/raspberry-pi/rpi-common.c | 4 ++++
>  include/mach/bcm283x/mbox.h               | 1 +
>  2 files changed, 5 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
> index c2b273c5c3..597e2d2d0e 100644
> --- a/arch/arm/boards/raspberry-pi/rpi-common.c
> +++ b/arch/arm/boards/raspberry-pi/rpi-common.c
> @@ -650,6 +650,9 @@ static const struct rpi_machine_data rpi_4_ids[] = {
>  	}, {
>  		.hw_id = BCM2711_BOARD_REV_CM4,
>  		.init = rpi_eth_init,
> +	}, {
> +		.hw_id = BCM2711_BOARD_REV_CM4_S,
> +		.init = rpi_eth_init,
>  	}, {
>  		.hw_id = U8_MAX
>  	},
> @@ -682,6 +685,7 @@ static const struct of_device_id rpi_of_match[] = {
>  	/* BCM2711 based Boards */
>  	{ .compatible = "raspberrypi,4-model-b", .data = rpi_4_ids },
>  	{ .compatible = "raspberrypi,4-compute-module", .data = rpi_4_ids },
> +	{ .compatible = "raspberrypi,4-compute-module-s", .data = rpi_4_ids },
>  	{ .compatible = "raspberrypi,400", .data = rpi_4_ids },
>  
>  	{ /* sentinel */ },
> diff --git a/include/mach/bcm283x/mbox.h b/include/mach/bcm283x/mbox.h
> index 908ba17dba..cf5143673a 100644
> --- a/include/mach/bcm283x/mbox.h
> +++ b/include/mach/bcm283x/mbox.h
> @@ -175,6 +175,7 @@ struct bcm2835_mbox_tag_hdr {
>  #define BCM2837B0_BOARD_REV_ZERO_2	0x12
>  #define BCM2711_BOARD_REV_400		0x13
>  #define BCM2711_BOARD_REV_CM4		0x14
> +#define BCM2711_BOARD_REV_CM4_S		0x15
>  
>  struct bcm2835_mbox_tag_get_board_rev {
>  	struct bcm2835_mbox_tag_hdr tag_hdr;
> -- 
> 2.42.0
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-12-18  6:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-14 16:35 [PATCH] ARM: rpi: add CM4S device id Sebastien Bourdelin
2023-12-14 17:17 ` Ahmad Fatoum
2023-12-15  8:27   ` Sebastien Bourdelin
2023-12-15  8:32   ` Sebastien Bourdelin
2023-12-18  6:53 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox