* [U-Boot] [PATCH] imx6: mx6qarm2: updated
@ 2012-01-17 11:18 Stefano Babic
2012-01-17 11:50 ` Dirk Behme
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Stefano Babic @ 2012-01-17 11:18 UTC (permalink / raw)
To: u-boot
Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
changed board_mmc_getcd() function prototype, while
mx6qarm2 has still the old one.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <jason.hui@linaro.org>
---
board/freescale/mx6qarm2/mx6qarm2.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
index 9894245..9724c16 100644
--- a/board/freescale/mx6qarm2/mx6qarm2.c
+++ b/board/freescale/mx6qarm2/mx6qarm2.c
@@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC4_BASE_ADDR, 1},
};
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
{
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+ int ret;
if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
gpio_direction_input(171); /*GPIO6_11*/
- *cd = gpio_get_value(171);
+ ret = !gpio_get_value(171);
} else /* Don't have the CD GPIO pin on board */
- *cd = 0;
+ ret = 0;
- return 0;
+ return ret;
}
int board_mmc_init(bd_t *bis)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] imx6: mx6qarm2: updated
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
@ 2012-01-17 11:50 ` Dirk Behme
2012-01-17 12:03 ` Fabio Estevam
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Dirk Behme @ 2012-01-17 11:50 UTC (permalink / raw)
To: u-boot
On 17.01.2012 12:18, Stefano Babic wrote:
> Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
> changed board_mmc_getcd() function prototype, while
> mx6qarm2 has still the old one.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <jason.hui@linaro.org>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Thanks
Dirk
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] imx6: mx6qarm2: updated
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
2012-01-17 11:50 ` Dirk Behme
@ 2012-01-17 12:03 ` Fabio Estevam
2012-01-17 13:11 ` Stefano Babic
2012-01-17 13:15 ` [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype Stefano Babic
2012-01-18 9:41 ` [U-Boot] [PATCH V3] " Stefano Babic
3 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2012-01-17 12:03 UTC (permalink / raw)
To: u-boot
Hi Stefano,
On Tue, Jan 17, 2012 at 9:18 AM, Stefano Babic <sbabic@denx.de> wrote:
> Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
> changed board_mmc_getcd() function prototype, while
> mx6qarm2 has still the old one.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <jason.hui@linaro.org>
I think the subject of the patch could be improved.
Writing only "updated" in the subject is too vague.
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] imx6: mx6qarm2: updated
2012-01-17 12:03 ` Fabio Estevam
@ 2012-01-17 13:11 ` Stefano Babic
0 siblings, 0 replies; 9+ messages in thread
From: Stefano Babic @ 2012-01-17 13:11 UTC (permalink / raw)
To: u-boot
On 17/01/2012 13:03, Fabio Estevam wrote:
> Hi Stefano,
>
> On Tue, Jan 17, 2012 at 9:18 AM, Stefano Babic <sbabic@denx.de> wrote:
>> Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
>> changed board_mmc_getcd() function prototype, while
>> mx6qarm2 has still the old one.
>>
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> CC: Jason Liu <jason.hui@linaro.org>
>
> I think the subject of the patch could be improved.
...one part was lost editing the commit message - I will send V2.
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
2012-01-17 11:50 ` Dirk Behme
2012-01-17 12:03 ` Fabio Estevam
@ 2012-01-17 13:15 ` Stefano Babic
2012-01-18 3:08 ` Jason Hui
2012-01-18 9:41 ` [U-Boot] [PATCH V3] " Stefano Babic
3 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2012-01-17 13:15 UTC (permalink / raw)
To: u-boot
Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
changed board_mmc_getcd() function prototype, while
mx6qarm2 has still the old one.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <jason.hui@linaro.org>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
---
board/freescale/mx6qarm2/mx6qarm2.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
index 9894245..9724c16 100644
--- a/board/freescale/mx6qarm2/mx6qarm2.c
+++ b/board/freescale/mx6qarm2/mx6qarm2.c
@@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC4_BASE_ADDR, 1},
};
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
{
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+ int ret;
if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
gpio_direction_input(171); /*GPIO6_11*/
- *cd = gpio_get_value(171);
+ ret = !gpio_get_value(171);
} else /* Don't have the CD GPIO pin on board */
- *cd = 0;
+ ret = 0;
- return 0;
+ return ret;
}
int board_mmc_init(bd_t *bis)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
2012-01-17 13:15 ` [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype Stefano Babic
@ 2012-01-18 3:08 ` Jason Hui
2012-01-18 8:22 ` Stefano Babic
0 siblings, 1 reply; 9+ messages in thread
From: Jason Hui @ 2012-01-18 3:08 UTC (permalink / raw)
To: u-boot
On Tue, Jan 17, 2012 at 9:15 PM, Stefano Babic <sbabic@denx.de> wrote:
> Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
> changed board_mmc_getcd() function prototype, while
> mx6qarm2 has still the old one.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <jason.hui@linaro.org>
> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
>
> ---
> ?board/freescale/mx6qarm2/mx6qarm2.c | ? ?9 +++++----
> ?1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
> index 9894245..9724c16 100644
> --- a/board/freescale/mx6qarm2/mx6qarm2.c
> +++ b/board/freescale/mx6qarm2/mx6qarm2.c
> @@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
> ? ? ? ?{USDHC4_BASE_ADDR, 1},
> ?};
>
> -int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> +int board_mmc_getcd(struct mmc *mmc)
> ?{
> ? ? ? ?struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> + ? ? ? int ret;
>
> ? ? ? ?if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
> ? ? ? ? ? ? ? ?gpio_direction_input(171); /*GPIO6_11*/
> - ? ? ? ? ? ? ? *cd = gpio_get_value(171);
> + ? ? ? ? ? ? ? ret = !gpio_get_value(171);
> ? ? ? ?} else /* Don't have the CD GPIO pin on board */
> - ? ? ? ? ? ? ? *cd = 0;
> + ? ? ? ? ? ? ? ret = 0;
^^^^^^1
Apparently, this is wrong for the else statement, since there is no CD
for the SD4 on the board,
so, we have to tell MMC system that the card is always there,
otherwise, we can't use the MMC
plug-in that slot. After change to new prototype, we also need convert
the ret value for the SD4,
and return 1 not 0 to MMC.
>
> - ? ? ? return 0;
> + ? ? ? return ret;
> ?}
>
> ?int board_mmc_init(bd_t *bis)
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
2012-01-18 3:08 ` Jason Hui
@ 2012-01-18 8:22 ` Stefano Babic
0 siblings, 0 replies; 9+ messages in thread
From: Stefano Babic @ 2012-01-18 8:22 UTC (permalink / raw)
To: u-boot
On 18/01/2012 04:08, Jason Hui wrote:
>> -int board_mmc_getcd(u8 *cd, struct mmc *mmc)
>> +int board_mmc_getcd(struct mmc *mmc)
>> {
>> struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>> + int ret;
>>
>> if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
>> gpio_direction_input(171); /*GPIO6_11*/
>> - *cd = gpio_get_value(171);
>> + ret = !gpio_get_value(171);
>> } else /* Don't have the CD GPIO pin on board */
>> - *cd = 0;
>> + ret = 0;
> ^^^^^^1
> Apparently, this is wrong for the else statement, since there is no CD
> for the SD4 on the board,
> so, we have to tell MMC system that the card is always there,
> otherwise, we can't use the MMC
Ok - so we have to invert the logic for the else clause.
> plug-in that slot. After change to new prototype, we also need convert
> the ret value for the SD4,
> and return 1 not 0 to MMC.
Thanks - I send V3 with the required change.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V3] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
` (2 preceding siblings ...)
2012-01-17 13:15 ` [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype Stefano Babic
@ 2012-01-18 9:41 ` Stefano Babic
2012-01-18 10:40 ` Jason Hui
3 siblings, 1 reply; 9+ messages in thread
From: Stefano Babic @ 2012-01-18 9:41 UTC (permalink / raw)
To: u-boot
Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
changed board_mmc_getcd() function prototype, while
mx6qarm2 has still the old one.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Jason Liu <jason.hui@linaro.org>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
---
Changes since V1:
- update subject (Fabio Estevam)
Changes since V2:
- board_mmc_getcd() must return 1 in the else clause (Jason Liu)
Note: not tested on real board, the patch fixes building.
board/freescale/mx6qarm2/mx6qarm2.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
index 9894245..1367b88 100644
--- a/board/freescale/mx6qarm2/mx6qarm2.c
+++ b/board/freescale/mx6qarm2/mx6qarm2.c
@@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC4_BASE_ADDR, 1},
};
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
+int board_mmc_getcd(struct mmc *mmc)
{
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
+ int ret;
if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
gpio_direction_input(171); /*GPIO6_11*/
- *cd = gpio_get_value(171);
+ ret = !gpio_get_value(171);
} else /* Don't have the CD GPIO pin on board */
- *cd = 0;
+ ret = 1;
- return 0;
+ return ret;
}
int board_mmc_init(bd_t *bis)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH V3] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
2012-01-18 9:41 ` [U-Boot] [PATCH V3] " Stefano Babic
@ 2012-01-18 10:40 ` Jason Hui
0 siblings, 0 replies; 9+ messages in thread
From: Jason Hui @ 2012-01-18 10:40 UTC (permalink / raw)
To: u-boot
On Wed, Jan 18, 2012 at 5:41 PM, Stefano Babic <sbabic@denx.de> wrote:
> Commit 314284b1567f1ce29c19060641e7f213146f7ab8 has
> changed board_mmc_getcd() function prototype, while
> mx6qarm2 has still the old one.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Jason Liu <jason.hui@linaro.org>
> Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Jason Liu <jason.hui@linaro.org>
> ---
> Changes since V1:
> - update subject (Fabio Estevam)
>
> Changes since V2:
> - board_mmc_getcd() must return 1 in the else clause (Jason Liu)
>
> Note: not tested on real board, the patch fixes building.
I have tested it on the real board, it works fine:)
Tested-by: Jason Liu <jason.hui@linaro.org>
>
> ?board/freescale/mx6qarm2/mx6qarm2.c | ? ?9 +++++----
> ?1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
> index 9894245..1367b88 100644
> --- a/board/freescale/mx6qarm2/mx6qarm2.c
> +++ b/board/freescale/mx6qarm2/mx6qarm2.c
> @@ -120,17 +120,18 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = {
> ? ? ? ?{USDHC4_BASE_ADDR, 1},
> ?};
>
> -int board_mmc_getcd(u8 *cd, struct mmc *mmc)
> +int board_mmc_getcd(struct mmc *mmc)
> ?{
> ? ? ? ?struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> + ? ? ? int ret;
>
> ? ? ? ?if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
> ? ? ? ? ? ? ? ?gpio_direction_input(171); /*GPIO6_11*/
> - ? ? ? ? ? ? ? *cd = gpio_get_value(171);
> + ? ? ? ? ? ? ? ret = !gpio_get_value(171);
> ? ? ? ?} else /* Don't have the CD GPIO pin on board */
> - ? ? ? ? ? ? ? *cd = 0;
> + ? ? ? ? ? ? ? ret = 1;
>
> - ? ? ? return 0;
> + ? ? ? return ret;
> ?}
>
> ?int board_mmc_init(bd_t *bis)
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-01-18 10:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
2012-01-17 11:50 ` Dirk Behme
2012-01-17 12:03 ` Fabio Estevam
2012-01-17 13:11 ` Stefano Babic
2012-01-17 13:15 ` [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype Stefano Babic
2012-01-18 3:08 ` Jason Hui
2012-01-18 8:22 ` Stefano Babic
2012-01-18 9:41 ` [U-Boot] [PATCH V3] " Stefano Babic
2012-01-18 10:40 ` Jason Hui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox