rapidio: add RapidIO space allocation bitmap arithmetic
PATCH 18/24 rapidio: add RapidIO space allocation bitmap arithmetic
From: Zhang Wei <[email protected]>
The bitmap is the simplest RapidIO space allocation arithmetic. It uses the fixed size space for each RapidIO device in the inter-connection network.
Signed-off-by Zhang Wei <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/powerpc/sysdev/fsl_rio.c | 11 drivers/rapidio/Kconfig | 2 drivers/rapidio/Makefile | 1 drivers/rapidio/rio.c | 1 drivers/rapidio/sallocator/Kconfig | 9 drivers/rapidio/sallocator/Makefile | 12 drivers/rapidio/sallocator/bitmap.c | 384 ++++++++++++++++++++++++++ include/linux/rio.h | 6 8 files changed, 425 insertions(+), 1 deletion(-)
arch/powerpc/sysdev/fsl_rio.c renamed from arch/powerpc/sysdev/fsl_rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic +11 -0
@@ -920,6 +920,17 @@ static int fsl_rio_doorbell_init(structreturn rc; } +u32 rio_get_mport_id (struct rio_mport *mport) +{ +u32 mport_id; + +rio_local_read_config_32 (mport,0x60 , &mport_id); + mport_id = mport->sys_size ? (mport_id &0xffff ) : + ((mport_id >>16 ) &0xff ); +return mport_id; + +} +static char *cmdline =NULL ;static int fsl_rio_get_hdid (int index)
drivers/rapidio/Kconfig renamed from drivers/rapidio/Kconfig~rapidio-add-rapidio-space-allocation-bitmap-arithmetic +2 -0
@@ -8,3 +8,5 @@ config RAPIDIO_DISC_TIMEOUT ---help--- Amount of time a discovery node waits for a host to complete enumeration before giving up. + +source "drivers/rapidio/sallocator/Kconfig"
drivers/rapidio/Makefile renamed from drivers/rapidio/Makefile~rapidio-add-rapidio-space-allocation-bitmap-arithmetic +1 -0
@@ -4,3 +4,4 @@ obj-y += rio.o rio-access.o rio-driver.o rio-scan.o rio-sysfs.o obj-$(CONFIG_RAPIDIO) += switches/ +obj-$(CONFIG_RAPIDIO) += sallocator/
drivers/rapidio/rio.c renamed from drivers/rapidio/rio.c~rapidio-add-rapidio-space-allocation-bitmap-arithmetic +1 -0
@@ -849,6 +849,7 @@ int rio_init_mports(void)rio_enum_mport (port); elserio_disc_mport (port ); +rio_space_init (port); } out:
drivers/rapidio/sallocator/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +choice + prompt "Default RapidIO Space Allocator" + depends on RAPIDIO + default RIO_SA_DEFAULT_BITMAP + + config RIO_SA_DEFAULT_BITMAP + bool "Bitmap" + +endchoice
drivers/rapidio/sallocator/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. +# +# Author: Zhang Wei, [email protected], Jun 2007 +# +# This is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# + +obj-$(CONFIG_RIO_SA_DEFAULT_BITMAP) += bitmap.o
drivers/rapidio/sallocator/bitmap.c new file +384 -0
384 lines not on this page · raw message
include/linux/rio.h renamed from include/linux/rio.h~rapidio-add-rapidio-space-allocation-bitmap-arithmetic +5 -1
@@ -60,11 +60,15 @@* * 0 RapidIO inbound doorbells * 1 RapidIO inbound mailboxes -* 1 RapidIO outbound mailboxes +* 2 RapidIO outbound mailboxes +* 3 RapidIO inbound memory +* 4 RapidIO outbound memory */ #define RIO_DOORBELL_RESOURCE 0#define RIO_INB_MBOX_RESOURCE 1#define RIO_OUTB_MBOX_RESOURCE 2 +#define RIO_INB_MEM_RESOURCE 3 +#define RIO_OUTB_MEM_RESOURCE 4extern struct bus_type rio_bus_type;extern struct list_head rio_devices;/* list of all devices */
_