All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] socfpga: initialize MMC
@ 2014-07-16 12:34 Pavel Machek
  2014-07-16 12:52 ` Wolfgang Denk
  2014-07-22  3:22 ` [U-Boot] socfpga: initialize MMC Jaehoon Chung
  0 siblings, 2 replies; 20+ messages in thread
From: Pavel Machek @ 2014-07-16 12:34 UTC (permalink / raw)
  To: u-boot

Hi!

Once ethernet changes I merged, I can rediff mmc changes for
application. It will look something like this:

Albert, can you apply the ethernet patch? I'd like to continue on top
of it...
								Pavel

diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c
index 2f1c716..7af384e 100644
--- a/arch/arm/cpu/armv7/socfpga/misc.c
+++ b/arch/arm/cpu/armv7/socfpga/misc.c
@@ -14,3 +16,27 @@ int dram_init(void)
+
+#ifdef CONFIG_DWMMC
+/*
+ * Initializes MMC controllers.
+ * to override, implement board_mmc_init()
+ */
+int cpu_mmc_init(bd_t *bis)
+{
+       return altera_dwmmc_init(SOCFPGA_SDMMC_ADDRESS, 4, 0);
+}
+#endif
diff --git a/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
index f564046..9b488d9 100644
--- a/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
+++ b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
@@ -14,5 +14,8 @@
 #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
 #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
 #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
+#define SOCFPGA_SDMMC_ADDRESS 0xff704000
 
 #endif /* _SOCFPGA_BASE_ADDRS_H_ */
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 34febf5..5902105 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
 obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
 obj-$(CONFIG_DWMMC) += dw_mmc.o
 obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
+obj-$(CONFIG_ALTERA_DWMMC) += altera_dw_mmc.o
 obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
 obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
 obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
diff --git a/drivers/mmc/altera_dw_mmc.c b/drivers/mmc/altera_dw_mmc.c
new file mode 100644
index 0000000..b22dc45
--- /dev/null
+++ b/drivers/mmc/altera_dw_mmc.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013 Altera Corporation <www.altera.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,  MA 02111-1307 USA
+ *
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <dwmmc.h>
+#include <asm/arch/dwmmc.h>
+#include <errno.h>
+
+#define CLKMGR_PERPLLGRP_EN_REG		(SOCFPGA_CLKMGR_ADDRESS + 0xA0)
+#define CLKMGR_SDMMC_CLK_ENABLE		(1 << 8)
+#define SYSMGR_SDMMCGRP_CTRL_REG	(SOCFPGA_SYSMGR_ADDRESS + 0x108)
+
+static char *ALTERA_NAME = "ALTERA DWMMC";
+
+static void altera_dwmci_clksel(struct dwmci_host *host)
+{
+	unsigned int drvsel;
+	unsigned int smplsel;
+
+	/* Disable SDMMC clock. */
+	clrbits_le32(CLKMGR_PERPLLGRP_EN_REG, CLKMGR_SDMMC_CLK_ENABLE);
+
+	/* Configures drv_sel and smpl_sel */
+	drvsel = 3;
+	smplsel = 0;
+
+	debug("%s: drvsel %d smplsel %d\n", __FUNCTION__, drvsel, smplsel);
+	writel((smplsel << 3) | drvsel, SYSMGR_SDMMCGRP_CTRL_REG);
+
+	/* Enable SDMMC clock */
+	setbits_le32(CLKMGR_PERPLLGRP_EN_REG, CLKMGR_SDMMC_CLK_ENABLE);
+}
+
+int altera_dwmmc_init(u32 regbase, int bus_width, int index)
+{
+	struct dwmci_host *host = NULL;
+	host = malloc(sizeof(struct dwmci_host));
+	if (!host) {
+		printf("dwmci_host malloc failed!\n");
+		return -ENOMEM;
+	}
+
+	host->name = ALTERA_NAME;
+	host->ioaddr = (void *)regbase;
+	host->buswidth = bus_width;
+	host->clksel = altera_dwmci_clksel;
+	host->dev_index = index;
+	host->bus_hz = 400000;
+	host->fifoth_val = MSIZE(0x2) |
+		RX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2 - 1) |
+		TX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2);
+
+	add_dwmci(host, host->bus_hz, host->bus_hz);
+
+	return 0;
+}
+
diff --git a/include/configs/socfpga_cyclone5.h b/include/configs/socfpga_cyclone5.h
index 0254249..189dcde 100644
--- a/include/configs/socfpga_cyclone5.h
+++ b/include/configs/socfpga_cyclone5.h
@@ -180,13 +183,30 @@
 /*
  * FLASH
  */
 #define CONFIG_SYS_NO_FLASH
 
+
+/*
+ * MMC support
+ */
+#define CONFIG_MMC
+#ifdef CONFIG_MMC
+#define CONFIG_CMD_MMC
+
+#define CONFIG_BOUNCE_BUFFER
+#define CONFIG_GENERIC_MMC             1
+#define CONFIG_DWMMC                   1
+#define CONFIG_ALTERA_DWMMC            1
+#define CONFIG_DWMMC_FIFO_DEPTH		1024
+/* using smaller max blk cnt to avoid flooding the limited stack we have */
+#define CONFIG_SYS_MMC_MAX_BLK_COUNT     256
+#endif /* CONFIG_MMC */
+
 /*
  * L4 OSC1 Timer 0
  */

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-16 12:34 [U-Boot] socfpga: initialize MMC Pavel Machek
@ 2014-07-16 12:52 ` Wolfgang Denk
  2014-07-16 13:13   ` Wolfgang Denk
                     ` (2 more replies)
  2014-07-22  3:22 ` [U-Boot] socfpga: initialize MMC Jaehoon Chung
  1 sibling, 3 replies; 20+ messages in thread
From: Wolfgang Denk @ 2014-07-16 12:52 UTC (permalink / raw)
  To: u-boot

Dear Pavel Machek,

In message <20140716123422.GA8844@amd.pavel.ucw.cz> you wrote:
> 
> Once ethernet changes I merged, I can rediff mmc changes for
> application. It will look something like this:
> 
> Albert, can you apply the ethernet patch? I'd like to continue on top
> of it...

Please mark such stuff for discussion explicitly as RFC so they can
easily be spottet in PW.


> +++ b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
> @@ -14,5 +14,8 @@
>  #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
>  #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
>  #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
> +#define SOCFPGA_SDMMC_ADDRESS 0xff704000

Please keep list sorted.

> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
>  obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
>  obj-$(CONFIG_DWMMC) += dw_mmc.o
>  obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
> +obj-$(CONFIG_ALTERA_DWMMC) += altera_dw_mmc.o
>  obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
>  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
>  obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o

Ditto.  This should be a sorted list.

> --- /dev/null
> +++ b/drivers/mmc/altera_dw_mmc.c
> @@ -0,0 +1,74 @@
> +/*
> + * Copyright (C) 2013 Altera Corporation <www.altera.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,  MA 02111-1307 USA

NAK.  Please use SPDX ID tags instead.

> +static char *ALTERA_NAME = "ALTERA DWMMC";

Please use lower case variable names only.

> +int altera_dwmmc_init(u32 regbase, int bus_width, int index)
> +{
> +	struct dwmci_host *host = NULL;
> +	host = malloc(sizeof(struct dwmci_host));

Please separate declartions and code by a blank line.

Hm, which sense does it make to initialize host as NULL, just to assign
a different value in the next step?

Please fix.

> +	host->name = ALTERA_NAME;
> +	host->ioaddr = (void *)regbase;
> +	host->buswidth = bus_width;
> +	host->clksel = altera_dwmci_clksel;
> +	host->dev_index = index;
> +	host->bus_hz = 400000;
> +	host->fifoth_val = MSIZE(0x2) |
> +		RX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2 - 1) |
> +		TX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2);
> +
> +	add_dwmci(host, host->bus_hz, host->bus_hz);

Is there a free(host) anywhere?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
While money can't buy happiness, it certainly lets  you  choose  your
own form of misery.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-16 12:52 ` Wolfgang Denk
@ 2014-07-16 13:13   ` Wolfgang Denk
  2014-07-17 11:00     ` Chin Liang See
  2014-07-21 10:20   ` Pavel Machek
  2014-07-21 10:30   ` [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc Pavel Machek
  2 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Denk @ 2014-07-16 13:13 UTC (permalink / raw)
  To: u-boot

Dear Pavel,

In message <20140716125238.CF3833804B5@gemini.denx.de> I wrote:
> 
> > +	add_dwmci(host, host->bus_hz, host->bus_hz);
> 
> Is there a free(host) anywhere?

I think there is none, which raises the question why you use malloc()
in the first place.  Just use a struct on the stack.

Also, please make sure to check the return code of add_dwmci() for
errors, and handle these as needed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The light at the end of the tunnel is usually a "No Exit" sign.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-16 13:13   ` Wolfgang Denk
@ 2014-07-17 11:00     ` Chin Liang See
  2014-07-17 12:01       ` Wolfgang Denk
  0 siblings, 1 reply; 20+ messages in thread
From: Chin Liang See @ 2014-07-17 11:00 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Wed, 2014-07-16 at 15:13 +0200, ZY - wd wrote:
> Dear Pavel,
> 
> In message <20140716125238.CF3833804B5@gemini.denx.de> I wrote:
> > 
> > > +	add_dwmci(host, host->bus_hz, host->bus_hz);
> > 
> > Is there a free(host) anywhere?


Actually the host will be referred throughout the code execution when
SDMMC access is required. Hence, we can only call the free when exit
which deems not needed then.

Thanks
Chin Liang

> 
> I think there is none, which raises the question why you use malloc()
> in the first place.  Just use a struct on the stack.
> 
> Also, please make sure to check the return code of add_dwmci() for
> errors, and handle these as needed.
> 
> Best regards,
> 
> Wolfgang Denk
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-17 11:00     ` Chin Liang See
@ 2014-07-17 12:01       ` Wolfgang Denk
  2014-07-19 12:03         ` Pavel Machek
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Denk @ 2014-07-17 12:01 UTC (permalink / raw)
  To: u-boot

Dear Chin Liang,

In message <1405594852.2088.8.camel@clsee-VirtualBox.altera.com> you wrote:
> 
> > > > +	add_dwmci(host, host->bus_hz, host->bus_hz);
> > > 
> > > Is there a free(host) anywhere?
> 
> Actually the host will be referred throughout the code execution when
> SDMMC access is required. Hence, we can only call the free when exit
> which deems not needed then.

I have to admit that I have hard times trying to understand the
concept of behind this code.

1) The new patches add  altera_dwmmc_init()  - but is this not
   basically a verbatim copy of  socfpga_dwmmc_init()  which is
   alreday in mainline?

   Except that the new patches use hardcoded constants (which is BAD)
   where the current mainline code uses #defines:

   altera_dwmmc_init():

	host->bus_hz = 400000;

   socfpga_dwmmc_init():

	host->bus_hz = CONFIG_SOCFPGA_DWMMC_BUS_HZ;

2) Is it really necessary to always and unconditionally initialyze
   the MMC subsystem, even in nobody will ever use any MMC commands in
   U-Boot?  The rule is that we only initialize hardwar when we
   actually use them inside of U-Boot, i. e. if any commands are
   executed that access such hardware?

   [Ok, this seems to be a generic problem, not specific you your
   patch set.]


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The average woman would rather have beauty than brains,  because  the
average man can see better than he can think.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-17 12:01       ` Wolfgang Denk
@ 2014-07-19 12:03         ` Pavel Machek
  0 siblings, 0 replies; 20+ messages in thread
From: Pavel Machek @ 2014-07-19 12:03 UTC (permalink / raw)
  To: u-boot

On Thu 2014-07-17 14:01:20, Wolfgang Denk wrote:
> Dear Chin Liang,
> 
> In message <1405594852.2088.8.camel@clsee-VirtualBox.altera.com> you wrote:
> > 
> > > > > +	add_dwmci(host, host->bus_hz, host->bus_hz);
> > > > 
> > > > Is there a free(host) anywhere?
> > 
> > Actually the host will be referred throughout the code execution when
> > SDMMC access is required. Hence, we can only call the free when exit
> > which deems not needed then.
> 
> I have to admit that I have hard times trying to understand the
> concept of behind this code.
> 
> 1) The new patches add  altera_dwmmc_init()  - but is this not
>    basically a verbatim copy of  socfpga_dwmmc_init()  which is
>    alreday in mainline?

Hmm. altera_dwmmc_init(), already in the mainline but not referenced
anywhere... which is why I failed to notice it.

And most of your review comments apply even to that version. I'll see
if that version works for me and will fix it up according to review.

> 2) Is it really necessary to always and unconditionally initialyze
>    the MMC subsystem, even in nobody will ever use any MMC commands in
>    U-Boot?  The rule is that we only initialize hardwar when we
>    actually use them inside of U-Boot, i. e. if any commands are
>    executed that access such hardware?
> 
>    [Ok, this seems to be a generic problem, not specific you your
>    patch set.]

I seem to have great trouble getting even the most trivial patches to
apply. I can do more extensive changes, but would like to get the
simple things merged, first...

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-16 12:52 ` Wolfgang Denk
  2014-07-16 13:13   ` Wolfgang Denk
@ 2014-07-21 10:20   ` Pavel Machek
  2014-07-21 10:50     ` Wolfgang Denk
  2014-07-21 10:30   ` [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc Pavel Machek
  2 siblings, 1 reply; 20+ messages in thread
From: Pavel Machek @ 2014-07-21 10:20 UTC (permalink / raw)
  To: u-boot

Hi!

> > +++ b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
> > @@ -14,5 +14,8 @@
> >  #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
> >  #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
> >  #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
> > +#define SOCFPGA_SDMMC_ADDRESS 0xff704000
> 
> Please keep list sorted.

It was sorted by address before, so I'll keep it like that.

> > --- a/drivers/mmc/Makefile
> > +++ b/drivers/mmc/Makefile
> > @@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
> >  obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
> >  obj-$(CONFIG_DWMMC) += dw_mmc.o
> >  obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
> > +obj-$(CONFIG_ALTERA_DWMMC) += altera_dw_mmc.o
> >  obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
> >  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
> >  obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
> 
> Ditto.  This should be a sorted list.

This was not sorted and I will not need to modify it in next patch
version, so I'll leave this unfixed.

> > +static char *ALTERA_NAME = "ALTERA DWMMC";
> 
> Please use lower case variable names only.

Actually, it turns out we don't need the variable :-).

> > +int altera_dwmmc_init(u32 regbase, int bus_width, int index)
> > +{
> > +	struct dwmci_host *host = NULL;
> > +	host = malloc(sizeof(struct dwmci_host));
> 
> Please separate declartions and code by a blank line.

Ok.

> Hm, which sense does it make to initialize host as NULL, just to assign
> a different value in the next step?
> 
> Please fix.

Fixed.

> > +	host->name = ALTERA_NAME;
> > +	host->ioaddr = (void *)regbase;
> > +	host->buswidth = bus_width;
> > +	host->clksel = altera_dwmci_clksel;
> > +	host->dev_index = index;
> > +	host->bus_hz = 400000;
> > +	host->fifoth_val = MSIZE(0x2) |
> > +		RX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2 - 1) |
> > +		TX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2);
> > +
> > +	add_dwmci(host, host->bus_hz, host->bus_hz);
> 
> Is there a free(host) anywhere?

Dynamic allocation does not make much sense here, agreed. But as it is
existing code, and there are bigger issues around, I'd prefer to leave
it to someone else to clean it up...

Thanks,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc
  2014-07-16 12:52 ` Wolfgang Denk
  2014-07-16 13:13   ` Wolfgang Denk
  2014-07-21 10:20   ` Pavel Machek
@ 2014-07-21 10:30   ` Pavel Machek
  2014-07-21 10:49     ` Chin Liang See
  2014-07-21 11:30     ` [U-Boot] [PATCHv2] " Pavel Machek
  2 siblings, 2 replies; 20+ messages in thread
From: Pavel Machek @ 2014-07-21 10:30 UTC (permalink / raw)
  To: u-boot


Cleanups as suggested by wd on mailing list, plus I replaced
calloc(...,1) with malloc().
    
Signed-off-by: Pavel Machek <pavel@denx.de>

--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base =
 static const struct socfpga_system_manager *system_manager_base =
 		(void *)SOCFPGA_SYSMGR_ADDRESS;
 
-static char *SOCFPGA_NAME = "SOCFPGA DWMMC";
-
 #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8)
 
 static void socfpga_dwmci_clksel(struct dwmci_host *host)
@@ -47,14 +45,15 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host)
 
 int socfpga_dwmmc_init(u32 regbase, int bus_width, int index)
 {
-	struct dwmci_host *host = NULL;
-	host = calloc(sizeof(struct dwmci_host), 1);
+	struct dwmci_host *host;
+
+	host = malloc(sizeof(struct dwmci_host));
 	if (!host) {
 		printf("dwmci_host calloc fail!\n");
 		return -1;
 	}
 
-	host->name = SOCFPGA_NAME;
+	host->name = "SOCFPGA DWMMC";
 	host->ioaddr = (void *)regbase;
 	host->buswidth = bus_width;
 	host->clksel = socfpga_dwmci_clksel;


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc
  2014-07-21 10:30   ` [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc Pavel Machek
@ 2014-07-21 10:49     ` Chin Liang See
  2014-07-21 11:30     ` [U-Boot] [PATCHv2] " Pavel Machek
  1 sibling, 0 replies; 20+ messages in thread
From: Chin Liang See @ 2014-07-21 10:49 UTC (permalink / raw)
  To: u-boot

Hi Pavel,


On Mon, 2014-07-21 at 12:30 +0200, ZY - pavel wrote:
> Cleanups as suggested by wd on mailing list, plus I replaced
> calloc(...,1) with malloc().
>     
> Signed-off-by: Pavel Machek <pavel@denx.de>
> 
> --- a/drivers/mmc/socfpga_dw_mmc.c
> +++ b/drivers/mmc/socfpga_dw_mmc.c
> @@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base =
>  static const struct socfpga_system_manager *system_manager_base =
>  		(void *)SOCFPGA_SYSMGR_ADDRESS;
>  
> -static char *SOCFPGA_NAME = "SOCFPGA DWMMC";
> -
>  #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8)
>  
>  static void socfpga_dwmci_clksel(struct dwmci_host *host)
> @@ -47,14 +45,15 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host)
>  
>  int socfpga_dwmmc_init(u32 regbase, int bus_width, int index)
>  {
> -	struct dwmci_host *host = NULL;
> -	host = calloc(sizeof(struct dwmci_host), 1);
> +	struct dwmci_host *host;
> +
> +	host = malloc(sizeof(struct dwmci_host));

We need calloc as it will initialize the allocated region. It will
prevent errors due to NULL comparison against uninitialized structure
member.

Thanks
Chin Liang

>  	if (!host) {
>  		printf("dwmci_host calloc fail!\n");
>  		return -1;
>  	}
>  
> -	host->name = SOCFPGA_NAME;
> +	host->name = "SOCFPGA DWMMC";
>  	host->ioaddr = (void *)regbase;
>  	host->buswidth = bus_width;
>  	host->clksel = socfpga_dwmci_clksel;
> 
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-21 10:20   ` Pavel Machek
@ 2014-07-21 10:50     ` Wolfgang Denk
  2014-07-21 12:05       ` Pavel Machek
  2014-09-09 13:16       ` [U-Boot] [PATCH] sort drivers/mmc/Makefile Pavel Machek
  0 siblings, 2 replies; 20+ messages in thread
From: Wolfgang Denk @ 2014-07-21 10:50 UTC (permalink / raw)
  To: u-boot

Dear Pavel,

In message <20140721102004.GA12896@amd.pavel.ucw.cz> you wrote:
> 
> > >  #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
> > >  #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
> > >  #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
> > > +#define SOCFPGA_SDMMC_ADDRESS 0xff704000
> > 
> > Please keep list sorted.
> 
> It was sorted by address before, so I'll keep it like that.

Yes, it was sorted by address, and 0xff704000 goes _before_
0xffd08000, not after.

> > > --- a/drivers/mmc/Makefile
> > > +++ b/drivers/mmc/Makefile
> > > @@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
> > >  obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
> > >  obj-$(CONFIG_DWMMC) += dw_mmc.o
> > >  obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
> > > +obj-$(CONFIG_ALTERA_DWMMC) += altera_dw_mmc.o
> > >  obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
> > >  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
> > >  obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
> > 
> > Ditto.  This should be a sorted list.
> 
> This was not sorted and I will not need to modify it in next patch
> version, so I'll leave this unfixed.

No, please clean up and fix it.

> > Is there a free(host) anywhere?
> 
> Dynamic allocation does not make much sense here, agreed. But as it is
> existing code, and there are bigger issues around, I'd prefer to leave
> it to someone else to clean it up...

I tend to disagree.  If we do not fix the problems as we see them, and
when we are working on the code anyway, they will never get fixed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When the bosses talk about improving  productivity,  they  are  never
talking about themselves.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCHv2] socfpga: cleanup socfpga_dw_mmc
  2014-07-21 10:30   ` [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc Pavel Machek
  2014-07-21 10:49     ` Chin Liang See
@ 2014-07-21 11:30     ` Pavel Machek
  2014-07-22  4:55       ` Chin Liang See
  2014-08-30 15:13       ` [U-Boot] [U-Boot,PATCHv2] " Tom Rini
  1 sibling, 2 replies; 20+ messages in thread
From: Pavel Machek @ 2014-07-21 11:30 UTC (permalink / raw)
  To: u-boot

 
Cleanups as suggested by wd on mailing list.

Signed-off-by: Pavel Machek <pavel@denx.de>

---

v2: calloc is actually needed, document it.

--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base =
 static const struct socfpga_system_manager *system_manager_base =
 		(void *)SOCFPGA_SYSMGR_ADDRESS;
 
-static char *SOCFPGA_NAME = "SOCFPGA DWMMC";
-
 #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8)
 
 static void socfpga_dwmci_clksel(struct dwmci_host *host)
@@ -47,14 +45,16 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host)
 
 int socfpga_dwmmc_init(u32 regbase, int bus_width, int index)
 {
-	struct dwmci_host *host = NULL;
+	struct dwmci_host *host;
+
+	/* calloc for zero init */
 	host = calloc(sizeof(struct dwmci_host), 1);
 	if (!host) {
 		printf("dwmci_host calloc fail!\n");
 		return -1;
 	}
 
