summaryrefslogtreecommitdiff
path: root/include/configs/tm2.h
blob: 83cd6e3d8c6b798ba15d58325e9d4b41ce54b5b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
 * (C) Copyright 2016 Samsung Electronics
 *
 * Marek Szyprowski <m.szyprowski@samsung.com>
 *
 * Configuration for Samsung Exynos 5433-based TM2/TM2E boards.
 * Parts were derived from Hikey board configuration.
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef __SAMSUNG_TM2_H
#define __SAMSUNG_TM2_H

#include <linux/sizes.h>

/* MMU Definitions */
#define CONFIG_SYS_CACHELINE_SIZE 64

#define CONFIG_PWM
#define CONFIG_ARCH_EXYNOS

#define CONFIG_CMD_BDI
#define CONFIG_CMD_UNZIP

/* Physical Memory Map */

/* SD/MMC configuration */
#define CONFIG_BOUNCE_BUFFER

/* DWC3 */
#define CONFIG_USB_DWC3
#define CONFIG_USB_DWC3_GADGET
#define CONFIG_USB_DWC3_PHY_SAMSUNG

/* USB gadget */
#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_VBUS_DRAW	2

/* Downloader */
#define CONFIG_G_DNL_VENDOR_NUM		0x04E8
#define CONFIG_G_DNL_PRODUCT_NUM	0x6601
#define CONFIG_G_DNL_MANUFACTURER	"Samsung"
#define CONFIG_USB_GADGET_DOWNLOAD

/* DFU */
#define CONFIG_USB_FUNCTION_DFU
#define CONFIG_DFU_MMC
#define CONFIG_CMD_DFU
#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
#define DFU_DEFAULT_POLL_TIMEOUT	300
#define DFU_MANIFEST_POLL_TIMEOUT       25000

/* THOR */
#define CONFIG_G_DNL_THOR_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
#define CONFIG_G_DNL_THOR_PRODUCT_NUM	0x685D
#define CONFIG_USB_FUNCTION_THOR
#define CONFIG_CMD_THOR_DOWNLOAD

/* require to avoid build break */
#define CONFIG_G_DNL_UMS_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM
#define CONFIG_G_DNL_UMS_PRODUCT_NUM	0xA4A5

/* I2C */
#define CONFIG_SOFT_I2C_GPIO_SCL	GPIO_I2C_SCL_PIN
#define CONFIG_SOFT_I2C_GPIO_SDA	GPIO_I2C_SDA_PIN

#define CONFIG_CMD_I2C
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_SOFT
#define CONFIG_SYS_I2C_SOFT_SPEED	50000
#define CONFIG_SYS_I2C_SOFT_SLAVE	0x00
#define CONFIG_SYS_I2C_INIT_BOARD

/* CONFIG_SYS_TEXT_BASE needs to align with where sboot loads kernel */
#define CONFIG_SYS_TEXT_BASE		0x20080000

#define CONFIG_NR_DRAM_BANKS		1
#define PHYS_SDRAM_1			0x20000000
#define PHYS_SDRAM_1_SIZE		0xbf700000
#define GICD_BASE			0x11001000

#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
#define CONFIG_SYS_INIT_RAM_SIZE	0x1000
#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
#define CONFIG_SYS_LOAD_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x80000)
#define CONFIG_SYS_CONSOLE_INFO_QUIET

/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (80 << 20))
#define CONFIG_SYS_BOOTM_LEN		(130 << 20)

/* Serial port Exynos S5P through the device model */
#define CONFIG_BAUDRATE			115200

/* Initial environment variables */
#define CONFIG_BOOTCOMMAND		"run modedetect"
#define CONFIG_EXTRA_ENV_SETTINGS	"dfu_alt_info=kernel part 0 9 offset 0x400;rootfs part 0 18;system-data part 0 19;user part 0 21\0" \
					"modedetect=if itest.l *0x10580044 == 0x81 || itest.l *0x10580044 == 0x1 || itest.l *0x10580044 == 0x41 || itest.l *0x105c080c == 0x12345671; then run download; else run bootkernel; fi; reset\0" \
					"fdt_high=0xffffffffffffffff\0" \
					"bootargs=console=ttySAC1,115200 earlycon=exynos4210,0x14C20000 ess_setup=0x26000000 loglevel=7 root=/dev/mmcblk0p18 rootfstype=ext4 rootwait\0" \
					"bootkernel=echo Booting kernel; run boarddetect; run loadkernel; bootm 0x30080000#$board\0" \
					"boarddetect=if itest.l *0x138000b4 == 0x0063f9ff; then setenv board tm2e; elif itest.l *0x138000b4 == 0x0059f9ff; then setenv board tm2; else setenv board unknown; fi; echo Detected $board board\0" \
					"loadkernel=part start mmc 0 9 kernel_sect; part size mmc 0 9 kernel_size; mmc read 0x30000000 $kernel_sect $kernel_size\0" \
					"muicsetusb=i2c mw 25 c 9; i2c mw 25 d 3b; i2c mw 25 e 05; i2c mw 25 16 10\0" \
					"displayimg=unzip 200d0000 67000000; mw.l 138000b4 0059f9ff; mw.l 138001a0 67e10000; mw.l 13800200 00001680; mw.l 13801410 1; mw.l 13802040 e0000018; sleep 1; mw.l 13802040 e0000008\0" \
					"download=echo Thor mode enabled; run muicsetusb; run displayimg; mw.l 0x105c080c 0; thor 0 mmc 0\0"
#define CONFIG_MENUPROMPT		"Loading, please wait..."

#define CONFIG_ENV_SIZE			0x1000
#define CONFIG_ENV_IS_NOWHERE

/* Monitor Command Prompt */
#define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
					sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
#define CONFIG_SYS_LONGHELP
#define CONFIG_CMDLINE_EDITING
#define CONFIG_SYS_MAXARGS		16	/* max command args */

#endif /* __SAMSUNG_TM2_H */