1 /*
2  * Copyright 2013 Broadcom Corporation.
3  *
4  * SPDX-License-Identifier:      GPL-2.0+
5  */
6 
7 #ifndef __BCM28155_AP_H
8 #define __BCM28155_AP_H
9 
10 #include <linux/sizes.h>
11 #include <asm/arch/sysmap.h>
12 
13 /* CPU, chip, mach, etc */
14 #define CONFIG_KONA
15 #define CONFIG_SKIP_LOWLEVEL_INIT
16 #define CONFIG_SYS_GENERIC_BOARD
17 
18 /*
19  * Memory configuration
20  */
21 #define CONFIG_SYS_TEXT_BASE		0xae000000
22 
23 #define CONFIG_SYS_SDRAM_BASE		0x80000000
24 #define CONFIG_SYS_SDRAM_SIZE		0x80000000
25 #define CONFIG_NR_DRAM_BANKS		1
26 
27 #define CONFIG_SYS_MALLOC_LEN		SZ_4M	/* see armv7/start.S. */
28 #define CONFIG_STACKSIZE		SZ_256K
29 
30 /* GPIO Driver */
31 #define CONFIG_KONA_GPIO
32 
33 /* MMC/SD Driver */
34 #define CONFIG_SDHCI
35 #define CONFIG_MMC_SDMA
36 #define CONFIG_KONA_SDHCI
37 #define CONFIG_MMC
38 #define CONFIG_GENERIC_MMC
39 
40 #define CONFIG_SYS_SDIO_BASE0 SDIO1_BASE_ADDR
41 #define CONFIG_SYS_SDIO_BASE1 SDIO2_BASE_ADDR
42 #define CONFIG_SYS_SDIO_BASE2 SDIO3_BASE_ADDR
43 #define CONFIG_SYS_SDIO_BASE3 SDIO4_BASE_ADDR
44 #define CONFIG_SYS_SDIO0_MAX_CLK 48000000
45 #define CONFIG_SYS_SDIO1_MAX_CLK 48000000
46 #define CONFIG_SYS_SDIO2_MAX_CLK 48000000
47 #define CONFIG_SYS_SDIO3_MAX_CLK 48000000
48 #define CONFIG_SYS_SDIO0 "sdio1"
49 #define CONFIG_SYS_SDIO1 "sdio2"
50 #define CONFIG_SYS_SDIO2 "sdio3"
51 #define CONFIG_SYS_SDIO3 "sdio4"
52 
53 /* I2C Driver */
54 #define CONFIG_SYS_I2C
55 #define CONFIG_SYS_I2C_KONA
56 #define CONFIG_SYS_SPD_BUS_NUM	3	/* Start with PMU bus */
57 #define CONFIG_SYS_MAX_I2C_BUS	4
58 #define CONFIG_SYS_I2C_BASE0	BSC1_BASE_ADDR
59 #define CONFIG_SYS_I2C_BASE1	BSC2_BASE_ADDR
60 #define CONFIG_SYS_I2C_BASE2	BSC3_BASE_ADDR
61 #define CONFIG_SYS_I2C_BASE3	PMU_BSC_BASE_ADDR
62 
63 /* Timer Driver */
64 #define CONFIG_SYS_TIMER_RATE		32000
65 #define CONFIG_SYS_TIMER_COUNTER	(TIMER_BASE_ADDR + 4) /* STCLO offset */
66 
67 /* Init functions */
68 #define CONFIG_MISC_INIT_R	/* board's misc_init_r function */
69 
70 /* Some commands use this as the default load address */
71 #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
72 
73 /* No mtest functions as recommended */
74 
75 /*
76  * This is the initial SP which is used only briefly for relocating the u-boot
77  * image to the top of SDRAM. After relocation u-boot moves the stack to the
78  * proper place.
79  */
80 #define CONFIG_SYS_INIT_SP_ADDR		CONFIG_SYS_TEXT_BASE
81 
82 /* Serial Info */
83 #define CONFIG_SYS_NS16550
84 #define CONFIG_SYS_NS16550_SERIAL
85 /* Post pad 3 bytes after each reg addr */
86 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
87 #define CONFIG_SYS_NS16550_CLK		13000000
88 #define CONFIG_CONS_INDEX		1
89 #define CONFIG_SYS_NS16550_COM1		0x3e000000
90 
91 #define CONFIG_BAUDRATE			115200
92 
93 #define CONFIG_ENV_SIZE			0x10000
94 #define CONFIG_ENV_IS_NOWHERE
95 
96 #define CONFIG_SYS_NO_FLASH	/* Not using NAND/NOR unmanaged flash */
97 
98 /* console configuration */
99 #define CONFIG_SYS_CBSIZE		1024	/* Console buffer size */
100 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
101 			sizeof(CONFIG_SYS_PROMPT) + 16)	/* Printbuffer size */
102 #define CONFIG_SYS_MAXARGS		64
103 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
104 
105 /*
106  * One partition type must be defined for part.c
107  * This is necessary for the fatls command to work on an SD card
108  * for example.
109  */
110 #define CONFIG_DOS_PARTITION
111 #define CONFIG_EFI_PARTITION
112 
113 /* version string, parser, etc */
114 #define CONFIG_VERSION_VARIABLE
115 #define CONFIG_AUTO_COMPLETE
116 #define CONFIG_SYS_HUSH_PARSER
117 #define CONFIG_CMDLINE_EDITING
118 #define CONFIG_SYS_LONGHELP
119 
120 #define CONFIG_CRC32_VERIFY
121 #define CONFIG_MX_CYCLIC
122 
123 /* Initial upstream - boot to cmd prompt only */
124 #define CONFIG_BOOTCOMMAND		""
125 
126 /* Commands */
127 #define CONFIG_CMD_ASKENV
128 #define CONFIG_CMD_CACHE
129 #define CONFIG_CMD_FAT
130 #define CONFIG_CMD_GPIO
131 #define CONFIG_CMD_I2C
132 #define CONFIG_CMD_MMC
133 #define CONFIG_CMD_BOOTZ
134 #define CONFIG_FAT_WRITE
135 
136 
137 /* Fastboot and USB OTG */
138 #define CONFIG_USB_FUNCTION_FASTBOOT
139 #define CONFIG_CMD_FASTBOOT
140 #define CONFIG_FASTBOOT_FLASH
141 #define CONFIG_FASTBOOT_FLASH_MMC_DEV	0
142 #define CONFIG_SYS_CACHELINE_SIZE	64
143 #define CONFIG_FASTBOOT_BUF_SIZE	(CONFIG_SYS_SDRAM_SIZE - SZ_1M)
144 #define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_SDRAM_BASE
145 #define CONFIG_USB_GADGET
146 #define CONFIG_USB_GADGET_DUALSPEED
147 #define CONFIG_USB_GADGET_VBUS_DRAW	0
148 #define CONFIG_USB_GADGET_S3C_UDC_OTG
149 #define CONFIG_USB_GADGET_BCM_UDC_OTG_PHY
150 #define CONFIG_USB_GADGET_DOWNLOAD
151 #define CONFIG_USBID_ADDR		0x34052c46
152 #define CONFIG_G_DNL_VENDOR_NUM		0x18d1	/* google */
153 #define CONFIG_G_DNL_PRODUCT_NUM	0x0d02	/* nexus one */
154 #define CONFIG_G_DNL_MANUFACTURER	"Broadcom Corporation"
155 
156 #endif /* __BCM28155_AP_H */
157