From patchwork Wed Feb 10 11:17:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 78397 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1ABOKuI005648 for ; Wed, 10 Feb 2010 11:24:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754857Ab0BJLYU (ORCPT ); Wed, 10 Feb 2010 06:24:20 -0500 Received: from mail-gx0-f224.google.com ([209.85.217.224]:55441 "EHLO mail-gx0-f224.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644Ab0BJLYT (ORCPT ); Wed, 10 Feb 2010 06:24:19 -0500 Received: by gxk24 with SMTP id 24so2684967gxk.1 for ; Wed, 10 Feb 2010 03:24:18 -0800 (PST) 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=cxvuvF6BPG1q5TXomQz8ecoOTL5uqgndTnkYjXV60Kc=; b=acjZER3iTiBGgcrTHnKM6SQJvLNvArOY6ePdoDlEV1fRBMtoO4+vgrdvxaaxfo9ScA a2+rpkoBUSzO3jrhbpDtU/LhN4rDp5gXnr9SynL+u02FVphlyNdlT86eUWg0MUkve9qk 3Z47cDHCxP1YLVHK9XwX2DRip8p+5kGXLSS0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=NNoHGlXP4nYVqSM3Krf2eVhGEMfo/+UPawb3az/G4t8OinQ/BfevfqMByeaFiIysIQ coneZGvO71xKk+yV6qx77RZRdfvxi4LJpBcdKej2RfWOMddyYl9Y8pm/Y5mQqcgqSm1x DkBLlbevvqaQHNNEj+DrwsqB+bO5Wcf9ug2PA= Received: by 10.91.9.3 with SMTP id m3mr1447617agi.35.1265801058657; Wed, 10 Feb 2010 03:24:18 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 16sm749454gxk.15.2010.02.10.03.24.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Feb 2010 03:24:18 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 10 Feb 2010 20:17:39 +0900 Message-Id: <20100210111739.11145.92334.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: extend INTC with optional ioremap() support Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 10 Feb 2010 11:24:20 +0000 (UTC) --- 0006/drivers/sh/intc.c +++ work/drivers/sh/intc.c 2010-02-10 19:31:14.000000000 +0900 @@ -45,6 +45,8 @@ struct intc_handle_int { struct intc_desc_int { struct list_head list; + unsigned long virt_base; + unsigned long phys_base; struct sys_device sysdev; pm_message_t state; unsigned long *reg; @@ -425,6 +427,9 @@ static unsigned int __init intc_get_reg( { unsigned int k; + address -= d->phys_base; + address += d->virt_base; + for (k = 0; k < d->nr_reg; k++) { if (d->reg[k] == address) return k; @@ -774,6 +779,9 @@ static unsigned int __init save_reg(stru unsigned int smp) { if (value) { + value -= d->phys_base; + value += d->virt_base; + d->reg[cnt] = value; #ifdef CONFIG_SMP d->smp[cnt] = smp; @@ -800,6 +808,12 @@ void __init register_intc_controller(str INIT_LIST_HEAD(&d->list); list_add(&d->list, &intc_list); + if (desc->io_window) { + d->phys_base = desc->io_window->start; + d->virt_base = (unsigned long)ioremap_nocache(d->phys_base, + resource_size(desc->io_window)); + } + d->nr_reg = hw->mask_regs ? hw->nr_mask_regs * 2 : 0; d->nr_reg += hw->prio_regs ? hw->nr_prio_regs * 2 : 0; d->nr_reg += hw->sense_regs ? hw->nr_sense_regs : 0; --- 0006/include/linux/sh_intc.h +++ work/include/linux/sh_intc.h 2010-02-10 19:31:14.000000000 +0900 @@ -1,6 +1,8 @@ #ifndef __SH_INTC_H #define __SH_INTC_H +#include + typedef unsigned char intc_enum; struct intc_vect { @@ -71,6 +73,7 @@ struct intc_hw_desc { struct intc_desc { char *name; + struct resource *io_window; intc_enum force_enable; struct intc_hw_desc hw; };