[U-Boot] [v3 PATCH 01/12] spi, atmel: move CONFIG_SYS_SPI_WRITE_TOUT into common header

Jagan Teki jagannadh.teki at gmail.com
Fri Oct 31 12:18:04 CET 2014


On 31 October 2014 13:00, Heiko Schocher <hs at denx.de> wrote:
> move CONFIG_SYS_SPI_WRITE_TOUT into drivers/spi/atmel_spi.h
> and define a default value. Delete this define in the board
> config files, where it is possible (all boards use currently
> the same value).
>
> Signed-off-by: Heiko Schocher <hs at denx.de>
> ---
>
> Changes in v3:
> rebased against 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6
>
> Changes in v2:
> rebased against d58a9451e7339ed4cf2b2627e534611f427fb791
> new in v2
>
>  drivers/spi/atmel_spi.h         | 4 ++++
>  include/configs/afeb9260.h      | 1 -
>  include/configs/at91sam9260ek.h | 1 -
>  include/configs/at91sam9261ek.h | 1 -
>  include/configs/at91sam9263ek.h | 1 -
>  include/configs/at91sam9rlek.h  | 1 -
>  include/configs/ethernut5.h     | 1 -
>  include/configs/meesc.h         | 1 -
>  include/configs/otc570.h        | 1 -
>  include/configs/pm9261.h        | 1 -
>  include/configs/pm9263.h        | 1 -
>  include/configs/sbc35_a9g20.h   | 1 -
>  include/configs/tny_a9260.h     | 1 -
>  include/configs/usb_a9263.h     | 1 -
>  14 files changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/spi/atmel_spi.h b/drivers/spi/atmel_spi.h
> index d240945..1538a23 100644
> --- a/drivers/spi/atmel_spi.h
> +++ b/drivers/spi/atmel_spi.h
> @@ -94,3 +94,7 @@ static inline struct atmel_spi_slave *to_atmel_spi(struct spi_slave *slave)
>         readl(as->regs + ATMEL_SPI_##reg)
>  #define spi_writel(as, reg, value)                             \
>         writel(value, as->regs + ATMEL_SPI_##reg)
> +
> +#if !defined(CONFIG_SYS_SPI_WRITE_TOUT)
> +#define CONFIG_SYS_SPI_WRITE_TOUT      (5 * CONFIG_SYS_HZ)
> +#endif
> diff --git a/include/configs/afeb9260.h b/include/configs/afeb9260.h
> index 14bac15..932a309 100644
> --- a/include/configs/afeb9260.h
> +++ b/include/configs/afeb9260.h
> @@ -77,7 +77,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5 * CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         2
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1    0xD0000000      /* CS1 */
> diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
> index 73917b0..72247cc 100644
> --- a/include/configs/at91sam9260ek.h
> +++ b/include/configs/at91sam9260ek.h
> @@ -135,7 +135,6 @@
>  #ifndef CONFIG_AT91SAM9G20EK_2MMC
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH           1
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         2
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1    0xD0000000      /* CS1 */
> diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
> index 226f8c1..cb16bda 100644
> --- a/include/configs/at91sam9261ek.h
> +++ b/include/configs/at91sam9261ek.h
> @@ -107,7 +107,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         2
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3    0xD0000000      /* CS3 */
> diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
> index b666d94..fa19e8b 100644
> --- a/include/configs/at91sam9263ek.h
> +++ b/include/configs/at91sam9263ek.h
> @@ -119,7 +119,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH           1
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define AT91_SPI_CLK                   15000000
> diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h
> index b8d5dd1..d5f0197 100644
> --- a/include/configs/at91sam9rlek.h
> +++ b/include/configs/at91sam9rlek.h
> @@ -100,7 +100,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH                   1
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define AT91_SPI_CLK                           15000000
> diff --git a/include/configs/ethernut5.h b/include/configs/ethernut5.h
> index 4c69af6..ce61a16 100644
> --- a/include/configs/ethernut5.h
> +++ b/include/configs/ethernut5.h
> @@ -78,7 +78,6 @@
>
>  /* SPI */
>  #define CONFIG_ATMEL_SPI
> -#define CONFIG_SYS_SPI_WRITE_TOUT      (5 * CONFIG_SYS_HZ)
>  #define AT91_SPI_CLK                   15000000
>
>  /* Serial port */
> diff --git a/include/configs/meesc.h b/include/configs/meesc.h
> index 86ce5f2..955d0e2 100644
> --- a/include/configs/meesc.h
> +++ b/include/configs/meesc.h
> @@ -124,7 +124,6 @@
>  #ifdef CONFIG_SYS_USE_DATAFLASH
>  # define CONFIG_ATMEL_DATAFLASH_SPI
>  # define CONFIG_HAS_DATAFLASH
> -# define CONFIG_SYS_SPI_WRITE_TOUT             (5 * CONFIG_SYS_HZ)
>  # define CONFIG_SYS_MAX_DATAFLASH_BANKS                1
>  # define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0   0xC0000000      /* CS0 */
>  # define AT91_SPI_CLK                          15000000
> diff --git a/include/configs/otc570.h b/include/configs/otc570.h
> index 629967d..2390beb 100644
> --- a/include/configs/otc570.h
> +++ b/include/configs/otc570.h
> @@ -174,7 +174,6 @@
>  #ifdef CONFIG_SYS_USE_DATAFLASH
>  # define CONFIG_ATMEL_DATAFLASH_SPI
>  # define CONFIG_HAS_DATAFLASH
> -# define CONFIG_SYS_SPI_WRITE_TOUT             (5 * CONFIG_SYS_HZ)
>  # define CONFIG_SYS_MAX_DATAFLASH_BANKS                1
>  # define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0   0xC0000000      /* CS0 */
>  # define AT91_SPI_CLK                          15000000
> diff --git a/include/configs/pm9261.h b/include/configs/pm9261.h
> index 4a71927..0746056 100644
> --- a/include/configs/pm9261.h
> +++ b/include/configs/pm9261.h
> @@ -202,7 +202,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5 * CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3    0xD0000000      /* CS3 */
> diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
> index d9c04d1..f0f12af 100644
> --- a/include/configs/pm9263.h
> +++ b/include/configs/pm9263.h
> @@ -216,7 +216,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH                   1
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5 * CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000      /* CS0 */
>  #define AT91_SPI_CLK                           15000000
> diff --git a/include/configs/sbc35_a9g20.h b/include/configs/sbc35_a9g20.h
> index a1b5751..e7c35ec 100644
> --- a/include/configs/sbc35_a9g20.h
> +++ b/include/configs/sbc35_a9g20.h
> @@ -80,7 +80,6 @@
>  #define CONFIG_SPI
>  #define CONFIG_CMD_SPI
>  #define CONFIG_ATMEL_SPI
> -#define CONFIG_SYS_SPI_WRITE_TOUT      (5 * CONFIG_SYS_HZ)
>
>  #define CONFIG_CMD_EEPROM
>  #define CONFIG_SPI_M95XXX
> diff --git a/include/configs/tny_a9260.h b/include/configs/tny_a9260.h
> index 32f6b00..79c7fc5 100644
> --- a/include/configs/tny_a9260.h
> +++ b/include/configs/tny_a9260.h
> @@ -85,7 +85,6 @@
>  #define CONFIG_SPI
>  #define CONFIG_CMD_SPI
>  #define CONFIG_ATMEL_SPI
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5 * CONFIG_SYS_HZ)
>
>  #define CONFIG_CMD_EEPROM
>  #define CONFIG_SPI_M95XXX
> diff --git a/include/configs/usb_a9263.h b/include/configs/usb_a9263.h
> index 3c54870..84571f6 100644
> --- a/include/configs/usb_a9263.h
> +++ b/include/configs/usb_a9263.h
> @@ -85,7 +85,6 @@
>  /* DataFlash */
>  #define CONFIG_ATMEL_DATAFLASH_SPI
>  #define CONFIG_HAS_DATAFLASH
> -#define CONFIG_SYS_SPI_WRITE_TOUT              (5*CONFIG_SYS_HZ)
>  #define CONFIG_SYS_MAX_DATAFLASH_BANKS         1
>  #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0    0xC0000000
>  #define AT91_SPI_CLK                           8000000
> --
> 1.8.3.1
>

Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki at gmail.com>

thanks!
-- 
Jagan.


More information about the U-Boot mailing list