Skip to contentSkip to conversation

add USB setup code for 8349emds PB

PATCH In review Li Yang 2 participants 8 messages Feb 5, 2007 – Feb 6, 2007

Subsystems (2)
lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH 1/3 add USB setup code for 8349emds PB

---

arch/powerpc/platforms/83xx/Kconfig       |    4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c |   77 +++++++++++++++++++++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h |   23 +++++++++
3 files changed, 104 insertions(+), 0 deletions(-)
arch/powerpc/platforms/83xx/Kconfig +0 -0
index edcd5b8..5371645 100644
@@ -59,4 +59,8 @@ config PPC_MPC836x

select PPC_INDIRECT_PCI
default y if MPC8360E_PB

+config 834x_USB_SUPPORT
+ bool
+ default y if MPC834x_SYS && (USB || USB_GADGET)
+
endmenu

arch/powerpc/platforms/83xx/mpc834x_sys.c +0 -0
index 80b735a..9b6abe9 100644
@@ -35,14 +35,69 @@

#include <asm/prom.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
+#include <linux/fsl_devices.h>

#include "mpc83xx.h"
+#include "mpc834x_sys.h"

#ifndef CONFIG_PCI
unsigned long isa_io_base = 0;
unsigned long isa_mem_base = 0;
#endif

+static volatile u8 *bcsr_regs = NULL;
+
+#ifdef CONFIG_834x_USB_SUPPORT
+/* Note: This is only for PB, not for PB+PIB
+ * On PB only port0 is connected using ULPI */
+static int mpc834x_usb_cfg(void)
+{
+ unsigned long sccr, sicrl;
+ volatile unsigned long *p;
+ unsigned long __iomem *immap;
+ struct device_node *np = NULL;
+ int port0_is_dr = 0;
+
+ if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL)
+ port0_is_dr = 1;
+ if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL){
+ if (port0_is_dr) {
+ printk(KERN_WARNING
+ "There is only one USB port on PB board! \n");
+ return -1;
+ } else if (!port0_is_dr)
+ /* No usb port enabled */
+ return -1;
+ }
+
+ immap = ioremap(get_immrbase(), 0x100000);
+
+ /* Configure clock */
+ p = (volatile unsigned long *)((u32)immap + MPC83XX_SCCR_OFFS);
+ sccr = *p;
+ if (port0_is_dr)
+ sccr |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
+ else
+ sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
+ *p = sccr;
+
+ /* Configure Pin */
+ p = (volatile unsigned long *)((u32)immap + MPC83XX_SICRL_OFFS);
+ sicrl = *p;
+ /* set port0 only */
+ if (port0_is_dr)
+ sicrl |= MPC83XX_SICRL_USB0;
+ else
+ sicrl &= ~(MPC83XX_SICRL_USB0);
+ *p = sicrl;
+
+ iounmap(immap);
+ return 0;
+}
+
+#endif /* CONFIG_834x_USB_SUPPORT */
+
+
/* ************************************************************************
*
* Setup the architecture
@@ -65,6 +120,7 @@ static void __init mpc834x_sys_setup_arch(void)

			loops_per_jiffy = 50000000 / HZ;
		of_node_put(np);
	}
+
#ifdef CONFIG_PCI
	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
		add_bridge(np);
@@ -72,6 +128,27 @@ static void __init mpc834x_sys_setup_arch(void)
	ppc_md.pci_exclude_device = mpc83xx_exclude_device;

#endif

+#ifdef CONFIG_834x_USB_SUPPORT
+ mpc834x_usb_cfg();
+
+ /* Map BCSR area */
+ np = of_find_node_by_name(NULL, "bcsr");
+ if (np != 0) {
+ struct resource res;
+
+ of_address_to_resource(np, 0, &res);
+ bcsr_regs = ioremap(res.start, res.end - res.start + 1);
+ of_node_put(np);
+ }
+
+ /*
+ * if SYS board is plug into PIB board,
+ * force to use the PHY on SYS board
+ * */
+ if ((bcsr_regs != NULL) && !(bcsr_regs[5] & BCSR5_INT_USB))
+ bcsr_regs[5] |= BCSR5_INT_USB;
+#endif
+

#ifdef  CONFIG_ROOT_NFS
	ROOT_DEV = Root_NFS;

#else

arch/powerpc/platforms/83xx/mpc834x_sys.h +0 -0
index 7d5bbef..c2786fe 100644
@@ -20,4 +20,27 @@

#define PIRQC MPC83xx_IRQ_EXT6
#define PIRQD MPC83xx_IRQ_EXT7

+#define BCSR_PHYS_ADDR ((uint)0xf8000000)
+#define BCSR_SIZE ((uint)(32 * 1024))
+ +#define BCSR5_OFF 0x05
+#define BCSR5_INT_USB 0x02
+

+#define MPC83XX_SCCR_OFFS          0xA08
+#define MPC83XX_SCCR_USB_MPHCM_11  0x00c00000
+#define MPC83XX_SCCR_USB_MPHCM_01  0x00400000
+#define MPC83XX_SCCR_USB_MPHCM_10  0x00800000
+#define MPC83XX_SCCR_USB_DRCM_11   0x00300000
+#define MPC83XX_SCCR_USB_DRCM_01   0x00100000
+#define MPC83XX_SCCR_USB_DRCM_10   0x00200000
+
+/* system i/o configuration register low */
+#define MPC83XX_SICRL_OFFS         0x114
+#define MPC83XX_SICRL_USB0         0x40000000
+#define MPC83XX_SICRL_USB1         0x20000000

+
+/* system i/o configuration register high */
+#define MPC83XX_SICRH_OFFS 0x118
+#define MPC83XX_SICRH_USB_UTMI 0x00020000
+
#endif /* __MACH_MPC83XX_SYS_H__ */

#1 lore raw

On Feb 5, 2007, at 3:09 AM, Li Yang wrote:

You have no description about what this patch does and why its needed.

Quoted 13 lines

---
arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 77 +++++++++++++++++++
++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 +++++++++

3 files changed, 104 insertions(+), 0 deletions(-)
arch/powerpc/platforms/83xx/Kconfig +0 -0
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 6 lines
arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

Do we really need to introduce a new config option?

Quoted 34 lines

endmenu

arch/powerpc/platforms/83xx/mpc834x_sys.c +18 -0
index 80b735a..9b6abe9 100644
@@ -35,14 +35,69 @@
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
+#include <linux/fsl_devices.h>
 #include "mpc83xx.h"
+#include "mpc834x_sys.h"
 #ifndef CONFIG_PCI
 unsigned long isa_io_base = 0;
 unsigned long isa_mem_base = 0;
 #endif
+static volatile u8 *bcsr_regs = NULL;
+
+#ifdef CONFIG_834x_USB_SUPPORT
+/* Note: This is only for PB, not for PB+PIB
+ * On PB only port0 is connected using ULPI */
+static int mpc834x_usb_cfg(void)
+{
+	unsigned long sccr, sicrl;
+	volatile unsigned long *p;
+	unsigned long __iomem *immap;
+	struct device_node *np = NULL;
+	int port0_is_dr = 0;
+
+	if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) !=  
 NULL)
+		port0_is_dr = 1;
+	if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) !=  
 NULL){

arch/powerpc/platforms/83xx/mpc834x_sys.c line 72

Quoted 10 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +10 -0
+		if (port0_is_dr) {
+			printk(KERN_WARNING
+				"There is only one USB port on PB board! \n");
+			return -1;
+		} else if (!port0_is_dr)
+			/* No usb port enabled */
+			return -1;
+	}
+
+	immap = ioremap(get_immrbase(), 0x100000);

How about checking if ioremap returned something valid.

arch/powerpc/platforms/83xx/mpc834x_sys.c line 76

