All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] video: bcm2835: use bus_to_phys() on FB address
Date: Sat,  6 Feb 2016 10:42:43 -0700	[thread overview]
Message-ID: <1454780563-4854-1-git-send-email-swarren@wwwdotorg.org> (raw)

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

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
---
 drivers/video/bcm2835.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
index 7867fe3895d0..bff1fcb9eaf7 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -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)
-- 
1.9.1

             reply	other threads:[~2016-02-06 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 17:42 Stephen Warren [this message]
2016-02-06 18:13 ` [U-Boot] [PATCH] video: bcm2835: use bus_to_phys() on FB address Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454780563-4854-1-git-send-email-swarren@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.