2 * (C) Copyright 2007-2012
3 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
4 * Berg Xing <bergxing@allwinnertech.com>
5 * Tom Cubie <tangliang@allwinnertech.com>
7 * Sunxi platform dram register definition.
9 * SPDX-License-Identifier: GPL-2.0+
16 #include <linux/types.h>
18 /* dram regs definition */
19 #if defined(CONFIG_MACH_SUN6I)
20 #include <asm/arch/dram_sun6i.h>
22 #include <asm/arch/dram_sun4i.h>
25 unsigned long sunxi_dram_init(void);
28 * Wait up to 1s for value to be set in given part of reg.
30 static inline void mctl_await_completion(u32 *reg, u32 mask, u32 val)
32 unsigned long tmo = timer_get_us() + 1000000;
34 while ((readl(reg) & mask) != val) {
35 if (timer_get_us() > tmo)
36 panic("Timeout initialising DRAM\n");
40 #endif /* _SUNXI_DRAM_H */