Add support for the MMC device to the vexpress
Subsystems (2)
cover Add support for the MMC device to the vexpress
From: Matt Waddel <[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC support
board/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/mmc.c | 19 +- drivers/mmc/mmci.c | 452 ++++++++++++++++++++++++++++++++++ drivers/mmc/mmci.h | 181 ++++++++++++++ include/configs/ca9x4_ct_vxp.h | 4 + 6 files changed, 656 insertions(+), 10 deletions(-) create mode 100644 drivers/mmc/mmci.c create mode 100644 drivers/mmc/mmci.h
PATCH 1/3 MMC: Max blocks value adjustable
From: Matt Waddel <[email protected]>
The maximum blocks value was hardcoded to 65535 due to a 16 bit register length. The value can change for different platforms. This patch makes the default the current value of 65535, but it is configurable for other platforms.
--- drivers/mmc/mmc.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-)
drivers/mmc/mmc.c +9 -10
@@ -33,6 +33,11 @@#include <mmc.h> #include <div64.h> +/* Set block count limit because of 16 bit register limit on some hardware*/ +#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535 +#endif +static struct list_head mmc_devices;static int cur_dev_num =-1 ;
@@ -139,11 +144,8 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)return 0 ; do { - /* - * The 65535 constraint comes from some hardware has - * only 16 bit width block number counter - */ - cur = (blocks_todo > 65535) ? 65535 : blocks_todo; + cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ? + CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo; if(mmc_write_blocks(mmc, start, cur, src) != cur) return 0; blocks_todo -= cur;
@@ -215,11 +217,8 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)return 0 ; do { - /* - * The 65535 constraint comes from some hardware has - * only 16 bit width block number counter - */ - cur = (blocks_todo > 65535) ? 65535 : blocks_todo; + cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ? + CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo; if(mmc_read_blocks(mmc, dst, start, cur) != cur) return 0; blocks_todo -= cur;
Signature · 1 line
1.7.1
PATCH 2/3 MMC: Add support for PL180 ARM mmc device
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Add support for the ARM PrimeCell MultiMedia Interface - PL180. Ported from original device driver written by ST-Ericsson.
--- drivers/mmc/Makefile | 1 + drivers/mmc/mmci.c | 452 ++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/mmci.h | 181 ++++++++++++++++++++ 3 files changed, 634 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/mmci.c create mode 100644 drivers/mmc/mmci.h
drivers/mmc/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o COBJS-$(CONFIG_GENERIC_MMC) += mmc.o COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o +COBJS-$(CONFIG_MMCI) += mmci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
drivers/mmc/mmci.c new file +452 -0
452 lines not on this page · raw message
drivers/mmc/mmci.h new file +181 -0
181 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 3/3 ARMV7: Vexpress: Add MMC support
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
--- board/armltd/vexpress/ca9x4_ct_vxp.c | 9 +++++++++ include/configs/ca9x4_ct_vxp.h | 4 ++++ 2 files changed, 13 insertions(+), 0 deletions(-)
board/armltd/vexpress/ca9x4_ct_vxp.c +9 -0
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)return rc; } +int cpu_mmc_init (bd_t *bis) +{ +int rc =0 ; +#ifdef CONFIG_MMCI + rc =mmci_init (bis); +#endif +return rc; +} +static void flash__init (void ) {/* Setup the sytem control register to allow writing to flash */
include/configs/ca9x4_ct_vxp.h +4 -0
@@ -86,6 +86,10 @@#define CONFIG_MMC 1#define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_MMCI +#define CONFIG_MMC_BASE 0x10005000 +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 +#define CONFIG_MMCI_CLOCK_FREQ 6250000/* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE
Signature · 1 line
1.7.1
cover Add support for the MMC device to the vexpress
In reply to matt.waddel at linaro.orgDear matt.waddel at linaro.org,
Quoted 10 lines
From: Matt Waddel<[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC support
Quoted 5 lines
board/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/mmc.c | 19 +- drivers/mmc/mmci.c | 452 ++++++++++++++++++++++++++++++++++ drivers/mmc/mmci.h | 181 ++++++++++++++
I would expect something more descriptive like <hardware>_mmc.[ch] here. mmci.[ch] does not lead one to think its a hardware specific driver, even less for what specific hardware it is.
The same is true for the exported function name "mmci_init", the macro CONFIG_MMCI etc.
Then, in patch 2/3:
+int mmci_init(void)
but in patch 3/3:
+ rc = mmci_init(bis);
Seems you should add a prototype to include/mmc.h to detect such mistakes ;)
Best Regards,
Reinhard
cover Add support for the MMC device to the vexpress
Reinhard,
Quoted 17 lines · Reinhard Meyer
Dear matt.waddel at linaro.org,
Quoted 10 lines
From: Matt Waddel<[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
Matt Waddel (3):
? ?MMC: Max blocks value adjustable
? ?MMC: Add support for PL180 ARM mmc device
? ?ARMV7: Vexpress: Add MMC supportQuoted 5 lines
? board/armltd/vexpress/ca9x4_ct_vxp.c | ? ?9 + ? drivers/mmc/Makefile ? ? ? ? ? ? ? ? | ? ?1 + ? drivers/mmc/mmc.c ? ? ? ? ? ? ? ? ? ?| ? 19 +- ? drivers/mmc/mmci.c ? ? ? ? ? ? ? ? ? | ?452 ++++++++++++++++++++++++++++++++++ ? drivers/mmc/mmci.h ? ? ? ? ? ? ? ? ? | ?181 ++++++++++++++
Quoted 4 lines
I would expect something more descriptive like <hardware>_mmc.[ch] here. mmci.[ch] does not lead one to think its a hardware specific driver, even less for what specific hardware it is.
The same is true for the exported function name "mmci_init", the macroCONFIG_MMCIetc.
The file in the linux kernel is mmci.c. One could argue that keeping it the same as the kernel is a good thing. If it needs to be changed, I would vote for arm_mmci.c.
The config option in the kernel is CONFIG_MMC_ARMMMCI so I would vote for that as the config option in u-boot.
br,
John
v2 cover Add support for the MMC device to the vexpress
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
---
Change log:
v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
Fixed conflicting fuction call and added prototype to arm_mmci.h (Note: Patch 1/3 did not change with these corrections)
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC support
board/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/arm_mmci.c | 452 ++++++++++++++++++++++++++++++++++ drivers/mmc/arm_mmci.h | 183 ++++++++++++++ drivers/mmc/mmc.c | 19 +- include/configs/ca9x4_ct_vxp.h | 4 + 6 files changed, 658 insertions(+), 10 deletions(-) create mode 100644 drivers/mmc/arm_mmci.c create mode 100644 drivers/mmc/arm_mmci.h
v2 cover Add support for the MMC device to the vexpress
Dear matt.waddel,
Quoted 10 lines
From: Matt Waddel<[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
---
Change log:v2 - Rename patch items to a more descriptive name (ie. mmci ->
arm_mmci)
Fixed conflicting fuction call and added prototype toarm_mmci.h
"function"
Quoted 14 lines
(Note: Patch 1/3 did not change with these corrections)
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC supportboard/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/arm_mmci.c | 452 ++++++++++++++++++++++++++++++++++ drivers/mmc/arm_mmci.h | 183 ++++++++++++++ drivers/mmc/mmc.c | 19 +- include/configs/ca9x4_ct_vxp.h | 4 + 6 files changed, 658 insertions(+), 10 deletions(-)
Quoted 2 lines
create mode 100644
drivers/mmc/arm_mmci.c
create mode 100644drivers/mmc/arm_mmci.h
Sorry, my original comment still holds true for the naming, now the name suggests that this driver is generic to ARM devices, which clearly is not true.
Can you list which devices have a MMCI that is covered by this driver? PL180 only? Or a series of PLxxx? It should be possible to find a naming that is more descriptive than "arm".
(That such a generic name slipped into the kernel must not imply we have to make the same mistake in u-boot)
Best Regards,
Reinhard
v2 cover Add support for the MMC device to the vexpress
Hi Reinhard,
Quoted 3 lines · Reinhard Meyer
Dear matt.waddel,
Quoted 2 lines
From: Matt Waddel<[email protected]>
<snip>
Quoted 3 lines
Sorry, my original comment still holds true for the naming, now the name suggests that this driver is generic to ARM devices, which clearly is not true.
Correct. However, this hardware device was developed by ARM (the company). As far as I know the other ARM mmc drivers, like the omap3_mmc, are not. So that would be the difference between the naming of these drivers.
I don't feel like this driver should be named after a particular platform like vexpress, since this driver could be used in any ARM hardware.
Quoted 4 lines
Can you list which devices have a MMCI that is covered by this driver? PL180 only? Or a series of PLxxx? It should be possible to find a naming that is more descriptive than "arm".
The PL180 is the name assigned to the hardware in the SOC. Here is the description of device from the 1st paragraph in the manual:
1.1 About the ARM PrimeCell Multimedia Card Interface (PL180)
The PrimeCell Multimedia Card Interface (MCI) is an Advanced
Microcontroller Bus Architecture(AMBA) compliant, System-on-a-Chip (SoC) peripheral that is developed, tested, and licensed by ARM.
----
As far as other platforms that use this hardware, it is in some of the other ARM EVMs and some STEricsson platforms like the u300 and u8500.
Quoted 3 lines
(That such a generic name slipped into the kernel must not imply we have to make the same mistake in u-boot)
I agree. However, it would be nice to have a bit of a link between the device in the kernel and the one in u-boot and I didn't think having "_mmci" in the name would be too objectionable.
Would pl180_mmci.c work? or how about arm_pl180_mmc.c? I'm open to other suggestions.
Best regards,
Matt
Quoted 3 lines
Best Regards,
Reinhard
v2 cover Add support for the MMC device to the vexpress
Hello Matt Waddel,
Quoted 8 lines
Quoted 3 lines
Sorry, my original comment still holds true for the naming, now the name suggests that this driver is generic to ARM devices, which clearly is not true.
Correct. However, this hardware device was developed by ARM (the company). As far as I know the other ARM mmc drivers, like the
omap3_mmc, are not. So that would be the difference between the naming of these drivers.
I see. The "problem" is that ARM is a company, an architecture, and now even an IP manufacturer...
Quoted 4 lines
I don't feel like this driver should be named after a particular platform like vexpress, since this driver could be used in any ARM hardware.
Correct.
Quoted 24 lines
Quoted 5 lines
Can you list which devices have a MMCI that is covered by this driver? PL180 only? Or a series of PLxxx? It should be possible to find a naming that is more descriptive than "arm".
The PL180 is the name assigned to the hardware in the SOC. Here is the description of device from the 1st paragraph in the manual:
1.1 About the ARM PrimeCell Multimedia Card Interface (PL180)
The PrimeCell Multimedia Card Interface (MCI) is an Advanced
Microcontroller Bus Architecture(AMBA) compliant, System-on-a-Chip (SoC) peripheral that is developed, tested, and licensed by ARM.
----As far as other platforms that use this hardware, it is in some of the other ARM EVMs and some STEricsson platforms like the u300 and u8500.
Quoted 3 lines
(That such a generic name slipped into the kernel must not imply we have to make the same mistake in u-boot)
Quoted 6 lines
I agree. However, it would be nice to have a bit of a link between the device in the kernel and the one in u-boot and I didn't think having "
_mmci" in the name would be too objectionable.Would
pl180_mmci.cwork? or how aboutarm_pl180_mmc.c? I'm open to other suggestions.
Yes, after what you have described, is it to be expected that it is always designated as PL180 when licensed and used by a SoC nanufacturer? "arm_pl180_mmci" would be best then, I think. That leaves the namespace open for other "arm_*_mmci" controllers that might appear in the future.
Best regards,
Reinhard
PATCH v2 2/3 MMC: Add support for PL180 ARM mmc device
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Add support for the ARM PrimeCell MultiMedia Interface - PL180. Ported from original device driver written by ST-Ericsson.
--- drivers/mmc/Makefile | 1 + drivers/mmc/arm_mmci.c | 452 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/arm_mmci.h | 183 +++++++++++++++++++ 3 files changed, 636 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/arm_mmci.c create mode 100644 drivers/mmc/arm_mmci.h
drivers/mmc/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o COBJS-$(CONFIG_GENERIC_MMC) += mmc.o COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o +COBJS-$(CONFIG_ARM_MMCI) += arm_mmci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
drivers/mmc/arm_mmci.c new file +452 -0
452 lines not on this page · raw message
drivers/mmc/arm_mmci.h new file +183 -0
183 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v2 3/3 ARMV7: Vexpress: Add MMC support
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
--- board/armltd/vexpress/ca9x4_ct_vxp.c | 9 +++++++++ include/configs/ca9x4_ct_vxp.h | 4 ++++ 2 files changed, 13 insertions(+), 0 deletions(-)
board/armltd/vexpress/ca9x4_ct_vxp.c +9 -0
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)return rc; } +int cpu_mmc_init (bd_t *bis) +{ +int rc =0 ; +#ifdef CONFIG_ARM_MMCI + rc =arm_mmci_init (); +#endif +return rc; +} +static void flash__init (void ) {/* Setup the sytem control register to allow writing to flash */
include/configs/ca9x4_ct_vxp.h +4 -0
@@ -86,6 +86,10 @@#define CONFIG_MMC 1#define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ARM_MMCI +#define CONFIG_ARM_MMCI_BASE 0x10005000 +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 +#define CONFIG_ARM_MMCI_CLOCK_FREQ 6250000/* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE
Signature · 1 line
1.7.1
v3 cover Add support for the MMC device to the vexpress
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
---
Change log:
v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
Fixed conflicting fuction call and added prototype to arm_mmci.h
v3 - Rename patch items (arm_mmci -> arm_pl180_mmci)
(Note: Patch 1/3 still did not change with these corrections)
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC support
board/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/arm_pl180_mmci.c | 452 ++++++++++++++++++++++++++++++++++ drivers/mmc/arm_pl180_mmci.h | 183 ++++++++++++++ drivers/mmc/mmc.c | 19 +- include/configs/ca9x4_ct_vxp.h | 4 + 6 files changed, 658 insertions(+), 10 deletions(-) create mode 100644 drivers/mmc/arm_pl180_mmci.c create mode 100644 drivers/mmc/arm_pl180_mmci.h
PATCH v3 2/3 MMC: Add support for PL180 ARM mmc device
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Add support for the ARM PrimeCell MultiMedia Interface - PL180. Ported from original device driver written by ST-Ericsson.
--- drivers/mmc/Makefile | 1 + drivers/mmc/arm_pl180_mmci.c | 452 ++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/arm_pl180_mmci.h | 183 +++++++++++++++++ 3 files changed, 636 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/arm_pl180_mmci.c create mode 100644 drivers/mmc/arm_pl180_mmci.h
drivers/mmc/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o COBJS-$(CONFIG_GENERIC_MMC) += mmc.o COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o +COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
drivers/mmc/arm_pl180_mmci.c new file +452 -0
452 lines not on this page · raw message
drivers/mmc/arm_pl180_mmci.h new file +183 -0
183 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v3 2/3 MMC: Add support for PL180 ARM mmc device
Review
Quoted 11 lines · On Wed, Mar 2, 2011 at 11:22 PM, <[email protected]> wrote:
(quoted diff) +11
-0+ +static int convert_from_bytes_to_power_of_two(unsigned int x) +{ + ? ? ? int y = 0; + ? ? ? y = (x & 0xAAAA) ? 1 : 0; + ? ? ? y |= ((x & 0xCCCC) ? 1 : 0) << 1; + ? ? ? y |= ((x & 0xF0F0) ? 1 : 0) << 2; + ? ? ? y |= ((x & 0xFF00) ? 1 : 0) << 3; + + ? ? ? return y; +}
Let's not try to be this clever. U-Boot already has a function that tells you which power of two a number corresponds to. Unless the caller of this will be highly sensitive to several cycles that you may gain from knowing that the input is already a power-of-two, there's just no cause to creating a separate implementation of ffs().
Other than that, it looks fine, and as soon as you respin, I'll add it to the mmc tree.
Andy
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
--- board/armltd/vexpress/ca9x4_ct_vxp.c | 9 +++++++++ include/configs/ca9x4_ct_vxp.h | 4 ++++ 2 files changed, 13 insertions(+), 0 deletions(-)
board/armltd/vexpress/ca9x4_ct_vxp.c +9 -0
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)return rc; } +int cpu_mmc_init (bd_t *bis) +{ +int rc =0 ; +#ifdef CONFIG_ARM_PL180_MMCI + rc =arm_pl180_mmci_init (); +#endif +return rc; +} +static void flash__init (void ) {/* Setup the sytem control register to allow writing to flash */
include/configs/ca9x4_ct_vxp.h +4 -0
@@ -86,6 +86,10 @@#define CONFIG_MMC 1#define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ARM_PL180_MMCI +#define CONFIG_ARM_PL180_MMCI_BASE 0x10005000 +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 +#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 6250000/* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE
Signature · 1 line
1.7.1
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
Quoted 5 lines · On Wed, Mar 2, 2011 at 11:22 PM, <[email protected]> wrote:
From: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
Signed-off-by Matt Waddel <[email protected]>
Looks fine to me. I can apply this to my tree if that's fine with the maintainer. If not, I'm also OK if the maintainer wants to pull in the driver patch (with the previously-mentioned small change).
Either way:
Andy
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
Quoted 10 lines · Andy Fleming
Quoted 5 lines · On Wed, Mar 2, 2011 at 11:22 PM, <[email protected]> wrote:
From: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
Signed-off-by Matt Waddel <[email protected]>Looks fine to me. I can apply this to my tree if that's fine with the maintainer. If not, I'm also OK if the maintainer wants to pull in the driver patch (with the previously-mentioned small change).
Hi Andy,
I made the ffs() change you suggested and have posted a 4th version of the 3 patches (even though the 2nd one was the only one that changed, I wanted to make sure they were all still in sync with the repository).
If you could apply these to your tree that would be great.
Quoted 3 lines
Either way:
Acked-by Andy Fleming <[email protected]>
Thanks,
Matt
Quoted 6 lines
Andy
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
Quoted 35 lines · Matt Waddel
Quoted 10 lines · Andy Fleming
Quoted 5 lines · On Wed, Mar 2, 2011 at 11:22 PM, ?<[email protected]> wrote:
From: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
Signed-off-by Matt Waddel <[email protected]>Looks fine to me. ?I can apply this to my tree if that's fine with the maintainer. ?If not, I'm also OK if the maintainer wants to pull in the driver patch (with the previously-mentioned small change).
Hi Andy,
I made the
ffs()change you suggested and have posted a 4th version of the 3 patches (even though the 2nd one was the only one that changed, I wanted to make sure they were all still in sync with the repository).If you could apply these to your tree that would be great.
Quoted 3 lines
Either way:
Acked-by Andy Fleming <[email protected]>Thanks,
MattQuoted 6 lines
Andy
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Quoted 5 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Andy, Matt:
What is the plan for getting the pl180 mmc driver commited? I need it in before my U8500 board patches can be commited.
Thanks,
John
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
It's on my todo list for today
Quoted 50 lines · John Rigby
Quoted 35 lines · Matt Waddel
Quoted 10 lines · Andy Fleming
Quoted 5 lines · On Wed, Mar 2, 2011 at 11:22 PM, <[email protected]> wrote:
From: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
Signed-off-by Matt Waddel <[email protected]>Looks fine to me. I can apply this to my tree if that's fine with the maintainer. If not, I'm also OK if the maintainer wants to pull in the driver patch (with the previously-mentioned small change).
Hi Andy,
I made the
ffs()change you suggested and have posted a 4th version of the 3 patches (even though the 2nd one was the only one that changed, I wanted to make sure they were all still in sync with the repository).If you could apply these to your tree that would be great.
Quoted 3 lines
Either way:
Acked-by Andy Fleming <[email protected]>Thanks,
MattQuoted 6 lines
Andy
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootQuoted 5 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootAndy, Matt:
What is the plan for getting the pl180 mmc driver commited? I need it in before my U8500 board patches can be commited.
Thanks,
John
PATCH v3 3/3 ARMV7: Vexpress: Add MMC support
Quoted 1 line · Andy Fleming
It's on my todo list for today
Thanks!
v4 cover Add support for the MMC device to the vexpress
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
These patches add support for the ARM PrimeCell PL180 MultiMedia Interface. The Versatile Express was the test platform for these changes.
---
Change log:
v2 - Rename patch items to a more descriptive name (ie. mmci -> arm_mmci)
Fixed conflicting fuction call and added prototype to arm_mmci.h
v3 - Rename patch items (arm_mmci -> arm_pl180_mmci)
(Note: Patch 1/3 still did not change with these corrections)
v4 - Removed convert_from_bytes_to_power_of_two() routine and used generic ffs
call instead. (Feedback from Andy Fleming.)
Matt Waddel (3):
MMC: Max blocks value adjustable
MMC: Add support for PL180 ARM mmc device
ARMV7: Vexpress: Add MMC support
board/armltd/vexpress/ca9x4_ct_vxp.c | 9 + drivers/mmc/Makefile | 1 + drivers/mmc/arm_pl180_mmci.c | 441 ++++++++++++++++++++++++++++++++++ drivers/mmc/arm_pl180_mmci.h | 183 ++++++++++++++ drivers/mmc/mmc.c | 19 +- include/configs/ca9x4_ct_vxp.h | 4 + 6 files changed, 647 insertions(+), 10 deletions(-) create mode 100644 drivers/mmc/arm_pl180_mmci.c create mode 100644 drivers/mmc/arm_pl180_mmci.h
Signature · 1 line
1.7.4.1
PATCH v4 1/3 MMC: Max blocks value adjustable
From: Matt Waddel <[email protected]>
The maximum blocks value was hardcoded to 65535 due to a 16 bit register length. The value can change for different platforms. This patch makes the default the current value of 65535, but it is configurable for other platforms.
--- drivers/mmc/mmc.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-)
drivers/mmc/mmc.c +9 -10
@@ -33,6 +33,11 @@#include <mmc.h> #include <div64.h> +/* Set block count limit because of 16 bit register limit on some hardware*/ +#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535 +#endif +static struct list_head mmc_devices;static int cur_dev_num =-1 ;
@@ -139,11 +144,8 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)return 0 ; do { - /* - * The 65535 constraint comes from some hardware has - * only 16 bit width block number counter - */ - cur = (blocks_todo > 65535) ? 65535 : blocks_todo; + cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ? + CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo; if(mmc_write_blocks(mmc, start, cur, src) != cur) return 0; blocks_todo -= cur;
@@ -215,11 +217,8 @@ static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)return 0 ; do { - /* - * The 65535 constraint comes from some hardware has - * only 16 bit width block number counter - */ - cur = (blocks_todo > 65535) ? 65535 : blocks_todo; + cur = (blocks_todo > CONFIG_SYS_MMC_MAX_BLK_COUNT) ? + CONFIG_SYS_MMC_MAX_BLK_COUNT : blocks_todo; if(mmc_read_blocks(mmc, dst, start, cur) != cur) return 0; blocks_todo -= cur;
Signature · 1 line
1.7.4.1
PATCH v4 2/3 MMC: Add support for PL180 ARM mmc device
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Add support for the ARM PrimeCell MultiMedia Interface - PL180. Ported from original device driver written by ST-Ericsson.
--- drivers/mmc/Makefile | 1 + drivers/mmc/arm_pl180_mmci.c | 441 ++++++++++++++++++++++++++++++++++++++++++ drivers/mmc/arm_pl180_mmci.h | 183 +++++++++++++++++ 3 files changed, 625 insertions(+), 0 deletions(-) create mode 100644 drivers/mmc/arm_pl180_mmci.c create mode 100644 drivers/mmc/arm_pl180_mmci.h
drivers/mmc/Makefile +1 -0
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o COBJS-$(CONFIG_GENERIC_MMC) += mmc.o COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o +COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
drivers/mmc/arm_pl180_mmci.c new file +441 -0
441 lines not on this page · raw message
drivers/mmc/arm_pl180_mmci.h new file +183 -0
183 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH v4 3/3 ARMV7: Vexpress: Add MMC support
In reply to matt.waddel at linaro.orgFrom: Matt Waddel <[email protected]>
Added the board specific definitions to use the MMCI device.
--- board/armltd/vexpress/ca9x4_ct_vxp.c | 9 +++++++++ include/configs/ca9x4_ct_vxp.h | 4 ++++ 2 files changed, 13 insertions(+), 0 deletions(-)
board/armltd/vexpress/ca9x4_ct_vxp.c +9 -0
@@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis)return rc; } +int cpu_mmc_init (bd_t *bis) +{ +int rc =0 ; +#ifdef CONFIG_ARM_PL180_MMCI + rc =arm_pl180_mmci_init (); +#endif +return rc; +} +static void flash__init (void ) {/* Setup the sytem control register to allow writing to flash */
include/configs/ca9x4_ct_vxp.h +4 -0
@@ -86,6 +86,10 @@#define CONFIG_MMC 1#define CONFIG_CMD_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ARM_PL180_MMCI +#define CONFIG_ARM_PL180_MMCI_BASE 0x10005000 +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 127 +#define CONFIG_ARM_PL180_MMCI_CLOCK_FREQ 6250000/* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE
Signature · 1 line
1.7.4.1