现在的位置: 首页 > 综合 > 正文

S5PV210 — UBOOT修改为只使用MEMORY PORT2

2012年11月21日 ⁄ 综合 ⁄ 共 2575字 ⁄ 字号 评论关闭

按三星默认的u-boot,内存起始地址是0x20000000,即memory port1,如果要让u-boot只在0x40000000(即memory port2) 运行,则需要修改的地方有:

(参考T34平台u-boot中的修改为0x30000000)

1.修改 board\samsung\smdkc110\lowlevel_init.S

[plain] view
plain
copy

  1. .set __base,0x200    ==>> .set __base,0x400  
  2.    
  3. // 256MB for SDRAM with cacheable  
  4.    
  5. .rept 0xD00 - 0xC00  
  6.    
  7. FL_SECTION_ENTRY __base,3,0,1,1  
  8.    
  9. .set __base,__base+1  
  10.    
  11. .endr  


2board/samsung/smdkc110/smdkc110.c

  1. ulong virt_to_phy_smdkc110(ulong addr)  
  2.    
  3. {  
  4.    
  5.         if ((0xc0000000 <= addr) && (addr < 0xd0000000))  
  6.    
  7.                 return (addr - 0xc0000000 + 0x20000000); //yan  
  8.    
  9.         else  
  10.    
  11.                 printf("The input address don't need "\  
  12.    
  13.                         "a virtual-to-physical translation : %08lx\n", addr);  
  14.    
  15.   
  16.   
  17.   
  18.         return addr;  
  19.    
  20. }  

修改为

  1. ulong virt_to_phy_smdkc110(ulong addr)  
  2.    
  3. {  
  4.    
  5.         if ((0xc0000000 <= addr) && (addr < 0xd0000000))  
  6.    
  7.                 return (addr - 0xc0000000 + MEMORY_BASE_ADDRESS); //yan  
  8.    
  9.         else  
  10.    
  11.                 printf("The input address don't need "\  
  12.    
  13.                         "a virtual-to-physical translation : %08lx\n", addr);  
  14.    
  15.   
  16.   
  17.   
  18.         return addr;  
  19.    
  20. }  


3include\configs\smdkv210single.h

  1. #define MEMORY_BASE_ADDRESS  
  2.  0x40000000  
  3.    
  4. #define DMC1_MEMCONFIG_0  
  5.  0x40E01323  
  6.   
  7. #define CONFIG_NR_DRAM_BANKS    1          /* we have 2 bank of DRAM */  
  8.    
  9. #define SDRAM_BANK_SIZE         0x20000000    /* 512 MB */  
  10.    
  11. //#define SDRAM_BANK_SIZE         0x10000000  
  12.    
  13. #define PHYS_SDRAM_1            MEMORY_BASE_ADDRESS /* SDRAM Bank #1 */  
  14.    
  15. #define PHYS_SDRAM_1_SIZE       SDRAM_BANK_SIZE  /* jeff */  
  16.    
  17. //#define PHYS_SDRAM_2            0x40000000 /* SDRAM Bank #2 */  
  18.    
  19. //#define PHYS_SDRAM_2_SIZE       SDRAM_BANK_SIZE  /* jeff */  
  20.   
  21. #ifdef CONFIG_ENABLE_MMU  
  22.    
  23. #define CFG_UBOOT_BASE  0xc3e00000  
  24.    
  25. #else  
  26.    
  27. #define CFG_UBOOT_BASE  0x43e00000  
  28.    
  29. #endif  
  30.   
  31. #define CONFIG_BOOTCOMMAND  "movi read kernel C0008000; movi read rootfs 40B00000 180000; bootm C0008000 40B00000"  

4.内核中的修改

[plain] view
plain
copy

  1. MACHINE_START(SMDKV210, "SMDKV210")   
  2. .boot_params    = S5P_PA_SDRAM + 0x100,  

arch/arm/mach-s5pv210/include/mach/map.h

  1. #define S5P_PA_SDRAM           S5PV210_PA_SDRAM  
  2.    
  3. #define S5PV210_PA_SDRAM        (0x40000000)  

arch/arm/mach-s5pv210/include/mach/memory.h

  1. #define PHYS_OFFSET         UL(0x40000000)  

arch/arm/mach-s5pv210/Makefile.boot

[plain] view
plain
copy

  1. zreladdr-y  := 0x40008000   
  2. params_phys-y  := 0x40000100  

转载自:http://blog.csdn.net/knock/article/details/7625579

抱歉!评论已关闭.