1
2
3
4
5
6
7
8
9#include <linux/io.h>
10
11#include "../init.h"
12#include "bcu-regs.h"
13
14#define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x11111111 : 0x11111111 << (x))
15
16void uniphier_sld3_bcu_init(const struct uniphier_board_data *bd)
17{
18 int shift;
19
20 writel(0x11111111, BCSCR2);
21 writel(0x11111111, BCSCR3);
22 writel(0x11111111, BCSCR4);
23
24
25
26
27
28 writel(0x24440000, BCSCR5);
29
30
31 shift = bd->dram_ch[0].size / 0x04000000 * 4;
32 writel(ch(shift), BCIPPCCHR2);
33
34 shift -= 32;
35 writel(ch(shift), BCIPPCCHR3);
36
37 shift -= 32;
38 writel(ch(shift), BCIPPCCHR4);
39}
40