Re: [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-14 Thread Allen Martin
On Wed, Feb 13, 2013 at 02:30:26PM -0800, Stephen Warren wrote:
 On 02/12/2013 08:23 PM, Allen Martin wrote:
  Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
  for commonization and addition of tegra114_spi.
 
 This isn't logically quite right. Both types (sflash, slink) of SPI
 controller actually exist on Tegra20, so it isn't right to name them
 after the different chips. It is true that only one is kept for Tegra30
 (slink). As such, it might make sense to simply drop this patch.

Mostly my intention here was to try to make the SPI driver naming less
confusing and to make room for the new tegra114 SPI driver.  What do
you think of the following:

tegra_sflash: tegra20 sflash driver
tegra_slink: tegra20 and tegra30 slink driver
tegra_spi: tegra114 and later spi driver

 
   arch/arm/include/asm/arch-tegra/tegra_slink.h   |   84 --
   arch/arm/include/asm/arch-tegra/tegra_spi.h |   75 -
   arch/arm/include/asm/arch-tegra20/tegra20_spi.h |   75 +
   arch/arm/include/asm/arch-tegra30/tegra30_spi.h |   84 ++
   board/nvidia/common/board.c |2 +-
   board/nvidia/common/uart-spi-switch.c   |2 +-
   drivers/spi/Makefile|4 +-
   drivers/spi/tegra20_spi.c   |  330 
  ++
   drivers/spi/tegra30_spi.c   |  343 
  +++
   drivers/spi/tegra_slink.c   |  343 
  ---
   drivers/spi/tegra_spi.c |  330 
  --
   include/configs/cardhu.h|2 +-
   include/configs/trimslice.h |2 +-
   13 files changed, 838 insertions(+), 838 deletions(-)
   delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_slink.h
   delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_spi.h
   create mode 100644 arch/arm/include/asm/arch-tegra20/tegra20_spi.h
   create mode 100644 arch/arm/include/asm/arch-tegra30/tegra30_spi.h
   create mode 100644 drivers/spi/tegra20_spi.c
   create mode 100644 drivers/spi/tegra30_spi.c
   delete mode 100644 drivers/spi/tegra_slink.c
   delete mode 100644 drivers/spi/tegra_spi.c
 
 git format-patch -M might have made this easier to spot the changes
 during the renames, assuming there weren't too many edits to make it
 worthwhile.

Yes, sorry, I'll fix for next round.


 
 I didn't actually review the diffs, since I assume it was just a simple
 rename.

-Allen
-- 
nvpublic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-14 Thread Allen Martin
On Wed, Feb 13, 2013 at 02:36:10PM -0800, Stephen Warren wrote:
 On 02/12/2013 08:23 PM, Allen Martin wrote:
  Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
  for commonization and addition of tegra114_spi.
 
   board/nvidia/common/uart-spi-switch.c   |2 +-
 
 I tend to think we should just rip out the UART/SPI switch cruft; it's
 just not that useful.

Ok

-- 
nvpublic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-14 Thread Stephen Warren
On 02/14/2013 12:58 PM, Allen Martin wrote:
 On Wed, Feb 13, 2013 at 02:30:26PM -0800, Stephen Warren wrote:
 On 02/12/2013 08:23 PM, Allen Martin wrote:
 Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
 for commonization and addition of tegra114_spi.

 This isn't logically quite right. Both types (sflash, slink) of SPI
 controller actually exist on Tegra20, so it isn't right to name them
 after the different chips. It is true that only one is kept for Tegra30
 (slink). As such, it might make sense to simply drop this patch.
 
 Mostly my intention here was to try to make the SPI driver naming less
 confusing and to make room for the new tegra114 SPI driver.  What do
 you think of the following:
 
 tegra_sflash: tegra20 sflash driver
 tegra_slink: tegra20 and tegra30 slink driver

I'd suggest naming those tegra20_*.

 tegra_spi: tegra114 and later spi driver

... and that tegra114_spi. That way, it's obvious when those IP blocks
were introduced, which will help people know which driver they care about.

Looking closer at the Tegra114 TRM, it looks like they did declare
slink a deprecated name, so the Tegra114 block really should be called
SPI as you have it. So, disregard my comments about the compatible
value; nvidia,tegra114-spi looks like the correct choice now.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-13 Thread Stephen Warren
On 02/12/2013 08:23 PM, Allen Martin wrote:
 Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
 for commonization and addition of tegra114_spi.

This isn't logically quite right. Both types (sflash, slink) of SPI
controller actually exist on Tegra20, so it isn't right to name them
after the different chips. It is true that only one is kept for Tegra30
(slink). As such, it might make sense to simply drop this patch.

  arch/arm/include/asm/arch-tegra/tegra_slink.h   |   84 --
  arch/arm/include/asm/arch-tegra/tegra_spi.h |   75 -
  arch/arm/include/asm/arch-tegra20/tegra20_spi.h |   75 +
  arch/arm/include/asm/arch-tegra30/tegra30_spi.h |   84 ++
  board/nvidia/common/board.c |2 +-
  board/nvidia/common/uart-spi-switch.c   |2 +-
  drivers/spi/Makefile|4 +-
  drivers/spi/tegra20_spi.c   |  330 ++
  drivers/spi/tegra30_spi.c   |  343 
 +++
  drivers/spi/tegra_slink.c   |  343 
 ---
  drivers/spi/tegra_spi.c |  330 --
  include/configs/cardhu.h|2 +-
  include/configs/trimslice.h |2 +-
  13 files changed, 838 insertions(+), 838 deletions(-)
  delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_slink.h
  delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_spi.h
  create mode 100644 arch/arm/include/asm/arch-tegra20/tegra20_spi.h
  create mode 100644 arch/arm/include/asm/arch-tegra30/tegra30_spi.h
  create mode 100644 drivers/spi/tegra20_spi.c
  create mode 100644 drivers/spi/tegra30_spi.c
  delete mode 100644 drivers/spi/tegra_slink.c
  delete mode 100644 drivers/spi/tegra_spi.c

git format-patch -M might have made this easier to spot the changes
during the renames, assuming there weren't too many edits to make it
worthwhile.

I didn't actually review the diffs, since I assume it was just a simple
rename.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-13 Thread Stephen Warren
On 02/12/2013 08:23 PM, Allen Martin wrote:
 Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
 for commonization and addition of tegra114_spi.

  board/nvidia/common/uart-spi-switch.c   |2 +-

I tend to think we should just rip out the UART/SPI switch cruft; it's
just not that useful.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/14] tegra: spi: rename tegra SPI drivers

