2 * Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
4 * This file contains some of the common configs/defines
5 * for boards based on Qualcomm/Atheros QCA9xxx WiSoCs
7 * SPDX-License-Identifier: GPL-2.0
10 #ifndef __QCA9K_COMMON_H
11 #define __QCA9K_COMMON_H
18 /* Wait only 1 second by default */
19 #if !defined(CONFIG_BOOTDELAY)
20 #define CONFIG_BOOTDELAY 1
23 #if !defined(CONFIG_MENUPROMPT)
24 #define CONFIG_MENUPROMPT "Hit any key to stop booting: %2d "
27 /* Allow to disable console output, don't display console info */
28 #define CONFIG_SILENT_CONSOLE 1
29 #define CFG_CONSOLE_INFO_QUIET 1
31 /* Use 115200 as default baudrate */
32 #if !defined(CONFIG_BAUDRATE)
33 #define CONFIG_BAUDRATE 115200
36 /* CLI parser, prompt */
37 #define CFG_HUSH_PARSER 1
38 #define CFG_LONGHELP 1
39 #define CFG_PROMPT "u-boot> "
40 #define CFG_PROMPT_HUSH_PS2 "> "
42 #define CFG_CBSIZE 1024
43 #define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
44 #define CFG_MAXARGS 16
45 #define CFG_MALLOC_LEN (512 * 1024)
46 #define CFG_BOOTPARAMS_LEN (512 * 1024)
48 /* RAM memory start address */
49 #define CFG_SDRAM_BASE 0x80000000
51 /* Ethernet related */
52 #define CONFIG_NET_MULTI 1
53 #define CFG_MII0_RMII 1
54 #define CFG_RX_ETH_BUFFER 16
57 #define CFG_ALT_MEMTEST 1
58 #define CFG_MEMTEST_START (CFG_SDRAM_BASE + (2 * 1024 * 1024))
59 #define CFG_MEMTEST_END (CFG_SDRAM_BASE + bd->bi_memsize \
60 - (4 * 1024 * 1024) - 1)
63 #define CFG_MAX_FLASH_BANKS 1
64 #define CFG_MAX_FLASH_SECT 4096
65 #define CFG_FLASH_BASE 0x9F000000
67 #if defined(COMPRESSED_UBOOT)
68 #define BOOTSTRAP_TEXT_BASE CFG_FLASH_BASE
69 #define BOOTSTRAP_CFG_MONITOR_BASE BOOTSTRAP_TEXT_BASE
73 #define CFG_BOOTM_LEN (16 << 20)
75 /* The following #defines are needed to get flash environment right */
76 #define CFG_MONITOR_BASE TEXT_BASE
77 #define CFG_MONITOR_LEN (192 << 10)
79 /* Default device and server IPs, net console */
80 #define CONFIG_IPADDR 192.168.1.1
81 #define CONFIG_SERVERIP 192.168.1.2
82 #define CONFIG_NETCONSOLE 1
83 #define CONFIG_NETCONSOLE_PORT 6666
85 /* Other environment variables */
86 #define CONFIG_BOOTFILE firmware.bin
87 #define CONFIG_LOADADDR 0x80800000
89 /* This is needed for time calculation */
90 #define CFG_HZ (bd->bi_cfg_hz)
93 #define CFG_INIT_SP_OFFSET 0x1000
94 #define CFG_CACHELINE_SIZE 32
95 #define CFG_DCACHE_SIZE (32 * 1024)
96 #define CFG_ICACHE_SIZE (64 * 1024)
98 /* Environment related */
99 #define CFG_ENV_IS_IN_FLASH 1
100 #undef CFG_ENV_IS_NOWHERE
102 /* Available commands */
103 #define CONFIG_CMD_MEMORY
104 #define CONFIG_CMD_DHCP
105 #define CONFIG_CMD_PING
106 #define CONFIG_CMD_FLASH
107 #define CONFIG_CMD_NET
108 #define CONFIG_CMD_RUN
109 #define CONFIG_CMD_DATE
110 #define CONFIG_CMD_SNTP
111 #define CONFIG_CMD_ECHO
112 #define CONFIG_CMD_BOOTD
113 #define CONFIG_CMD_ITEST
114 #define CONFIG_CMD_IMI
115 #define CONFIG_CMD_ENV
116 #define CONFIG_CMD_LOADB
117 #define CONFIG_CMD_BUTTON
118 #define CONFIG_CMD_SLEEP
120 /* Simple upgrade scripts in environment */
121 #define CONFIG_UPG_SCRIPTS_UBOOT
122 #define CONFIG_UPG_SCRIPTS_FW
124 /* For HTTP based recovery */
125 /* TODO: move it to httpd related header */
126 #define WEBFAILSAFE_PROGRESS_START 0
127 #define WEBFAILSAFE_PROGRESS_TIMEOUT 1
128 #define WEBFAILSAFE_PROGRESS_UPLOAD_READY 2
129 #define WEBFAILSAFE_PROGRESS_UPGRADE_READY 3
130 #define WEBFAILSAFE_PROGRESS_UPGRADE_FAILED 4
132 #define WEBFAILSAFE_UPGRADE_TYPE_FIRMWARE 0
133 #define WEBFAILSAFE_UPGRADE_TYPE_UBOOT 1
134 #define WEBFAILSAFE_UPGRADE_TYPE_ART 2
136 #define WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES (64 * 1024)
138 /* Some helper macros */
139 /* TODO: move them out from here */
140 #define XMK_STR(x) #x
141 #define MK_STR(x) XMK_STR(x)
143 #endif /* __QCA9K_COMMON_H */