From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 2 Apr 2012 21:26:24 +0200 Subject: [U-Boot] [PATCH v2] mmc: mxsmmc: Fix operation with DMA In-Reply-To: References: <1333391050-25199-1-git-send-email-fabio.estevam@freescale.com> <201204022103.02717.marex@denx.de> Message-ID: <201204022126.25166.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Fabio Estevam, > On Mon, Apr 2, 2012 at 4:03 PM, Marek Vasut wrote: > > Because that's called before relocation ;-) > > What about this? > > --- a/drivers/dma/apbh_dma.c > +++ b/drivers/dma/apbh_dma.c > @@ -35,6 +35,7 @@ > > static struct mxs_dma_chan mxs_dma_channels[MXS_MAX_DMA_CHANNELS]; > > +static int first; > /* > * Test is the DMA channel is valid channel > */ > @@ -346,6 +347,10 @@ struct mxs_dma_desc *mxs_dma_desc_alloc(void) > struct mxs_dma_desc *pdesc; > uint32_t size; > > + if (!first) > + mxs_dma_init(); > + first++; > + > size = roundup(sizeof(struct mxs_dma_desc), MXS_DMA_ALIGNMENT); > pdesc = memalign(MXS_DMA_ALIGNMENT, size); > > Too ugly? Or any better place for calling mxs_dma_init()? I'd say arch_misc_init(), if it was before nand_init() though. Maybe we need arch_early_init_r() ? Best regards, Marek Vasut