From patchwork Tue Oct 6 04:29:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 51859 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n964YpkH011855 for ; Tue, 6 Oct 2009 04:34:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbZJFEem (ORCPT ); Tue, 6 Oct 2009 00:34:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751000AbZJFEem (ORCPT ); Tue, 6 Oct 2009 00:34:42 -0400 Received: from mail-qy0-f173.google.com ([209.85.221.173]:44307 "EHLO mail-qy0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbZJFEel (ORCPT ); Tue, 6 Oct 2009 00:34:41 -0400 Received: by qyk3 with SMTP id 3so3154546qyk.4 for ; Mon, 05 Oct 2009 21:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=taa/ItenXLPkFEnl7Tig7yMKrPypiOwxX85zAMgypj0=; b=jUmdthJ5bs9E5LOr6QSAqXAhs+NGZi47S3i11TFJ2ZKBdei/Smdg6B2yRaQdFs6QQ9 60CWLpEOT9RHWKR/z4UpoIpGIXGYbvEoSa6ELyn/6vaCiRa/LqEkkaWNIoYysPFHfDI6 b6ZOcUq+VdTacSe4s2aRXJm28A1aP2RTNN/SQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=a7GKHZfdPFExjYbwJl7U7EsW01Gn9oAQVztlcR289clA9KQJk5KLK+HL3sgzqEm6Pl 4BAV85MwvVlGh3QErUd/90bpSiWHWJzoyozOr9DQxKjYb0Zho1IdEKlT2dTPqnxDCK06 /mEK+FtBxApad8jtw99kDsp3tUXKb+wUwlVjs= Received: by 10.224.96.88 with SMTP id g24mr836074qan.361.1254803644946; Mon, 05 Oct 2009 21:34:04 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 7sm303229qwb.16.2009.10.05.21.34.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 21:34:04 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Tue, 06 Oct 2009 13:29:21 +0900 Message-Id: <20091006042921.20412.57494.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: add uio device for physically contiguous memory Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7366.c 2009-10-02 10:19:29.000000000 +0900 @@ -88,7 +88,7 @@ static struct resource vpu_resources[] = static struct platform_device vpu_device = { .name = "uio_pdrv_genirq", - .id = 0, + .id = 1, .dev = { .platform_data = &vpu_platform_data, }, @@ -116,7 +116,7 @@ static struct resource veu0_resources[] static struct platform_device veu0_device = { .name = "uio_pdrv_genirq", - .id = 1, + .id = 2, .dev = { .platform_data = &veu0_platform_data, }, @@ -144,7 +144,7 @@ static struct resource veu1_resources[] static struct platform_device veu1_device = { .name = "uio_pdrv_genirq", - .id = 2, + .id = 3, .dev = { .platform_data = &veu1_platform_data, }, --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7722.c 2009-10-02 10:19:57.000000000 +0900 @@ -130,7 +130,7 @@ static struct resource vpu_resources[] = static struct platform_device vpu_device = { .name = "uio_pdrv_genirq", - .id = 0, + .id = 1, .dev = { .platform_data = &vpu_platform_data, }, @@ -161,7 +161,7 @@ static struct resource veu_resources[] = static struct platform_device veu_device = { .name = "uio_pdrv_genirq", - .id = 1, + .id = 2, .dev = { .platform_data = &veu_platform_data, }, @@ -192,7 +192,7 @@ static struct resource jpu_resources[] = static struct platform_device jpu_device = { .name = "uio_pdrv_genirq", - .id = 2, + .id = 3, .dev = { .platform_data = &jpu_platform_data, }, --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7723.c 2009-10-02 10:20:41.000000000 +0900 @@ -40,7 +40,7 @@ static struct resource vpu_resources[] = static struct platform_device vpu_device = { .name = "uio_pdrv_genirq", - .id = 0, + .id = 1, .dev = { .platform_data = &vpu_platform_data, }, @@ -71,7 +71,7 @@ static struct resource veu0_resources[] static struct platform_device veu0_device = { .name = "uio_pdrv_genirq", - .id = 1, + .id = 2, .dev = { .platform_data = &veu0_platform_data, }, @@ -102,7 +102,7 @@ static struct resource veu1_resources[] static struct platform_device veu1_device = { .name = "uio_pdrv_genirq", - .id = 2, + .id = 3, .dev = { .platform_data = &veu1_platform_data, }, --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7724.c 2009-10-02 10:20:20.000000000 +0900 @@ -180,7 +180,7 @@ static struct resource vpu_resources[] = static struct platform_device vpu_device = { .name = "uio_pdrv_genirq", - .id = 0, + .id = 1, .dev = { .platform_data = &vpu_platform_data, }, @@ -212,7 +212,7 @@ static struct resource veu0_resources[] static struct platform_device veu0_device = { .name = "uio_pdrv_genirq", - .id = 1, + .id = 2, .dev = { .platform_data = &veu0_platform_data, }, @@ -244,7 +244,7 @@ static struct resource veu1_resources[] static struct platform_device veu1_device = { .name = "uio_pdrv_genirq", - .id = 2, + .id = 3, .dev = { .platform_data = &veu1_platform_data, }, @@ -512,7 +512,7 @@ static struct resource jpu_resources[] = static struct platform_device jpu_device = { .name = "uio_pdrv_genirq", - .id = 3, + .id = 4, .dev = { .platform_data = &jpu_platform_data, }, --- 0001/arch/sh/kernel/cpu/shmobile/Makefile +++ work/arch/sh/kernel/cpu/shmobile/Makefile 2009-10-02 10:18:11.000000000 +0900 @@ -6,3 +6,4 @@ obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_PM_RUNTIME) += pm_runtime.o +obj-$(CONFIG_UIO_PDRV_GENIRQ) += uio_memory.o --- /dev/null +++ work/arch/sh/kernel/cpu/shmobile/uio_memory.c 2009-10-02 10:18:37.000000000 +0900 @@ -0,0 +1,42 @@ +/* + * Physical contiguous memory for UIO devices + * + * Copyright (C) 2009 Magnus Damm + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#include +#include +#include + +static struct uio_info mem_platform_data = { + .name = "uio_memory", + .version = "0", + .irq = UIO_IRQ_NONE, +}; + +static struct resource mem_resources[] = { + [0] = { + /* place holder for contiguous memory */ + }, +}; + +static struct platform_device mem_device = { + .name = "uio_pdrv_genirq", + .id = 0, + .dev = { + .platform_data = &mem_platform_data, + }, + .resource = mem_resources, + .num_resources = ARRAY_SIZE(mem_resources), +}; + +static int __init mem_devices_setup(void) +{ + platform_resource_setup_memory(&mem_device, "uio_memory", 0); + + return platform_device_register(&mem_device); +} +arch_initcall(mem_devices_setup);