2013-02-12 Thread Allen Martin
Rename tegra SPI drivers to tegra20_spi and tegra30_spi in preparation
for commonization and addition of tegra114_spi.

Signed-off-by: Allen Martin amar...@nvidia.com
---
 arch/arm/include/asm/arch-tegra/tegra_slink.h   |   84 --
 arch/arm/include/asm/arch-tegra/tegra_spi.h |   75 -
 arch/arm/include/asm/arch-tegra20/tegra20_spi.h |   75 +
 arch/arm/include/asm/arch-tegra30/tegra30_spi.h |   84 ++
 board/nvidia/common/board.c |2 +-
 board/nvidia/common/uart-spi-switch.c   |2 +-
 drivers/spi/Makefile|4 +-
 drivers/spi/tegra20_spi.c   |  330 ++
 drivers/spi/tegra30_spi.c   |  343 +++
 drivers/spi/tegra_slink.c   |  343 ---
 drivers/spi/tegra_spi.c |  330 --
 include/configs/cardhu.h|2 +-
 include/configs/trimslice.h |2 +-
 13 files changed, 838 insertions(+), 838 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_slink.h
 delete mode 100644 arch/arm/include/asm/arch-tegra/tegra_spi.h
 create mode 100644 arch/arm/include/asm/arch-tegra20/tegra20_spi.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/tegra30_spi.h
 create mode 100644 drivers/spi/tegra20_spi.c
 create mode 100644 drivers/spi/tegra30_spi.c
 delete mode 100644 drivers/spi/tegra_slink.c
 delete mode 100644 drivers/spi/tegra_spi.c

diff --git a/arch/arm/include/asm/arch-tegra/tegra_slink.h 
b/arch/arm/include/asm/arch-tegra/tegra_slink.h
deleted file mode 100644
index 74804b5..000
--- a/arch/arm/include/asm/arch-tegra/tegra_slink.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * NVIDIA Tegra SPI-SLINK controller
- *
- * Copyright 2010-2013 NVIDIA Corporation
- *
- * This software may be used and distributed according to the
- * terms of the GNU Public License, Version 2, incorporated
- * herein by reference.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef _TEGRA_SLINK_H_
-#define _TEGRA_SLINK_H_
-
-#include asm/types.h
-
-struct slink_tegra {
-   u32 command;/* SLINK_COMMAND_0 register  */
-   u32 command2;   /* SLINK_COMMAND2_0 reg */
-   u32 status; /* SLINK_STATUS_0 register */
-   u32 reserved;   /* Reserved offset 0C */
-   u32 mas_data;   /* SLINK_MAS_DATA_0 reg */
-   u32 slav_data;  /* SLINK_SLAVE_DATA_0 reg */
-   u32 dma_ctl;/* SLINK_DMA_CTL_0 register */
-   u32 status2;/* SLINK_STATUS2_0 reg */
-   u32 rsvd[56];   /* 0x20 to 0xFF reserved */
-   u32 tx_fifo;/* SLINK_TX_FIFO_0 reg off 100h */
-   u32 rsvd2[31];  /* 0x104 to 0x17F reserved */
-   u32 rx_fifo;/* SLINK_RX_FIFO_0 reg off 180h */
-};
-
-/* COMMAND */
-#define SLINK_CMD_ENB  (1  31)
-#define SLINK_CMD_GO   (1  30)
-#define SLINK_CMD_M_S  (1  28)
-#define SLINK_CMD_CK_SDA   (1  21)
-#define SLINK_CMD_CS_POL   (1  13)
-#define SLINK_CMD_CS_VAL   (1  12)
-#define SLINK_CMD_CS_SOFT  (1  11)
-#define SLINK_CMD_BIT_LENGTH   (1  4)
-#define SLINK_CMD_BIT_LENGTH_MASK  0x001F
-/* COMMAND2 */
-#define SLINK_CMD2_TXEN(1  30)
-#define SLINK_CMD2_RXEN(1  31)
-#define SLINK_CMD2_SS_EN   (1  18)
-#define SLINK_CMD2_SS_EN_SHIFT 18
-#define SLINK_CMD2_SS_EN_MASK  0x000C
-#define SLINK_CMD2_CS_ACTIVE_BETWEEN   (1  17)
-/* STATUS */
-#define SLINK_STAT_BSY (1  31)
-#define SLINK_STAT_RDY (1  30)
-#define SLINK_STAT_ERR (1  29)
-#define SLINK_STAT_RXF_FLUSH   (1  27)
-#define SLINK_STAT_TXF_FLUSH   (1  26)
-#define SLINK_STAT_RXF_OVF (1  25)
-#define SLINK_STAT_TXF_UNR (1  24)
-#define SLINK_STAT_RXF_EMPTY   (1  23)
-#define SLINK_STAT_RXF_FULL(1  22)
-#define SLINK_STAT_TXF_EMPTY   (1  21)
-#define SLINK_STAT_TXF_FULL(1  20)
-#define SLINK_STAT_TXF_OVF (1  19)
-#define SLINK_STAT_RXF_UNR (1  18)
-#define SLINK_STAT_CUR_BLKCNT  (1  15)
-/* STATUS2 */
-#define SLINK_STAT2_RXF_FULL_CNT   (1  16)
-#define SLINK_STAT2_TXF_FULL_CNT   (1