LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/85xx: Fix doorbells
From: Kumar Gala @ 2011-10-12  4:26 UTC (permalink / raw)
  To: Matthew McClintock; +Cc: linuxppc-dev
In-Reply-To: <1318378002-32531-1-git-send-email-msm@freescale.com>


On Oct 11, 2011, at 7:06 PM, Matthew McClintock wrote:

> Commit 765342526246c97600e5344c0949824d94bb51c3 made some small
> changes to IPI, message_pass in smp_ops was initialized to NULL
> for other platforms but not for 85xx which causes us to always
> use the mpic for IPI's. This patch makes doorbells work again.
> 
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> arch/powerpc/platforms/85xx/smp.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)

applied (updated commit message a bit).

- k

^ permalink raw reply

* Re: [PATCH] powerpc: e500mc: Fix: use CONFIG_PPC_E500MC in idle_e500.S
From: Kumar Gala @ 2011-10-12  4:24 UTC (permalink / raw)
  To: Bharat Bhushan; +Cc: Bharat Bhushan, linuxppc-dev, bharatb.yadav
In-Reply-To: <1318312568-23181-1-git-send-email-bharat.bhushan@freescale.com>


On Oct 11, 2011, at 12:56 AM, Bharat Bhushan wrote:

> It is wrongly using undefined CONFIG_E500MC.
> 
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
> arch/powerpc/kernel/idle_e500.S |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

applied, can you send this linux-stable for v3.0.x inclusion

- k

^ permalink raw reply

* Re: [PATCH 1/4] powerpc/85xx: Rename PowerPC core nodes to match other e500mc based .dts
From: Kumar Gala @ 2011-10-12  4:21 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1314905175-4371-1-git-send-email-galak@kernel.crashing.org>


On Sep 1, 2011, at 2:26 PM, Kumar Gala wrote:

> The P4080 silicon device tree was using PowerPC,4080 while the other
> e500mc based SoCs used PowerPC,e500mc.  Use the core name to be
> consistent going forward.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/boot/dts/p4080si.dtsi |   16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH 2/4] powerpc/85xx: Rename p2040_rdb.c to p2041_rdb.c
From: Kumar Gala @ 2011-10-12  4:20 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Mingkai Hu
In-Reply-To: <1314905178-4394-1-git-send-email-galak@kernel.crashing.org>


On Sep 1, 2011, at 2:26 PM, Kumar Gala wrote:

> From: Mingkai Hu <Mingkai.hu@freescale.com>
>=20
> There's only p2041rdb board for official release, but the p2041 =
silicon
> on the board can be converted to p2040 silicon without XAUI and L2 =
cache
> function, then the board becomes p2040rdb board. so we use the file =
name
> p2041_rdb.c to handle P2040RDB board and P2041RDB board which is also
> consistent with the board name under U-Boot.
>=20
> During the rename we make few other minor changes to the device tree:
> * Move USB phy setting into p2041si.dtsi as its SoC not board defined
> * Convert PCI clock-frequency to decimal to be more readable
>=20
> Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/boot/dts/p2040rdb.dts           |  166 -------
> arch/powerpc/boot/dts/p2040si.dtsi           |  623 =
--------------------------
> arch/powerpc/boot/dts/p2041rdb.dts           |  161 +++++++
> arch/powerpc/boot/dts/p2041si.dtsi           |  623 =
++++++++++++++++++++++++++
> arch/powerpc/configs/corenet32_smp_defconfig |    2 +-
> arch/powerpc/platforms/85xx/Kconfig          |    6 +-
> arch/powerpc/platforms/85xx/Makefile         |    2 +-
> arch/powerpc/platforms/85xx/p2040_rdb.c      |   88 ----
> arch/powerpc/platforms/85xx/p2041_rdb.c      |   88 ++++
> 9 files changed, 877 insertions(+), 882 deletions(-)
> delete mode 100644 arch/powerpc/boot/dts/p2040rdb.dts
> delete mode 100644 arch/powerpc/boot/dts/p2040si.dtsi
> create mode 100644 arch/powerpc/boot/dts/p2041rdb.dts
> create mode 100644 arch/powerpc/boot/dts/p2041si.dtsi
> delete mode 100644 arch/powerpc/platforms/85xx/p2040_rdb.c
> create mode 100644 arch/powerpc/platforms/85xx/p2041_rdb.c

applied

- k

^ permalink raw reply

* Re: [PATCH] powerpc/fsl_msi: fix support for multiple MSI ranges
From: Kumar Gala @ 2011-10-12  4:19 UTC (permalink / raw)
  To: Timur Tabi; +Cc: scottwood, linuxppc-dev
In-Reply-To: <1315948620-12402-1-git-send-email-timur@freescale.com>


On Sep 13, 2011, at 4:17 PM, Timur Tabi wrote:

> Commit 6820fead ("powerpc/fsl_msi: Handle msi-available-ranges =
better") added
> support for multiple ranges in the msi-available-ranges property, but =
it
> miscalculated the MSIR index when multiple ranges are used.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_msi.c |    8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)

applied

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/fsl-booke: Handle L1 D-cache parity error correctly on e500mc
From: Kumar Gala @ 2011-10-12  4:18 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1314443917-18515-1-git-send-email-galak@kernel.crashing.org>


On Aug 27, 2011, at 6:18 AM, Kumar Gala wrote:

> If the L1 D-Cache is in write shadow mode the HW will auto-recover the
> error.  However we might still log the error and cause a machine check
> (if L1CSR0[CPE] - Cache error checking enable).  We should only treat
> the non-write shadow case as non-recoverable.
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/include/asm/reg_booke.h |    3 +++
> arch/powerpc/kernel/traps.c          |    9 ++++++++-
> 2 files changed, 11 insertions(+), 1 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH 0/3] math_emu: fixup for efp
From: Kumar Gala @ 2011-10-12  4:17 UTC (permalink / raw)
  To: Liu Yu; +Cc: linuxppc-dev
In-Reply-To: <1315213283-3800-1-git-send-email-yu.liu@freescale.com>


On Sep 5, 2011, at 4:01 AM, Liu Yu wrote:

> These patches fix some issues in efp.

applied

- k

^ permalink raw reply

* Re: [PATCH] powerpc/82xx: updates for mgcoge
From: Kumar Gala @ 2011-10-12  4:16 UTC (permalink / raw)
  To: Holger Brunck; +Cc: linuxppc-dev
In-Reply-To: <1317109490-4449-1-git-send-email-holger.brunck@keymile.com>


On Sep 27, 2011, at 2:44 AM, Holger Brunck wrote:

> Add:
> - Setup dts node for USB
> - pin description and setup for SMC1 (serial interface)
> 
> Update and cleanup mgcoge_defconfig:
> - enable: TIPC, UBIFS, USB_GADGET driver, SQUASHFS, HIGHRES timers
>          POSIX_MQUEUE, EMBEDDED
> - disable: EXT3, PPC_PMAC
> 
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> Acked-by: Heiko Schocher <hs@denx.de>
> cc: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/boot/dts/mgcoge.dts      |    9 +++++++++
> arch/powerpc/configs/mgcoge_defconfig |   27 ++++++++++++++++-----------
> arch/powerpc/platforms/82xx/km82xx.c  |    4 ++++
> 3 files changed, 29 insertions(+), 11 deletions(-)

applied

- k

^ permalink raw reply

* Re: [PATCH 1/2] [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags
From: David Gibson @ 2011-10-12  3:33 UTC (permalink / raw)
  To: K.Prasad; +Cc: linuxppc-dev, Thiago Jung Bauermann, Edjunior Barbosa Machado
In-Reply-To: <20110916072710.GA28060@in.ibm.com>

On Fri, Sep 16, 2011 at 12:57:10PM +0530, K.Prasad wrote:
> On Fri, Aug 26, 2011 at 03:05:52PM +0530, K.Prasad wrote:
> > On Wed, Aug 24, 2011 at 01:59:39PM +1000, David Gibson wrote:
> > > On Tue, Aug 23, 2011 at 02:55:13PM +0530, K.Prasad wrote:
> > > > On Tue, Aug 23, 2011 at 03:08:50PM +1000, David Gibson wrote:
> > > > > On Fri, Aug 19, 2011 at 01:21:36PM +0530, K.Prasad wrote:
> > > > > > PPC_PTRACE_GETHWDBGINFO, PPC_PTRACE_SETHWDEBUG and PPC_PTRACE_DELHWDEBUG are
> > > > > > PowerPC specific ptrace flags that use the watchpoint register. While they are
> > > > > > targeted primarily towards BookE users, user-space applications such as GDB
> > > > > > have started using them for BookS too.
> > > > > > 
> > > > > > This patch enables the use of generic hardware breakpoint interfaces for these
> > > > > > new flags. The version number of the associated data structures
> > > > > > "ppc_hw_breakpoint" and "ppc_debug_info" is incremented to denote new semantics.
> > > > > 
> > > > > So, the structure itself doesn't seem to have been extended.  I don't
> > > > > understand what the semantic difference is - your patch comment needs
> > > > > to explain this clearly.
> > > > >
> > > > 
> > > > We had a request to extend the structure but thought it was dangerous to
> > > > do so. For instance if the user-space used version1 of the structure,
> > > > while kernel did a copy_to_user() pertaining to version2, then we'd run
> > > > into problems. Unfortunately the ptrace flags weren't designed to accept
> > > > a version number as input from the user through the
> > > > PPC_PTRACE_GETHWDBGINFO flag (which would have solved this issue).
> > > 
> > > I still don't follow you.
> > > 
> > 
> > Two things here.
> > 
> > One, the change of semantics warranted an increment of the version
> > number. The new semantics accepts PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE on
> > BookS, while the old version number did not. I've added a small comment
> > in the code to this effect.
> > 
> > Two, regarding changes in the "ppc_hw_breakpoint" and "ppc_debug_info"
> > structures - we would like to add more members to it if we can (GDB has a
> > pending request to add more members to it). However the problem foreseen
> > is that there could be a mismatch between the versions of the structure
> > used by the user vs kernel-space i.e. if a new version of the structure,
> > known to the kernel, had an extra member while the user-space still had
> > the old version, then it becomes dangerous because the __copy_to_user
> > function would overflow the buffer size in user-space.
> > 
> > This could have been avoided if PPC_PTRACE_GETHWDBGINFO was originally
> > designed to accept a version number (and provide corresponding
> > "struct ppc_debug_info") rather than send a populated "ppc_debug_info"
> > structure along with the version number.
> >
> 
> Based on further discussions with the code-reviewer (David Gibson
> <dwg@au1.ibm.com>), it was decided that incrementing the version number
> for the proposed changes is unnecessary as the patch only introduces new
> features but not a change in semantics.
> 
> Please find a new version of the patch where the version number is
> retained as 1, along with the other planned changes.
> 
> Thanks,
> K.Prasad
> 
>  
>     [hw-breakpoint] Use generic hw-breakpoint interfaces for new PPC ptrace flags
>     
>     PPC_PTRACE_GETHWDBGINFO, PPC_PTRACE_SETHWDEBUG and PPC_PTRACE_DELHWDEBUG are
>     PowerPC specific ptrace flags that use the watchpoint register. While they are
>     targeted primarily towards BookE users, user-space applications such as GDB
>     have started using them for BookS too.
>     
>     This patch enables the use of generic hardware breakpoint interfaces for these
>     new flags. The version number of the associated data structures
>     "ppc_hw_breakpoint" and "ppc_debug_info" is incremented to denote new semantics.

Above pargraph needs revision.


>     Apart from the usual benefits of using generic hw-breakpoint interfaces, these
>     changes allow debuggers (such as GDB) to use a common set of ptrace flags for
>     their watchpoint needs and allow more precise breakpoint specification (length
>     of the variable can be specified).
>     
>     [Edjunior: Identified an issue in the patch with the sanity check for version
>     numbers]
>     
>     Tested-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
>     Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
> 
> diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt
> index f4a5499..04656ec 100644
> --- a/Documentation/powerpc/ptrace.txt
> +++ b/Documentation/powerpc/ptrace.txt
> @@ -127,6 +127,22 @@ Some examples of using the structure to:
>    p.addr2           = (uint64_t) end_range;
>    p.condition_value = 0;
>  
> +- set a watchpoint in server processors (BookS)
> +
> +  p.version         = 1;
> +  p.trigger_type    = PPC_BREAKPOINT_TRIGGER_RW;
> +  p.addr_mode       = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE;
> +  or
> +  p.addr_mode       = PPC_BREAKPOINT_MODE_RANGE_EXACT;

MODE_RANGE_EXACT?  Shouldn't that just be MODE_EXACT?

> +
> +  p.condition_mode  = PPC_BREAKPOINT_CONDITION_NONE;
> +  p.addr            = (uint64_t) begin_range;
> +  /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where
> +   * addr2 - addr <= 8 Bytes.
> +   */
> +  p.addr2           = (uint64_t) end_range;
> +  p.condition_value = 0;
> +
>  3. PTRACE_DELHWDEBUG
>  
>  Takes an integer which identifies an existing breakpoint or watchpoint
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index 05b7dd2..2449495 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -1339,6 +1339,12 @@ static int set_dac_range(struct task_struct *child,
>  static long ppc_set_hwdebug(struct task_struct *child,
>  		     struct ppc_hw_breakpoint *bp_info)
>  {
> +#ifdef CONFIG_HAVE_HW_BREAKPOINT
> +	int ret, len = 0;
> +	struct thread_struct *thread = &(child->thread);
> +	struct perf_event *bp;
> +	struct perf_event_attr attr;
> +#endif /* CONFIG_HAVE_HW_BREAKPOINT */
>  #ifndef CONFIG_PPC_ADV_DEBUG_REGS
>  	unsigned long dabr;
>  #endif
> @@ -1382,13 +1388,9 @@ static long ppc_set_hwdebug(struct task_struct *child,
>  	 */
>  	if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 ||
>  	    (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 ||
> -	    bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT ||
>  	    bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)
>  		return -EINVAL;
>  
> -	if (child->thread.dabr)
> -		return -ENOSPC;
> -
>  	if ((unsigned long)bp_info->addr >= TASK_SIZE)
>  		return -EIO;
>  
> @@ -1398,15 +1400,83 @@ static long ppc_set_hwdebug(struct task_struct *child,
>  		dabr |= DABR_DATA_READ;
>  	if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
>  		dabr |= DABR_DATA_WRITE;
> +#ifdef CONFIG_HAVE_HW_BREAKPOINT
> +	if (ptrace_get_breakpoints(child) < 0)
> +		return -ESRCH;
>  
> -	child->thread.dabr = dabr;
> +	bp = thread->ptrace_bps[0];
> +	if (!bp_info->addr) {

I think this is treating a hardware breakpoint at address 0 as if it
didn't exist.  That seems wrong.

> +		if (bp) {
> +			unregister_hw_breakpoint(bp);
> +			thread->ptrace_bps[0] = NULL;
> +		}
> +		ptrace_put_breakpoints(child);
> +		return 0;
> +	}
> +	/*
> +	 * Check if the request is for 'range' breakpoints. We can
> +	 * support it if range < 8 bytes.
> +	 */
> +	if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE)
> +		len = bp_info->addr2 - bp_info->addr;
> +	else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) {
> +			ptrace_put_breakpoints(child);
> +			return -EINVAL;
> +		}

Misindent here.  This statement would be clearer if you had {} on all
of the if branches.

> +	if (bp) {
> +		attr = bp->attr;
> +		attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN;
> +		arch_bp_generic_fields(dabr &
> +					(DABR_DATA_WRITE | DABR_DATA_READ),
> +							&attr.bp_type);
> +		attr.bp_len = len;

If gdb is using the new breakpoint interface, surely it should just
use it, rather than doing this bit frobbing as in the old SET_DABR
call.

> +		ret =  modify_user_hw_breakpoint(bp, &attr);
> +		if (ret) {
> +			ptrace_put_breakpoints(child);
> +			return ret;
> +		}
> +		thread->ptrace_bps[0] = bp;
> +		ptrace_put_breakpoints(child);
> +		thread->dabr = dabr;
> +		return 0;
> +	}
>  
> +	/* Create a new breakpoint request if one doesn't exist already */
> +	hw_breakpoint_init(&attr);
> +	attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN;
> +	attr.bp_len = len;
> +	arch_bp_generic_fields(dabr & (DABR_DATA_WRITE | DABR_DATA_READ),
> +								&attr.bp_type);
> +
> +	thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr,
> +					       ptrace_triggered, NULL, child);
> +	if (IS_ERR(bp)) {
> +		thread->ptrace_bps[0] = NULL;
> +		ptrace_put_breakpoints(child);
> +		return PTR_ERR(bp);
> +	}
> +
> +	ptrace_put_breakpoints(child);
> +	return 1;
> +#endif /* CONFIG_HAVE_HW_BREAKPOINT */
> +
> +	if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT)
> +		return -EINVAL;
> +
> +	if (child->thread.dabr)
> +		return -ENOSPC;
> +
> +	child->thread.dabr = dabr;
>  	return 1;
>  #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */
>  }
>  
>  static long ppc_del_hwdebug(struct task_struct *child, long addr, long data)
>  {
> +#ifdef CONFIG_HAVE_HW_BREAKPOINT
> +	struct thread_struct *thread = &(child->thread);
> +	struct perf_event *bp;
> +#endif /* CONFIG_HAVE_HW_BREAKPOINT */
>  #ifdef CONFIG_PPC_ADV_DEBUG_REGS
>  	int rc;
>  
> @@ -1426,10 +1496,24 @@ static long ppc_del_hwdebug(struct task_struct *child, long addr, long data)
>  #else
>  	if (data != 1)
>  		return -EINVAL;
> +
> +#ifdef CONFIG_HAVE_HW_BREAKPOINT
> +	if (ptrace_get_breakpoints(child) < 0)
> +		return -ESRCH;
> +
> +	bp = thread->ptrace_bps[0];
> +	if (bp) {
> +		unregister_hw_breakpoint(bp);
> +		thread->ptrace_bps[0] = NULL;
> +	}
> +	ptrace_put_breakpoints(child);
> +	return 0;
> +#else /* CONFIG_HAVE_HW_BREAKPOINT */
>  	if (child->thread.dabr == 0)
>  		return -ENOENT;
>  
>  	child->thread.dabr = 0;
> +#endif /* CONFIG_HAVE_HW_BREAKPOINT */
>  
>  	return 0;
>  #endif
> @@ -1560,7 +1644,7 @@ long arch_ptrace(struct task_struct *child, long request,
>  		dbginfo.data_bp_alignment = 4;
>  #endif
>  		dbginfo.sizeof_condition = 0;
> -		dbginfo.features = 0;
> +		dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE;
>  #endif /* CONFIG_PPC_ADV_DEBUG_REGS */
>  
>  		if (!access_ok(VERIFY_WRITE, datavp,
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] powerpc/85xx: Fix doorbells
From: Matthew McClintock @ 2011-10-12  0:06 UTC (permalink / raw)
  To: kumar.gala, linuxppc-dev

Commit 765342526246c97600e5344c0949824d94bb51c3 made some small
changes to IPI, message_pass in smp_ops was initialized to NULL
for other platforms but not for 85xx which causes us to always
use the mpic for IPI's. This patch makes doorbells work again.

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
 arch/powerpc/platforms/85xx/smp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 5b9b901..d6e4746 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -243,6 +243,7 @@ void __init mpc85xx_smp_init(void)
 		 * If left NULL, .message_pass defaults to
 		 * smp_muxed_ipi_message_pass
 		 */
+		smp_85xx_ops.message_pass = NULL;
 		smp_85xx_ops.cause_ipi = doorbell_cause_ipi;
 	}
 
-- 
1.7.6.1

^ permalink raw reply related

* RE: [PATCH v14 02/10] USB/ppc4xx: Add Synopsys DesignWare HS USB OTG driver framework
From: Tirumala Marri @ 2011-10-11 22:46 UTC (permalink / raw)
  To: Kassey Lee; +Cc: Mark Miesfeld, greg, linux-usb, linuxppc-dev, Fushen Chen
In-Reply-To: <CAKwPUowTCS2jO1QdFMCFg86Mb_d_yo2NvnWQ=Lh6N1tdgZE1rA@mail.gmail.com>

Hi,
<
<     I did  find any private info for ppc in
<     drivers/usb/dwc/apmppc.c
<
<     do you want make it generic driver ? if yes, it could be a
<generic name too.
[Tirumala Marri] This file has of PPC specific functions, like device tree
which actually contains PPC specific address ranges, interrupt numbers
etc.
--marri

^ permalink raw reply

* RE: [PATCH v14 10/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
From: Tirumala Marri @ 2011-10-11 22:43 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Mark Miesfeld, greg, linux-usb, linuxppc-dev, Fushen Chen
In-Reply-To: <4E8EDD75.5090107@ru.mvista.com>

<> +# dwc_otg builds in ../dwc along with host support
<> +config USB_GADGET_DWC_HDRC
<> +	boolean "DesignWare USB Peripheral"
<> +	depends on DWC_OTG_MODE || DWC_DEVICE_ONLY
<> +	select USB_GADGET_DUALSPEED
<> +	select USB_GADGET_SELECTED
<> +	select USB_GADGET_DWC_OTG
<
<    I don't see where this one is defined...
<
[Tirumala Marri] You mean USB_GADGET_SELECTED ? Ok I will add it.
--marri

^ permalink raw reply

* Re: [PATCH v2] powerpc: book3e: WSP: Add Chroma as a new WSP/PowerEN platform.
From: Jimi Xenidis @ 2011-10-11 14:47 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

On Tue Oct 4 05:02:41 EST 2011, Scott Wood wrote:

Looking at your comments below, will the following be acceptable

> On 09/29/2011 09:27 PM, Jimi Xenidis wrote:
> > diff --git a/arch/powerpc/platforms/wsp/Kconfig =
b/arch/powerpc/platforms/wsp/Kconfig
> > index ea2811c..a3eef8e 100644
> > --- a/arch/powerpc/platforms/wsp/Kconfig
> > +++ b/arch/powerpc/platforms/wsp/Kconfig
> > @@ -1,6 +1,7 @@
> >  config PPC_WSP
> >  	bool
> >  	select PPC_A2
> > +	select GENERIC_TBSYNC
> >  	select PPC_ICSWX
> >  	select PPC_SCOM
> >  	select PPC_XICS
> > @@ -8,14 +9,20 @@ config PPC_WSP
> >  	select PCI
> >  	select PPC_IO_WORKAROUNDS if PCI
> >  	select PPC_INDIRECT_PIO if PCI
> > +	select PPC_WSP_COPRO
> >  	default n
> > =20
> >  menu "WSP platform selection"
> >  	depends on PPC_BOOK3E_64

add "&& SMP"

> > =20
> >  config PPC_PSR2
> > -	bool "PSR-2 platform"
> > -	select GENERIC_TBSYNC
> > +	bool "PowerEN System Reference Platform 2"
> > +	select EPAPR_BOOT
> > +	select PPC_WSP
> > +	default y

Make these "default n"

Will that address everything?
-jx

> > +
> > +config PPC_CHROMA
> > +	bool "PowerEN PCIe Chroma Card"
> >  	select EPAPR_BOOT
> >  	select PPC_WSP
> >  	default y
>=20
> This is an existing problem with PSR2, but please don't hide "default =
y"
> in a menu (at least make it a menuconfig).
>  As is, it's not obvious from
> looking at the toplevel platforms menu that these platforms are =
enabled
> at all.
>=20
> Further, PPC_WSP doesn't build on non-SMP (undefined references to
> boot_cpuid and get_hard_smp_processor_id in ics.c), but the platforms
> that select it don't depend on SMP.

this I can solve with=20

>=20
> -Scott
>=20

^ permalink raw reply

* Re: [PATCH 2/3] [44x] Enable CONFIG_RELOCATABLE for PPC44x
From: Suzuki Poulose @ 2011-10-11 12:54 UTC (permalink / raw)
  To: Scott Wood
  Cc: Michal Simek, tmarri, Mahesh Jagannath Salgaonkar, Dave Hansen,
	David Laight, Paul Mackerras, linux ppc dev, Vivek Goyal
In-Reply-To: <4E9332AA.1050307@freescale.com>

On 10/10/11 23:30, Scott Wood wrote:
> On 10/10/2011 04:56 AM, Suzuki K. Poulose wrote:
>> #if defined(CONFIG_RELOCATABLE)&&  defined(CONFIG_44x)
>> #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) - PHYSICAL_START + (KERNELBASE + RELOC_OFFSET)))
>> #define __pa(x) ((unsigned long)(x) + PHYSICAL_START - (KERNELBASE + RELOC_OFFSET))
>> #endif
>
> Why is this 44x-specific?

As of now, we compile with relocations only for the 44x. We could make this
generic once the approach is accepted by everyone and implemented on the other
platforms.

Thanks

Suzuki

^ permalink raw reply

* Re: [PATCH] Fix interrupt handling in MPC8xxx GPIO driver
From: Greg KH @ 2011-10-11 12:00 UTC (permalink / raw)
  To: Felix Radensky; +Cc: linuxppc-dev, stable
In-Reply-To: <1318321461-3066-1-git-send-email-felix@embedded-sol.com>

On Tue, Oct 11, 2011 at 10:24:21AM +0200, Felix Radensky wrote:
> Interrupt handler in MPC8xxx GPIO driver is missing the call
> to PIC EOI (end of interrupt) handler. As a result, at least
> on 85XX systems, GPIO interrupt is delivered only once. This
> patch adds the missing EOI call. Tested on custom P1022 board.
> 
> Signed-off-by: Felix Radensky <felix@embedded-sol.com>
> ---
>  arch/powerpc/sysdev/mpc8xxx_gpio.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply

* [PATCH] Fix interrupt handling in MPC8xxx GPIO driver
From: Felix Radensky @ 2011-10-11  8:24 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Felix Radensky, stable

Interrupt handler in MPC8xxx GPIO driver is missing the call
to PIC EOI (end of interrupt) handler. As a result, at least
on 85XX systems, GPIO interrupt is delivered only once. This
patch adds the missing EOI call. Tested on custom P1022 board.

Signed-off-by: Felix Radensky <felix@embedded-sol.com>
---
 arch/powerpc/sysdev/mpc8xxx_gpio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/mpc8xxx_gpio.c b/arch/powerpc/sysdev/mpc8xxx_gpio.c
index fb4963a..d2e0e1c 100644
--- a/arch/powerpc/sysdev/mpc8xxx_gpio.c
+++ b/arch/powerpc/sysdev/mpc8xxx_gpio.c
@@ -153,6 +153,7 @@ static void mpc8xxx_gpio_irq_cascade(unsigned int irq, struct irq_desc *desc)
 	if (mask)
 		generic_handle_irq(irq_linear_revmap(mpc8xxx_gc->irq,
 						     32 - ffs(mask)));
+	desc->chip->eoi(irq);
 }
 
 static void mpc8xxx_irq_unmask(struct irq_data *d)
-- 
1.7.4.4

^ permalink raw reply related

* Re: [PATCH v14 02/10] USB/ppc4xx: Add Synopsys DesignWare HS USB OTG driver framework
From: Kassey Lee @ 2011-10-11  8:57 UTC (permalink / raw)
  To: tmarri; +Cc: Mark Miesfeld, greg, linux-usb, linuxppc-dev, Fushen Chen
In-Reply-To: <1317954632-11768-1-git-send-email-tmarri@apm.com>

hi, Tirumala:

     I did  find any private info for ppc in
     drivers/usb/dwc/apmppc.c

     do you want make it generic driver ? if yes, it could be a
generic name too.

     thanks !

2011/10/7  <tmarri@apm.com>:
> From: Tirumala Marri <tmarri@apm.com>
>
> Platform probing is in apmppc.c.
> Driver parameter and parameter checking are in param.c.
>
> Signed-off-by: Tirumala R Marri<tmarri@apm.com>
> Signed-off-by: Fushen Chen <fchen@apm.com>
> Signed-off-by: Mark Miesfeld <mmiesfeld@apm.com>
> ---
> =A0drivers/usb/dwc/apmppc.c | =A0353 ++++++++++++++++++++++++++++++++++++=
++++++++++
> =A0drivers/usb/dwc/driver.h | =A0 76 ++++++++++
> =A0drivers/usb/dwc/param.c =A0| =A0180 +++++++++++++++++++++++
> =A03 files changed, 609 insertions(+), 0 deletions(-)
> =A0create mode 100644 drivers/usb/dwc/apmppc.c
> =A0create mode 100644 drivers/usb/dwc/driver.h
> =A0create mode 100644 drivers/usb/dwc/param.c
>
> diff --git a/drivers/usb/dwc/apmppc.c b/drivers/usb/dwc/apmppc.c
> new file mode 100644
> index 0000000..5053c6a
> --- /dev/null
> +++ b/drivers/usb/dwc/apmppc.c
> @@ -0,0 +1,353 @@
> +/*
> + * DesignWare HS OTG controller driver
> + * Copyright (C) 2006 Synopsys, Inc.
> + * Portions Copyright (C) 2010 Applied Micro Circuits Corporation.
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License version 2 for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, see http://www.gnu.org/licenses
> + * or write to the Free Software Foundation, Inc., 51 Franklin Street,
> + * Suite 500, Boston, MA 02110-1335 USA.
> + *
> + * Based on Synopsys driver version 2.60a
> + * Modified by Mark Miesfeld <mmiesfeld@apm.com>
> + * Modified by Stefan Roese <sr@denx.de>, DENX Software Engineering
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "=
AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO T=
HE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU=
RPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL SYNOPSYS, INC. BE LIABLE FOR ANY DI=
RECT,
> + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER=
VICES;
> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUS=
ED AND
> + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR =
TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE=
 OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + */
> +
> +/*
> + * The dwc_otg module provides the initialization and cleanup entry
> + * points for the dwcotg driver. This module will be dynamically install=
ed
> + * after Linux is booted using the insmod command. When the module is
> + * installed, the dwc_otg_driver_init function is called. When the modul=
e is
> + * removed (using rmmod), the dwc_otg_driver_cleanup function is called.
> + *
> + * This module also defines a data structure for the dwc_otg driver, whi=
ch is
> + * used in conjunction with the standard device structure. These
> + * structures allow the OTG driver to comply with the standard Linux dri=
ver
> + * model in which devices and drivers are registered with a bus driver. =
This
> + * has the benefit that Linux can expose attributes of the driver and de=
vice
> + * in its special sysfs file system. Users can then read or write files =
in
> + * this file system to perform diagnostics on the driver components or t=
he
> + * device.
> + */
> +
> +#include <linux/of_platform.h>
> +
> +#include "driver.h"
> +
> +#define DWC_DRIVER_VERSION =A0 =A0 =A0 =A0 =A0 =A0 "1.05"
> +#define DWC_DRIVER_DESC =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"=
HS OTG USB Controller driver"
> +static const char dwc_driver_name[] =3D "dwc_otg";
> +
> +static irqreturn_t dwc_otg_common_irq(int _irq, void *dev)
> +{
> + =A0 =A0 =A0 struct dwc_otg_device *dwc_dev =3D dev;
> + =A0 =A0 =A0 int retval;
> + =A0 =A0 =A0 struct dwc_hcd *dwc_hcd;
> +
> + =A0 =A0 =A0 dwc_hcd =3D dwc_dev->hcd;
> + =A0 =A0 =A0 spin_lock(&dwc_hcd->lock);
> + =A0 =A0 =A0 retval =3D dwc_otg_handle_common_intr(dwc_dev->core_if);
> + =A0 =A0 =A0 spin_unlock(&dwc_hcd->lock);
> + =A0 =A0 =A0 return IRQ_RETVAL(retval);
> +}
> +
> +static irqreturn_t dwc_otg_externalchgpump_irq(int _irq, void *dev)
> +{
> + =A0 =A0 =A0 struct dwc_otg_device *dwc_dev =3D dev;
> +
> + =A0 =A0 =A0 if (dwc_otg_is_host_mode(dwc_dev->core_if)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct dwc_hcd *dwc_hcd;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 u32 hprt0 =3D 0;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_hcd =3D dwc_dev->hcd;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 spin_lock(&dwc_hcd->lock);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_hcd->flags.b.port_over_current_change =
=3D 1;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 hprt0 =3D DWC_HPRT0_PRT_PWR_RW(hprt0, 0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_reg_write(dwc_dev->core_if->host_if->hp=
rt0, 0, hprt0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 spin_unlock(&dwc_hcd->lock);
> + =A0 =A0 =A0 } else {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Device mode - This int is n/a for device=
 mode */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(dev, "DeviceMode: OTG OverCurrent D=
etected\n");
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 return IRQ_HANDLED;
> +}
> +
> +static int __devexit dwc_otg_driver_remove(struct platform_device *ofdev=
)
> +{
> + =A0 =A0 =A0 struct device *dev =3D &ofdev->dev;
> + =A0 =A0 =A0 struct dwc_otg_device *dwc_dev =3D dev_get_drvdata(dev);
> +
> + =A0 =A0 =A0 /* Memory allocation for dwc_otg_device may have failed. */
> + =A0 =A0 =A0 if (!dwc_dev)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0;
> +
> + =A0 =A0 =A0 /* Free the IRQ */
> + =A0 =A0 =A0 free_irq(dwc_dev->irq, dwc_dev);
> + =A0 =A0 =A0 /* Free external charge pump irq */
> + =A0 =A0 =A0 free_irq(dwc_dev->hcd->cp_irq, dwc_dev);
> +
> + =A0 =A0 =A0 if (dwc_dev->hcd)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_otg_hcd_remove(dev);
> +
> + =A0 =A0 =A0 if (dwc_dev->pcd)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_otg_pcd_remove(dev);
> +
> + =A0 =A0 =A0 if (dwc_dev->core_if)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_otg_cil_remove(dwc_dev->core_if);
> +
> + =A0 =A0 =A0 /* Return the memory. */
> + =A0 =A0 =A0 if (dwc_dev->base)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 iounmap(dwc_dev->base);
> +
> + =A0 =A0 =A0 if (dwc_dev->phys_addr)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 release_mem_region(dwc_dev->phys_addr, dwc_=
dev->base_len);
> +
> + =A0 =A0 =A0 otg_put_transceiver(dwc_dev->core_if->xceiv);
> + =A0 =A0 =A0 dwc_dev->core_if->xceiv =3D NULL;
> +
> + =A0 =A0 =A0 kfree(dwc_dev);
> +
> + =A0 =A0 =A0 /* Clear the drvdata pointer. */
> + =A0 =A0 =A0 dev_set_drvdata(dev, NULL);
> + =A0 =A0 =A0 return 0;
> +}
> +
> +static int __devinit dwc_otg_driver_probe(struct platform_device *ofdev)
> +{
> + =A0 =A0 =A0 int retval;
> + =A0 =A0 =A0 struct dwc_otg_device *dwc_dev;
> + =A0 =A0 =A0 struct device *dev =3D &ofdev->dev;
> + =A0 =A0 =A0 struct resource res;
> + =A0 =A0 =A0 ulong gusbcfg_addr;
> + =A0 =A0 =A0 u32 usbcfg =3D 0;
> +
> + =A0 =A0 =A0 dwc_dev =3D kzalloc(sizeof(*dwc_dev), GFP_KERNEL);
> + =A0 =A0 =A0 if (!dwc_dev) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "kmalloc of dwc_otg_device fai=
led\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENOMEM;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_dwc_dev;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /* Retrieve the memory and IRQ resources. */
> + =A0 =A0 =A0 dwc_dev->irq =3D irq_of_parse_and_map(ofdev->dev.of_node, 0=
);
> + =A0 =A0 =A0 if (dwc_dev->irq =3D=3D NO_IRQ) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "no device irq\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENODEV;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_of_irq;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 if (of_address_to_resource(ofdev->dev.of_node, 0, &res)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "%s: Can't get USB-OTG registe=
r address\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 __func__);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENOMEM;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_of_irq;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 dwc_dev->phys_addr =3D res.start;
> + =A0 =A0 =A0 dwc_dev->base_len =3D res.end - res.start + 1;
> + =A0 =A0 =A0 if (!request_mem_region(dwc_dev->phys_addr,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->ba=
se_len, dwc_driver_name)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "request_mem_region failed\n")=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -EBUSY;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_of_irq;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /* Map the DWC_otg Core memory into virtual address space. =
*/
> + =A0 =A0 =A0 dwc_dev->base =3D ioremap(dwc_dev->phys_addr, dwc_dev->base=
_len);
> + =A0 =A0 =A0 if (!dwc_dev->base) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "ioremap() failed\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENOMEM;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_ioremap;
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 dev_dbg(dev, "mapped base=3D0x%08x\n", (__force u32)dwc_dev=
->base);
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Initialize driver data to point to the global DWC_otg
> + =A0 =A0 =A0 =A0* Device structure.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 dev_set_drvdata(dev, dwc_dev);
> +
> + =A0 =A0 =A0 dwc_dev->core_if =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_otg_cil_init(dwc_dev->base, &dwc_otg_module_par=
ams);
> + =A0 =A0 =A0 if (!dwc_dev->core_if) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "CIL initialization failed!\n"=
);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENOMEM;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_cil_init;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Validate parameter values after dwc_otg_cil_init.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 if (check_parameters(dwc_dev->core_if)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -EINVAL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_check_param;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 usb_nop_xceiv_register();
> + =A0 =A0 =A0 dwc_dev->core_if->xceiv =3D otg_get_transceiver();
> + =A0 =A0 =A0 if (!dwc_dev->core_if->xceiv) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -ENODEV;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_xceiv;
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 dwc_set_feature(dwc_dev->core_if);
> +
> + =A0 =A0 =A0 /* Initialize the DWC_otg core. */
> + =A0 =A0 =A0 dwc_otg_core_init(dwc_dev->core_if);
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Disable the global interrupt until all the interrupt
> + =A0 =A0 =A0 =A0* handlers are installed.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 dwc_otg_disable_global_interrupts(dwc_dev->core_if);
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Install the interrupt handler for the common interrupt=
s before
> + =A0 =A0 =A0 =A0* enabling common interrupts in core_init below.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 retval =3D request_irq(dwc_dev->irq, dwc_otg_common_irq,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0IRQF_SHARED, "dw=
c_otg", dwc_dev);
> + =A0 =A0 =A0 if (retval) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "request of irq%d failed retva=
l: %d\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->irq, retval);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D -EBUSY;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_req_irq;
> + =A0 =A0 =A0 } else {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->common_irq_installed =3D 1;
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 if (!dwc_has_feature(dwc_dev->core_if, DWC_HOST_ONLY)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Initialize the PCD */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D dwc_otg_pcd_init(dev);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (retval) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "dwc_otg_pcd_i=
nit failed\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->pcd =3D NULL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_req_irq;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 gusbcfg_addr =3D (ulong) (dwc_dev->core_if->core_global_reg=
s)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 + DWC_GUSBCFG;
> + =A0 =A0 =A0 if (!dwc_has_feature(dwc_dev->core_if, DWC_DEVICE_ONLY)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Initialize the HCD and force_host_mode *=
/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usbcfg =3D dwc_reg_read(gusbcfg_addr, 0);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usbcfg |=3D DWC_USBCFG_FRC_HST_MODE;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_reg_write(gusbcfg_addr, 0, usbcfg);
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D dwc_otg_hcd_init(dev, dwc_dev);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (retval) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev, "dwc_otg_hcd_i=
nit failed\n");
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->hcd =3D NULL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_hcd;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* configure chargepump interrupt */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_dev->hcd->cp_irq =3D irq_of_parse_and_m=
ap(ofdev->dev.of_node,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 3);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (dwc_dev->hcd->cp_irq) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D request_irq(dwc_=
dev->hcd->cp_irq,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0dwc_otg_externalchgpump_irq,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0IRQF_SHARED,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0"dwc_otg_ext_chg_pump", dwc_dev);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (retval) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(dev=
,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 "request of irq failed retval: %d\n",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 retval);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval =3D =
-EBUSY;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto fail_h=
cd;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_dbg(dev=
, "%s: ExtChgPump Detection "
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 "IRQ registered\n", dwc_driver_name);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Enable the global interrupt after all the interrupt
> + =A0 =A0 =A0 =A0* handlers are installed.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 dwc_otg_enable_global_interrupts(dwc_dev->core_if);
> +
> + =A0 =A0 =A0 usbcfg =3D dwc_reg_read(gusbcfg_addr, 0);
> + =A0 =A0 =A0 usbcfg &=3D ~DWC_USBCFG_FRC_HST_MODE;
> + =A0 =A0 =A0 dwc_reg_write(gusbcfg_addr, 0, usbcfg);
> +
> + =A0 =A0 =A0 return 0;
> +fail_hcd:
> + =A0 =A0 =A0 free_irq(dwc_dev->irq, dwc_dev);
> + =A0 =A0 =A0 if (!dwc_has_feature(dwc_dev->core_if, DWC_HOST_ONLY)) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (dwc_dev->pcd)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dwc_otg_pcd_remove(dev);
> + =A0 =A0 =A0 }
> +fail_req_irq:
> + =A0 =A0 =A0 otg_put_transceiver(dwc_dev->core_if->xceiv);
> +fail_xceiv:
> + =A0 =A0 =A0 usb_nop_xceiv_unregister();
> +fail_check_param:
> + =A0 =A0 =A0 dwc_otg_cil_remove(dwc_dev->core_if);
> +fail_cil_init:
> + =A0 =A0 =A0 dev_set_drvdata(dev, NULL);
> + =A0 =A0 =A0 iounmap(dwc_dev->base);
> +fail_ioremap:
> + =A0 =A0 =A0 release_mem_region(dwc_dev->phys_addr, dwc_dev->base_len);
> +fail_of_irq:
> + =A0 =A0 =A0 kfree(dwc_dev);
> +fail_dwc_dev:
> + =A0 =A0 =A0 return retval;
> +}
> +
> +static const struct of_device_id dwc_otg_match[] =3D {
> + =A0 =A0 =A0 {.compatible =3D "amcc,dwc-otg",},
> + =A0 =A0 =A0 {}
> +};
> +
> +MODULE_DEVICE_TABLE(of, dwc_otg_match);
> +
> +static struct platform_driver dwc_otg_driver =3D {
> + =A0 =A0 =A0 .probe =3D dwc_otg_driver_probe,
> + =A0 =A0 =A0 .remove =3D __devexit_p(dwc_otg_driver_remove),
> + =A0 =A0 =A0 .driver =3D {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 .name =3D "dwc_otg",
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 .owner =3D THIS_MODULE,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 .of_match_table =3D dwc_otg_match,
> + =A0 =A0 =A0 },
> +};
> +
> +static int __init dwc_otg_driver_init(void)
> +{
> +
> + =A0 =A0 =A0 return platform_driver_register(&dwc_otg_driver);
> +}
> +
> +module_init(dwc_otg_driver_init);
> +
> +static void __exit dwc_otg_driver_cleanup(void)
> +{
> + =A0 =A0 =A0 platform_driver_unregister(&dwc_otg_driver);
> +}
> +
> +module_exit(dwc_otg_driver_cleanup);
> +
> +MODULE_DESCRIPTION(DWC_DRIVER_DESC);
> +MODULE_AUTHOR("Mark Miesfeld <mmiesfeld@apm.com");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/usb/dwc/driver.h b/drivers/usb/dwc/driver.h
> new file mode 100644
> index 0000000..a86532b
> --- /dev/null
> +++ b/drivers/usb/dwc/driver.h
> @@ -0,0 +1,76 @@
> +/*
> + * DesignWare HS OTG controller driver
> + * Copyright (C) 2006 Synopsys, Inc.
> + * Portions Copyright (C) 2010 Applied Micro Circuits Corporation.
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License version 2 for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, see http://www.gnu.org/licenses
> + * or write to the Free Software Foundation, Inc., 51 Franklin Street,
> + * Suite 500, Boston, MA 02110-1335 USA.
> + *
> + * Based on Synopsys driver version 2.60a
> + * Modified by Mark Miesfeld <mmiesfeld@apm.com>
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "=
AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO T=
HE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU=
RPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL SYNOPSYS, INC. BE LIABLE FOR ANY DI=
RECT,
> + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER=
VICES;
> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUS=
ED AND
> + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR =
TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE=
 OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + */
> +
> +#if !defined(__DWC_OTG_DRIVER_H__)
> +#define __DWC_OTG_DRIVER_H__
> +
> +/*
> + * This file contains the interface to the Linux driver.
> + */
> +#include "cil.h"
> +
> +/*
> + * This structure is a wrapper that encapsulates the driver components u=
sed to
> + * manage a single DWC_otg controller.
> + */
> +struct dwc_otg_device {
> + =A0 =A0 =A0 /* Base address returned from ioremap() */
> + =A0 =A0 =A0 __iomem void *base;
> +
> + =A0 =A0 =A0 /* Pointer to the core interface structure. */
> + =A0 =A0 =A0 struct core_if *core_if;
> +
> + =A0 =A0 =A0 /* Pointer to the PCD structure. */
> + =A0 =A0 =A0 struct dwc_pcd *pcd;
> +
> + =A0 =A0 =A0 /* Pointer to the HCD structure. */
> + =A0 =A0 =A0 struct dwc_hcd *hcd;
> +
> + =A0 =A0 =A0 /* Flag to indicate whether the common IRQ handler is insta=
lled. */
> + =A0 =A0 =A0 u8 common_irq_installed;
> +
> + =A0 =A0 =A0 /* Interrupt request number. */
> + =A0 =A0 =A0 unsigned int irq;
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Physical address of Control and Status registers, used=
 by
> + =A0 =A0 =A0 =A0* release_mem_region().
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 resource_size_t phys_addr;
> +
> + =A0 =A0 =A0 /* Length of memory region, used by release_mem_region(). *=
/
> + =A0 =A0 =A0 unsigned long base_len;
> +};
> +#endif
> diff --git a/drivers/usb/dwc/param.c b/drivers/usb/dwc/param.c
> new file mode 100644
> index 0000000..afae800
> --- /dev/null
> +++ b/drivers/usb/dwc/param.c
> @@ -0,0 +1,180 @@
> +/*
> + * DesignWare HS OTG controller driver
> + * Copyright (C) 2006 Synopsys, Inc.
> + * Portions Copyright (C) 2010 Applied Micro Circuits Corporation.
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License version 2 for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, see http://www.gnu.org/licenses
> + * or write to the Free Software Foundation, Inc., 51 Franklin Street,
> + * Suite 500, Boston, MA 02110-1335 USA.
> + *
> + * Based on Synopsys driver version 2.60a
> + * Modified by Mark Miesfeld <mmiesfeld@apm.com>
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "=
AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO T=
HE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU=
RPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL SYNOPSYS, INC. BE LIABLE FOR ANY DI=
RECT,
> + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES
> + * (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER=
VICES;
> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUS=
ED AND
> + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR =
TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE=
 OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + *
> + */
> +
> +/*
> + * This file provides dwc_otg driver parameter and parameter checking.
> + */
> +
> +#include "cil.h"
> +
> +/*
> + * Encapsulate the module parameter settings
> + */
> +struct core_params dwc_otg_module_params =3D {
> + =A0 =A0 =A0 .otg_cap =3D -1,
> + =A0 =A0 =A0 .dma_enable =3D -1,
> + =A0 =A0 =A0 .dma_burst_size =3D -1,
> + =A0 =A0 =A0 .speed =3D -1,
> + =A0 =A0 =A0 .host_support_fs_ls_low_power =3D -1,
> + =A0 =A0 =A0 .host_ls_low_power_phy_clk =3D -1,
> + =A0 =A0 =A0 .enable_dynamic_fifo =3D -1,
> + =A0 =A0 =A0 .dev_rx_fifo_size =3D -1,
> + =A0 =A0 =A0 .dev_nperio_tx_fifo_size =3D -1,
> + =A0 =A0 =A0 .dev_perio_tx_fifo_size =3D {-1, -1, -1, -1, -1, -1, -1, -1=
,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 -1, -1, -1, -1, -1, -1, -1}, =A0 =A0/* 15 *=
/
> + =A0 =A0 =A0 .host_rx_fifo_size =3D -1,
> + =A0 =A0 =A0 .host_nperio_tx_fifo_size =3D -1,
> + =A0 =A0 =A0 .host_perio_tx_fifo_size =3D -1,
> + =A0 =A0 =A0 .max_transfer_size =3D -1,
> + =A0 =A0 =A0 .max_packet_count =3D -1,
> + =A0 =A0 =A0 .host_channels =3D -1,
> + =A0 =A0 =A0 .dev_endpoints =3D -1,
> + =A0 =A0 =A0 .phy_type =3D -1,
> + =A0 =A0 =A0 .phy_utmi_width =3D -1,
> + =A0 =A0 =A0 .phy_ulpi_ddr =3D -1,
> + =A0 =A0 =A0 .phy_ulpi_ext_vbus =3D -1,
> + =A0 =A0 =A0 .i2c_enable =3D -1,
> + =A0 =A0 =A0 .ulpi_fs_ls =3D -1,
> + =A0 =A0 =A0 .ts_dline =3D -1,
> + =A0 =A0 =A0 .en_multiple_tx_fifo =3D -1,
> + =A0 =A0 =A0 .dev_tx_fifo_size =3D {-1, -1, -1, -1, -1, -1, -1, -1, -1,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 -1, -1, -1, -1, -1, -1}, =A0 =A0 =A0 =A0/* =
15 */
> + =A0 =A0 =A0 .thr_ctl =3D -1,
> + =A0 =A0 =A0 .tx_thr_length =3D -1,
> + =A0 =A0 =A0 .rx_thr_length =3D -1,
> +};
> +
> +/**
> + * Checks that parameter settings for the periodic Tx FIFO sizes are cor=
rect
> + * according to the hardware configuration. Sets the size to the hardwar=
e
> + * configuration if an incorrect size is detected.
> + */
> +static int set_valid_perio_tx_fifo_sizes(struct core_if *core_if)
> +{
> + =A0 =A0 =A0 ulong regs =3D (u32) core_if->core_global_regs;
> + =A0 =A0 =A0 u32 *param_size =3D &dwc_otg_module_params.dev_perio_tx_fif=
o_size[0];
> + =A0 =A0 =A0 u32 i, size;
> +
> + =A0 =A0 =A0 for (i =3D 0; i < MAX_PERIO_FIFOS; i++, param_size++) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 size =3D dwc_reg_read(regs, DWC_DPTX_FSIZ_D=
IPTXF(i));
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *param_size =3D size;
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 return 0;
> +}
> +
> +/**
> + * Checks that parameter settings for the Tx FIFO sizes are correct acco=
rding to
> + * the hardware configuration. =A0Sets the size to the hardware configur=
ation if
> + * an incorrect size is detected.
> + */
> +static int set_valid_tx_fifo_sizes(struct core_if *core_if)
> +{
> + =A0 =A0 =A0 ulong regs =3D (u32) core_if->core_global_regs;
> + =A0 =A0 =A0 u32 *param_size =3D &dwc_otg_module_params.dev_tx_fifo_size=
[0];
> + =A0 =A0 =A0 u32 i, size;
> +
> + =A0 =A0 =A0 for (i =3D 0; i < MAX_TX_FIFOS; i++, param_size) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 size =3D dwc_reg_read(regs, =A0DWC_DPTX_FSI=
Z_DIPTXF(i));
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *param_size =3D size;
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 return 0;
> +}
> +
> +/**
> + * This function is called during module intialization to verify that
> + * the module parameters are in a valid state.
> + */
> +int __devinit check_parameters(struct core_if *core_if)
> +{
> + =A0 =A0 =A0 /* Default values */
> + =A0 =A0 =A0 dwc_otg_module_params.otg_cap =3D dwc_param_otg_cap_default=
;
> + =A0 =A0 =A0 dwc_otg_module_params.dma_enable =3D dwc_param_dma_enable_d=
efault;
> + =A0 =A0 =A0 dwc_otg_module_params.speed =3D dwc_param_speed_default;
> + =A0 =A0 =A0 dwc_otg_module_params.host_support_fs_ls_low_power =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_param_host_support_fs_ls_low_power_default;
> + =A0 =A0 =A0 dwc_otg_module_params.host_ls_low_power_phy_clk =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_param_host_ls_low_power_phy_clk_default;
> + =A0 =A0 =A0 dwc_otg_module_params.phy_type =3D dwc_param_phy_type_defau=
lt;
> + =A0 =A0 =A0 dwc_otg_module_params.phy_ulpi_ddr =3D dwc_param_phy_ulpi_d=
dr_default;
> + =A0 =A0 =A0 dwc_otg_module_params.phy_ulpi_ext_vbus =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_param_phy_ulpi_ext_vbus_default;
> + =A0 =A0 =A0 dwc_otg_module_params.i2c_enable =3D dwc_param_i2c_enable_d=
efault;
> + =A0 =A0 =A0 dwc_otg_module_params.ulpi_fs_ls =3D dwc_param_ulpi_fs_ls_d=
efault;
> + =A0 =A0 =A0 dwc_otg_module_params.ts_dline =3D dwc_param_ts_dline_defau=
lt;
> +
> + =A0 =A0 =A0 dwc_otg_module_params.dma_burst_size =3D dwc_param_dma_burs=
t_size_default;
> + =A0 =A0 =A0 dwc_otg_module_params.phy_utmi_width =3D dwc_param_phy_utmi=
_width_default;
> + =A0 =A0 =A0 dwc_otg_module_params.thr_ctl =3D dwc_param_thr_ctl_default=
;
> + =A0 =A0 =A0 dwc_otg_module_params.tx_thr_length =3D dwc_param_tx_thr_le=
ngth_default;
> + =A0 =A0 =A0 dwc_otg_module_params.rx_thr_length =3D dwc_param_rx_thr_le=
ngth_default;
> +
> + =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0* Hardware configurations of the OTG core.
> + =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 dwc_otg_module_params.enable_dynamic_fifo =3D
> + =A0 =A0 =A0 =A0 =A0 DWC_HWCFG2_DYN_FIFO_RD(core_if->hwcfg2);
> + =A0 =A0 =A0 dwc_otg_module_params.dev_rx_fifo_size =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_reg_read(core_if->core_global_regs, DWC_GRXFSIZ=
);
> + =A0 =A0 =A0 dwc_otg_module_params.dev_nperio_tx_fifo_size =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_reg_read(core_if->core_global_regs, DWC_GNPTXFS=
IZ) >> 16;
> +
> + =A0 =A0 =A0 dwc_otg_module_params.host_rx_fifo_size =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_reg_read(core_if->core_global_regs, DWC_GRXFSIZ=
);
> + =A0 =A0 =A0 dwc_otg_module_params.host_nperio_tx_fifo_size =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_reg_read(core_if->core_global_regs, DWC_GNPTXFS=
IZ) >> 16;
> + =A0 =A0 =A0 dwc_otg_module_params.host_perio_tx_fifo_size =3D
> + =A0 =A0 =A0 =A0 =A0 dwc_reg_read(core_if->core_global_regs, DWC_HPTXFSI=
Z) >> 16;
> + =A0 =A0 =A0 dwc_otg_module_params.max_transfer_size =3D
> + =A0 =A0 =A0 =A0 =A0 (1 << (DWC_HWCFG3_XFERSIZE_CTR_WIDTH_RD(core_if->hw=
cfg3) + 11))
> + =A0 =A0 =A0 =A0 =A0 - 1;
> + =A0 =A0 =A0 dwc_otg_module_params.max_packet_count =3D
> + =A0 =A0 =A0 =A0 =A0 (1 << (DWC_HWCFG3_PKTSIZE_CTR_WIDTH_RD(core_if->hwc=
fg3) + 4))
> + =A0 =A0 =A0 =A0 =A0 - 1;
> +
> + =A0 =A0 =A0 dwc_otg_module_params.host_channels =3D
> + =A0 =A0 =A0 =A0 =A0 DWC_HWCFG2_NO_HST_CHAN_RD(core_if->hwcfg2) + 1;
> + =A0 =A0 =A0 dwc_otg_module_params.dev_endpoints =3D
> + =A0 =A0 =A0 =A0 =A0 DWC_HWCFG2_NO_DEV_EP_RD(core_if->hwcfg2);
> + =A0 =A0 =A0 dwc_otg_module_params.en_multiple_tx_fifo =3D
> + =A0 =A0 =A0 =A0 =A0 (DWC_HWCFG4_DED_FIFO_ENA_RD(core_if->hwcfg4) =3D=3D=
 0)
> + =A0 =A0 =A0 =A0 =A0 ? 0 : 1, 0;
> + =A0 =A0 =A0 set_valid_perio_tx_fifo_sizes(core_if);
> + =A0 =A0 =A0 set_valid_tx_fifo_sizes(core_if);
> +
> + =A0 =A0 =A0 return 0;
> +}
> +
> +module_param_named(dma_enable, dwc_otg_module_params.dma_enable, bool, 0=
444);
> +MODULE_PARM_DESC(dma_enable, "DMA Mode 0=3DSlave 1=3DDMA enabled");
> --
> 1.6.1.rc3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>



--=20
Best regards
Kassey

Intel Mobile Communication =A0Xi'an, China PRC

^ permalink raw reply

* Re: [PATCH 0/3] 8xx: Large page(8MB) support for 2.4
From: Joakim Tjernlund @ 2011-10-11  7:42 UTC (permalink / raw)
  To: Dan Malek; +Cc: Scott Wood, linuxppc-dev, Willy Tarreau
In-Reply-To: <9CE82FAD-2451-4253-B304-CF8BE5AC8CAC@digitaldans.com>

Dan Malek <ppc6dev@digitaldans.com> wrote on 2011/10/10 20:03:53:
>
>
> On Oct 10, 2011, at 9:45 AM, Joakim Tjernlund wrote:
>
> > That is an easy port but I will have to do that blind. Would you
> > mind take this for a spin on 2.4 first?
>
> My current system is running 2.6, so I don't have much
> interested in testing 2.4

Too bad as I won't be able to run 2.6 at all.
However, I just sent you a dry port to 3.0 of the large page stuff to
you. Happy testing.

>
> > The more interesting part is if one should use other sized(16K or
> > 512K) large pages too?
>
> My thought long ago was most of the 8xx systems have rather small
> real memories, so the larger pages, especially 512K may be too wasteful.
> I've always been a fan of keeping the TLB handlers tiny and simple,
> rather then spending the instructions doing complex replacements.
> Remember, this also affects the I- and D-cache, so a more frequent
> and trivial PTE update could very well gain larger system performance
> than the management of larger pages with more complex code.
> With all of the bug fix code in the handlers, maybe a larger page would
> be better.
>
> > Those should be useful for user space but it is a lot of work. I
> > haven't checked
> > what large page support for user space is in 2.6 for ppc though.
>
> The 2.6/3.0 kernel supports different, but fixed, page sizes.  IIRC,
> anything
> over 64K may require distribution rebuilding to realign code/data
> sections
> to more restrictive boundaries.  Maybe a 16K page would show some
> benefit.
> I'll try to make some time to play with it.

Unfortunately 3.0 does not have any free PTE bits now. I had to move
_PAGE_SPECIAL to the last available one as the new _PAGE_PSE needed its place.
Don't know what _PAGE_SPECIAL is but if it cannot be removed one can always skip
_PAGE_WRITETHRU again.

 Jocke

^ permalink raw reply

* [PATCH] powerpc: e500mc: Fix: use CONFIG_PPC_E500MC in idle_e500.S
From: Bharat Bhushan @ 2011-10-11  5:56 UTC (permalink / raw)
  To: galak; +Cc: Bharat Bhushan, linuxppc-dev, bharatb.yadav

It is wrongly using undefined CONFIG_E500MC.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
 arch/powerpc/kernel/idle_e500.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
index 3e2b95c..4f0ab85 100644
--- a/arch/powerpc/kernel/idle_e500.S
+++ b/arch/powerpc/kernel/idle_e500.S
@@ -26,7 +26,7 @@ _GLOBAL(e500_idle)
 	ori	r4,r4,_TLF_NAPPING	/* so when we take an exception */
 	stw	r4,TI_LOCAL_FLAGS(r3)	/* it will return to our caller */
 
-#ifdef CONFIG_E500MC
+#ifdef CONFIG_PPC_E500MC
 	wrteei	1
 1:	wait
 
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH 13/13] powerpc: Enable hugetlb by default for corenet64 platforms
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <13182798902823-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/configs/corenet64_smp_defconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 782822c..53741f4 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -81,6 +81,7 @@ CONFIG_EXT3_FS=y
 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
 # CONFIG_MISC_FILESYSTEMS is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_MAC_PARTITION=y
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 12/13] powerpc: Update corenet64_smp_defconfig
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <13182798892145-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

Updates from make savedefconfig.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/configs/corenet64_smp_defconfig |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index c92c204..782822c 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -11,10 +11,8 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -25,7 +23,6 @@ CONFIG_P5020_DS=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BINFMT_MISC=m
-# CONFIG_PCI is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -93,10 +90,8 @@ CONFIG_CRC_T10DIF=y
 CONFIG_CRC_ITU_T=m
 CONFIG_FRAME_WARN=1024
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_VIRQ_DEBUG=y
 CONFIG_CRYPTO_PCBC=m
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 11/13] powerpc: Enable Hugetlb by default for 32-bit 85xx/corenet
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <13182798883685-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/configs/corenet32_smp_defconfig |    1 +
 arch/powerpc/configs/mpc85xx_defconfig       |    1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig   |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index ab4db40..1c328da 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -154,6 +154,7 @@ CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_CRAMFS=y
 CONFIG_NFS_FS=y
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index a1e5a17..542eaa1 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -182,6 +182,7 @@ CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
 CONFIG_ADFS_FS=m
 CONFIG_AFFS_FS=m
 CONFIG_HFS_FS=m
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index dd1e413..c0a9574 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -183,6 +183,7 @@ CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
 CONFIG_ADFS_FS=m
 CONFIG_AFFS_FS=m
 CONFIG_HFS_FS=m
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 10/13] powerpc: Update mpc85xx/corenet 32-bit defconfigs
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <1318279885811-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

Results from updates via make savedefconfig.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/configs/corenet32_smp_defconfig |    8 --------
 arch/powerpc/configs/mpc85xx_defconfig       |    5 +----
 arch/powerpc/configs/mpc85xx_smp_defconfig   |    6 +-----
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index 4311d02..ab4db40 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -12,9 +12,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
@@ -69,7 +67,6 @@ CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_MTD=y
-CONFIG_MTD_PARTITIONS=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
@@ -107,7 +104,6 @@ CONFIG_FSL_PQ_MDIO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_LEGACY_PTYS is not set
-CONFIG_PPC_EPAPR_HV_BYTECHAN=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_EXTENDED=y
@@ -136,8 +132,6 @@ CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_OF=y
-CONFIG_MMC_SDHCI_OF_ESDHC=y
 CONFIG_EDAC=y
 CONFIG_EDAC_MM_EDAC=y
 CONFIG_EDAC_MPC85XX=y
@@ -146,7 +140,6 @@ CONFIG_RTC_DRV_DS3232=y
 CONFIG_RTC_DRV_CMOS=y
 CONFIG_UIO=y
 CONFIG_STAGING=y
-# CONFIG_STAGING_EXCLUDE_BUILD is not set
 CONFIG_VIRT_DRIVERS=y
 CONFIG_FSL_HV_MANAGER=y
 CONFIG_EXT2_FS=y
@@ -173,7 +166,6 @@ CONFIG_MAC_PARTITION=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=m
 CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEBUG_INFO=y
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index 2500912..a1e5a17 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -10,10 +10,8 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -41,7 +39,6 @@ CONFIG_TQM8560=y
 CONFIG_SBC8548=y
 CONFIG_QUICC_ENGINE=y
 CONFIG_QE_GPIO=y
-CONFIG_GPIO_MPC8XXX=y
 CONFIG_HIGHMEM=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -123,6 +120,7 @@ CONFIG_NVRAM=y
 CONFIG_I2C=y
 CONFIG_I2C_CPM=m
 CONFIG_I2C_MPC=y
+CONFIG_GPIO_MPC8XXX=y
 # CONFIG_HWMON is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -206,7 +204,6 @@ CONFIG_PARTITION_ADVANCED=y
 CONFIG_MAC_PARTITION=y
 CONFIG_CRC_T10DIF=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEBUG_INFO=y
 CONFIG_SYSCTL_SYSCALL_CHECK=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index a4ba13b..dd1e413 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -12,10 +12,8 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
-CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -42,7 +40,6 @@ CONFIG_TQM8560=y
 CONFIG_SBC8548=y
 CONFIG_QUICC_ENGINE=y
 CONFIG_QE_GPIO=y
-CONFIG_GPIO_MPC8XXX=y
 CONFIG_HIGHMEM=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -124,6 +121,7 @@ CONFIG_NVRAM=y
 CONFIG_I2C=y
 CONFIG_I2C_CPM=m
 CONFIG_I2C_MPC=y
+CONFIG_GPIO_MPC8XXX=y
 # CONFIG_HWMON is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
@@ -207,10 +205,8 @@ CONFIG_PARTITION_ADVANCED=y
 CONFIG_MAC_PARTITION=y
 CONFIG_CRC_T10DIF=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
 CONFIG_VIRQ_DEBUG=y
 CONFIG_CRYPTO_PCBC=m
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 09/13] powerpc: Kconfig updates for FSL BookE HUGETLB 64-bit
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <1318279883564-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

Allow hugetlb to be enabled on 64b FSL_BOOK3E.  No platforms enable
it by default yet.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/platforms/Kconfig.cputype |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a85990c..7e47fd4 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -174,7 +174,6 @@ config BOOKE
 config FSL_BOOKE
 	bool
 	depends on (E200 || E500) && PPC32
-	select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT
 	default y
 
 # this is for common code between PPC32 & PPC64 FSL BOOKE
@@ -182,6 +181,7 @@ config PPC_FSL_BOOK3E
 	bool
 	select FSL_EMB_PERFMON
 	select PPC_SMP_MUXED_IPI
+	select SYS_SUPPORTS_HUGETLBFS if PHYS_64BIT || PPC64
 	default y if FSL_BOOKE
 
 config PTE_64BIT
@@ -298,7 +298,7 @@ config PPC_BOOK3E_MMU
 
 config PPC_MM_SLICES
 	bool
-	default y if (PPC64 && HUGETLB_PAGE) || (PPC_STD_MMU_64 && PPC_64K_PAGES)
+	default y if (!PPC_FSL_BOOK3E && PPC64 && HUGETLB_PAGE) || (PPC_STD_MMU_64 && PPC_64K_PAGES)
 	default n
 
 config VIRT_CPU_ACCOUNTING
-- 
1.5.6.5

^ permalink raw reply related

* [PATCH 08/13] powerpc: Add gpages reservation code for 64-bit FSL BOOKE
From: Becky Bruce @ 2011-10-10 20:50 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: david
In-Reply-To: <13182798791090-git-send-email-beckyb@kernel.crashing.org>

From: Becky Bruce <beckyb@kernel.crashing.org>

For 64-bit FSL_BOOKE implementations, gigantic pages need to be
reserved at boot time by the memblock code based on the command line.
This adds the call that handles the reservation, and fixes some code
comments.

It also removes the previous pr_err when reserve_hugetlb_gpages
is called on a system without hugetlb enabled - the way the code is
structured, the call is unconditional and the resulting error message
spurious and confusing.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 arch/powerpc/include/asm/hugetlb.h |   19 ++++++++++++++-----
 arch/powerpc/kernel/setup_64.c     |   10 ++++++++++
 arch/powerpc/mm/hugetlbpage.c      |    8 ++++----
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 273acfa..555044c 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -5,7 +5,6 @@
 #include <asm/page.h>
 
 extern struct kmem_cache *hugepte_cache;
-extern void __init reserve_hugetlb_gpages(void);
 
 static inline pte_t *hugepd_page(hugepd_t hpd)
 {
@@ -153,14 +152,24 @@ static inline void arch_release_hugepage(struct page *page)
 }
 
 #else /* ! CONFIG_HUGETLB_PAGE */
-static inline void reserve_hugetlb_gpages(void)
-{
-	pr_err("Cannot reserve gpages without hugetlb enabled\n");
-}
 static inline void flush_hugetlb_page(struct vm_area_struct *vma,
 				      unsigned long vmaddr)
 {
 }
+#endif /* CONFIG_HUGETLB_PAGE */
+
+
+/*
+ * FSL Book3E platforms require special gpage handling - the gpages
+ * are reserved early in the boot process by memblock instead of via
+ * the .dts as on IBM platforms.
+ */
+#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PPC_FSL_BOOK3E)
+extern void __init reserve_hugetlb_gpages(void);
+#else
+static inline void reserve_hugetlb_gpages(void)
+{
+}
 #endif
 
 #endif /* _ASM_POWERPC_HUGETLB_H */
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d4168c9..2e334d4 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -35,6 +35,8 @@
 #include <linux/pci.h>
 #include <linux/lockdep.h>
 #include <linux/memblock.h>
+#include <linux/hugetlb.h>
+
 #include <asm/io.h>
 #include <asm/kdump.h>
 #include <asm/prom.h>
@@ -64,6 +66,7 @@
 #include <asm/mmu_context.h>
 #include <asm/code-patching.h>
 #include <asm/kvm_ppc.h>
+#include <asm/hugetlb.h>
 
 #include "setup.h"
 
@@ -217,6 +220,13 @@ void __init early_setup(unsigned long dt_ptr)
 	/* Initialize the hash table or TLB handling */
 	early_init_mmu();
 
+	/*
+	 * Reserve any gigantic pages requested on the command line.
+	 * memblock needs to have been initialized by the time this is
+	 * called since this will reserve memory.
+	 */
+	reserve_hugetlb_gpages();
+
 	DBG(" <- early_setup()\n");
 }
 
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 9a34606..51855a0 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -28,10 +28,10 @@ unsigned int HPAGE_SHIFT;
 
 /*
  * Tracks gpages after the device tree is scanned and before the
- * huge_boot_pages list is ready.  On 64-bit implementations, this is
- * just used to track 16G pages and so is a single array.  32-bit
- * implementations may have more than one gpage size due to limitations
- * of the memory allocators, so we need multiple arrays
+ * huge_boot_pages list is ready.  On non-Freescale implementations, this is
+ * just used to track 16G pages and so is a single array.  FSL-based
+ * implementations may have more than one gpage size, so we need multiple
+ * arrays
  */
 #ifdef CONFIG_PPC_FSL_BOOK3E
 #define MAX_NUMBER_GPAGES	128
-- 
1.5.6.5

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox