diff options
author | Dipen Dudhat <dipen.dudhat@freescale.com> | 2009-10-07 15:47:47 -0400 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2009-10-07 15:47:47 -0400 |
commit | 735586d8200e41338a876e704ab3eeae6b91cd67 (patch) | |
tree | b517ae83445bb8dccd1746cc5a6b340266f17164 | |
parent | f18b8cddeb400ea9eedb52803dd415246fb81a62 (diff) |
u-boot-2009.03-p2020rdb-SDCARD-boot-support
SDCARD boot support for P2020RDB
Make a special uboot used for booting from SDcard for P2020RDB platform.
This patch uses sdboot support for 8536DS posted by Mingkai Hu.
Signed-off-by: Dipen Dudhat <dipen.dudhat@freescale.com>
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | board/freescale/p10xx_p20xx_rdb/config.mk | 1 | ||||
-rw-r--r-- | board/freescale/p10xx_p20xx_rdb/p10xx_p20xx_rdb.c | 4 | ||||
-rw-r--r-- | board/freescale/p10xx_p20xx_rdb/tlb.c | 2 | ||||
-rw-r--r-- | board/freescale/p10xx_p20xx_rdb/u-boot-sdboot.lds | 139 | ||||
-rw-r--r-- | include/configs/P10XX_20XX_RDB.h | 17 |
6 files changed, 172 insertions, 0 deletions
@@ -2445,12 +2445,21 @@ MPC8572DS_config: unconfig @$(MKCONFIG) -a MPC8572DS ppc mpc85xx mpc8572ds freescale P2020RDB_config \ +P2020RDB_SDCARD_config \ P1021RDB_config \ P1020RDB_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MP" >>$(obj)include/config.h ; + @if [ "$(findstring _SDCARD_,$@)" ] ; then \ + echo "#define CONFIG_SDCARD_U_BOOT" >> $(obj)include/config.h ; \ + $(XECHO) "...SDCARD Boot" ; \ + fi ; @$(XECHO) "... setting CONFIG_MP." ; @$(MKCONFIG) -a P10XX_20XX_RDB ppc mpc85xx p10xx_p20xx_rdb freescale + @if [ "$(findstring _SDCARD_,$@)" ] ; then \ + echo "TEXT_BASE = 0x11001000" > $(obj)board/freescale/p10xx_p20xx_rdb/config.tmp ; \ + echo "CONFIG_SDCARD_U_BOOT = y" >> $(obj)include/config.mk ; \ + fi ; P1011RDB_config \ P1012RDB_config: unconfig diff --git a/board/freescale/p10xx_p20xx_rdb/config.mk b/board/freescale/p10xx_p20xx_rdb/config.mk index b5af2d2ed7..9b20d26acf 100644 --- a/board/freescale/p10xx_p20xx_rdb/config.mk +++ b/board/freescale/p10xx_p20xx_rdb/config.mk @@ -23,6 +23,7 @@ # #p10xx_20xxerdb board # +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp ifndef TEXT_BASE TEXT_BASE = 0xeff80000 diff --git a/board/freescale/p10xx_p20xx_rdb/p10xx_p20xx_rdb.c b/board/freescale/p10xx_p20xx_rdb/p10xx_p20xx_rdb.c index be888fb10a..ad3cda1be8 100644 --- a/board/freescale/p10xx_p20xx_rdb/p10xx_p20xx_rdb.c +++ b/board/freescale/p10xx_p20xx_rdb/p10xx_p20xx_rdb.c @@ -93,6 +93,10 @@ phys_size_t initdram(int board_type) puts("Initializing...."); +#ifdef CONFIG_SDCARD_U_BOOT + return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; +#endif + #ifdef CONFIG_DDR_SPD dram_size = fsl_ddr_sdram(); #else diff --git a/board/freescale/p10xx_p20xx_rdb/tlb.c b/board/freescale/p10xx_p20xx_rdb/tlb.c index 67163441f3..c00817e58a 100644 --- a/board/freescale/p10xx_p20xx_rdb/tlb.c +++ b/board/freescale/p10xx_p20xx_rdb/tlb.c @@ -24,6 +24,7 @@ #include <asm/mmu.h> struct fsl_e_tlb_entry tlb_table[] = { +#if !defined(CONFIG_SDCARD_U_BOOT) /* TLB 0 - for temp stack in cache */ SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR, MAS3_SX|MAS3_SW|MAS3_SR, 0, @@ -37,6 +38,7 @@ struct fsl_e_tlb_entry tlb_table[] = { SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024 , CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 0, BOOKE_PAGESZ_4K, 0), +#endif /* TLB 1 */ /* *I*** - Covers boot page */ diff --git a/board/freescale/p10xx_p20xx_rdb/u-boot-sdboot.lds b/board/freescale/p10xx_p20xx_rdb/u-boot-sdboot.lds new file mode 100644 index 0000000000..f4a0e91286 --- /dev/null +++ b/board/freescale/p10xx_p20xx_rdb/u-boot-sdboot.lds @@ -0,0 +1,139 @@ +/* + * Copyright (C)2009 Freescale Semiconductor, Inc. All rights reserved. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +OUTPUT_ARCH(powerpc) +/* Do we need any of these for elf? + __DYNAMIC = 0; */ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .rel.text : { *(.rel.text) } + .rela.text : { *(.rela.text) } + .rel.data : { *(.rel.data) } + .rela.data : { *(.rela.data) } + .rel.rodata : { *(.rel.rodata) } + .rela.rodata : { *(.rela.rodata) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { *(.init) } + .plt : { *(.plt) } + .text : + { + *(.text) + *(.fixup) + *(.got1) + } + _etext = .; + PROVIDE (etext = .); + .rodata : + { + *(.rodata) + *(.rodata1) + *(.rodata.str1.4) + *(.eh_frame) + } + .fini : { *(.fini) } =0 + .ctors : { *(.ctors) } + .dtors : { *(.dtors) } + + /* Read-write section, merged into data segment: */ + . = (. + 0x00FF) & 0xFFFFFF00; + _erotext = .; + PROVIDE (erotext = .); + .reloc : + { + *(.got) + _GOT2_TABLE_ = .; + *(.got2) + _FIXUP_TABLE_ = .; + *(.fixup) + } + __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; + __fixup_entries = (. - _FIXUP_TABLE_) >> 2; + + .data : + { + *(.data) + *(.data1) + *(.sdata) + *(.sdata2) + *(.dynamic) + CONSTRUCTORS + } + _edata = .; + PROVIDE (edata = .); + + . = .; + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + + . = .; + __start___ex_table = .; + __ex_table : { *(__ex_table) } + __stop___ex_table = .; + + . = ALIGN(256); + __init_begin = .; + .text.init : { *(.text.init) } + .data.init : { *(.data.init) } + . = ALIGN(256); + __init_end = .; + + .bootpg ADDR(.text) - 0x1000 : + { + cpu/mpc85xx/start.o (.bootpg) + } = 0xffff + + .resetvec ADDR(.text) + 0x7fffc - 0x1000 : + { + *(.resetvec) + } = 0xffff + + . = ADDR(.text) + 0x80000 - 0x1000; + + __bss_start = .; + .bss (NOLOAD) : + { + *(.sbss) *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + } + + . = ALIGN(4); + _end = . ; + PROVIDE (end = .); +} diff --git a/include/configs/P10XX_20XX_RDB.h b/include/configs/P10XX_20XX_RDB.h index c5017aad40..f8b1335522 100644 --- a/include/configs/P10XX_20XX_RDB.h +++ b/include/configs/P10XX_20XX_RDB.h @@ -199,9 +199,15 @@ #define CONFIG_BOARD_EARLY_INIT_R /* call board_early_init_r function */ +#if !defined(CONFIG_SDCARD_U_BOOT) #define CONFIG_SYS_INIT_RAM_LOCK 1 #define CONFIG_SYS_INIT_RAM_ADDR 0xffd00000 /* stack in RAM */ #define CONFIG_SYS_INIT_RAM_END 0x00004000 /* End of used area in RAM */ +#else +#undef CONFIG_SYS_INIT_RAM_LOCK +#define CONFIG_SYS_INIT_RAM_ADDR 0x07d00000 /* unused memory region */ +#define CONFIG_SYS_INIT_RAM_END 0x4000 /* we have SDRAM initialized */ +#endif #define CONFIG_SYS_GBL_DATA_SIZE 128 /* num bytes initial data */ #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) @@ -210,6 +216,10 @@ #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* Reserved for malloc */ +#ifdef CONFIG_SDCARD_U_BOOT +#define CONFIG_SYS_RESERVED_LAW0 0 +#endif + #define CONFIG_SYS_NAND_BASE 0xffa00000 #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE} @@ -430,6 +440,7 @@ /* * Environment */ +#if !defined(CONFIG_SDCARD_U_BOOT) #define CONFIG_ENV_IS_IN_FLASH 1 #if CONFIG_SYS_MONITOR_BASE > 0xfff80000 #define CONFIG_ENV_ADDR 0xfff80000 @@ -438,6 +449,12 @@ #endif #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) */ +#else +#define CONFIG_ENV_IS_IN_SDCARD 1 +#define CONFIG_ENV_SIZE 0x2000 +/*env located after the u-boot image, size is 8K*/ +#define CONFIG_ENV_ADDR_IN_RAM ((TEXT_BASE - 0x1000) + 0x80000) +#endif #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */ |