nand set up

Nand Bootstrap v0.1
NAND chip (id: 0xecf10095): 4 address cycle, 2048 page size, 64 pages/block
Boot image offset: 0x140000
Load sdram addres: 0x0
Booting image ...
0567Will set the following freq...
PLL1: 480 MHz, PLL3: 648 MHz, CPU freq: 480 MHz, AHB freq: 240 MHz, DDR freq: 480 MHz
go...

*********************************************
Please input Space to run Linux
Please input ESC to run UBOOT
Please input . to run burn-in
Otherwise, system will run Linux after 5 sec
*********************************************
Load image from NAND offset 0x3c0000 to sdram 0x4000000
Jump 0x4000000


U-Boot 2008.10 (Jul 20 2011 - 17:47:11)

I2C:   ready
DRAM:  128 MB
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   FTGMAC#0
Hit any key to stop autoboot:  0

=> help

?       - alias for 'help'
autoscr - run script from memory
base - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp - boot image via network using BOOTP/TFTP protocol
cmp - memory compare
coninfo - print console devices and information
cp - memory copy
crc32 - checksum calculation
echo    - echo args to console
fsinfo - print information about filesystems
fsload - load binary file from a filesystem image
go      - start application at address 'addr'
help    - print online help
icrc32  - checksum calculation
iloop   - infinite loop on address range
imd     - i2c memory display
iminfo  - print header information for application image
imm     - i2c memory modify (auto-incrementing)
imw     - memory write (fill)
imxtract- extract a part of a multi-image
inm     - memory modify (constant address)
iprobe  - probe to discover valid I2C chip addresses
itest - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop - infinite loop on address range
ls - list files in a directory (default /)
md - memory display
mm - memory modify (auto-incrementing)
mtest - simple RAM test
mw - memory write (fill)
nand - NAND sub-system
nboot   - boot from NAND device
nfs - boot image via network using NFS protocol
nm - memory modify (constant address)
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
tftpboot- boot image via network using TFTP protocol
version - print monitor version

 

=> printenv
bootargs=
bootcmd=nand read 0x4000000 0x500000 0x1000000;go 0x4000000
bootdelay=3
baudrate=38400
ethaddr=00:42:70:00:30:22
ethact=FTGMAC#0
ipaddr=192.168.1.244
serverip=192.168.1.111
gatewayip=192.168.1.1
netmask=255.255.255.0
ver=U-Boot 2008.10 (Jul 20 2011 - 17:47:11)

Environment size: 271/32764 bytes

 

=> setenv ipaddr 192.168.1.244

=> saveenv

掉电重启

 

pc机上打开Cisco TFTP Server,并把需要的文件bootsImageNand放在TFTP Server的根目录上

 

=> tftpboot 0x4000000 bootsImageNand
FTMAC with AR PHY support
HALF
PHY_SPEED_100M
Using eth0 device
TFTP from server 192.168.1.111; our IP address is 192.168.1.244
Filename 'bootsImageNand'.
Load address: 0x4000000
Loading: t RD_REQ, file: bootsImageNand
#################################################################
  ##############################
done
Bytes transferred = 7471944 (720348 hex)

 

=> nand erase 0x00500000 0x1000000

NAND erase: device 0 offset 0x500000, size 0x1000000
Erasing at 0x14e0000 -- 100% complete.
OK

 

=> nand write 0x4000000 0x00500000 0x1000000

NAND write: device 0 offset 0x500000, size 0x1000000
 16777216 bytes written: OK

 

手动的话,可以直接go 0x4000000

 

 

### NAND闪存擦除操作对寿命的影响 NAND闪存在数据存储设备中扮演着重要角色,然而其擦除机制显著影响器件的使用寿命。每次执行擦除操作时,浮栅晶体管上的电荷会被移除,这一过程会对单元造成物理损伤[^2]。 #### 擦除操作的工作原理 在NAND架构下,最小可独立擦除的数据单位被称为“块”,而读写则可以按更小粒度——页来进行。由于擦除只能针对整个块实施,当某个位置频繁更新时,会引发额外开销:旧版本所在的整块需先被复制到临时空间,在完成新内容写入后再将未修改部分迁回并最终抹去原块中的全部记录[^1]。 这种特性意味着即使只是改写了少量页面也会触发大规模重定位活动,进而加速磨损进程。为了缓解此现象带来的负面影响,固态硬盘控制器采用了多种策略来优化管理方式: - **磨损均衡算法**:通过动态分配逻辑地址映射至不同物理区块的方法,使得各处得到均匀利用机会,从而延长整体可用时间。 - **垃圾回收机制**:定期整理碎片化区域内的有效片段,并集中处理失效或不再使用的扇区,减少不必要的重复清除次数。 ```python def wear_leveling_algorithm(logical_address, physical_blocks): """ 实现简单的磨损平衡算法 参数: logical_address (int): 传入要访问的逻辑地址 physical_blocks (list): 当前所有物理块的状态列表 返回: int: 应该实际写入的目标物理块索引 """ min_wear_block_index = physical_blocks.index(min(physical_blocks)) # 更新对应物理块的使用计数器 physical_blocks[min_wear_block_index] += 1 return min_wear_block_index def garbage_collection(valid_pages_per_block, blocks_to_clean_up): """ 执行垃圾收集流程 参数: valid_pages_per_block (dict): 各个待清理块内有效的页集合字典 blocks_to_clean_up (set): 需要进行GC操作的块编号集合 动作: 将valid_pages_per_block里指定的有效页迁移出去, 并准备彻底清空blocks_to_clean_up里的每一个成员 """ pass ``` 尽管采取了一系列措施试图减轻因擦除所带来的损害,但不可避免的是随着时间和操作频率增加,任何基于浮动门技术构建的产品都会逐渐趋向于达到极限状态。制造商通常会在产品规格书中给出预期循环耐受能力指标作为参考依据[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值