Fixes a couple of errors in MTD NAND logic
This commit is contained in:
parent
afb0209207
commit
881c12cad8
@ -904,14 +904,14 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
|
||||
size = (uint64_t)onfi.pagesperblock *
|
||||
(uint64_t)onfi.blocksperlun *
|
||||
(uint64_t)onfi.pagesize;
|
||||
DEBUGASSERT(size < (uint64_t)(1 << 21));
|
||||
|
||||
DEBUGASSERT(size < ((uint64_t)1 << 36));
|
||||
model->devsize = (uint16_t)(size >> 20);
|
||||
|
||||
size = (uint64_t)onfi.pagesperblock *
|
||||
(uint64_t)onfi.pagesize;
|
||||
DEBUGASSERT(size < (uint64_t)(1 << 11));
|
||||
|
||||
DEBUGASSERT(size < ((uint64_t)1 << 26));
|
||||
model->blocksize = (uint16_t)(size >> 10);
|
||||
|
||||
switch (onfi.pagesize)
|
||||
|
@ -282,7 +282,7 @@ int onfi_read(uintptr_t cmdaddr, uintptr_t addraddr, uintptr_t dataaddr,
|
||||
fvdbg("cmdaddr=%08x addraddr=%08x dataaddr=%08x\n",
|
||||
(int)cmdaddr, (int)addraddr, (int)dataaddr);
|
||||
|
||||
if (onfi_compatible(cmdaddr, addraddr, dataaddr))
|
||||
if (!onfi_compatible(cmdaddr, addraddr, dataaddr))
|
||||
{
|
||||
fdbg("ERROR: No ONFI compatible device detected\n");
|
||||
return -ENODEV;
|
||||
@ -457,7 +457,7 @@ bool onfi_ebidetect(uintptr_t cmdaddr, uintptr_t addraddr,
|
||||
{
|
||||
uint32_t timer;
|
||||
uint8_t rc;
|
||||
bool found = 0;
|
||||
bool found = false;
|
||||
uint8_t ids[4];
|
||||
uint8_t i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user