From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mmc: mxsmmc: Fix operation with DMA
Date: Mon, 2 Apr 2012 22:52:26 +0200 [thread overview]
Message-ID: <201204022252.26493.marex@denx.de> (raw)
In-Reply-To: <CAOMZO5B-SSWqVuK_A_X92UkHSS72u26ft-+wkT1ehkv3jR0kog@mail.gmail.com>
Dear Fabio Estevam,
> On Mon, Apr 2, 2012 at 4:54 PM, Marek Vasut <marex@denx.de> wrote:
> > Yes another hook function that'd be called early in board_init_r()
>
> Ok, please see the patch below and let me know if you like it.
>
> If you do, then I can probably split it in 2 parts:
> one that introduces arch_early_init_r() and another one that fixes the
> mmc problem on mx28.
Well ... CCing Albert to express his concerns about this.
>
> diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> index cf6d4e9..6c148a8 100644
> --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
> +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
> @@ -34,6 +34,7 @@
> #include <asm/arch/iomux.h>
> #include <asm/arch/imx-regs.h>
> #include <asm/arch/sys_proto.h>
> +#include <asm/arch/dma.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> @@ -297,3 +298,14 @@ U_BOOT_CMD(
> "display clocks",
> ""
> );
> +
> +#ifdef CONFIG_ARCH_EARLY_INIT_R
> +int arch_early_init_r(void)
> +{
> +#ifdef CONFIG_APBH_DMA
> + /* Initialize the DMA controller. */
> + mxs_dma_init();
> +#endif
> + return 0;
> +}
> +#endif
> diff --git a/arch/arm/include/asm/u-boot-arm.h
> b/arch/arm/include/asm/u-boot-arm.h
> index 4ca75f9..9f3cae5 100644
> --- a/arch/arm/include/asm/u-boot-arm.h
> +++ b/arch/arm/include/asm/u-boot-arm.h
> @@ -52,6 +52,7 @@ void cpu_init_cp15(void);
> /* cpu/.../arch/cpu.c */
> int arch_cpu_init(void);
> int arch_misc_init(void);
> +int arch_early_init_r(void);
>
> /* board/.../... */
> int board_init(void);
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 5270c11..025d6ca 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -500,6 +500,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
> malloc_start = dest_addr - TOTAL_MALLOC_LEN;
> mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
>
> +#ifdef CONFIG_ARCH_EARLY_INIT_R
> + arch_early_init_r();
> +#endif
> +
> #if !defined(CONFIG_SYS_NO_FLASH)
> puts("Flash: ");
>
> diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
> index 4b1297a..95eac35 100644
> --- a/drivers/mtd/nand/mxs_nand.c
> +++ b/drivers/mtd/nand/mxs_nand.c
> @@ -1072,9 +1072,6 @@ int mxs_nand_init(struct mxs_nand_info *info)
> goto err2;
> }
>
> - /* Init the DMA controller. */
> - mxs_dma_init();
> -
> /* Reset the GPMI block. */
> mx28_reset_block(&gpmi_regs->hw_gpmi_ctrl0_reg);
>
> diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
> index 8b83180..b0e6d3b 100644
> --- a/include/configs/m28evk.h
> +++ b/include/configs/m28evk.h
> @@ -42,6 +42,7 @@
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_ARCH_CPU_INIT
> #define CONFIG_ARCH_MISC_INIT
> +#define CONFIG_ARCH_EARLY_INIT_R
>
> /*
> * SPL
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 705fdab..350e833 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -36,6 +36,7 @@
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_ARCH_CPU_INIT
> #define CONFIG_ARCH_MISC_INIT
> +#define CONFIG_ARCH_EARLY_INIT_R
>
> /*
> * SPL
next prev parent reply other threads:[~2012-04-02 20:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 18:24 [U-Boot] [PATCH v2] mmc: mxsmmc: Fix operation with DMA Fabio Estevam
2012-04-02 18:39 ` Marek Vasut
2012-04-02 18:54 ` Fabio Estevam
2012-04-02 19:03 ` Marek Vasut
2012-04-02 19:18 ` Fabio Estevam
2012-04-02 19:26 ` Marek Vasut
2012-04-02 19:30 ` Anatolij Gustschin
2012-04-02 19:38 ` Marek Vasut
2012-04-02 19:50 ` Fabio Estevam
2012-04-02 19:54 ` Marek Vasut
2012-04-02 20:44 ` Fabio Estevam
2012-04-02 20:52 ` Marek Vasut [this message]
2012-04-02 20:54 ` Fabio Estevam
2012-04-02 21:00 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201204022252.26493.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox