Skip to contentSkip to conversation

ata: Updates for pata_octeon_cf driver.

PATCH In review David Daney 2 participants 4 messages Aug 17, 2012 – Aug 18, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ata: Updates for pata_octeon_cf driver.

From: David Daney <[email protected]>

The main update is conversion to device tree. Now the the OCTEON device tree prerequisites are upstream, we can convert the pata_octeon_cf driver.

The second change allows the driver to function when the kernel is built for little-endian operation.

The only real change in the MIPS portion of the tree is deletion of crap.

There is a dependence on patches Ralf has queued in linux-next so it may be best to merge via the MIPS tree (as pata_octeon_cf only exists in MIPS based OCTEON SOCs). But the ata tree would be fine by me too. In any even we may need some cross sub-system Acked-bys.

David Daney (2):
MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.
ata: pata_octeon_cf: Use correct byte order for DMA in when built
little-endian.

 arch/mips/cavium-octeon/octeon-irq.c           |   1 -
 arch/mips/cavium-octeon/octeon-platform.c      | 102 ------
 arch/mips/include/asm/mach-cavium-octeon/irq.h |   1 -
 arch/mips/include/asm/octeon/octeon.h          |   7 -
 drivers/ata/pata_octeon_cf.c                   | 423 +++++++++++++++++--------
 5 files changed, 288 insertions(+), 246 deletions(-)
Signature · 1 line
1.7.11.2
#1 lore raw

PATCH 1/2 MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.

From: David Daney <[email protected]>

The patch needs to eliminate the definition of OCTEON_IRQ_BOOTDMA so that the device tree code can map the interrupt, so in order to not temporarily break things, we do a single patch to both the interrupt registration code and the pata_octeon_cf driver.

Also rolled in is a conversion to use hrtimers and corrections to the timing calculations.

---
 arch/mips/cavium-octeon/octeon-irq.c           |   1 -
 arch/mips/cavium-octeon/octeon-platform.c      | 102 ------
 arch/mips/include/asm/mach-cavium-octeon/irq.h |   1 -
 arch/mips/include/asm/octeon/octeon.h          |   7 -
 drivers/ata/pata_octeon_cf.c                   | 419 +++++++++++++++++--------
 5 files changed, 284 insertions(+), 246 deletions(-)
arch/mips/cavium-octeon/octeon-irq.c +0 -1
index 274cd4f..5dcb88c 100644
@@ -1213,7 +1213,6 @@ static void __init octeon_irq_init_ciu(void)
 		octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_TIMER0, 0, i + 52);
 
 	octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_USB0, 0, 56);
-	octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_BOOTDMA, 0, 63);
 
 	/* CIU_1 */
 	for (i = 0; i < 16; i++)
arch/mips/cavium-octeon/octeon-platform.c +0 -102

108 lines not on this page · raw message

arch/mips/include/asm/mach-cavium-octeon/irq.h +0 -1
index c22a307..4eda022 100644
@@ -41,7 +41,6 @@ enum octeon_irq {
 	OCTEON_IRQ_TIMER3,
 	OCTEON_IRQ_USB0,
 	OCTEON_IRQ_USB1,
-	OCTEON_IRQ_BOOTDMA,
 #ifndef CONFIG_PCI_MSI
 	OCTEON_IRQ_LAST = 127
 #endif
arch/mips/include/asm/octeon/octeon.h +0 -7
index 712f6b7..96e58a5 100644
@@ -209,13 +209,6 @@ union octeon_cvmemctl {
 	} s;
 };
 
-struct octeon_cf_data {
-	unsigned long	base_region_bias;
-	unsigned int	base_region;	/* The chip select region used by CF */
-	int		is16bit;	/* 0 - 8bit, !0 - 16bit */
-	int		dma_engine;	/* -1 for no DMA */
-};
-
 extern void octeon_write_lcd(const char *s);
 extern void octeon_check_cpu_bist(void);
 extern int octeon_get_boot_debug_flag(void);
drivers/ata/pata_octeon_cf.c +284 -135

710 lines not on this page · raw message

Signature · 1 line
1.7.11.2
#2 lore raw

PATCH 2/2 ata: pata_octeon_cf: Use correct byte order for DMA in when built little-endian.

In reply to David Daney

From: David Daney <[email protected]>

We need to set the 'endian' bit in this case.

---
 drivers/ata/pata_octeon_cf.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/ata/pata_octeon_cf.c +4 -0
index 652d035..4e1194b 100644
@@ -20,6 +20,7 @@
 #include <linux/platform_device.h>
 #include <scsi/scsi_host.h>
 
+#include <asm/byteorder.h>
 #include <asm/octeon/octeon.h>
 
 /*
@@ -589,6 +590,9 @@ static void octeon_cf_dma_start(struct ata_queued_cmd *qc)
 
 	/* Set the direction of the DMA */
 	mio_boot_dma_cfg.u64 = 0;
+#ifdef __LITTLE_ENDIAN
+	mio_boot_dma_cfg.s.endian = 1;
+#endif
 	mio_boot_dma_cfg.s.en = 1;
 	mio_boot_dma_cfg.s.rw = ((qc->tf.flags & ATA_TFLAG_WRITE) != 0);
 
Signature · 1 line
1.7.11.2
Acked-by on the v1 series
#3 lore raw
In reply to David Daney
Quoted 22 lines · David Daney

From: David Daney <[email protected]>

The main update is conversion to device tree. Now the the OCTEON device tree prerequisites are upstream, we can convert the pata_octeon_cf driver.

The second change allows the driver to function when the kernel is built for little-endian operation.

The only real change in the MIPS portion of the tree is deletion of crap.

There is a dependence on patches Ralf has queued in linux-next so it may be best to merge via the MIPS tree (as pata_octeon_cf only exists in MIPS based OCTEON SOCs). But the ata tree would be fine by me too. In any even we may need some cross sub-system Acked-bys.

David Daney (2):
MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.
ata: pata_octeon_cf: Use correct byte order for DMA in when built
little-endian.

Quoted 6 lines
  arch/mips/cavium-octeon/octeon-irq.c           |   1 -
  arch/mips/cavium-octeon/octeon-platform.c      | 102 ------
  arch/mips/include/asm/mach-cavium-octeon/irq.h |   1 -
  arch/mips/include/asm/octeon/octeon.h          |   7 -
  drivers/ata/pata_octeon_cf.c                   | 423 +++++++++++++++++--------
  5 files changed, 288 insertions(+), 246 deletions(-)

patches 1 and 2 are