[PATCH] watchdog: aspeed: fix hardware timeout calculation

2021-04-16 Thread rentao . bupt
From: Tao Ren Fix hardware timeout calculation in aspeed_wdt_set_timeout function to ensure the reload value does not exceed the hardware limit. Fixes: efa859f7d786 ("watchdog: Add Aspeed watchdog driver") Reported-by: Amithash Prasad Signed-off-by: Tao Ren --- drivers/watchdog/aspeed_wdt.c

[PATCH v2] watchdog: aspeed: fix integer overflow in set_timeout handler

2021-04-15 Thread rentao . bupt
From: Tao Ren Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout handler to avoid potential integer overflow when the supplied timeout is greater than aspeed's maximum allowed timeout (4294 seconds). Fixes: efa859f7d786 ("watchdog: Add Aspeed watchdog driver") Reported-by:

[PATCH] watchdog: aspeed: fix integer overflow in set_timeout handler

2021-04-15 Thread rentao . bupt
From: Tao Ren Fix the time comparison (timeout vs. max_hw_heartbeat_ms) in set_timeout handler to avoid potential integer overflow when the supplied timeout is greater than aspeed's maximum allowed timeout (4294 seconds). Fixes: efa859f7d786 ("watchdog: Add Aspeed watchdog driver") Reported-by:

[PATCH] usb: gadget: aspeed: fix dma map failure

2021-03-30 Thread rentao . bupt
From: Tao Ren Currently the virtual port_dev device is passed to DMA API, and this is wrong because the device passed to DMA API calls must be the actual hardware device performing the DMA. The patch replaces usb_gadget_map_request/usb_gadget_unmap_request APIs with

[PATCH] usb: gadget: aspeed: set port_dev dma mask

2021-03-26 Thread rentao . bupt
From: Tao Ren Set aspeed-usb vhub port_dev's dma mask to pass the dma_mask test in "dma_map_page_attrs" function, and the dma_mask test was added in 'commit f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")'. Below is the backtrace without the patch: [<80106550>]

[PATCH v5 1/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring driver

2020-11-23 Thread rentao . bupt
From: Tao Ren Add hardware monitoring driver for the Maxim MAX127 chip. MAX127 min/max range handling code is inspired by the max197 driver. Signed-off-by: Tao Ren --- Changes in v5: - fix i2c_transfer() error handling. Changes in v4: - delete unnecessary "#include" lines. -

[PATCH v5 0/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring

2020-11-23 Thread rentao . bupt
From: Tao Ren The patch series adds hardware monitoring driver for the Maxim MAX127 chip. Patch #1 adds the max127 hardware monitoring driver, and patch #2 adds documentation for the driver. Tao Ren (2): hwmon: (max127) Add Maxim MAX127 hardware monitoring driver docs: hwmon: Document

[PATCH v5 2/2] docs: hwmon: Document max127 driver

2020-11-23 Thread rentao . bupt
From: Tao Ren Add documentation for the max127 hardware monitoring driver. Signed-off-by: Tao Ren Reviewed-by: Guenter Roeck --- Changes in v5: - None. Changes in v4: - None. Changes in v3: - no code change. xdp maintainers were removed from to/cc list. Changes in v2: - add

[PATCH v4 1/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring driver

2020-11-22 Thread rentao . bupt
From: Tao Ren Add hardware monitoring driver for the Maxim MAX127 chip. MAX127 min/max range handling code is inspired by the max197 driver. Signed-off-by: Tao Ren --- Changes in v4: - delete unnecessary "#include" lines. - simplify i2c_transfer() error handling. - add mutex to

[PATCH v4 2/2] docs: hwmon: Document max127 driver

2020-11-22 Thread rentao . bupt
From: Tao Ren Add documentation for the max127 hardware monitoring driver. Signed-off-by: Tao Ren Reviewed-by: Guenter Roeck --- Changes in v4: - None. Changes in v3: - no code change. xdp maintainers were removed from to/cc list. Changes in v2: - add more description for min/max

[PATCH v4 0/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring

2020-11-22 Thread rentao . bupt
From: Tao Ren The patch series adds hardware monitoring driver for the Maxim MAX127 chip. Patch #1 adds the max127 hardware monitoring driver, and patch #2 adds documentation for the driver. Tao Ren (2): hwmon: (max127) Add Maxim MAX127 hardware monitoring driver docs: hwmon: Document

[PATCH v3 2/2] docs: hwmon: Document max127 driver

2020-11-19 Thread rentao . bupt
From: Tao Ren Add documentation for the max127 hardware monitoring driver. Signed-off-by: Tao Ren --- Changes in v3: - no code change. xdp maintainers were removed from to/cc list. Changes in v2: - add more description for min/max sysfs nodes. - convert values from volt to millivolt

[PATCH v3 1/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring driver

2020-11-19 Thread rentao . bupt
From: Tao Ren Add hardware monitoring driver for the Maxim MAX127 chip. MAX127 min/max range handling code is inspired by the max197 driver. Signed-off-by: Tao Ren --- Changes in v3: - no code change. xdp maintainers were removed from to/cc list. Changes in v2: - replace

[PATCH v3 0/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring

2020-11-19 Thread rentao . bupt
From: Tao Ren The patch series adds hardware monitoring driver for the Maxim MAX127 chip. Patch #1 adds the max127 hardware monitoring driver, and patch #2 adds documentation for the driver. Resending the patch series (v3) with XDP maintainers removed from to/cc list to reduce noise. Tao Ren

[PATCH v2 2/2] docs: hwmon: Document max127 driver

2020-11-18 Thread rentao . bupt
From: Tao Ren Add documentation for the max127 hardware monitoring driver. Signed-off-by: Tao Ren --- Changes in v2: - add more description for min/max sysfs nodes. - convert values from volt to millivolt in the document. Documentation/hwmon/index.rst | 1 +

[PATCH v2 1/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring driver

2020-11-18 Thread rentao . bupt
From: Tao Ren Add hardware monitoring driver for the Maxim MAX127 chip. MAX127 min/max range handling code is inspired by the max197 driver. Signed-off-by: Tao Ren --- Changes in v2: - replace devm_hwmon_device_register_with_groups() with devm_hwmon_device_register_with_info() API.

[PATCH v2 0/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring

2020-11-18 Thread rentao . bupt
From: Tao Ren The patch series adds hardware monitoring driver for the Maxim MAX127 chip. Patch #1 adds the max127 hardware monitoring driver, and patch #2 adds documentation for the driver. Tao Ren (2): hwmon: (max127) Add Maxim MAX127 hardware monitoring driver docs: hwmon: Document

[PATCH 2/2] docs: hwmon: Document max127 driver

2020-11-16 Thread rentao . bupt
From: Tao Ren Add documentation for max127 hardware monitoring driver. Signed-off-by: Tao Ren --- Documentation/hwmon/index.rst | 1 + Documentation/hwmon/max127.rst | 43 ++ 2 files changed, 44 insertions(+) create mode 100644 Documentation/hwmon/max127.rst

[PATCH 0/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring

2020-11-16 Thread rentao . bupt
From: Tao Ren The patch series adds hardware monitoring driver for the Maxim MAX127 chip. Patch #1 adds the max127 hardware monitoring driver, and patch #2 adds documentation for the driver. Tao Ren (2): hwmon: (max127) Add Maxim MAX127 hardware monitoring driver docs: hwmon: Document

[PATCH 1/2] hwmon: (max127) Add Maxim MAX127 hardware monitoring driver

2020-11-16 Thread rentao . bupt
From: Tao Ren Add hardware monitoring driver for the Maxim MAX127 chip. MAX127 min/max range handling code is inspired by the max197 driver. Signed-off-by: Tao Ren --- drivers/hwmon/Kconfig | 9 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/max127.c | 286

[PATCH 2/4] ARM: dts: aspeed: wedge40: Use common dtsi

2020-11-11 Thread rentao . bupt
From: Tao Ren Simplify the Wedge40 device tree by using the common dtsi. Signed-off-by: Tao Ren --- .../boot/dts/aspeed-bmc-facebook-wedge40.dts | 112 +- 1 file changed, 1 insertion(+), 111 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts

[PATCH 3/4] ARM: dts: aspeed: wedge100: Use common dtsi

2020-11-11 Thread rentao . bupt
From: Tao Ren Simplify the Wedge100 device tree by using the common dtsi. In addition this enables the second firmware flash, and turns on the "i2c-mux-idle-disconnect" flag for I2C switch 7-0070. Signed-off-by: Tao Ren --- .../boot/dts/aspeed-bmc-facebook-wedge100.dts | 120

[PATCH 1/4] ARM: dts: aspeed: Common dtsi for Facebook AST2400 Network BMCs

2020-11-11 Thread rentao . bupt
From: Tao Ren This common descirption is included by all Facebook AST2400 Network BMC platforms to minimize duplicated device entries across Facebook Network BMC device trees. Signed-off-by: Tao Ren --- .../dts/ast2400-facebook-netbmc-common.dtsi | 117 ++ 1 file changed,

[PATCH 4/4] ARM: dts: aspeed: Add Facebook Galaxy100 (AST2400) BMC

2020-11-11 Thread rentao . bupt
From: Tao Ren Add initial version of device tree for Facebook Galaxy100 (AST2400) BMC. Signed-off-by: Tao Ren --- arch/arm/boot/dts/Makefile| 1 + .../dts/aspeed-bmc-facebook-galaxy100.dts | 57 +++ 2 files changed, 58 insertions(+) create mode 100644

[PATCH 0/4] ARM: dts: aspeed: Add Facebook Galaxy100 BMC

2020-11-11 Thread rentao . bupt
From: Tao Ren The patch series adds the initial version of device tree for Facebook Galaxy100 (AST2400) BMC. Patch #1 adds common dtsi to minimize duplicated device entries across Facebook Network AST2400 BMC device trees. Patch #2 simplfies Wedge40 device tree by using the common dtsi. Patch

[PATCH] ARM: dts: aspeed: minipack: Fixup I2C tree

2020-11-09 Thread rentao . bupt
From: Tao Ren Create all the i2c switches in device tree and use aliases to assign child channels with consistent bus numbers. Besides, "i2c-mux-idle-disconnect" is set for all the i2c switches to avoid potential conflicts when multiple devices (beind the switches) use the same device address.

[PATCH] ARM: dts: aspeed: wedge400: Fix FMC flash0 layout

2020-11-09 Thread rentao . bupt
From: Tao Ren Update "data0" partition's size from 8MB to 4MB to fix "partition data0 extends beyond the end of device" warning at bootup time. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-wedge400.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] gpio: aspeed: fix ast2600 bank properties

2020-09-16 Thread rentao . bupt
From: Tao Ren GPIO_U is mapped to the least significant byte of input/output mask, and the byte in "output" mask should be 0 because GPIO_U is input only. All the other bits need to be 1 because GPIO_V/W/X support both input and output modes. Similarly, GPIO_Y/Z are mapped to the 2 least

[PATCH 1/5] ARM: dts: aspeed: Remove flash layout from Facebook AST2500 Common dtsi

2020-08-24 Thread rentao . bupt
From: Tao Ren Remove FMC flash layout from ast2500-facebook-netbmc-common.dtsi because flash size and layout varies across different Facebook AST2500 OpenBMC platforms. Signed-off-by: Tao Ren --- .../boot/dts/ast2500-facebook-netbmc-common.dtsi| 13 - 1 file changed, 13

[PATCH 2/5] ARM: dts: aspeed: cmm: Set 32MB FMC flash layout

2020-08-24 Thread rentao . bupt
From: Tao Ren Set 32MB FMC flash layout in CMM device tree explicitly because the flash layout settings were removed from "ast2500-facebook-netbmc-common.dtsi". Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-cmm.dts | 17 + 1 file changed, 17 insertions(+)

[PATCH 0/5] ARM: dts: aspeed: Add Facebook Wedge400 (AST2500) BMC

2020-08-24 Thread rentao . bupt
From: Tao Ren The patch series adds Facebook Wedge400 (AST2500) BMC device tree, and FMC flash layout is re-structured because flash size and layout varies across different Facebook AST2500 OpenBMC platforms. Patch #1 removes flash layout from ast2500-facebook-netbmc-common.dtsi because now we

[PATCH 4/5] ARM: dts: aspeed: minipack: Update 64MB FMC flash layout

2020-08-24 Thread rentao . bupt
From: Tao Ren Set 64Mb FMC flash layout in Minipack device tree explicitly because the flash layout was removed from "ast2500-facebook-netbmc-common.dtsi". Please note "data0" partition' size is updated to 4MB to be consistent with other Facebook OpenBMC platforms. Signed-off-by: Tao Ren ---

[PATCH 3/5] ARM: dts: aspeed: yamp: Set 32MB FMC flash layout

2020-08-24 Thread rentao . bupt
From: Tao Ren Set 32MB FMC flash layout in Yamp device tree explicitly because flash layout settings were removed from "ast2500-facebook-netbmc-common.dtsi". Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-yamp.dts | 17 + 1 file changed, 17 insertions(+)

[PATCH 5/5] ARM: dts: aspeed: Add Facebook Wedge400 BMC

2020-08-24 Thread rentao . bupt
From: Tao Ren Add initial version of device tree for Facebook Wedge400 (AST2500) BMC. Signed-off-by: Tao Ren --- arch/arm/boot/dts/Makefile| 1 + .../boot/dts/aspeed-bmc-facebook-wedge400.dts | 420 ++ 2 files changed, 421 insertions(+) create mode

[PATCH 1/2] ARM: dts: aspeed: wedge40: Update FMC flash0 label

2020-08-24 Thread rentao . bupt
From: Tao Ren Update FMC flash0's label to "spi0.0" so it's consistent with all the other Facebook OpenBMC platforms. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 2/2] ARM: dts: aspeed: wedge40: Update UART4 pin settings

2020-08-24 Thread rentao . bupt
From: Tao Ren Enable UART4's NRTS4 (A19) pin because the pin is used for RS485 software emulation. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 0/2] ARM: dts: aspeed: wedge40: fix a few nits

2020-08-24 Thread rentao . bupt
From: Tao Ren This patch series fixes a few nits in wedge40 device tree. Patch #1 updates FMC flash label so it's consistent with other Facebook OpenBMC platforms. Patch #2 updates UART4 pin settings for the purpose of RS485 software emulation. Tao Ren (2): ARM: dts: aspeed: wedge40: Update

[PATCH v2] ARM: dts: aspeed: cmm: fixup i2c tree

2020-07-23 Thread rentao . bupt
From: Tao Ren Create all the i2c switches in device tree and use aliases to assign child channels with consistent bus numbers. Besides, "i2c-mux-idle-disconnect" is set for all the i2c switches to avoid potential conflicts when multiple devices (beind the switches) use the same device address.

[PATCH v2 0/3] ARM: dts: aspeed: fixup wedge40 device tree

2020-07-23 Thread rentao . bupt
From: Tao Ren The patch series update several devices' settings in Facebook Wedge40 device tree. Patch #1 disables a few i2c controllers as they are not being used at present. Patch #2 enables adc device for voltage monitoring. Patch #3 enables pwm_tacho device for fan control and monitoring.

[PATCH v2 3/3] ARM: dts: aspeed: wedge40: enable pwm_tacho device

2020-07-23 Thread rentao . bupt
From: Tao Ren Enable pwm_tacho device for fan control and monitoring in Wedge40. Signed-off-by: Tao Ren --- Changes in v2: - Nothing changed. Resending the patch just in case the previous email was not delivered. .../boot/dts/aspeed-bmc-facebook-wedge40.dts | 29 +++

[PATCH v2 1/3] ARM: dts: aspeed: wedge40: disable a few i2c controllers

2020-07-23 Thread rentao . bupt
From: Tao Ren Disable i2c bus #9, #10 and #13 as these i2c controllers are not used on Wedge40. Signed-off-by: Tao Ren --- Changes in v2: - Nothing changed. Resending the patch just in case the previous email was not delivered. arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 12

[PATCH v2 2/3] ARM: dts: aspeed: wedge40: enable adc device

2020-07-23 Thread rentao . bupt
From: Tao Ren Enable adc controller and corresponding voltage sensoring channels for Wedge40. Signed-off-by: Tao Ren --- Changes in v2: - Nothing changed. Resending the patch just in case the previous email was not delivered. arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 9

[PATCH] hwmon: (pmbus) fix a typo in Kconfig SENSORS_IR35221 option

2020-07-02 Thread rentao . bupt
From: Tao Ren Fix a typo in SENSORS_IR35221 option: module name should be "ir35221" instead of "ir35521". Fixes: 8991ebd9c9a6 ("hwmon: (pmbus) Add client driver for IR35221") Cc: Samuel Mendoza-Jonas Signed-off-by: Tao Ren --- drivers/hwmon/pmbus/Kconfig | 2 +- 1 file changed, 1

[PATCH] ARM: dts: aspeed: cmm: fixup i2c tree

2020-07-01 Thread rentao . bupt
From: Tao Ren Create all the i2c switches in device tree and use aliases to assign child channels with consistent bus numbers. Besides, "i2c-mux-idle-disconnect" is set for all the i2c switches to avoid potential conflicts when multiple devices (beind the switches) use the same device address.

[PATCH 2/3] ARM: dts: aspeed: wedge40: enable adc device

2020-06-29 Thread rentao . bupt
From: Tao Ren Enable adc controller and corresponding voltage sensoring channels for Wedge40. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts

[PATCH 1/3] ARM: dts: aspeed: wedge40: disable a few i2c controllers

2020-06-29 Thread rentao . bupt
From: Tao Ren Disable i2c bus #9, #10 and #13 as these i2c controllers are not used on Wedge40. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts | 12 1 file changed, 12 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts

[PATCH 3/3] ARM: dts: aspeed: wedge40: enable pwm_tacho device

2020-06-29 Thread rentao . bupt
From: Tao Ren Enable pwm_tacho device for fan control and monitoring in Wedge40. Signed-off-by: Tao Ren --- .../boot/dts/aspeed-bmc-facebook-wedge40.dts | 29 +++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-wedge40.dts

[PATCH 0/3] ARM: dts: aspeed: fixup wedge40 device tree

2020-06-29 Thread rentao . bupt
From: Tao Ren The patch series update several devices' settings in Facebook Wedge40 device tree. Patch #1 disables a few i2c controllers as they are not being used at present. Patch #2 enables adc device for voltage monitoring. Patch #3 enables pwm_tacho device for fan control and monitoring.

[PATCH net-next] of: mdio: preserve phy dev_flags in of_phy_connect()

2020-06-18 Thread rentao . bupt
From: Tao Ren Replace assignment "=" with OR "|=" for "phy->dev_flags" so "dev_flags" configured in phy probe() function can be preserved. The idea is similar to commit e7312efbd5de ("net: phy: modify assignment to OR for dev_flags in phy_attach_direct"). Signed-off-by: Tao Ren ---

[PATCH] usb: gadget: aspeed: fixup vhub port irq handling

2020-05-27 Thread rentao . bupt
From: Tao Ren This is a follow-on patch for commit a23be4ed8f48 ("usb: gadget: aspeed: improve vhub port irq handling"): for_each_set_bit() is replaced with simple for() loop because for() loop runs faster on ASPEED BMC. Signed-off-by: Tao Ren --- drivers/usb/gadget/udc/aspeed-vhub/core.c |

[PATCH net-next v10 2/3] net: phy: add support for clause 37 auto-negotiation

2019-10-22 Thread rentao . bupt
From: Heiner Kallweit This patch adds support for clause 37 1000Base-X auto-negotiation. Signed-off-by: Heiner Kallweit Signed-off-by: Tao Ren Tested-by: René van Dorst Reviewed-by: Andrew Lunn --- No change in v9/v10. Changes in v8: - Rebased the patch on top of net-next HEAD. Changes

[PATCH net-next v10 1/3] net: phy: modify assignment to OR for dev_flags in phy_attach_direct

2019-10-22 Thread rentao . bupt
From: Tao Ren Modify the assignment to OR when dealing with phydev->dev_flags in phy_attach_direct function, and this is to make sure dev_flags set in driver's probe callback won't be lost. Suggested-by: Andrew Lunn CC: Heiner Kallweit CC: Vladimir Oltean Signed-off-by: Tao Ren Reviewed-by:

[PATCH net-next v10 3/3] net: phy: broadcom: add 1000Base-X support for BCM54616S

2019-10-22 Thread rentao . bupt
From: Tao Ren The BCM54616S PHY cannot work properly in RGMII->1000Base-X mode, mainly because genphy functions are designed for copper links, and 1000Base-X (clause 37) auto negotiation needs to be handled differently. This patch enables 1000Base-X support for BCM54616S by customizing 3 driver

[PATCH net-next v10 0/3] net: phy: support 1000Base-X auto-negotiation for BCM54616S

2019-10-22 Thread rentao . bupt
From: Tao Ren This patch series aims at supporting auto negotiation when BCM54616S is running in 1000Base-X mode: without the patch series, BCM54616S PHY driver would report incorrect link speed in 1000Base-X mode. Patch #1 (of 3) modifies assignment to OR when dealing with dev_flags in