diff options
author | Jens Taprogge <jens.taprogge@taprogge.org> | 2012-09-13 10:32:19 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 03:21:38 (GMT) |
commit | e4af9497b65a8245ad7ef756d5f698e78db6e11c (patch) | |
tree | 2b680d382e041c69db57612279383be854bd9eb1 | |
parent | 7505817603854506732affb584ef6568a4702d6f (diff) | |
download | linux-e4af9497b65a8245ad7ef756d5f698e78db6e11c.tar.xz |
Staging: ipack: Add IPACK_INT_SPACE memory space.
This will allow us to correctly access the IPack INT space.
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.c | 29 | ||||
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.h | 2 | ||||
-rw-r--r-- | drivers/staging/ipack/ipack.h | 2 |
3 files changed, 33 insertions, 0 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c index 21b2b75..3462783 100644 --- a/drivers/staging/ipack/bridges/tpci200.c +++ b/drivers/staging/ipack/bridges/tpci200.c @@ -95,6 +95,8 @@ static void tpci200_unregister(struct tpci200_board *tpci200) tpci200->slots[i].io_phys.size = 0; tpci200->slots[i].id_phys.address = NULL; tpci200->slots[i].id_phys.size = 0; + tpci200->slots[i].int_phys.address = NULL; + tpci200->slots[i].int_phys.size = 0; tpci200->slots[i].mem_phys.address = NULL; tpci200->slots[i].mem_phys.size = 0; } @@ -331,6 +333,11 @@ static int tpci200_register(struct tpci200_board *tpci200) TPCI200_ID_SPACE_OFF + TPCI200_ID_SPACE_GAP*i; tpci200->slots[i].id_phys.size = TPCI200_ID_SPACE_SIZE; + tpci200->slots[i].int_phys.address = + (void __iomem *)ioidint_base + + TPCI200_INT_SPACE_OFF + TPCI200_INT_SPACE_GAP * i; + tpci200->slots[i].int_phys.size = TPCI200_INT_SPACE_SIZE; + tpci200->slots[i].mem_phys.address = (void __iomem *)mem_base + TPCI200_MEM8_GAP*i; tpci200->slots[i].mem_phys.size = TPCI200_MEM8_SIZE; @@ -391,6 +398,15 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space) } virt_addr_space = &dev->id_space; break; + case IPACK_INT_SPACE: + if (dev->int_space.address == NULL) { + dev_info(&dev->dev, + "Slot [%d:%d] INT space not mapped !\n", + dev->bus_nr, dev->slot); + goto out_unlock; + } + virt_addr_space = &dev->int_space; + break; case IPACK_MEM_SPACE: if (dev->mem_space.address == NULL) { dev_info(&dev->dev, @@ -460,6 +476,19 @@ static int tpci200_slot_map_space(struct ipack_device *dev, phys_address = tpci200->slots[dev->slot].id_phys.address; size_to_map = tpci200->slots[dev->slot].id_phys.size; break; + case IPACK_INT_SPACE: + if (dev->int_space.address != NULL) { + dev_err(&dev->dev, + "Slot [%d:%d] INT space already mapped !\n", + tpci200->number, dev->slot); + res = -EINVAL; + goto out_unlock; + } + virt_addr_space = &dev->int_space; + + phys_address = tpci200->slots[dev->slot].int_phys.address; + size_to_map = tpci200->slots[dev->slot].int_phys.size; + break; case IPACK_MEM_SPACE: if (dev->mem_space.address != NULL) { dev_err(&dev->dev, diff --git a/drivers/staging/ipack/bridges/tpci200.h b/drivers/staging/ipack/bridges/tpci200.h index e1f60f3..235d1fe 100644 --- a/drivers/staging/ipack/bridges/tpci200.h +++ b/drivers/staging/ipack/bridges/tpci200.h @@ -132,6 +132,7 @@ struct slot_irq { * @irq Slot IRQ infos * @io_phys IO physical base address register of the slot * @id_phys ID physical base address register of the slot + * @int_phys INT physical base address register of the slot * @mem_phys MEM physical base address register of the slot * */ @@ -139,6 +140,7 @@ struct tpci200_slot { struct slot_irq *irq; struct ipack_addr_space io_phys; struct ipack_addr_space id_phys; + struct ipack_addr_space int_phys; struct ipack_addr_space mem_phys; }; diff --git a/drivers/staging/ipack/ipack.h b/drivers/staging/ipack/ipack.h index 9c3079d..f8405df 100644 --- a/drivers/staging/ipack/ipack.h +++ b/drivers/staging/ipack/ipack.h @@ -35,6 +35,7 @@ enum ipack_space { IPACK_IO_SPACE = 0, IPACK_ID_SPACE = 1, IPACK_MEM_SPACE = 2, + IPACK_INT_SPACE, }; /** @@ -71,6 +72,7 @@ struct ipack_device { struct ipack_bus_device *bus; struct ipack_addr_space id_space; struct ipack_addr_space io_space; + struct ipack_addr_space int_space; struct ipack_addr_space mem_space; struct device dev; u8 *id; |