-	host->name = SOCFPGA_NAME;
+	host->name = "SOCFPGA DWMMC";
 	host->ioaddr = (void *)regbase;
 	host->buswidth = bus_width;
 	host->clksel = socfpga_dwmci_clksel;


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-21 10:50     ` Wolfgang Denk
@ 2014-07-21 12:05       ` Pavel Machek
  2014-07-22  9:33         ` Chin Liang See
  2014-09-09 13:16       ` [U-Boot] [PATCH] sort drivers/mmc/Makefile Pavel Machek
  1 sibling, 1 reply; 20+ messages in thread
From: Pavel Machek @ 2014-07-21 12:05 UTC (permalink / raw)
  To: u-boot

Hi!

> > > >  #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
> > > >  #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
> > > >  #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
> > > > +#define SOCFPGA_SDMMC_ADDRESS 0xff704000
> > > 
> > > Please keep list sorted.
> > 
> > It was sorted by address before, so I'll keep it like that.
> 
> Yes, it was sorted by address, and 0xff704000 goes _before_
> 0xffd08000, not after.

Sorry, I meant "will fix it so that it is sorted after my patches".

> > > Is there a free(host) anywhere?
> > 
> > Dynamic allocation does not make much sense here, agreed. But as it is
> > existing code, and there are bigger issues around, I'd prefer to leave
> > it to someone else to clean it up...
> 
> I tend to disagree.  If we do not fix the problems as we see them, and
> when we are working on the code anyway, they will never get fixed.

