1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
| /*
| * WORK Microwave work_92105 board support
| *
| * (C) Copyright 2014 DENX Software Engineering GmbH
| * Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr>
| *
| * SPDX-License-Identifier: GPL-2.0+
| */
|
| #include <common.h>
| #include <asm/io.h>
| #include <asm/arch/sys_proto.h>
| #include <asm/arch/cpu.h>
| #include <asm/arch/emc.h>
| #include <asm/gpio.h>
| #include <spl.h>
| #include "work_92105_display.h"
|
| struct emc_dram_settings dram_64mb = {
| .cmddelay = 0x0001C000,
| .config0 = 0x00005682,
| .rascas0 = 0x00000302,
| .rdconfig = 0x00000011,
| .trp = 52631578,
| .tras = 20833333,
| .tsrex = 12500000,
| .twr = 66666666,
| .trc = 13888888,
| .trfc = 10256410,
| .txsr = 12500000,
| .trrd = 1,
| .tmrd = 1,
| .tcdlr = 0,
| .refresh = 128000,
| .mode = 0x00018000,
| .emode = 0x02000000
| };
|
| const struct emc_dram_settings dram_128mb = {
| .cmddelay = 0x0001C000,
| .config0 = 0x00005882,
| .rascas0 = 0x00000302,
| .rdconfig = 0x00000011,
| .trp = 52631578,
| .tras = 22222222,
| .tsrex = 8333333,
| .twr = 66666666,
| .trc = 14814814,
| .trfc = 10256410,
| .txsr = 8333333,
| .trrd = 1,
| .tmrd = 1,
| .tcdlr = 0,
| .refresh = 128000,
| .mode = 0x00030000,
| .emode = 0x02000000
| };
|
| void spl_board_init(void)
| {
| /* initialize serial port for console */
| lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
| /* initialize console */
| preloader_console_init();
| /* init DDR and NAND to chainload U-Boot */
| ddr_init(&dram_128mb);
| /*
| * If this is actually a 64MB module, then the highest column
| * bit in any address will be ignored, and thus address 0x80000000
| * should be mirrored at address 0x80000800. Test this.
| */
| writel(0x31415926, 0x80000000); /* write Pi at 0x80000000 */
| writel(0x16180339, 0x80000800); /* write Phi at 0x80000800 */
| if (readl(0x80000000) == 0x16180339) /* check 0x80000000 */ {
| /* actually 64MB mirrored: reconfigure controller */
| ddr_init(&dram_64mb);
| }
| /* initialize NAND controller to load U-Boot from NAND */
| lpc32xx_mlc_nand_init();
| }
|
| u32 spl_boot_device(void)
| {
| return BOOT_DEVICE_NAND;
| }
|
|