1
2
3
4
5
6#include <common.h>
7#include <miiphy.h>
8#include <asm/io.h>
9#include <asm/arch/cpu.h>
10#include <asm/arch/soc.h>
11#include <linux/mbus.h>
12
13#include "../drivers/ddr/marvell/axp/ddr3_hw_training.h"
14#include "../arch/arm/mach-mvebu/serdes/axp/high_speed_env_spec.h"
15
16DECLARE_GLOBAL_DATA_PTR;
17
18
19#define DEV_CS0_BASE 0xe0000000
20#define DEV_CS1_BASE 0xe1000000
21#define DEV_CS2_BASE 0xe2000000
22#define DEV_CS3_BASE 0xe3000000
23
24
25MV_DRAM_MC_INIT ddr3_b0_maxbcm[MV_MAX_DDR3_STATIC_SIZE] = {
26 {0x00001400, 0x7301CC30},
27 {0x00001404, 0x30000820},
28 {0x00001408, 0x5515BAAB},
29 {0x0000140C, 0x38DA3F97},
30 {0x00001410, 0x20100005},
31 {0x00001414, 0x0000F3FF},
32 {0x00001418, 0x00000e00},
33 {0x0000141C, 0x00000672},
34 {0x00001420, 0x00000004},
35 {0x00001424, 0x0000F3FF},
36 {0x00001428, 0x0011A940},
37 {0x0000142C, 0x014C5134},
38 {0x0000147C, 0x0000D771},
39
40 {0x00001494, 0x00010000},
41 {0x0000149C, 0x00000001},
42 {0x000014A0, 0x00000001},
43 {0x000014A8, 0x00000101},
44
45
46 {0x000014C0, 0x192424C9},
47 {0x000014C4, 0xAAA24C9},
48
49
50
51
52
53 {0x000200e8, 0x3FFF0E01},
54 {0x00020184, 0x3FFFFFE0},
55
56 {0x0001504, 0x3FFFFFE1},
57 {0x000150C, 0x00000000},
58 {0x0001514, 0x00000000},
59 {0x000151C, 0x00000000},
60
61 {0x0020220, 0x00000007},
62
63 {0x00001538, 0x0000000B},
64 {0x0000153C, 0x0000000B},
65
66 {0x000015D0, 0x00000670},
67 {0x000015D4, 0x00000044},
68 {0x000015D8, 0x00000018},
69 {0x000015DC, 0x00000000},
70 {0x000015E0, 0x00000001},
71 {0x000015E4, 0x00203c18},
72 {0x000015EC, 0xF800A225},
73
74 {0x0, 0x0}
75};
76
77MV_DRAM_MODES maxbcm_ddr_modes[MV_DDR3_MODES_NUMBER] = {
78 {"maxbcm_1600-800", 0xB, 0x5, 0x0, A0, ddr3_b0_maxbcm, NULL},
79};
80
81extern MV_SERDES_CHANGE_M_PHY serdes_change_m_phy[];
82
83
84MV_BIN_SERDES_CFG maxbcm_serdes_cfg[] = {
85 { MV_PEX_ROOT_COMPLEX, 0x20011111, 0x00000000,
86 { PEX_BUS_MODE_X1, PEX_BUS_MODE_X1, PEX_BUS_DISABLED,
87 PEX_BUS_DISABLED },
88 0x1f, serdes_change_m_phy
89 }
90};
91
92MV_DRAM_MODES *ddr3_get_static_ddr_mode(void)
93{
94
95 return &maxbcm_ddr_modes[0];
96}
97
98MV_BIN_SERDES_CFG *board_serdes_cfg_get(void)
99{
100 return &maxbcm_serdes_cfg[0];
101}
102
103int board_early_init_f(void)
104{
105
106
107
108
109
110
111
112
113 mbus_dt_setup_win(&mbus_state, DEV_CS0_BASE, 16 << 20,
114 CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS0);
115 mbus_dt_setup_win(&mbus_state, DEV_CS1_BASE, 16 << 20,
116 CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS1);
117 mbus_dt_setup_win(&mbus_state, DEV_CS2_BASE, 16 << 20,
118 CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS2);
119 mbus_dt_setup_win(&mbus_state, DEV_CS3_BASE, 16 << 20,
120 CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_DEV_CS3);
121
122 return 0;
123}
124
125int board_init(void)
126{
127
128 gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
129
130 return 0;
131}
132
133int checkboard(void)
134{
135 puts("Board: maxBCM\n");
136
137 return 0;
138}
139
140
141int board_phy_config(struct phy_device *phydev)
142{
143
144
145
146
147
148
149 printf("88E6185 Initialized\n");
150 return 0;
151}
152