u010216127的专栏

PowerPC功能很强的通信处理器,支持1000M以太网接口,以Freescale的P1010处理器为开发平台,讲述移植linux的整个过程,与大家分享。

1.配置交叉编译链 网上下载交叉编译工具,配置环境变量 sudo gedit /etc/environment 在末尾添加交叉编译链路径 :/home/freescale/work/tools/freescale/bin log out(不需要重启),输入如下,验证交叉编译是否安装成功:freescale@freescale-sdk:~/work/u-boot$ powerpc-linux-gnu-gcc -vUsing built-in specs.COLLECT_GCC=powerpc-linux-gnu-gcc……..gcc version 4.5.1 (Sourcery G++ Lite 2010.09-55) freescale@freescale-sdk:~/work/u-boot$

2.新增单板freescale@freescale-sdk:~/work/source/u-boot-2010.12$ make distclean freescale@freescale-sdk:~/work/source/u-boot-2010.12$ cd board/freescale/freescale@freescale-sdk:~/work/source/u-boot-2010.12/board/freescale$ cp p1010rdb p1010acce -rffreescale@freescale-sdk:~/work/source/u-boot-2010.12/board/freescale$ cd ../..freescale@freescale-sdk:~/work/source/u-boot-2010.12$ cd include/configs/ freescale@freescale-sdk:~/work/source/u-boot-2010.12/include/configs$ cp P1010RDB.h P1010BOARD.hfreescale@freescale-sdk:~/work/source/u-boot-2010.12/include/configs$ cd ../..freescale@freescale-sdk:~/work/source/u-boot-2010.12$ vim boards.cfg add:P1010BOARD_NOR powerpc mpc85xx p1010acce freescale – P1010BOARD:P1010BOARDfreescale@freescale-sdk:~/work/source/u-boot-2010.12$ make P1010BOARD_NOR_config Configuring for P1010BOARD_NOR – Board: P1010BOARD, Options: P1010BOARDfreescale@freescale-sdk:~/work/source/u-boot-2010.12$ freescale@freescale-sdk:~/work/source/u-boot-2010.12$ makeGenerating include/autoconf.mk/home/freescale/work/source/u-boot-2010.12/include/asm/config_mpc85xx.h:328:2: error: #error Processor type not defined for this platformGenerating include/autoconf.mk.dep/home/freescale/work/source/u-boot-2010.12/include/asm/config_mpc85xx.h:328:2: error: #error Processor type not defined for this platformpowerpc-linux-gnu-gcc -DDO_DEPS_ONLY \ -g -Os -mrelocatable -ffunction-sections -fdata-sections -fPIC -meabi -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0xeff80000 -I/home/freescale/work/source/u-boot-2010.12/include -fno-builtin -ffreestanding -nostdinc -isystem /home/freescale/work/tools/freescale-2010.09/bin/../lib/gcc/powerpc-linux-gnu/4.5.1/include -pipe -DCONFIG_PPC -D__powerpc__ -ffixed-r2 -Wa,-me500 -msoft-float -mno-string -mno-spe -Wall -Wstrict-prototypes -fno-stack-protector \ -o lib/asm-offsets.s lib/asm-offsets.c -c -SIn file included from /home/freescale/work/source/u-boot-2010.12/include/asm/config.h:25:0, from /home/freescale/work/source/u-boot-2010.12/include/config.h:6, from /home/freescale/work/source/u-boot-2010.12/include/common.h:37, from lib/asm-offsets.c:18:/home/freescale/work/source/u-boot-2010.12/include/asm/config_mpc85xx.h:328:2: error: #error Processor type not defined for this platformmake: *** [lib/asm-offsets.s] Error 1freescale@freescale-sdk:~/work/source/u-boot-2010.12$ 编译报错,修改如下:solutions:freescale@freescale-sdk:~/work/source/u-boot-2010.12$ vim boards.cfg P1010BOARD_NOR powerpc mpc85xx p1010acce freescale – P1010BOARD:P1010RDB继续编译,成功生成u-boot.binfreescale@freescale-sdk:~/work/source/u-boot-2010.12$ make P1010BOARD_NOR………5.1/nof -lgcc -Map u-boot.map -o u-bootpowerpc-linux-gnu-objcopy -O srec u-boot u-boot.srecpowerpc-linux-gnu-objcopy –gap-fill=0xff -O binary u-boot u-boot.binfreescale@freescale-sdk:~/work/source/u-boot-2010.12$ 3.修改配置支持DDR3烧写上面生成的u-boot.bin(0xfff80000),配置串口 115200 8 n 1,打印如下:U-Boot 2013.01-dirty (May 18 2015 – 20:04:36)CPU: P1010, Version: 1.0, (0x80f10010)Core: E500, Version: 5.1, (0x80212151)Clock Configuration: CPU0:800 MHz, CCB:400 MHz, DDR:200 MHz (400 MT/s data rate) (Synchronous), IFC:100 MHzL1: D-cache 32 kB enabled I-cache 32 kB enabledBoard: P1010RDBI2C: readySPI: readyDRAM: DDR: failed to read SPD from address 82SPD error on controller 0! Trying fallback to raw timing calculationDetected UDIMM Fixed DDR on boardThe choosen cas latency 5 is too large1 GiB (DDR3, 32-bit, CL=5, ECC off)Flash: 32 MiBL2: 256 KB enabledNAND: 16 MiBMMC: FSL_SDHC: 0*** Warning – bad CRC, using default environmentPCIe1: Root Complex of mini PCIe Slot, no link, regs @ 0xffe0a000PCIe1: Bus 00 – 00PCIe2: Root Complex of PCIe Slot, no link, regs @ 0xffe09000PCIe2: Bus 01 – 01In: serialOut: serialErr: serialNet: PHY reset timed outPHY reset timed outPHY reset timed outeTSEC1 [PRIME], eTSEC2, eTSEC3Hit any key to stop autoboot: 0 系统启动不稳定,经常卡死。log打印显示DDR配置失败。DDR: failed to read SPD from address 82跟踪代码_start: bl cpu_init_early_f bl cpu_init_f init_early_memctl_regs(); bl board_init_f Board.c (…\u-boot-2010.12\arch\powerpc\lib) 27583 2015/5/18 for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { if ((*init_fnc_ptr) () != 0) { hang (); } probecpu, board_early_init_f, init_timebase, env_init, init_baudrate, serial_init, console_init_f, display_options, checkcpu, checkboard,INIT_FUNC_WATCHDOG_RESET init_func_i2c, init_func_spi, INIT_FUNC_WATCHDOG_RESET init_func_ram, puts ("DRAM: "); initdram (0) Cpu.c (…\u-boot-2010.12\arch\powerpc\cpu\mpc85xx) 14954 2015/5/18 #if defined(CONFIG_SPD_EEPROM) || \ defined(CONFIG_DDR_SPD) || \ defined(CONFIG_DDR_RAW_TIMING) dram_size = fsl_ddr_sdram(); #else dram_size = fixed_sdram(); #endif比对P1010rdb单板,新建单板没有使用SPD,利用ERROE_ROM存储DDR配置信息,去掉SPD相关宏,修改如下:P1010BOARD.h/* DDR Setup */#define CONFIG_FSL_DDR3/*#define CONFIG_DDR_RAW_TIMING#define CONFIG_DDR_SPD#define CONFIG_SYS_SPD_BUS_NUM 1*/#define SPD_EEPROM_ADDRESS 0x52修改Ddr.c (….\u-boot-2010.12\board\freescale\p1010acce) 7474 5/23/2015 ddr_freq = get_ddr_freq(0);modified to ddr_freq = 667*1000000;//配置成667MHz

风景如何,其实并不重要。重要的是,你在我的身边。

u010216127的专栏

相关文章:

你感兴趣的文章:

标签云: