blob: 9b32149b0ea3946d0b1595261acc98c9bb731880 [file] [log] [blame]
Stephen Warren0e012c32012-08-05 16:07:22 +00001/*
2 * (C) Copyright 2012 Stephen Warren
3 *
Stephen Warren29e494c2015-02-16 12:16:13 -07004 * SPDX-License-Identifier: GPL-2.0
Stephen Warren0e012c32012-08-05 16:07:22 +00005 */
6
7#ifndef __CONFIG_H
8#define __CONFIG_H
9
Alexey Brodkin267d8e22014-02-26 17:47:58 +040010#include <linux/sizes.h>
Stephen Warren0e012c32012-08-05 16:07:22 +000011
12/* Architecture, CPU, etc.*/
Stephen Warren02402f62014-06-13 23:37:49 -060013#define CONFIG_SYS_GENERIC_BOARD
Stephen Warren0e012c32012-08-05 16:07:22 +000014#define CONFIG_BCM2835
15#define CONFIG_ARCH_CPU_INIT
Stephen Warren12a8a7d2013-01-29 16:37:39 +000016#define CONFIG_SYS_DCACHE_OFF
Stephen Warren0e012c32012-08-05 16:07:22 +000017/*
18 * 2835 is a SKU in a series for which the 2708 is the first or primary SoC,
19 * so 2708 has historically been used rather than a dedicated 2835 ID.
20 */
21#define CONFIG_MACH_TYPE MACH_TYPE_BCM2708
22
Stephen Warren0e012c32012-08-05 16:07:22 +000023/* Memory layout */
24#define CONFIG_NR_DRAM_BANKS 1
25#define CONFIG_SYS_SDRAM_BASE 0x00000000
26#define CONFIG_SYS_TEXT_BASE 0x00008000
27#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
28/*
29 * The board really has 256M. However, the VC (VideoCore co-processor) shares
30 * the RAM, and uses a configurable portion at the top. We tell U-Boot that a
31 * smaller amount of RAM is present in order to avoid stomping on the area
32 * the VC uses.
33 */
34#define CONFIG_SYS_SDRAM_SIZE SZ_128M
35#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + \
36 CONFIG_SYS_SDRAM_SIZE - \
37 GENERATED_GBL_DATA_SIZE)
38#define CONFIG_SYS_MALLOC_LEN SZ_4M
39#define CONFIG_SYS_MEMTEST_START 0x00100000
40#define CONFIG_SYS_MEMTEST_END 0x00200000
Stephen Warrenc4ab9712013-01-29 16:37:42 +000041#define CONFIG_LOADADDR 0x00200000
Stephen Warren0e012c32012-08-05 16:07:22 +000042
43/* Flash */
44#define CONFIG_SYS_NO_FLASH
45
46/* Devices */
47/* GPIO */
48#define CONFIG_BCM2835_GPIO
Stephen Warren4ecd4982013-01-29 16:37:40 +000049/* LCD */
50#define CONFIG_LCD
Stephen Warrenaa44d532013-05-27 18:31:18 +000051#define CONFIG_LCD_DT_SIMPLEFB
Stephen Warren4ecd4982013-01-29 16:37:40 +000052#define LCD_BPP LCD_COLOR16
53/*
54 * Prevent allocation of RAM for FB; the real FB address is queried
55 * dynamically from the VideoCore co-processor, and comes from RAM
56 * not owned by the ARM CPU.
57 */
58#define CONFIG_FB_ADDR 0
59#define CONFIG_VIDEO_BCM2835
60#define CONFIG_SYS_WHITE_ON_BLACK
Stephen Warren0e012c32012-08-05 16:07:22 +000061
Stephen Warrenc4ab9712013-01-29 16:37:42 +000062/* SD/MMC configuration */
63#define CONFIG_GENERIC_MMC
64#define CONFIG_MMC
65#define CONFIG_SDHCI
66#define CONFIG_MMC_SDHCI_IO_ACCESSORS
67#define CONFIG_BCM2835_SDHCI
68
Stephen Warren6d392c52014-09-26 20:51:40 -060069#define CONFIG_CMD_USB
70#ifdef CONFIG_CMD_USB
71#define CONFIG_USB_DWC2
72#define CONFIG_USB_DWC2_REG_ADDR 0x20980000
73#define CONFIG_USB_STORAGE
74#define CONFIG_USB_HOST_ETHER
75#define CONFIG_USB_ETHER_SMSC95XX
76#define CONFIG_MISC_INIT_R
77#endif
78
Stephen Warren0e012c32012-08-05 16:07:22 +000079/* Console UART */
Simon Glassf52cada2014-11-24 21:36:34 -070080#define CONFIG_PL01X_SERIAL
Stephen Warren0e012c32012-08-05 16:07:22 +000081#define CONFIG_CONS_INDEX 0
82#define CONFIG_BAUDRATE 115200
83
84/* Console configuration */
85#define CONFIG_SYS_CBSIZE 1024
86#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
87 sizeof(CONFIG_SYS_PROMPT) + 16)
88
89/* Environment */
90#define CONFIG_ENV_SIZE SZ_16K
Stephen Warren2f9e9f22014-11-19 20:41:04 -070091#define CONFIG_ENV_IS_IN_FAT
92#define FAT_ENV_INTERFACE "mmc"
93#define FAT_ENV_DEVICE_AND_PART "0:1"
94#define FAT_ENV_FILE "uboot.env"
95#define CONFIG_FAT_WRITE
Stephen Warrenc4ab9712013-01-29 16:37:42 +000096#define CONFIG_ENV_VARS_UBOOT_CONFIG
Stephen Warren0e012c32012-08-05 16:07:22 +000097#define CONFIG_SYS_LOAD_ADDR 0x1000000
Stephen Warren4ecd4982013-01-29 16:37:40 +000098#define CONFIG_CONSOLE_MUX
99#define CONFIG_SYS_CONSOLE_IS_IN_ENV
Stephen Warrendcc73642014-02-05 20:49:22 -0700100
Stephen Warrenaafd4fc2014-07-30 16:37:16 -0600101/* Shell */
102#define CONFIG_SYS_MAXARGS 8
103#define CONFIG_SYS_PROMPT "U-Boot> "
104#define CONFIG_COMMAND_HISTORY
105
106/* Commands */
107#include <config_cmd_default.h>
108#define CONFIG_CMD_GPIO
109#define CONFIG_CMD_MMC
110#define CONFIG_PARTITION_UUIDS
111#define CONFIG_CMD_PART
112
113/* Device tree support */
114#define CONFIG_OF_BOARD_SETUP
115/* ATAGs support for bootm/bootz */
116#define CONFIG_SETUP_MEMORY_TAGS
117#define CONFIG_CMDLINE_TAG
118#define CONFIG_INITRD_TAG
119
120#include <config_distro_defaults.h>
121
122/* Some things don't make sense on this HW or yet */
123#undef CONFIG_CMD_FPGA
Stephen Warrenaafd4fc2014-07-30 16:37:16 -0600124
125/* Environment */
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700126#define ENV_DEVICE_SETTINGS \
127 "stdin=serial,lcd\0" \
128 "stdout=serial,lcd\0" \
129 "stderr=serial,lcd\0"
130
Stephen Warrenc4ab9712013-01-29 16:37:42 +0000131/*
132 * Memory layout for where various images get loaded by boot scripts:
133 *
134 * scriptaddr can be pretty much anywhere that doesn't conflict with something
135 * else. Put it low in memory to avoid conflicts.
136 *
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700137 * pxefile_addr_r can be pretty much anywhere that doesn't conflict with
138 * something else. Put it low in memory to avoid conflicts.
139 *
Stephen Warrenc4ab9712013-01-29 16:37:42 +0000140 * kernel_addr_r must be within the first 128M of RAM in order for the
141 * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
142 * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
143 * should not overlap that area, or the kernel will have to copy itself
144 * somewhere else before decompression. Similarly, the address of any other
145 * data passed to the kernel shouldn't overlap the start of RAM. Pushing
146 * this up to 16M allows for a sizable kernel to be decompressed below the
147 * compressed load address.
148 *
149 * fdt_addr_r simply shouldn't overlap anything else. Choosing 32M allows for
150 * the compressed kernel to be up to 16M too.
151 *
152 * ramdisk_addr_r simply shouldn't overlap anything else. Choosing 33M allows
153 * for the FDT/DTB to be up to 1M, which is hopefully plenty.
154 */
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700155#define ENV_MEM_LAYOUT_SETTINGS \
Stephen Warrenc4ab9712013-01-29 16:37:42 +0000156 "scriptaddr=0x00000000\0" \
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700157 "pxefile_addr_r=0x00100000\0" \
Stephen Warrenc4ab9712013-01-29 16:37:42 +0000158 "kernel_addr_r=0x01000000\0" \
159 "fdt_addr_r=0x02000000\0" \
160 "ramdisk_addr_r=0x02100000\0" \
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700161
Stephen Warrenaafd4fc2014-07-30 16:37:16 -0600162#define BOOT_TARGET_DEVICES(func) \
Stephen Warren6d392c52014-09-26 20:51:40 -0600163 func(MMC, mmc, 0) \
164 func(USB, usb, 0) \
165 func(PXE, pxe, na) \
166 func(DHCP, dhcp, na)
Stephen Warrenaafd4fc2014-07-30 16:37:16 -0600167#include <config_distro_bootcmd.h>
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700168
169#define CONFIG_EXTRA_ENV_SETTINGS \
170 ENV_DEVICE_SETTINGS \
171 ENV_MEM_LAYOUT_SETTINGS \
Stephen Warrenaafd4fc2014-07-30 16:37:16 -0600172 BOOTENV
Stephen Warren40fa0bf2014-02-13 20:44:07 -0700173
174#define CONFIG_BOOTDELAY 2
Stephen Warren0e012c32012-08-05 16:07:22 +0000175
Stephen Warren0e012c32012-08-05 16:07:22 +0000176#endif