Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212973

Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller

From Cyrille Pitchen <cyrille.pitchen@atmel.com>
Newsgroups linux.kernel
Subject Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller
Date 2015-08-25 13:30 +0200
Message-ID <q1kAr-51z-29@gated-at.bofh.it> (permalink)
References <q0X18-4Km-3@gated-at.bofh.it> <q0X18-4Km-1@gated-at.bofh.it> <q1bx8-oq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi!

Le 25/08/2015 03:44, Bean Huo 霍斌斌 (beanhuo) a écrit :
> 
>> +	nor->read_reg = atmel_qspi_read_reg;
>> +	nor->write_reg = atmel_qspi_write_reg;
>> +	nor->read = atmel_qspi_read;
>> +	nor->write = atmel_qspi_write;
>> +	nor->erase = atmel_qspi_erase;
>> +	nor->set_protocol = atmel_qspi_set_protocol;
> 
> This is very good, the structure of spi_nor should add a hook function to notify spi controller 
> That spi nor transfer protocol already changed.
> 
>> +
>> +	if (of_modalias_node(child, modalias, sizeof(modalias)) < 0) {
>> +		err = -ENODEV;
>> +		goto release_channel;
>> +	}
>> +
>> +	err = of_property_read_u32(child, "spi-max-frequency", &aq->clk_rate);
>> +	if (err < 0)
>> +		goto release_channel;
>> +
>> +	err = atmel_qspi_init(aq);
>> +	if (err)
>> +		goto release_channel;
>> +
>> +	nor->dev->of_node = child;
>> +	err = spi_nor_scan(nor, modalias, SPI_NOR_QUAD);
>> 		goto release_channel;
>> +
> 
> 
> .......
> 
>> static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd)  {
>  	return mtd->priv;
>> @@ -944,6 +960,11 @@ static int micron_quad_enable(struct spi_nor *nor)
>> 		return ret;
>> 	}
>>
>> +	/* switch protocol to Quad CMD 4-4-4 */
>> +	ret = spi_nor_set_protocol(nor, SPI_PROTO_4_4_4);
>> +	if (ret)
>> +		return ret;
>> +
> 
> This make sense,from spi nor side,once its protocol being changed,
> Mtd layer must notify this status to spi nor controller immediately,
> And spi nor controller also should re-adjust its protocol.
> Otherwise, following reading SR operation will fail. 
> 
>>
>> 	ret = spi_nor_wait_till_ready(nor);
>> 	if (ret)
>> 		return ret;
> 
> If my ack has any value in here, feel free to add it.
> 
> Acked-by: Bean Huo <beanhuo@micron.com>
> 

Since your comments deal with the protocol change, I'll add your ack to the
first patch of the series:
"mtd: spi-nor: notify (Q)SPI controller about protocol change"

Thanks for your review!

Best regards,

Cyrille

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2015-08-24 12:20 +0200
  Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Marek Vasut <marex@denx.de> - 2015-08-24 13:10 +0200
    Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-08-24 15:00 +0200
      Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Marek Vasut <marex@denx.de> - 2015-08-24 15:20 +0200
    Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2015-08-24 19:10 +0200
      Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Marek Vasut <marex@denx.de> - 2015-08-24 19:50 +0200
        Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Jonas Gorski <jogo@openwrt.org> - 2015-08-25 11:50 +0200
          Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2015-08-25 12:30 +0200
    Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2015-08-25 12:20 +0200
      Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Marek Vasut <marex@denx.de> - 2015-08-25 12:30 +0200
        Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Brian Norris <computersforpeace@gmail.com> - 2015-08-25 18:00 +0200
  RE: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Bean Huo 霍斌斌 (beanhuo)   <beanhuo@micron.com> - 2015-08-25 03:50 +0200
    Re: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for  Atmel QSPI controller Cyrille Pitchen <cyrille.pitchen@atmel.com> - 2015-08-25 13:30 +0200

csiph-web