1 /*
2  * (C) Copyright 2008-2010
3  * Gražvydas Ignotas <notasas@gmail.com>
4  *
5  * Configuration settings for the OMAP3 Pandora.
6  *
7  * SPDX-License-Identifier:	GPL-2.0+
8  */
9 
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12 
13 #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
14 #define CONFIG_NAND
15 
16 /* override base for compatibility with MLO the device ships with */
17 #define CONFIG_SYS_TEXT_BASE		0x80008000
18 
19 #include <configs/ti_omap3_common.h>
20 
21 #define CONFIG_MISC_INIT_R
22 #define CONFIG_REVISION_TAG		1
23 
24 #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
25 
26 #define CONFIG_SYS_DEVICE_NULLDEV	1
27 
28 /*
29  * Hardware drivers
30  */
31 
32 /* I2C Support */
33 #define CONFIG_SYS_I2C_OMAP34XX
34 
35 /* TWL4030 LED */
36 #define CONFIG_TWL4030_LED
37 
38 /*
39  * NS16550 Configuration
40  */
41 #undef CONFIG_SYS_NS16550_CLK
42 #define CONFIG_SYS_NS16550_SERIAL
43 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
44 #define CONFIG_SYS_NS16550_CLK		V_NS16550_CLK
45 #define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
46 #define CONFIG_SERIAL3			3
47 
48 /* commands to include */
49 
50 /*
51  * Board NAND Info.
52  */
53 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
54 							/* to access nand */
55 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
56 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_SW
57 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
58 #define CONFIG_SYS_NAND_OOBSIZE		64
59 
60 #ifdef CONFIG_NAND
61 #define CONFIG_CMD_UBIFS	/* Read-only UBI volume operations */
62 
63 #define CONFIG_RBTREE		/* required by CONFIG_CMD_UBI */
64 #define CONFIG_LZO		/* required by CONFIG_CMD_UBIFS */
65 
66 #define CONFIG_MTD_PARTITIONS	/* required for UBI partition support */
67 
68 #define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
69 #define MTDPARTS_DEFAULT		"mtdparts=omap2-nand.0:512k(xloader),"\
70 					"1920k(uboot),128k(uboot-env),"\
71 					"10m(boot),-(rootfs)"
72 #else
73 #define MTDPARTS_DEFAULT
74 #endif
75 
76 
77 #define CONFIG_BOOTCOMMAND \
78 	"run distro_bootcmd; " \
79 	"setenv bootargs ${bootargs_ubi}; " \
80 	"if mmc rescan && load mmc 0:1 ${loadaddr} autoboot.scr; then " \
81 		"source ${loadaddr}; " \
82 	"fi; " \
83 	"ubi part boot && ubifsmount ubi:boot && " \
84 		"ubifsload ${loadaddr} uImage && bootm ${loadaddr}"
85 
86 #define BOOT_TARGET_DEVICES(func) \
87 	func(MMC, mmc, 0) \
88 
89 #include <config_distro_bootcmd.h>
90 
91 #define CONFIG_EXTRA_ENV_SETTINGS \
92 	DEFAULT_LINUX_BOOT_ENV \
93 	"usbtty=cdc_acm\0" \
94 	"bootargs_ubi=ubi.mtd=4 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs " \
95 		"rw rootflags=bulk_read vram=6272K omapfb.vram=0:3000K\0" \
96 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
97 	BOOTENV \
98 
99 /* memtest works on */
100 #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)
101 #define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
102 					0x01F00000) /* 31MB */
103 
104 #if defined(CONFIG_NAND)
105 #define CONFIG_SYS_FLASH_BASE		NAND_BASE
106 #endif
107 
108 /* Monitor at start of flash */
109 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
110 
111 #define CONFIG_ENV_IS_IN_NAND		1
112 #define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
113 
114 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
115 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
116 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
117 
118 #endif				/* __CONFIG_H */
119