Skip to contentSkip to conversation

libata driver for bf548 on chip ATAPI controller.

PATCH In review Sonic Zhang 2 participants 2 messages Aug 13, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata driver for bf548 on chip ATAPI controller.

This driver is for bf548 on chip ATAPI controller. Both PIO 4 and UDMA5 mode are enabled.

---
 drivers/ata/Kconfig      |   28 +
 drivers/ata/Makefile     |    1 +
 drivers/ata/pata_bf54x.c | 1585 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1614 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ata/pata_bf54x.c
drivers/ata/Kconfig +28 -0
index b4a8d60..e679f04 100644
@@ -583,4 +583,32 @@ config PATA_SCC
 
 	  If unsure, say N.
 
+config PATA_BF54X
+	tristate "Blackfin 54x ATAPI support"
+	depends on BF542 || BF548 || BF549
+	help
+	  This option enables support for the built-in ATAPI controller on
+	  Blackfin 54x family chips.
+
+	  If unsure, say N.
+
+choice
+	prompt "Blackfin 54x ATAPI mode"
+	depends on PATA_BF54X
+	default PATA_BF54X_DMA
+	help
+	  This option selects bf54x ATAPI controller working mode.
+
+config PATA_BF54X_PIO
+	bool "PIO mode"
+	help
+	  Blackfin ATAPI controller works under PIO mode.
+
+config PATA_BF54X_DMA
+	bool "DMA mode"
+	help
+	  Blackfin ATAPI controller works under DMA mode.
+
+endchoice
+
 endif # ATA
drivers/ata/Makefile +1 -0
index 8149c68..c2ecba5 100644
@@ -61,6 +61,7 @@ obj-$(CONFIG_PATA_SIS)		+= pata_sis.o
 obj-$(CONFIG_PATA_TRIFLEX)	+= pata_triflex.o
 obj-$(CONFIG_PATA_IXP4XX_CF)	+= pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_SCC)		+= pata_scc.o
+obj-$(CONFIG_PATA_BF54X)	+= pata_bf54x.o
 obj-$(CONFIG_PATA_PLATFORM)	+= pata_platform.o
 obj-$(CONFIG_PATA_ICSIDE)	+= pata_icside.o
 # Should be last but one libata driver
drivers/ata/pata_bf54x.c new file +1585 -0

1,585 lines not on this page · raw message

Signature · 1 line
1.5.1.3
#1 lore raw
Quoted 14 lines

+ * Register transfer timing table
+ */

drivers/ata/pata_bf54x.c new file +12 -0
+/*               mode:       0    1    2    3    4    */
+/* Cycle Time                     */
+static u32 reg_t0min[]   = { 600, 383, 330, 180, 120 };
+/* DIOR/DIOW to end cycle         */
+static u32 reg_t2min[]   = { 290, 290, 290, 70,  25  };
+/* DIOR/DIOW asserted pulse width */
+static u32 reg_teocmin[] = { 290, 290, 290, 80,  70  };
+
+/**
+ * PIO timing table
+ */
+/*               mode:       0    1    2    3    4    */

drivers/ata/pata_bf54x.c line 212

Quoted 10 lines
drivers/ata/pata_bf54x.c new file +10 -0
+/* Cycle Time                     */
+static u32 pio_t0min[]   = { 600, 383, 240, 180, 120 };
+/* Address valid to DIOR/DIORW    */
+static u32 pio_t1min[]   = { 70,  50,  30,  30,  25  };
+/* DIOR/DIOW to end cycle         */
+static u32 pio_t2min[]   = { 165, 125, 100, 80,  70  };
+/* DIOR/DIOW asserted pulse width */
+static u32 pio_teocmin[] = { 165, 125, 100, 70,  25  };
+/* DIOW data hold                 */
+static u32 pio_t4min[]   = { 30,  20,  15,  10,  10  };

Why not use the timing tables provided by libata ?