diff options
| author | Marek Vasut <marek.vasut@gmail.com> | 2018-04-08 14:04:31 -0400 |
|---|---|---|
| committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-05-01 06:35:10 -0400 |
| commit | 0ee40820989b330e24926d82953ffb9e1c7a8425 (patch) | |
| tree | c9da2108b663afc7782c338bb3149beb22a80274 | |
| parent | 0df6150e7ceb8967c0f4e953a4468a5c7b184be8 (diff) | |
PCI: rcar: Clean up the macros
This patch replaces the (1 << n) with BIT(n) and cleans up whitespace,
no functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
| -rw-r--r-- | drivers/pci/host/pcie-rcar.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 25f68305322c..e403c5206b24 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * Author: Phil Edworthy <phil.edworthy@renesas.com> | 11 | * Author: Phil Edworthy <phil.edworthy@renesas.com> |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/bitops.h> | ||
| 14 | #include <linux/clk.h> | 15 | #include <linux/clk.h> |
| 15 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
| 16 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
| @@ -30,9 +31,9 @@ | |||
| 30 | 31 | ||
| 31 | #define PCIECAR 0x000010 | 32 | #define PCIECAR 0x000010 |
| 32 | #define PCIECCTLR 0x000018 | 33 | #define PCIECCTLR 0x000018 |
| 33 | #define CONFIG_SEND_ENABLE (1 << 31) | 34 | #define CONFIG_SEND_ENABLE BIT(31) |
| 34 | #define TYPE0 (0 << 8) | 35 | #define TYPE0 (0 << 8) |
| 35 | #define TYPE1 (1 << 8) | 36 | #define TYPE1 BIT(8) |
| 36 | #define PCIECDR 0x000020 | 37 | #define PCIECDR 0x000020 |
| 37 | #define PCIEMSR 0x000028 | 38 | #define PCIEMSR 0x000028 |
| 38 | #define PCIEINTXR 0x000400 | 39 | #define PCIEINTXR 0x000400 |
| @@ -44,7 +45,7 @@ | |||
| 44 | #define PCIETSTR 0x02004 | 45 | #define PCIETSTR 0x02004 |
| 45 | #define DATA_LINK_ACTIVE 1 | 46 | #define DATA_LINK_ACTIVE 1 |
| 46 | #define PCIEERRFR 0x02020 | 47 | #define PCIEERRFR 0x02020 |
| 47 | #define UNSUPPORTED_REQUEST (1 << 4) | 48 | #define UNSUPPORTED_REQUEST BIT(4) |
| 48 | #define PCIEMSIFR 0x02044 | 49 | #define PCIEMSIFR 0x02044 |
| 49 | #define PCIEMSIALR 0x02048 | 50 | #define PCIEMSIALR 0x02048 |
| 50 | #define MSIFE 1 | 51 | #define MSIFE 1 |
| @@ -57,17 +58,17 @@ | |||
| 57 | /* local address reg & mask */ | 58 | /* local address reg & mask */ |
| 58 | #define PCIELAR(x) (0x02200 + ((x) * 0x20)) | 59 | #define PCIELAR(x) (0x02200 + ((x) * 0x20)) |
| 59 | #define PCIELAMR(x) (0x02208 + ((x) * 0x20)) | 60 | #define PCIELAMR(x) (0x02208 + ((x) * 0x20)) |
| 60 | #define LAM_PREFETCH (1 << 3) | 61 | #define LAM_PREFETCH BIT(3) |
| 61 | #define LAM_64BIT (1 << 2) | 62 | #define LAM_64BIT BIT(2) |
| 62 | #define LAR_ENABLE (1 << 1) | 63 | #define LAR_ENABLE BIT(1) |
| 63 | 64 | ||
| 64 | /* PCIe address reg & mask */ | 65 | /* PCIe address reg & mask */ |
| 65 | #define PCIEPALR(x) (0x03400 + ((x) * 0x20)) | 66 | #define PCIEPALR(x) (0x03400 + ((x) * 0x20)) |
| 66 | #define PCIEPAUR(x) (0x03404 + ((x) * 0x20)) | 67 | #define PCIEPAUR(x) (0x03404 + ((x) * 0x20)) |
| 67 | #define PCIEPAMR(x) (0x03408 + ((x) * 0x20)) | 68 | #define PCIEPAMR(x) (0x03408 + ((x) * 0x20)) |
| 68 | #define PCIEPTCTLR(x) (0x0340c + ((x) * 0x20)) | 69 | #define PCIEPTCTLR(x) (0x0340c + ((x) * 0x20)) |
| 69 | #define PAR_ENABLE (1 << 31) | 70 | #define PAR_ENABLE BIT(31) |
| 70 | #define IO_SPACE (1 << 8) | 71 | #define IO_SPACE BIT(8) |
| 71 | 72 | ||
| 72 | /* Configuration */ | 73 | /* Configuration */ |
| 73 | #define PCICONF(x) (0x010000 + ((x) * 0x4)) | 74 | #define PCICONF(x) (0x010000 + ((x) * 0x4)) |
| @@ -79,23 +80,23 @@ | |||
| 79 | #define IDSETR1 0x011004 | 80 | #define IDSETR1 0x011004 |
| 80 | #define TLCTLR 0x011048 | 81 | #define TLCTLR 0x011048 |
| 81 | #define MACSR 0x011054 | 82 | #define MACSR 0x011054 |
| 82 | #define SPCHGFIN (1 << 4) | 83 | #define SPCHGFIN BIT(4) |
| 83 | #define SPCHGFAIL (1 << 6) | 84 | #define SPCHGFAIL BIT(6) |
| 84 | #define SPCHGSUC (1 << 7) | 85 | #define SPCHGSUC BIT(7) |
| 85 | #define LINK_SPEED (0xf << 16) | 86 | #define LINK_SPEED (0xf << 16) |
| 86 | #define LINK_SPEED_2_5GTS (1 << 16) | 87 | #define LINK_SPEED_2_5GTS (1 << 16) |
| 87 | #define LINK_SPEED_5_0GTS (2 << 16) | 88 | #define LINK_SPEED_5_0GTS (2 << 16) |
| 88 | #define MACCTLR 0x011058 | 89 | #define MACCTLR 0x011058 |
| 89 | #define SPEED_CHANGE (1 << 24) | 90 | #define SPEED_CHANGE BIT(24) |
| 90 | #define SCRAMBLE_DISABLE (1 << 27) | 91 | #define SCRAMBLE_DISABLE BIT(27) |
| 91 | #define MACS2R 0x011078 | 92 | #define MACS2R 0x011078 |
| 92 | #define MACCGSPSETR 0x011084 | 93 | #define MACCGSPSETR 0x011084 |
| 93 | #define SPCNGRSN (1 << 31) | 94 | #define SPCNGRSN BIT(31) |
| 94 | 95 | ||
| 95 | /* R-Car H1 PHY */ | 96 | /* R-Car H1 PHY */ |
| 96 | #define H1_PCIEPHYADRR 0x04000c | 97 | #define H1_PCIEPHYADRR 0x04000c |
| 97 | #define WRITE_CMD (1 << 16) | 98 | #define WRITE_CMD BIT(16) |
| 98 | #define PHY_ACK (1 << 24) | 99 | #define PHY_ACK BIT(24) |
| 99 | #define RATE_POS 12 | 100 | #define RATE_POS 12 |
| 100 | #define LANE_POS 8 | 101 | #define LANE_POS 8 |
| 101 | #define ADR_POS 0 | 102 | #define ADR_POS 0 |
| @@ -107,19 +108,19 @@ | |||
| 107 | #define GEN2_PCIEPHYDATA 0x784 | 108 | #define GEN2_PCIEPHYDATA 0x784 |
| 108 | #define GEN2_PCIEPHYCTRL 0x78c | 109 | #define GEN2_PCIEPHYCTRL 0x78c |
| 109 | 110 | ||
| 110 | #define INT_PCI_MSI_NR 32 | 111 | #define INT_PCI_MSI_NR 32 |
| 111 | 112 | ||
| 112 | #define RCONF(x) (PCICONF(0)+(x)) | 113 | #define RCONF(x) (PCICONF(0) + (x)) |
| 113 | #define RPMCAP(x) (PMCAP(0)+(x)) | 114 | #define RPMCAP(x) (PMCAP(0) + (x)) |
| 114 | #define REXPCAP(x) (EXPCAP(0)+(x)) | 115 | #define REXPCAP(x) (EXPCAP(0) + (x)) |
| 115 | #define RVCCAP(x) (VCCAP(0)+(x)) | 116 | #define RVCCAP(x) (VCCAP(0) + (x)) |
| 116 | 117 | ||
| 117 | #define PCIE_CONF_BUS(b) (((b) & 0xff) << 24) | 118 | #define PCIE_CONF_BUS(b) (((b) & 0xff) << 24) |
| 118 | #define PCIE_CONF_DEV(d) (((d) & 0x1f) << 19) | 119 | #define PCIE_CONF_DEV(d) (((d) & 0x1f) << 19) |
| 119 | #define PCIE_CONF_FUNC(f) (((f) & 0x7) << 16) | 120 | #define PCIE_CONF_FUNC(f) (((f) & 0x7) << 16) |
| 120 | 121 | ||
| 121 | #define RCAR_PCI_MAX_RESOURCES 4 | 122 | #define RCAR_PCI_MAX_RESOURCES 4 |
| 122 | #define MAX_NR_INBOUND_MAPS 6 | 123 | #define MAX_NR_INBOUND_MAPS 6 |
| 123 | 124 | ||
| 124 | struct rcar_msi { | 125 | struct rcar_msi { |
| 125 | DECLARE_BITMAP(used, INT_PCI_MSI_NR); | 126 | DECLARE_BITMAP(used, INT_PCI_MSI_NR); |
