All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
@ 2009-06-09  6:26 ` liqin.chen
  0 siblings, 0 replies; 6+ messages in thread
From: liqin.chen @ 2009-06-09  6:26 UTC (permalink / raw)
  To: linux-arch, linux-kernel; +Cc: Arnd Bergmann, Andrew Morton, torvalds

>From 98df81697789227319d5909b66daf7e48bb3d2d7 Mon Sep 17 00:00:00 2001
From: Chen Liqin <liqin.chen@sunplusct.com>
Date: Tue, 9 Jun 2009 13:43:07 +0800



Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
---
 arch/score/include/asm/delay.h       |   14 ++++++++++++++
 arch/score/include/asm/device.h      |    6 ++++++
 arch/score/include/asm/div64.h       |    6 ++++++
 arch/score/include/asm/dma-mapping.h |    6 ++++++
 arch/score/include/asm/dma.h         |    8 ++++++++
 5 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 arch/score/include/asm/delay.h
 create mode 100644 arch/score/include/asm/device.h
 create mode 100644 arch/score/include/asm/div64.h
 create mode 100644 arch/score/include/asm/dma-mapping.h
 create mode 100644 arch/score/include/asm/dma.h

diff --git a/arch/score/include/asm/delay.h 
b/arch/score/include/asm/delay.h
new file mode 100644
index 0000000..ea4d532
--- /dev/null
+++ b/arch/score/include/asm/delay.h
@@ -0,0 +1,14 @@
+#ifndef _ASM_SCORE_DELAY_H
+#define _ASM_SCORE_DELAY_H
+
+static inline void __delay(unsigned long loops)
+{}
+
+static inline void __udelay(unsigned long usecs)
+{
+       __delay(usecs);
+}
+
+#define udelay(usecs) __udelay(usecs)
+
+#endif /* _ASM_SCORE_DELAY_H */
diff --git a/arch/score/include/asm/device.h 
b/arch/score/include/asm/device.h
new file mode 100644
index 0000000..2dc7cc5
--- /dev/null
+++ b/arch/score/include/asm/device.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DEVICE_H
+#define _ASM_SCORE_DEVICE_H
+
+#include <asm-generic/device.h>
+
+#endif /* _ASM_SCORE_DEVICE_H */
diff --git a/arch/score/include/asm/div64.h 
b/arch/score/include/asm/div64.h
new file mode 100644
index 0000000..75fae19
--- /dev/null
+++ b/arch/score/include/asm/div64.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DIV64_H
+#define _ASM_SCORE_DIV64_H
+
+#include <asm-generic/div64.h>
+
+#endif /* _ASM_SCORE_DIV64_H */
diff --git a/arch/score/include/asm/dma-mapping.h 
b/arch/score/include/asm/dma-mapping.h
new file mode 100644
index 0000000..f9c0193
--- /dev/null
+++ b/arch/score/include/asm/dma-mapping.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DMA_MAPPING_H
+#define _ASM_SCORE_DMA_MAPPING_H
+
+#include <asm-generic/dma-mapping-broken.h>
+
+#endif /* _ASM_SCORE_DMA_MAPPING_H */
diff --git a/arch/score/include/asm/dma.h b/arch/score/include/asm/dma.h
new file mode 100644
index 0000000..4c4f2e3
--- /dev/null
+++ b/arch/score/include/asm/dma.h
@@ -0,0 +1,8 @@
+#ifndef _ASM_SCORE_DMA_H
+#define _ASM_SCORE_DMA_H
+
+#include <asm/io.h>
+
+#define MAX_DMA_ADDRESS                (PAGE_OFFSET + 0x01000000)
+
+#endif /* _ASM_SCORE_DMA_H */
-- 
1.6.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
@ 2009-06-09  6:26 ` liqin.chen
  0 siblings, 0 replies; 6+ messages in thread
From: liqin.chen @ 2009-06-09  6:26 UTC (permalink / raw)
  To: linux-arch, linux-kernel; +Cc: Arnd Bergmann, Andrew Morton, torvalds

From 98df81697789227319d5909b66daf7e48bb3d2d7 Mon Sep 17 00:00:00 2001
From: Chen Liqin <liqin.chen@sunplusct.com>
Date: Tue, 9 Jun 2009 13:43:07 +0800



Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
---
 arch/score/include/asm/delay.h       |   14 ++++++++++++++
 arch/score/include/asm/device.h      |    6 ++++++
 arch/score/include/asm/div64.h       |    6 ++++++
 arch/score/include/asm/dma-mapping.h |    6 ++++++
 arch/score/include/asm/dma.h         |    8 ++++++++
 5 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 arch/score/include/asm/delay.h
 create mode 100644 arch/score/include/asm/device.h
 create mode 100644 arch/score/include/asm/div64.h
 create mode 100644 arch/score/include/asm/dma-mapping.h
 create mode 100644 arch/score/include/asm/dma.h

diff --git a/arch/score/include/asm/delay.h 
b/arch/score/include/asm/delay.h
new file mode 100644
index 0000000..ea4d532
--- /dev/null
+++ b/arch/score/include/asm/delay.h
@@ -0,0 +1,14 @@
+#ifndef _ASM_SCORE_DELAY_H
+#define _ASM_SCORE_DELAY_H
+
+static inline void __delay(unsigned long loops)
+{}
+
+static inline void __udelay(unsigned long usecs)
+{
+       __delay(usecs);
+}
+
+#define udelay(usecs) __udelay(usecs)
+
+#endif /* _ASM_SCORE_DELAY_H */
diff --git a/arch/score/include/asm/device.h 
b/arch/score/include/asm/device.h
new file mode 100644
index 0000000..2dc7cc5
--- /dev/null
+++ b/arch/score/include/asm/device.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DEVICE_H
+#define _ASM_SCORE_DEVICE_H
+
+#include <asm-generic/device.h>
+
+#endif /* _ASM_SCORE_DEVICE_H */
diff --git a/arch/score/include/asm/div64.h 
b/arch/score/include/asm/div64.h
new file mode 100644
index 0000000..75fae19
--- /dev/null
+++ b/arch/score/include/asm/div64.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DIV64_H
+#define _ASM_SCORE_DIV64_H
+
+#include <asm-generic/div64.h>
+
+#endif /* _ASM_SCORE_DIV64_H */
diff --git a/arch/score/include/asm/dma-mapping.h 
b/arch/score/include/asm/dma-mapping.h
new file mode 100644
index 0000000..f9c0193
--- /dev/null
+++ b/arch/score/include/asm/dma-mapping.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_SCORE_DMA_MAPPING_H
+#define _ASM_SCORE_DMA_MAPPING_H
+
+#include <asm-generic/dma-mapping-broken.h>
+
+#endif /* _ASM_SCORE_DMA_MAPPING_H */
diff --git a/arch/score/include/asm/dma.h b/arch/score/include/asm/dma.h
new file mode 100644
index 0000000..4c4f2e3
--- /dev/null
+++ b/arch/score/include/asm/dma.h
@@ -0,0 +1,8 @@
+#ifndef _ASM_SCORE_DMA_H
+#define _ASM_SCORE_DMA_H
+
+#include <asm/io.h>
+
+#define MAX_DMA_ADDRESS                (PAGE_OFFSET + 0x01000000)
+
+#endif /* _ASM_SCORE_DMA_H */
-- 
1.6.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
  2009-06-09  6:26 ` liqin.chen
  (?)
@ 2009-06-09 17:18 ` Arnd Bergmann
  2009-06-13  6:36     ` liqin.chen
  -1 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2009-06-09 17:18 UTC (permalink / raw)
  To: liqin.chen; +Cc: linux-arch, linux-kernel, Andrew Morton, torvalds

On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:

> diff --git a/arch/score/include/asm/delay.h 
> b/arch/score/include/asm/delay.h
> new file mode 100644
> index 0000000..ea4d532
> --- /dev/null
> +++ b/arch/score/include/asm/delay.h
> @@ -0,0 +1,14 @@
> +#ifndef _ASM_SCORE_DELAY_H
> +#define _ASM_SCORE_DELAY_H
> +
> +static inline void __delay(unsigned long loops)
> +{}
> +
> +static inline void __udelay(unsigned long usecs)
> +{
> +       __delay(usecs);
> +}
> +
> +#define udelay(usecs) __udelay(usecs)
> +
> +#endif /* _ASM_SCORE_DELAY_H */

Having a working udelay() function is required for many
drivers that are sensitive to timing, you should probably
implement that at some point in the future.

> new file mode 100644
> index 0000000..f9c0193
> --- /dev/null
> +++ b/arch/score/include/asm/dma-mapping.h
> @@ -0,0 +1,6 @@
> +#ifndef _ASM_SCORE_DMA_MAPPING_H
> +#define _ASM_SCORE_DMA_MAPPING_H
> +
> +#include <asm-generic/dma-mapping-broken.h>
> +
> +#endif /* _ASM_SCORE_DMA_MAPPING_H */

This is what I did in the asm-generic#microblaze tree, but I noticed later
that you can simply leave out that file entirely when you set
CONFIG_NO_DMA.

> --- /dev/null
> +++ b/arch/score/include/asm/dma.h
> @@ -0,0 +1,8 @@
> +#ifndef _ASM_SCORE_DMA_H
> +#define _ASM_SCORE_DMA_H
> +
> +#include <asm/io.h>
> +
> +#define MAX_DMA_ADDRESS                (PAGE_OFFSET + 0x01000000)
> +
> +#endif /* _ASM_SCORE_DMA_H */

This indicates that you allow DMA to certain devices only in the first
16MB of memory, like an ISA floppy or parallel port. Do you actually have
any devices with this behaviour?

	Arnd <><

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
  2009-06-09 17:18 ` Arnd Bergmann
