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: 4050551 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A08E79F1F4 for ; Thu, 24 Apr 2014 12:39:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C427C202F8 for ; Thu, 24 Apr 2014 12:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE5C620304 for ; Thu, 24 Apr 2014 12:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbaDXMjC (ORCPT ); Thu, 24 Apr 2014 08:39:02 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:62248 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757283AbaDXMhN (ORCPT ); Thu, 24 Apr 2014 08:37:13 -0400 Received: by mail-wg0-f51.google.com with SMTP id z12so963949wgg.34 for ; Thu, 24 Apr 2014 05:37:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bz5EhzWlYiH+lH7PVQF6XIsouQBeM9hhUWr2CxNP1Zk=; b=NPcseRRzvsw6s2ann5CeF/Z/jrd0LFL/suz3QdAJD8aXBcbipDlfyfml0xvkTq+hx2 SK3EhX5w1DIooLF66kiklM+T+LEi4yBV77x+KHudr/HE7Ii5EGGKlIZ3AHYO2n4Eo9Bb SFVvK2qtWKI/Dl5OtloZMG7hCVuXm4ZiZcjDLOceoCHhXfwTZNvPs5uvZTZiF2bjnRpn 2AYXSVneZkZJHWmfS3l5B9kYnLIH8FgKqzRsqB+aBHJ44eNB8FUtRudhmDt5P2z28Dhf EZWfqdDD9GNI/eHvE2nWb2l5i6dTBjTkM8taACf6SjJ7eoJYxRWS1KgrR/J7lKsM8AmA vGDg== X-Gm-Message-State: ALoCoQlujAs0i/6dghHZzye9aFMYcwksLks7vjeVFXk801XzWGoEa4rylQjOwik4+b1/IVa9GHpV 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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)