Skip to contentSkip to conversation

mmc: sunxi: Use new timing mode for A64 eMMC controller

PATCH New Chen-Yu Tsai 2 participants 8 messages Jul 12, 2018 – Jul 31, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

---
 drivers/mmc/host/sunxi-mmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mmc/host/sunxi-mmc.c +1 -0
index 8e7f3e35ee3d..13201bddfcc3 100644
@@ -1166,6 +1166,7 @@ static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = {
 	.idma_des_size_bits = 13,
 	.clk_delays = NULL,
 	.can_calibrate = true,
+	.needs_new_timings = true,
 };
 
 static const struct of_device_id sunxi_mmc_of_match[] = {
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Hi,

Quoted 10 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

And I definitely remember having HS-DDR working back when I added the a64 eMMC support.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180712/438c9ea8/attachment.sig>
#2 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 12 lines · Maxime Ripard

Hi,

Quoted 9 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

Quoted 8 lines
Quoted 1 line

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Would a comment, or comments, help with making this clear?

Quoted 2 lines

And I definitely remember having HS-DDR working back when I added the a64 eMMC support.

Well it doesn't at the moment. My BPI-M64 reports:

    [    1.634276] mmc2: new high speed MMC card at address 0001

And with the patch:

    [    1.632552] mmc2: new DDR MMC card at address 0001

Regards
ChenYu

#3 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 20 lines · Chen-Yu Tsai
Quoted 18 lines · Maxime Ripard

Hi,

Quoted 10 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

Quoted 8 lines
Quoted 2 lines

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Would a comment, or comments, help with making this clear?

Ah right. Maybe we should move the calibration under can_calibrate though, or create another boolean for this?

Putting it under has_new_timings while the SoC doesn't use it looks very confusing.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180717/b9e9ebd4/attachment.sig>
#4 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 28 lines · Maxime Ripard
Quoted 27 lines · Chen-Yu Tsai
Quoted 12 lines · Maxime Ripard

Hi,

Quoted 9 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

Quoted 8 lines
Quoted 1 line

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Quoted 7 lines
Quoted 1 line

Would a comment, or comments, help with making this clear?

Ah right. Maybe we should move the calibration under can_calibrate though, or create another boolean for this?

Putting it under has_new_timings while the SoC doesn't use it looks very confusing.

IIRC we don't support calibration anyway. This boolean simply signals the usage of the new timing mode, whether by choice, or because it is the only mode the controller supports.

ChenYu

#5 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 35 lines · Chen-Yu Tsai
Quoted 33 lines · Maxime Ripard
Quoted 20 lines · Chen-Yu Tsai
Quoted 18 lines · Maxime Ripard

Hi,

Quoted 10 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

Quoted 8 lines
Quoted 2 lines

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Would a comment, or comments, help with making this clear?

Ah right. Maybe we should move the calibration under can_calibrate though, or create another boolean for this?

Quoted 6 lines
Quoted 2 lines

Putting it under has_new_timings while the SoC doesn't use it looks very confusing.

IIRC we don't support calibration anyway. This boolean simply signals the usage of the new timing mode, whether by choice, or because it is the only mode the controller supports.

This is not the semantic I had in mind when I introduced it. The original intent was to set the new timing bit all the time for SoCs. If we want to change that semantic, then we also need to make sure what this bit means is documented properly.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180718/a0d51ed7/attachment.sig>
#6 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 39 lines · Maxime Ripard
Quoted 38 lines · Chen-Yu Tsai
Quoted 35 lines · Maxime Ripard
Quoted 20 lines · Chen-Yu Tsai
Quoted 18 lines · Maxime Ripard

Hi,

Quoted 10 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

Quoted 8 lines
Quoted 2 lines

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Would a comment, or comments, help with making this clear?

Ah right. Maybe we should move the calibration under can_calibrate though, or create another boolean for this?

Putting it under has_new_timings while the SoC doesn't use it looks very confusing.

Quoted 8 lines
Quoted 3 lines

IIRC we don't support calibration anyway. This boolean simply signals the usage of the new timing mode, whether by choice, or because it is the only mode the controller supports.

This is not the semantic I had in mind when I introduced it. The original intent was to set the new timing bit all the time for SoCs. If we want to change that semantic, then we also need to make sure what this bit means is documented properly.

In the driver:

    /* hardware only supports new timing mode */
    bool needs_new_timings;

    /* hardware can switch between old and new timing modes */
    bool has_timings_switch;

So if the A64 / H6 eMMC controller only supports / is stuck with the new timing mode, that surely fits the description of the first one, right? As for setting the new timing bit all the time, yes it is set, but it's a no-op. Would a comment clarifying this at the point the hardware bit is set suffice?

Thanks
ChenYu

#7 lore raw

PATCH 1/1 mmc: sunxi: Use new timing mode for A64 eMMC controller

Quoted 52 lines · Chen-Yu Tsai
Quoted 39 lines · Maxime Ripard
Quoted 38 lines · Chen-Yu Tsai
Quoted 35 lines · Maxime Ripard
Quoted 20 lines · Chen-Yu Tsai
Quoted 18 lines · Maxime Ripard

Hi,

Quoted 10 lines · Chen-Yu Tsai

The eMMC controller is also a new timing mode controller, but it doesn't have the timing mode switch. It does however have signal delay and calibration controls, typical of Allwinner MMC controllers that support the new timing mode.

Enable the new timing mode setting for the A64 eMMC controller. This also enables MMC HS-DDR modes, which gives higher throughput for eMMC chips that support it, and can deliver such throughput.

That doesn't look right. The datasheet explicitly mentions that this bit doesn't apply to the eMMC controller, and the BSP is doing the same:
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-1.c

Quoted 8 lines
Quoted 2 lines

vs
https://github.com/longsleep/linux-pine64/blob/lichee-dev-v3.10.65/drivers/mmc/host/sunxi-mmc-sun50iw1p1-2.c

You mean the bit in SDXC_REG_SD_NTSR? Yes I know that doesn't exist for the eMMC controller. I mentioned this in the commit message. It doesn't exist, and writes to it become a no-op.

Would a comment, or comments, help with making this clear?

Ah right. Maybe we should move the calibration under can_calibrate though, or create another boolean for this?

Putting it under has_new_timings while the SoC doesn't use it looks very confusing.

Quoted 8 lines
Quoted 3 lines

IIRC we don't support calibration anyway. This boolean simply signals the usage of the new timing mode, whether by choice, or because it is the only mode the controller supports.

This is not the semantic I had in mind when I introduced it. The original intent was to set the new timing bit all the time for SoCs. If we want to change that semantic, then we also need to make sure what this bit means is documented properly.

In the driver:

Quoted 8 lines
    /* hardware only supports new timing mode */
    bool needs_new_timings;

    /* hardware can switch between old and new timing modes */
    bool has_timings_switch;

So if the A64 / H6 eMMC controller only supports / is stuck with the new timing mode, that surely fits the description of the first one, right?

I guess so, yes

Quoted 3 lines

As for setting the new timing bit all the time, yes it is set, but it's a no-op. Would a comment clarifying this at the point the hardware bit is set suffice?

Yep. Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180731/67794c1d/attachment.sig>