Lines Matching refs:buf
18 static int flash_cmd(struct spi_slave *slave, uchar cmd, uchar *buf, int len) in flash_cmd() argument
20 buf[0] = cmd; in flash_cmd()
21 return spi_xfer(slave, 8 * len, buf, buf, SPI_XFER_BEGIN | SPI_XFER_END); in flash_cmd()
26 uchar buf[2]; in flash_status() local
27 if (flash_cmd(slave, CMD_STAT, buf, sizeof(buf))) in flash_status()
29 return buf[1]; in flash_status()
35 uchar buf[4]; in flash_set_pow2() local
37 buf[1] = 0x2a; in flash_set_pow2()
38 buf[2] = 0x80; in flash_set_pow2()
39 buf[3] = 0xa6; in flash_set_pow2()
41 ret = flash_cmd(slave, CMD_CFG, buf, sizeof(buf)); in flash_set_pow2()
58 uchar buf[4]; in flash_check() local
60 ret = flash_cmd(slave, CMD_ID, buf, sizeof(buf)); in flash_check()
64 if (buf[1] != 0x1F) { in flash_check()
65 printf("atmel flash not found (id[0] = %#x)\n", buf[1]); in flash_check()
69 if ((buf[2] >> 5) != 0x1) { in flash_check()
70 printf("AT45 flash not found (id[0] = %#x)\n", buf[2]); in flash_check()