Quoted 4 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +4 -0
+
+	/* Configure clock */
+	p = (volatile unsigned long *)((u32)immap + MPC83XX_SCCR_OFFS);
+	sccr = *p;

Don't do direct pointer access like this, use in_be32/out_be32

Quoted 46 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +33 -0
+	if (port0_is_dr)
+		sccr |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
+	else
+		sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
+	*p = sccr;
+
+	/* Configure Pin */
+	p = (volatile unsigned long *)((u32)immap + MPC83XX_SICRL_OFFS);
+	sicrl = *p;
+	/* set port0 only */
+	if (port0_is_dr)
+		sicrl |= MPC83XX_SICRL_USB0;
+	else
+		sicrl &= ~(MPC83XX_SICRL_USB0);
+	*p = sicrl;
+
+	iounmap(immap);
+	return 0;
+}
+
+#endif /* CONFIG_834x_USB_SUPPORT */
+
+
 /* ************************************************************************
 *
 * Setup the architecture
@@ -65,6 +120,7 @@ static void __init mpc834x_sys_setup_arch(void)
 			loops_per_jiffy = 50000000 / HZ;
 		of_node_put(np);
 	}
+
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
 		add_bridge(np);
@@ -72,6 +128,27 @@ static void __init mpc834x_sys_setup_arch(void)
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
+#ifdef CONFIG_834x_USB_SUPPORT
+	mpc834x_usb_cfg();
+
+	/* Map BCSR area */
+	np = of_find_node_by_name(NULL, "bcsr");
+	if (np != 0) {
+		struct resource res;
+
+		of_address_to_resource(np, 0, &res);

arch/powerpc/platforms/83xx/mpc834x_sys.c static void __init mpc834x_sys_setup_arch(void) · line 148

Quoted 10 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +10 -0
+		bcsr_regs = ioremap(res.start, res.end - res.start + 1);
+		of_node_put(np);
+	}
+
+	/*
+	 * if SYS board is plug into PIB board,
+	 * force to use the PHY on SYS board
+	 * */
+	if ((bcsr_regs != NULL) && !(bcsr_regs[5] & BCSR5_INT_USB))
+		bcsr_regs[5] |= BCSR5_INT_USB;

why not fold all this into mpc834x_usb_cfg() since its all board related config code?

iounmap(bcsr) ?

Quoted 23 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +2 -0
+#endif
+
 #ifdef  CONFIG_ROOT_NFS
 	ROOT_DEV = Root_NFS;
 #else
arch/powerpc/platforms/83xx/mpc834x_sys.h +11 -0
index 7d5bbef..c2786fe 100644
@@ -20,4 +20,27 @@
 #define PIRQC	MPC83xx_IRQ_EXT6
 #define PIRQD	MPC83xx_IRQ_EXT7
+#define BCSR_PHYS_ADDR		((uint)0xf8000000)
+#define BCSR_SIZE		((uint)(32 * 1024))
+ +#define BCSR5_OFF		0x05
+#define BCSR5_INT_USB		0x02
+
+#define MPC83XX_SCCR_OFFS          0xA08
+#define MPC83XX_SCCR_USB_MPHCM_11  0x00c00000
+#define MPC83XX_SCCR_USB_MPHCM_01  0x00400000
+#define MPC83XX_SCCR_USB_MPHCM_10  0x00800000
+#define MPC83XX_SCCR_USB_DRCM_11   0x00300000
+#define MPC83XX_SCCR_USB_DRCM_01   0x00100000

arch/powerpc/platforms/83xx/mpc834x_sys.h line 42

Quoted 10 lines
arch/powerpc/platforms/83xx/mpc834x_sys.h +10 -0
+#define MPC83XX_SCCR_USB_DRCM_10   0x00200000
+
+/* system i/o configuration register low */
+#define MPC83XX_SICRL_OFFS         0x114
+#define MPC83XX_SICRL_USB0         0x40000000
+#define MPC83XX_SICRL_USB1         0x20000000
+
+/* system i/o configuration register high */
+#define MPC83XX_SICRH_OFFS         0x118
+#define MPC83XX_SICRH_USB_UTMI     0x00020000

