}
static void denali_setup_dma64(struct denali_nand_info *denali,
- dma_addr_t dma_addr, int page, int write)
+ dma_addr_t dma_addr, int page, bool write)
{
uint32_t mode;
const int page_count = 1;
* burst len = 64 bytes, the number of pages
*/
denali->host_write(denali, mode,
- 0x01002000 | (64 << 16) | (write << 8) | page_count);
+ 0x01002000 | (64 << 16) |
+ (write ? BIT(8) : 0) | page_count);
/* 2. set memory low address */
denali->host_write(denali, mode, lower_32_bits(dma_addr));
}
static void denali_setup_dma32(struct denali_nand_info *denali,
- dma_addr_t dma_addr, int page, int write)
+ dma_addr_t dma_addr, int page, bool write)
{
uint32_t mode;
const int page_count = 1;
/* 1. setup transfer type and # of pages */
denali->host_write(denali, mode | page,
- 0x2000 | (write << 8) | page_count);
+ 0x2000 | (write ? BIT(8) : 0) | page_count);
/* 2. set memory high address bits 23:8 */
denali->host_write(denali, mode | ((dma_addr >> 16) << 8), 0x2200);
}
static int denali_pio_xfer(struct denali_nand_info *denali, void *buf,
- size_t size, int page, int write)
+ size_t size, int page, bool write)
{
if (write)
return denali_pio_write(denali, buf, size, page);
}
static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,
- size_t size, int page, int write)
+ size_t size, int page, bool write)
{
dma_addr_t dma_addr;
uint32_t irq_mask, irq_status, ecc_err_mask;
}
static int denali_page_xfer(struct nand_chip *chip, void *buf, size_t size,
- int page, int write)
+ int page, bool write)
{
struct denali_nand_info *denali = to_denali(chip);
int stat = 0;
int ret;
- ret = denali_page_xfer(chip, buf, mtd->writesize, page, 0);
+ ret = denali_page_xfer(chip, buf, mtd->writesize, page, false);
if (ret && ret != -EBADMSG)
return ret;
{
struct mtd_info *mtd = nand_to_mtd(chip);
- return denali_page_xfer(chip, (void *)buf, mtd->writesize, page, 1);
+ return denali_page_xfer(chip, (void *)buf, mtd->writesize, page, true);
}
static int denali_setup_data_interface(struct nand_chip *chip, int chipnr,
int ret;
if (ioread32(denali->reg + FEATURES) & FEATURES__DMA)
- denali->dma_avail = 1;
+ denali->dma_avail = true;
if (denali->dma_avail) {
int dma_bit = denali->caps & DENALI_CAP_DMA_64BIT ? 64 : 32;
if (ret) {
dev_info(denali->dev,
"Failed to set DMA mask. Disabling DMA.\n");
- denali->dma_avail = 0;
+ denali->dma_avail = false;
}
}