[U-Boot] [PATCH v1] net: use block layer in net driver

From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com --- drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device *phydev) printf("MMC read: dev # %u, block # %u, count %u ...\n", dev, blk, cnt); mmc_init(mmc); - (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, + (void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr); } #endif

On Wed, Apr 17, 2019 at 4:02 AM Yinbo Zhu yinbo.zhu@nxp.com wrote:
From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com
drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device *phydev) printf("MMC read: dev # %u, block # %u, count %u ...\n", dev, blk, cnt); mmc_init(mmc);
(void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
(void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
Should this be switching on CONFIG_BLK or CONFIG_DM_MMC or something.
}
#endif
2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

On Thu, May 9, 2019 at 3:02 PM Joe Hershberger joe.hershberger@gmail.com wrote:
On Wed, Apr 17, 2019 at 4:02 AM Yinbo Zhu yinbo.zhu@nxp.com wrote:
From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com
drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device *phydev) printf("MMC read: dev # %u, block # %u, count %u ...\n", dev, blk, cnt); mmc_init(mmc);
(void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
(void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
Should this be switching on CONFIG_BLK or CONFIG_DM_MMC or something.
Any word?
}
#endif
2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

-----Original Message----- From: Joe Hershberger [mailto:joe.hershberger@gmail.com] Sent: 2019年6月1日 19:16 To: Yinbo Zhu yinbo.zhu@nxp.com Cc: York Sun york.sun@nxp.com; u-boot@lists.denx.de; Xiaobo Xie xiaobo.xie@nxp.com; Jiafei Pan jiafei.pan@nxp.com; Ran Wang ran.wang_1@nxp.com Subject: [EXT] Re: [U-Boot] [PATCH v1] net: use block layer in net driver
Caution: EXT Email
On Thu, May 9, 2019 at 3:02 PM Joe Hershberger joe.hershberger@gmail.com wrote:
On Wed, Apr 17, 2019 at 4:02 AM Yinbo Zhu yinbo.zhu@nxp.com wrote:
From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com
drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device
*phydev)
printf("MMC read: dev # %u, block # %u, count %u ...\n", dev, blk, cnt); mmc_init(mmc);
(void)mmc->block_dev.block_read(&mmc->block_dev, blk,
cnt,
(void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
Should this be switching on CONFIG_BLK or CONFIG_DM_MMC or something.
Any word?
Yes, need enable above two config. And default uboot had enabled them.
Regards, Yinbo
}
#endif
2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.denx.de%2Flistinfo%2Fu-boot&data=02%7C01%7Cyinbo.zhu%40nxp.c
om%7Cf4dd39cb85174bb474e208d6e682980b%7C686ea1d3bc2b4c6fa92cd9 9c5c30
1635%7C0%7C1%7C636949845952441371&sdata=PJGcNYuSLsAndJaGTBe khmEN
sad96LwmV92jLec5mrs%3D&reserved=0

On Sun, Jun 2, 2019 at 9:28 PM Yinbo Zhu yinbo.zhu@nxp.com wrote:
-----Original Message----- From: Joe Hershberger [mailto:joe.hershberger@gmail.com] Sent: 2019年6月1日 19:16 To: Yinbo Zhu yinbo.zhu@nxp.com Cc: York Sun york.sun@nxp.com; u-boot@lists.denx.de; Xiaobo Xie xiaobo.xie@nxp.com; Jiafei Pan jiafei.pan@nxp.com; Ran Wang ran.wang_1@nxp.com Subject: [EXT] Re: [U-Boot] [PATCH v1] net: use block layer in net driver
Caution: EXT Email
On Thu, May 9, 2019 at 3:02 PM Joe Hershberger joe.hershberger@gmail.com wrote:
On Wed, Apr 17, 2019 at 4:02 AM Yinbo Zhu yinbo.zhu@nxp.com wrote:
From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com
drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device
*phydev)
printf("MMC read: dev # %u, block # %u, count %u ...\n", dev, blk, cnt); mmc_init(mmc);
(void)mmc->block_dev.block_read(&mmc->block_dev, blk,
cnt,
(void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
Should this be switching on CONFIG_BLK or CONFIG_DM_MMC or something.
Any word?
Yes, need enable above two config. And default uboot had enabled them.
OK, if this depends on them, even if they are default, this block should check for the option in v2. Also, if there is still a use-case for the "mmc->block_dev.block_read" that exists with different or fewer options, then that could also be a config option instead of replaced.
Thanks, -Joe
Regards, Yinbo
}
#endif
2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fli
sts.denx.de%2Flistinfo%2Fu-boot&data=02%7C01%7Cyinbo.zhu%40nxp.c
om%7Cf4dd39cb85174bb474e208d6e682980b%7C686ea1d3bc2b4c6fa92cd9 9c5c30
1635%7C0%7C1%7C636949845952441371&sdata=PJGcNYuSLsAndJaGTBe khmEN
sad96LwmV92jLec5mrs%3D&reserved=0

-----Original Message----- From: Joe Hershberger [mailto:joe.hershberger@gmail.com] Sent: 2019年6月10日 23:41 To: Yinbo Zhu yinbo.zhu@nxp.com Cc: York Sun york.sun@nxp.com; u-boot@lists.denx.de; Xiaobo Xie xiaobo.xie@nxp.com; Jiafei Pan jiafei.pan@nxp.com; Ran Wang ran.wang_1@nxp.com; Y.b. Lu yangbo.lu@nxp.com Subject: Re: [EXT] Re: [U-Boot] [PATCH v1] net: use block layer in net driver
Caution: EXT Email
On Sun, Jun 2, 2019 at 9:28 PM Yinbo Zhu yinbo.zhu@nxp.com wrote:
-----Original Message----- From: Joe Hershberger [mailto:joe.hershberger@gmail.com] Sent: 2019年6月1日 19:16 To: Yinbo Zhu yinbo.zhu@nxp.com Cc: York Sun york.sun@nxp.com; u-boot@lists.denx.de; Xiaobo Xie xiaobo.xie@nxp.com; Jiafei Pan jiafei.pan@nxp.com; Ran Wang ran.wang_1@nxp.com Subject: [EXT] Re: [U-Boot] [PATCH v1] net: use block layer in net driver
Caution: EXT Email
On Thu, May 9, 2019 at 3:02 PM Joe Hershberger joe.hershberger@gmail.com wrote:
On Wed, Apr 17, 2019 at 4:02 AM Yinbo Zhu yinbo.zhu@nxp.com wrote:
From: Yinbo Zhu yinbo.zhu@nxp.com
At present the MMC subsystem maintains its own list of MMC devices. This cannot work with driver model when CONFIG_BLK is enabled, use blk_dread to replace previous mmc read interface,
Signed-off-by: Yinbo Zhu yinbo.zhu@nxp.com
drivers/net/phy/cortina.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c index a04a118f90..2337c3403c 100644 --- a/drivers/net/phy/cortina.c +++ b/drivers/net/phy/cortina.c @@ -176,7 +176,7 @@ void cs4340_upload_firmware(struct phy_device
*phydev)
printf("MMC read: dev # %u, block # %u,
count %u ...\n",
dev, blk, cnt); mmc_init(mmc);
(void)mmc->block_dev.block_read(&mmc->block_dev,
blk,
cnt,
(void)blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
Should this be switching on CONFIG_BLK or CONFIG_DM_MMC or
something.
Any word?
Yes, need enable above two config. And default uboot had enabled them.
OK, if this depends on them, even if they are default, this block should check for the option in v2. Also, if there is still a use-case for the "mmc->block_dev.block_read" that exists with different or fewer options, then that could also be a config option instead of replaced.
Thanks, -Joe
Hi joe,
In fact, above change is only depend on BLK config, I have mistake about previous word, and I will apply your advice send v3 patch to upstream.
Yinbo
Regards, Yinbo
}
#endif
2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F% 2Fli
sts.denx.de%2Flistinfo%2Fu-boot&data=02%7C01%7Cyinbo.zhu%40nxp.c
om%7Cf4dd39cb85174bb474e208d6e682980b%7C686ea1d3bc2b4c6fa92cd9
9c5c30
1635%7C0%7C1%7C636949845952441371&sdata=PJGcNYuSLsAndJaGTBe
khmEN
sad96LwmV92jLec5mrs%3D&reserved=0
participants (2)
-
Joe Hershberger
-
Yinbo Zhu