MIPS: Fixes and improvements for CI20 board (JZ4780)
Subsystems (9)
cover MIPS: Fixes and improvements for CI20 board (JZ4780)
This patch set provides several improvements for the CI20 board:
* suppress warnings from i2c if device is not responding
* make ingenic-drm found through DT
* allow davicom dm9000 ethernet controller to use MAC address provided by U-Boot
* fix #include in jz4780.dtsi
* configure for loadable kernel modules
* add DTS for IR sensor and SW1 button
* configure so that LEDs, IR sensor, SW1 button have drivers
* fix DTS for ACT8600 PMU and configure driver
* fix interrupt of nxp,pcf8563
There is another patch set in our queue to add HDMI support on top of this work.
Alex Smith (1):
MIPS: DTS: CI20: add DT node for IR sensor
H. Nikolaus Schaller (13):
i2c: jz4780: suppress txabrt reports for i2cdetect
drm: ingenic-drm: add MODULE_DEVICE_TABLE
net: davicom: dm9000: allow to pass MAC address through mac_addr
module parameter
MIPS: DTS: jz4780: fix #includes for irq.h and gpio.h
MIPS: CI20: defconfig: configure for supporting modules
MIPS: CI20: defconfig: compile leds-gpio driver into the kernel and
configure for LED triggers
MIPS: DTS: CI20: fix PMU definitions for ACT8600
MIPS: CI20: defconfig: configure CONFIG_REGULATOR_ACT8865 for PMU
MIPS: DTS: CI20: give eth0_power a defined voltage.
MIPS: CI20: defconfig: compile gpio-ir driver
MIPS: DTS: CI20: add DT node for SW1 as Enter button
MIPS: CI20: defconfig: configure for CONFIG_KEYBOARD_GPIO=m
MIPS: DTS: CI20: fix interrupt for pcf8563 RTC
arch/mips/boot/dts/ingenic/ci20.dts | 71 ++++++++++++++++++++------ arch/mips/boot/dts/ingenic/jz4780.dtsi | 2 + arch/mips/configs/ci20_defconfig | 21 ++++++++ drivers/gpu/drm/ingenic/ingenic-drm.c | 2 + drivers/i2c/busses/i2c-jz4780.c | 3 ++ drivers/net/ethernet/davicom/dm9000.c | 42 +++++++++++++++ 6 files changed, 125 insertions(+), 16 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/14 i2c: jz4780: suppress txabrt reports for i2cdetect
This suppresses "simple" error reasons
ABRT_7B_ADDR_NOACK ABRT_10ADDR1_NOACK ABRT_10ADDR2_NOACK
from flooding the console log when running i2cdetect on addresses without a responding slave.
Additionally, reading the JZ4780_I2C_TAR in this situation seems to harm the controller state.
--- drivers/i2c/busses/i2c-jz4780.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/i2c/busses/i2c-jz4780.c +3 -0
@@ -578,6 +578,9 @@ static void jz4780_i2c_txabrt(struct jz4780_i2c *i2c, int src) {int i; +if (!(src & ~7 )) +return ; +dev_err (&i2c->adap.dev,"txabrt: 0x%08x\n" , src);dev_err (&i2c->adap.dev,"device addr=%x\n" ,jz4780_i2c_readw (i2c,JZ4780_I2C_TAR ));
Signature · 1 line
2.23.0
PATCH 2/14 drm: ingenic-drm: add MODULE_DEVICE_TABLE
In reply to H. Nikolaus SchallerAdd MODULE_DEVICE_TABLE so that the driver can load by matching the device tree if compiled as module.
--- drivers/gpu/drm/ingenic/ingenic-drm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/ingenic/ingenic-drm.c +2 -0
@@ -844,6 +844,8 @@ static const struct of_device_id ingenic_drm_of_match[] = { { /* sentinel */ }, }; +MODULE_DEVICE_TABLE (of, ingenic_drm_of_match); +static struct platform_driver ingenic_drm_driver = { .driver = { .name ="ingenic-drm" ,
Signature · 1 line
2.23.0
PATCH 3/14 net: davicom: dm9000: allow to pass MAC address through mac_addr module parameter
In reply to H. Nikolaus SchallerThis is needed to give the MIPS Ingenic CI20 board a stable MAC address which can be optionally provided by vendor U-Boot.
For get_mac_addr() we use an adapted copy of from ksz884x.c which has very similar functionality.
--- drivers/net/ethernet/davicom/dm9000.c | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
drivers/net/ethernet/davicom/dm9000.c +42 -0
@@ -1409,6 +1409,43 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev)return pdata; } +static char *mac_addr =":" ; +module_param (mac_addr, charp,0 ); +MODULE_PARM_DESC (mac_addr,"MAC address" ); + +static void get_mac_addr (struct net_device *ndev,char *macaddr) +{ +int i =0 ; +int j =0 ; +int got_num =0 ; +int num =0 ; + +while (j <ETH_ALEN ) { +if (macaddr[i]) { +int digit; + + got_num =1 ; + digit =hex_to_bin (macaddr[i]); +if (digit >=0 ) + num = num *16 + digit; +else if (':' == macaddr[i]) + got_num =2 ; +else +break ; + }else if (got_num) { + got_num =2 ; + }else { +break ; + } +if (got_num ==2 ) { + ndev->dev_addr[j++] = (u8 )num; + num =0 ; + got_num =0 ; + } + i++; + } +} +/* * Search DM9000 board, allocate space and register it */
@@ -1679,6 +1716,11 @@ dm9000_probe(struct platform_device *pdev) ndev->dev_addr[i] =ior (db, i+DM9000_PAR ); } +if (!is_valid_ether_addr (ndev->dev_addr)) { + mac_src ="param" ; +get_mac_addr (ndev, mac_addr); + } +if (!is_valid_ether_addr (ndev->dev_addr)) { inv_mac_addr = true;eth_hw_addr_random (ndev);
Signature · 1 line
2.23.0
PATCH 4/14 MIPS: DTS: jz4780: fix #includes for irq.h and gpio.h
In reply to H. Nikolaus SchallerThe constants from irq.h and gpio.h can be used in the jz4780.dtsi and derived DTS like ci20.dts.
--- arch/mips/boot/dts/ingenic/jz4780.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/boot/dts/ingenic/jz4780.dtsi +2 -0
@@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include <dt-bindings/clock/jz4780-cgu.h> #include <dt-bindings/dma/jz4780-dma.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/irq.h> / { #address-cells = <1>;
Signature · 1 line
2.23.0
PATCH 5/14 MIPS: CI20: defconfig: configure for supporting modules
In reply to H. Nikolaus SchallerNot all drivers need to be compiled into the kernel. Support building and loading of kernel modules.
--- arch/mips/configs/ci20_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/configs/ci20_defconfig +1 -0
@@ -1,4 +1,5 @@ # CONFIG_LOCALVERSION_AUTO is not set +CONFIG_MODULES=y CONFIG_KERNEL_XZ=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y
Signature · 1 line
2.23.0
PATCH 6/14 MIPS: CI20: defconfig: compile leds-gpio driver into the kernel and configure for LED triggers
In reply to H. Nikolaus SchallerDTS has been augmented to add some gpio-leds. We need the leds-gpio driver and enable the triggers.
--- arch/mips/configs/ci20_defconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/mips/configs/ci20_defconfig +13 -0
@@ -167,3 +167,16 @@ CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon console=ttyS4,115200 clk_ignore_unused" +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_MTD=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=m +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +CONFIG_LEDS_TRIGGER_TRANSIENT=y +CONFIG_LEDS_TRIGGER_CAMERA=m
Signature · 1 line
2.23.0
PATCH 7/14 MIPS: DTS: CI20: fix PMU definitions for ACT8600
In reply to H. Nikolaus SchallerThere is a ACT8600 on the CI20 board and the bindings of the ACT8865 driver have changed without updating the CI20 device tree. Therefore the PMU can not be probed successfully and is running in power-on reset state.
Fix DT to match the latest act8865-regulator bindings.
--- arch/mips/boot/dts/ingenic/ci20.dts | 48 ++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 15 deletions(-)
arch/mips/boot/dts/ingenic/ci20.dts +33 -15
@@ -148,6 +148,8 @@ pinctrl-0 = <&pins_uart4>; }; +#include <dt-bindings/regulator/active-semi,8865-regulator.h> + &i2c0 { status = "okay";
@@ -161,65 +163,81 @@ reg = <0x5a>; status = "okay"; +/* +Optional input supply properties: +- for act8600: + - vp1-supply: The input supply for DCDC_REG1 + - vp2-supply: The input supply for DCDC_REG2 + - vp3-supply: The input supply for DCDC_REG3 + - inl-supply: The input supply for LDO_REG5, LDO_REG6, LDO_REG7 and LDO_REG8 + SUDCDC_REG4, LDO_REG9 and LDO_REG10 do not have separate supplies. +*/ + regulators { vddcore: SUDCDC1 { - regulator-name = "VDDCORE"; + regulator-name = "DCDC_REG1"; regulator-min-microvolt = <1100000>; regulator-max-microvolt = <1100000>; regulator-always-on; }; vddmem: SUDCDC2 { - regulator-name = "VDDMEM"; + regulator-name = "DCDC_REG2"; regulator-min-microvolt = <1500000>; regulator-max-microvolt = <1500000>; regulator-always-on; }; vcc_33: SUDCDC3 { - regulator-name = "VCC33"; + regulator-name = "DCDC_REG3"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; }; vcc_50: SUDCDC4 { - regulator-name = "VCC50"; + regulator-name = "SUDCDC_REG4"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; regulator-always-on; }; vcc_25: LDO_REG5 { - regulator-name = "VCC25"; + regulator-name = "LDO_REG5"; regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-always-on; }; wifi_io: LDO_REG6 { - regulator-name = "WIFIIO"; + regulator-name = "LDO_REG6"; regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-always-on; }; vcc_28: LDO_REG7 { - regulator-name = "VCC28"; + regulator-name = "LDO_REG7"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-always-on; }; vcc_15: LDO_REG8 { - regulator-name = "VCC15"; + regulator-name = "LDO_REG8"; regulator-min-microvolt = <1500000>; regulator-max-microvolt = <1500000>; regulator-always-on; }; - vcc_18: LDO_REG9 { - regulator-name = "VCC18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; + vrtc_18: LDO_REG9 { + regulator-name = "LDO_REG9"; + /* Despite the datasheet stating 3.3V for REG9 and + driver expecting that, REG9 outputs 1.8V. + Likely the CI20 uses a chip variant. + Since it is a simple on/off LDO the exact values + do not matter. + */ + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; regulator-always-on; }; vcc_11: LDO_REG10 { - regulator-name = "VCC11"; - regulator-min-microvolt = <1100000>; - regulator-max-microvolt = <1100000>; + regulator-name = "LDO_REG10"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; regulator-always-on; }; };
Signature · 1 line
2.23.0
PATCH 8/14 MIPS: CI20: defconfig: configure CONFIG_REGULATOR_ACT8865 for PMU
In reply to H. Nikolaus SchallerThe PMU on the CI20 board is an ACT8600 using the ACT8865 driver. Since it is not compiled, the PMU and the CI20 board is running in power-on reset state of the PMU.
--- arch/mips/configs/ci20_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/configs/ci20_defconfig +1 -0
@@ -95,6 +95,7 @@ CONFIG_JZ4740_WDT=y CONFIG_REGULATOR=y CONFIG_REGULATOR_DEBUG=y CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_ACT8865=y # CONFIG_VGA_CONSOLE is not set # CONFIG_HID is not set # CONFIG_USB_SUPPORT is not set
Signature · 1 line
2.23.0
PATCH 9/14 MIPS: DTS: CI20: give eth0_power a defined voltage.
In reply to H. Nikolaus SchallerThis is a 3.3V regulator.
--- arch/mips/boot/dts/ingenic/ci20.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/boot/dts/ingenic/ci20.dts +2 -0
@@ -56,6 +56,8 @@ eth0_power: fixedregulator@0 { compatible = "regulator-fixed"; regulator-name = "eth0_power"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; gpio = <&gpb 25 GPIO_ACTIVE_LOW>; enable-active-high; };
Signature · 1 line
2.23.0
PATCH 10/14 MIPS: DTS: CI20: add DT node for IR sensor
In reply to H. Nikolaus SchallerFrom: Alex Smith <[email protected]>
The infrared sensor on the CI20 board is connected to a GPIO and can be operated by using the gpio-ir-recv driver. Add a DT node for the sensor to allow that driver to be used.
--- arch/mips/boot/dts/ingenic/ci20.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/mips/boot/dts/ingenic/ci20.dts +5 -0
@@ -62,6 +62,11 @@ enable-active-high; }; + ir: ir-receiver { + compatible = "gpio-ir-receiver"; + gpios = <&gpe 3 GPIO_ACTIVE_LOW>; + }; + wlan0_power: fixedregulator@1 { compatible = "regulator-fixed"; regulator-name = "wlan0_power";
Signature · 1 line
2.23.0
PATCH 11/14 MIPS: CI20: defconfig: compile gpio-ir driver
In reply to H. Nikolaus SchallerThe CI20 board has a gpio based IR receiver.
--- arch/mips/configs/ci20_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
arch/mips/configs/ci20_defconfig +5 -0
@@ -181,3 +181,8 @@ CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_TRIGGER_DEFAULT_ON=y CONFIG_LEDS_TRIGGER_TRANSIENT=y CONFIG_LEDS_TRIGGER_CAMERA=m +CONFIG_LIRC=y +CONFIG_MEDIA_SUPPORT=m +CONFIG_RC_DEVICES=y +CONFIG_IR_GPIO_CIR=m +CONFIG_IR_GPIO_TX=m
Signature · 1 line
2.23.0
PATCH 12/14 MIPS: DTS: CI20: add DT node for SW1 as Enter button
In reply to H. Nikolaus SchallerThe SW1 button can be used as a simple one-button keyboard and is connected to PD17.
Note: SW1 has a second meaning to change the boot sequence when pressed while powering on.
--- arch/mips/boot/dts/ingenic/ci20.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/mips/boot/dts/ingenic/ci20.dts +12 -0
@@ -4,6 +4,7 @@ #include "jz4780.dtsi" #include <dt-bindings/clock/ingenic,tcu.h> #include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> / { compatible = "img,ci20", "ingenic,jz4780";
@@ -25,6 +26,17 @@ 0x30000000 0x30000000>; }; + gpio-keys { + compatible = "gpio-keys"; + + sw1 { + label = "ci20:sw1"; + linux,code = <KEY_ENTER>; + gpios = <&gpd 17 GPIO_ACTIVE_HIGH>; + wakeup-source; + }; + }; + leds { compatible = "gpio-leds";
Signature · 1 line
2.23.0
PATCH 13/14 MIPS: CI20: defconfig: configure for CONFIG_KEYBOARD_GPIO=m
In reply to H. Nikolaus SchallerThe SW1 button is hooked up to send input events.
--- arch/mips/configs/ci20_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/configs/ci20_defconfig +1 -0
@@ -89,6 +89,7 @@ CONFIG_I2C_JZ4780=y CONFIG_SPI=y CONFIG_SPI_GPIO=y CONFIG_GPIO_SYSFS=y +CONFIG_KEYBOARD_GPIO=m # CONFIG_HWMON is not set CONFIG_WATCHDOG=y CONFIG_JZ4740_WDT=y
Signature · 1 line
2.23.0
PATCH 14/14 MIPS: DTS: CI20: fix interrupt for pcf8563 RTC
In reply to H. Nikolaus SchallerInterrupts should not be specified by interrupt line but by gpio parent and reference.
--- arch/mips/boot/dts/ingenic/ci20.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/boot/dts/ingenic/ci20.dts +3 -1
@@ -298,7 +298,9 @@ Optional input supply properties: rtc@51 { compatible = "nxp,pcf8563"; reg = <0x51>; - interrupts = <110>; + + interrupt-parent = <&gpf>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; }; };
Signature · 1 line
2.23.0
Re: [Letux-kernel] [PATCH 07/14] MIPS: DTS: CI20: fix PMU definitions for ACT8600
In reply to H. Nikolaus SchallerQuoted 8 lines · On Tue, 11 Feb 2020 22:41:24 +0100 "H. Nikolaus Schaller" <[email protected]>…
There is a ACT8600 on the CI20 board and the bindings of the ACT8865 driver have changed without updating the CI20 device tree. Therefore the PMU can not be probed successfully and is running in power-on reset state.
Fix DT to match the latest act8865-regulator bindings.
Signed-off-by H. Nikolaus Schaller <[email protected]>
hmm, what about a Fixes: tag here? Sounds like a regression.
Regards,
Andreas
Re: [PATCH 03/14] net: davicom: dm9000: allow to pass MAC address through mac_addr module parameter
In reply to H. Nikolaus SchallerQuoted 7 lines · H. Nikolaus Schaller
This is needed to give the MIPS Ingenic CI20 board a stable MAC address which can be optionally provided by vendor U-Boot.
For
get_mac_addr()we use an adapted copy of fromksz884x.cwhich has very similar functionality.Signed-off-by H. Nikolaus Schaller <[email protected]>
Hi Nikolaus
Please split these patches by subsystem. So this one patch needs to go via netdev.
drivers/net/ethernet/davicom/dm9000.c static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev) · line 1414
Quoted 3 lines
drivers/net/ethernet/davicom/dm9000.c +3
-0+static char *mac_addr =":" ; +module_param (mac_addr, charp,0 ); +MODULE_PARM_DESC (mac_addr,"MAC address" );
Module parameters are not liked.
Can it be passed via device tree? The driver already has code to get it out of the device tree.
Andrew
Re: [PATCH 03/14] net: davicom: dm9000: allow to pass MAC address through mac_addr module parameter
Quoted 14 lines · Andrew Lunn
Quoted 7 lines · H. Nikolaus Schaller
This is needed to give the MIPS Ingenic CI20 board a stable MAC address which can be optionally provided by vendor U-Boot.
For
get_mac_addr()we use an adapted copy of fromksz884x.cwhich has very similar functionality.Signed-off-by H. Nikolaus Schaller <[email protected]>Hi Nikolaus
Please split these patches by subsystem. So this one patch needs to go via netdev.
Quoted 8 lines
drivers/net/ethernet/davicom/dm9000.c static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev) · line 1414
Quoted 3 lines
drivers/net/ethernet/davicom/dm9000.c +3
-0+static char *mac_addr =":" ; +module_param (mac_addr, charp,0 ); +MODULE_PARM_DESC (mac_addr,"MAC address" );Module parameters are not liked.
Can it be passed via device tree? The driver already has code to get it out of the device tree.
Yep, typically U-Boot adds an appropriate "local-mac-address" property to the network device's device node, based on the "ethernet0" alias.
However, the real clue here may be "vendor U-Boot", i.e. no support for the above?
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 03/14] net: davicom: dm9000: allow to pass MAC address through mac_addr module parameter
Quoted 24 lines
Am 12.02.2020 um 09:07 schrieb Geert Uytterhoeven <[email protected]>:
Quoted 20 lines · Andrew Lunn
Quoted 7 lines · H. Nikolaus Schaller
This is needed to give the MIPS Ingenic CI20 board a stable MAC address which can be optionally provided by vendor U-Boot.
For
get_mac_addr()we use an adapted copy of fromksz884x.cwhich has very similar functionality.Signed-off-by H. Nikolaus Schaller <[email protected]>Hi Nikolaus
Please split these patches by subsystem. So this one patch needs to go via netdev.
drivers/net/ethernet/davicom/dm9000.c static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev) · line 1414
Quoted 3 lines
drivers/net/ethernet/davicom/dm9000.c +3
-0+static char *mac_addr =":" ; +module_param (mac_addr, charp,0 ); +MODULE_PARM_DESC (mac_addr,"MAC address" );Module parameters are not liked.
Quoted 8 lines
Quoted 2 lines
Can it be passed via device tree? The driver already has code to get it out of the device tree.
Yep, typically U-Boot adds an appropriate "local-mac-address" property to the network device's device node, based on the "ethernet0" alias.
However, the real clue here may be "vendor U-Boot", i.e. no support for the above?
Yes. It is a fallback solution like it is implemented for ksz884x.c to make it work with existing (older) U-Boot installation.
Maybe I should better clarify this in the commit message for v2 (which goes to netdev only).
BR and thanks,
Nikolaus
i2c: jz4780: silence log flood on txabrt
In reply to H. Nikolaus SchallerThe printout for txabrt is way too talkative. Reduce it to the minimum, the rest can be gained by I2C core debugging and datasheet information. Also, make it a debug printout, it won't help the regular user.
---
Sorry, normally I don't do counter patches. Yet, this time I realized that it would be faster to actually do what I envisioned than to describe it in words. I hope you don't feel offended. This driver has way too many dev_err anyhow, so this may be a start.
Obviously, I can't test, does it work for you?
drivers/i2c/busses/i2c-jz4780.c | 36 ++------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-)
drivers/i2c/busses/i2c-jz4780.c +2 -34
@@ -78,25 +78,6 @@#define X1000_I2C_DC_STOP BIT(9) -static const char *const jz4780_i2c_abrt_src[] = { -"ABRT_7B_ADDR_NOACK" , -"ABRT_10ADDR1_NOACK" , -"ABRT_10ADDR2_NOACK" , -"ABRT_XDATA_NOACK" , -"ABRT_GCALL_NOACK" , -"ABRT_GCALL_READ" , -"ABRT_HS_ACKD" , -"SBYTE_ACKDET" , -"ABRT_HS_NORSTRT" , -"SBYTE_NORSTRT" , -"ABRT_10B_RD_NORSTRT" , -"ABRT_MASTER_DIS" , -"ARB_LOST" , -"SLVFLUSH_TXFIFO" , -"SLV_ARBLOST" , -"SLVRD_INTX" , -}; -#define JZ4780_I2C_INTST_IGC BIT(11)#define JZ4780_I2C_INTST_ISTT BIT(10)#define JZ4780_I2C_INTST_ISTP BIT(9)
@@ -576,21 +557,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)static void jz4780_i2c_txabrt (struct jz4780_i2c *i2c,int src) { -int i; - -dev_err (&i2c->adap.dev,"txabrt: 0x%08x\n" , src); -dev_err (&i2c->adap.dev,"device addr=%x\n" , -jz4780_i2c_readw (i2c,JZ4780_I2C_TAR )); -dev_err (&i2c->adap.dev,"send cmd count:%d %d\n" , - i2c->cmd, i2c->cmd_buf[i2c->cmd]); -dev_err (&i2c->adap.dev,"receive data count:%d %d\n" , - i2c->cmd, i2c->data_buf[i2c->cmd]); - -for (i =0 ; i <16 ; i++) { -if (src &BIT (i)) -dev_dbg (&i2c->adap.dev,"I2C TXABRT[%d]=%s\n" , - i, jz4780_i2c_abrt_src[i]); - } +dev_dbg (&i2c->adap.dev,"txabrt: 0x%08x, cmd: %d, send: %d, recv: %d\n" , + src, i2c->cmd, i2c->cmd_buf[i2c->cmd], i2c->data_buf[i2c->cmd]); } static inline int jz4780_i2c_xfer_read(struct jz4780_i2c *i2c,
Signature · 1 line
2.20.1
Re: i2c: jz4780: silence log flood on txabrt
Hi,
Quoted 7 lines
Am 12.02.2020 um 10:46 schrieb Wolfram Sang <[email protected]>:
The printout for txabrt is way too talkative. Reduce it to the minimum, the rest can be gained by I2C core debugging and datasheet information. Also, make it a debug printout, it won't help the regular user.
Quoted 7 lines
Reported-by H. Nikolaus Schaller <[email protected]>Signed-off-by Wolfram Sang <[email protected]>---
Sorry, normally I don't do counter patches. Yet, this time I realized that it would be faster to actually do what I envisioned than to describe it in words. I hope you don't feel offended.
No problem. I had thought a little about that myself, but did not dare to solve more than my problem...
Quoted 4 lines
This driver has
way too manydev_erranyhow, so this may be a start.Obviously, I can't test, does it work for you?
Yes,it works.
Do you want to push your patch yourself, or should I add it to my patch series and resubmit in a v2?
BR and thanks,
Nikolaus
Quoted 61 lines
drivers/i2c/busses/i2c-jz4780.c| 36 ++-------------------------------1 file changed, 2 insertions(+), 34 deletions(-)drivers/i2c/busses/i2c-jz4780.c +2
-34@@ -78,25 +78,6 @@#define X1000_I2C_DC_STOP BIT(9) -static const char *const jz4780_i2c_abrt_src[] = { -"ABRT_7B_ADDR_NOACK" , -"ABRT_10ADDR1_NOACK" , -"ABRT_10ADDR2_NOACK" , -"ABRT_XDATA_NOACK" , -"ABRT_GCALL_NOACK" , -"ABRT_GCALL_READ" , -"ABRT_HS_ACKD" , -"SBYTE_ACKDET" , -"ABRT_HS_NORSTRT" , -"SBYTE_NORSTRT" , -"ABRT_10B_RD_NORSTRT" , -"ABRT_MASTER_DIS" , -"ARB_LOST" , -"SLVFLUSH_TXFIFO" , -"SLV_ARBLOST" , -"SLVRD_INTX" , -}; -#define JZ4780_I2C_INTST_IGC BIT(11)#define JZ4780_I2C_INTST_ISTT BIT(10)#define JZ4780_I2C_INTST_ISTP BIT(9)@@ -576,21 +557,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)static void jz4780_i2c_txabrt (struct jz4780_i2c *i2c,int src) { -int i; - -dev_err (&i2c->adap.dev,"txabrt: 0x%08x\n" , src); -dev_err (&i2c->adap.dev,"device addr=%x\n" , -jz4780_i2c_readw (i2c,JZ4780_I2C_TAR )); -dev_err (&i2c->adap.dev,"send cmd count:%d %d\n" , - i2c->cmd, i2c->cmd_buf[i2c->cmd]); -dev_err (&i2c->adap.dev,"receive data count:%d %d\n" , - i2c->cmd, i2c->data_buf[i2c->cmd]); - -for (i =0 ; i <16 ; i++) { -if (src &BIT (i)) -dev_dbg (&i2c->adap.dev,"I2C TXABRT[%d]=%s\n" , - i, jz4780_i2c_abrt_src[i]); - } +dev_dbg (&i2c->adap.dev,"txabrt: 0x%08x, cmd: %d, send: %d, recv: %d\n" , + src, i2c->cmd, i2c->cmd_buf[i2c->cmd], i2c->data_buf[i2c->cmd]); } static inline int jz4780_i2c_xfer_read(struct jz4780_i2c *i2c,Signature · 1 line
2.20.1
Re: i2c: jz4780: silence log flood on txabrt
Hi,
Quoted 6 lines
Quoted 3 lines
Sorry, normally I don't do counter patches. Yet, this time I realized that it would be faster to actually do what I envisioned than to describe it in words. I hope you don't feel offended.
No problem. I had thought a little about that myself, but did not dare to solve more than my problem...
Glad you like it. Well, it still kinda solves your problem only, because there are still too many dev_err in there, but I think this is good enough for now.
Quoted 3 lines
Quoted 1 line
Obviously, I can't test, does it work for you?
Yes,it works.
Good!
Quoted 2 lines
Do you want to push your patch yourself, or should I add it to my patch series and resubmit in a v2?
I'll apply the patch to my tree directly as a bugfix for 5.6. You can drop the I2C list from V2 then.
Thanks and kind regards,
Wolfram
Re: i2c: jz4780: silence log flood on txabrt
Quoted 20 lines
Am 12.02.2020 um 15:53 schrieb Wolfram Sang <[email protected]>:
Hi,
Quoted 6 lines
Quoted 3 lines
Sorry, normally I don't do counter patches. Yet, this time I realized that it would be faster to actually do what I envisioned than to describe it in words. I hope you don't feel offended.
No problem. I had thought a little about that myself, but did not dare to solve more than my problem...
Glad you like it. Well, it still kinda solves your problem only, because there are still too many
dev_errin there, but I think this is good enough for now.Quoted 3 lines
Quoted 1 line
Obviously, I can't test, does it work for you?
Yes,it works.
Quoted 7 lines
Good!
Quoted 2 lines
Do you want to push your patch yourself, or should I add it to my patch series and resubmit in a v2?
I'll apply the patch to my tree directly as a bugfix for 5.6. You can drop the I2C list from V2 then.
Ok, fine.
BR and thanks,
Nikolaus
Wolfram Sang
AppliedRe: i2c: jz4780: silence log flood on txabrt
In reply to Wolfram SangQuoted 7 lines · Wolfram Sang
The printout for txabrt is way too talkative. Reduce it to the minimum, the rest can be gained by I2C core debugging and datasheet information. Also, make it a debug printout, it won't help the regular user.
Reported-by H. Nikolaus Schaller <[email protected]>Signed-off-by Wolfram Sang <[email protected]>
Applied to for-current, thanks!
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel