Skip to contentSkip to conversation

rapidio: adding memory mapping IO support and misc fixes

PATCH Jan Neskudla 3 participants 5 messages May 7, 2009 – May 8, 2009

lore
Share & tools
lore
#0 lore raw

Hallo,

I tested your patches, and the MMIO is working when enabled in the rionet driver. Only the compilation of rionet as modules was a problem. I had to add following lines into rio.c to export missing symbols.

EXPORT_SYMBOL_GPL(rio_unmap_inb_region);
EXPORT_SYMBOL_GPL(rio_map_inb_region);
EXPORT_SYMBOL_GPL(rio_unmap_outb_region);
EXPORT_SYMBOL_GPL(rio_map_outb_region);

And one more think, when I enabled usage of DMA, rionet does not compile too, but in this case I do not have a fix. I tested this on kernel 2.6.29.1 and EP8548 as target board.

Jan

Quoted 7 lines

The patch series add MMIO support to Linux rapidio and fix a few nits. The patches cross rapidio, netdev, powerpc sub-systems. It will be good for them to go through one tree. Probably Andrew? As the previous rapidio patches are mostly merged by you.

- Leo

#1 lore raw
Quoted 3 lines · Jan Neskudla

And one more think, when I enabled usage of DMA, rionet does not compile too, but in this case I do not have a fix. I tested this on kernel 2.6.29.1 and EP8548 as target board.

What exactly do you mean by that? What CONFIG options cause compile failure? Can you post the compiler error.

- k

#2 lore raw
Quoted 8 lines · ext Kumar Gala
Quoted 5 lines · Jan Neskudla

And one more think, when I enabled usage of DMA, rionet does not compile too,
but in this case I do not have a fix. I tested this on kernel 2.6.29.1 and
EP8548 as target board.

Quoted 4 lines

What exactly do you mean by that? What CONFIG options cause compile failure? Can you post the compiler error.

- k

The problem is with the missing stucture dma_client in the kernel tree sources. It looks to me that a dma model changed after 2.6 .28. Here are the details.

I used a pristine kernel 2.6.29 + patch 2.6.29.1 than Leo's patches in this order.

rio-warn_unused_result-warnings-fix.patch rionet-add-memory-access-to-simulated-Ethernet-over-rapidio.patch powerpc-add-memory-map-support-to-Freescale-RapioIO-block.patch powerpc-fsl_rio-use-LAW-address-from-device-tree.patch rapidio-add-common-mapping-APIs-for-RapidIO-memory-access.patch

Important CONFIG options are:
PPC_86xx=y
HPC8641_HPCN=y
RAPIDIO=y
DMADEVICES=y
FSL_DMA=y !!
NETDEVICES=y
RIONET=y/m
RIONET_MEMMAP=y
RIONET_DMA=y !!

And the error during compilation:

CC drivers/net/rionet.o
drivers/net/rionet.c:110: error: field `rio_dma_client' has incomplete type
drivers/net/rionet.c: In function `rio_send_mem':
drivers/net/rionet.c:239: error: parse error before "rnet" drivers/net/rionet.c: At top level:
drivers/net/rionet.c:514: warning: "enum dma_state" declared inside parameter list
drivers/net/rionet.c:514: warning: its scope is only this definition or declaration, which is probably not what you want drivers/net/rionet.c:515: error: parameter state' has incomplete type drivers/net/rionet.c:515: error: return type is an incomplete type drivers/net/rionet.c: In function rionet_dma_event':
drivers/net/rionet.c:516: warning: type defaults to int' in declaration of __mptr'
drivers/net/rionet.c:516: warning: initialization from incompatible pointer type
drivers/net/rionet.c:518: error: variable `ack' has initializer but incomplete type
drivers/net/rionet.c:518: error: `DMA_DUP' undeclared (first use in this function)
drivers/net/rionet.c:518: error: (Each undeclared identifier is reported only once
drivers/net/rionet.c:518: error: for each function it appears in.) drivers/net/rionet.c:518: error: storage size of 'ack' isn't known drivers/net/rionet.c:522: error: `DMA_RESOURCE_AVAILABLE' undeclared (first use in this function)
drivers/net/rionet.c:524: error: `DMA_ACK' undeclared (first use in this function)
drivers/net/rionet.c:531: error: `DMA_RESOURCE_REMOVED' undeclared (first use in this function)
drivers/net/rionet.c:544: warning: `return' with a value, in function returning void
drivers/net/rionet.c:518: warning: unused variable ack' drivers/net/rionet.c: In function rionet_dma_register':
drivers/net/rionet.c:553: error: implicit declaration of function `dma_async_client_register'
drivers/net/rionet.c:554: error: implicit declaration of function `dma_async_client_chan_request'
drivers/net/rionet.c: In function `rionet_close':
drivers/net/rionet.c:731: error: implicit declaration of function `dma_async_client_unregister'
make[2]: *** [drivers/net/rionet.o] Error 1

Jan

#3 lore raw

Hi Jan,

On Friday 08 May 2009 12:06:35 Jan Neskudla wrote:
[SNIPSNAP]

Quoted 3 lines

Important CONFIG options are:
PPC_86xx=y
HPC8641_HPCN=y

you're using a e500 board (EP8548A), but the options above will be used when building a kernel for a e600 machine (MPC8641). Are you sure that is okay?

- Gerhard

Signature · 3 lines
Gerhard Jaeger <[email protected]>            
SYSGO AG                                Embedding Innovations
www.sysgo.com | www.elinos.com | www.pikeos.com | www.osek.de 
#4 lore raw

Hi Gerhard,

Yes I am sure, I know I chosen a different board than I use. I wanted to show that this compilation problem is not influenced by our e500 patches. So I did the test on the pristine 2.6.29.1 kernel without any external patches applied, and the problem is exactly the same when the rionet is compiled for E500 with our patches.

And anyway the dma_client structure is defined in the 2.6.28, but not in the 2.6.29, so it looks to me that a rionet dma support is written for older kernel.

Here is the Linus tree and async_tx tree merge tree months ago and info is:
dmaengine: kill struct dma_client and supporting infrastructure

http://git.kernel.org/?
p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9e8a3a5b8298a3c814ed37ac5756e6f67b6be41

Jan

Quoted 13 lines · ext Gerhard Jaeger

Hi Jan,

On Friday 08 May 2009 12:06:35 Jan Neskudla wrote:
[SNIPSNAP]

Quoted 3 lines

Important CONFIG options are:
PPC_86xx=y
HPC8641_HPCN=y

you're using a e500 board (EP8548A), but the options above will be used when building a kernel for a e600 machine (MPC8641). Are you sure that is okay?

- Gerhard