Merge branch '2019-08-02-autoboot-cleanup'
[platform/kernel/u-boot.git] / include / configs / gazerbeam.h
1 /*
2  * (C) Copyright 2015
3  * Dirk Eibach,  Guntermann & Drunck GmbH, eibach@gdsys.de
4  *
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef __CONFIG_H
10 #define __CONFIG_H
11
12 /*
13  * DDR Setup
14  */
15 #define CONFIG_SYS_SDRAM_BASE           0x00000000 /* DDR is system memory */
16 /* TODO: Check: Can this be unified with CONFIG_SYS_SDRAM_BASE? */
17 #define CONFIG_SYS_DDR_SDRAM_BASE       CONFIG_SYS_SDRAM_BASE
18
19 /*
20  * Memory test
21  * TODO: Migrate!
22  */
23 #define CONFIG_SYS_MEMTEST_START        0x00001000 /* memtest region */
24 #define CONFIG_SYS_MEMTEST_END          0x07e00000
25
26 /*
27  * The reserved memory
28  */
29 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
30
31 #define CONFIG_SYS_MONITOR_LEN  (512 * 1024) /* Reserve 512 kB for Mon */
32 #define CONFIG_SYS_MALLOC_LEN   (512 * 1024) /* Reserved for malloc */
33
34 /*
35  * Initial RAM Base Address Setup
36  */
37 #define CONFIG_SYS_INIT_RAM_LOCK
38 #define CONFIG_SYS_INIT_RAM_ADDR        0xE6000000 /* Initial RAM address */
39 #define CONFIG_SYS_INIT_RAM_SIZE        0x1000 /* Size of used area in RAM */
40 #define CONFIG_SYS_GBL_DATA_OFFSET      \
41         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
42
43 /*
44  * FLASH on the Local Bus
45  */
46 #define CONFIG_SYS_FLASH_BASE           0xFE000000 /* FLASH base address */
47 #define CONFIG_SYS_FLASH_SIZE           8 /* FLASH size is up to 8M */
48
49 #define CONFIG_SYS_MAX_FLASH_BANKS      1 /* number of banks */
50 #define CONFIG_SYS_MAX_FLASH_SECT       135
51
52 #define CONFIG_SYS_BAUDRATE_TABLE  \
53         {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
54
55 /*
56  * Environment
57  */
58 #define CONFIG_ENV_ADDR         (CONFIG_SYS_MONITOR_BASE + \
59                                  CONFIG_SYS_MONITOR_LEN)
60 #define CONFIG_ENV_SECT_SIZE    0x10000 /* 64K(one sector) for env */
61 #define CONFIG_ENV_SIZE         0x2000
62 #define CONFIG_ENV_ADDR_REDUND  (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
63 #define CONFIG_ENV_SIZE_REDUND  CONFIG_ENV_SIZE
64
65 #define CONFIG_LOADS_ECHO               /* echo on for serial download */
66 #define CONFIG_SYS_LOADS_BAUD_CHANGE    /* allow baudrate change */
67
68 /*
69  * Miscellaneous configurable options
70  */
71 #define CONFIG_SYS_LOAD_ADDR            0x2000000 /* default load address */
72 #define CONFIG_SYS_HZ           1000    /* decrementer freq: 1ms ticks */
73
74 #define CONFIG_SYS_CBSIZE       1024 /* Console I/O Buffer Size */
75
76 /* Print Buffer Size */
77 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
78 #define CONFIG_SYS_MAXARGS      16      /* max number of command args */
79 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE
80
81 /*
82  * For booting Linux, the board info and command line data
83  * have to be in the first 256 MB of memory, since this is
84  * the maximum mapped by the Linux kernel during initialization.
85  */
86 #define CONFIG_SYS_BOOTMAPSZ    (256 << 20) /* Initial Memory map for Linux */
87
88 /*
89  * Environment Configuration
90  */
91 #define CONFIG_ENV_OVERWRITE
92
93 #define CONFIG_HAS_ETH0
94 #define CONFIG_HAS_ETH1
95
96 #define CONFIG_LOADADDR 800000  /* default location for tftp and bootm */
97
98 /* TODO: Turn into string option and migrate to Kconfig */
99 #define CONFIG_HOSTNAME         "gazerbeam"
100 #define CONFIG_ROOTPATH         "/opt/nfsroot"
101 #define CONFIG_BOOTFILE         "uImage"
102
103 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
104         "netdev=eth0\0"                                                 \
105         "consoledev=ttyS1\0"                                            \
106         "u-boot=u-boot.bin\0"                                           \
107         "kernel_addr=1000000\0"                                 \
108         "fdt_addr=C00000\0"                                             \
109         "fdtfile=hrcon.dtb\0"                           \
110         "load=tftp ${loadaddr} ${u-boot}\0"                             \
111         "update=protect off " __stringify(CONFIG_SYS_MONITOR_BASE)      \
112                 " +${filesize};era " __stringify(CONFIG_SYS_MONITOR_BASE)\
113                 " +${filesize};cp.b ${fileaddr} "                       \
114                 __stringify(CONFIG_SYS_MONITOR_BASE) " ${filesize}\0"   \
115         "upd=run load update\0"                                         \
116
117 #define CONFIG_NFSBOOTCOMMAND                                           \
118         "setenv bootargs root=/dev/nfs rw "                             \
119         "nfsroot=$serverip:$rootpath "                                  \
120         "ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
121         "console=$consoledev,$baudrate $othbootargs;"                   \
122         "tftp ${kernel_addr} $bootfile;"                                \
123         "tftp ${fdt_addr} $fdtfile;"                                    \
124         "bootm ${kernel_addr} - ${fdt_addr}"
125
126 #define CONFIG_MMCBOOTCOMMAND                                           \
127         "setenv bootargs root=/dev/mmcblk0p3 rw rootwait "              \
128         "console=$consoledev,$baudrate $othbootargs;"                   \
129         "ext2load mmc 0:2 ${kernel_addr} $bootfile;"                    \
130         "ext2load mmc 0:2 ${fdt_addr} $fdtfile;"                        \
131         "bootm ${kernel_addr} - ${fdt_addr}"
132
133 #define CONFIG_BOOTCOMMAND              CONFIG_MMCBOOTCOMMAND
134
135 #endif  /* __CONFIG_H */