I'm working on the code, anyway, yes. Currently, u-boot is completely
unusable on socfpga. I'd rather fix big problems first, so that code
could be actually tested, and does not bitrot further as happened in
clock and time areas. There are just too many small problems around.

Could we talk on jabber or phone?

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-16 12:34 [U-Boot] socfpga: initialize MMC Pavel Machek
  2014-07-16 12:52 ` Wolfgang Denk
@ 2014-07-22  3:22 ` Jaehoon Chung
  2014-07-22  8:49   ` Pavel Machek
  1 sibling, 1 reply; 20+ messages in thread
From: Jaehoon Chung @ 2014-07-22  3:22 UTC (permalink / raw)
  To: u-boot

Hi,

I don't know what differ with socfpga_dw_mmc.c.
I think you can use it.

Best Regards,
Jaehoon Chung

On 07/16/2014 09:34 PM, Pavel Machek wrote:
> Hi!
> 
> Once ethernet changes I merged, I can rediff mmc changes for
> application. It will look something like this:
> 
> Albert, can you apply the ethernet patch? I'd like to continue on top
> of it...
> 								Pavel
> 
> diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c
> index 2f1c716..7af384e 100644
> --- a/arch/arm/cpu/armv7/socfpga/misc.c
> +++ b/arch/arm/cpu/armv7/socfpga/misc.c
> @@ -14,3 +16,27 @@ int dram_init(void)
> +
> +#ifdef CONFIG_DWMMC
> +/*
> + * Initializes MMC controllers.
> + * to override, implement board_mmc_init()
> + */
> +int cpu_mmc_init(bd_t *bis)
> +{
> +       return altera_dwmmc_init(SOCFPGA_SDMMC_ADDRESS, 4, 0);
> +}
> +#endif
> diff --git a/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
> index f564046..9b488d9 100644
> --- a/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
> +++ b/arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
> @@ -14,5 +14,8 @@
>  #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
>  #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
>  #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
> +#define SOCFPGA_SDMMC_ADDRESS 0xff704000
>  
>  #endif /* _SOCFPGA_BASE_ADDRS_H_ */
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 34febf5..5902105 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -28,6 +28,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
>  obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
>  obj-$(CONFIG_DWMMC) += dw_mmc.o
>  obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
> +obj-$(CONFIG_ALTERA_DWMMC) += altera_dw_mmc.o
>  obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
>  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
>  obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
> diff --git a/drivers/mmc/altera_dw_mmc.c b/drivers/mmc/altera_dw_mmc.c
> new file mode 100644
> index 0000000..b22dc45
> --- /dev/null
> +++ b/drivers/mmc/altera_dw_mmc.c
> @@ -0,0 +1,74 @@
> +/*
> + * Copyright (C) 2013 Altera Corporation <www.altera.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,  MA 02111-1307 USA
> + *
> + */
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <dwmmc.h>
> +#include <asm/arch/dwmmc.h>
> +#include <errno.h>
> +
> +#define CLKMGR_PERPLLGRP_EN_REG		(SOCFPGA_CLKMGR_ADDRESS + 0xA0)
> +#define CLKMGR_SDMMC_CLK_ENABLE		(1 << 8)
> +#define SYSMGR_SDMMCGRP_CTRL_REG	(SOCFPGA_SYSMGR_ADDRESS + 0x108)
> +
> +static char *ALTERA_NAME = "ALTERA DWMMC";
> +
> +static void altera_dwmci_clksel(struct dwmci_host *host)
> +{
> +	unsigned int drvsel;
> +	unsigned int smplsel;
> +
> +	/* Disable SDMMC clock. */
> +	clrbits_le32(CLKMGR_PERPLLGRP_EN_REG, CLKMGR_SDMMC_CLK_ENABLE);
> +
> +	/* Configures drv_sel and smpl_sel */
> +	drvsel = 3;
> +	smplsel = 0;
> +
> +	debug("%s: drvsel %d smplsel %d\n", __FUNCTION__, drvsel, smplsel);
> +	writel((smplsel << 3) | drvsel, SYSMGR_SDMMCGRP_CTRL_REG);
> +
> +	/* Enable SDMMC clock */
> +	setbits_le32(CLKMGR_PERPLLGRP_EN_REG, CLKMGR_SDMMC_CLK_ENABLE);
> +}
> +
> +int altera_dwmmc_init(u32 regbase, int bus_width, int index)
> +{
> +	struct dwmci_host *host = NULL;
> +	host = malloc(sizeof(struct dwmci_host));
> +	if (!host) {
> +		printf("dwmci_host malloc failed!\n");
> +		return -ENOMEM;
> +	}
> +
> +	host->name = ALTERA_NAME;
> +	host->ioaddr = (void *)regbase;
> +	host->buswidth = bus_width;
> +	host->clksel = altera_dwmci_clksel;
> +	host->dev_index = index;
> +	host->bus_hz = 400000;
> +	host->fifoth_val = MSIZE(0x2) |
> +		RX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2 - 1) |
> +		TX_WMARK(CONFIG_DWMMC_FIFO_DEPTH / 2);
> +
> +	add_dwmci(host, host->bus_hz, host->bus_hz);
> +
> +	return 0;
> +}
> +
> diff --git a/include/configs/socfpga_cyclone5.h b/include/configs/socfpga_cyclone5.h
> index 0254249..189dcde 100644
> --- a/include/configs/socfpga_cyclone5.h
> +++ b/include/configs/socfpga_cyclone5.h
> @@ -180,13 +183,30 @@
>  /*
>   * FLASH
>   */
>  #define CONFIG_SYS_NO_FLASH
>  
> +
> +/*
> + * MMC support
> + */
> +#define CONFIG_MMC
> +#ifdef CONFIG_MMC
> +#define CONFIG_CMD_MMC
> +
> +#define CONFIG_BOUNCE_BUFFER
> +#define CONFIG_GENERIC_MMC             1
> +#define CONFIG_DWMMC                   1
> +#define CONFIG_ALTERA_DWMMC            1
> +#define CONFIG_DWMMC_FIFO_DEPTH		1024
> +/* using smaller max blk cnt to avoid flooding the limited stack we have */
> +#define CONFIG_SYS_MMC_MAX_BLK_COUNT     256
> +#endif /* CONFIG_MMC */
> +
>  /*
>   * L4 OSC1 Timer 0
>   */
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCHv2] socfpga: cleanup socfpga_dw_mmc
  2014-07-21 11:30     ` [U-Boot] [PATCHv2] " Pavel Machek
