Skip to content

Commit 049e4b3

Browse files
Paul WalmsleyRussell King
authored andcommitted
ARM: 8333/1: amba: tegra-ahb: fix register offsets in the macros
amba: tegra-ahb: fix register offsets in the macros From a hardware SoC integration point of view, the offsets of the Tegra AHB registers that are currently defined in tegra-ahb.c macros are all off by four bytes. Similarly, the starting address of this IP block in our existing DT files is also off by four bytes. Since we attempt to make old DT files forward-compatible with newer kernels, we cannot fix the IP block base address in old DT data. However, we can fix the offsets in the driver so that they are correct with respect to the hardware, which is what this patch does. And a subsequent patch will allow the offset to be removed for DT 'compatible' strings used in future DT files for newer Tegra chips that the kernel does not yet support. Signed-off-by: Paul Walmsley <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Hiroshi DOYU <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Thierry Reding <[email protected]> Cc: [email protected] Acked-by: Stephen Warren <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 7c07005 commit 049e4b3

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

drivers/amba/tegra-ahb.c

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,50 @@
2525
#include <linux/module.h>
2626
#include <linux/platform_device.h>
2727
#include <linux/io.h>
28+
#include <linux/of.h>
2829

2930
#include <soc/tegra/ahb.h>
3031

3132
#define DRV_NAME "tegra-ahb"
3233

33-
#define AHB_ARBITRATION_DISABLE 0x00
34-
#define AHB_ARBITRATION_PRIORITY_CTRL 0x04
34+
#define AHB_ARBITRATION_DISABLE 0x04
35+
#define AHB_ARBITRATION_PRIORITY_CTRL 0x08
3536
#define AHB_PRIORITY_WEIGHT(x) (((x) & 0x7) << 29)
3637
#define PRIORITY_SELECT_USB BIT(6)
3738
#define PRIORITY_SELECT_USB2 BIT(18)
3839
#define PRIORITY_SELECT_USB3 BIT(17)
3940

40-
#define AHB_GIZMO_AHB_MEM 0x0c
41+
#define AHB_GIZMO_AHB_MEM 0x10
4142
#define ENB_FAST_REARBITRATE BIT(2)
4243
#define DONT_SPLIT_AHB_WR BIT(7)
4344

44-
#define AHB_GIZMO_APB_DMA 0x10
45-
#define AHB_GIZMO_IDE 0x18
46-
#define AHB_GIZMO_USB 0x1c
47-
#define AHB_GIZMO_AHB_XBAR_BRIDGE 0x20
48-
#define AHB_GIZMO_CPU_AHB_BRIDGE 0x24
49-
#define AHB_GIZMO_COP_AHB_BRIDGE 0x28
50-
#define AHB_GIZMO_XBAR_APB_CTLR 0x2c
51-
#define AHB_GIZMO_VCP_AHB_BRIDGE 0x30
52-
#define AHB_GIZMO_NAND 0x3c
53-
#define AHB_GIZMO_SDMMC4 0x44
54-
#define AHB_GIZMO_XIO 0x48
55-
#define AHB_GIZMO_BSEV 0x60
56-
#define AHB_GIZMO_BSEA 0x70
57-
#define AHB_GIZMO_NOR 0x74
58-
#define AHB_GIZMO_USB2 0x78
59-
#define AHB_GIZMO_USB3 0x7c
45+
#define AHB_GIZMO_APB_DMA 0x14
46+
#define AHB_GIZMO_IDE 0x1c
47+
#define AHB_GIZMO_USB 0x20
48+
#define AHB_GIZMO_AHB_XBAR_BRIDGE 0x24
49+
#define AHB_GIZMO_CPU_AHB_BRIDGE 0x28
50+
#define AHB_GIZMO_COP_AHB_BRIDGE 0x2c
51+
#define AHB_GIZMO_XBAR_APB_CTLR 0x30
52+
#define AHB_GIZMO_VCP_AHB_BRIDGE 0x34
53+
#define AHB_GIZMO_NAND 0x40
54+
#define AHB_GIZMO_SDMMC4 0x48
55+
#define AHB_GIZMO_XIO 0x4c
56+
#define AHB_GIZMO_BSEV 0x64
57+
#define AHB_GIZMO_BSEA 0x74
58+
#define AHB_GIZMO_NOR 0x78
59+
#define AHB_GIZMO_USB2 0x7c
60+
#define AHB_GIZMO_USB3 0x80
6061
#define IMMEDIATE BIT(18)
6162

62-
#define AHB_GIZMO_SDMMC1 0x80
63-
#define AHB_GIZMO_SDMMC2 0x84
64-
#define AHB_GIZMO_SDMMC3 0x88
65-
#define AHB_MEM_PREFETCH_CFG_X 0xd8
66-
#define AHB_ARBITRATION_XBAR_CTRL 0xdc
67-
#define AHB_MEM_PREFETCH_CFG3 0xe0
68-
#define AHB_MEM_PREFETCH_CFG4 0xe4
69-
#define AHB_MEM_PREFETCH_CFG1 0xec
70-
#define AHB_MEM_PREFETCH_CFG2 0xf0
63+
#define AHB_GIZMO_SDMMC1 0x84
64+
#define AHB_GIZMO_SDMMC2 0x88
65+
#define AHB_GIZMO_SDMMC3 0x8c
66+
#define AHB_MEM_PREFETCH_CFG_X 0xdc
67+
#define AHB_ARBITRATION_XBAR_CTRL 0xe0
68+
#define AHB_MEM_PREFETCH_CFG3 0xe4
69+
#define AHB_MEM_PREFETCH_CFG4 0xe8
70+
#define AHB_MEM_PREFETCH_CFG1 0xf0
71+
#define AHB_MEM_PREFETCH_CFG2 0xf4
7172
#define PREFETCH_ENB BIT(31)
7273
#define MST_ID(x) (((x) & 0x1f) << 26)
7374
#define AHBDMA_MST_ID MST_ID(5)
@@ -77,7 +78,7 @@
7778
#define ADDR_BNDRY(x) (((x) & 0xf) << 21)
7879
#define INACTIVITY_TIMEOUT(x) (((x) & 0xffff) << 0)
7980

80-
#define AHB_ARBITRATION_AHB_MEM_WRQUE_MST_ID 0xf8
81+
#define AHB_ARBITRATION_AHB_MEM_WRQUE_MST_ID 0xfc
8182

8283
#define AHB_ARBITRATION_XBAR_CTRL_SMMU_INIT_DONE BIT(17)
8384

@@ -123,12 +124,12 @@ struct tegra_ahb {
123124

124125
static inline u32 gizmo_readl(struct tegra_ahb *ahb, u32 offset)
125126
{
126-
return readl(ahb->regs + offset);
127+
return readl(ahb->regs - 4 + offset);
127128
}
128129

129130
static inline void gizmo_writel(struct tegra_ahb *ahb, u32 value, u32 offset)
130131
{
131-
writel(value, ahb->regs + offset);
132+
writel(value, ahb->regs - 4 + offset);
132133
}
133134

134135
#ifdef CONFIG_TEGRA_IOMMU_SMMU

0 commit comments

Comments
 (0)