struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
{
const struct atmel_spi_flash_params *params;
- unsigned long page_size;
+ unsigned page_size;
unsigned int family;
struct atmel_spi_flash *asf;
unsigned int i;
* params->blocks_per_sector
* params->nr_sectors;
- debug("SF: Detected %s with page size %lu, total %u bytes\n",
- params->name, page_size, asf->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, page_size);
+ print_size(asf->flash.size, "\n");
return &asf->flash;
mcx->flash.size = params->page_size * params->pages_per_sector
* params->sectors_per_block * params->nr_blocks;
- printf("SF: Detected %s with page size %u, total %u bytes\n",
- params->name, params->page_size, mcx->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, params->page_size);
+ print_size(mcx->flash.size, "\n");
return &mcx->flash;
}
spsn->flash.size = params->page_size * params->pages_per_sector
* params->nr_sectors;
- debug("SF: Detected %s with page size %u, total %u bytes\n",
- params->name, params->page_size, spsn->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, params->page_size);
+ print_size(spsn->flash.size, "\n");
return &spsn->flash;
}
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
- debug("SF: Failed to set up slave\n");
+ printf("SF: Failed to set up slave\n");
return NULL;
}
break;
#endif
default:
- debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
+ printf("SF: Unsupported manufacturer %02X\n", idcode[0]);
flash = NULL;
break;
}
stm->flash.read = sst_read_fast;
stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
- debug("SF: Detected %s with page size %u, total %u bytes\n",
- params->name, SST_SECTOR_SIZE, stm->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, SST_SECTOR_SIZE);
+ print_size(stm->flash.size, "\n");
/* Flash powers up read-only, so clear BP# bits */
sst_unlock(&stm->flash);
stm->flash.size = params->page_size * params->pages_per_sector
* params->nr_sectors;
- debug("SF: Detected %s with page size %u, total %u bytes\n",
- params->name, params->page_size, stm->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, params->page_size);
+ print_size(stm->flash.size, "\n");
return &stm->flash;
}
struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
{
const struct winbond_spi_flash_params *params;
- unsigned long page_size;
+ unsigned page_size;
struct winbond_spi_flash *stm;
unsigned int i;
* params->sectors_per_block
* params->nr_blocks;
- debug("SF: Detected %s with page size %u, total %u bytes\n",
- params->name, page_size, stm->flash.size);
+ printf("SF: Detected %s with page size %u, total ",
+ params->name, page_size);
+ print_size(stm->flash.size, "\n");
return &stm->flash;
}