aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-pci (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-09staging: mt7621-pci: Prefer using the BIT macroMamta Shukla1-13/+13
Replace all occurrences of (1<<x) with BIT(x). Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-pci: Add spaces around '<<'Mamta Shukla1-20/+20
Add spaces around '<<' to fix checkpatch issue. CHECK: spaces preferred around that '<<' (ctx:VxV) Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-pci: Add spaces around '|'Mamta Shukla1-3/+3
Add spaces around '|' to fix checkpatch issue CHECK: spaces preferred around that '|' (ctx:VxV) Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-pci: Add spaces around '&'Mamta Shukla1-1/+1
Add spaces around '&' to fix checkpatch issue. CHECK: spaces preferred around that '&' (ctx:VxV) Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09staging: mt7621-pci: Do not initialise statics to 0Mamta Shukla1-1/+1
Remove initialisation for static global variable to fix checkpatch issue. ERROR: do not initialise statics to 0 Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-10staging: mt7621-pci: remove unnecessary check of device_type == pciRob Herring1-7/+0
PCI host drivers have already matched on compatible strings, so checking device_type is redundant. Also, device_type is considered deprecated for FDT though we've still been requiring it for PCI hosts as it is useful for finding PCI buses. Cc: devel@driverdev.osuosl.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: mt7621-pci: show N_FTS status using a loopSergio Paracuellos1-8/+5
There are some printk's which can be replaced properly using dev_* kernel functions. Use dev_info to show N_FTS status for each port using a loop instead of duplicating lines of code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27staging: mt7621-pci: make some function staticSergio Paracuellos1-3/+3
There are some functions in driver code that can be declared 'static'. Just do it. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: remove remaining pci_legacy dependant codeSergio Paracuellos1-32/+1
pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definitionSergio Paracuellos1-4/+4
RALINK_PCI_CONFIG_DATA_VIRTUAL_REG is a very long name. Make it a bit shorter renaming it to RALINK_PCI_CONFIG_DATA. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: use BIT macro in preprocessor definitionsSergio Paracuellos1-10/+10
Some preprocessor definitions are using a custom implementation of BIT macro. Just use linux kernel BIT macro instead. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitionsSergio Paracuellos1-64/+67
RALINK_PCI_BASE has no sense and this driver has base address readed and mapped from device tree. Remove remaining uses of it and change code to use pcie_read and pcie_write functions in places where this was being used. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDRSergio Paracuellos1-20/+34
RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR are defined to be directly referenced for read and write. Use pcie_read and pcie_write instead changing its definition to a simple relative offset to pcie base address. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: review includes putting them in alphabethic orderSergio Paracuellos1-14/+8
There are some includes that are being used that are not really needed to correct driver compilation. Remove them and reorder the rest alphabetically. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write]Sergio Paracuellos1-36/+34
Use pcie_[read|write] fucntions to read and write controller registers. Define those only by offset and pass controller offset + register offset relative to base address to functions. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: remove unused macrosSergio Paracuellos1-23/+1
There some macros that are not being used. Remove them. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: simplify write_config functionSergio Paracuellos1-11/+9
write_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Review parameter types changing for more proper ones. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: simplify read_config functionSergio Paracuellos1-17/+15
read_config function is always called with bus and func being 0. Avoid those params and just use 0 inside the function. Return readed value instead pass a reference parameter. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: use pcie_[read|write] in [write|read]_configSergio Paracuellos1-35/+32
Instead of custom macros use pcie_read and pcie_write functions. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: add pcie_write and pcie_read helpersSergio Paracuellos1-0/+10
Introdice this functions to make easier to write/read to/from an offset relative to base address Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: remove dead code derived to not use custom reads and writesSergio Paracuellos1-128/+0
Driver is using now pci subsystem generics reads and writes and requesting bus resources without using legacy code functions. Because of this there is a lot of dead code that can be removed. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-08staging: mt7621-pci: use generic kernel pci subsystem read and writeSergio Paracuellos2-17/+216
map_bus callback is called before every .read/.write operation. Implement it and change custom read write operations for the pci subsystem generics. Make the probe function to don't use legacy stuff and request bus resources directly. Get pci register base and ranges from device tree. The driver is not using PCI_LEGACY code anymore and shall use the PCI_DRIVERS_GENERIC option to correct compile it. Add also new Kconfig file for this controller setting there its correct dependencies. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Tested-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-16staging: mt7621: Add SPDX license identifierOliver Hübers1-0/+1
Signed-off-by: Oliver Hübers <oliver.huebers@web.de> Signed-off-by: Vanessa Borgmann <nessa.x@web.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-16staging: mt7621-pci: Include preferred headersOliver Hübers1-2/+2
This fixes the following checkpatch warnings: Use #include <linux/pci.h> instead of <asm/pci.h> Use #include <linux/io.h> instead of <asm/io.h> Signed-off-by: Oliver Hübers <oliver.huebers@web.de> Signed-off-by: Vanessa Borgmann <nessa.x@web.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-10staging: mt7621-pci: factor out mt7621_pci_get_cfgaddr functionSergio Paracuellos1-7/+14
To get config address the same pattern is repeated in some functions along the code. Factor out a new mt7621_pci_get_cfgaddr for calculate it and use it in convenient places. Adjust types to match to u32 where is neccesary. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-10staging: mt7621-pci: remove unused macro MV_READ_DATASergio Paracuellos1-3/+0
This macro is not being used at all along the code. Just remove it. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07staging: mt7621-pci: Move open-braces to match kernel code stylePeter Vernia1-4/+2
Moves some open-braces to the end of the conditional statement to match the kernel's coding style Signed-off-by: Peter Vernia <peter.vernia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07staging: mt7621-pci: Add spaces after commas in pci-mt7621.cPeter Vernia1-8/+8
Adds spaces after commas in parameter lists in pci-mt7621.c Signed-off-by: Peter Vernia <peter.vernia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07staging: mt7621-pci: Fix spacing around equals signPeter Vernia1-3/+3
Add spaces in front of the equals sign in assignment operations Signed-off-by: Peter Vernia <peter.vernia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07staging: mt7621-pci: Fix spaces around parenthesis in pci-7621.cPeter Vernia1-14/+14
Adds spaces before open parenthesis, and removes spaces after open parenthesis Signed-off-by: Peter Vernia <peter.vernia@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-pci: Fix coding style errorAbdun Nihaal1-5/+5
This patch removes space after * to fix the following checkpatch error: ERROR: "foo * bar" should be "foo *bar" Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17staging: mt7621-pci: use rt_sysc_?32() to access system-control register.NeilBrown1-30/+27
This driver currently has internal knowledge ofthe address of system-control registers and accesses them by dereferencing a constant pointer. It is cleaner to use rt_sysc_r32(), rt_sysc_w32(), rt_sysc_m32() which is a more standard interface. So change the defined names to offsets instead of pointers, and use these functions. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-31staging: mt7621-pci: Fix line size exceeding 80 columns.Sankalp Negi1-1/+2
This patch fixes the checkpatch.pl warning: WARNING: line over 80 characters Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-pci: remove some dead code.NeilBrown1-14/+0
Some code is dead because it is commented out. Some is dead because it is uninteresting printks. Some is dead because it declares unused functions. Remove it all. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-pci: remove unnecessary resource details.NeilBrown1-17/+2
These resources are extracted from devicetree, so they aren't needed here. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-pci: remove conditional compilation.NeilBrown1-55/+15
Code currently defines: #define CONFIG_PCIE_PORT0 #define CONFIG_PCIE_PORT1 #define CONFIG_PCIE_PORT2 #define GPIO_PERST and then compiles code only if they are defined. We might want to disable some of these via devicetree one day, but for now just remove the #defines and the conditions - all the code for different ports is easy to identify. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-pci: white-space cleanups.NeilBrown1-148/+143
- remove white space at end of line. - no more than 2 blank line at a time - remove spaces before tabs - use tabs to line things up - re-indent some #define do{}while(0) Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: mt7621-pci: improve interrupt mappingNeilBrown1-81/+9
As the Interrupts for the PCI adapters are listed in devicetree we shouldn't need to have them explicit in the code. The simplest way to do this is to use of_irq_parse_and_map_pci() and specify an interrupt-map which identifies the different PCI hosts by bus/slot numbers. This has the advantage that the hwirq number are mapped to virq numbers for us, so the ugly hack can go. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-pci: Remove redundant owner assignmentChristian Lütke-Stetzkamp1-1/+0
Remove the owner assignment form the platform driver as platform_driver_register() already initializes the owner. Found using coccinelle. Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: mt7621-pci: Hack 2 more PCI interrupts for gnubee1NeilBrown1-3/+8
The mt7621-pci support 3 pci devices and has 3 interrupts. Each of these need to be enabled by the same sort of hack to map hwirq number to virq number. This is a hack which will go as soon as I understand how this is supposed to work. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: mt7621-pci: MIPS/ralink: add MT7621 pcie driverJohn Crispin3-0/+853
NeilBrown: forward port and hack to work on GNUBEE1 Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>