i2c: brcmstb: add support for BMIPS_GENERIC
Subsystems (6)
cover i2c: brcmstb: add support for BMIPS_GENERIC
Hi all,
This patch series adds support for BMIPS_GENERIC, and fixes running conditions.
Thanks.
Jaedon Shin (9):
i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
i2c: brcmstb: fix typo in i2c-brcmstb
i2c: brcmstb: add missing parenthesis
i2c: brcmstb: enable ACK condition
i2c: brcmstb: fix start and stop conditions
MIPS: BMIPS: brcmstb: add I2C node for bcm7346
MIPS: BMIPS: brcmstb: add I2C node for bcm7358
MIPS: BMIPS: brcmstb: add I2C node for bcm7360
MIPS: BMIPS: brcmstb: add I2C node for bcm7362
arch/mips/boot/dts/brcm/bcm7346.dtsi | 72 ++++++++++++++++++++++++++++++- arch/mips/boot/dts/brcm/bcm7358.dtsi | 62 +++++++++++++++++++++++++- arch/mips/boot/dts/brcm/bcm7360.dtsi | 62 +++++++++++++++++++++++++- arch/mips/boot/dts/brcm/bcm7362.dtsi | 52 +++++++++++++++++++++- arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++ arch/mips/boot/dts/brcm/bcm97358svmb.dts | 16 +++++++ arch/mips/boot/dts/brcm/bcm97360svmb.dts | 16 +++++++ arch/mips/boot/dts/brcm/bcm97362svmb.dts | 12 ++++++ drivers/i2c/busses/Kconfig | 2 +- drivers/i2c/busses/i2c-brcmstb.c | 11 +++-- 10 files changed, 310 insertions(+), 15 deletions(-)
Signature · 6 lines
2.6.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/9 i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
The BCM7xxx ARM and MIPS platforms share a similar hardware block for I2C.
--- drivers/i2c/busses/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
@@ -394,7 +394,7 @@ config I2C_BCM_KONA config I2C_BRCMSTB tristate "BRCM Settop I2C controller" - depends on ARCH_BRCMSTB || COMPILE_TEST + depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST default y help If you say yes to this option, support will be included for the
Signature · 1 line
2.6.1
PATCH 2/9 i2c: brcmstb: fix typo in i2c-brcmstb
In reply to a message not in the archiveFixes the "definitions" where it is spelled "defintions".
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-brcmstb.c +1 -1
@@ -41,7 +41,7 @@#define BSC_CTL_REG_INT_EN_SHIFT 6#define BSC_CTL_REG_DIV_CLK_MASK 0x00000080 -/* BSC_IIC_ENABLE r/w enable and interrupt field defintions */ +/* BSC_IIC_ENABLE r/w enable and interrupt field definitions */ #define BSC_IIC_EN_RESTART_MASK 0x00000040#define BSC_IIC_EN_NOSTART_MASK 0x00000020#define BSC_IIC_EN_NOSTOP_MASK 0x00000010
Signature · 6 lines
2.6.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/9 i2c: brcmstb: add missing parenthesis
In reply to Jaedon ShinAdd the necessary parenthesis for NOACK condition.
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-brcmstb.c +1 -1
@@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev, }if ((CMD_RD ||CMD_WR ) && -bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK ) { + (bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK )) { rc = -EREMOTEIO ;dev_dbg (dev->device,"controller received NOACK intr for %s\n" , cmd_string[cmd]);
Signature · 1 line
2.6.1
PATCH 4/9 i2c: brcmstb: enable ACK condition
In reply to Jaedon ShinRemoves the condition of a message with under 32 bytes in length. The messages that do not require an ACK are I2C_M_IGNORE_NAK flag.
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-brcmstb.c +1 -1
@@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,int no_ack = pmsg->flags &I2C_M_IGNORE_NAK ;/* see if the transaction needs to check NACK conditions */ -if (no_ack || len <=N_DATA_BYTES ) { +if (no_ack) { cmd = (pmsg->flags &I2C_M_RD ) ?CMD_RD_NOACK :CMD_WR_NOACK ; pi2creg->ctlhi_reg |=BSC_CTLHI_REG_IGNORE_ACK_MASK ;
Signature · 1 line
2.6.1
PATCH 5/9 i2c: brcmstb: fix start and stop conditions
In reply to a message not in the archiveFixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and stop is already in brcmstb_set_i2c_start_stop(). Therefore, the caller does not need a mask value.
--- drivers/i2c/busses/i2c-brcmstb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-brcmstb.c +2 -3
@@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, pmsg->buf ? pmsg->buf[0] : '0', pmsg->len);if (i < (num -1 ) && (msgs[i +1 ].flags &I2C_M_NOSTART )) -brcmstb_set_i2c_start_stop (dev, ~(COND_START_STOP )); +brcmstb_set_i2c_start_stop (dev,0 );else brcmstb_set_i2c_start_stop (dev,COND_RESTART |COND_NOSTOP );
@@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, bytes_to_xfer =min (len,N_DATA_BYTES );if (len <=N_DATA_BYTES && i == (num -1 )) -brcmstb_set_i2c_start_stop (dev, - ~(COND_START_STOP )); +brcmstb_set_i2c_start_stop (dev,0 ); rc =brcmstb_i2c_xfer_bsc_data (dev, tmp_buf, bytes_to_xfer, pmsg);
Signature · 6 lines
2.6.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/9 MIPS: BMIPS: brcmstb: add I2C node for bcm7346
In reply to a message not in the archiveAdd I2C device nodes to BMIPS based BCM7346 platform.
--- arch/mips/boot/dts/brcm/bcm7346.dtsi | 72 ++++++++++++++++++++++++++++++- arch/mips/boot/dts/brcm/bcm97346dbsmb.dts | 20 +++++++++ 2 files changed, 90 insertions(+), 2 deletions(-)
arch/mips/boot/dts/brcm/bcm7346.dtsi +70 -2
@@ -87,14 +87,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406780 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0xf000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <59>; + interrupts = <59>, <57>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <60>, <58>, <62>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {
@@ -144,6 +162,56 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscc: i2c@406300 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406300 0x58>; + interrupts = <26>; + interrupt-names = "upg_bscc"; + status = "disabled"; + }; + + bscd: i2c@406380 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406380 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + + bsce: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bsce"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;
arch/mips/boot/dts/brcm/bcm97346dbsmb.dts +20 -0
@@ -29,6 +29,26 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscc { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + +&bsce { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 6 lines
2.6.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/9 MIPS: BMIPS: brcmstb: add I2C node for bcm7358
In reply to Jaedon ShinAdd I2C device nodes to BMIPS based BCM7358 platform.
--- arch/mips/boot/dts/brcm/bcm7358.dtsi | 62 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97358svmb.dts | 16 +++++++++ 2 files changed, 76 insertions(+), 2 deletions(-)
arch/mips/boot/dts/brcm/bcm7358.dtsi +60 -2
@@ -81,14 +81,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {
@@ -138,6 +156,46 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscc: i2c@406300 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406300 0x58>; + interrupts = <26>; + interrupt-names = "upg_bscc"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;
arch/mips/boot/dts/brcm/bcm97358svmb.dts +16 -0
@@ -29,6 +29,22 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscc { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
2.6.1
PATCH 8/9 MIPS: BMIPS: brcmstb: add I2C node for bcm7360
In reply to Jaedon ShinAdd I2C device nodes to BMIPS based BCM7360 platform.
--- arch/mips/boot/dts/brcm/bcm7360.dtsi | 62 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97360svmb.dts | 16 +++++++++ 2 files changed, 76 insertions(+), 2 deletions(-)
arch/mips/boot/dts/brcm/bcm7360.dtsi +60 -2
@@ -81,14 +81,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {
@@ -138,6 +156,46 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscc: i2c@406300 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406300 0x58>; + interrupts = <26>; + interrupt-names = "upg_bscc"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;
arch/mips/boot/dts/brcm/bcm97360svmb.dts +16 -0
@@ -29,6 +29,22 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscc { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
2.6.1
PATCH 9/9 MIPS: BMIPS: brcmstb: add I2C node for bcm7362
In reply to Jaedon ShinAdd I2C device nodes to BMIPS based BCM7362 platform.
--- arch/mips/boot/dts/brcm/bcm7362.dtsi | 52 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97362svmb.dts | 12 ++++++++ 2 files changed, 62 insertions(+), 2 deletions(-)
arch/mips/boot/dts/brcm/bcm7362.dtsi +50 -2
@@ -87,14 +87,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {
@@ -144,6 +162,36 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;
arch/mips/boot/dts/brcm/bcm97362svmb.dts +12 -0
@@ -29,6 +29,18 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
2.6.1
Re: [PATCH 1/9] i2c: brcmstb: make the driver buildable on BMIPS_GENERIC
In reply to Jaedon ShinQuoted 4 lines · Jaedon Shin
The BCM7xxx ARM and MIPS platforms share a similar hardware block for I2C.
Signed-off-by Jaedon Shin <[email protected]>
Quoted 18 lines
--- drivers/i2c/busses/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/Kconfig +1
-1@@ -394,7 +394,7 @@ config I2C_BCM_KONA config I2C_BRCMSTB tristate "BRCM Settop I2C controller" - depends on ARCH_BRCMSTB || COMPILE_TEST + depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST default y help If you say yes to this option, support will be included for the
Signature · 1 line
Florian
Re: [PATCH 2/9] i2c: brcmstb: fix typo in i2c-brcmstb
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Fixes the "definitions" where it is spelled "defintions".
Signed-off-by Jaedon Shin <[email protected]>
Quoted 18 lines
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +1
-1@@ -41,7 +41,7 @@#define BSC_CTL_REG_INT_EN_SHIFT 6#define BSC_CTL_REG_DIV_CLK_MASK 0x00000080 -/* BSC_IIC_ENABLE r/w enable and interrupt field defintions */ +/* BSC_IIC_ENABLE r/w enable and interrupt field definitions */ #define BSC_IIC_EN_RESTART_MASK 0x00000040#define BSC_IIC_EN_NOSTART_MASK 0x00000020#define BSC_IIC_EN_NOSTOP_MASK 0x00000010
Signature · 1 line
Florian
Re: [PATCH 3/9] i2c: brcmstb: add missing parenthesis
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Add the necessary parenthesis for NOACK condition.
Signed-off-by Jaedon Shin <[email protected]>
Quoted 18 lines
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +1
-1@@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev, }if ((CMD_RD ||CMD_WR ) && -bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK ) { + (bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK )) { rc = -EREMOTEIO ;dev_dbg (dev->device,"controller received NOACK intr for %s\n" , cmd_string[cmd]);
Signature · 1 line
Florian
Florian Fainelli
Acked-byRe: [PATCH 6/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7346
In reply to a message not in the archiveQuoted 3 lines · Jaedon Shin
Add I2C device nodes to BMIPS based BCM7346 platform.
Signed-off-by Jaedon Shin <[email protected]>
Signature · 5 lines
Florian -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7358
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Add I2C device nodes to BMIPS based BCM7358 platform.
Signed-off-by Jaedon Shin <[email protected]>
Quoted 119 lines
--- arch/mips/boot/dts/brcm/bcm7358.dtsi | 62 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97358svmb.dts | 16 +++++++++ 2 files changed, 76 insertions(+), 2 deletions(-)arch/mips/boot/dts/brcm/bcm7358.dtsi +60
-2@@ -81,14 +81,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {@@ -138,6 +156,46 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscc: i2c@406300 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406300 0x58>; + interrupts = <26>; + interrupt-names = "upg_bscc"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;arch/mips/boot/dts/brcm/bcm97358svmb.dts +16
-0@@ -29,6 +29,22 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscc { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
Florian
Re: [PATCH 8/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7360
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Add I2C device nodes to BMIPS based BCM7360 platform.
Signed-off-by Jaedon Shin <[email protected]>
Quoted 119 lines
--- arch/mips/boot/dts/brcm/bcm7360.dtsi | 62 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97360svmb.dts | 16 +++++++++ 2 files changed, 76 insertions(+), 2 deletions(-)arch/mips/boot/dts/brcm/bcm7360.dtsi +60
-2@@ -81,14 +81,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {@@ -138,6 +156,46 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscc: i2c@406300 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406300 0x58>; + interrupts = <26>; + interrupt-names = "upg_bscc"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;arch/mips/boot/dts/brcm/bcm97360svmb.dts +16
-0@@ -29,6 +29,22 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscc { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
Florian
Re: [PATCH 9/9] MIPS: BMIPS: brcmstb: add I2C node for bcm7362
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Add I2C device nodes to BMIPS based BCM7362 platform.
Signed-off-by Jaedon Shin <[email protected]>
Quoted 105 lines
--- arch/mips/boot/dts/brcm/bcm7362.dtsi | 52 ++++++++++++++++++++++++++++++-- arch/mips/boot/dts/brcm/bcm97362svmb.dts | 12 ++++++++ 2 files changed, 62 insertions(+), 2 deletions(-)arch/mips/boot/dts/brcm/bcm7362.dtsi +50
-2@@ -87,14 +87,32 @@ compatible = "brcm,bcm7120-l2-intc"; reg = <0x406600 0x8>; - brcm,int-map-mask = <0x44>; + brcm,int-map-mask = <0x44>, <0x7000000>; brcm,int-fwd-mask = <0x70000>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&periph_intc>; - interrupts = <56>; + interrupts = <56>, <54>; + interrupt-names = "upg_main", "upg_bsc"; + }; + + upg_aon_irq0_intc: upg_aon_irq0_intc@408b80 { + compatible = "brcm,bcm7120-l2-intc"; + reg = <0x408b80 0x8>; + + brcm,int-map-mask = <0x40>, <0x8000000>, <0x100000>; + brcm,int-fwd-mask = <0>; + brcm,irq-can-wake; + + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&periph_intc>; + interrupts = <57>, <55>, <59>; + interrupt-names = "upg_main_aon", "upg_bsc_aon", + "upg_spi"; }; sun_top_ctrl: syscon@404000 {@@ -144,6 +162,36 @@ status = "disabled"; }; + bsca: i2c@406200 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406200 0x58>; + interrupts = <24>; + interrupt-names = "upg_bsca"; + status = "disabled"; + }; + + bscb: i2c@406280 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_irq0_intc>; + reg = <0x406280 0x58>; + interrupts = <25>; + interrupt-names = "upg_bscb"; + status = "disabled"; + }; + + bscd: i2c@408980 { + clock-frequency = <390000>; + compatible = "brcm,brcmstb-i2c"; + interrupt-parent = <&upg_aon_irq0_intc>; + reg = <0x408980 0x58>; + interrupts = <27>; + interrupt-names = "upg_bscd"; + status = "disabled"; + }; + enet0: ethernet@430000 { phy-mode = "internal"; phy-handle = <&phy1>;arch/mips/boot/dts/brcm/bcm97362svmb.dts +12
-0@@ -29,6 +29,18 @@ status = "okay"; }; +&bsca { + status = "okay"; +}; + +&bscb { + status = "okay"; +}; + +&bscd { + status = "okay"; +}; + &enet0 { status = "okay"; };
Signature · 1 line
Florian
Re: [PATCH 3/9] i2c: brcmstb: add missing parenthesis
In reply to Florian FainelliQuoted 6 lines · Florian Fainelli
Quoted 3 lines · Jaedon Shin
Add the necessary parenthesis for NOACK condition.
Signed-off-by Jaedon Shin <[email protected]>Acked-by Florian Fainelli <[email protected]>
I wouldn't call them necessary?
Quoted 23 lines
Quoted 19 lines
--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +1
-1@@ -305,7 +305,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev, }if ((CMD_RD ||CMD_WR ) && -bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK ) { + (bsc_readl (dev, iic_enable) &BSC_IIC_EN_NOACK_MASK )) { rc = -EREMOTEIO ;dev_dbg (dev->device,"controller received NOACK intr for %s\n" , cmd_string[cmd]);Signature · 1 line
Florian
Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
In reply to Jaedon ShinQuoted 2 lines · Jaedon Shin
Removes the condition of a message with under 32 bytes in length. The messages that do not require an ACK are
I2C_M_IGNORE_NAKflag.
Makes me wonder why it worked before? Kamal?
Quoted 22 lines
Signed-off-by Jaedon Shin <[email protected]>--- drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +1
-1@@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,int no_ack = pmsg->flags &I2C_M_IGNORE_NAK ;/* see if the transaction needs to check NACK conditions */ -if (no_ack || len <=N_DATA_BYTES ) { +if (no_ack) { cmd = (pmsg->flags &I2C_M_RD ) ?CMD_RD_NOACK :CMD_WR_NOACK ; pi2creg->ctlhi_reg |=BSC_CTLHI_REG_IGNORE_ACK_MASK ;Signature · 1 line
2.6.1
Re: [PATCH 5/9] i2c: brcmstb: fix start and stop conditions
In reply to Jaedon ShinQuoted 3 lines · Jaedon Shin
Fixes conditions for RESTART, NOSTART and NOSTOP. The masks of start and stop is already in
brcmstb_set_i2c_start_stop(). Therefore, the caller does not need a mask value.
Hmm, and what if that changes for some reason in the future (driver refactoring)? I'd rather leave it as it is; it is a micro-optimization after all.
Quoted 32 lines
Signed-off-by Jaedon Shin <[email protected]>--- drivers/i2c/busses/i2c-brcmstb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/i2c/busses/i2c-brcmstb.c +2
-3@@ -464,7 +464,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, pmsg->buf ? pmsg->buf[0] : '0', pmsg->len);if (i < (num -1 ) && (msgs[i +1 ].flags &I2C_M_NOSTART )) -brcmstb_set_i2c_start_stop (dev, ~(COND_START_STOP )); +brcmstb_set_i2c_start_stop (dev,0 );else brcmstb_set_i2c_start_stop (dev,COND_RESTART |COND_NOSTOP );@@ -485,8 +485,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, bytes_to_xfer =min (len,N_DATA_BYTES );if (len <=N_DATA_BYTES && i == (num -1 )) -brcmstb_set_i2c_start_stop (dev, - ~(COND_START_STOP )); +brcmstb_set_i2c_start_stop (dev,0 ); rc =brcmstb_i2c_xfer_bsc_data (dev, tmp_buf, bytes_to_xfer, pmsg);Signature · 1 line
2.6.1
Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
In reply to Wolfram SangHi Kamal,
Quoted 20 lines · Wolfram Sang
Quoted 2 lines · Jaedon Shin
Removes the condition of a message with under 32 bytes in length. The messages that do not require an ACK are
I2C_M_IGNORE_NAKflag.Makes me wonder why it worked before? Kamal?
Quoted 13 lines
Signed-off-by Jaedon Shin <[email protected]>---
drivers/i2c/busses/i2c-brcmstb.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +0
-0@@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,int no_ack = pmsg->flags &I2C_M_IGNORE_NAK ;
Quoted 2 lines
drivers/i2c/busses/i2c-brcmstb.c static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev, · line 333
Quoted 2 lines
drivers/i2c/busses/i2c-brcmstb.c +0
-1/* see if the transaction needs to check NACK conditions */ -if (no_ack || len <=N_DATA_BYTES ) {
Could you please explain why have NOACK with smaller transfer size? I don't find any reason about NOACK when smaller size, and the driver always operates NOACK by "len <= xfersz".
brcmstb_i2c_xfer(...)
{
int xfersz = brcmstb_i2c_get_xfersz(dev);
...
bytes_to_xfer = min(len, xfersz);
...
brcmstb_i2c_xfer_bsc_data(..., bytes_to_xfer, ...);
...I have a plan for v2 that has for BMIPS_GENERIC and this patch with the latest driver.
Thanks!
--
Jaedon
Quoted 7 lines
Quoted 7 lines
drivers/i2c/busses/i2c-brcmstb.c +1
-0+if (no_ack) { cmd = (pmsg->flags &I2C_M_RD ) ?CMD_RD_NOACK :CMD_WR_NOACK ; pi2creg->ctlhi_reg |=BSC_CTLHI_REG_IGNORE_ACK_MASK ;Signature · 1 line
2.6.1
Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
Jaedon,
Your change looks good to me. I agree that we do not need the size check.
Kamal
Quoted 52 lines · Jaedon Shin
Hi Kamal,
Quoted 20 lines · Wolfram Sang
Quoted 2 lines · Jaedon Shin
Removes the condition of a message with under 32 bytes in length. The messages that do not require an ACK are
I2C_M_IGNORE_NAKflag.Makes me wonder why it worked before? Kamal?
Quoted 13 lines
Signed-off-by Jaedon Shin <[email protected]>---
drivers/i2c/busses/i2c-brcmstb.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-brcmstb.c +0
-0@@ -330,7 +330,7 @@ static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,int no_ack = pmsg->flags &I2C_M_IGNORE_NAK ;Quoted 2 lines
drivers/i2c/busses/i2c-brcmstb.c static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev, · line 333
Quoted 2 lines
drivers/i2c/busses/i2c-brcmstb.c +0
-1/* see if the transaction needs to check NACK conditions */ -if (no_ack || len <=N_DATA_BYTES ) {Could you please explain why have NOACK with smaller transfer size? I don't find any reason about NOACK when smaller size, and the driver always operates NOACK by "len <= xfersz".
brcmstb_i2c_xfer(...){ int xfersz = brcmstb_i2c_get_xfersz(dev); ... bytes_to_xfer = min(len, xfersz); ... brcmstb_i2c_xfer_bsc_data(..., bytes_to_xfer, ...); ...I have a plan for v2 that has for
BMIPS_GENERICand this patch with the latest driver.Thanks!
--
JaedonQuoted 7 lines
Quoted 7 lines
drivers/i2c/busses/i2c-brcmstb.c +1
-1+if (no_ack) { cmd = (pmsg->flags &I2C_M_RD ) ?CMD_RD_NOACK :CMD_WR_NOACK ; pi2creg->ctlhi_reg |=BSC_CTLHI_REG_IGNORE_ACK_MASK ; --2.6.1
Re: [PATCH 4/9] i2c: brcmstb: enable ACK condition
Quoted 2 lines
Your change looks good to me. I agree that we do not need the size check.
I read this as an ack, thanks. But how did it work before?