Skip to contentSkip to conversation

video: bcm2835: use bus_to_phys() on FB address

PATCH New Stephen Warren 2 participants 2 messages Feb 6, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: bcm2835: use bus_to_phys() on FB address

The FB address is generated by the firmware running on the GPU/VideoCore and is a "bus" address. This address is the other side of an IOMMU from the ARM upon which U-Boot is running. Use bus_to_phys() to convert this to an ARM physical address. Without this, U-Boot seems to work just fine, but once the Linux kernel boots on an RPi2, accessing the FB memory often causes a hard system hang.

This is related to:
122426d46e31 ARM: bcm2835: use phys_to_bus() for mbox 5c0beb5c58c8 usb: dwc2: use phys_to_bus/bus_to_phys 79340db7f1f6 ARM: bcm2835: implement phys_to_bus/bus_to_phys

---
 drivers/video/bcm2835.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/bcm2835.c +3 -1
index 7867fe3895d0..bff1fcb9eaf7 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <lcd.h>
 #include <memalign.h>
+#include <phys2bus.h>
 #include <asm/arch/mbox.h>
 #include <asm/global_data.h>
 
@@ -103,7 +104,8 @@ void lcd_ctrl_init(void *lcdbase)
 	panel_info.vl_row = h;
 	panel_info.vl_bpix = LCD_COLOR16;
 
-	gd->fb_base = msg_setup->allocate_buffer.body.resp.fb_address;
+	gd->fb_base = bus_to_phys(
+		msg_setup->allocate_buffer.body.resp.fb_address);
 }
 
 void lcd_enable(void)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 video: bcm2835: use bus_to_phys() on FB address

Hi Stephen,

Quoted 12 lines · On Sat, 6 Feb 2016 10:42:43 -0700 Stephen Warren swarren at wwwdotorg.org…

The FB address is generated by the firmware running on the GPU/VideoCore and is a "bus" address. This address is the other side of an IOMMU from the ARM upon which U-Boot is running. Use bus_to_phys() to convert this to an ARM physical address. Without this, U-Boot seems to work just fine, but once the Linux kernel boots on an RPi2, accessing the FB memory often causes a hard system hang.

This is related to:
122426d46e31 ARM: bcm2835: use phys_to_bus() for mbox 5c0beb5c58c8 usb: dwc2: use phys_to_bus/bus_to_phys 79340db7f1f6 ARM: bcm2835: implement phys_to_bus/bus_to_phys

Quoted 4 lines
---
 drivers/video/bcm2835.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

applied to u-boot-video/master, thanks!

--
Anatolij