@ 2014-07-22  4:55       ` Chin Liang See
  2014-08-30 15:13       ` [U-Boot] [U-Boot,PATCHv2] " Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Chin Liang See @ 2014-07-22  4:55 UTC (permalink / raw)
  To: u-boot

On Mon, 2014-07-21 at 13:30 +0200, ZY - pavel wrote:
> Cleanups as suggested by wd on mailing list.
> 
> Signed-off-by: Pavel Machek <pavel@denx.de>
> 
> ---
> 
> v2: calloc is actually needed, document it.
> 
> --- a/drivers/mmc/socfpga_dw_mmc.c
> +++ b/drivers/mmc/socfpga_dw_mmc.c
> @@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base =
>  static const struct socfpga_system_manager *system_manager_base =
>  		(void *)SOCFPGA_SYSMGR_ADDRESS;
>  
> -static char *SOCFPGA_NAME = "SOCFPGA DWMMC";
> -
>  #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8)
>  
>  static void socfpga_dwmci_clksel(struct dwmci_host *host)
> @@ -47,14 +45,16 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host)
>  
>  int socfpga_dwmmc_init(u32 regbase, int bus_width, int index)
>  {
> -	struct dwmci_host *host = NULL;
> +	struct dwmci_host *host;
> +
> +	/* calloc for zero init */
>  	host = calloc(sizeof(struct dwmci_host), 1);
>  	if (!host) {
>  		printf("dwmci_host calloc fail!\n");
>  		return -1;
>  	}
>  
> -	host->name = SOCFPGA_NAME;
> +	host->name = "SOCFPGA DWMMC";
>  	host->ioaddr = (void *)regbase;
>  	host->buswidth = bus_width;
>  	host->clksel = socfpga_dwmci_clksel;
> 
> 

Acked-by: Chin Liang See <clsee@altera.com>

Thanks
Chin Liang

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-22  3:22 ` [U-Boot] socfpga: initialize MMC Jaehoon Chung
@ 2014-07-22  8:49   ` Pavel Machek
  0 siblings, 0 replies; 20+ messages in thread
From: Pavel Machek @ 2014-07-22  8:49 UTC (permalink / raw)
  To: u-boot

Hi!

> I don't know what differ with socfpga_dw_mmc.c.
> I think you can use it.

Yes, I think I can. I missed it because it has different name than in
altera sources, and because it was not hooked up with rest of system.

Thanks,
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] socfpga: initialize MMC
  2014-07-21 12:05       ` Pavel Machek
@ 2014-07-22  9:33         ` Chin Liang See
  0 siblings, 0 replies; 20+ messages in thread
