Skip to contentSkip to conversation

ARM: EXYNOS: Add USB HOST register definitions

PATCH New Jingoo Han 4 participants 6 messages Mar 1, 2012 – Mar 5, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v2 1/2 ARM: EXYNOS: Add USB HOST register definitions

This patch adds USB HOST register definitions. The definition for EHCI INSNREG00 regiser and corresponding bit field definitions are added.

---
v2: change the definition name from EHCI_ENA_xxx to EHCI_INSNREG00_ENA_xxx.

arch/arm/mach-exynos/include/mach/regs-usb-host.h | 24 +++++++++++++++++++++

 1 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/include/mach/regs-usb-host.h
arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +24 -0
new file mode 100644
index 0000000..572b7d4
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ *		http://www.samsung.com
+ *
+ * EXYNOS - USB HOST register definitions
+ *
+ * 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.
+ */
+
+#ifndef __REGS_USB_HOST_H
+#define __REGS_USB_HOST_H __FILE__
+
+#define EHCI_INSNREG00(base)			(base + 0x90)
+#define EHCI_INSNREG00_ENA_INCR16		(0x1 << 25)
+#define EHCI_INSNREG00_ENA_INCR8		(0x1 << 24)
+#define EHCI_INSNREG00_ENA_INCR4		(0x1 << 23)
+#define EHCI_INSNREG00_ENA_INCRX_ALIGN		(0x1 << 22)
+#define EHCI_INSNREG00_ENABLE_DMA_BURST	\
+	(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 |	\
+	 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
+
+#endif /* __REGS_USB_HOST_H */
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/2 ARM: EXYNOS: Add USB HOST register definitions

Am Donnerstag, 1. M?rz 2012, 06:38:20 schrieb Jingoo Han:

Quoted 4 lines

This patch adds USB HOST register definitions. The definition for EHCI INSNREG00 regiser and corresponding bit field definitions are added.

Quoted 8 lines

---
v2: change the definition name from EHCI_ENA_xxx to EHCI_INSNREG00_ENA_xxx.

arch/arm/mach-exynos/include/mach/regs-usb-host.h | 24
+++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-exynos/include/mach/regs-usb-host.h

Isn't the general idea to depopulate the mach directories and make drivers buildable across architectures?

The definitions are only used in drivers/usb/host/ehci-s5p.c [in the second patch], so there should be no need to add another arch-header and they could simply be included in the driver itself or if necessary a drivers/usb/host/ehci-s5p.h .

Heiko

Quoted 30 lines
(quoted diff) +0 -0

b/arch/arm/mach-exynos/include/mach/regs-usb-host.h new file mode 100644 index 0000000..572b7d4

arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +24 -0
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ *		http://www.samsung.com
+ *
+ * EXYNOS - USB HOST register definitions
+ *
+ * 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.
+ */
+
+#ifndef __REGS_USB_HOST_H
+#define __REGS_USB_HOST_H __FILE__
+
+#define EHCI_INSNREG00(base)			(base + 0x90)
+#define EHCI_INSNREG00_ENA_INCR16		(0x1 << 25)
+#define EHCI_INSNREG00_ENA_INCR8		(0x1 << 24)
+#define EHCI_INSNREG00_ENA_INCR4		(0x1 << 23)
+#define EHCI_INSNREG00_ENA_INCRX_ALIGN		(0x1 << 22)
+#define EHCI_INSNREG00_ENABLE_DMA_BURST	\
+	(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 |	\
+	 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
+
+#endif /* __REGS_USB_HOST_H */

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 14 lines · Heiko Stübner

Am Donnerstag, 1. März 2012, 06:38:20 schrieb Jingoo Han:

Quoted 8 lines

This patch adds USB HOST register definitions. The definition for EHCI INSNREG00 regiser and corresponding bit field definitions are added.

---
v2: change the definition name from EHCI_ENA_xxx to

EHCI_INSNREG00_ENA_xxx.

Quoted 4 lines

arch/arm/mach-exynos/include/mach/regs-usb-host.h | 24
+++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-exynos/include/mach/regs-usb-host.h
Quoted 9 lines

Isn't the general idea to depopulate the mach directories and make drivers buildable across architectures?

The definitions are only used in drivers/usb/host/ehci-s5p.c [in the second patch], so there should be no need to add another arch-header and they could
simply be included in the driver itself or if necessary a drivers/usb/host/ehci-s5p.h .

I found out some code related to this burst function.

the snip from ehci-s5pv210.c, 2.6.35 kernel

        /* Mark hardware accessible again as we are out of D3 state by now
*/
        set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
#if defined(CONFIG_ARCH_S5PV210) || defined(CONFIG_ARCH_S5P6450)
        ehci_writel(ehci, 0x000F0000, (void __iomem *)ehci->caps + 0x90);

#endif

#if defined(CONFIG_ARCH_S5PV310)
        ehci_writel(ehci, 0x03C00000, (void __iomem *)ehci->caps + 0x90);
#endif
        if (ehci_readl(ehci, &ehci->regs->configured_flag) == FLAG_CF) {
Quoted 1 line

From this code, this burst function seems to be depending on CPUs,

The driver by itself is not good idea because echi-s5p.c will have defined.

Which is the better place to pus this CPU specific definition either drivers/usb/host/ehci-s5p.h is
or mach/xx.h or include/linux/usb/xxx.h ? I am not clear about this.

Heiko

Quoted 29 lines
Quoted 29 lines
(quoted diff) +0 -0

b/arch/arm/mach-exynos/include/mach/regs-usb-host.h new file mode 100644 index 0000000..572b7d4

arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +22 -0
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ *           http://www.samsung.com
+ *
+ * EXYNOS - USB HOST register definitions
+ *
+ * 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.
+ */
+
+#ifndef __REGS_USB_HOST_H
+#define __REGS_USB_HOST_H __FILE__
+
+#define EHCI_INSNREG00(base)                 (base + 0x90)
+#define EHCI_INSNREG00_ENA_INCR16            (0x1 << 25)
+#define EHCI_INSNREG00_ENA_INCR8             (0x1 << 24)
+#define EHCI_INSNREG00_ENA_INCR4             (0x1 << 23)
+#define EHCI_INSNREG00_ENA_INCRX_ALIGN               (0x1 << 22)
+#define EHCI_INSNREG00_ENABLE_DMA_BURST      \
+     (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
+      EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
Quoted 9 lines

arch/arm/mach-exynos/include/mach/regs-usb-host.h line 24

Quoted 2 lines
arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +2 -0
+
+#endif /* __REGS_USB_HOST_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
linaro-dev mailing list [email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev

#4 lore raw

PATCH v2 1/2 ARM: EXYNOS: Add USB HOST register definitions

Am Donnerstag 01 M?rz 2012, 17:10:52 schrieb Sangwook Lee:

Quoted 38 lines · Heiko St?bner
Quoted 17 lines

Am Donnerstag, 1. M?rz 2012, 06:38:20 schrieb Jingoo Han:

Quoted 8 lines

This patch adds USB HOST register definitions. The definition for EHCI INSNREG00 regiser and corresponding bit field definitions are added.

---
v2: change the definition name from EHCI_ENA_xxx to

EHCI_INSNREG00_ENA_xxx.

Quoted 4 lines

arch/arm/mach-exynos/include/mach/regs-usb-host.h | 24
+++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-exynos/include/mach/regs-usb-host.h
Quoted 8 lines

Isn't the general idea to depopulate the mach directories and make drivers buildable across architectures?

The definitions are only used in drivers/usb/host/ehci-s5p.c [in the second patch], so there should be no need to add another arch-header and they could
simply be included in the driver itself or if necessary a drivers/usb/host/ehci-s5p.h .

I found out some code related to this burst function.

the snip from ehci-s5pv210.c, 2.6.35 kernel

        /* Mark hardware accessible again as we are out of D3 state by now
*/
        set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
#if defined(CONFIG_ARCH_S5PV210) || defined(CONFIG_ARCH_S5P6450)
        ehci_writel(ehci, 0x000F0000, (void __iomem *)ehci->caps + 0x90);

#endif

Quoted 7 lines
#if defined(CONFIG_ARCH_S5PV310)
        ehci_writel(ehci, 0x03C00000, (void __iomem *)ehci->caps + 0x90);
#endif
        if (ehci_readl(ehci, &ehci->regs->configured_flag) == FLAG_CF) {

From this code, this burst function seems to be depending on CPUs, The driver by itself is not good idea because echi-s5p.c will have defined.

The current driver in mainline does not contain these ifdefs and this also should not change. What would happen in the code above if ARCH_S5PV210 and ARCH_S5PV310 are selected?

As providing support for more than one SoC in a kernel image is one of the current targets, architecture dependant stuff like the code above should probably be detected at runtime and definitly not compile-time.

Quoted 3 lines

Which is the better place to pus this CPU specific definition either drivers/usb/host/ehci-s5p.h is
or mach/xx.h or include/linux/usb/xxx.h ? I am not clear about this.

As I understand it, drivers should be compileable even if the underlying architecture is not selected and hence mustn't depend on architecure code.

Use-cases are for example compile-testing all usb-host drivers at once during some sort of rework, or the multi-arch kernel mentioned above.

But I really do not see why these defines you're adding cannot simply live inside the ehci-s5p.c . For example take a look at drivers/usb/gadget/s3c-hsudc.c . This driver also contains its private defines without the need for another header.

Quoted 36 lines
Quoted 36 lines
Quoted 20 lines
(quoted diff) +0 -0

b/arch/arm/mach-exynos/include/mach/regs-usb-host.h new file mode 100644 index 0000000..572b7d4

arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +7 -0
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ *           http://www.samsung.com
+ *
+ * EXYNOS - USB HOST register definitions
+ *
+ * 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.
+ */

arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +4 -0
+
+#ifndef __REGS_USB_HOST_H
+#define __REGS_USB_HOST_H __FILE__
+

arch/arm/mach-exynos/include/mach/regs-usb-host.h line 24

Quoted 10 lines
arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +10 -0
+#define EHCI_INSNREG00(base)                 (base + 0x90)
+#define EHCI_INSNREG00_ENA_INCR16            (0x1 << 25)
+#define EHCI_INSNREG00_ENA_INCR8             (0x1 << 24)
+#define EHCI_INSNREG00_ENA_INCR4             (0x1 << 23)
+#define EHCI_INSNREG00_ENA_INCRX_ALIGN               (0x1 << 22)
+#define EHCI_INSNREG00_ENABLE_DMA_BURST      \
+     (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
+      EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
+
+#endif /* __REGS_USB_HOST_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

PATCH v2 1/2 ARM: EXYNOS: Add USB HOST register definitions

In reply to Sangwook Lee

On 1 March 2012 21:40, Sangwook Lee <[email protected]> wrote:
[...]

Quoted 16 lines

?I found out some code related to this burst function.

?the snip from ehci-s5pv210.c, 2.6.35 kernel

??????? /* Mark hardware accessible again as we are out of D3 state by now */
??????? set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
#if defined(CONFIG_ARCH_S5PV210) || defined(CONFIG_ARCH_S5P6450) ??????? ehci_writel(ehci, 0x000F0000, (void __iomem *)ehci->caps + 0x90); #endif

#if defined(CONFIG_ARCH_S5PV310)
??????? ehci_writel(ehci, 0x03C00000, (void __iomem *)ehci->caps + 0x90); #endif
??????? if (ehci_readl(ehci, &ehci->regs->configured_flag) == FLAG_CF) {

Quoted 6 lines

From this code, this burst function seems to be depending on CPUs, The driver by itself is not good idea because echi-s5p.c will have defined.

Which is the better place to pus this CPU specific definition either drivers/usb/host/ehci-s5p.h is
or mach/xx.h or? include/linux/usb/xxx.h ?? I am not clear about this.

Any configuration that is controller specific should be in the driver. If that configuration has a SoC specific behavior, a id_table can be provided to the platform_driver which can provide any SoC specific information. The samsung keypad driver is an example of how this can be handled (drivers/input/keyboard/samsung.c).

Thanks,
Thomas.

author
#6 lore raw

PATCH v2 1/2 ARM: EXYNOS: Add USB HOST register definitions

In reply to Heiko Stübner
Quoted 22 lines

-----Original Message-----
From: Heiko Stubner
Sent: Friday, March 02, 2012 12:24 AM
To: linux-arm-kernel at lists.infradead.org
Cc: Jingoo Han; linux-usb at vger.kernel.org; linux-samsung-soc at vger.kernel.org; 'Kukjin Kim'; linaro- dev at lists.linaro.org; 'Joonyoung Shim'; patches at linaro.org; 'Greg Kroah-Hartman'; 'Sangwook Lee'; 'Alan Stern'; 'Thomas Abraham'
Subject: Re: [PATCH v2 1/2] ARM: EXYNOS: Add USB HOST register definitions

Am Donnerstag, 1. M?rz 2012, 06:38:20 schrieb Jingoo Han:

Quoted 4 lines

This patch adds USB HOST register definitions. The definition for EHCI INSNREG00 regiser and corresponding bit field definitions are added.

Quoted 8 lines

---
v2: change the definition name from EHCI_ENA_xxx to EHCI_INSNREG00_ENA_xxx.

arch/arm/mach-exynos/include/mach/regs-usb-host.h | 24
+++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-exynos/include/mach/regs-usb-host.h
Quoted 7 lines

Isn't the general idea to depopulate the mach directories and make drivers buildable across architectures?

The definitions are only used in drivers/usb/host/ehci-s5p.c [in the second patch], so there should be no need to add another arch-header and they could simply be included in the driver itself or if necessary a drivers/usb/host/ehci-s5p.h

Hi, Heiko St?bner.

OK, I will move the register definitions from arch/arm/mach-exynos/include/mach to drivers/usb/host/ehci-s5p.c.

Thank you for your suggestion.

Quoted 39 lines

Heiko

Quoted 20 lines
(quoted diff) +0 -0

b/arch/arm/mach-exynos/include/mach/regs-usb-host.h new file mode 100644 index 0000000..572b7d4

arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +14 -0
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ *		http://www.samsung.com
+ *
+ * EXYNOS - USB HOST register definitions
+ *
+ * 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.
+ */
+
+#ifndef __REGS_USB_HOST_H
+#define __REGS_USB_HOST_H __FILE__
+

arch/arm/mach-exynos/include/mach/regs-usb-host.h line 24

Quoted 10 lines
arch/arm/mach-exynos/include/mach/regs-usb-host.h new file +10 -0
+#define EHCI_INSNREG00(base)			(base + 0x90)
+#define EHCI_INSNREG00_ENA_INCR16		(0x1 << 25)
+#define EHCI_INSNREG00_ENA_INCR8		(0x1 << 24)
+#define EHCI_INSNREG00_ENA_INCR4		(0x1 << 23)
+#define EHCI_INSNREG00_ENA_INCRX_ALIGN		(0x1 << 22)
+#define EHCI_INSNREG00_ENABLE_DMA_BURST	\
+	(EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 |	\
+	 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
+
+#endif /* __REGS_USB_HOST_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html