@ 2009-06-13  6:36     ` liqin.chen
  0 siblings, 0 replies; 6+ messages in thread
From: liqin.chen @ 2009-06-13  6:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Andrew Morton, linux-arch, linux-kernel, torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 714 bytes --]

Arnd Bergmann <arnd@arndb.de> дÓÚ 2009-06-10 01:18:20:

> On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:
> 
> Having a working udelay() function is required for many
> drivers that are sensitive to timing, you should probably
> implement that at some point in the future.

Add udelay() implement in code.

> 
> This indicates that you allow DMA to certain devices only in the first
> 16MB of memory, like an ISA floppy or parallel port. Do you actually 
have
> any devices with this behaviour?
> 

No, I had removed it.

Best Regards
Liqin
--
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
@ 2009-06-13  6:36     ` liqin.chen
  0 siblings, 0 replies; 6+ messages in thread
From: liqin.chen @ 2009-06-13  6:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Andrew Morton, linux-arch, linux-kernel, torvalds

Arnd Bergmann <arnd@arndb.de> 写于 2009-06-10 01:18:20:

> On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:
> 
> Having a working udelay() function is required for many
> drivers that are sensitive to timing, you should probably
> implement that at some point in the future.

Add udelay() implement in code.

> 
> This indicates that you allow DMA to certain devices only in the first
> 16MB of memory, like an ISA floppy or parallel port. Do you actually 
have
> any devices with this behaviour?
> 

No, I had removed it.

Best Regards
Liqin
--

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h
  2009-06-13  6:36     ` liqin.chen
  (?)
@ 2009-06-13 22:31     ` Arnd Bergmann
  -1 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2009-06-13 22:31 UTC (permalink / raw)
  To: liqin.chen; +Cc: Andrew Morton, linux-arch, linux-kernel, torvalds

On Saturday 13 June 2009, liqin.chen@sunplusct.com wrote:
> Arnd Bergmann <arnd@arndb.de> 写于 2009-06-10 01:18:20:
> 
> > On Tuesday 09 June 2009, liqin.chen@sunplusct.com wrote:
> > 
> > Having a working udelay() function is required for many
> > drivers that are sensitive to timing, you should probably
> > implement that at some point in the future.
> 
> Add udelay() implement in code.

so you use 

static inline void __delay(unsigned long loops)
{
        __asm__ __volatile__ (
                "1:\tsubi\t%0,1\n\t"
                "cmpz.c\t%0\n\t"
                "bne\t1b\n\t"
                : "=r" (loops)
                : "0" (loops));
}

static inline void __udelay(unsigned long usecs)
{
        __delay(usecs);
}


This is much better than before, but is far from exact in the __udelay()
case. Please take a look at init/calibrate.c and how other architectures
use loops_per_jiffy if you don't have an exact time source you can use.

If you have a time source with microsecond resolution or better, just loop
until the amount of microseconds has expired.

	Arnd <><

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-13 22:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09  6:26 [PATCH 06/27] score: create head files delay.h device.h div64.h dma-mapping.h dma.h liqin.chen
2009-06-09  6:26 ` liqin.chen
2009-06-09 17:18 ` Arnd Bergmann
2009-06-13  6:36   ` liqin.chen
2009-06-13  6:36     ` liqin.chen
2009-06-13 22:31     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.