Skip to contentSkip to conversation

System ACE MPU interface to CF card

DISCUSSION Sharad Gupta 5 participants 12 messages Apr 7, 2004 – Apr 20, 2004 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi All,

I would like to know if anyone in the group or otherwise is/was using Xilinx's System ACE MPU interface to read/write to Compact Flash card on their hardware ? I see that there is a device driver provided by Xilinx for system ace mpu bus in the linux kernel tree (2.4.23). But, I dont see anyone actually implementing it in their design.

It will be nice to follow someone's footsteps if it has already been implemented before. Else, please direct me to appropriate resources about how to go about using it in my design.

Thanks
Sharad.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 8 lines · Sharad Gupta sharad-at-buckeye.ece.drexel.edu |PPC Linux Embedded| wrote:

Hi All,

I would like to know if anyone in the group or otherwise is/was using Xilinx's System ACE MPU interface to read/write to Compact Flash card on their hardware ? I see that there is a device driver provided by Xilinx for system ace mpu bus in the linux kernel tree (2.4.23). But, I dont see anyone actually implementing it in their design.

That would be me. I haven't yet submitted patches for my JSE board, but if you look back to the last few weeks in this list, you'll see plenty of messages with SystemACE in their subject.

Including a patch on 1 April 2004 to generalize the driver a bit. MonteVista folks have approved the patch, so I hope it turns up inofficial trees in due course.

--

Steve Williams                "The woods are lovely, dark and deep.
steve at XXXXXXXXXX           But I have promises to keep,
http://www.XXXXXXXXXX         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 11 lines · Stephen Williams
Quoted 8 lines · Sharad Gupta sharad-at-buckeye.ece.drexel.edu |PPC Linux Embedded| wrote:

Hi All,

I would like to know if anyone in the group or otherwise is/was using Xilinx's System ACE MPU interface to read/write to Compact Flash card on their hardware ? I see that there is a device driver provided by Xilinx for system ace mpu bus in the linux kernel tree (2.4.23). But, I dont see anyone actually implementing it in their design.

Quoted 7 lines

That would be me. I haven't yet submitted patches for my JSE board, but if you look back to the last few weeks in this list, you'll see plenty of messages with SystemACE in their subject.

Including a patch on 1 April 2004 to generalize the driver a bit. MonteVista folks have approved the patch, so I hope it turns up inofficial trees in due course.

The previous message reminded me that I still hadn't pushed that patch, so I did that a few hours ago (and it should show up on the commit list in due course).

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 3 lines · Sharad Gupta sharad-at-buckeye.ece.drexel.edu |PPC Linux Embedded| wrote:

Can you send me your board patch so that I can configure and build ACE driver for my board ? I want some help in knowing how and where to customize the driver for one's board.

The attached patch demonstrates how I enabled the SYSACE driver for my (JSE) board. I'm not so sure I'm happy with it, because each board will have to do something similar. I'm thinking that the CONFIG_XILINX_SYSACE define should lose its dependence on CONFIG_XILINX_OCP, but I'm not clear on the best way to account for this in the xilinx_ocp/Makefile.

NOTE: This patch is meant to demonstrate my thinking on this matter. It's not complete.

--

Steve Williams                "The woods are lovely, dark and deep.
steve at XXXXXXXXXX           But I have promises to keep,
http://www.XXXXXXXXXX         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

Index: arch/ppc/platforms/xilinx_ocp/Makefile
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/platforms/xilinx_ocp/Makefile,v retrieving revision 1.1

ppc/platforms/xilinx_ocp/Makefile +1 -0
diff -u -r1.1 Makefile
@@ -13,6 +13,7 @@
 			   xipif_v1_23_b.o xpacket_fifo_v1_00_b.o xversion.o
 
 obj-$(CONFIG_XILINX_OCP) := xilinx_ocp.o
+obj-$(CONFIG_JSE) := xilinx_ocp.o
 
 xilinx_ocp.o: $(xilinx_ocp-objs)
 	$(LD) -r -o $@ $(xilinx_ocp-objs)

Index: arch/ppc/platforms/xilinx_ocp/xparameters.h
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/platforms/xilinx_ocp/xparameters.h,v retrieving revision 1.2

ppc/platforms/xilinx_ocp/xparameters.h +4 -0
diff -u -r1.2 xparameters.h
@@ -16,3 +16,7 @@
 #if defined(CONFIG_XILINX_ML300)
 #include "xparameters_ml300.h"
 #endif
+
+#if defined(CONFIG_JSE)
+#include "xparameters_jse.h"
+#endif

Index: drivers/block/Config.in
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/drivers/block/Config.in,v retrieving revision 1.5

block/Config.in +1 -1
diff -u -r1.5 Config.in
@@ -40,7 +40,7 @@
 dep_tristate 'Mylex DAC960/DAC1100 PCI RAID Controller support' CONFIG_BLK_DEV_DAC960 $CONFIG_PCI
 dep_tristate 'Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)' CONFIG_BLK_DEV_UMEM $CONFIG_PCI $CONFIG_EXPERIMENTAL
 
-if [ "$CONFIG_XILINX_OCP" = "y" ]; then
+if [ "$CONFIG_XILINX_OCP" = "y" -o "$CONFIG_JSE" = "y" ]; then
    tristate 'Xilinx on-chip System ACE' CONFIG_XILINX_SYSACE
 fi
 
#5 lore raw
Quoted 6 lines · Stephen Williams

The attached patch demonstrates how I enabled the SYSACE driver for my (JSE) board. I'm not so sure I'm happy with it, because each board will have to do something similar. I'm thinking that the CONFIG_XILINX_SYSACE define should lose its dependence on CONFIG_XILINX_OCP, but I'm not clear on the best way to account for this in the xilinx_ocp/Makefile.

Thanks Stephen,

Your patch helped me a lot in compiling and configuring my kernel. Just on a side note, have you been able to talk to compact flash (mount fs on it, fsck it ?) through system ace ?

My kernel hangs while doing partition check on the drive. All I ever see is

Partition check:
xsysacea:

(then nothing happens)

I am using SanDisk's 128MB CF card and system ace is configured in the byte mode. Any pointers as to why it is not going ahead will be highly appreciated.

Thanks
Sharad.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw
Quoted 8 lines · Sharad Gupta sharad-at-buckeye.ece.drexel.edu |PPC Linux Embedded| wrote:

Thanks Stephen,

Your patch helped me a lot in compiling and configuring my kernel. Just on a side note, have you been able to talk to compact flash (mount fs on it, fsck it ?) through system ace ?

My kernel hangs while doing partition check on the drive. All I ever see is

Quoted 8 lines

Partition check:
xsysacea:

(then nothing happens)

I am using SanDisk's 128MB CF card and system ace is configured in the byte mode. Any pointers as to why it is not going ahead will be highly appreciated.

Works just peachy for me, with 32M and 256M disks installed. I have most of my embedded system living on the disk (a little bit of ramdisk for root, and tmpfs for /tmp) with not a spot of trouble.

I have noticed that if the disk does not have a .ace file on it, and a Xilinx chip to program, the driver fails to get any partition info from the disk and it all fails from there. So I suspect the driver still to some degree relies on the state of the chip after a successful Xilinx load. If you are trying to use the chip without an FPGA attached, you may be running into that.
--

Steve Williams                "The woods are lovely, dark and deep.
steve at XXXXXXXXXX           But I have promises to keep,
http://www.XXXXXXXXXX         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#7 lore raw

Stephen Williams wrote:

| I have noticed that if the disk does not have a .ace file on
| it, and a Xilinx chip to program, the driver fails to get any
| partition info from the disk and it all fails from there. So
| I suspect the driver still to some degree relies on the state
| of the chip after a successful Xilinx load. If you are trying
| to use the chip without an FPGA attached, you may be running
| into that.

I am having problems with xilinx_sysace at my end. This is on a non-ML300 which is not running at anything like the same clock as the rest of you at this moment in time (for various hardware development reasons unrelated to the Linux side). I have a classic case of debugging printk code altering the rate of execution and making things work.

Otherwise we get hard lockups and corrupted CURRENT data which has all the hallmarks of a failure to re-aquire io_request_lock somewhere.

Obviously I will fix this problem soon but if anyone has already caught this nasty and fixed it then do drop me a line. The driver will need plenty of cleanup for kernel 2.6. Even then the HAL approach clearly needs to be replaced also (but I will send an update on that later).

Jon.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#8 lore raw

Jon Masters wrote:

| I am having problems with xilinx_sysace at my end. This is on a
| non-ML300 which is not running at anything like the same clock as the
| rest of you at this moment in time (for various hardware development
| reasons unrelated to the Linux side). I have a classic case of debugging
| printk code altering the rate of execution and making things work.

I received a mail offlist about this concerning the issues with an earlier revision of the xilinx_sysace driver brokenly not following the datasheet and failing to hold the device configuration controller in reset while doing transfers. I have now upgraded to a new verson.

This has fixed the ``hardware seems fairly screwed, it's not giving me interrupts when I want it! arrrgh!'' type problems but I still get random lockups and corruption of the request queue, which I think is related to a missing spinlock aquisition somewhere else.

To be honest I might soon get annoyed enough with it to rewrite it. Clearly Xilinx think it is a really good idea to have this HAL concept (and I think it is a really really bad one) - and I am one of the people that ends up using this code so really want something that works :-).

Jon.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#9 lore raw
In reply to Sharad Gupta
Quoted 10 lines · Sharad Gupta

Your patch helped me a lot in compiling and configuring my kernel. Just on a side note, have you been able to talk to compact flash (mount fs on it, fsck it ?) through system ace ?

My kernel hangs while doing partition check on the drive. All I ever see is

Partition check:
xsysacea:

(then nothing happens)

Sounds to me like you do not have your interrupts configured properly between the SystemACE and the CPU or your xsa_thread is dying prematurely.

Either way, the kernel is getting no response when it actually tries to access the CF thru the SystemACE.

Jeff Angielski
The PTR Group

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#10 lore raw
Quoted 10 lines · Jeff Angielski

Sounds to me like you do not have your interrupts configured properly between the SystemACE and the CPU or your xsa_thread is dying prematurely.

Either way, the kernel is getting no response when it actually tries to access the CF thru the SystemACE.

Jeff Angielski
The PTR Group

I do not enable interrupts between SystemACE and the CPU. Following the debug cycle:

xsysace_init()
->register_disk()
-->grok_partitions()
--->check_partition()
---->msdos_partition()
----->read_dev_sector()
------>read_cache_page()
------->lock_page()
-------->__lock_page()
--------->schedule()

And it never resumes after that. The code just goes to power_save mode. Any help would be appreciated.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#11 lore raw
Quoted 1 line · Sharad Gupta

I do not enable interrupts between SystemACE and the CPU.

Doh. It is in your best interest to get the interrupts working...

Quoted 14 lines

Following the
debug cycle:

xsysace_init()
->register_disk()
-->grok_partitions()
--->check_partition()
---->msdos_partition()
----->read_dev_sector()
------>read_cache_page()
------->lock_page()
-------->__lock_page()
--------->schedule()

Quoted 2 lines

And it never resumes after that. The code just goes to power_save mode. Any help would be appreciated.

I would suggest instrumenting the code in the driver that actually handles the block request from the kernel. For instance, is the request being received by the xsa_thread? Is the driver actually making a request to the device. And most importantly and where I suspect your problem lies, is the xsa_complete_request() ever getting run?

Jeff Angielski
The PTR Group

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#12 lore raw

more SystemACE problems

Quoted 9 lines · Jeff Angielski

On Mon, 2004-04-19 at 14:06, Sharad Gupta wrote:
I would suggest instrumenting the code in the driver that actually handles the block request from the kernel. For instance, is the request being received by the xsa_thread? Is the driver actually making a request to the device. And most importantly and where I suspect your problem lies, is the xsa_complete_request() ever getting run?

Jeff Angielski
The PTR Group

Hi Jeff,

Thanks very much for your help. I have enabled the interrupts for SystemACE now. And in fact xsa_complete_request() was never called. I fixed that in xsa_thread.

I was wondering if you could send in your modifications to the xilinx_systemace/* files so that I can know better where else the potential problems may lie.

Do I need to have a device entry for xsystemacea (0/1) in my /dev directory ? If yes, then what should it be like ?

Thanks
Sharad.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/