Re: [PATCH v4 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-30 Thread Sergio Paracuellos
Hi Dan, On Mon, Nov 30, 2020 at 1:15 PM Dan Carpenter wrote: > > On Thu, Nov 19, 2020 at 07:05:22AM +0100, Sergio Paracuellos wrote: > > > > +static inline void phy_write(struct mt7621_pci_phy *phy, u32 val, u32 > > > > reg) > > > > +{ > > > > + regmap_write(phy->regmap, reg, val); > > > > >

Re: [PATCH v6 0/4] MT7621 PCIe PHY

2020-11-30 Thread Sergio Paracuellos
Hi Vinod, On Mon, Nov 30, 2020 at 11:48 AM Vinod Koul wrote: > > On 21-11-20, 16:50, Sergio Paracuellos wrote: > > This series adds support for the PCIe PHY found in the Mediatek > > MT7621 SoC. > > > > There is also a 'mt7621-pci' driver which is the controller part > > which is still in staging

Re: [PATCH v4 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-30 Thread Dan Carpenter
On Thu, Nov 19, 2020 at 07:05:22AM +0100, Sergio Paracuellos wrote: > > > +static inline void phy_write(struct mt7621_pci_phy *phy, u32 val, u32 > > > reg) > > > +{ > > > + regmap_write(phy->regmap, reg, val); > > > > Why not use regmap_ calls directly and avoid the dummy wrappers..? > > This

Re: [PATCH v6 0/4] MT7621 PCIe PHY

2020-11-30 Thread Vinod Koul
On 21-11-20, 16:50, Sergio Paracuellos wrote: > This series adds support for the PCIe PHY found in the Mediatek > MT7621 SoC. > > There is also a 'mt7621-pci' driver which is the controller part > which is still in staging and is a client of this phy. > > Both drivers have been tested together in

[PATCH v6 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-21 Thread Sergio Paracuellos
MASK(7, 6) + +#define MAX_PHYS 2 + +/** + * struct mt7621_pci_phy - Mt7621 Pcie PHY core + * @dev: pointer to device + * @regmap: kernel regmap pointer + * @phy: pointer to the kernel PHY device + * @port_base: base register + * @has_dual_port: if the phy has dual ports. + * @bypass_pipe_rst: mark if

[PATCH v6 0/4] MT7621 PCIe PHY

2020-11-21 Thread Sergio Paracuellos
get_resource' instead of 'of_address_to_resource'. Changes in v2: - Reorder patches to get bindings first in the series. - Don't use child nodes in the device tree. Use #phy-cells=1 instead. - Update driver code with new 'xlate' function for the new device tree. -

[PATCH v6 1/4] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2020-11-21 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos Reviewed-by: Rob Herring --- .../bindings/phy/mediatek,mt7621-pci-phy.yaml | 36 +++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621

Re: [PATCH v5 0/4] MT7621 PCIe PHY

2020-11-21 Thread Vinod Koul
On 20-11-20, 17:20, Sergio Paracuellos wrote: > Hi Vinod, > > On Thu, Nov 19, 2020 at 4:43 PM Sergio Paracuellos > wrote: > > > > This series adds support for the PCIe PHY found in the Mediatek > > MT7621 SoC. > > > > There is also a 'mt7621-pci' driver which is the controller part > > which is s

Re: [PATCH v5 0/4] MT7621 PCIe PHY

2020-11-20 Thread Sergio Paracuellos
stead. > - Update driver code with new 'xlate' function for the new device tree. > - Minor changes in driver's macros changing some spaces to tabs. > > Thanks in advance for your time. > > Best regards, > Sergio Paracuellos > > [0]: > http://driverdev

[PATCH v5 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-19 Thread Sergio Paracuellos
0x7 + +#define MAX_PHYS 2 + +/** + * struct mt7621_pci_phy - Mt7621 Pcie PHY core + * @dev: pointer to device + * @regmap: kernel regmap pointer + * @phy: pointer to the kernel PHY device + * @port_base: base register + * @has_dual_port: if the phy has dual ports. + * @bypass_pipe_rst: mark if &#

[PATCH v5 1/4] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2020-11-19 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos Reviewed-by: Rob Herring --- .../bindings/phy/mediatek,mt7621-pci-phy.yaml | 36 +++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621

[PATCH v5 0/4] MT7621 PCIe PHY

2020-11-19 Thread Sergio Paracuellos
ad. - Update driver code with new 'xlate' function for the new device tree. - Minor changes in driver's macros changing some spaces to tabs. Thanks in advance for your time. Best regards, Sergio Paracuellos [0]: http://driverdev.linuxdriverproject.org/pipermail/driverdev-dev

Re: [PATCH v4 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-18 Thread Sergio Paracuellos
Hi Vinod, Thanks for the review. On Thu, Nov 19, 2020 at 6:31 AM Vinod Koul wrote: > > On 31-10-20, 13:22, Sergio Paracuellos wrote: > > > +#define RG_PE1_PIPE_REG 0x02c > > +#define RG_PE1_PIPE_RST BIT(12) > > +#define RG_PE1_PIPE_CMD_FR

Re: [PATCH v4 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-11-18 Thread Vinod Koul
On 31-10-20, 13:22, Sergio Paracuellos wrote: > +#define RG_PE1_PIPE_REG 0x02c > +#define RG_PE1_PIPE_RST BIT(12) > +#define RG_PE1_PIPE_CMD_FRC BIT(4) > + > +#define RG_P0_TO_P1_WIDTH0x100 > +#define RG

Re: [PATCH v4 0/4] MT7621 PCIe PHY

2020-11-10 Thread Sergio Paracuellos
; > Changes in v2: > - Reorder patches to get bindings first in the series. > - Don't use child nodes in the device tree. Use #phy-cells=1 instead. > - Update driver code with new 'xlate' function for the new device tree. > - Minor changes in driver'

Re: [PATCH v4 1/4] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2020-11-04 Thread Rob Herring
On Sat, 31 Oct 2020 13:22:43 +0100, Sergio Paracuellos wrote: > Add bindings to describe Mediatek MT7621 PCIe PHY. > > Signed-off-by: Sergio Paracuellos > --- > .../bindings/phy/mediatek,mt7621-pci-phy.yaml | 36 +++ > 1 file changed, 36 insertions(+) >

[PATCH v4 2/4] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2020-10-31 Thread Sergio Paracuellos
GENMASK(7, 6) +#define RG_PE1_MSTCKDIV_VAL(x) ((0x3 & (x)) << 6) + +#define RG_PE1_FRC_MSTCKDIVBIT(5) + +#define XTAL_MODE_SEL_SHIFT6 +#define XTAL_MODE_SEL_MASK 0x7 + +#define MAX_PHYS 2 + +/** + * st

[PATCH v4 0/4] MT7621 PCIe PHY

2020-10-31 Thread Sergio Paracuellos
=1 instead. - Update driver code with new 'xlate' function for the new device tree. - Minor changes in driver's macros changing some spaces to tabs. Thanks in advance for your time. Best regards, Sergio Paracuellos Sergio Paracuellos (4): dt-bindings: phy: Add binding

[PATCH v4 1/4] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2020-10-31 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos --- .../bindings/phy/mediatek,mt7621-pci-phy.yaml | 36 +++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml diff --git a

Re: [PATCH v3 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-05-10 Thread Sergio Paracuellos
_PE1_H_LCDDS_SSC_DELTA1_VAL(x) ((0xff & (x)) << 16) > + > +#define RG_PE1_LCDDS_CLK_PH_INV_REG0x4a0 > +#define RG_PE1_LCDDS_CLK_PH_INVBIT(5) > + > +#define RG_PE1_H_PLL_BR_REG0x4ac > +#define RG_PE1_H_PLL_BR

[PATCH v3 0/2] MT7621 PCIe PHY

2019-04-25 Thread Sergio Paracuellos
ng some spaces to tabs. Thanks in advance for your time. Best regards, Sergio Paracuellos Sergio Paracuellos (2): dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY phy: ralink: Add PHY driver for MT7621 PCIe PHY .../bindings/phy/mediatek,mt7621-pci-phy.txt | 28 ++ drivers/phy

[PATCH v3 1/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-04-25 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Reviewed-by: Rob Herring Signed-off-by: Sergio Paracuellos --- .../bindings/phy/mediatek,mt7621-pci-phy.txt | 28 +++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621

[PATCH v3 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-04-25 Thread Sergio Paracuellos
0x414 +#define RG_PE1_MSTCKDIVGENMASK(7, 6) +#define RG_PE1_MSTCKDIV_VAL(x) ((0x3 & (x)) << 6) + +#define RG_PE1_FRC_MSTCKDIVBIT(5) + +#define MAX_PHYS 2 + +/** + * struct mt7621_pci_phy_instance - Mt7621 Pci

Re: [PATCH v2 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-04-17 Thread Sergio Paracuellos
GENMASK(11, 0) > > +#define RG_PE1_H_LCDDS_SSC_DELTA_VAL(x) ((0xfff & (x)) << 0) > > +#define RG_PE1_H_LCDDS_SSC_DELTA1GENMASK(27, 16) > > +#define RG_PE1_H_LCDDS_SSC_DELTA1_VAL(x) ((0xff & (x)) << 16) > > + > >

Re: [PATCH v2 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-04-16 Thread Kishon Vijay Abraham I
) > +#define RG_PE1_H_LCDDS_SSC_DELTA1_VAL(x) ((0xff & (x)) << 16) > + > +#define RG_PE1_LCDDS_CLK_PH_INV_REG 0x4a0 > +#define RG_PE1_LCDDS_CLK_PH_INV BIT(5) > + > +#define RG_PE1_H_PLL_BR_REG 0x4ac > +#define RG_P

Re: [PATCH v2 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-04-12 Thread Sergio Paracuellos
(x)) << 16) > + > +#define RG_PE1_LCDDS_CLK_PH_INV_REG0x4a0 > +#define RG_PE1_LCDDS_CLK_PH_INVBIT(5) > + > +#define RG_PE1_H_PLL_BR_REG0x4ac > +#define RG_PE1_H_PLL_BRGENMASK(18, 16) >

Re: [PATCH v2 1/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-04-05 Thread Rob Herring
On Sat, 30 Mar 2019 06:50:37 +0100, Sergio Paracuellos wrote: > Add bindings to describe Mediatek MT7621 PCIe PHY. > > Signed-off-by: Sergio Paracuellos > --- > .../bindings/phy/mediatek,mt7621-pci-phy.txt | 28 +++ > 1 file changed, 28 insertions(+) >

[PATCH v2 0/2] MT7621 PCIe PHY

2019-03-29 Thread Sergio Paracuellos
n for the new device tree. - Minor changes in driver's macros changing some spaces to tabs. Thanks in advance for your time. Best regards, Sergio Paracuellos Sergio Paracuellos (2): dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY phy: ralink: Add PHY driver for MT7621 PCIe P

[PATCH v2 2/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-03-29 Thread Sergio Paracuellos
+#define RG_PE1_MSTCKDIVGENMASK(7, 6) +#define RG_PE1_MSTCKDIV_VAL(x) ((0x3 & (x)) << 6) + +#define RG_PE1_FRC_MSTCKDIVBIT(5) + +#define MAX_PHYS 2 + +/** + * struct mt7621_pci_phy_instance - Mt7621 Pci

[PATCH v2 1/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-03-29 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos --- .../bindings/phy/mediatek,mt7621-pci-phy.txt | 28 +++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.txt diff --git a

Re: [PATCH 2/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-03-28 Thread Sergio Paracuellos
Hi Rob, Thanks for the review. On Thu, Mar 28, 2019 at 4:42 PM Rob Herring wrote: > > On Thu, Mar 14, 2019 at 02:22:10PM +0100, Sergio Paracuellos wrote: > > Add bindings to describe Mediatek MT7621 PCIe PHY. > > Binding should come before the driver. Do you mean this should

Re: [PATCH 2/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-03-28 Thread Rob Herring
On Thu, Mar 14, 2019 at 02:22:10PM +0100, Sergio Paracuellos wrote: > Add bindings to describe Mediatek MT7621 PCIe PHY. Binding should come before the driver. > > Signed-off-by: Sergio Paracuellos > --- > .../bindings/phy/mediatek,mt7621-pci-phy.txt | 54 ++

MT7621 PCIe PHY

2019-03-14 Thread Sergio Paracuellos
nt of this phy. Both drivers have been tested together in a gnubee1 board. Thanks in advance for your time. Best regards, Sergio Paracuellos Sergio Paracuellos (2): phy: ralink: Add PHY driver for MT7621 PCIe PHY dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY .../bi

[PATCH 1/2] phy: ralink: Add PHY driver for MT7621 PCIe PHY

2019-03-14 Thread Sergio Paracuellos
define RG_PE1_H_PLL_BR_REG0x4ac +#define RG_PE1_H_PLL_BRGENMASK(18, 16) +#define RG_PE1_H_PLL_BR_VAL(x) ((0x7 & (x)) << 16) + +#defineRG_PE1_MSTCKDIV_REG 0x414 +#define RG_PE1_MSTCKDIV GENMASK(7, 6)

[PATCH 2/2] dt-bindings: phy: Add binding for Mediatek MT7621 PCIe PHY

2019-03-14 Thread Sergio Paracuellos
Add bindings to describe Mediatek MT7621 PCIe PHY. Signed-off-by: Sergio Paracuellos --- .../bindings/phy/mediatek,mt7621-pci-phy.txt | 54 +++ 1 file changed, 54 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.txt diff --git a

[PATCH v3 4/4] staging: mt7621-pci-phy: dt-bindings: add bindings for Mediatek MT7621 Pcie PHY

2019-01-03 Thread Sergio Paracuellos
0..33a8a698bdd0 --- /dev/null +++ b/drivers/staging/mt7621-pci-phy/mediatek,mt7621-pci-phy.txt @@ -0,0 +1,54 @@ +Mediatek Mt7621 PCIe PHY + +Required properties: +- compatible: must be "mediatek,mt7621-pci-phy" +- reg: base address and length of the PCIe PHY block +- #address-cells: mus