You should stick these defines in mpc83xx.h so they are available to everyone.

- k

#2 lore raw
Quoted 11 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Monday, February 05, 2007 11:04 PM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB =20
=20
On Feb 5, 2007, at 3:09 AM, Li Yang wrote:
=20
You have no description about what this patch does and why its needed.

Add cpu and board specific initialization code for USB to work in both MPH and DR mode for MPC8349EMDS PB board.

Quoted 9 lines

=20

Quoted 8 lines

---
arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 77 +++++++++++++++++++
++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 +++++++++

3 files changed, 104 insertions(+), 0 deletions(-)
Quoted 14 lines

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 12 lines
arch/powerpc/ renamed from arch/powerpc/platforms/83xx/Kconfig +0 -0

platforms/83xx/Kconfig
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

=20
Do we really need to introduce a new config option?

It will be neater to make use of the Kconfig feature than judging all the macros and module variations. It will be a very long #if defined the other way.

Quoted 7 lines

arch/powerpc/platforms/83xx/Kconfig static void __init mpc834x_sys_setup_arch(void) · line 125

Quoted 7 lines
arch/powerpc/platforms/83xx/Kconfig +1 -0
@@ -65,6 +120,7 @@ static void __init mpc834x_sys_setup_arch(void)
 			loops_per_jiffy =3D 50000000 / HZ;
 		of_node_put(np);
 	}
+
 #ifdef CONFIG_PCI
 	for (np =3D NULL; (np =3D of_find_node_by_type(np, "pci")) !=3D =

NULL;)

Quoted 18 lines
Quoted 18 lines
arch/powerpc/platforms/83xx/Kconfig +14 -0
 		add_bridge(np);
@@ -72,6 +128,27 @@ static void __init mpc834x_sys_setup_arch(void)
 	ppc_md.pci_exclude_device =3D mpc83xx_exclude_device;
 #endif
+#ifdef CONFIG_834x_USB_SUPPORT
+	mpc834x_usb_cfg();
+
+	/* Map BCSR area */
+	np =3D of_find_node_by_name(NULL, "bcsr");
+	if (np !=3D 0) {
+		struct resource res;
+
+		of_address_to_resource(np, 0, &res);
+		bcsr_regs =3D ioremap(res.start, res.end - res.start + 1);
+		of_node_put(np);
+	}
+
+	/*
Quoted 8 lines

arch/powerpc/platforms/83xx/Kconfig static void __init mpc834x_sys_setup_arch(void) · line 148

Quoted 5 lines
arch/powerpc/platforms/83xx/Kconfig +5 -0
+	 * if SYS board is plug into PIB board,
+	 * force to use the PHY on SYS board
+	 * */
+	if ((bcsr_regs !=3D NULL) && !(bcsr_regs[5] & BCSR5_INT_USB))
+		bcsr_regs[5] |=3D BCSR5_INT_USB;

=20
why not fold all this into mpc834x_usb_cfg() since its all board related config code?

Well, not quite. The code in mpc834x_usb_cfg() is 834x CPU specific initialization. The bcsr is board specific.

- Leo

#3 lore raw
Quoted 38 lines · On Feb 5, 2007, at 9:15 PM, Li Yang-r58472 wrote:
Quoted 11 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Monday, February 05, 2007 11:04 PM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB

On Feb 5, 2007, at 3:09 AM, Li Yang wrote:

You have no description about what this patch does and why its needed.

Add cpu and board specific initialization code for USB to work in both MPH and DR mode for MPC8349EMDS PB board.

Quoted 9 lines
Quoted 9 lines

---
arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 77 +++++++++++++++++++
++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 +++++++++

3 files changed, 104 insertions(+), 0 deletions(-)
Quoted 14 lines

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 12 lines
arch/powerpc/ renamed from arch/powerpc/platforms/83xx/Kconfig +0 -0

platforms/83xx/Kconfig
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

Do we really need to introduce a new config option?

Quoted 3 lines

It will be neater to make use of the Kconfig feature than judging all the macros and module variations. It will be a very long #if defined the other way.

Huh, it would look like:

#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET).

Not very long.

Quoted 34 lines
Quoted 25 lines
Quoted 25 lines
arch/powerpc/platforms/83xx/Kconfig +15 -0
@@ -65,6 +120,7 @@ static void __init mpc834x_sys_setup_arch(void)
 			loops_per_jiffy = 50000000 / HZ;
 		of_node_put(np);
 	}
+
 #ifdef CONFIG_PCI
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
 		add_bridge(np);
@@ -72,6 +128,27 @@ static void __init mpc834x_sys_setup_arch(void)
 	ppc_md.pci_exclude_device = mpc83xx_exclude_device;
 #endif
+#ifdef CONFIG_834x_USB_SUPPORT
+	mpc834x_usb_cfg();
+
+	/* Map BCSR area */
+	np = of_find_node_by_name(NULL, "bcsr");
+	if (np != 0) {
+		struct resource res;
+
+		of_address_to_resource(np, 0, &res);
+		bcsr_regs = ioremap(res.start, res.end - res.start + 1);
+		of_node_put(np);
+	}
+
+	/*
Quoted 8 lines

arch/powerpc/platforms/83xx/Kconfig static void __init mpc834x_sys_setup_arch(void) · line 148

Quoted 5 lines
arch/powerpc/platforms/83xx/Kconfig +5 -0
+	 * if SYS board is plug into PIB board,
+	 * force to use the PHY on SYS board
+	 * */
+	if ((bcsr_regs != NULL) && !(bcsr_regs[5] & BCSR5_INT_USB))
+		bcsr_regs[5] |= BCSR5_INT_USB;

why not fold all this into mpc834x_usb_cfg() since its all board related config code?

Quoted 2 lines

Well, not quite. The code in mpc834x_usb_cfg() is 834x CPU specific initialization. The bcsr is board specific.

If that's the case what are they doing in mpc834x_sys.c which is a board specific file?

Rather, I see the setting for SCCR/SICRL as board specific.

- k

#4 lore raw
Quoted 24 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, February 06, 2007 11:31 AM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB =20
=20
On Feb 5, 2007, at 9:15 PM, Li Yang-r58472 wrote:
=20

Quoted 14 lines
Quoted 8 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Monday, February 05, 2007 11:04 PM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB

Quoted 4 lines

On Feb 5, 2007, at 3:09 AM, Li Yang wrote:

You have no description about what this patch does and why its needed.

Add cpu and board specific initialization code for USB to work in

both

Quoted 6 lines
Quoted 6 lines

MPH and DR mode for MPC8349EMDS PB board.

Quoted 5 lines
Quoted 5 lines

---
arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 77

+++++++++++++++++++

Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 10 lines

++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 +++++++++

3 files changed, 104 insertions(+), 0 deletions(-)
arch/powerpc/ renamed from arch/powerpc/platforms/83xx/Kconfig +0 -0

platforms/83xx/Kconfig
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 6 lines
arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

Do we really need to introduce a new config option?

Quoted 1 line
Quoted 1 line

It will be neater to make use of the Kconfig feature than judging

all

Quoted 1 line
Quoted 1 line

the macros and module variations. It will be a very long #if

defined

Quoted 5 lines
Quoted 1 line

the other way.

=20
Huh, it would look like:
=20
#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET).

Are you sure we don't need CONFIG_USB_MODULE and CONFIG_USB_GADGET_MODULE any more? At least in some early kernel version, they are needed explicitly.

- Leo

#5 lore raw
Quoted 57 lines · On Feb 5, 2007, at 9:46 PM, Li Yang-r58472 wrote:
Quoted 8 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Tuesday, February 06, 2007 11:31 AM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB

Quoted 16 lines
Quoted 14 lines · On Feb 5, 2007, at 9:15 PM, Li Yang-r58472 wrote:
Quoted 8 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Monday, February 05, 2007 11:04 PM
To: Li Yang-r58472
Cc: Paul; [email protected]
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB

Quoted 4 lines

On Feb 5, 2007, at 3:09 AM, Li Yang wrote:

You have no description about what this patch does and why its needed.

Add cpu and board specific initialization code for USB to work in

both

Quoted 6 lines
Quoted 6 lines

MPH and DR mode for MPC8349EMDS PB board.

Quoted 5 lines
Quoted 5 lines

---
arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 77

+++++++++++++++++++

Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 10 lines

++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 +++++++++

3 files changed, 104 insertions(+), 0 deletions(-)
arch/powerpc/ renamed from arch/powerpc/platforms/83xx/Kconfig +0 -0

platforms/83xx/Kconfig
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 6 lines
arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

Do we really need to introduce a new config option?

Quoted 1 line
Quoted 1 line

It will be neater to make use of the Kconfig feature than judging

all

Quoted 1 line
Quoted 1 line

the macros and module variations. It will be a very long #if

defined

Quoted 2 lines
Quoted 1 line

the other way.

Quoted 7 lines
Quoted 3 lines

Huh, it would look like:

#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET).

Are you sure we don't need CONFIG_USB_MODULE and CONFIG_USB_GADGET_MODULE any more? At least in some early kernel version, they are needed explicitly.

I'm not seeing any references to either CONFIG option.

Also, I'm not seeing any code to support OTG for ehci/83xx... (in the kernel tree). Are there patches for this?

- k

#6 lore raw
Quoted 25 lines
Quoted 25 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

arch/powerpc/platforms/83xx/Kconfig config PPC_MPC836x · line 64

Quoted 12 lines
arch/powerpc/ renamed from arch/powerpc/platforms/83xx/Kconfig +0 -0

platforms/83xx/Kconfig
index edcd5b8..5371645 100644

arch/powerpc/platforms/83xx/Kconfig +4 -0
@@ -59,4 +59,8 @@ config PPC_MPC836x
 	select PPC_INDIRECT_PCI
 	default y if MPC8360E_PB
+config 834x_USB_SUPPORT
+	bool
+	default y if MPC834x_SYS && (USB || USB_GADGET)
+

Do we really need to introduce a new config option?

Quoted 1 line
Quoted 1 line

It will be neater to make use of the Kconfig feature than judging

all

Quoted 1 line
Quoted 1 line

the macros and module variations. It will be a very long #if

defined

Quoted 5 lines
Quoted 1 line

the other way.

Huh, it would look like:

#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET).

Quoted 8 lines
Quoted 3 lines

Are you sure we don't need CONFIG_USB_MODULE and CONFIG_USB_GADGET_MODULE any more? At least in some early kernel version, they are needed explicitly.

=20
I'm not seeing any references to either CONFIG option.
=20
Also, I'm not seeing any code to support OTG for ehci/83xx... (in the kernel tree). Are there patches for this?

The complete OTG protocol support is not submitted yet, but the OTG mode support for ehci-fsl is submitted to linux-usb.

- Leo

#7 lore raw
In reply to Kumar Gala
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

Huh, it would look like:

#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET).

Are you sure we don't need CONFIG_USB_MODULE and CONFIG_USB_GADGET_MODULE any more? At least in some early kernel version, they are needed explicitly.

=20
I'm not seeing any references to either CONFIG option.

There is no direct reference to the CONFIG_*_MODULE. But if you configure a driver to be module, the CONFIG_*_MODULE is defined not CONFIG_*. Here we need the init code when USB host or gadget is selected either as built-in or module.

- Leo