From: Chin Liang See @ 2014-07-22  9:33 UTC (permalink / raw)
  To: u-boot

Hi Pavel,


On Mon, 2014-07-21 at 14:05 +0200, ZY - pavel wrote:
> > > > Is there a free(host) anywhere?
> > > 
> > > Dynamic allocation does not make much sense here, agreed. But as it is
> > > existing code, and there are bigger issues around, I'd prefer to leave
> > > it to someone else to clean it up...
> > 
> > I tend to disagree.  If we do not fix the problems as we see them, and
> > when we are working on the code anyway, they will never get fixed.
> 
> I'm working on the code, anyway, yes. Currently, u-boot is completely
> unusable on socfpga. I'd rather fix big problems first, so that code
> could be actually tested, and does not bitrot further as happened in
> clock and time areas. There are just too many small problems around.
> 

I believe some of them break due to recent upstream. The bug escaped as
we still build socfpga for Virtual Target instead dev kit. I already fix
this at another patch and I can boot up the U-Boot successfully again.
While SDMMC, I can try it tomorrow.

Thanks
Chin Liang


> Could we talk on jabber or phone?
> 
> Best regards,
> 									Pavel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot,PATCHv2] socfpga: cleanup socfpga_dw_mmc
  2014-07-21 11:30     ` [U-Boot] [PATCHv2] " Pavel Machek
  2014-07-22  4:55       ` Chin Liang See
