mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 01:02:19 +02:00
sf: move useful messages from debug to printf
At the moment, the default SPI flash subsystem is quite terse. Errors and successes both result in a generic message. So move the useful errors and useful successes to printf output by default. While we're here, also convert the messages to use print_size(). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
@@ -467,7 +467,7 @@ out:
|
|||||||
struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
|
struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
|
||||||
{
|
{
|
||||||
const struct atmel_spi_flash_params *params;
|
const struct atmel_spi_flash_params *params;
|
||||||
unsigned long page_size;
|
unsigned page_size;
|
||||||
unsigned int family;
|
unsigned int family;
|
||||||
struct atmel_spi_flash *asf;
|
struct atmel_spi_flash *asf;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -540,8 +540,9 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
|
|||||||
* params->blocks_per_sector
|
* params->blocks_per_sector
|
||||||
* params->nr_sectors;
|
* params->nr_sectors;
|
||||||
|
|
||||||
debug("SF: Detected %s with page size %lu, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, page_size, asf->flash.size);
|
params->name, page_size);
|
||||||
|
print_size(asf->flash.size, "\n");
|
||||||
|
|
||||||
return &asf->flash;
|
return &asf->flash;
|
||||||
|
|
||||||
|
@@ -330,8 +330,9 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
|
|||||||
mcx->flash.size = params->page_size * params->pages_per_sector
|
mcx->flash.size = params->page_size * params->pages_per_sector
|
||||||
* params->sectors_per_block * params->nr_blocks;
|
* params->sectors_per_block * params->nr_blocks;
|
||||||
|
|
||||||
printf("SF: Detected %s with page size %u, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, params->page_size, mcx->flash.size);
|
params->name, params->page_size);
|
||||||
|
print_size(mcx->flash.size, "\n");
|
||||||
|
|
||||||
return &mcx->flash;
|
return &mcx->flash;
|
||||||
}
|
}
|
||||||
|
@@ -343,8 +343,9 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
|
|||||||
spsn->flash.size = params->page_size * params->pages_per_sector
|
spsn->flash.size = params->page_size * params->pages_per_sector
|
||||||
* params->nr_sectors;
|
* params->nr_sectors;
|
||||||
|
|
||||||
debug("SF: Detected %s with page size %u, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, params->page_size, spsn->flash.size);
|
params->name, params->page_size);
|
||||||
|
print_size(spsn->flash.size, "\n");
|
||||||
|
|
||||||
return &spsn->flash;
|
return &spsn->flash;
|
||||||
}
|
}
|
||||||
|
@@ -106,7 +106,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
|
|||||||
|
|
||||||
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
|
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
|
||||||
if (!spi) {
|
if (!spi) {
|
||||||
debug("SF: Failed to set up slave\n");
|
printf("SF: Failed to set up slave\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
|
printf("SF: Unsupported manufacturer %02X\n", idcode[0]);
|
||||||
flash = NULL;
|
flash = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -364,8 +364,9 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
|
|||||||
stm->flash.read = sst_read_fast;
|
stm->flash.read = sst_read_fast;
|
||||||
stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
|
stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
|
||||||
|
|
||||||
debug("SF: Detected %s with page size %u, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, SST_SECTOR_SIZE, stm->flash.size);
|
params->name, SST_SECTOR_SIZE);
|
||||||
|
print_size(stm->flash.size, "\n");
|
||||||
|
|
||||||
/* Flash powers up read-only, so clear BP# bits */
|
/* Flash powers up read-only, so clear BP# bits */
|
||||||
sst_unlock(&stm->flash);
|
sst_unlock(&stm->flash);
|
||||||
|
@@ -365,8 +365,9 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
|
|||||||
stm->flash.size = params->page_size * params->pages_per_sector
|
stm->flash.size = params->page_size * params->pages_per_sector
|
||||||
* params->nr_sectors;
|
* params->nr_sectors;
|
||||||
|
|
||||||
debug("SF: Detected %s with page size %u, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, params->page_size, stm->flash.size);
|
params->name, params->page_size);
|
||||||
|
print_size(stm->flash.size, "\n");
|
||||||
|
|
||||||
return &stm->flash;
|
return &stm->flash;
|
||||||
}
|
}
|
||||||
|
@@ -289,7 +289,7 @@ out:
|
|||||||
struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
|
struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
|
||||||
{
|
{
|
||||||
const struct winbond_spi_flash_params *params;
|
const struct winbond_spi_flash_params *params;
|
||||||
unsigned long page_size;
|
unsigned page_size;
|
||||||
struct winbond_spi_flash *stm;
|
struct winbond_spi_flash *stm;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
@@ -325,8 +325,9 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
|
|||||||
* params->sectors_per_block
|
* params->sectors_per_block
|
||||||
* params->nr_blocks;
|
* params->nr_blocks;
|
||||||
|
|
||||||
debug("SF: Detected %s with page size %u, total %u bytes\n",
|
printf("SF: Detected %s with page size %u, total ",
|
||||||
params->name, page_size, stm->flash.size);
|
params->name, page_size);
|
||||||
|
print_size(stm->flash.size, "\n");
|
||||||
|
|
||||||
return &stm->flash;
|
return &stm->flash;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user