[PATCH v4 00/18] staging: mt7621-pci: Parse ports info from DT and other minor cleanups

2018-09-10 Thread Sergio Paracuellos
st in probe function. - Use parent node to get base address registers for each port. Changes in v2: - Rewrite phy part of the driver - fix some checkpatch complains - make use of sysctl from DT Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (18):

[PATCH v4 04/18] staging: mt7621-pci: factor out 'mt7621_pcie_enable_port' function

2018-09-10 Thread Sergio Paracuellos
Driver probe function is a mess and shall be refactored a lot. At first make use of assert and deassert control factoring out a new function called 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 88 +++---

[PATCH v4 02/18] staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails

2018-09-10 Thread Sergio Paracuellos
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails it is returning -ENODEV. Return -ENOMEM instead which is more accurate for this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v4 01/18] staging: mt7621-pci: parse and init port data from device tree

2018-09-10 Thread Sergio Paracuellos
Add initialization of each PCIe port reading and initializing data using device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 75 +++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pci

[PATCH v4 09/18] staging: mt7621-pci: reagroup reset related macros all together

2018-09-10 Thread Sergio Paracuellos
Reset bits related macros are in different parts. Reagroup all of them together to improve readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v4 16/18] staging: mt7621-pci: use a trailing */ on a separate line

2018-09-10 Thread Sergio Paracuellos
Chackpatch script is compalining about one comment which is not following the kernel style. Fix it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v4 03/18] staging: mt7621-pci: add two helpers for read and write pcie register ports

2018-09-10 Thread Sergio Paracuellos
mt7621-pcie_port data structure has filed 'base' as the base address for read and write related port registers. Create two inline functions 'pcie_port_read' and 'pcie_port_write' to make this task easier and code more readable. Signed-off-by: Sergio Paracuellos -

[PATCH v4 11/18] staging: mt7621-pci: factor out 'mt7621_enable_phy' function

2018-09-10 Thread Sergio Paracuellos
Factor out a new function 'mt7621_enable_phy' for enabling the pcie phy for each port and call it from 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deleti

[PATCH v4 17/18] staging: mt7621-pci: use dev_* functions instead of printk

2018-09-10 Thread Sergio Paracuellos
checkpatch script is complaining about the use of printk instead of use more proper dev_* kernel functions. Replace all of them removing warnings. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH v4 12/18] staging: mt7621-pci: debug port N_FTS inside 'mt7621_pcie_enable_port'

2018-09-10 Thread Sergio Paracuellos
Move debug for the port N_FTS from driver probe function to the more appropiate one 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt76

[PATCH v4 14/18] staging: mt7621-dts: add sysctl registers base address to pcie

2018-09-10 Thread Sergio Paracuellos
Add missing system control registers address in pcie node of the device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts

[PATCH v4 10/18] staging: mt7621-pci: rewrite pcie phy related functions

2018-09-10 Thread Sergio Paracuellos
of dark and use new macros also resetting and adding bits using bitwise operators directly in the code. Now these function are offset-based on the port to use them cleaner in driver probe functio and improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pc

[PATCH v4 07/18] staging: mt7621-pci: remove two commented code lines

2018-09-10 Thread Sergio Paracuellos
This two lines whch are commented are not needed at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v4 05/18] staging: mt7621-pci: remove [ASSERT|DEASSERT]_SYSRST_PCIE macros

2018-09-10 Thread Sergio Paracuellos
Driver is using reset_control kernel API's to manage this so this two macros are not needed anymore. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/mt7621-pc

[PATCH v4 18/18] staging: mt7621-pci: do not initialise statics to 0

2018-09-10 Thread Sergio Paracuellos
Static variables are initialised to 0 by GCC and checkpatch script also complains about that. Make it happy. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v4 08/18] staging: mt7621-pci: remove reset related unused macros

2018-09-10 Thread Sergio Paracuellos
There are three macros which are not being used at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v4 15/18] staging: mt7621-pci: remap and use sysctl from device tree

2018-09-10 Thread Sergio Paracuellos
There are some pointer read and writes which can be replaced properly using sysctl registers readed from device tree. Remap sysctl registers and replace in proper places. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 38 - 1 file

[PATCH v4 06/18] staging: mt7621-pci: remove GPL2+ text from license header

2018-09-10 Thread Sergio Paracuellos
This file has a valid SPDX license line added so reamining GPL2+ boilerplate text is not needed at all. Remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a

[PATCH v4 13/18] staging: mt7621-pci: rename 'mt7621_pcie_enable_port' into 'mt7621_pcie_init_port'

2018-09-10 Thread Sergio Paracuellos
Rename function 'mt7621_pcie_enable_port' with a name which is better for what the function is really doing calling it 'mt7621_pcie_init_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

Re: [PATCH -next] staging: mt7621-pci: Use PTR_ERR_OR_ZERO in mt7621_pcie_parse_dt()

2018-09-11 Thread Sergio Paracuellos
he 'mt7621_pcie_parse_dt' function is not completed at all. There is a lot of missing for each pci node to be parsed yet and some patch series which are doing this have not been tested yet so those patches are not included. Please see: http://driverdev.linuxdriverproject.org/pi

[PATCH] staging: mt7621-pci: dt-bindings: add dt bindings for mt7621 pcie controller

2018-09-23 Thread Sergio Paracuellos
This commit adds pci device tree bindings for the Mt7621 pci controller. This is a temporal file included in staging driver directory and will be moved to its correct location when this driver gets out of staging. Cc: Rob Herring Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci

[RESEND PATCH] staging: mt7621-pci: dt-bindings: add dt bindings for mt7621 pcie controller

2018-10-09 Thread Sergio Paracuellos
This commit adds pci device tree bindings for the Mt7621 pci controller. This is a temporal file included in staging driver directory and will be moved to its correct location when this driver gets out of staging. Cc: Rob Herring Signed-off-by: Sergio Paracuellos --- I resend this because I

[PATCH v5 00/17] staging: mt7621-pci: Parse ports info from DT and other minor cleanups

2018-10-15 Thread Sergio Paracuellos
checkpatch complains - make use of sysctl from DT Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (17): staging: mt7621-pci: parse and init port data from device tree staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails staging:

[PATCH v5 01/17] staging: mt7621-pci: parse and init port data from device tree

2018-10-15 Thread Sergio Paracuellos
Add initialization of each PCIe port reading and initializing data using device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 75 +++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pci

[PATCH v5 03/17] staging: mt7621-pci: add two helpers for read and write pcie register ports

2018-10-15 Thread Sergio Paracuellos
mt7621-pcie_port data structure has filed 'base' as the base address for read and write related port registers. Create two inline functions 'pcie_port_read' and 'pcie_port_write' to make this task easier and code more readable. Signed-off-by: Sergio Paracuellos -

[PATCH v5 02/17] staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails

2018-10-15 Thread Sergio Paracuellos
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails it is returning -ENODEV. Return -ENOMEM instead which is more accurate for this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v5 04/17] staging: mt7621-pci: factor out 'mt7621_pcie_enable_port' function

2018-10-15 Thread Sergio Paracuellos
Driver probe function is a mess and shall be refactored a lot. At first make use of assert and deassert control factoring out a new function called 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 88 +++---

[PATCH v5 06/17] staging: mt7621-pci: remove GPL2+ text from license header

2018-10-15 Thread Sergio Paracuellos
This file has a valid SPDX license line added so reamining GPL2+ boilerplate text is not needed at all. Remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a

[PATCH v5 12/17] staging: mt7621-pci: debug port N_FTS inside 'mt7621_pcie_enable_port'

2018-10-15 Thread Sergio Paracuellos
Move debug for the port N_FTS from driver probe function to the more appropiate one 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt76

[PATCH v5 13/17] staging: mt7621-pci: rename 'mt7621_pcie_enable_port' into 'mt7621_pcie_init_port'

2018-10-15 Thread Sergio Paracuellos
Rename function 'mt7621_pcie_enable_port' with a name which is better for what the function is really doing calling it 'mt7621_pcie_init_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v5 07/17] staging: mt7621-pci: remove two commented code lines

2018-10-15 Thread Sergio Paracuellos
This two lines whch are commented are not needed at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v5 10/17] staging: mt7621-pci: rewrite pcie phy related functions

2018-10-15 Thread Sergio Paracuellos
of dark and use new macros also resetting and adding bits using bitwise operators directly in the code. Now these function are offset-based on the port to use them cleaner in driver probe functio and improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pc

[PATCH v5 09/17] staging: mt7621-pci: reagroup reset related macros all together

2018-10-15 Thread Sergio Paracuellos
Reset bits related macros are in different parts. Reagroup all of them together to improve readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v5 16/17] staging: mt7621-pci: use a trailing */ on a separate line

2018-10-15 Thread Sergio Paracuellos
Chackpatch script is compalining about one comment which is not following the kernel style. Fix it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v5 08/17] staging: mt7621-pci: remove reset related unused macros

2018-10-15 Thread Sergio Paracuellos
There are three macros which are not being used at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v5 15/17] staging: mt7621-pci: remap and use sysctl from device tree

2018-10-15 Thread Sergio Paracuellos
There are some pointer read and writes which can be replaced properly using sysctl registers readed from device tree. Remap sysctl registers and replace in proper places. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 38 - 1 file

[PATCH v5 17/17] staging: mt7621-pci: use dev_* functions instead of printk

2018-10-15 Thread Sergio Paracuellos
checkpatch script is complaining about the use of printk instead of use more proper dev_* kernel functions. Replace all of them removing warnings. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH v5 05/17] staging: mt7621-pci: remove [ASSERT|DEASSERT]_SYSRST_PCIE macros

2018-10-15 Thread Sergio Paracuellos
Driver is using reset_control kernel API's to manage this so this two macros are not needed anymore. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/mt7621-pc

[PATCH v5 14/17] staging: mt7621-dts: add sysctl registers base address to pcie

2018-10-15 Thread Sergio Paracuellos
Add missing system control registers address in pcie node of the device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts

[PATCH v5 11/17] staging: mt7621-pci: factor out 'mt7621_enable_phy' function

2018-10-15 Thread Sergio Paracuellos
Factor out a new function 'mt7621_enable_phy' for enabling the pcie phy for each port and call it from 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deleti

[PATCH] staging: mt7621-dma: fix potentially dereferencing uninitialized 'tx_desc'

2018-10-20 Thread Sergio Paracuellos
Function 'mtk_hsdma_start_transfer' uses 'tx_desc' pointer which can be dereferenced before it is initializated. Initializate pointer before avoiding the problem. Fixes: 0853c7a53eb3: "staging: mt7621-dma: ralink: add rt2880 dma engine" Reported-by: Dan Car

[RESEND PATCH] staging: mt7621-pci: dt-bindings: add dt bindings for mt7621 pcie controller

2018-10-26 Thread Sergio Paracuellos
This commit adds pci device tree bindings for the Mt7621 pci controller. This is a temporal file included in staging driver directory and will be moved to its correct location when this driver gets out of staging. Cc: Rob Herring Signed-off-by: Sergio Paracuellos --- I resend this because I

[PATCH v6 01/33] staging: mt7621-pci: parse and init port data from device tree

2018-11-04 Thread Sergio Paracuellos
Add initialization of each PCIe port reading and initializing data using device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 75 +++-- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pci

[PATCH v6 17/33] staging: mt7621-pci: use dev_* functions instead of printk

2018-11-04 Thread Sergio Paracuellos
checkpatch script is complaining about the use of printk instead of use more proper dev_* kernel functions. Replace all of them removing warnings. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH v6 08/33] staging: mt7621-pci: remove reset related unused macros

2018-11-04 Thread Sergio Paracuellos
There are three macros which are not being used at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v6 23/33] staging: mt7621-pci: remove non sense comment

2018-11-04 Thread Sergio Paracuellos
There is a comment at the beggining which has no sense at all. Remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v6 02/33] staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails

2018-11-04 Thread Sergio Paracuellos
Driver probe function calls 'devm_pci_alloc_host_bridge'. If this call fails it is returning -ENODEV. Return -ENOMEM instead which is more accurate for this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v6 12/33] staging: mt7621-pci: debug port N_FTS inside 'mt7621_pcie_enable_port'

2018-11-04 Thread Sergio Paracuellos
Move debug for the port N_FTS from driver probe function to the more appropiate one 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt76

[PATCH v6 04/33] staging: mt7621-pci: factor out 'mt7621_pcie_enable_port' function

2018-11-04 Thread Sergio Paracuellos
Driver probe function is a mess and shall be refactored a lot. At first make use of assert and deassert control factoring out a new function called 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 88 +++---

[PATCH v6 10/33] staging: mt7621-pci: rewrite pcie phy related functions

2018-11-04 Thread Sergio Paracuellos
of dark and use new macros also resetting and adding bits using bitwise operators directly in the code. Now these function are offset-based on the port to use them cleaner in driver probe functio and improving readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pc

[PATCH v6 03/33] staging: mt7621-pci: add two helpers for read and write pcie register ports

2018-11-04 Thread Sergio Paracuellos
mt7621-pcie_port data structure has filed 'base' as the base address for read and write related port registers. Create two inline functions 'pcie_port_read' and 'pcie_port_write' to make this task easier and code more readable. Signed-off-by: Sergio Paracuellos -

[PATCH v6 06/33] staging: mt7621-pci: remove GPL2+ text from license header

2018-11-04 Thread Sergio Paracuellos
This file has a valid SPDX license line added so reamining GPL2+ boilerplate text is not needed at all. Remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a

[PATCH v6 18/33] staging: mt7621-pci: factor out 'mt7621_pcie_enable_ports' function

2018-11-04 Thread Sergio Paracuellos
zero to num_slots_enabled as follows: - Only one enabled -> only enable virtual bridge 0. - Two enabled -> enable virtual bridges 0 and 1. - Three enabled -> enable virtual bridges 0, 1 and 2. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 106 +

[PATCH v6 28/33] staging: mt7621-pci: use PERST_N instead of gpio control

2018-11-04 Thread Sergio Paracuellos
Driver is using gpio control instead of each port PERST_N bit. Use PERST_N bit of each port cleaning all the ugly gpio code in driver probe function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 46 + 1 file changed, 24

[PATCH v6 25/33] staging: mt7621-pci: rewrite RC FTS configuration

2018-11-04 Thread Sergio Paracuellos
The RC FTS configuration is done using hardcoded registers and bitshift operations. Make it a bit clean defining some prepocessor definitions and simple macros. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 16 +++- 1 file changed, 11 insertions

[PATCH v6 21/33] staging: mt7621-pci: remove unused preprocessor definitions

2018-11-04 Thread Sergio Paracuellos
There are some preprocessor definition which are not being used at all. Remove them cleaning the code a bit. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v6 22/33] staging: mt7621-pci: reorder preprocessor definitions

2018-11-04 Thread Sergio Paracuellos
Reorder a bit register definitions and some values into logical groups adding some comments for each group. Also unify all of register to use 16 bit in definitions instead of having some with 16 bits and some with 8 bits. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci

[PATCH v6 31/33] staging: mt7621-pci: factor out 'mt7621_pcie_enable_port' function

2018-11-04 Thread Sergio Paracuellos
Function 'mt7621_pcie_enable_ports' tries to enable all PCI ports. To make it more readable the single port initialization part has been factor out into a new 'mt7621_pcie_enable_port' function. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-p

[PATCH v6 09/33] staging: mt7621-pci: reagroup reset related macros all together

2018-11-04 Thread Sergio Paracuellos
Reset bits related macros are in different parts. Reagroup all of them together to improve readability. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c

[PATCH v6 24/33] staging: mt7621-pci: align function definition style along the code

2018-11-04 Thread Sergio Paracuellos
Make some function definition changes in order to get all the functions in the code with the same style. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci

[PATCH v6 14/33] staging: mt7621-dts: add sysctl registers base address to pcie

2018-11-04 Thread Sergio Paracuellos
Add missing system control registers address in pcie node of the device tree. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts

[PATCH v6 13/33] staging: mt7621-pci: rename 'mt7621_pcie_enable_port' into 'mt7621_pcie_init_port'

2018-11-04 Thread Sergio Paracuellos
Rename function 'mt7621_pcie_enable_port' with a name which is better for what the function is really doing calling it 'mt7621_pcie_init_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH v6 07/33] staging: mt7621-pci: remove two commented code lines

2018-11-04 Thread Sergio Paracuellos
This two lines whch are commented are not needed at all. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index

[PATCH v6 00/33] staging: mt7621-pci: Parse ports info from DT and other minor cleanups

2018-11-04 Thread Sergio Paracuellos
e checkpatch complains - make use of sysctl from DT Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (33): staging: mt7621-pci: parse and init port data from device tree staging: mt7621-pci: replace return value if devm_pci_alloc_host_bridge call fails staging:

[PATCH v6 32/33] staging: mt7621-pci: move some code into 'mt7621_pcie_init_ports'

2018-11-04 Thread Sergio Paracuellos
Some clocks bits related code is in driver probe function and can perfectly be moved into 'mt7621_pcie_init_ports' function which is a more accurate place for it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 18 -- 1 file changed, 8

[PATCH v6 05/33] staging: mt7621-pci: remove [ASSERT|DEASSERT]_SYSRST_PCIE macros

2018-11-04 Thread Sergio Paracuellos
Driver is using reset_control kernel API's to manage this so this two macros are not needed anymore. Remove them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/mt7621-pc

[PATCH v6 15/33] staging: mt7621-pci: remap and use sysctl from device tree

2018-11-04 Thread Sergio Paracuellos
There are some pointer read and writes which can be replaced properly using sysctl registers readed from device tree. Remap sysctl registers and replace in proper places. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 38 - 1 file

[PATCH v6 16/33] staging: mt7621-pci: use a trailing */ on a separate line

2018-11-04 Thread Sergio Paracuellos
Chackpatch script is compalining about one comment which is not following the kernel style. Fix it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b

[PATCH v6 11/33] staging: mt7621-pci: factor out 'mt7621_enable_phy' function

2018-11-04 Thread Sergio Paracuellos
Factor out a new function 'mt7621_enable_phy' for enabling the pcie phy for each port and call it from 'mt7621_pcie_enable_port'. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deleti

[PATCH v6 29/33] staging: mt7621-pci: use PCIE_PORT_LINKUP instead of hardcode value

2018-11-04 Thread Sergio Paracuellos
PCIE_PORT_LINKUP is defined and can be used to check if link is up for each controller. Use it instead of use a hardcode value. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH v6 33/33] staging: mt7621-pci: replace 'mdelay()' with 'msleep()'

2018-11-04 Thread Sergio Paracuellos
Function 'mt7621_pcie_init_ports' is never called in atomic context. It calls mdelay() to busily wait, which is not necessary. mdelay() can be replaced with msleep(). Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v6 27/33] staging: mt7621-pci: add some definitions for enabling and disabling GEN and GEN1 clocks

2018-11-04 Thread Sergio Paracuellos
Instead of use hardcoded values when calling 'rt_sysc_m32' for enabling and disabling RALINK_PCIE_CLK_GEN and RALINK_PCIE_CLK_GEN1 create some preprocessor definitions. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 10 +++--- 1 file changed, 7

[PATCH v6 20/33] staging: mt7621-pci: factor out 'mt7621_pcie_init_ports' function

2018-11-04 Thread Sergio Paracuellos
Instead of just inline this code in the probe driver function factor out a new 'mt7621_pcie_init_ports' function to achieve this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 28 ++-- 1 file changed, 18 insertions(+), 10

[PATCH v6 26/33] staging: mt7621-pci: rewrite hardcoded code for enabling ports

2018-11-04 Thread Sergio Paracuellos
There are some hardcoded values in the process for enabling and disabling some stuff inside 'mt7621_pcie_enable_ports' function. Create some preprocessor definitions to make code more readable. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7

[PATCH v6 19/33] staging: mt7621-pci: avoid use of global variable 'pcie_link_status'

2018-11-04 Thread Sergio Paracuellos
operly configure the virtual PCI-PCI bridges in configuration registers of the mt7621 pci controller. For a correct initiation of which is connected use 'enabled' field of 'mt7621_pcie_port' struct. With this change driver probe function gets a bit cleaner and readable. Signed-off-by:

[PATCH v6 30/33] staging: mt7621-pci: enable interrupt when port is being enabled

2018-11-04 Thread Sergio Paracuellos
Interrupt is being enabled in port initialization when the port phy has not been initialized yet. Just enable the interrupt when the port is being enabled which is a more accurate place for this. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 9 + 1 file

Re: [PATCH v6 33/33] staging: mt7621-pci: replace 'mdelay()' with 'msleep()'

2018-11-07 Thread Sergio Paracuellos
On Mon, Nov 05, 2018 at 09:09:39AM +0100, Frans Klaver wrote: > On Sun, Nov 4, 2018 at 11:51 AM Sergio Paracuellos > wrote: > > > > Function 'mt7621_pcie_init_ports' is never called in atomic context. > > It calls mdelay() to busily wait, which is not necessary.

Re: [PATCH] staging: mt7621-pinctrl: fix uninitialized variable ngroups

2018-11-10 Thread Sergio Paracuellos
*function_name, *group_name; > int ret; > - int ngroups; > + int ngroups = 0; > unsigned int reserved_maps = 0; > > for_each_node_with_property(np_config, "group") > -- > 2.19.1 > Thanks, Colin. Looks good. Reviewed-by:

Re: [PATCH v6 00/33] staging: mt7621-pci: Parse ports info from DT and other minor cleanups

2018-11-11 Thread Sergio Paracuellos
On Mon, Nov 12, 2018 at 08:40:10AM +1100, NeilBrown wrote: > On Sun, Nov 11 2018, Greg KH wrote: > > > On Sun, Nov 04, 2018 at 11:49:26AM +0100, Sergio Paracuellos wrote: > >> This patch series parse remaining port info from device tree storing > >> it in mt7621_pci

Re: [PATCH v6 01/33] staging: mt7621-pci: parse and init port data from device tree

2018-11-18 Thread Sergio Paracuellos
On Sun, Nov 18, 2018 at 10:52 PM NeilBrown wrote: > > On Sun, Nov 04 2018, Sergio Paracuellos wrote: > > > Add initialization of each PCIe port reading and initializing > > data using device tree. > > > > Signed-off-by: Sergio Paracuellos > > --- > >

Re: [PATCH v6 14/33] staging: mt7621-dts: add sysctl registers base address to pcie

2018-11-23 Thread Sergio Paracuellos
On Sat, Nov 24, 2018 at 12:07 AM NeilBrown wrote: > > On Sun, Nov 04 2018, Sergio Paracuellos wrote: > > > Add missing system control registers address in pcie node of > > the device tree. > > > > Signed-off-by: Sergio Paracuellos > > --- > >

Re: [PATCH v6 00/33] staging: mt7621-pci: Parse ports info from DT and other minor cleanups

2018-11-23 Thread Sergio Paracuellos
On Sat, Nov 24, 2018 at 1:21 AM NeilBrown wrote: > > On Mon, Nov 12 2018, Sergio Paracuellos wrote: > > > On Mon, Nov 12, 2018 at 08:40:10AM +1100, NeilBrown wrote: > >> On Sun, Nov 11 2018, Greg KH wrote: > >> > >> > On Sun, Nov 04, 2018

[PATCH 1/7] staging: mt7621-pci: avoid mapping sysctls registers

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. The best way to access the sysc registers is to use rt_sysc_[rwm]32(). Fixes: 89e9f6e6adfc: staging: mt7621-pci: remap and use sysctl from device tree Reported-by: NeilBrown Signed-off-by: Sergio Paracuellos

[PATCH 0/7] staging: mt7621-pci: some fixes after test previous series

2018-11-24 Thread Sergio Paracuellos
in driver code and use proper reset_control_* functions. I checked the 'arch/mips/ralink/reset.c' and think a good way to add a quirk there but I ended up handling those inside the driver. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (7): staging: mt7621-

[PATCH 5/7] staging: mt7621-pci: avoid using clk_* operations

2018-11-24 Thread Sergio Paracuellos
eported-by: NeilBrown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 1b63706e129b..c5e33fbdf225 100644 --- a/drive

[PATCH 2/7] staging: mt7621-dts: remove sysctl registers from pcie bindings

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. Remove registers accordly from DT bindings. Fixes: 624c5227ed0a: staging: mt7621-dts: add sysctl registers base address to pcie Reported-by: NeilBrown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts

[PATCH 7/7] staging: mt7621-pcie: dt-bindings: update bindings doc removing clocks

2018-11-24 Thread Sergio Paracuellos
Clocks are not necessary for the driver to work. Remove them also for DT binding documentation. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt b

[PATCH 4/7] staging: mt7621-pci: fix reset lines for each pcie port

2018-11-24 Thread Sergio Paracuellos
rown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 38 + 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index ba81b34dc1b7..1b63706e129b

[PATCH 3/7] staging: mt7621-pci: dt-bindings: update bindings doc removing sysctls registers

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. Device tree has been updated to not use it at all with pcie. Update bindings documentation. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 3 +-- 1 file changed, 1 insertion

[PATCH 6/7] staging: mt7621-dts: remove clocks for pcie bindings

2018-11-24 Thread Sergio Paracuellos
There are no real need to use clocks for pcie ports for this driver. There is no clock driver for ralink and driver can work without them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-dts

[PATCH v2 0/7]

2018-11-24 Thread Sergio Paracuellos
helps. Best regards, Sergio Paracuellos Sergio Paracuellos (7): staging: mt7621-pci: avoid mapping sysctls registers staging: mt7621-dts: remove sysctl registers from pcie bindings staging: mt7621-pci: dt-bindings: update bindings doc removing sysctls registers staging: mt7621-pci:

[PATCH v2 2/7] staging: mt7621-dts: remove sysctl registers from pcie bindings

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. Remove registers accordly from DT bindings. Fixes: 624c5227ed0a: staging: mt7621-dts: add sysctl registers base address to pcie Reported-by: NeilBrown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts

[PATCH v2 1/7] staging: mt7621-pci: avoid mapping sysctls registers

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. The best way to access the sysc registers is to use rt_sysc_[rwm]32(). Fixes: 89e9f6e6adfc: staging: mt7621-pci: remap and use sysctl from device tree Reported-by: NeilBrown Signed-off-by: Sergio Paracuellos

[PATCH v2 4/7] staging: mt7621-pci: fix reset lines for each pcie port

2018-11-24 Thread Sergio Paracuellos
rown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 38 + 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index ba81b34dc1b7..1b63706e129b

[PATCH v2 6/7] staging: mt7621-dts: remove clocks for pcie bindings

2018-11-24 Thread Sergio Paracuellos
There are no real need to use clocks for pcie ports for this driver. There is no clock driver for ralink and driver can work without them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-dts

[PATCH v2 3/7] staging: mt7621-pci: dt-bindings: update bindings doc removing sysctls registers

2018-11-24 Thread Sergio Paracuellos
The sysctl register are already claimed by palmbus, so pci fails to claim it. Device tree has been updated to not use it at all with pcie. Update bindings documentation. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 3 +-- 1 file changed, 1 insertion

[PATCH v2 7/7] staging: mt7621-pci: dt-bindings: update bindings doc removing clocks

2018-11-24 Thread Sergio Paracuellos
Clocks are not necessary for the driver to work. Remove them also for DT binding documentation. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt b

[PATCH v2 5/7] staging: mt7621-pci: avoid using clk_* operations

2018-11-24 Thread Sergio Paracuellos
eported-by: NeilBrown Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/pci-mt7621.c | 16 1 file changed, 16 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index 1b63706e129b..c5e33fbdf225 100644 --- a/drive

[PATCH v2 7/7] staging: mt7621-pci: dt-bindings: update bindings doc removing clocks

2018-11-24 Thread Sergio Paracuellos
Clocks are not necessary for the driver to work. Remove them also for DT binding documentation. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt b

[PATCH v2 6/7] staging: mt7621-dts: remove clocks for pcie bindings

2018-11-24 Thread Sergio Paracuellos
There are no real need to use clocks for pcie ports for this driver. There is no clock driver for ralink and driver can work without them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/mt7621-dts

  1   2   3   4   5   6   7   8   9   10   >