U-boot移植
(以下进程适用于s3c2440开发板)
1、修正Makefile文件:
a.修正穿插编译宏(CROSS_COMPILE?=)修正为(CROSS_COMPILE?=arm-linux-);
tocore2440_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t tocore2440 tocore
包括六个参数:$1. tocore2440 表明在include/configs/目录下有必要包括tocore2440.h文件;$2. arm表明在主目录下包括lib_arm目录,在include/目录下包括asm_arm目录;$3.arm920t表明CPU类型,在cpu目录下包括arm920t目录;$4.tocore2440芯片类型;$5.厂商目录(if($5!=NULL),则在board目录下有$5/$4目录,else,则在board目录下有$4目录);$6. s3c24x0表明在include/asm_arm/包括arch_ s3c24x0目录;
d.以上部分表明在移植U-boot前首先要增加开发板自己的装备头文件,并在board目录下树立自己的开发板目录,修正s3c24x0(cpu/arm920t/s3c24x0,include/asm_arm/archs3c24x0)文件,改为支撑2440开发板,修正进程如下:
1)
2)
if (pllreg == MPLL)
return((CONFIG_SYS_CLK_FREQ * m * 2) / (p << s)); //得到2440开发板的频率
#endif
c.将get_HCLK()函数修正为2440支撑,将原函数回来改为:
#if defined(CONFIG_S3C2440)
#else
#endif
d.修正time.c文件,增加宏界说#defined (CONFIG_S3C2440)(line33)
2、增加装备文件
2)注释2410宏界说:
//#define
//#define CONFIG_SBC2410X
#define CONFIG_S3C2440
#define CONFIG_TOCORE2440
#define CONFIG_TOCORE2440_LED
#define CONFIG_S3C2440_NAND_BOOT
4)注释CS8900网卡宏界说(在line72增加#if 0,在line76 增加#endif),增加DM9000网卡宏界说:
#define CONFIG_DM9000_USE_16BIT
#define CONFIG_DM9000_BASE
#define DM9000_IO
#define DM9000_DATA
#define CONFIG_DM9000_NO_SROM
#undef CONFIG_DM9000_DEBUG
#define CONFIG_NET_MULTI
#define CONFIG_CMD_ASKENV
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_PING
#define CONFIG_CMD_NAND
#define CONFIG_CMD_SAVEENV
#define CONFIG_BOOTDELAY
#define CONFIG_BOOTARGS “console=ttySAC0 root=/dev/nfs “
#define CONFIG_ETHADDR
#define CONFIG_IPADDR
#define CONFIG_SERVERIP
#define CONFIG_BOOTCOMMAND
#define CONFIG_SYS_PROMPT
#define CONFIG_SYS_LOAD_ADDR
#define CONFIG_ENV_ADDR
#define CONFIG_ENV_IS_IN_NAND 1
#define CONFIG_ENV_OFFSET
#define CONFIG_ENV_SIZE
#define MTDPARTS_DEFAULT “mtdparts=nandflash0:384k(bootloader),”
#define NAND_MAX_CHIPS 1
#define CONFIG_MTD_NAND_VERIFY_WRITE
#if defined(CONFIG_TOCORE2440_LED)
#define GPIO_CTL_BASE 0x56000000
#define oGPIO_B 0x10
#define oGPIO_CON 0x0
#define oGPIO_DAT 0x4
#define oGPIO_UP 0x8
#endif
#define STACK_BASE 0x33f00000
#define STACK_SIZE 0x10000
//#define CONFIG_ENV_ADDR
//#define
//#define CONFIG_ENV_SIZE
增加Nandflash设置:
#if defined(CONFIG_CMD_NAND)
#define CONFIG_NAND_S3C2410
#define CONFIG_SYS_MAX_NAND_DEVICE
#endif
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_CMDLINE_TAG
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT_HUSH_PS2
#define CONFIG_CMDLINE_EDITING
#ifdef CONFIG_CMDLINE_EDITING
#undef CONFIG_AUTO_COMPLETE
#else
#define CONFIG_AUTO_COMPLETE
#endif
#define CONFIG_SYS_NAND_BASE 0x4E000000
#define NAND_CTL_BASE 0x4E000000
#define bINT_CTL(Nb) __REG(INT_CTL_BASE + (Nb))
#define oNFCONF 0x00
#if defined(CONFIG_S3C2440)
#define CONFIG_S3C2440_NAND_BOOT 1
#define oNFCONT 0x04
#define oNFCMD 0x08
#define oNFADDR 0x0c
#define oNFDATA 0x10
#define oNFSTAT 0x20
#define oNFECC 0x2c
#define rNFCONF (*(volatile unsigned int *)0x4e000000)
#define rNFCONT (*(volatile unsigned int *)0x4e000004)
#define rNFCMD (*(volatile unsigned char *)0x4e000008)
#define rNFADDR (*(volatile unsigned char *)0x4e00000c)
#define rNFDATA (*(volatile unsigned char *)0x4e000010)
#define rNFSTAT (*(volatile unsigned int *)0x4e000020)
#define rNFECC (*(volatile unsigned int *)0x4e00002c)
#endif
#if defined(CONFIG_S3C2410)
#define CONFIG_S3C2410_NAND_BOOT 1
#define oNFCONF 0x00
#define oNFCMD 0x04
#define oNFADDR 0x08
#define oNFDATA 0x0c
#define oNFSTAT 0x10
#define oNFECC 0x14
#define rNFCONF (*(volatile unsigned int *)0x4e000000)
#define rNFCMD (*(volatile unsigned char *)0x4e000004)
#define rNFADDR (*(volatile unsigned char *)0x4e000008)
#define rNFDATA (*(volatile unsigned char *)0x4e00000c)
#define rNFSTAT (*(volatile unsigned int *)0x4e000010)
#define rNFECC (*(volatile unsigned int *)0x4e000014)
#define rNFECC0 (*(volatile unsigned char *)0x4e000014)
#define rNFECC1 (*(volatile unsigned char *)0x4e000015)
#define rNFECC2 (*(volatile unsigned char *)0x4e000016)
#endif
至此tocore2440.h文件修正结束
b.树立目录/board/tocore/tocore2440,将/board/samsung/smdk2440下的文件复制至/board/tocore/tocore2440下,复制nand_read.c(开发板自带)文件至该目录下。修正Makefile文件(line28)
COBJS
c.修正lowlevel_init.S文件,增加如下支撑2440代码:
#define Trp
#define REFCNT
#else
#define Trp
#define REFCNT
#endif
#define M_PDIV
#define M_SDIV
#endif
#endif
在#elif USB_CLOCK==1之后修正为:
//#define U_M_MDIV
//#define U_M_PDIV
#if defined(CONFIG_S3C2440)
#define U_M_MDIV 0x38
#define U_M_PDIV 0x2
#endif
修正board_init()函数:
将gpio->GPGCON的值改为 0xFF95FF3A;
将gpio->GPHCON 的值改为 0x0016FAAA
在gpio->GPHUP = 0x000007FF之后增加一下宏界说:
gpio->EXTINT0=0x22222222;
gpio->EXTINT1=0x22222222;
gpio->EXTINT2=0x22222222;
在dcache_enable()函数之后增加以下低昂等操作代码:
#if defined(CONFIG_TOCORE2440_LED)
#endif
在board_init()函数之后增加以下函数:
#ifdef CONFIG_DRIVER_DM9000
int board_eth_init(bd_t *bis)
{
}
#endif
至此tocore2440.c文件修正结束
//bl coloured_LED_init
//bl red_LED_on
在#if defined (CONFIG_S3C2400) || defined (CONFIG_S3C2410)之后增加2440的支撑:|| defined(CONFIG_S3C2440)
2)在line146之后增加对时钟设置代码:
#define CLK_CTL_BASE
#define MDIV_405
#define PSDIV_405
#define MDIV_200
#define PSDIV_200
#endif
在line163之后增加作业频率设置汇编代码
#if defined(CONFIG_S3C2440)
minis3c2440移植之uboot移植
U-boot移植(以下步骤适用于s3c2440开发板)1、修改Makefile文件:a修改交叉编译宏(CROSS_COMPILE?=)修改为(CROSS_COMPILE?=arm-linux-);
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qiche/adas/260529.html