Skip to contentSkip to conversation

fsldma: add support to 36-bit physical address

PATCH In review Li Yang 5 participants 9 messages Nov 11, 2010 – Nov 15, 2010

Subsystems (2)
lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH v2 1/1 fsldma: add support to 36-bit physical address

Expand the dma_mask of fsldma device to 36-bit, indicating that the DMA engine can deal with 36-bit physical address and does not need the SWIOTLB to create bounce buffer for it when doing dma_map_*().

---
Add more detailed commit message

 drivers/dma/fsldma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/dma/fsldma.c +3 -1
index cea08be..8c79b37 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale MPC85xx, MPC83xx DMA Engine support
  *
- * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights reserved.
  *
  * Author:
  *   Zhang Wei <[email protected]>, Jul 2007
@@ -1338,6 +1338,8 @@ static int __devinit fsldma_of_probe(struct platform_device *op,
 	fdev->common.device_control = fsl_dma_device_control;
 	fdev->common.dev = &op->dev;
 
+	dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
+
 	dev_set_drvdata(&op->dev, fdev);
 
 	/*
Signature · 1 line
1.6.6-rc1.GIT
#1 lore raw
Quoted 16 lines · Li Yang

Expand the dma_mask of fsldma device to 36-bit, indicating that the DMA engine can deal with 36-bit physical address and does not need the SWIOTLB to create bounce buffer for it when doing dma_map_*(). =20

---
Add more detailed commit message
=20
drivers/dma/fsldma.c | 4 +++-

1 files changed, 3 insertions(+), 1 deletions(-)

=20

drivers/dma/fsldma.c +0 -0
index cea08be..8c79b37 100644

drivers/dma/fsldma.c line 4

Quoted 4 lines
drivers/dma/fsldma.c +0 -1
@@ -1,7 +1,7 @@
 /*
 * Freescale MPC85xx, MPC83xx DMA Engine support
 *
- * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights =

reserved.

drivers/dma/fsldma.c line 4

Quoted 1 line
drivers/dma/fsldma.c +1 -0
+ * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights =

reserved.

drivers/dma/fsldma.c static int __devinit fsldma_of_probe(struct =

Quoted 4 lines
drivers/dma/fsldma.c +0 -0
 *
 * Author:
 *   Zhang Wei <[email protected]>, Jul 2007
@@ -1338,6 +1338,8 @@ static int __devinit fsldma_of_probe(struct =

platform_device *op,

drivers/dma/fsldma.c static int __devinit fsldma_of_probe(struct platform_device *op, · line 1342

Quoted 5 lines
drivers/dma/fsldma.c +0 -0
 	fdev->common.device_control =3D fsl_dma_device_control;
 	fdev->common.dev =3D &op->dev;

=20

drivers/dma/fsldma.c +2 -0
+	dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
+

Is there any reason we shouldn't set DMA_BIT_MASK(64) since the DMA = block programming model allows the address to be 64-bits?

Quoted 6 lines
	dev_set_drvdata(&op->dev, fdev);
=20
	/*

--=20
1.6.6-rc1.GIT
=20

#2 lore raw
Quoted 7 lines

Subject: Re: [PATCH v2] fsldma: add support to 36-bit physical address

Quoted 2 lines · Li Yang

Expand the dma_mask of fsldma device to 36-bit, indicating that the DMA engine can deal with 36-bit physical address and does not need =

the

Quoted 9 lines
Quoted 9 lines

SWIOTLB to create bounce buffer for it when doing dma_map_*().

---
Add more detailed commit message

drivers/dma/fsldma.c | 4 +++-

1 files changed, 3 insertions(+), 1 deletions(-)
Quoted 9 lines

drivers/dma/fsldma.c line 4

Quoted 9 lines
drivers/dma/fsldma.c index renamed from drivers/dma/fsldma.c +0 -0

cea08be..8c79b37 100644

drivers/dma/fsldma.c +0 -1
@@ -1,7 +1,7 @@
 /*
 * Freescale MPC85xx, MPC83xx DMA Engine support
 *
- * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights =

reserved.

Quoted 7 lines

drivers/dma/fsldma.c line 4

Quoted 1 line
drivers/dma/fsldma.c +1 -0
+ * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights

reserved.

drivers/dma/fsldma.c static int __devinit fsldma_of_probe(struct

Quoted 4 lines
drivers/dma/fsldma.c +0 -0
 *
 * Author:
 *   Zhang Wei <[email protected]>, Jul 2007
@@ -1338,6 +1338,8 @@ static int __devinit fsldma_of_probe(struct

platform_device *op,

Quoted 7 lines

drivers/dma/fsldma.c static int __devinit fsldma_of_probe(struct platform_device *op, · line 1342

Quoted 5 lines
drivers/dma/fsldma.c +2 -0
 	fdev->common.device_control =3D fsl_dma_device_control;
 	fdev->common.dev =3D &op->dev;
 
+	dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
+

Is there any reason we shouldn't set DMA_BIT_MASK(64) since the DMA =

block

Quoted 1 line

programming model allows the address to be 64-bits?

The current code is only verified on chips with 36-bit physical address. =
I'm not sure if the driver can work without any change on the 64-bit =
chip, although the register model suggests it can work well with 64-bit. =
If you can confirm that it's compatible with the block on 64-bit chip, =
then we can change it to 64 bit dma mask.

- Leo

#3 lore raw
In reply to Kumar Gala
Quoted 1 line · Kumar Gala

Is there any reason we shouldn't set DMA_BIT_MASK(64) since the DMA block programming model allows the address to be 64-bits?

Can you explain that? The DMA registers only have room for 36 bits for the physical address.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#4 lore raw
Quoted 1 line · Timur Tabi

On Thu, Nov 11, 2010 at 5:56 AM, Kumar Gala =

Quoted 2 lines · <[email protected]> wrote:

=20

Quoted 1 line

Is there any reason we shouldn't set DMA_BIT_MASK(64) since the DMA =

block programming model allows the address to be 64-bits?

Quoted 3 lines

=20
Can you explain that? The DMA registers only have room for 36 bits for the physical address.

The programming model (if you look at the free-space in the registers = and data structures) supports a 64-bit address. I'm trying to avoid = changing the driver in the future if we have >36-bit. However this is = such a minor worry that I'll stop and just ack the patch as is.

- k=

#5 lore raw

On Mon, Nov 15, 2010 at 9:16 AM, Kumar Gala <[email protected]> wro= te:

Quoted 1 line

The programming model (if you look at the free-space in the registers and=

data structures) supports a 64-bit address. =A0I'm trying to avoid changin=
g the driver in the future if we have >36-bit. =A0However this is such a mi= nor worry that I'll stop and just ack the patch as is.

I must still be missing something. I'm looking at the description of the SATR register in the MPC8572 RM, and it shows this:

0 - 3 | 4 - 5 | 6 | 7 | 8 - 11 | 12 - 15 | 16-21 | 22-=
31
--- | STFLOWLVL | SPCIORDER | SSME | STRANSINT | SREADTTYPE | --- | ES=
AD

The most that we can extend ESAD to is 16 bits, for a total of a 48-bit physical address. Where are the other 16 bits supposed to go?

--=20
Timur Tabi
Linux kernel developer at Freescale

Acked-by on v2 1/1
#8 lore raw
In reply to Li Yang
Quoted 10 lines · Li Yang

Expand the dma_mask of fsldma device to 36-bit, indicating that the DMA engine can deal with 36-bit physical address and does not need the SWIOTLB to create bounce buffer for it when doing dma_map_*().

---
Add more detailed commit message

drivers/dma/fsldma.c | 4 +++-

1 files changed, 3 insertions(+), 1 deletions(-)

- k

#6 lore raw
In reply to Timur Tabi
Quoted 1 line · Timur Tabi

On Mon, Nov 15, 2010 at 9:16 AM, Kumar Gala =

Quoted 2 lines · <[email protected]> wrote:

=20

Quoted 1 line

The programming model (if you look at the free-space in the registers =

and data structures) supports a 64-bit address. I'm trying to avoid = changing the driver in the future if we have >36-bit. However this is = such a minor worry that I'll stop and just ack the patch as is.

Quoted 5 lines

=20
I must still be missing something. I'm looking at the description of the SATR register in the MPC8572 RM, and it shows this:
=20
0 - 3 | 4 - 5 | 6 | 7 | 8 - 11 | 12 - 15 | 16-21 =

| 22-31

Quoted 1 line

--- | STFLOWLVL | SPCIORDER | SSME | STRANSINT | SREADTTYPE | --- | =

ESAD

Quoted 3 lines

=20
The most that we can extend ESAD to is 16 bits, for a total of a 48-bit physical address. Where are the other 16 bits supposed to go?

I was looking at the link addresses. I stand corrected so our max is = 48-bits.

- k=

#7 lore raw
Quoted 10 lines · On Mon, 15 Nov 2010 11:43:12 -0600 Kumar Gala <[email protected]> wrote:
Quoted 7 lines · Timur Tabi
Quoted 1 line · Kumar Gala

The programming model (if you look at the free-space in the registers and data structures) supports a 64-bit address. I'm trying to avoid changing the driver in the future if we have >36-bit. However this is such a minor worry that I'll stop and just ack the patch as is.

I must still be missing something. I'm looking at the description of the SATR register in the MPC8572 RM, and it shows this:

Quoted 7 lines
Quoted 5 lines

0 - 3 | 4 - 5 | 6 | 7 | 8 - 11 | 12 - 15 | 16-21 | 22-31
--- | STFLOWLVL | SPCIORDER | SSME | STRANSINT | SREADTTYPE | --- | ESAD

The most that we can extend ESAD to is 16 bits, for a total of a 48-bit physical address. Where are the other 16 bits supposed to go?

I was looking at the link addresses. I stand corrected so our max is 48-bits.

Looks like 42 bits -- just because bits 16-21 could be used to extend ESAD doesn't mean that they have been.

-Scott