/* Query the Atmel flash ID Parameter: data: buffer to store the ID queried Return: SUCCESS on success, otherwise FAIL  */
int spi_nor_query_atmel(uint8_t *data)
/* Query the Atmel flash ID Parameter: data: buffer to store the ID queried Return: SUCCESS on success, otherwise FAIL  */
int spi_nor_query_atmel(uint8_t *data)
{
    spi_nor_tx_buf[3] = JEDEC_ID;
    if (ecspi_xfer(dev_spi_nor, spi_nor_tx_buf, spi_nor_rx_buf, 20 * 8) == FALSE) {
    	return FAIL;
    }
    data[0] = spi_nor_rx_buf[0];
    data[1] = spi_nor_rx_buf[1];
    data[2] = spi_nor_rx_buf[2];
    data[3] = spi_nor_rx_buf[3];
    return SUCCESS;
}