add mmc support for pantheon platform
Subsystems (2)
cover add mmc support for pantheon platform
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Lei Wen (3):
ARM: pantheon: add mmc definition
Marvell: dkb: add mmc support
mmc: mv_sdhci: fix 8bus width access for 88SV331xV5
arch/arm/include/asm/arch-pantheon/config.h | 17 ++++++++++++ arch/arm/include/asm/arch-pantheon/cpu.h | 1 + arch/arm/include/asm/arch-pantheon/mfp.h | 12 ++++++++ board/Marvell/dkb/dkb.c | 37 +++++++++++++++++++++++++++ drivers/mmc/mv_sdhci.c | 33 ++++++++++++++++++++++++ include/configs/dkb.h | 1 + 6 files changed, 101 insertions(+), 0 deletions(-)
PATCH 1/3 ARM: pantheon: add mmc definition
--- arch/arm/include/asm/arch-pantheon/config.h | 17 +++++++++++++++++ arch/arm/include/asm/arch-pantheon/cpu.h | 1 + arch/arm/include/asm/arch-pantheon/mfp.h | 12 ++++++++++++ 3 files changed, 30 insertions(+), 0 deletions(-)
arch/arm/include/asm/arch-pantheon/config.h +17 -0
@@ -45,4 +45,21 @@#define CONFIG_SYS_I2C_SLAVE 0xfe#endif +/* +* MMC definition +*/ +#ifdef CONFIG_CMD_MMC +#define CONFIG_CMD_FAT 1 +#define CONFIG_MMC 1 +#define CONFIG_GENERIC_MMC 1 +#define CONFIG_SDHCI 1 +#define CONFIG_MMC_SDHCI_IO_ACCESSORS 1 +#define CONFIG_MMC_SDMA 1 +#define CONFIG_MV_SDHCI 1 +#define CONFIG_DOS_PARTITION 1 +#define CONFIG_EFI_PARTITION 1 +#define CONFIG_SYS_MMC_NUM 2 +#define CONFIG_SYS_MMC_BASE {0xD4280000, 0xd4281000} +#endif +#endif /* _PANTHEON_CONFIG_H */
arch/arm/include/asm/arch-pantheon/cpu.h +1 -0
@@ -77,5 +77,6 @@ struct panthcpu_registers {*/ u32 panth_sdram_base (int );u32 panth_sdram_size (int ); +int mv_sdh_init (u32 regbase,u32 max_clk,u32 min_clk,u32 quirks);#endif /* _PANTHEON_CPU_H */
arch/arm/include/asm/arch-pantheon/mfp.h +12 -0
@@ -38,6 +38,18 @@#define MFP54_CI2C_SDA (MFP_REG(0x1b4) | MFP_AF2 | MFP_DRIVE_MEDIUM)/* More macros can be defined here... */ +#define MFP_MMC1_DAT7 (MFP_REG(0x84) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT6 (MFP_REG(0x88) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT5 (MFP_REG(0x8c) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT4 (MFP_REG(0x90) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT3 (MFP_REG(0x94) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT2 (MFP_REG(0x98) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT1 (MFP_REG(0x9c) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT0 (MFP_REG(0xa0) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CMD (MFP_REG(0xa4) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CLK (MFP_REG(0xa8) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CD (MFP_REG(0xac) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_WP (MFP_REG(0xb0) | MFP_AF0 | MFP_DRIVE_MEDIUM)#define MFP_PIN_MAX 117#endif
Signature · 1 line
1.7.0.4
PATCH 2/3 Marvell: dkb: add mmc support
In reply to Lei Wen--- board/Marvell/dkb/dkb.c | 37 +++++++++++++++++++++++++++++++++++++ include/configs/dkb.h | 1 + 2 files changed, 38 insertions(+), 0 deletions(-)
board/Marvell/dkb/dkb.c +37 -0
@@ -24,8 +24,12 @@#include <common.h> #include <mvmfp.h> +#include <i2c.h> #include <asm/arch/mfp.h> #include <asm/arch/cpu.h> +#ifdef CONFIG_GENERIC_MMC +#include <sdhci.h> +#endif DECLARE_GLOBAL_DATA_PTR ;
@@ -40,6 +44,20 @@ int board_early_init_f(void)MFP53_CI2C_SCL ,MFP54_CI2C_SDA , +/* MMC1 */ +MFP_MMC1_DAT7 , +MFP_MMC1_DAT6 , +MFP_MMC1_DAT5 , +MFP_MMC1_DAT4 , +MFP_MMC1_DAT3 , +MFP_MMC1_DAT2 , +MFP_MMC1_DAT1 , +MFP_MMC1_DAT0 , +MFP_MMC1_CMD , +MFP_MMC1_CLK , +MFP_MMC1_CD , +MFP_MMC1_WP , +MFP_EOC /*End of configureation*/ };/* configure MFP's */
@@ -56,3 +74,22 @@ int board_init(void) gd->bd->bi_boot_params =panth_sdram_base (0 ) +0x100 ;return 0 ; } + +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init (bd_t *bd) +{ +ulong mmc_base_address[CONFIG_SYS_MMC_NUM ] =CONFIG_SYS_MMC_BASE ; +u8 i, data; + data =0xd ; +i2c_write (0x34 ,0x28 ,1 , &data,1 ); + +for (i =0 ; i <CONFIG_SYS_MMC_NUM ; i++) { +if (mv_sdh_init (mmc_base_address[i],0 ,0 , +SDHCI_QUIRK_32BIT_DMA_ADDR )) +return 1 ; + } + *(unsigned int *)0xd4282854 =0x1b ; + *(unsigned int *)0xd42828e0 =0x1b ; +return 0 ; +} +#endif
include/configs/dkb.h +1 -0
@@ -47,6 +47,7 @@#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ #include <config_cmd_default.h> #define CONFIG_CMD_I2C +#define CONFIG_CMD_MMC #undef CONFIG_CMD_NET#undef CONFIG_CMD_NFS/*
Signature · 1 line
1.7.0.4
PATCH 2/3 Marvell: dkb: add mmc support
Quoted 5 lines · Lei Wen
Signed-off-by Lei Wen <[email protected]>--- board/Marvell/dkb/dkb.c | 37 +++++++++++++++++++++++++++++++++++++ include/configs/dkb.h | 1 + 2 files changed, 38 insertions(+), 0 deletions(-)
Dear Lei Wen,
[...]
board/Marvell/dkb/dkb.c int board_init(void) · line 83
Quoted 11 lines
board/Marvell/dkb/dkb.c +7
-0@@ -56,3 +74,22 @@ int board_init(void) gd->bd->bi_boot_params =panth_sdram_base (0 ) +0x100 ;return 0 ; } + +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init (bd_t *bd) +{ +ulong mmc_base_address[CONFIG_SYS_MMC_NUM ] =CONFIG_SYS_MMC_BASE ; +u8 i, data; + data =0xd ;
Magic value ?
board/Marvell/dkb/dkb.c int board_init(void) · line 84
Quoted 1 line
board/Marvell/dkb/dkb.c +1
-0+i2c_write (0x34 ,0x28 ,1 , &data,1 );
More magic values ?
board/Marvell/dkb/dkb.c int board_init(void) · line 92
Quoted 8 lines
board/Marvell/dkb/dkb.c +8
-0+ +for (i =0 ; i <CONFIG_SYS_MMC_NUM ; i++) { +if (mv_sdh_init (mmc_base_address[i],0 ,0 , +SDHCI_QUIRK_32BIT_DMA_ADDR )) +return 1 ; + } + *(unsigned int *)0xd4282854 =0x1b ; + *(unsigned int *)0xd42828e0 =0x1b ;
Magic value and not using writel() ?
Quoted 8 lines
board/Marvell/dkb/dkb.c +3
-0+ return 0; +} +#endif include/configs/dkb.h +0
-0
include/configs/dkb.h line 53
Quoted 7 lines
include/configs/dkb.h +1
-0@@ -47,6 +47,7 @@#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ #include <config_cmd_default.h> #define CONFIG_CMD_I2C +#define CONFIG_CMD_MMC #undef CONFIG_CMD_NET#undef CONFIG_CMD_NFS/*
This should be in a separate patch maybe ?
Cheers
PATCH 2/3 Marvell: dkb: add mmc support
Hi Marek,
Quoted 25 lines · Marek Vasut
Quoted 5 lines · Lei Wen
Signed-off-by Lei Wen <[email protected]>---
?board/Marvell/dkb/dkb.c | ? 37 +++++++++++++++++++++++++++++++++++++ ?include/configs/dkb.h ? | ? ?1 +
?2 files changed, 38 insertions(+), 0 deletions(-)Dear Lei Wen,
[...]
Review int board_init(void) · line 83
Quoted 11 lines
(quoted diff) +7
-0@@ -56,3 +74,22 @@ int board_init(void) ? ? ? gd->bd->bi_boot_params = panth_sdram_base(0) + 0x100; ? ? ? return 0; ?} + +#ifdef CONFIG_GENERIC_MMC +int board_mmc_init(bd_t *bd) +{ + ? ? ulong mmc_base_address[CONFIG_SYS_MMC_NUM] = CONFIG_SYS_MMC_BASE; + ? ? u8 i, data; + ? ? data = 0xd;Magic value ?
Quoted 3 lines
Review int board_init(void) · line 84
Quoted 1 line
(quoted diff) +1
-0+ ? ? i2c_write(0x34, 0x28, 1, &data, 1);More magic values ?
The magic number stand for the pmic chip address and its corresponding register address.
Since we don't want to add a complex pmic driver here... How about just define those
magic number with macro?
Quoted 11 lines
Review int board_init(void) · line 92
Quoted 9 lines
(quoted diff) +8
-0+ + ? ? for (i = 0; i < CONFIG_SYS_MMC_NUM; i++) { + ? ? ? ? ? ? if (mv_sdh_init(mmc_base_address[i], 0, 0, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? SDHCI_QUIRK_32BIT_DMA_ADDR)) + ? ? ? ? ? ? ? ? ? ? return 1; + ? ? } + ? ? *(unsigned int *)0xd4282854 = 0x1b; + ? ? *(unsigned int *)0xd42828e0 = 0x1b;Magic value and not using
writel()?
Opps, this should move to the cpu_init as a part of apmu clock enabling.
Quoted 10 lines
Quoted 10 lines
board/Marvell/dkb/dkb.c +3
-0+ ? ? return 0; +} +#endif include/configs/dkb.h +0
-0@@ -47,6 +47,7 @@?#define
CONFIG_SYS_NO_FLASH? ? ? ? ?/* Declare no flash (NOR/SPI) */
Quoted 8 lines
Quoted 6 lines
?#include <
config_cmd_default.h>
?#defineCONFIG_CMD_I2C
+#defineCONFIG_CMD_MMC
?#undefCONFIG_CMD_NET
?#undefCONFIG_CMD_NFS
?/*This should be in a separate patch maybe ?
Ok, would do in the next patch.
Thanks,
Lei
PATCH 3/3 mmc: mv_sdhci: fix 8bus width access for 88SV331xV5
In reply to Lei WenMarvell 88SV331xV5 platform's sdhci host control is not very standard with the spec in the 8bit handling. It need to set its private register to switch to the 8bit mode which is not included in the standard sdhci registers.
This patch mainly hacks the writeb method, and set its private register if it find the driver is going to switch to the 8bit mode.
--- drivers/mmc/mv_sdhci.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
drivers/mmc/mv_sdhci.c +33 -0
@@ -2,6 +2,33 @@#include <malloc.h> #include <sdhci.h> +#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS +static struct sdhci_ops mv_ops; + +#if defined(CONFIG_SHEEVA_88SV331xV5) +#define SD_CE_ATA_2 0xEA +#define MMC_CARD 0x1000 +#define MMC_WIDTH 0x0100 +static inline void mv_sdhci_writeb (struct sdhci_host *host,u8 val,int reg) +{ +struct mmc *mmc = host->mmc; +u32 ata = (u32 )host->ioaddr +SD_CE_ATA_2 ; + +if (!IS_SD (mmc) && reg ==SDHCI_HOST_CONTROL ) { +if (mmc->bus_width ==8 ) +writew (readw (ata) | (MMC_CARD |MMC_WIDTH ), ata); +else +writew (readw (ata) & ~(MMC_CARD |MMC_WIDTH ), ata); + } + +writeb (val, host->ioaddr + reg); +} + +#else +#define mv_sdhci_writeb NULL +#endif /* CONFIG_SHEEVA_88SV331xV5 */ +#endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */ +static char *MVSDH_NAME ="mv_sdh" ;int mv_sdh_init (u32 regbase,u32 max_clk,u32 min_clk,u32 quirks) {
@@ -15,6 +42,12 @@ int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) host->name =MVSDH_NAME ; host->ioaddr = (void *)regbase; host->quirks = quirks; +#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS +memset (&mv_ops,0 ,sizeof (struct sdhci_ops )); +if (mv_sdhci_writeb !=NULL ) + mv_ops.write_b = mv_sdhci_writeb; + host->ops = &mv_ops; +#endif host->version =sdhci_readw (host,SDHCI_HOST_VERSION );add_sdhci (host, max_clk, min_clk);return 0 ;
Signature · 1 line
1.7.0.4
v2 cover add mmc support for pantheon platform
In reply to Lei WenThis patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure
respectively.
remove enable mmc function into seperated patch
Lei Wen (4):
ARM: pantheon: add mmc definition
Marvell: dkb: add mmc support
dkb: make mmc command as default enabled
mmc: mv_sdhci: fix 8bus width access for 88SV331xV5
arch/arm/cpu/arm926ejs/pantheon/cpu.c | 11 ++++++ arch/arm/include/asm/arch-pantheon/config.h | 18 ++++++++++ arch/arm/include/asm/arch-pantheon/cpu.h | 12 +++++++ arch/arm/include/asm/arch-pantheon/mfp.h | 12 +++++++ arch/arm/include/asm/arch-pantheon/pantheon.h | 7 ++++ board/Marvell/dkb/dkb.c | 43 +++++++++++++++++++++++++ drivers/mmc/mv_sdhci.c | 33 +++++++++++++++++++ include/configs/dkb.h | 1 + 8 files changed, 137 insertions(+), 0 deletions(-)
v2 cover add mmc support for pantheon platform
Hi Lei Wen,
Le 04/10/2011 08:33, Lei Wen a ?crit :
Quoted 9 lines
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure
respectively.
remove enable mmc function into seperated patch
Quoted 5 lines
Lei Wen (4):
ARM: pantheon: add mmc definition
Marvell: dkb: add mmc support
dkb: make mmc command as default enabled
mmc:mv_sdhci: fix 8bus width access for 88SV331xV5
This causes a lot of build errors on dkb with ELDK42:
Configuring for dkb board...
In file included from mv_sdhci.c:3:/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: its scope is only this definition or declaration, which is probably not what you want /home/uboot/src/u-boot-arm/include/sdhci.h:225: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h:226: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h:227: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h:228: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h:229: warning: 'struct sdhci_host' declared inside parameter list /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writel':/home/uboot/src/u-boot-arm/include/sdhci.h:247: warning: passing argument 1 of 'host->ops->write_l' from incompatible pointer type /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writew':/home/uboot/src/u-boot-arm/include/sdhci.h:255: warning: passing argument 1 of 'host->ops->write_w' from incompatible pointer type /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writeb':/home/uboot/src/u-boot-arm/include/sdhci.h:263: warning: passing argument 1 of 'host->ops->write_b' from incompatible pointer type /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readl':/home/uboot/src/u-boot-arm/include/sdhci.h:271: warning: passing argument 1 of 'host->ops->read_l' from incompatible pointer type /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readw':/home/uboot/src/u-boot-arm/include/sdhci.h:279: warning: passing argument 1 of 'host->ops->read_w' from incompatible pointer type /home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readb':/home/uboot/src/u-boot-arm/include/sdhci.h:287: warning: passing argument 1 of 'host->ops->read_b' from incompatible pointer type mv_sdhci.c: In function 'mv_sdhci_writeb':
mv_sdhci.c:14: error: 'struct sdhci_host' has no member named 'mmc' mv_sdhci.c:17: warning: implicit declaration of function 'IS_SD' mv_sdhci.c:18: error: dereferencing pointer to incomplete type mv_sdhci.c: In function 'mv_sdh_init':
mv_sdhci.c:48: warning: assignment from incompatible pointer type
Amicalement,
Signature · 1 line
Albert.
v2 cover add mmc support for pantheon platform
Hi Albert,
Quoted 52 lines · Albert ARIBAUD
Hi Lei Wen,
Le 04/10/2011 08:33, Lei Wen a ?crit :
Quoted 9 lines
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure ? ? ? respectively.
? ? ?remove enable mmc function into seperated patchQuoted 5 lines
Lei Wen (4):
? ?ARM: pantheon: add mmc definition
? ?Marvell: dkb: add mmc support
? ?dkb: make mmc command as default enabled
? ?mmc:mv_sdhci: fix 8bus width access for 88SV331xV5This causes a lot of build errors on dkb with ELDK42:
Configuring for dkb board...
In file included from mv_sdhci.c:3:/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: its scope is only this definition or declaration, which is probably not what you want/home/uboot/src/u-boot-arm/include/sdhci.h:225: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:226: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:227: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:228: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:229: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writel':/home/uboot/src/u-boot-arm/include/sdhci.h:247: warning: passing argument 1 of 'host->ops->write_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writew':/home/uboot/src/u-boot-arm/include/sdhci.h:255: warning: passing argument 1 of 'host->ops->write_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writeb':/home/uboot/src/u-boot-arm/include/sdhci.h:263: warning: passing argument 1 of 'host->ops->write_b' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readl':/home/uboot/src/u-boot-arm/include/sdhci.h:271: warning: passing argument 1 of 'host->ops->read_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readw':/home/uboot/src/u-boot-arm/include/sdhci.h:279: warning: passing argument 1 of 'host->ops->read_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readb':
Quoted 9 lines
/home/uboot/src/u-boot-arm/include/sdhci.h:287: warning: passing argument 1 of 'host->ops->read_b' from incompatible pointer typemv_sdhci.c: In function 'mv_sdhci_writeb':
mv_sdhci.c:14: error: 'structsdhci_host' has no member named 'mmc' mv_sdhci.c:17: warning: implicit declaration of function 'IS_SD' mv_sdhci.c:18: error: dereferencing pointer to incomplete typemv_sdhci.c: In function 'mv_sdh_init':
mv_sdhci.c:48: warning: assignment from incompatible pointer type
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.
You could refer to:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/111621
Best regards,
Lei
v2 cover add mmc support for pantheon platform
Hi Lei Wen,
Le 25/10/2011 03:21, Lei Wen a ?crit :
Quoted 66 lines
Hi Albert,
Quoted 52 lines · Albert ARIBAUD
Hi Lei Wen,
Le 04/10/2011 08:33, Lei Wen a ?crit :
Quoted 9 lines
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure
respectively.
remove enable mmc function into seperated patchQuoted 5 lines
Lei Wen (4):
ARM: pantheon: add mmc definition
Marvell: dkb: add mmc support
dkb: make mmc command as default enabled
mmc:mv_sdhci: fix 8bus width access for 88SV331xV5This causes a lot of build errors on dkb with ELDK42:
Configuring for dkb board...
In file included from mv_sdhci.c:3:/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: its scope is only this definition or declaration, which is probably not what you want/home/uboot/src/u-boot-arm/include/sdhci.h:225: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:226: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:227: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:228: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:229: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writel':/home/uboot/src/u-boot-arm/include/sdhci.h:247: warning: passing argument 1 of 'host->ops->write_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writew':/home/uboot/src/u-boot-arm/include/sdhci.h:255: warning: passing argument 1 of 'host->ops->write_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writeb':/home/uboot/src/u-boot-arm/include/sdhci.h:263: warning: passing argument 1 of 'host->ops->write_b' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readl':/home/uboot/src/u-boot-arm/include/sdhci.h:271: warning: passing argument 1 of 'host->ops->read_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readw':/home/uboot/src/u-boot-arm/include/sdhci.h:279: warning: passing argument 1 of 'host->ops->read_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readb':Quoted 9 lines
/home/uboot/src/u-boot-arm/include/sdhci.h:287: warning: passing argument 1 of 'host->ops->read_b' from incompatible pointer typemv_sdhci.c: In function 'mv_sdhci_writeb':
mv_sdhci.c:14: error: 'structsdhci_host' has no member named 'mmc' mv_sdhci.c:17: warning: implicit declaration of function 'IS_SD' mv_sdhci.c:18: error: dereferencing pointer to incomplete typemv_sdhci.c: In function 'mv_sdh_init':
mv_sdhci.c:48: warning: assignment from incompatible pointer type
Quoted 6 lines
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.You could refer to:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/111621
Thanks for the pointer -- please next time indicate the dependency on any patch set not yet applied at the time.
Quoted 2 lines
Best regards,
Lei
Amicalement,
Signature · 1 line
Albert.
v2 cover add mmc support for pantheon platform
Le 25/10/2011 08:15, Albert ARIBAUD a ?crit :
Quoted 73 lines
Hi Lei Wen,
Le 25/10/2011 03:21, Lei Wen a ?crit :
Quoted 70 lines
Hi Albert,
Quoted 52 lines · Albert ARIBAUD
Hi Lei Wen,
Le 04/10/2011 08:33, Lei Wen a ?crit :
Quoted 9 lines
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure
respectively.
remove enable mmc function into seperated patchQuoted 5 lines
Lei Wen (4):
ARM: pantheon: add mmc definition
Marvell: dkb: add mmc support
dkb: make mmc command as default enabled
mmc:mv_sdhci: fix 8bus width access for 88SV331xV5This causes a lot of build errors on dkb with ELDK42:
Configuring for dkb board...
In file included from mv_sdhci.c:3:/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: its scope is only this definition or declaration, which is probably not what you want/home/uboot/src/u-boot-arm/include/sdhci.h:225: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:226: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:227: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:228: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:229: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writel':/home/uboot/src/u-boot-arm/include/sdhci.h:247: warning: passing argument 1 of 'host->ops->write_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writew':/home/uboot/src/u-boot-arm/include/sdhci.h:255: warning: passing argument 1 of 'host->ops->write_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writeb':/home/uboot/src/u-boot-arm/include/sdhci.h:263: warning: passing argument 1 of 'host->ops->write_b' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readl':/home/uboot/src/u-boot-arm/include/sdhci.h:271: warning: passing argument 1 of 'host->ops->read_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readw':/home/uboot/src/u-boot-arm/include/sdhci.h:279: warning: passing argument 1 of 'host->ops->read_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readb':Quoted 9 lines
/home/uboot/src/u-boot-arm/include/sdhci.h:287: warning: passing argument 1 of 'host->ops->read_b' from incompatible pointer typemv_sdhci.c: In function 'mv_sdhci_writeb':
mv_sdhci.c:14: error: 'structsdhci_host' has no member named 'mmc' mv_sdhci.c:17: warning: implicit declaration of function 'IS_SD' mv_sdhci.c:18: error: dereferencing pointer to incomplete typemv_sdhci.c: In function 'mv_sdh_init':
mv_sdhci.c:48: warning: assignment from incompatible pointer typeActually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.
Quoted 5 lines
Quoted 2 lines
You could refer to:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/111621Thanks for the pointer -- please next time indicate the dependency on any patch set not yet applied at the time.
I've tried applying the patches in the link you refer to, then the patch series given here, but the latter does not apply properly above the former on top of u-boot-arm/master. Can you check this?
Quoted 2 lines
Quoted 2 lines
Best regards,
Lei
Amicalement,
Signature · 1 line
Albert.
v2 cover add mmc support for pantheon platform
Hi Albert,
Quoted 82 lines · Albert ARIBAUD
Le 25/10/2011 08:15, Albert ARIBAUD a ?crit :
Quoted 81 lines
Hi Lei Wen,
Le 25/10/2011 03:21, Lei Wen a ?crit :
Quoted 76 lines
Hi Albert,
Quoted 55 lines · On Tue, Oct 25, 2011 at 1:20 AM, Albert ARIBAUD <[email protected]> ?…
Hi Lei Wen,
Le 04/10/2011 08:33, Lei Wen a ?crit :
Quoted 11 lines
This patch seris add the mmc support for the pantheon platform. Also give platform like dkb and aspenite a workaround when enabling the 8bit mode for accessing the mmc.
Changelog:
V2: remove magic number, and replace it by macro definition and structure
? ? ? ?respectively.
? ? ? remove enable mmc function into seperated patchQuoted 5 lines
Lei Wen (4):
? ? ARM: pantheon: add mmc definition
? ? Marvell: dkb: add mmc support
? ? dkb: make mmc command as default enabled
? ? mmc:mv_sdhci: fix 8bus width access for 88SV331xV5This causes a lot of build errors on dkb with ELDK42:
Configuring for dkb board...
In file included from mv_sdhci.c:3:/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:224: warning: its scope is only this definition or declaration, which is probably not what you want/home/uboot/src/u-boot-arm/include/sdhci.h:225: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:226: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:227: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:228: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h:229: warning: 'structsdhci_host' declared inside parameter list/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writel':/home/uboot/src/u-boot-arm/include/sdhci.h:247: warning: passing argument 1 of 'host->ops->write_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writew':/home/uboot/src/u-boot-arm/include/sdhci.h:255: warning: passing argument 1 of 'host->ops->write_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_writeb':/home/uboot/src/u-boot-arm/include/sdhci.h:263: warning: passing argument 1 of 'host->ops->write_b' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readl':/home/uboot/src/u-boot-arm/include/sdhci.h:271: warning: passing argument 1 of 'host->ops->read_l' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readw':/home/uboot/src/u-boot-arm/include/sdhci.h:279: warning: passing argument 1 of 'host->ops->read_w' from incompatible pointer type/home/uboot/src/u-boot-arm/include/sdhci.h: In function 'sdhci_readb':Quoted 9 lines
/home/uboot/src/u-boot-arm/include/sdhci.h:287: warning: passing argument 1 of 'host->ops->read_b' from incompatible pointer typemv_sdhci.c: In function 'mv_sdhci_writeb':
mv_sdhci.c:14: error: 'structsdhci_host' has no member named 'mmc' mv_sdhci.c:17: warning: implicit declaration of function 'IS_SD' mv_sdhci.c:18: error: dereferencing pointer to incomplete typemv_sdhci.c: In function 'mv_sdh_init':
mv_sdhci.c:48: warning: assignment from incompatible pointer typeActually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.You could refer to:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/111621
Quoted 11 lines
Quoted 2 lines
Thanks for the pointer -- please next time indicate the dependency on any patch set not yet applied at the time.
I've tried applying the patches in the link you refer to, then the patch series given here, but the latter does not apply properly above the former on top of u-boot-arm/master. Can you check this?
Quoted 2 lines
Quoted 2 lines
Best regards,
Lei
I try to rebase the V4 of sdhci fixing patch over latest u-boot-arm.git, and find
there is no problem... Could you help check again?
Thanks,
Lei
v2 cover add mmc support for pantheon platform
In reply to Lei WenDear Lei Wen,
Quoted 4 lines · In message <CALZhoSR_jco_Ps5DxM8vtPk9eXCqoCPM0FiBDRat0uRHhw9qog@mail.gmail.com>…
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.
Then please squash your patches and submit a new, bug free patch.
We don't add (knowingly) broken code and only fix it later.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 I'd like to meet the man who invented sex and see what he's working on now.
v2 cover add mmc support for pantheon platform
Hi Wolfgang,
Quoted 11 lines · Wolfgang Denk
Dear Lei Wen,
Quoted 4 lines · In message <CALZhoSR_jco_Ps5DxM8vtPk9eXCqoCPM0FiBDRat0uRHhw9qog@mail.gmail.com>…
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.Then please squash your patches and submit a new, bug free patch.
We don't add (knowingly) broken code and only fix it later.
This patch seris itself is bug free indeed...
But like Albert says, this one has a dependency with another, which means it should be applied with
sequence...
So how about hold this patch till its dependency patch set got in?
Thanks,
Lei
v2 cover add mmc support for pantheon platform
Dear Lei Wen,
Quoted 5 lines · In message <CALZhoSQ42OfdTBV8pggNdhUgTTsVKVCPgyvQ0keSUJW+uQZT0Q@mail.gmail.com>…
Quoted 5 lines
Quoted 4 lines
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.
Quoted 8 lines
Quoted 3 lines
Then please squash your patches and submit a new, bug free patch.
We don't add (knowingly) broken code and only fix it later.
This patch seris itself is bug free indeed...
But like Albert says, this one has a dependency with another, which means it should be applied with
sequence...
No, this patch and the other one should be squashed.
Best regards,
Wolfgang Denk
Signature · 4 lines
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 Never call a man a fool. Borrow from him.
v2 cover add mmc support for pantheon platform
Hi Wolfgang,
Quoted 10 lines · Wolfgang Denk
Dear Lei Wen,
Quoted 7 lines · In message <CALZhoSQ42OfdTBV8pggNdhUgTTsVKVCPgyvQ0keSUJW+uQZT0Q@mail.gmail.com>…
Quoted 7 lines
Quoted 4 lines
Actually, I have post another fixing series before this, so if it got be applied before this merged,
the warning would be disappeared.Then please squash your patches and submit a new, bug free patch.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
We don't add (knowingly) broken code and only fix it later.
This patch seris itself is bug free indeed...
But like Albert says, this one has a dependency with another, which means it should be applied with
sequence...No, this patch and the other one should be squashed.
Do you mean that I should merge this mmc adding patch and the sdhci fixing patch together as one patch?
Thanks,
Lei
PATCH v2 1/4 ARM: pantheon: add mmc definition
In reply to Lei Wen---
Changelog:
V2: no change
arch/arm/cpu/arm926ejs/pantheon/cpu.c | 11 +++++++++++ arch/arm/include/asm/arch-pantheon/config.h | 18 ++++++++++++++++++ arch/arm/include/asm/arch-pantheon/cpu.h | 12 ++++++++++++ arch/arm/include/asm/arch-pantheon/mfp.h | 12 ++++++++++++ arch/arm/include/asm/arch-pantheon/pantheon.h | 7 +++++++ 5 files changed, 60 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/pantheon/cpu.c +11 -0
@@ -42,6 +42,9 @@ int arch_cpu_init(void)struct panthmpmu_registers *mpmu = (struct panthmpmu_registers *)PANTHEON_MPMU_BASE ; +struct panthapmu_registers *apmu = + (struct panthapmu_registers *)PANTHEON_APMU_BASE ; +/* set SEL_MRVL_ID bit in PANTHEON_CPU_CONF register */ val =readl (&cpuregs->cpu_conf); val = val |SET_MRVL_ID ;
@@ -65,6 +68,14 @@ int arch_cpu_init(void)writel (APBC_FNCLK |APBC_APBCLK , &apbclkres->twsi);#endif +#ifdef CONFIG_MV_SDHCI +/* Enable mmc clock */ +writel (APMU_PERI_CLK |APMU_AXI_CLK |APMU_PERI_RST |APMU_AXI_RST , + &apmu->sd1); +writel (APMU_PERI_CLK |APMU_AXI_CLK |APMU_PERI_RST |APMU_AXI_RST , + &apmu->sd3); +#endif +icache_enable ();return 0 ;
arch/arm/include/asm/arch-pantheon/config.h +18 -0
@@ -47,4 +47,22 @@#define CONFIG_SYS_I2C_SLAVE 0xfe#endif +/* +* MMC definition +*/ +#ifdef CONFIG_CMD_MMC +#define CONFIG_CMD_FAT 1 +#define CONFIG_MMC 1 +#define CONFIG_GENERIC_MMC 1 +#define CONFIG_SDHCI 1 +#define CONFIG_MMC_SDHCI_IO_ACCESSORS 1 +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 0x1000 +#define CONFIG_MMC_SDMA 1 +#define CONFIG_MV_SDHCI 1 +#define CONFIG_DOS_PARTITION 1 +#define CONFIG_EFI_PARTITION 1 +#define CONFIG_SYS_MMC_NUM 2 +#define CONFIG_SYS_MMC_BASE {0xD4280000, 0xd4281000} +#endif +#endif /* _PANTHEON_CONFIG_H */
arch/arm/include/asm/arch-pantheon/cpu.h +12 -0
@@ -43,6 +43,17 @@ struct panthmpmu_registers { };/* +* Application Power Management (APMU) Registers +* Refer Register Datasheet 9.2 +*/ +struct panthapmu_registers { +u8 pad0[0x0054 ]; +u32 sd1;/*0x0054*/ +u8 pad1[0x00e0 -0x054 -4 ]; +u32 sd3;/*0x00e0*/ +}; + +/* * APB Clock Reset/Control Registers * Refer Register Datasheet 6.14 */
@@ -77,5 +88,6 @@ struct panthcpu_registers {*/ u32 panth_sdram_base (int );u32 panth_sdram_size (int ); +int mv_sdh_init (u32 regbase,u32 max_clk,u32 min_clk,u32 quirks);#endif /* _PANTHEON_CPU_H */
arch/arm/include/asm/arch-pantheon/mfp.h +12 -0
@@ -38,6 +38,18 @@#define MFP54_CI2C_SDA (MFP_REG(0x1b4) | MFP_AF2 | MFP_DRIVE_MEDIUM)/* More macros can be defined here... */ +#define MFP_MMC1_DAT7 (MFP_REG(0x84) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT6 (MFP_REG(0x88) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT5 (MFP_REG(0x8c) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT4 (MFP_REG(0x90) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_DAT3 (MFP_REG(0x94) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT2 (MFP_REG(0x98) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT1 (MFP_REG(0x9c) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_DAT0 (MFP_REG(0xa0) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CMD (MFP_REG(0xa4) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CLK (MFP_REG(0xa8) | MFP_AF0 | MFP_DRIVE_FAST) +#define MFP_MMC1_CD (MFP_REG(0xac) | MFP_AF0 | MFP_DRIVE_MEDIUM) +#define MFP_MMC1_WP (MFP_REG(0xb0) | MFP_AF0 | MFP_DRIVE_MEDIUM)#define MFP_PIN_MAX 117#endif
arch/arm/include/asm/arch-pantheon/pantheon.h +7 -0
@@ -32,6 +32,12 @@/* Functional Clock Selection Mask */ #define APBC_FNCLKSEL (x) (((x) & 0xf) << 4) +/* Common APMU register bit definitions */ +#define APMU_PERI_CLK (1<<4)/* Peripheral Clock Enable */ +#define APMU_AXI_CLK (1<<3)/* AXI Clock Enable*/ +#define APMU_PERI_RST (1<<1)/* Peripheral Reset */ +#define APMU_AXI_RST (1<<0)/* AXI Reset */ +/* Register Base Addresses */ #define PANTHEON_DRAM_BASE 0xB0000000#define PANTHEON_TIMER_BASE 0xD4014000
@@ -42,6 +48,7 @@#define PANTHEON_GPIO_BASE 0xD4019000#define PANTHEON_MFPR_BASE 0xD401E000#define PANTHEON_MPMU_BASE 0xD4050000 +#define PANTHEON_APMU_BASE 0xD4282800#define PANTHEON_CPU_BASE 0xD4282C00#endif /* _PANTHEON_H */
Signature · 1 line
1.7.0.4
PATCH v2 2/4 Marvell: dkb: add mmc support
In reply to Lei Wen---
Changelog:
V2: remove magic number, and replace it by macro definition and structure respectively
board/Marvell/dkb/dkb.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-)
board/Marvell/dkb/dkb.c +43 -0
@@ -24,8 +24,12 @@#include <common.h> #include <mvmfp.h> +#include <i2c.h> #include <asm/arch/mfp.h> #include <asm/arch/cpu.h> +#ifdef CONFIG_GENERIC_MMC +#include <sdhci.h> +#endif DECLARE_GLOBAL_DATA_PTR ;
@@ -40,6 +44,20 @@ int board_early_init_f(void)MFP53_CI2C_SCL ,MFP54_CI2C_SDA , +/* MMC1 */ +MFP_MMC1_DAT7 , +MFP_MMC1_DAT6 , +MFP_MMC1_DAT5 , +MFP_MMC1_DAT4 , +MFP_MMC1_DAT3 , +MFP_MMC1_DAT2 , +MFP_MMC1_DAT1 , +MFP_MMC1_DAT0 , +MFP_MMC1_CMD , +MFP_MMC1_CLK , +MFP_MMC1_CD , +MFP_MMC1_WP , +MFP_EOC /*End of configureation*/ };/* configure MFP's */
@@ -56,3 +74,28 @@ int board_init(void) gd->bd->bi_boot_params =panth_sdram_base (0 ) +0x100 ;return 0 ; } + +#ifdef CONFIG_GENERIC_MMC +#define I2C_SLAVE_ADDR 0x34 +#define LDO13_REG 0x28 +#define LDO_V30 0x6 +#define LDO_VOLTAGE (x) ((x & 0x7) << 1) +#define LDO_EN 0x1 +int board_mmc_init (bd_t *bd) +{ +ulong mmc_base_address[CONFIG_SYS_MMC_NUM ] =CONFIG_SYS_MMC_BASE ; +u8 i, data; + +/* set LDO 13 to 3.0v */ + data =LDO_VOLTAGE (LDO_V30 ) |LDO_EN ; +i2c_write (I2C_SLAVE_ADDR ,LDO13_REG ,1 , &data,1 ); + +for (i =0 ; i <CONFIG_SYS_MMC_NUM ; i++) { +if (mv_sdh_init (mmc_base_address[i],0 ,0 , +SDHCI_QUIRK_32BIT_DMA_ADDR )) +return 1 ; + } + +return 0 ; +} +#endif
Signature · 1 line
1.7.0.4
PATCH v2 3/4 dkb: make mmc command as default enabled
In reply to Lei Wen---
Changelog:
V2: remove enable mmc function into seperated patch
include/configs/dkb.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/dkb.h +1 -0
@@ -47,6 +47,7 @@#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ #include <config_cmd_default.h> #define CONFIG_CMD_I2C +#define CONFIG_CMD_MMC #undef CONFIG_CMD_NET#undef CONFIG_CMD_NFS/*
Signature · 1 line
1.7.0.4
PATCH v2 4/4 mmc: mv_sdhci: fix 8bus width access for 88SV331xV5
In reply to Lei WenMarvell 88SV331xV5 platform's sdhci host control is not very standard with the spec in the 8bit handling. It need to set its private register to switch to the 8bit mode which is not included in the standard sdhci registers.
This patch mainly hacks the writeb method, and set its private register if it find the driver is going to switch to the 8bit mode.
---
Changelog:
V2: no change
drivers/mmc/mv_sdhci.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
drivers/mmc/mv_sdhci.c +33 -0
@@ -2,6 +2,33 @@#include <malloc.h> #include <sdhci.h> +#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS +static struct sdhci_ops mv_ops; + +#if defined(CONFIG_SHEEVA_88SV331xV5) +#define SD_CE_ATA_2 0xEA +#define MMC_CARD 0x1000 +#define MMC_WIDTH 0x0100 +static inline void mv_sdhci_writeb (struct sdhci_host *host,u8 val,int reg) +{ +struct mmc *mmc = host->mmc; +u32 ata = (u32 )host->ioaddr +SD_CE_ATA_2 ; + +if (!IS_SD (mmc) && reg ==SDHCI_HOST_CONTROL ) { +if (mmc->bus_width ==8 ) +writew (readw (ata) | (MMC_CARD |MMC_WIDTH ), ata); +else +writew (readw (ata) & ~(MMC_CARD |MMC_WIDTH ), ata); + } + +writeb (val, host->ioaddr + reg); +} + +#else +#define mv_sdhci_writeb NULL +#endif /* CONFIG_SHEEVA_88SV331xV5 */ +#endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */ +static char *MVSDH_NAME ="mv_sdh" ;int mv_sdh_init (u32 regbase,u32 max_clk,u32 min_clk,u32 quirks) {
@@ -15,6 +42,12 @@ int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) host->name =MVSDH_NAME ; host->ioaddr = (void *)regbase; host->quirks = quirks; +#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS +memset (&mv_ops,0 ,sizeof (struct sdhci_ops )); +if (mv_sdhci_writeb !=NULL ) + mv_ops.write_b = mv_sdhci_writeb; + host->ops = &mv_ops; +#endif host->version =sdhci_readw (host,SDHCI_HOST_VERSION );add_sdhci (host, max_clk, min_clk);return 0 ;
Signature · 1 line
1.7.0.4