Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2012 Stephen Warren |
| 3 | * |
Stephen Warren | 29e494c | 2015-02-16 12:16:13 -0700 | [diff] [blame^] | 4 | * SPDX-License-Identifier: GPL-2.0 |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_H |
| 8 | #define __CONFIG_H |
| 9 | |
Alexey Brodkin | 267d8e2 | 2014-02-26 17:47:58 +0400 | [diff] [blame] | 10 | #include <linux/sizes.h> |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 11 | |
| 12 | /* Architecture, CPU, etc.*/ |
Stephen Warren | 02402f6 | 2014-06-13 23:37:49 -0600 | [diff] [blame] | 13 | #define CONFIG_SYS_GENERIC_BOARD |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 14 | #define CONFIG_BCM2835 |
| 15 | #define CONFIG_ARCH_CPU_INIT |
Stephen Warren | 12a8a7d | 2013-01-29 16:37:39 +0000 | [diff] [blame] | 16 | #define CONFIG_SYS_DCACHE_OFF |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 17 | /* |
| 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 Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 23 | /* 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 Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 41 | #define CONFIG_LOADADDR 0x00200000 |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 42 | |
| 43 | /* Flash */ |
| 44 | #define CONFIG_SYS_NO_FLASH |
| 45 | |
| 46 | /* Devices */ |
| 47 | /* GPIO */ |
| 48 | #define CONFIG_BCM2835_GPIO |
Stephen Warren | 4ecd498 | 2013-01-29 16:37:40 +0000 | [diff] [blame] | 49 | /* LCD */ |
| 50 | #define CONFIG_LCD |
Stephen Warren | aa44d53 | 2013-05-27 18:31:18 +0000 | [diff] [blame] | 51 | #define CONFIG_LCD_DT_SIMPLEFB |
Stephen Warren | 4ecd498 | 2013-01-29 16:37:40 +0000 | [diff] [blame] | 52 | #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 Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 61 | |
Stephen Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 62 | /* 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 Warren | 6d392c5 | 2014-09-26 20:51:40 -0600 | [diff] [blame] | 69 | #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 Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 79 | /* Console UART */ |
Simon Glass | f52cada | 2014-11-24 21:36:34 -0700 | [diff] [blame] | 80 | #define CONFIG_PL01X_SERIAL |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 81 | #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 Warren | 2f9e9f2 | 2014-11-19 20:41:04 -0700 | [diff] [blame] | 91 | #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 Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 96 | #define CONFIG_ENV_VARS_UBOOT_CONFIG |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 97 | #define CONFIG_SYS_LOAD_ADDR 0x1000000 |
Stephen Warren | 4ecd498 | 2013-01-29 16:37:40 +0000 | [diff] [blame] | 98 | #define CONFIG_CONSOLE_MUX |
| 99 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
Stephen Warren | dcc7364 | 2014-02-05 20:49:22 -0700 | [diff] [blame] | 100 | |
Stephen Warren | aafd4fc | 2014-07-30 16:37:16 -0600 | [diff] [blame] | 101 | /* 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 Warren | aafd4fc | 2014-07-30 16:37:16 -0600 | [diff] [blame] | 124 | |
| 125 | /* Environment */ |
Stephen Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 126 | #define ENV_DEVICE_SETTINGS \ |
| 127 | "stdin=serial,lcd\0" \ |
| 128 | "stdout=serial,lcd\0" \ |
| 129 | "stderr=serial,lcd\0" |
| 130 | |
Stephen Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 131 | /* |
| 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 Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 137 | * 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 Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 140 | * 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 Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 155 | #define ENV_MEM_LAYOUT_SETTINGS \ |
Stephen Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 156 | "scriptaddr=0x00000000\0" \ |
Stephen Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 157 | "pxefile_addr_r=0x00100000\0" \ |
Stephen Warren | c4ab971 | 2013-01-29 16:37:42 +0000 | [diff] [blame] | 158 | "kernel_addr_r=0x01000000\0" \ |
| 159 | "fdt_addr_r=0x02000000\0" \ |
| 160 | "ramdisk_addr_r=0x02100000\0" \ |
Stephen Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 161 | |
Stephen Warren | aafd4fc | 2014-07-30 16:37:16 -0600 | [diff] [blame] | 162 | #define BOOT_TARGET_DEVICES(func) \ |
Stephen Warren | 6d392c5 | 2014-09-26 20:51:40 -0600 | [diff] [blame] | 163 | func(MMC, mmc, 0) \ |
| 164 | func(USB, usb, 0) \ |
| 165 | func(PXE, pxe, na) \ |
| 166 | func(DHCP, dhcp, na) |
Stephen Warren | aafd4fc | 2014-07-30 16:37:16 -0600 | [diff] [blame] | 167 | #include <config_distro_bootcmd.h> |
Stephen Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 168 | |
| 169 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 170 | ENV_DEVICE_SETTINGS \ |
| 171 | ENV_MEM_LAYOUT_SETTINGS \ |
Stephen Warren | aafd4fc | 2014-07-30 16:37:16 -0600 | [diff] [blame] | 172 | BOOTENV |
Stephen Warren | 40fa0bf | 2014-02-13 20:44:07 -0700 | [diff] [blame] | 173 | |
| 174 | #define CONFIG_BOOTDELAY 2 |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 175 | |
Stephen Warren | 0e012c3 | 2012-08-05 16:07:22 +0000 | [diff] [blame] | 176 | #endif |