按三星默认的u-boot,内存起始地址是0x20000000,即memory port1,如果要让u-boot只在0x40000000(即memory port2) 运行,则需要修改的地方有:
(参考T34平台u-boot中的修改为0x30000000)
1.修改 board\samsung\smdkc110\lowlevel_init.S
- .set __base,0x200 ==>> .set __base,0x400
- // 256MB for SDRAM with cacheable
- .rept 0xD00 - 0xC00
- FL_SECTION_ENTRY __base,3,0,1,1
- .set __base,__base+1
- .endr
2. board/samsung/smdkc110/smdkc110.c
- ulong virt_to_phy_smdkc110(ulong addr)
- {
- if ((0xc0000000 <= addr) && (addr < 0xd0000000))
- return (addr - 0xc0000000 + 0x20000000); //yan
- else
- printf("The input address don't need "\
- "a virtual-to-physical translation : %08lx\n", addr);
- return addr;
- }
修改为
- ulong virt_to_phy_smdkc110(ulong addr)
- {
- if ((0xc0000000 <= addr) && (addr < 0xd0000000))
- return (addr - 0xc0000000 + MEMORY_BASE_ADDRESS); //yan
- else
- printf("The input address don't need "\
- "a virtual-to-physical translation : %08lx\n", addr);
- return addr;
- }
3. include\configs\smdkv210single.h
- #define MEMORY_BASE_ADDRESS
- 0x40000000
- #define DMC1_MEMCONFIG_0
- 0x40E01323
- #define CONFIG_NR_DRAM_BANKS 1 /* we have 2 bank of DRAM */
- #define SDRAM_BANK_SIZE 0x20000000 /* 512 MB */
- //#define SDRAM_BANK_SIZE 0x10000000
- #define PHYS_SDRAM_1 MEMORY_BASE_ADDRESS /* SDRAM Bank #1 */
- #define PHYS_SDRAM_1_SIZE SDRAM_BANK_SIZE /* jeff */
- //#define PHYS_SDRAM_2 0x40000000 /* SDRAM Bank #2 */
- //#define PHYS_SDRAM_2_SIZE SDRAM_BANK_SIZE /* jeff */
- #ifdef CONFIG_ENABLE_MMU
- #define CFG_UBOOT_BASE 0xc3e00000
- #else
- #define CFG_UBOOT_BASE 0x43e00000
- #endif
- #define CONFIG_BOOTCOMMAND "movi read kernel C0008000; movi read rootfs 40B00000 180000; bootm C0008000 40B00000"
4.内核中的修改
- MACHINE_START(SMDKV210, "SMDKV210")
- .boot_params = S5P_PA_SDRAM + 0x100,
arch/arm/mach-s5pv210/include/mach/map.h
- #define S5P_PA_SDRAM S5PV210_PA_SDRAM
- #define S5PV210_PA_SDRAM (0x40000000)
arch/arm/mach-s5pv210/include/mach/memory.h
- #define PHYS_OFFSET UL(0x40000000)
arch/arm/mach-s5pv210/Makefile.boot
- zreladdr-y := 0x40008000
- params_phys-y := 0x40000100