* Setting up Silicon image 3114 in DMA mode @ 2010-06-25 8:25 amruth pattanada 2010-06-26 4:13 ` Robert Hancock 0 siblings, 1 reply; 5+ messages in thread From: amruth pattanada @ 2010-06-25 8:25 UTC (permalink / raw) To: jeff, Andrew Morton, Linus Torvalds, linux-ide, LKML Hi Can anybody please guide me what minimal steps to follow for setting up 3114 for operating in DMA mode and looked into linux 2.6.32.7 code. I am porting 3114 driver to RTOS but have problems in using BAR5 PCI config space because of Memory mapped region issues. I can access BAR4 and plan to set up DMA mode. How do we access entire BAR5 memory space without using BAR5, is there any indirect way to access BAR5 using BAR4. Please let me know. Thanks Amruth p.v Sr.Embedded Engineer ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Setting up Silicon image 3114 in DMA mode 2010-06-25 8:25 Setting up Silicon image 3114 in DMA mode amruth pattanada @ 2010-06-26 4:13 ` Robert Hancock 2010-06-26 15:06 ` amruth pattanada 0 siblings, 1 reply; 5+ messages in thread From: Robert Hancock @ 2010-06-26 4:13 UTC (permalink / raw) To: amruth pattanada; +Cc: linux-ide, LKML On 06/25/2010 02:25 AM, amruth pattanada wrote: > Hi > Can anybody please guide me what minimal steps to follow for setting > up 3114 for operating in DMA mode and looked into linux 2.6.32.7 code. > I am porting 3114 driver to RTOS but have problems in using BAR5 PCI > config space because of Memory mapped region issues. I can access BAR4 > and plan to set up DMA mode. > How do we access entire BAR5 memory space without using BAR5, is there > any indirect way to access BAR5 using BAR4. Please let me know. > Thanks > Amruth p.v > Sr.Embedded Engineer See the datasheet (PCI Configuration Space section), there's a way to access BAR5 registers using indirect access registers in configuration space. I expect this will be relatively slow, however. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Setting up Silicon image 3114 in DMA mode 2010-06-26 4:13 ` Robert Hancock @ 2010-06-26 15:06 ` amruth pattanada 2010-06-30 12:30 ` amruth pattanada 0 siblings, 1 reply; 5+ messages in thread From: amruth pattanada @ 2010-06-26 15:06 UTC (permalink / raw) To: Robert Hancock; +Cc: linux-ide, LKML Thanks for the info Robert. I checked the code for open solaris and see the following below. It basically uses BAR5 indirect access method. /* Base Register 5 Indirect Address Offset */ #define PCI_CONF_BA5_IND_ADDRESS 0xc0 #define PCI_CONF_BA5_IND_ACCESS 0xc4 #define PUT_BAR5_INDIRECT(handle, address, value) \ {\ pci_config_put32(handle, PCI_CONF_BA5_IND_ADDRESS, address); \ pci_config_put32(handle, PCI_CONF_BA5_IND_ACCESS, value); \ } #define GET_BAR5_INDIRECT(handle, address, rval) \ {\ pci_config_put32(handle, PCI_CONF_BA5_IND_ADDRESS, address); \ rval = pci_config_get32(handle, PCI_CONF_BA5_IND_ACCESS); \ } /* * The following BAR5 registers are accessed via an indirect register * in the PCI configuration space rather than mapping BAR5. */ for (i = 0; i < ports; i++) { GET_BAR5_INDIRECT(pci_conf_handle, fifocntctl[i], fifo_cnt_ctl); fifo_cnt_ctl = (fifo_cnt_ctl & ~0x7) | (frrc & 0x7); PUT_BAR5_INDIRECT(pci_conf_handle, fifocntctl[i], fifo_cnt_ctl); /* * Correct default setting for FIS0cfg */ #ifdef DEBUG GET_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], sfiscfg_val); ADBG_WARN(("sil3xxx_init_controller: old val SFISCfg " "ch%d: %x\n", i, sfiscfg_val)); #endif PUT_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], SFISCFG_ERRATA); #ifdef DEBUG GET_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], sfiscfg_val); ADBG_WARN(("sil3xxx_init_controller: new val SFISCfg " "ch%d: %x\n", i, sfiscfg_val)); #endif I need to setup DMA transfer mode for silicon image 3114 chipset for dma write/read operation.Where can I find the initialisation steps for DMA in libata(Programming Bus Master Registers,setup PRD table and Issue ATA commands). Do we have any sample implementation in libata. Please let me know. Thanks Amruth p.v Sr.Embedded Engineer On Sat, Jun 26, 2010 at 9:43 AM, Robert Hancock <hancockrwd@gmail.com> wrote: > On 06/25/2010 02:25 AM, amruth pattanada wrote: >> >> Hi >> Can anybody please guide me what minimal steps to follow for setting >> up 3114 for operating in DMA mode and looked into linux 2.6.32.7 code. >> I am porting 3114 driver to RTOS but have problems in using BAR5 PCI >> config space because of Memory mapped region issues. I can access BAR4 >> and plan to set up DMA mode. >> How do we access entire BAR5 memory space without using BAR5, is there >> any indirect way to access BAR5 using BAR4. Please let me know. >> Thanks >> Amruth p.v >> Sr.Embedded Engineer > > See the datasheet (PCI Configuration Space section), there's a way to access > BAR5 registers using indirect access registers in configuration space. I > expect this will be relatively slow, however. > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Setting up Silicon image 3114 in DMA mode 2010-06-26 15:06 ` amruth pattanada @ 2010-06-30 12:30 ` amruth pattanada 2010-07-01 0:33 ` Jeff Garzik 0 siblings, 1 reply; 5+ messages in thread From: amruth pattanada @ 2010-06-30 12:30 UTC (permalink / raw) To: Robert Hancock; +Cc: linux-ide, LKML Hi I need some clarification regarding read DMA data from silicon image controller. How do know that DMA transfer happened and where to look for the data after the transfer. Should we look at BAR2 channel X Task file register data word or look into allocated DMA buffer which is specified in the PRD table. I am reading 0x00 in the PRD table scatter gather list and it hangs in the when I tried to read data word of channel task file register. Please let me know how to read data buffer after the DMA is complete. Thanks Amruth p.v On Sat, Jun 26, 2010 at 8:36 PM, amruth pattanada <amruth.vamadev@gmail.com> wrote: > Thanks for the info Robert. I checked the code for open solaris and > see the following below. It basically uses BAR5 indirect access > method. > > /* Base Register 5 Indirect Address Offset */ > > #define PCI_CONF_BA5_IND_ADDRESS 0xc0 > #define PCI_CONF_BA5_IND_ACCESS 0xc4 > > #define PUT_BAR5_INDIRECT(handle, address, value) \ > {\ > pci_config_put32(handle, PCI_CONF_BA5_IND_ADDRESS, address); \ > pci_config_put32(handle, PCI_CONF_BA5_IND_ACCESS, value); \ > } > > #define GET_BAR5_INDIRECT(handle, address, rval) \ > {\ > pci_config_put32(handle, PCI_CONF_BA5_IND_ADDRESS, address); \ > rval = pci_config_get32(handle, PCI_CONF_BA5_IND_ACCESS); \ > } > > /* > * The following BAR5 registers are accessed via an indirect register > * in the PCI configuration space rather than mapping BAR5. > */ > for (i = 0; i < ports; i++) { > GET_BAR5_INDIRECT(pci_conf_handle, fifocntctl[i], > fifo_cnt_ctl); > fifo_cnt_ctl = (fifo_cnt_ctl & ~0x7) | (frrc & 0x7); > PUT_BAR5_INDIRECT(pci_conf_handle, fifocntctl[i], > fifo_cnt_ctl); > /* > * Correct default setting for FIS0cfg > */ > #ifdef DEBUG > GET_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], > sfiscfg_val); > ADBG_WARN(("sil3xxx_init_controller: old val SFISCfg " > "ch%d: %x\n", i, sfiscfg_val)); > #endif > PUT_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], > SFISCFG_ERRATA); > #ifdef DEBUG > GET_BAR5_INDIRECT(pci_conf_handle, sfiscfg[i], > sfiscfg_val); > ADBG_WARN(("sil3xxx_init_controller: new val SFISCfg " > "ch%d: %x\n", i, sfiscfg_val)); > #endif > > I need to setup DMA transfer mode for silicon image 3114 chipset for > dma write/read operation.Where can I find the initialisation steps for > DMA in libata(Programming Bus Master Registers,setup PRD table and > Issue ATA commands). Do we have any sample implementation in libata. > Please let me know. > Thanks > Amruth p.v > Sr.Embedded Engineer > On Sat, Jun 26, 2010 at 9:43 AM, Robert Hancock <hancockrwd@gmail.com> wrote: >> On 06/25/2010 02:25 AM, amruth pattanada wrote: >>> >>> Hi >>> Can anybody please guide me what minimal steps to follow for setting >>> up 3114 for operating in DMA mode and looked into linux 2.6.32.7 code. >>> I am porting 3114 driver to RTOS but have problems in using BAR5 PCI >>> config space because of Memory mapped region issues. I can access BAR4 >>> and plan to set up DMA mode. >>> How do we access entire BAR5 memory space without using BAR5, is there >>> any indirect way to access BAR5 using BAR4. Please let me know. >>> Thanks >>> Amruth p.v >>> Sr.Embedded Engineer >> >> See the datasheet (PCI Configuration Space section), there's a way to access >> BAR5 registers using indirect access registers in configuration space. I >> expect this will be relatively slow, however. >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Setting up Silicon image 3114 in DMA mode 2010-06-30 12:30 ` amruth pattanada @ 2010-07-01 0:33 ` Jeff Garzik 0 siblings, 0 replies; 5+ messages in thread From: Jeff Garzik @ 2010-07-01 0:33 UTC (permalink / raw) To: amruth pattanada; +Cc: Robert Hancock, linux-ide, LKML On 06/30/2010 08:30 AM, amruth pattanada wrote: > Hi > I need some clarification regarding read DMA data from silicon image > controller. How do know that DMA transfer happened and where to look > for the data after the transfer. Should we look at BAR2 channel X Task > file register data word or look into allocated DMA buffer which is > specified in the PRD table. I am reading 0x00 in the PRD table scatter > gather list and it hangs in the when I tried to read data word of > channel task file register. Please let me know how to read data buffer > after the DMA is complete. Teaching you how to write a non-Linux driver is outside the scope of linux-ide and linux-kernel. This information is covered by the freely available Silicon Image documentation, and SiI support should be able to assist you further beyond that. Jeff ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-01 0:33 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-06-25 8:25 Setting up Silicon image 3114 in DMA mode amruth pattanada 2010-06-26 4:13 ` Robert Hancock 2010-06-26 15:06 ` amruth pattanada 2010-06-30 12:30 ` amruth pattanada 2010-07-01 0:33 ` Jeff Garzik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox