Skip to contentSkip to conversation

add USB setup code for 8349emds PB

PATCH In review Li Yang 3 participants 14 messages Feb 6, 2007 – Feb 7, 2007

Subsystems (2)
lore
Share & tools
lore

Li Yang

author
#0 lore raw

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

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

---

arch/powerpc/platforms/83xx/Kconfig       |    4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c |   79 +++++++++++++++++++++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h |    2 +
arch/powerpc/platforms/83xx/mpc83xx.h     |   18 +++++++
4 files changed, 103 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..aff7ae3 100644
@@ -35,14 +35,88 @@

#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;
+ void __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);
+ if (!immap)
+ return -1;
+
+ /* Configure clock */
+ sccr = in_be32(immap + MPC83XX_SCCR_OFFS);
+ if (port0_is_dr)
+ sccr |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
+ else
+ sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
+ out_be32(immap + MPC83XX_SCCR_OFFS, sccr);
+
+ /* Configure Pin */
+ sicrl = in_be32(immap + MPC83XX_SICRL_OFFS);
+ /* set port0 only */
+ if (port0_is_dr)
+ sicrl |= MPC83XX_SICRL_USB0;
+ else
+ sicrl &= ~(MPC83XX_SICRL_USB0);
+ out_be32(immap + MPC83XX_SICRL_OFFS, sicrl);
+
+ iounmap(immap);
+
+ /* 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 (!bcsr_regs)
+ return -1;
+
+ /*
+ * if SYS board is plug into PIB board,
+ * force to use the PHY on SYS board
+ */
+ if (!(bcsr_regs[5] & BCSR5_INT_USB))
+ bcsr_regs[5] |= BCSR5_INT_USB;
+ iounmap(bcsr_regs);
+ return 0;
+}
+
+#endif /* CONFIG_834x_USB_SUPPORT */
+
+
/* ************************************************************************
*
* Setup the architecture
@@ -65,6 +139,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 +147,10 @@ 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();
+#endif
+

#ifdef  CONFIG_ROOT_NFS
	ROOT_DEV = Root_NFS;

#else

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

#define PIRQC MPC83xx_IRQ_EXT6
#define PIRQD MPC83xx_IRQ_EXT7

+#define BCSR5_INT_USB 0x02
+
#endif /* __MACH_MPC83XX_SYS_H__ */

arch/powerpc/platforms/83xx/mpc83xx.h +0 -0
index 01cae10..9cd03b5 100644
@@ -4,6 +4,24 @@

#include <linux/init.h>
#include <linux/device.h>

+/* System Clock Control Register */

+#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
+
/*
* Declaration for the various functions exported by the
* mpc83xx_* files. Mostly for use by mpc83xx_setup

#1 lore raw
Quoted 2 lines · Li Yang

+static volatile u8 *bcsr_regs = NULL;

A 'static volatile u8*' type sounds very wrong. You use the variable only in one function, so it should be local to that. There is normally no reason to ever mark a variable volatile in driver code, instead you want it to be '__iomem'. It should probably also be 'void *' instead of 'u8 *', so it doesn't get dereferenced by accident. Your references should be changed to use in_8/out_8 or readb/writeb, depending on whether it's on-chip or PCI space.

Review

Quoted 11 lines
(quoted diff) +11 -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;
+	}

I'm not sure if scanning through the device tree to find mmio addresses is still considered valid style. I would instead prefer you to provide a of_platform_driver that attaches to the respective 'compatible' property and does the register access in its probe() function in order to not conflict with other drivers.

	Arnd <><
#2 lore raw
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +1 -0
+	if ((np =3D of_find_compatible_node(np, "usb", "fsl-usb2-dr")) =

!=3D
NULL)

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+		port0_is_dr =3D 1;
+	if ((np =3D of_find_compatible_node(np, "usb", "fsl-usb2-mph")) =

!=3D
NULL){

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+		if (port0_is_dr) {
+			printk(KERN_WARNING
+				"There is only one USB port on PB board!

\n");

Quoted 7 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+			return -1;
+		} else if (!port0_is_dr)
+			/* No usb port enabled */
+			return -1;
+	}

=20
I'm not sure if scanning through the device tree to find mmio

addresses

Quoted 1 line

is still considered valid style. I would instead prefer you to provide

a

Quoted 1 line

of_platform_driver that attaches to the respective 'compatible'

property

Quoted 2 lines

and does the register access in its probe() function in order to not conflict with other drivers.

The driver will not use of_platform_driver for it to be used through multiple architectures.

- Leo

#3 lore raw
Quoted 9 lines · On Wednesday 07 February 2007 03:22, Li Yang-r58472 wrote:
Quoted 6 lines

I'm not sure if scanning through the device tree to find mmio addresses is still considered valid style. I would instead prefer you to provide a of_platform_driver that attaches to the respective 'compatible' property and does the register access in its probe() function in order to not conflict with other drivers.

The driver will not use of_platform_driver for it to be used through multiple architectures.

Huh? I don't understand. You currently use of_find_compatible_node(), which is also platform-specific.

	Arnd <><
#4 lore raw
Quoted 14 lines

-----Original Message-----
From: Arnd Bergmann [mailto:[email protected]]
Sent: Wednesday, February 07, 2007 4:47 PM
To: Li Yang-r58472
Cc: [email protected]; Paul
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB =20

Quoted 6 lines · On Wednesday 07 February 2007 03:22, Li Yang-r58472 wrote:
Quoted 6 lines

I'm not sure if scanning through the device tree to find mmio addresses is still considered valid style. I would instead prefer you to provide a of_platform_driver that attaches to the respective 'compatible' property and does the register access in its probe() function in order to not conflict with other

drivers.

Quoted 6 lines
Quoted 3 lines

The driver will not use of_platform_driver for it to be used through multiple architectures.

=20
Huh? I don't understand. You currently use of_find_compatible_node(), which is also platform-specific.

Do you mean to create an of_plarform_driver here just to do the platform initialization? The true USB driver can only takes platform_device as it is used by multiple architectures.
btw: We don't access the mmio address of the device here. We just need to read some property from the device tree.

- Leo

#5 lore raw
Quoted 5 lines · On Wednesday 07 February 2007 10:16, Li Yang-r58472 wrote:

Do you mean to create an of_plarform_driver here just to do the platform initialization? =A0The true USB driver can only takes platform_device as it is used by multiple architectures.
btw: We don't access the mmio address of the device here. =A0We just need to read some property from the device tree.

The usb host controllers already come with an abstraction layer, e.g. there is ehci-fsl.c, ehci-au1xxx.c and some more. All powerpc bases systems that have the host controller on a local bus instead of PCI should use a common driver for that, I believe one has already been posted some time ago, but I'm not entirely sure about that.

As mentioned by Kumar Gala, we should eventually migrate over the users of ehci-fsl to a new ehci-of, but getting rid of ehci-fsl means removing all its users in arch/ppc first.

	Arnd <><
#6 lore raw
Quoted 9 lines

-----Original Message-----
From: Arnd Bergmann [mailto:[email protected]]
Sent: Wednesday, February 07, 2007 6:02 PM
To: [email protected]
Cc: Li Yang-r58472; Paul
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB =20

Quoted 1 line · On Wednesday 07 February 2007 10:16, Li Yang-r58472 wrote:

Do you mean to create an of_plarform_driver here just to do the =

platform

Quoted 1 line
Quoted 1 line

initialization? =A0The true USB driver can only takes =

platform_device as

Quoted 2 lines
Quoted 2 lines

it is used by multiple architectures.
btw: We don't access the mmio address of the device here. =A0We just =

need

Quoted 3 lines
Quoted 1 line

to read some property from the device tree.

=20
The usb host controllers already come with an abstraction layer, e.g. =

there

Quoted 1 line

is ehci-fsl.c, ehci-au1xxx.c and some more. All powerpc bases systems =

that

Quoted 1 line

have the host controller on a local bus instead of PCI should use a =

common

Quoted 4 lines

driver for that, I believe one has already been posted some time ago, but I'm not entirely sure about that.
=20
As mentioned by Kumar Gala, we should eventually migrate over the =

users

Quoted 1 line

of ehci-fsl to a new ehci-of, but getting rid of ehci-fsl means =

removing

Quoted 1 line

all its users in arch/ppc first.

How about a non-PCI ehci driver for all architectures (such as arm, = m68k)? Then, platform_bus is a more generic interface than of_platform.

- Leo

#7 lore raw
Quoted 2 lines · On Wednesday 07 February 2007 11:10, Li Yang-r58472 wrote:

How about a non-PCI ehci driver for all architectures (such as arm, m68k)? Then, platform_bus is a more generic interface than of_platform.

Yes, that's right. The main difference is that if you scan all of devices at boot time, you already have a node for the USB controller and you shouldn't need to create another node that does not reflect the actual hierarchy in the linux device tree.

A platform_device is really meant to be 'something that can't be probed but we know it is there', like the interrupt controller on a PC. With the of device tree, we can probe anything, so ideally, we should not need to create any platform devices at all.

	Arnd <><
#8 lore raw
Quoted 9 lines · Arnd Bergmann
Quoted 2 lines · On Wednesday 07 February 2007 11:10, Li Yang-r58472 wrote:

How about a non-PCI ehci driver for all architectures (such as arm, m68k)? Then, platform_bus is a more generic interface than of_platform.

Yes, that's right. The main difference is that if you scan all of devices at boot time, you already have a node for the USB controller and you shouldn't need to create another node that does not reflect the actual hierarchy in the linux device tree.

Quoted 4 lines

A platform_device is really meant to be 'something that can't be probed but we know it is there', like the interrupt controller on a PC. With the of device tree, we can probe anything, so ideally, we should not need to create any platform devices at all.

I think the concern is how to handle the case on something like ARM w/o the device-tree. We can support both mechanisms in the driver

However, the bigger issue is getting so we can remove arch/ppc consumers.

- k

#9 lore raw
In reply to Li Yang
Quoted 19 lines · Li Yang

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

---

arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 79 +++++++++++++++++++
++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 2 +
arch/powerpc/platforms/83xx/mpc83xx.h | 18 +++++++

4 files changed, 103 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)
+

I'm still not convinced we need a new config option for this.

Quoted 11 lines

endmenu

arch/powerpc/platforms/83xx/mpc834x_sys.c +1 -0
index 80b735a..aff7ae3 100644
@@ -35,14 +35,88 @@
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
+#include <linux/fsl_devices.h>
 #include "mpc83xx.h"

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

Quoted 10 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +6 -0
+#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 */

Can you tell if we are on PIB by what type of phy is used?

Quoted 12 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +10 -0
+static int mpc834x_usb_cfg(void)
+{
+	unsigned long sccr, sicrl;
+	void __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 71

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);

Do we really need to remap 1M, both registers live in one 4k page 0x1000

Quoted 106 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +52 -0
+	if (!immap)
+		return -1;
+
+	/* Configure clock */
+	sccr = in_be32(immap + MPC83XX_SCCR_OFFS);
+	if (port0_is_dr)
+		sccr |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
+	else
+		sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
+	out_be32(immap + MPC83XX_SCCR_OFFS, sccr);
+
+	/* Configure Pin */
+	sicrl = in_be32(immap + MPC83XX_SICRL_OFFS);
+	/* set port0 only */
+	if (port0_is_dr)
+		sicrl |= MPC83XX_SICRL_USB0;
+	else
+		sicrl &= ~(MPC83XX_SICRL_USB0);
+	out_be32(immap + MPC83XX_SICRL_OFFS, sicrl);
+
+	iounmap(immap);
+
+	/* 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 (!bcsr_regs)
+		return -1;
+
+	/*
+	 * if SYS board is plug into PIB board,
+	 * force to use the PHY on SYS board
+	 */
+	if (!(bcsr_regs[5] & BCSR5_INT_USB))
+		bcsr_regs[5] |= BCSR5_INT_USB;
+	iounmap(bcsr_regs);
+	return 0;
+}
+
+#endif /* CONFIG_834x_USB_SUPPORT */
+
+
 /* ************************************************************************
 *
 * Setup the architecture
@@ -65,6 +139,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 +147,10 @@ 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();
+#endif
+
 #ifdef  CONFIG_ROOT_NFS
 	ROOT_DEV = Root_NFS;
 #else
arch/powerpc/platforms/83xx/mpc834x_sys.h +2 -0
index 7d5bbef..52f14a3 100644
@@ -20,4 +20,6 @@
 #define PIRQC	MPC83xx_IRQ_EXT6
 #define PIRQD	MPC83xx_IRQ_EXT7
+#define BCSR5_INT_USB		0x02
+
 #endif				/* __MACH_MPC83XX_SYS_H__ */
arch/powerpc/platforms/83xx/mpc83xx.h +18 -0
index 01cae10..9cd03b5 100644
@@ -4,6 +4,24 @@
 #include <linux/init.h>
 #include <linux/device.h>
+/* System Clock Control Register */
+#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
+
 /*
 * Declaration for the various functions exported by the
 * mpc83xx_* files. Mostly for use by mpc83xx_setup
#10 lore raw
Quoted 17 lines · Kumar Gala
Quoted 14 lines · Li Yang

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

---

arch/powerpc/platforms/83xx/Kconfig | 4 ++
arch/powerpc/platforms/83xx/mpc834x_sys.c | 79 +++++++++++++++++++
++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 2 +
arch/powerpc/platforms/83xx/mpc83xx.h | 18 +++++++

4 files changed, 103 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)
+

I'm still not convinced we need a new config option for this.

Ok, I see what this now accomplishes, but why don't we just build the support in always, lets just remove the config option altogether?

- k

#11 lore raw
Quoted 22 lines

-----Original Message-----
From: Kumar Gala [mailto:[email protected]]
Sent: Wednesday, February 07, 2007 12:31 AM
To: Kumar Gala
Cc: Li Yang-r58472; [email protected]; Paul
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB =20
=20
On Feb 6, 2007, at 8:37 AM, Kumar Gala wrote:
=20

Quoted 12 lines · Li Yang
Quoted 10 lines

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

---

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

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

Quoted 19 lines
Quoted 5 lines
Quoted 5 lines

++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 2 +
arch/powerpc/platforms/83xx/mpc83xx.h | 18 +++++++

4 files changed, 103 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)
+

I'm still not convinced we need a new config option for this.

Quoted 3 lines

=20
Ok, I see what this now accomplishes, but why don't we just build the support in always, lets just remove the config option altogether?

To save some space and time for embedded product which doesn't really need usb?

- Leo

#12 lore raw
Quoted 43 lines · On Feb 6, 2007, at 8:27 PM, Li Yang-r58472 wrote:
Quoted 8 lines

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

Quoted 14 lines
Quoted 12 lines · Kumar Gala
Quoted 9 lines · Li Yang

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

---

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

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

Quoted 20 lines
Quoted 19 lines
Quoted 11 lines

++++++++++
arch/powerpc/platforms/83xx/mpc834x_sys.h | 2 +
arch/powerpc/platforms/83xx/mpc83xx.h | 18 +++++++

4 files changed, 103 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)
+

I'm still not convinced we need a new config option for this.

Quoted 5 lines
Quoted 2 lines

Ok, I see what this now accomplishes, but why don't we just build the support in always, lets just remove the config option altogether?

To save some space and time for embedded product which doesn't really need usb?

Its not worth the savings. We are talking about a reference board here, if someone doesn't want this init code in their board port they are free to remove it.

- k

#13 lore raw
In reply to Kumar Gala
Quoted 17 lines

=20

Quoted 16 lines

endmenu

arch/ renamed from arch/powerpc/platforms/83xx/mpc834x_sys.c +0 -0

powerpc/platforms/83xx/mpc834x_sys.c
index 80b735a..aff7ae3 100644

arch/powerpc/platforms/83xx/mpc834x_sys.c +2 -0
@@ -35,14 +35,88 @@
 #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 =3D 0;
 unsigned long isa_mem_base =3D 0;
Quoted 8 lines

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

Quoted 6 lines
arch/powerpc/platforms/83xx/mpc834x_sys.c +5 -0
 #endif
+static volatile u8 *bcsr_regs =3D NULL;
+
+#ifdef CONFIG_834x_USB_SUPPORT
+/* Note: This is only for PB, not for PB+PIB
+ * On PB only port0 is connected using ULPI */

=20
Can you tell if we are on PIB by what type of phy is used?

No, PIB supports all PHYs including ULPI. We only deal with PB only case for now, as PIB is far more complex.

- Leo