@ 2014-08-30 15:13       ` Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Tom Rini @ 2014-08-30 15:13 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 21, 2014 at 01:30:19PM +0200, Pavel Machek wrote:

> Cleanups as suggested by wd on mailing list.
> 
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Acked-by: Chin Liang See <clsee@altera.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140830/8155c996/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH] sort drivers/mmc/Makefile
  2014-07-21 10:50     ` Wolfgang Denk
  2014-07-21 12:05       ` Pavel Machek
@ 2014-09-09 13:16       ` Pavel Machek
  2014-09-12  7:25         ` Chin Liang See
  2014-11-10 21:29         ` [U-Boot] " Tom Rini
  1 sibling, 2 replies; 20+ messages in thread
From: Pavel Machek @ 2014-09-09 13:16 UTC (permalink / raw)
  To: u-boot


Sort drivers/mmc makefile, as requested by wd.
    
Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 464cee1..461d7d8 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -5,37 +5,39 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
+obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
+obj-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
 obj-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 obj-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
+obj-$(CONFIG_DWMMC) += dw_mmc.o
+obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
 obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o
 obj-$(CONFIG_FTSDC021) += ftsdc021_sdhci.o
 obj-$(CONFIG_GENERIC_MMC) += mmc.o
 obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+obj-$(CONFIG_KONA_SDHCI) += kona_sdhci.o
 obj-$(CONFIG_MMC_SPI) += mmc_spi.o
-obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
+obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
 obj-$(CONFIG_MV_SDHCI) += mv_sdhci.o
+obj-$(CONFIG_MVEBU_MMC) += mvebu_mmc.o
 obj-$(CONFIG_MXC_MMC) += mxcmmc.o
 obj-$(CONFIG_MXS_MMC) += mxsmmc.o
 obj-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
-obj-$(CONFIG_SDHCI) += sdhci.o
-obj-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
-obj-$(CONFIG_KONA_SDHCI) += kona_sdhci.o
+obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
 obj-$(CONFIG_S3C_SDI) += s3c_sdi.o
 obj-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
+obj-$(CONFIG_SDHCI) += sdhci.o
 obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
+obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
 obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
 obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
-obj-$(CONFIG_DWMMC) += dw_mmc.o
-obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
-obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
 obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
-obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
-obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
+
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o
 else
 obj-$(CONFIG_GENERIC_MMC) += mmc_write.o
 endif
-obj-$(CONFIG_MVEBU_MMC) += mvebu_mmc.o
+

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH] sort drivers/mmc/Makefile
  2014-09-09 13:16       ` [U-Boot] [PATCH] sort drivers/mmc/Makefile Pavel Machek
@ 2014-09-12  7:25         ` Chin Liang See
  2014-11-10 21:29         ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Chin Liang See @ 2014-09-12  7:25 UTC (permalink / raw)
  To: u-boot

On Tue, 2014-09-09 at 15:16 +0200, ZY - pavel wrote:
> Sort drivers/mmc makefile, as requested by wd.
>     
> Signed-off-by: Pavel Machek <pavel@denx.de>
> 
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 464cee1..461d7d8 100644
> --- a/drivers/mmc/Makefile
> +++ b/drivers/mmc/Makefile
> @@ -5,37 +5,39 @@
>  # SPDX-License-Identifier:	GPL-2.0+
>  #
>  
> +obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
> +obj-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
>  obj-$(CONFIG_BFIN_SDH) += bfin_sdh.o
>  obj-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
> +obj-$(CONFIG_DWMMC) += dw_mmc.o
> +obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
>  obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
>  obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o
>  obj-$(CONFIG_FTSDC021) += ftsdc021_sdhci.o
>  obj-$(CONFIG_GENERIC_MMC) += mmc.o
>  obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
> +obj-$(CONFIG_KONA_SDHCI) += kona_sdhci.o
>  obj-$(CONFIG_MMC_SPI) += mmc_spi.o
> -obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
> +obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
>  obj-$(CONFIG_MV_SDHCI) += mv_sdhci.o
> +obj-$(CONFIG_MVEBU_MMC) += mvebu_mmc.o
>  obj-$(CONFIG_MXC_MMC) += mxcmmc.o
>  obj-$(CONFIG_MXS_MMC) += mxsmmc.o
>  obj-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
>  obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o
> -obj-$(CONFIG_SDHCI) += sdhci.o
> -obj-$(CONFIG_BCM2835_SDHCI) += bcm2835_sdhci.o
> -obj-$(CONFIG_KONA_SDHCI) += kona_sdhci.o
> +obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
>  obj-$(CONFIG_S3C_SDI) += s3c_sdi.o
>  obj-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o
> +obj-$(CONFIG_SDHCI) += sdhci.o
>  obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
> +obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
>  obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o
>  obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o
> -obj-$(CONFIG_DWMMC) += dw_mmc.o
> -obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o
> -obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
>  obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o
> -obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o
> -obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
> +
>  ifdef CONFIG_SPL_BUILD
>  obj-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o
>  else
>  obj-$(CONFIG_GENERIC_MMC) += mmc_write.o
>  endif
> -obj-$(CONFIG_MVEBU_MMC) += mvebu_mmc.o
> +
> 

Acked-by: Chin Liang See <clsee@altera.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] sort drivers/mmc/Makefile
  2014-09-09 13:16       ` [U-Boot] [PATCH] sort drivers/mmc/Makefile Pavel Machek
  2014-09-12  7:25         ` Chin Liang See
@ 2014-11-10 21:29         ` Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Tom Rini @ 2014-11-10 21:29 UTC (permalink / raw)
  To: u-boot

On Tue, Sep 09, 2014 at 03:16:10PM +0200, Pavel Machek wrote:

> Sort drivers/mmc makefile, as requested by wd.
>     
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Acked-by: Chin Liang See <clsee@altera.com>
> 
> diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
> index 464cee1..461d7d8 100644

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/fb6f6504/attachment.pgp>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-11-10 21:29 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 12:34 [U-Boot] socfpga: initialize MMC Pavel Machek
2014-07-16 12:52 ` Wolfgang Denk
2014-07-16 13:13   ` Wolfgang Denk
2014-07-17 11:00     ` Chin Liang See
2014-07-17 12:01       ` Wolfgang Denk
2014-07-19 12:03         ` Pavel Machek
2014-07-21 10:20   ` Pavel Machek
2014-07-21 10:50     ` Wolfgang Denk
2014-07-21 12:05       ` Pavel Machek
2014-07-22  9:33         ` Chin Liang See
2014-09-09 13:16       ` [U-Boot] [PATCH] sort drivers/mmc/Makefile Pavel Machek
2014-09-12  7:25         ` Chin Liang See
2014-11-10 21:29         ` [U-Boot] " Tom Rini
2014-07-21 10:30   ` [U-Boot] [PATCH] socfpga: cleanup socfpga_dw_mmc Pavel Machek
2014-07-21 10:49     ` Chin Liang See
2014-07-21 11:30     ` [U-Boot] [PATCHv2] " Pavel Machek
2014-07-22  4:55       ` Chin Liang See
2014-08-30 15:13       ` [U-Boot] [U-Boot,PATCHv2] " Tom Rini
2014-07-22  3:22 ` [U-Boot] socfpga: initialize MMC Jaehoon Chung
2014-07-22  8:49   ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.