From patchwork Sat Feb 6 17:42:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 579850 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9F21E140761 for ; Sun, 7 Feb 2016 04:43:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9383EB3830; Sat, 6 Feb 2016 18:43:41 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YNxG4FFfFVom; Sat, 6 Feb 2016 18:43:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 085B5B382B; Sat, 6 Feb 2016 18:43:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5AA74B382B for ; Sat, 6 Feb 2016 18:43:37 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k8p8MHP7w-Hn for ; Sat, 6 Feb 2016 18:43:37 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 19165A7498 for ; Sat, 6 Feb 2016 18:43:32 +0100 (CET) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 4780B6492; Sat, 6 Feb 2016 10:42:36 -0700 (MST) Received: from dart.wwwdotorg.org (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id E8106E461D; Sat, 6 Feb 2016 10:43:46 -0700 (MST) From: Stephen Warren To: u-boot@lists.denx.de, Anatolij Gustschin Date: Sat, 6 Feb 2016 10:42:43 -0700 Message-Id: <1454780563-4854-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.9.1 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.6 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: Tom Rini Subject: [U-Boot] [PATCH] video: bcm2835: use bus_to_phys() on FB address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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 #include #include +#include #include #include @@ -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)