移植環境
1,主機環境:VMare下CentOS 5.5 ,1G內存。
2,集成開發環境:Elipse IDE
3,編譯編譯環境:arm-linux-gcc v4.4.3,arm-none-eabi-gcc v4.5.1。
4,開發板:mini2440,2M nor flash,128M nand flash。
5,u-boot版本:u-boot-2009.08
6,參考文章:
10.1,實現u-boot的I2C EEPROM功能
mini2440開發板上的AT24C08A芯片提供了8kbyte的非易失的EEPROM存儲空間,而且是通過I2C協議進行讀寫的,U-boot提供了對I2C和EEPROM的操作支持。
打開/include/configs/mini2440.h,定位到206行附近,加入宏定義:
/*
* SD Card support
* */
#if 1
#define CONFIG_CMD_MMC
#define CONFIG_MMC 1
#define CONFIG_MMC_S3C 1 /* Enabling the MMC driver */
#define CFG_MMC_BASE 0xff000000
#endif
/**
* I2C and EEPROM support
*/
#if 1
#define CONFIG_CMD_EEPROM
#define CONFIG_CMD_I2C
#define CONFIG_DRIVER_S3C24X0_I2C 1 /* we use the buildin I2C controller */
#define CONFIG_HARD_I2C 1 /* I2C with hardware support */
#define CONFIG_SYS_I2C_SPEED 100000 /* I2C speed and slave address */
#define CONFIG_SYS_I2C_SLAVE 0x7F
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM at24c08 */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */
/* mask of address bits that overflow into the 'EEPROM chip address' */
#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x07
#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* The Catalyst CAT24WC08 has */
/* 16 byte page write mode using*/
/* last 4 bits of the address */
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* and takes up to 10 msec */
#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
//#define CONFIG_ENV_IS_IN_EEPROM 1 /* use EEPROM for environment vars */
//#define CONFIG_ENV_OFFSET 0x000 /* environment starts at offset 0 */
//#define CONFIG_ENV_SIZE 0x400 /* 1KB */
#endif
10.2,重新編譯測試
待編譯完成后,nor檔下載nand檔啟動,操作如下:
[u-boot@MINI2440]# help i2c
i2c - I2C sub-system
Usage:
i2c speed [speed] - show or set I2C bus speed
i2c md chip address[.0, .1, .2] [# of objects] - read from I2C device
i2c mm chip address[.0, .1, .2] - write to I2C device (auto-incrementing)
i2c mw chip address[.0, .1, .2] value [count] - write to I2C device (fill)
i2c nm chip address[.0, .1, .2] - write to I2C device (constant address)
i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum
i2c probe - show devices on the I2C bus
i2c reset - re-init the I2C Controller
i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device
[u-boot@MINI2440]# i2c speed
Current bus speed=100000
[u-boot@MINI2440]# i2c probe
Valid chip addresses: 50 51 52 53
[u-boot@MINI2440]# i2c
在上面的mini2440.h文件中, CONFIG_ENV_IS_IN_EEPROM 是注釋掉的,如果想將環境變量保存的位置設置在EEPROM中,需要將nand flash的CONFIG_ENV_IS_IN_NAND 的相關幾行代碼注釋掉,將上面注釋掉的幾行代碼恢復即可。這里先不作修改了。
上一篇:u-boot-2009.08在mini2440上的移植 增加USB功能
下一篇:Qt-embedded-linux-opensource-src-4.5.1移植到mini2440開發板技術說明
推薦閱讀最新更新時間:2025-04-17 22:44



設計資源 培訓 開發板 精華推薦
- LTC3110IUF 3.6V 自主備份和充電應用的典型應用電路
- LTC3622IDE 5V/3.3V Vout、突發模式操作、同相開關同步降壓穩壓器的典型應用電路
- 多媒體小鍵盤ch552g
- MIC5268 的典型應用:具有電源良好狀態的 150mA Cap CMOS LDO 穩壓器
- OP213FSZ-REEL假接地發生器的典型應用
- LTC3403,WCDMA 發射機電源
- 使用 NXP Semiconductors 的 UBA2000T 的參考設計
- 使用 ON Semiconductor 的 LV5215LF 的參考設計
- ADP2118、1.8V、3A降壓穩壓器的典型應用,與外部時鐘同步至1MHz同相
- Disaster Transport Jr 吉他延遲效果器
- 閱1SP0350V SCALE-2單通道即插即用型門極驅動器,參與PI答題享好禮!
- 親歷易電源——易電源電源模塊試用!
- TE 福利月|有獎調查、技術干貨、限時折扣
- 有獎征集:推薦你用過或了解的好用的電源芯片
- 報名2019年ST全國巡回研討會,贏三重好禮
- 開啟Altera SoC體驗之旅,玩轉Altera Cyclone V系列SoC
- 【瓜分2500元紅包】票選2024 DigiKey “感知萬物,樂享生活”創意大賽人氣作品TOP3!
- 【TI 教室】學電源,曬成績,挖樓有禮!
- 合泰ESK32-360 開發板“拍了拍”你,免費測評在等你
- 有獎直播|Keysight World 2020【電信基礎設施、云與人工智能分論壇】