[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 2011.09 / 0013-AM3517-Add-SPL-support.patch
1 From aff5a412e0353407420ed63246ea630988ebf469 Mon Sep 17 00:00:00 2001
2 From: Tom Rini <trini@ti.com>
3 Date: Fri, 18 Nov 2011 12:48:10 +0000
4 Subject: [PATCH 13/21] AM3517: Add SPL support
6 The only change of note is that we move from 0x80008000 to 0x80100000
7 for CONFIG_SYS_TEXT_BASE
9 Cc: Vaibhav Hiremath <hvaibhav@ti.com>
10 Signed-off-by: Tom Rini <trini@ti.com>
11 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
12 ---
13 board/logicpd/am3517evm/am3517evm.c | 2 +-
14 board/logicpd/am3517evm/config.mk | 30 ------------------
15 include/configs/am3517_evm.h | 57 +++++++++++++++++++++++++++++++++-
16 3 files changed, 56 insertions(+), 33 deletions(-)
17 delete mode 100644 board/logicpd/am3517evm/config.mk
19 diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c
20 index c0a006a..0a105bf 100644
21 --- a/board/logicpd/am3517evm/am3517evm.c
22 +++ b/board/logicpd/am3517evm/am3517evm.c
23 @@ -76,7 +76,7 @@ void set_muxconf_regs(void)
24 MUX_AM3517EVM();
25 }
27 -#ifdef CONFIG_GENERIC_MMC
28 +#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
29 int board_mmc_init(bd_t *bis)
30 {
31 omap_mmc_init(0);
32 diff --git a/board/logicpd/am3517evm/config.mk b/board/logicpd/am3517evm/config.mk
33 deleted file mode 100644
34 index 71ec5d0..0000000
35 --- a/board/logicpd/am3517evm/config.mk
36 +++ /dev/null
37 @@ -1,30 +0,0 @@
38 -#
39 -# Author: Vaibhav Hiremath <hvaibhav@ti.com>
40 -#
41 -# Based on ti/evm/config.mk
42 -#
43 -# Copyright (C) 2010
44 -# Texas Instruments Incorporated - http://www.ti.com/
45 -#
46 -# This program is free software; you can redistribute it and/or modify
47 -# it under the terms of the GNU General Public License as published by
48 -# the Free Software Foundation; either version 2 of the License, or
49 -# (at your option) any later version.
50 -#
51 -# This program is distributed in the hope that it will be useful,
52 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
53 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54 -# GNU General Public License for more details.
55 -#
56 -# You should have received a copy of the GNU General Public License
57 -# along with this program; if not, write to the Free Software
58 -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
59 -#
60 -# Physical Address:
61 -# 8000'0000 (bank0)
62 -# A000/0000 (bank1)
63 -# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
64 -# (mem base + reserved)
65 -
66 -# For use with external or internal boots.
67 -CONFIG_SYS_TEXT_BASE = 0x80008000
68 diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
69 index 1c70b9d..4a1c72c 100644
70 --- a/include/configs/am3517_evm.h
71 +++ b/include/configs/am3517_evm.h
72 @@ -63,7 +63,6 @@
73 /*
74 * DDR related
75 */
76 -#define CONFIG_OMAP3_MICRON_DDR 1 /* Micron DDR */
77 #define CONFIG_SYS_CS0_SIZE (256 * 1024 * 1024)
79 /*
80 @@ -273,7 +272,6 @@
81 */
82 #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
83 #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
84 -#define PHYS_SDRAM_1_SIZE (32 << 20) /* at least 32 MiB */
85 #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
87 /* SDRAM Bank Allocation method */
88 @@ -331,4 +329,59 @@
89 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
90 CONFIG_SYS_INIT_RAM_SIZE - \
91 GENERATED_GBL_DATA_SIZE)
92 +
93 +/* Defines for SPL */
94 +#define CONFIG_SPL
95 +#define CONFIG_SPL_NAND_SIMPLE
96 +#define CONFIG_SPL_TEXT_BASE 0x40200800
97 +#define CONFIG_SPL_MAX_SIZE (45 * 1024)
98 +#define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK
99 +
100 +#define CONFIG_SPL_BSS_START_ADDR 0x80000000
101 +#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
102 +
103 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
104 +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
105 +#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
106 +#define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
107 +
108 +#define CONFIG_SPL_LIBCOMMON_SUPPORT
109 +#define CONFIG_SPL_LIBDISK_SUPPORT
110 +#define CONFIG_SPL_I2C_SUPPORT
111 +#define CONFIG_SPL_LIBGENERIC_SUPPORT
112 +#define CONFIG_SPL_MMC_SUPPORT
113 +#define CONFIG_SPL_FAT_SUPPORT
114 +#define CONFIG_SPL_SERIAL_SUPPORT
115 +#define CONFIG_SPL_NAND_SUPPORT
116 +#define CONFIG_SPL_POWER_SUPPORT
117 +#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
118 +
119 +/* NAND boot config */
120 +#define CONFIG_SYS_NAND_5_ADDR_CYCLE
121 +#define CONFIG_SYS_NAND_PAGE_COUNT 64
122 +#define CONFIG_SYS_NAND_PAGE_SIZE 2048
123 +#define CONFIG_SYS_NAND_OOBSIZE 64
124 +#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
125 +#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
126 +#define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
127 + 10, 11, 12, 13}
128 +#define CONFIG_SYS_NAND_ECCSIZE 512
129 +#define CONFIG_SYS_NAND_ECCBYTES 3
130 +#define CONFIG_SYS_NAND_ECCSTEPS (CONFIG_SYS_NAND_PAGE_SIZE / \
131 + CONFIG_SYS_NAND_ECCSIZE)
132 +#define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
133 + CONFIG_SYS_NAND_ECCSTEPS)
134 +#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
135 +#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
136 +
137 +/*
138 + * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
139 + * 64 bytes before this address should be set aside for u-boot.img's
140 + * header. That is 0x800FFFC0--0x80100000 should not be used for any
141 + * other needs.
142 + */
143 +#define CONFIG_SYS_TEXT_BASE 0x80100000
144 +#define CONFIG_SYS_SPL_MALLOC_START 0x80208000
145 +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
146 +
147 #endif /* __CONFIG_H */
148 --
149 1.7.2.5