mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/mtd_spi_nor: move printing of flash debug info
Move printing the flash information after deriving the capacity.
This commit is contained in:
parent
585928f23d
commit
50914cbf96
@ -378,16 +378,6 @@ static int mtd_spi_nor_init(mtd_dev_t *mtd)
|
|||||||
DEBUG("mtd_spi_nor_init: -> spi: %lx, cs: %lx, opcodes: %p\n",
|
DEBUG("mtd_spi_nor_init: -> spi: %lx, cs: %lx, opcodes: %p\n",
|
||||||
(unsigned long)dev->params->spi, (unsigned long)dev->params->cs, (void *)dev->params->opcode);
|
(unsigned long)dev->params->spi, (unsigned long)dev->params->cs, (void *)dev->params->opcode);
|
||||||
|
|
||||||
DEBUG("mtd_spi_nor_init: %" PRIu32 " bytes "
|
|
||||||
"(%" PRIu32 " sectors, %" PRIu32 " bytes/sector, "
|
|
||||||
"%" PRIu32 " pages, "
|
|
||||||
"%" PRIu32 " pages/sector, %" PRIu32 " bytes/page)\n",
|
|
||||||
mtd->pages_per_sector * mtd->sector_count * mtd->page_size,
|
|
||||||
mtd->sector_count, mtd->pages_per_sector * mtd->page_size,
|
|
||||||
mtd->pages_per_sector * mtd->sector_count,
|
|
||||||
mtd->pages_per_sector, mtd->page_size);
|
|
||||||
DEBUG("mtd_spi_nor_init: Using %u byte addresses\n", dev->params->addr_width);
|
|
||||||
|
|
||||||
if (dev->params->addr_width == 0) {
|
if (dev->params->addr_width == 0) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -418,6 +408,16 @@ static int mtd_spi_nor_init(mtd_dev_t *mtd)
|
|||||||
/ (mtd->pages_per_sector * mtd->page_size);
|
/ (mtd->pages_per_sector * mtd->page_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEBUG("mtd_spi_nor_init: %" PRIu32 " bytes "
|
||||||
|
"(%" PRIu32 " sectors, %" PRIu32 " bytes/sector, "
|
||||||
|
"%" PRIu32 " pages, "
|
||||||
|
"%" PRIu32 " pages/sector, %" PRIu32 " bytes/page)\n",
|
||||||
|
mtd->pages_per_sector * mtd->sector_count * mtd->page_size,
|
||||||
|
mtd->sector_count, mtd->pages_per_sector * mtd->page_size,
|
||||||
|
mtd->pages_per_sector * mtd->sector_count,
|
||||||
|
mtd->pages_per_sector, mtd->page_size);
|
||||||
|
DEBUG("mtd_spi_nor_init: Using %u byte addresses\n", dev->params->addr_width);
|
||||||
|
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
mtd_spi_cmd_read(dev, dev->params->opcode->rdsr, &status, sizeof(status));
|
mtd_spi_cmd_read(dev, dev->params->opcode->rdsr, &status, sizeof(status));
|
||||||
mtd_spi_release(dev);
|
mtd_spi_release(dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user