Skip to contentSkip to conversation

board: rpi: Pass CMA through from firmware DT

PATCH Superseded Peter Robinson 3 participants 3 messages Oct 4, 2024 – Oct 7, 2024 Broadcom BCM2711/BCM2835 Arm architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: rpi: Pass CMA through from firmware DT

For a lot of usecases, such as display, camera, media the Raspberry Pi needs a lot more CMA than distros configure as default so we should pass this parameter through so things work as expected. Fix a spelling mistake while we're at it.

---
 board/raspberrypi/rpi/rpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.c +4 -1
index ab5ea85cf9f..d4dbd96bc96 100644
@@ -540,7 +540,7 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 	if (fdt == fw_fdt)
 		return;
 
-	/* The firmware provides a more precie model; so copy that */
+	/* The firmware provides a more precise model; so copy that */
 	copy_property(fdt, fw_fdt, "/", "model");
 
 	/* memory reserve as suggested by the firmware */
@@ -561,6 +561,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 
 	/* address of the PHY device as provided by the firmware  */
 	copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
+
+	/* copy the CMA memory setting from the firmware DT to linux */
+	copy_property(fdt, fw_fdt, "cma", "size");
 }
 
 int ft_board_setup(void *blob, struct bd_info *bd)
Signature · 1 line
2.46.2
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Peter Robinson

For a lot of usecases, such as display, camera, media the Raspberry Pi needs a lot more CMA than distros configure as default so we should pass this parameter through so things work as expected. Fix a spelling mistake while we're at it.

Quoted 27 lines
---
  board/raspberrypi/rpi/rpi.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.c +4 -1
index ab5ea85cf9f..d4dbd96bc96 100644
@@ -540,7 +540,7 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
  	if (fdt == fw_fdt)
  		return;
 
-	/* The firmware provides a more precie model; so copy that */
+	/* The firmware provides a more precise model; so copy that */
  	copy_property(fdt, fw_fdt, "/", "model");
 
  	/* memory reserve as suggested by the firmware */
@@ -561,6 +561,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 
  	/* address of the PHY device as provided by the firmware  */
  	copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
+
+	/* copy the CMA memory setting from the firmware DT to linux */
+	copy_property(fdt, fw_fdt, "cma", "size");
  }
 
  int ft_board_setup(void *blob, struct bd_info *bd)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Robinson
Quoted 7 lines · Peter Robinson

For a lot of usecases, such as display, camera, media the Raspberry Pi needs a lot more CMA than distros configure as default so we should pass this parameter through so things work as expected. Fix a spelling mistake while we're at it.

Quoted 5 lines
---
 board/raspberrypi/rpi/rpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Quoted 26 lines
board/raspberrypi/rpi/rpi.c +4 -2
index ab5ea85cf9f..d4dbd96bc96 100644
@@ -540,7 +540,7 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
        if (fdt == fw_fdt)
                return;
 
-       /* The firmware provides a more precie model; so copy that */
+       /* The firmware provides a more precise model; so copy that */
        copy_property(fdt, fw_fdt, "/", "model");
 
        /* memory reserve as suggested by the firmware */
@@ -561,6 +561,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 
        /* address of the PHY device as provided by the firmware  */
        copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
+
+       /* copy the CMA memory setting from the firmware DT to linux */
+       copy_property(fdt, fw_fdt, "cma", "size");
 }
 
 int ft_board_setup(void *blob, struct bd_info *bd)
--

2.46.2