From patchwork Thu Apr 24 12:28:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 28972 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8BD4203AC for ; Thu, 24 Apr 2014 12:39:17 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf8385797qcy.7 for ; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=9p7Tmm99+wUfhkB/JJoCwzMJJtyWXVeO+SqB3dZGh9k=; b=Sw/mdAZliN45KoNaL+WtAjVbZMqXP8nx7URXdMFtBiKaBa+1Lj/+9lVAF8nzPlnf7p 1GMe7Jqbr/lOmm0tkkfvCAxSxESyiZfDLne5q1aNI7IjytVbaRHTyIVeIUazupHRJZA/ F4t6i/6nG9+AhgENs8vgQJnKoqrJTiJUWPb2Yaze+b54W6SFXr0B1kg1PqEGJkd+76z5 Mdnvhdak4XIGWq7DpQIRgYZVh98UfYTmdQsMaIoVmH6PYXpoXCJwrPqOJQbKOu+ftTjh KI1PJbplGvNpUjJpHsEIby3QSYkUGDbss0Drq+iQR3VpqIALKoF3gvJiOvzY+w8uD72u 6/JQ== X-Gm-Message-State: ALoCoQkiykkGFeH1lfXm7vihy8LJiyOFLypyI3EjDqv801rhYhafKJj+R+fHVKl+D4aQEeB0EFkr X-Received: by 10.236.87.73 with SMTP id x49mr883582yhe.30.1398343157676; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.51 with SMTP id w48ls824583qgd.6.gmail; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) X-Received: by 10.58.49.10 with SMTP id q10mr1069946ven.5.1398343157567; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id y16si884134vct.102.2014.04.24.05.39.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 05:39:17 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so2789394vcb.26 for ; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) X-Received: by 10.220.167.2 with SMTP id o2mr1124767vcy.8.1398343157172; Thu, 24 Apr 2014 05:39:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp12619vcb; Thu, 24 Apr 2014 05:39:16 -0700 (PDT) X-Received: by 10.68.204.162 with SMTP id kz2mr2975212pbc.13.1398343156331; Thu, 24 Apr 2014 05:39:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dg5si2616837pbc.179.2014.04.24.05.39.15; Thu, 24 Apr 2014 05:39:15 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755970AbaDXMjG (ORCPT + 27 others); Thu, 24 Apr 2014 08:39:06 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:46960 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757284AbaDXMhN (ORCPT ); Thu, 24 Apr 2014 08:37:13 -0400 Received: by mail-we0-f170.google.com with SMTP id w61so2206010wes.29 for ; Thu, 24 Apr 2014 05:37:12 -0700 (PDT) X-Received: by 10.194.242.4 with SMTP id wm4mr137685wjc.88.1398343032262; Thu, 24 Apr 2014 05:37:12 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by mx.google.com with ESMTPSA id y20sm35144777wiv.14.2014.04.24.05.37.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 05:37:11 -0700 (PDT) From: Peter Griffin To: linux-kernel@vger.kernel.org Cc: linaro-kernel@lists.linaro.org, Arnd Bergmann , Peter Griffin , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH 13/13] video: omap: allow building on !MMU Date: Thu, 24 Apr 2014 13:28:29 +0100 Message-Id: <1398342509-10243-14-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398342509-10243-1-git-send-email-peter.griffin@linaro.org> References: <1398342509-10243-1-git-send-email-peter.griffin@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Arnd Bergmann The omap lcdc driver has an elaborate mmap_kern function to map the frame buffer into kernel address space as write-combined. This uses functions that are only available on MMU-enabled builds. It does seem equivalent to ioremap_wc though, so we should be able to just use that instead. This patch is build-tested only, it needs to be run on real hardware before applying. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Griffin Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: linux-fbdev@vger.kernel.org Cc: linux-omap@vger.kernel.org --- drivers/video/fbdev/omap/lcdc.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index b52f625..40e8200 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c @@ -613,29 +613,11 @@ static void lcdc_dma_handler(u16 status, void *data) static int mmap_kern(void) { - struct vm_struct *kvma; - struct vm_area_struct vma; - pgprot_t pgprot; - unsigned long vaddr; - - kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP); - if (kvma == NULL) { - dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n"); + void __iomem *vaddr; + + vaddr = ioremap_wc(lcdc.vram_phys, lcdc.vram_size); + if (!vaddr) return -ENOMEM; - } - vma.vm_mm = &init_mm; - - vaddr = (unsigned long)kvma->addr; - vma.vm_start = vaddr; - vma.vm_end = vaddr + lcdc.vram_size; - - pgprot = pgprot_writecombine(pgprot_kernel); - if (io_remap_pfn_range(&vma, vaddr, - lcdc.vram_phys >> PAGE_SHIFT, - lcdc.vram_size, pgprot) < 0) { - dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n"); - return -EAGAIN; - } lcdc.vram_virt = (void *)vaddr; @@ -644,7 +626,7 @@ static int mmap_kern(void) static void unmap_kern(void) { - vunmap(lcdc.vram_virt); + iounmap(lcdc.vram_virt); } static int alloc_palette_ram(void)