tkernel_2/monitor/driver/flash/src/cfi.c | bare source | permlink (0.01 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * cfi.c 17: * 18: * CFI(Intel) Flash ROM specification 19: */ 20: 21: #include "flash.h" 22: 23: /* 24: Flash ROM specification: 25: Intel 28F256P30B 32MB (256Mbits) 26: 32 KB x 4 27: 128 KB x 255 28: 29: command: 30: ba: Block Addr, xa: Any Addr, sr: Status Reg, xsr: extend Status Reg. 31: 32: Reset(Read Array): 33: xa<-FF 34: Block Erase: 35: ba<-20, xa<-D0, sr<-xa & check 36: Write (via Buffer 16 words): 37: ba<-E8, xsr<-xa & check, ba<-15(count), da<-data, .. 38: xa<-D0, sr<-xa & check 39: Write: 40: xa<-40(10), da<-data, sr<-xa & check 41: Read sr: 42: xa<-70, sr<-xa, if any error, xa<-50 (clear sr) 43: sr: b7:0x80 1:Ready, 0:busy 44: b5:0x20 1:Error Erase 45: b4:0x10 1:Error Set Lock-bit 46: b3:0x08 1:Low Voltage Error 47: b1:0x02 1:Locked 48: xsr:b7:0x80 1:WriteBuffer Available 49: Clear Lock-bits: 50: xa<-60, xa<-D0, sr<-xa & check 51: ID read: 52: xa<-90, man-id<- ba:0, dev-id <- ba:2 53: man-id: 89 Intel 54: dev-id: 001C 28F256P30B 55: */ 56: 57: /* 58: * CFI(Intel) Flash ROM specification 59: */ 60: EXPORT const JEDEC_SPEC JedecSpec[] = { 61: { 0x0089, 0x001c, 0x0000, 0x0000, 32, 0, 0x8888, 0x8000 }, /* 28F256P30B */ 62: }; 63: 64: EXPORT const W N_JedecSpec = sizeof(JedecSpec) / sizeof(JEDEC_SPEC);