Re: [PATCH v2 3/3] mmc: hi6220_dw_mmc: add fifoth_val to private data and set it in .probe

2024-04-02 Thread Yang Xiwen
On 4/3/2024 8:43 AM, Jaehoon Chung wrote: Hi On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen The value defaults to 0 and is ignored by dw_mmc code, so the other users are not affected. Setting this explicitly fixes some weird reading error found on Hi3798MV200. Fixes

Re: [PATCH v2 2/3] mmc: dw_mmc: Don't return error if data busy timeout

2024-04-02 Thread Yang Xiwen
On 4/3/2024 8:41 AM, Jaehoon Chung wrote: Hi, On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen As described in [1], some poor hardware or cards would fail to release the bus and keep driving data lines low. Ignore it and send the next cmd directly seems okay for most cases

Re: [PATCH v2 1/3] mmc: hi6220-dwmmc: handle clocks and resets if CONFIG_CLK and CONFIG_DM_RESET enabled

2024-04-02 Thread Yang Xiwen
On 4/3/2024 8:39 AM, Jaehoon Chung wrote: Hi, On 2/1/24 23:05, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen This can avoid hardcoding a clock rate in driver. Also can enable the clocks and deassert the resets if the pre-bootloader does not do this for us. Currently only enabled

Re: [PATCH] clk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present

2024-03-20 Thread Yang Xiwen
* get private clock struct used for cache */ clk_get_priv(clk, ); -- 2.39.2 -- Regards, Yang Xiwen

Re: [PATCH v3] clk: set initial best mux parent to current parent with CLK_MUX_ROUND_CLOSEST

2024-03-12 Thread Yang Xiwen
On 3/11/2024 5:34 PM, Maxime Ripard wrote: On Thu, Mar 07, 2024 at 07:18:05PM +0800, Yang Xiwen wrote: On 3/7/2024 4:48 PM, Maxime Ripard wrote: Hi, On Thu, Mar 07, 2024 at 10:03:50AM +0800, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen Originally, the initial clock rate is hardcoded

[PATCH v2] serial: pl01x: set baudrate when probing

2024-02-28 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It is found that when DM is enabled, only generic init function is called in .probe(). Baudrate is never honored. Add a function call to .setbrg() when probing so that we can update the baudrate of the serial device. Signed-off-by: Yang Xiwen --- Changes in v2: - reverse

Re: [PATCH RESEND] serial: pl01x: set baudrate when probing

2024-02-26 Thread Yang Xiwen
On 2/26/2024 4:23 PM, Dan Carpenter wrote: > On Sun, Feb 25, 2024 at 08:38:33AM +0800, Yang Xiwen via B4 Relay wrote: >> #if CONFIG_IS_ENABLED(OF_PLATDATA) >> struct dtd_serial_pl01x *dtplat = >dtplat; >> @@ -301,10 +302,14 @@ int pl01x_serial_probe(struct

[PATCH RESEND] serial: pl01x: set baudrate when probing

2024-02-24 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It is found that when DM is enabled, only generic init function is called in .probe(). Baudrate is never honored. Add a function call to .setbrg() when probing so that we can update the baudrate of the serial device. Signed-off-by: Yang Xiwen --- drivers/serial/serial_pl01x.c

Re: [PATCH RFC] pinctrl: add support for HiSilicon HiSTB SoCs

2024-02-12 Thread Yang Xiwen
On 2/13/2024 1:08 AM, Tom Rini wrote: On Tue, Feb 13, 2024 at 01:02:50AM +0800, Yang Xiwen wrote: On 2/13/2024 12:58 AM, Tom Rini wrote: On Tue, Feb 13, 2024 at 12:30:15AM +0800, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen The first supported SoC is Hi3798MV200. Signed-off-by: Yang

Re: [PATCH RFC] pinctrl: add support for HiSilicon HiSTB SoCs

2024-02-12 Thread Yang Xiwen
On 2/13/2024 12:58 AM, Tom Rini wrote: On Tue, Feb 13, 2024 at 12:30:15AM +0800, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen The first supported SoC is Hi3798MV200. Signed-off-by: Yang Xiwen --- This patchset adds support for HiSTB ioconfig module. The module is used to set pins config

[PATCH RFC] pinctrl: add support for HiSilicon HiSTB SoCs

2024-02-12 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen The first supported SoC is Hi3798MV200. Signed-off-by: Yang Xiwen --- This patchset adds support for HiSTB ioconfig module. The module is used to set pins config(e.g. pull-up, pull-down, drive-strength etc..) and pinmux. The first supported chip is Hi3798MV200. Adding support

[PATCH v2 3/3] usb: ehci: Make usage of generic_{setup,shutdown}_phy_bulk() helpers

2024-02-07 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Replace generic_setup_phy() and generic_shutdown_phy() by respectively generic_setup_phy_bulk() and generic_shutdown_phy_bulk(). Signed-off-by: Yang Xiwen --- drivers/usb/host/ehci-generic.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2 0/3] usb: ehci-generic: setup a bulk of phy when possible

2024-02-07 Thread Yang Xiwen via B4 Relay
one USB controller can have multiple ports specified in dts, all of them should be setup to make use of all possible ports. Signed-off-by: Yang Xiwen --- Changes in v2: - Rewrite generic_phy_setup_bulk(): Actually v1 is doing things completely wrong. This series should work and it's tested

[PATCH v2 2/3] test: phy: test generic_setup(shutdown)_phy_bulk()

2024-02-07 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen add unittests for the newly introduced helper functions. Signed-off-by: Yang Xiwen --- test/dm/phy.c | 4 1 file changed, 4 insertions(+) diff --git a/test/dm/phy.c b/test/dm/phy.c index 0cf3689fde..cb16844a0a 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -159,6

[PATCH v2 1/3] phy: add generic_setup(shutdown)_phy_bulk()

2024-02-07 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen They are the bulk version of generic_setup(shutdown)_phy(). Signed-off-by: Yang Xiwen --- drivers/phy/phy-uclass.c | 41 + include/generic-phy.h| 29 + 2 files changed, 70 insertions(+) diff --git

Re: [PATCH 1/3] usb: dwc3: handle return value of clk_get_rate() correctly

2024-02-05 Thread Yang Xiwen
On 2/5/2024 3:25 PM, Dan Carpenter wrote: On Sat, Feb 03, 2024 at 07:01:54AM +0800, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen clk_get_rate() return -ve on error, not 0. Fix it by replacing judging NULL with IS_ERR_VALUE(). s/NULL/zero/. I'd be surprised if clk_get_rate

Re: [PATCH] poplar: add myself as co-maintainer

2024-02-03 Thread Yang Xiwen
On 2/3/2024 6:19 PM, Jorge Ramirez-Ortiz, Gmail wrote: On 03/02/24 17:45:42, Yang Xiwen wrote: On 2/3/2024 4:32 PM, Jorge Ramirez-Ortiz, Gmail wrote: On 03/02/24 07:54:22, Shawn Guo wrote: On Sat, Feb 3, 2024 at 5:44 AM Igor Opaniuk wrote: Add myself as co-maintainer for Poplar board

Re: [PATCH] poplar: add myself as co-maintainer

2024-02-03 Thread Yang Xiwen
On 2/3/2024 5:45 PM, Yang Xiwen wrote: On 2/3/2024 4:32 PM, Jorge Ramirez-Ortiz, Gmail wrote: On 03/02/24 07:54:22, Shawn Guo wrote: On Sat, Feb 3, 2024 at 5:44 AM Igor Opaniuk wrote: Add myself as co-maintainer for Poplar board, as I'm currently working on it (re-testing releases

Re: [PATCH] poplar: add myself as co-maintainer

2024-02-03 Thread Yang Xiwen
On 2/3/2024 4:32 PM, Jorge Ramirez-Ortiz, Gmail wrote: On 03/02/24 07:54:22, Shawn Guo wrote: On Sat, Feb 3, 2024 at 5:44 AM Igor Opaniuk wrote: Add myself as co-maintainer for Poplar board, as I'm currently working on it (re-testing releases, addressing issues etc). CC: Jorge Ramirez-Ortiz

[PATCH 2/3] usb: dwc3: replace argument mode with child ofnode

2024-02-02 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen child ofnode is more useful and can be used to query a lot of other props of child device. dr_mode can be also queried from it. Signed-off-by: Yang Xiwen --- drivers/usb/dwc3/dwc3-generic.c | 12 drivers/usb/dwc3/dwc3-generic.h | 3 +-- 2 files changed, 5

[PATCH 3/3] usb: dwc3: add glue driver for Hi3798MV200

2024-02-02 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It needs some platform-specific operations before generic initialization code. If nano PHY is not initialized properly, it must be disabled. Or else USB host will complain unable to reset port. USB2 is always supported, so it's never disabled. Signed-off-by: Yang Xiwen

[PATCH 0/3] usb: dwv3: add glue driver for hi3798mv200

2024-02-02 Thread Yang Xiwen via B4 Relay
Also edit the prototype of .glue_configure to fulfill our needs. Signed-off-by: Yang Xiwen --- Yang Xiwen (3): usb: dwc3: handle return value of clk_get_rate() correctly usb: dwc3: replace argument mode with child ofnode usb: dwc3: add glue driver for Hi3798MV200 drivers/usb

[PATCH 1/3] usb: dwc3: handle return value of clk_get_rate() correctly

2024-02-02 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen clk_get_rate() return -ve on error, not 0. Fix it by replacing judging NULL with IS_ERR_VALUE(). Fixes: 6bae0eb5b8bd("usb: dwc3: Calculate REFCLKPER based on reference clock") Signed-off-by: Yang Xiwen --- drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1 inser

Re: [PATCH 0/3] usb: ehci-generic: setup a bulk of phy when possible

2024-02-01 Thread Yang Xiwen
On 2/1/2024 10:07 PM, Marek Vasut wrote: On 2/1/24 14:16, Yang Xiwen via B4 Relay wrote: one USB controller can have multiple ports specified in dts, all of them should be setup to make use of all possible ports. Is there an example of such a system ? I'm going to send one, but not now

[PATCH v2 1/3] mmc: hi6220-dwmmc: handle clocks and resets if CONFIG_CLK and CONFIG_DM_RESET enabled

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This can avoid hardcoding a clock rate in driver. Also can enable the clocks and deassert the resets if the pre-bootloader does not do this for us. Currently only enabled for Hi3798MV200. Signed-off-by: Yang Xiwen --- drivers/mmc/hi6220_dw_mmc.c | 61

[PATCH v2 3/3] mmc: hi6220_dw_mmc: add fifoth_val to private data and set it in .probe

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen The value defaults to 0 and is ignored by dw_mmc code, so the other users are not affected. Setting this explicitly fixes some weird reading error found on Hi3798MV200. Fixes: 8a5dc8140e62 ("mmc: hi6220_dw_mmc: add compatible for HC2910 support") Signed-off-by:

[PATCH v2 2/3] mmc: dw_mmc: Don't return error if data busy timeout

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen As described in [1], some poor hardware or cards would fail to release the bus and keep driving data lines low. Ignore it and send the next cmd directly seems okay for most cases. [1]: https://patchwork.kernel.org/project/linux-mmc/patch/1424458179-5456-1-git-send-email-diand

[PATCH v2 0/3] mmc: hi6220-dwmmc: handle resets and clocks

2024-02-01 Thread Yang Xiwen via B4 Relay
Also allow setup fifoth_val in driver Signed-off-by: Yang Xiwen --- Changes in v2: - dw-mmc: proceed if data busy found - hi6220-dw-mmc: add fifoth_val setup, separate hi3798mv200 data - Link to v1: https://lore.kernel.org/r/20240119-mmc-v1-1-aee6b2cf6...@outlook.com --- Yang Xiwen (3

[PATCH 2/3] test: phy: test generic_setup(shutdown)_phy_bulk()

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen add unittests for the newly introduced helper functions. Signed-off-by: Yang Xiwen --- test/dm/phy.c | 4 1 file changed, 4 insertions(+) diff --git a/test/dm/phy.c b/test/dm/phy.c index 0cf3689fde..cb16844a0a 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -159,6

[PATCH 3/3] usb: ehci: Make usage of generic_{setup,shutdown}_phy_bulk() helpers

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Replace generic_setup_phy() and generic_shutdown_phy() by respectively generic_setup_phy_bulk() and generic_shutdown_phy_bulk(). Signed-off-by: Yang Xiwen --- drivers/usb/host/ehci-generic.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH 1/3] phy: add generic_setup(shutdown)_phy_bulk()

2024-02-01 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen They are the bulk version of generic_setup(shutdown)_phy(). Signed-off-by: Yang Xiwen --- drivers/phy/phy-uclass.c | 33 + include/generic-phy.h| 29 + 2 files changed, 62 insertions(+) diff --git a/drivers/phy

[PATCH 0/3] usb: ehci-generic: setup a bulk of phy when possible

2024-02-01 Thread Yang Xiwen via B4 Relay
one USB controller can have multiple ports specified in dts, all of them should be setup to make use of all possible ports. Signed-off-by: Yang Xiwen --- Yang Xiwen (3): phy: add generic_setup(shutdown)_phy_bulk() test: phy: test generic_setup(shutdown)_phy_bulk() usb: ehci

[PATCH] mmc: dw_mmc: Don't return error if data busy timeout

2024-01-25 Thread Yang Xiwen
/ Signed-off-by: Yang Xiwen --- drivers/mmc/dw_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 400066fa99..e103664145 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -262,8 +262,8 @@ static int

[PATCH] serial: pl01x: set baudrate when probing

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It is found that when DM is enabled, only generic init function is called in .probe(). Baudrate is never honored. Add a function call to .setbrg() when probing so that we can update the baudrate of the serial device. Signed-off-by: Yang Xiwen --- drivers/serial/serial_pl01x.c

[PATCH v3 4/5] net: hifemac: implement `net stats` needed ops

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen 3 operations needed by `net stats` are implemented. New `net stats` output some useful info. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 87 +++ 1 file changed, 87 insertions(+) diff --git a/drivers/net/hifemac.c b

[PATCH v3 1/5] net: hifemac_mdio: use log_msg_ret() correctly, report error by dev_err()

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen The initial commit used log_msg_ret() wrongly. Fix that by moving error report to a separate dev_err() call and shrink the first argument of log_msg_ret() to no more than 4 chars. Fixes: 6b5c8d98e204 ("net: add hifemac_mdio MDIO bus driver for HiSilicon platform")

[PATCH v3 3/5] net: hifemac: register MDIO bus device for subnode

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen register internal MDIO bus device if it is a subnode. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/net/hifemac.c b/drivers/net/hifemac.c index 1088f3eca3..39c0233b62 100644

[PATCH v3 2/5] net: hifemac: fix log reporting

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen shrink the first argument of log_msg_ret(), add dev_xxx() functions for error reporting. Fixes: 9d8f78a2a79f7 ("net: add hifemac Ethernet driver for HiSilicon platform") Signed-off-by: Yang Xiwen --- drivers/net/hifem

[PATCH v3 0/5] net: hifemac: a few cleanups

2024-01-22 Thread Yang Xiwen via B4 Relay
- Fix the use of log_msg_ret() and add dev_xxx() for error reporting. - Register mdio subnode as a mdio bus device for hifemac. - Implement ops needed by `net stats` - Make functions static. Signed-off-by: Yang Xiwen --- Changes in v3: - hisi-femac: add missing `static` to avoid polluting global

[PATCH v3 5/5] net: hifemac: make some functions static

2024-01-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen They are not required to be global, make them static. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hifemac.c b/drivers/net/hifemac.c index d24023eefd..90cc247b3b 100644 --- a/drivers

[PATCH v2 0/4] net: hifemac: a few cleanups

2024-01-21 Thread Yang Xiwen via B4 Relay
Fix the use of log_msg_ret() and add dev_xxx() for error reporting. Register mdio subnode as a mdio bus device for hifemac. Implement ops needed by `net stats` Signed-off-by: Yang Xiwen --- Changes in v2: - hisi-femac: add statistics related operations - Link to v1: https://lore.kernel.org/r

[PATCH v2 4/4] net: hifemac: implement `net stats` needed ops

2024-01-21 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen 3 operations needed by `net stats` are implemented. New `net stats` output some useful info. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 87 +++ 1 file changed, 87 insertions(+) diff --git a/drivers/net/hifemac.c b

[PATCH v2 3/4] net: hifemac: register MDIO bus device for subnode

2024-01-21 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen register internal MDIO bus device if it is a subnode. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/net/hifemac.c b/drivers/net/hifemac.c index 1088f3eca3..39c0233b62 100644

[PATCH v2 2/4] net: hifemac: fix log reporting

2024-01-21 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen shrink the first argument of log_msg_ret(), add dev_xxx() functions for error reporting. Fixes: 9d8f78a2a79f7 ("net: add hifemac Ethernet driver for HiSilicon platform") Signed-off-by: Yang Xiwen --- drivers/net/hifem

[PATCH v2 1/4] net: hifemac_mdio: use log_msg_ret() correctly, report error by dev_err()

2024-01-21 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen The initial commit used log_msg_ret() wrongly. Fix that by moving error report to a separate dev_err() call and shrink the first argument of log_msg_ret() to no more than 4 chars. Fixes: 6b5c8d98e204 ("net: add hifemac_mdio MDIO bus driver for HiSilicon platform")

Re: [PATCH] wdt: add HiSilicon watchdog driver support

2024-01-19 Thread Yang Xiwen
On 1/19/2024 12:24 PM, Yang Xiwen via B4 Relay wrote: From: Yang Xiwen This watchdog core is found on many HiSilicon SoCs. Add support for it. Signed-off-by: Yang Xiwen --- drivers/watchdog/Kconfig| 10 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/hisi_wdt.c | 196

[PATCH RFC 2/2] clk: add clock framework for HiSilicon SoCs

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Hi3798 Series SoCs have a CRG (Clock Reset Generator) module which manages all clocks and resets of the SoC. The first supported chip is Hi3798MV200. The unused clocks are not registered to save space and time. Only necessary clocks are implemented right now. Signed-off

[PATCH RFC 0/2] clk: add HiSilicon CLK framework

2024-01-19 Thread Yang Xiwen via B4 Relay
The first supported chip is Hi3798MV200. Signed-off-by: Yang Xiwen --- Yang Xiwen (2): clk: ccf: Export clk_register_mux_table() in linux/clk-provider.h clk: add clock framework for HiSilicon SoCs drivers/clk/Kconfig | 7 ++ drivers/clk/Makefile

[PATCH RFC 1/2] clk: ccf: Export clk_register_mux_table() in linux/clk-provider.h

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This function is used by HiSilicon Clock Framework. Signed-off-by: Yang Xiwen --- include/linux/clk-provider.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b8acacd49e..952439ad39 100644

[PATCH RFC 2/2] clk: add clock framework for HiSilicon SoCs

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Hi3798 Series SoCs have a CRG (Clock Reset Generator) module which manages all clocks and resets of the SoC. The first supported chip is Hi3798MV200. The unused clocks are not registered to save space and time. Only necessary clocks are implemented right now. Signed-off

[PATCH RFC 0/2] clk: add HiSilicon CLK framework

2024-01-19 Thread Yang Xiwen via B4 Relay
The first supported chip is Hi3798MV200. Signed-off-by: Yang Xiwen --- Yang Xiwen (2): clk: ccf: Export clk_register_mux_table() in linux/clk-provider.h clk: add clock framework for HiSilicon SoCs drivers/clk/Kconfig | 7 ++ drivers/clk/Makefile

[PATCH RFC 1/2] clk: ccf: Export clk_register_mux_table() in linux/clk-provider.h

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This function is used by HiSilicon Clock Framework. Signed-off-by: Yang Xiwen --- include/linux/clk-provider.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b8acacd49e..952439ad39 100644

[PATCH] reset: reset-hisilicon: also handle #reset-cells = <2>

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It's also valid to have #reset-cells = <2> while the third arg defaults to ASSERT_SET. Signed-off-by: Yang Xiwen --- drivers/reset/reset-hisilicon.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/reset/reset-hisilicon.c b/d

[PATCH 0/3] net: hifemac: a few cleanups

2024-01-19 Thread Yang Xiwen via B4 Relay
Fix the use of log_msg_ret() and add dev_xxx() for error reporting. Register mdio subnode as a mdio bus device for hifemac. Signed-off-by: Yang Xiwen --- Yang Xiwen (3): net: hifemac_mdio: use log_msg_ret() correctly, report error by dev_err() net: hifemac: fix log reporting

[PATCH 3/3] net: hifemac: register MDIO bus device for subnode

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen register internal MDIO bus device if it is a subnode. Signed-off-by: Yang Xiwen --- drivers/net/hifemac.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/net/hifemac.c b/drivers/net/hifemac.c index 1088f3eca3..39c0233b62 100644

[PATCH 2/3] net: hifemac: fix log reporting

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen shrink the first argument of log_msg_ret(), add dev_xxx() functions for error reporting. Fixes: 9d8f78a2a79f7 ("net: add hifemac Ethernet driver for HiSilicon platform") Signed-off-by: Yang Xiwen --- drivers/net/hifem

[PATCH 1/3] net: hifemac_mdio: use log_msg_ret() correctly, report error by dev_err()

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen The initial commit used log_msg_ret() wrongly. Fix that by moving error report to a separate dev_err() call and shrink the first argument of log_msg_ret() to no more than 4 chars. Fixes: 6b5c8d98e204 ("net: add hifemac_mdio MDIO bus driver for HiSilicon platform")

[PATCH] mmc: hi6220-dwmmc: handle clocks and resets if CONFIG_CLK and CONFIG_DM_RESET enabled

2024-01-19 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This can avoid hardcoding a clock rate in driver. Also can enable the clocks and deassert the resets if the pre-bootloader does not do this for us. Currently only enabled for Hi3798MV200. Signed-off-by: Yang Xiwen --- drivers/mmc/hi6220_dw_mmc.c | 61

[PATCH] wdt: add HiSilicon watchdog driver support

2024-01-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This watchdog core is found on many HiSilicon SoCs. Add support for it. Signed-off-by: Yang Xiwen --- drivers/watchdog/Kconfig| 10 +++ drivers/watchdog/Makefile | 1 + drivers/watchdog/hisi_wdt.c | 196 3 files changed

[PATCH] test: dm: clk_ccf: fix building error

2023-12-15 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Fix unused variable error produced by building tests Fixes: d3061824 (test: dm: clk_ccf: test ccf_clk_ops) Signed-off-by: Yang Xiwen --- it's detected by u-boot gitlab CI. --- test/dm/clk_ccf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/dm

[PATCH v3 0/2] clk: ccf: fix enable_count mismatch

2023-12-15 Thread Yang Xiwen via B4 Relay
As described in [1], enable_count is incremented by 2 when ccf_clk_enable() is called. This series of patch fixed this issue and added a testcase for that. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.com/ Signed-off-by: Yang Xiwen

[PATCH v3 1/2] clk: get correct ops for clk_enable() and clk_disable()

2023-12-15 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations are called on clocks. This fixes the incorrect enable_count issue as described in [1]. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.

[PATCH v3 2/2] test: dm: clk_ccf: test ccf_clk_ops

2023-12-15 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Assign ccf_clk_ops to .ops of clk_ccf driver so that it can act as an clk provider. Also add "#clock-cells=<1>" to its device tree node. Add "i2c_root" to clk_test in the device tree and driver for testing. Get "i2c_root" clock in CCF unit

[PATCH v2 2/4] clk: get correct ops for clk_enable() and clk_disable()

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations are called on clocks. This fixes the incorrect enable_count issue as described in [1]. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.

[PATCH v2 1/4] clk: clk_sandbox_ccf: assign ccf_clk_ops to .ops of the driver

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It can now act as an clk provider on which ccf_clk_ops can be tested. Also add "#clock-cells=<1>" to test.dts. Signed-off-by: Yang Xiwen --- arch/sandbox/dts/test.dts | 1 + drivers/clk/clk_sandbox_ccf.c | 1 + 2 files changed, 2 insertions(+) diff --gi

[PATCH v2 3/4] clk: clk_sandbox: get devm clock i2c_root

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This clock is added to dts. Get it in the devm group in the driver or the testcases will fail. Signed-off-by: Yang Xiwen --- arch/sandbox/dts/test.dts | 5 +++-- arch/sandbox/include/asm/clk.h | 1 + drivers/clk/clk_sandbox_test.c | 5 + 3 files changed, 9 insertions

[PATCH v2 0/4] clk: ccf: fix enable_count mismatch

2023-11-18 Thread Yang Xiwen via B4 Relay
As described in [1], enable_count is incremented by 2 when ccf_clk_enable() is called. This series of patch fixed this issue and added a testcase for that. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.com/ Signed-off-by: Yang Xiwen

[PATCH v2 4/4] test: dm: clk_ccf: get "i2c_root" clock from _ccf

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen get i2c_root clock from device tree. In this way we get an CCF clock and also test ccf_clk_ops. Signed-off-by: Yang Xiwen --- test/dm/clk_ccf.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index

[PATCH 1/4] clk: clk_sandbox_ccf: assign ccf_clk_ops to .ops of the driver

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It can now act as an clk provider on which ccf_clk_ops can be tested. Also add "#clock-cells=<1>" to test.dts. --- arch/sandbox/dts/test.dts | 1 + drivers/clk/clk_sandbox_ccf.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/sandbox/dts/test.dt

[PATCH 4/4] test: dm: clk_ccf: get "i2c_root" clock from _ccf

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen get i2c_root clock from device tree. In this way we get an CCF clock and also test ccf_clk_ops. Signed-off-by: Yang Xiwen --- test/dm/clk_ccf.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index

[PATCH 0/4] clk: ccf: fix enable_count mismatch

2023-11-18 Thread Yang Xiwen via B4 Relay
As described in [1], enable_count is incremented by 2 when ccf_clk_enable() is called. This series of patch fixed this issue and added a testcase for that. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.com/ Signed-off-by: Yang Xiwen

[PATCH 2/4] clk: get correct ops for clk_enable() and clk_disable()

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations are called on clocks. This fixes the incorrect enable_count issue as described in [1]. [1]: https://lore.kernel.org/all/sezpr06mb695927a6deeef8489a06897396...@sezpr06mb6959.apcprd06.prod.outlook.

[PATCH 3/4] clk: clk_sandbox: get devm clock i2c_root

2023-11-18 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen This clock is added to dts. Get it in the devm group in the driver or the testcases will fail. Signed-off-by: Yang Xiwen --- arch/sandbox/dts/test.dts | 5 +++-- arch/sandbox/include/asm/clk.h | 1 + drivers/clk/clk_sandbox_test.c | 5 + 3 files changed, 9 insertions

[PATCH v2] clk: check parent_name in clk_register to avoid confusing log_error() output

2023-11-10 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen For some gate clocks and fixed clocks without a parent, calling clk_register will print an useless error message indicating that parent is missing. Fix that by gaurding log_xxx() with an if-statement. Signed-off-by: Yang Xiwen Suggested-by: Sean Anderson --- It's found during

Re: [PATCH RESEND 5/5] clk: ccf: call clock provided ops directly for endisable()

2023-11-01 Thread Yang Xiwen
On 11/2/2023 2:50 AM, Yang Xiwen wrote: > On 11/2/2023 2:19 AM, Sean Anderson wrote: >> On 8/17/23 13:04, Yang Xiwen via B4 Relay wrote: >>> From: Yang Xiwen >>> >>> Calling into CCF framework will cause a clock being enabled twice >>> instead of on

Re: [PATCH RESEND 2/5] clk: call log_debug() instead to avoid console log printing

2023-11-01 Thread Yang Xiwen
On 11/2/2023 2:01 AM, Sean Anderson wrote: > On 11/1/23 13:55, Sean Anderson wrote: >> On 8/17/23 13:04, Yang Xiwen via B4 Relay wrote: >>> From: Yang Xiwen >>> >>> it's a very common case to register a clock without a parent, such as >>> clk_register_

Re: [PATCH RESEND 5/5] clk: ccf: call clock provided ops directly for endisable()

2023-11-01 Thread Yang Xiwen
On 11/2/2023 2:19 AM, Sean Anderson wrote: > On 8/17/23 13:04, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen >> >> Calling into CCF framework will cause a clock being enabled twice >> instead of once (clk->enable_count becomes 2 rather than 1), thus makin

Re: [PATCH RESEND 1/5] clk: export clk_register_mux_table()

2023-11-01 Thread Yang Xiwen
On 11/2/2023 1:50 AM, Sean Anderson wrote: > On 8/17/23 13:04, Yang Xiwen via B4 Relay wrote: >> From: Yang Xiwen >> >> It's already implemented in clk-mux.c, export it in the header file. >> >> Signed-off-by: Yang Xiwen >> --- >>   include/linux/clk

Re: [PATCH RESEND 0/5] clk: A few bugfixes/enhancements for CCF

2023-08-24 Thread Yang Xiwen
Why is this patchset completely ignored for more than half a month already? I have some other patches pending because of this one. Please tell me what's wrong with this patchset so that i can fix them. -- Regards, Yang Xiwen

[PATCH RESEND v2 0/2] net: add support for HiSilicon Fast Ethernet Controller driver

2023-08-22 Thread Yang Xiwen via B4 Relay
for Hi3798MV200 since the clock driver is missing. I will implement and submit the clock driver and the framework in a later patchset. Signed-off-by: Yang Xiwen --- Changes in v2: - hisi_femac: clear previous irq before sending - Link to v1: https://lore.kernel.org/r/20230725-wip-hisi_femac-trunk-v1

[PATCH RESEND v2 1/2] net: add hifemac Ethernet driver for HiSilicon platform

2023-08-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It adds the driver for HIFEMAC Ethernet controller found on HiSilicon SoCs like Hi3798MV200. It's based on the mainstream linux driver, but quite a lot of code gets rewritten and cleaned up to adopt u-boot driver model. Signed-off-by: Yang Xiwen --- drivers/net/Kconfig

[PATCH RESEND v2 2/2] net: add hifemac_mdio MDIO bus driver for HiSilicon platform

2023-08-22 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It adds the driver for the internal MDIO bus of HIFEMAC Ethernet controller. It's based on the mainstream linux driver. Signed-off-by: Yang Xiwen --- drivers/net/Kconfig| 8 drivers/net/Makefile | 1 + drivers/net/hifemac_mdio.c | 116

[PATCH RESEND 5/5] clk: ccf: call clock provided ops directly for endisable()

2023-08-17 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Calling into CCF framework will cause a clock being enabled twice instead of once (clk->enable_count becomes 2 rather than 1), thus making it hard to disable (needs to call clk_disable() twice). Fix that by calling clock provided ops directly. Signed-off-by: Yang Xi

[PATCH RESEND 2/5] clk: call log_debug() instead to avoid console log printing

2023-08-17 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen it's a very common case to register a clock without a parent, such as clk_register_fixed_rate(). Replace log_error() with log_debug() to avoid useless console log if not debugging. Signed-off-by: Yang Xiwen --- drivers/clk/clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH RESEND 4/5] clk: promote clk_dev_ops to linux/clk-provider.h

2023-08-17 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen So that it can be used by others. Signed-off-by: Yang Xiwen --- drivers/clk/clk-uclass.c | 5 - include/linux/clk-provider.h | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index dc3e9d6a26

[PATCH RESEND 3/5] clk: also handle ENOENT in *_optional functions

2023-08-17 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen If the device does not specify any clocks in device tree, these functions will return PTR_ERR(-ENOENT). This is not the intended behavior and does not comply with linux kernel CCF. Fix that by returning NULL under such circumstances instead. Signed-off-by: Yang Xiwen

[PATCH RESEND 1/5] clk: export clk_register_mux_table()

2023-08-17 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It's already implemented in clk-mux.c, export it in the header file. Signed-off-by: Yang Xiwen --- include/linux/clk-provider.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b8acacd49e..801404480b

[PATCH RESEND 0/5] clk: A few bugfixes/enhancements for CCF

2023-08-17 Thread Yang Xiwen via B4 Relay
They are found during my development for HiSilicon clock driver. Details are in commit logs. Signed-off-by: Yang Xiwen --- Yang Xiwen (5): clk: export clk_register_mux_table() clk: call log_debug() instead to avoid console log printing clk: also handle ENOENT in *_optional

[PATCH v2 1/2] net: add hifemac Ethernet driver for HiSilicon platform

2023-08-13 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It adds the driver for HIFEMAC Ethernet controller found on HiSilicon SoCs like Hi3798MV200. It's based on the mainstream linux driver, but quite a lot of code gets rewritten and cleaned up to adopt u-boot driver model. Signed-off-by: Yang Xiwen --- drivers/net/Kconfig

[PATCH v2 0/2] net: add support for HiSilicon Fast Ethernet Controller driver

2023-08-13 Thread Yang Xiwen via B4 Relay
for Hi3798MV200 since the clock driver is missing. I will implement and submit the clock driver and the framework in a later patchset. Signed-off-by: Yang Xiwen --- Changes in v2: - hisi_femac: clear previous irq before sending - Link to v1: https://lore.kernel.org/r/20230725-wip-hisi_femac-trunk-v1

[PATCH v2 2/2] net: add hifemac_mdio MDIO bus driver for HiSilicon platform

2023-08-13 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It adds the driver for the internal MDIO bus of HIFEMAC Ethernet controller. It's based on the mainstream linux driver. Signed-off-by: Yang Xiwen --- drivers/net/Kconfig| 8 drivers/net/Makefile | 1 + drivers/net/hifemac_mdio.c | 116

[PATCH 4/5] clk: promote clk_dev_ops to linux/clk-provider.h

2023-08-08 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen So that it can be used by others. Signed-off-by: Yang Xiwen --- drivers/clk/clk-uclass.c | 5 - include/linux/clk-provider.h | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index dc3e9d6a26

[PATCH 5/5] clk: ccf: call clock provided ops directly for endisable()

2023-08-08 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen Calling into CCF framework will cause a clock being enabled twice instead of once (clk->enable_count becomes 2 rather than 1), thus making it hard to disable (needs to call clk_disable() twice). Fix that by calling clock provided ops directly. Signed-off-by: Yang Xi

[PATCH 2/5] clk: call log_debug() instead to avoid console log printing

2023-08-08 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen it's a very common case to register a clock without a parent, such as clk_register_fixed_rate(). Replace log_error() with log_debug() to avoid useless console log if not debugging. Signed-off-by: Yang Xiwen --- drivers/clk/clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH 3/5] clk: also handle ENOENT in *_optional functions

2023-08-08 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen If the device does not specify any clocks in device tree, these functions will return PTR_ERR(-ENOENT). This is not the intended behavior and does not comply with linux kernel CCF. Fix that by returning NULL under such circumstances instead. Signed-off-by: Yang Xiwen

[PATCH 0/5] clk: A few bugfixes/enhancements for CCF

2023-08-08 Thread Yang Xiwen via B4 Relay
They are found during my development for HiSilicon clock driver. Details are in commit logs. Signed-off-by: Yang Xiwen --- Yang Xiwen (5): clk: export clk_register_mux_table() clk: call log_debug() instead to avoid console log printing clk: also handle ENOENT in *_optional

[PATCH 1/5] clk: export clk_register_mux_table()

2023-08-08 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It's already implemented in clk-mux.c, export it in the header file. Signed-off-by: Yang Xiwen --- include/linux/clk-provider.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b8acacd49e..801404480b

Re: [PATCH] clk: also return NULL for -ENOENT in devm_clk_get_optional functions

2023-07-24 Thread Yang Xiwen
On 7/25/2023 1:34 AM, Fabio Estevam wrote: On Mon, Jul 24, 2023 at 2:32 PM Yang Xiwen via B4 Relay wrote: From: Yang Xiwen As described by the doc. Which doc? Please mention the details in the commit log. It's in the source annotation of devm_clk_get_optional. The annotation says -ENOENT

[PATCH] clk: also return NULL for -ENOENT in devm_clk_get_optional functions

2023-07-24 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen As described by the doc. Signed-off-by: Yang Xiwen --- Handle both ENODATA and ENOENT. --- include/clk.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/clk.h b/include/clk.h index d91285235f..c9aa2360e1 100644 --- a/include/clk.h +++ b

[PATCH 1/2] net: add hifemac Ethernet driver for HiSilicon platform

2023-07-24 Thread Yang Xiwen via B4 Relay
From: Yang Xiwen It adds the driver for HIFEMAC Ethernet controller found on HiSilicon SoCs like Hi3798MV200. It's based on the mainstream linux driver, but quite a lot of code gets rewritten and cleaned up to adopt u-boot driver model. Signed-off-by: Yang Xiwen --- drivers/net/Kconfig

  1   2   >