aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/amba/tegra-ahb.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/drivers/amba/tegra-ahb.c b/drivers/amba/tegra-ahb.c
index c6dc3548e5d1..30759a55efe4 100644
--- a/drivers/amba/tegra-ahb.c
+++ b/drivers/amba/tegra-ahb.c
@@ -25,49 +25,50 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/of.h>
28 29
29#include <soc/tegra/ahb.h> 30#include <soc/tegra/ahb.h>
30 31
31#define DRV_NAME "tegra-ahb" 32#define DRV_NAME "tegra-ahb"
32 33
33#define AHB_ARBITRATION_DISABLE 0x00 34#define AHB_ARBITRATION_DISABLE 0x04
34#define AHB_ARBITRATION_PRIORITY_CTRL 0x04 35#define AHB_ARBITRATION_PRIORITY_CTRL 0x08
35#define AHB_PRIORITY_WEIGHT(x) (((x) & 0x7) << 29) 36#define AHB_PRIORITY_WEIGHT(x) (((x) & 0x7) << 29)
36#define PRIORITY_SELECT_USB BIT(6) 37#define PRIORITY_SELECT_USB BIT(6)
37#define PRIORITY_SELECT_USB2 BIT(18) 38#define PRIORITY_SELECT_USB2 BIT(18)
38#define PRIORITY_SELECT_USB3 BIT(17) 39#define PRIORITY_SELECT_USB3 BIT(17)
39 40
40#define AHB_GIZMO_AHB_MEM 0x0c 41#define AHB_GIZMO_AHB_MEM 0x10
41#define ENB_FAST_REARBITRATE BIT(2) 42#define ENB_FAST_REARBITRATE BIT(2)
42#define DONT_SPLIT_AHB_WR BIT(7) 43#define DONT_SPLIT_AHB_WR BIT(7)
43 44
44#define AHB_GIZMO_APB_DMA 0x10 45#define AHB_GIZMO_APB_DMA 0x14
45#define AHB_GIZMO_IDE 0x18 46#define AHB_GIZMO_IDE 0x1c
46#define AHB_GIZMO_USB 0x1c 47#define AHB_GIZMO_USB 0x20
47#define AHB_GIZMO_AHB_XBAR_BRIDGE 0x20 48#define AHB_GIZMO_AHB_XBAR_BRIDGE 0x24
48#define AHB_GIZMO_CPU_AHB_BRIDGE 0x24 49#define AHB_GIZMO_CPU_AHB_BRIDGE 0x28
49#define AHB_GIZMO_COP_AHB_BRIDGE 0x28 50#define AHB_GIZMO_COP_AHB_BRIDGE 0x2c
50#define AHB_GIZMO_XBAR_APB_CTLR 0x2c 51#define AHB_GIZMO_XBAR_APB_CTLR 0x30
51#define AHB_GIZMO_VCP_AHB_BRIDGE 0x30 52#define AHB_GIZMO_VCP_AHB_BRIDGE 0x34
52#define AHB_GIZMO_NAND 0x3c 53#define AHB_GIZMO_NAND 0x40
53#define AHB_GIZMO_SDMMC4 0x44 54#define AHB_GIZMO_SDMMC4 0x48
54#define AHB_GIZMO_XIO 0x48 55#define AHB_GIZMO_XIO 0x4c
55#define AHB_GIZMO_BSEV 0x60 56#define AHB_GIZMO_BSEV 0x64
56#define AHB_GIZMO_BSEA 0x70 57#define AHB_GIZMO_BSEA 0x74
57#define AHB_GIZMO_NOR 0x74 58#define AHB_GIZMO_NOR 0x78
58#define AHB_GIZMO_USB2 0x78 59#define AHB_GIZMO_USB2 0x7c
59#define AHB_GIZMO_USB3 0x7c 60#define AHB_GIZMO_USB3 0x80
60#define IMMEDIATE BIT(18) 61#define IMMEDIATE BIT(18)
61 62
62#define AHB_GIZMO_SDMMC1 0x80 63#define AHB_GIZMO_SDMMC1 0x84
63#define AHB_GIZMO_SDMMC2 0x84 64#define AHB_GIZMO_SDMMC2 0x88
64#define AHB_GIZMO_SDMMC3 0x88 65#define AHB_GIZMO_SDMMC3 0x8c
65#define AHB_MEM_PREFETCH_CFG_X 0xd8 66#define AHB_MEM_PREFETCH_CFG_X 0xdc
66#define AHB_ARBITRATION_XBAR_CTRL 0xdc 67#define AHB_ARBITRATION_XBAR_CTRL 0xe0
67#define AHB_MEM_PREFETCH_CFG3 0xe0 68#define AHB_MEM_PREFETCH_CFG3 0xe4
68#define AHB_MEM_PREFETCH_CFG4 0xe4 69#define AHB_MEM_PREFETCH_CFG4 0xe8
69#define AHB_MEM_PREFETCH_CFG1 0xec 70#define AHB_MEM_PREFETCH_CFG1 0xf0
70#define AHB_MEM_PREFETCH_CFG2 0xf0 71#define AHB_MEM_PREFETCH_CFG2 0xf4
71#define PREFETCH_ENB BIT(31) 72#define PREFETCH_ENB BIT(31)
72#define MST_ID(x) (((x) & 0x1f) << 26) 73#define MST_ID(x) (((x) & 0x1f) << 26)
73#define AHBDMA_MST_ID MST_ID(5) 74#define AHBDMA_MST_ID MST_ID(5)
@@ -77,7 +78,7 @@
77#define ADDR_BNDRY(x) (((x) & 0xf) << 21) 78#define ADDR_BNDRY(x) (((x) & 0xf) << 21)
78#define INACTIVITY_TIMEOUT(x) (((x) & 0xffff) << 0) 79#define INACTIVITY_TIMEOUT(x) (((x) & 0xffff) << 0)
79 80
80#define AHB_ARBITRATION_AHB_MEM_WRQUE_MST_ID 0xf8 81#define AHB_ARBITRATION_AHB_MEM_WRQUE_MST_ID 0xfc
81 82
82#define AHB_ARBITRATION_XBAR_CTRL_SMMU_INIT_DONE BIT(17) 83#define AHB_ARBITRATION_XBAR_CTRL_SMMU_INIT_DONE BIT(17)
83 84
@@ -123,12 +124,12 @@ struct tegra_ahb {
123 124
124static inline u32 gizmo_readl(struct tegra_ahb *ahb, u32 offset) 125static inline u32 gizmo_readl(struct tegra_ahb *ahb, u32 offset)
125{ 126{
126 return readl(ahb->regs + offset); 127 return readl(ahb->regs - 4 + offset);
127} 128}
128 129
129static inline void gizmo_writel(struct tegra_ahb *ahb, u32 value, u32 offset) 130static inline void gizmo_writel(struct tegra_ahb *ahb, u32 value, u32 offset)
130{ 131{
131 writel(value, ahb->regs + offset); 132 writel(value, ahb->regs - 4 + offset);
132} 133}
133 134
134#ifdef CONFIG_TEGRA_IOMMU_SMMU 135#ifdef CONFIG_TEGRA_IOMMU_SMMU