* Re: Too verbose compat_ioctl messages?
From: Andi Kleen @ 2007-07-06 18:14 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Geert Uytterhoeven, Linux/PPC Development,
Linux Kernel Development, Hiroaki Fuse
In-Reply-To: <468E6E33.3040000@zytor.com>
"H. Peter Anvin" <hpa@zytor.com> writes:
>
> For one thing, it looks like we're returning the wrong thing (EINVAL
> rather than ENOTTY) across the board. This was unfortunately a common
> misunderstanding with non-tty-related ioctls in the early days of Linux.
ENOTTY is so excessively misnamed that it is actually surprising
anybody ever got that "right" (for very small values of right i guess)
-Andi
^ permalink raw reply
* Re: Too verbose compat_ioctl messages?
From: H. Peter Anvin @ 2007-07-06 17:48 UTC (permalink / raw)
To: Andi Kleen
Cc: Geert Uytterhoeven, Linux/PPC Development,
Linux Kernel Development, Hiroaki Fuse
In-Reply-To: <p737ipd1jsg.fsf@bingen.suse.de>
Andi Kleen wrote:
> "H. Peter Anvin" <hpa@zytor.com> writes:
>> For one thing, it looks like we're returning the wrong thing (EINVAL
>> rather than ENOTTY) across the board. This was unfortunately a common
>> misunderstanding with non-tty-related ioctls in the early days of Linux.
>
> ENOTTY is so excessively misnamed that it is actually surprising
> anybody ever got that "right" (for very small values of right i guess)
>
No argument there.
-hpa
^ permalink raw reply
* Re: Too verbose compat_ioctl messages?
From: H. Peter Anvin @ 2007-07-06 18:36 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Geert Uytterhoeven, Linux/PPC Development, Andi Kleen,
Linux Kernel Development, Hiroaki Fuse
In-Reply-To: <468E8B07.2030404@goop.org>
Jeremy Fitzhardinge wrote:
>>
>> ENOTTY is so excessively misnamed that it is actually surprising
>> anybody ever got that "right" (for very small values of right i guess)
>
> But it *isn't* a typewriter. Of course, it's not a giraffe either.
>
The union of things that are not typewriters and not giraffes are rather
large, indeed.
This is getting philosophical.
-hpa
^ permalink raw reply
* Re: Too verbose compat_ioctl messages?
From: Jeremy Fitzhardinge @ 2007-07-06 18:40 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Geert Uytterhoeven, Linux/PPC Development, Andi Kleen,
Linux Kernel Development, Hiroaki Fuse
In-Reply-To: <468E8BBF.9020907@zytor.com>
H. Peter Anvin wrote:
> The union of things that are not typewriters and not giraffes are rather
> large, indeed.
>
> This is getting philosophical.
>
I think my point is that we're rather short of good quality open source
giraffe drivers.
J
^ permalink raw reply
* Re: Too verbose compat_ioctl messages?
From: Jeremy Fitzhardinge @ 2007-07-06 18:33 UTC (permalink / raw)
To: Andi Kleen
Cc: Geert Uytterhoeven, Linux/PPC Development,
Linux Kernel Development, Hiroaki Fuse, H. Peter Anvin
In-Reply-To: <p737ipd1jsg.fsf@bingen.suse.de>
Andi Kleen wrote:
> "H. Peter Anvin" <hpa@zytor.com> writes:
>
>> For one thing, it looks like we're returning the wrong thing (EINVAL
>> rather than ENOTTY) across the board. This was unfortunately a common
>> misunderstanding with non-tty-related ioctls in the early days of Linux.
>>
>
> ENOTTY is so excessively misnamed that it is actually surprising
> anybody ever got that "right" (for very small values of right i guess)
>
But it *isn't* a typewriter. Of course, it's not a giraffe either.
J
^ permalink raw reply
* ARCH=ppc vs ARCH=powerpc
From: Mark Fortescue @ 2007-07-06 16:21 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I have noticed and read a few comments regarding the demise of ARCH=ppc.
Having two PowerPC arcitectures and only supprting one of them makes
little sense. Is it not time to migrate (where required) the remaining
code from arch/ppc to arch/powerpc and asm-ppc to asm-powerpc. There are
not many files left that are unique to ARCH=ppc so it should not take too
long.
For me, the requirement is to keep support for the cards indicated in
arch/ppc/config/xxx_defconfig (as I have one that I might what to use with
linux) in the same way as they are supported in ARCH=ppc.
I have just made some tweeks to get ARCH=ppc building for me but I still
need to sort out what is required to get around *** Error: Headers not
exportable for this architecture (ppc).
Regards
Mark Fortescue.
^ permalink raw reply
* Re: Too verbose compat_ioctl messages?
From: Andi Kleen @ 2007-07-06 19:04 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Linux Kernel Development, Linux/PPC Development, Andi Kleen,
H. Peter Anvin, Geert Uytterhoeven, Hiroaki Fuse
In-Reply-To: <468E8B07.2030404@goop.org>
On Fri, Jul 06, 2007 at 11:33:43AM -0700, Jeremy Fitzhardinge wrote:
> Andi Kleen wrote:
> >"H. Peter Anvin" <hpa@zytor.com> writes:
> >
> >>For one thing, it looks like we're returning the wrong thing (EINVAL
> >>rather than ENOTTY) across the board. This was unfortunately a common
> >>misunderstanding with non-tty-related ioctls in the early days of Linux.
> >>
> >
> >ENOTTY is so excessively misnamed that it is actually surprising
> >anybody ever got that "right" (for very small values of right i guess)
> >
>
> But it *isn't* a typewriter.
Most ioctls are not related to ttys in any way.
-Andi
^ permalink raw reply
* mpc83xx USB support status
From: Grant Likely @ 2007-07-06 20:02 UTC (permalink / raw)
To: Li Yang-r58472, Timur Tabi, Behan Webster, Linux PPC Linux PPC
Li,
What is the state of mpc83xx support in arch/powerpc? I saw some of
the patches you posted to the ppc and usb-devel lists, but I want to
make sure I've got the whole set. Also, can you tell me what the
state of those patches are (ie. which ones will be picked up for
2.6.23?)
I'm working on the mpc8349-mitx-gp board, and I can do the work to get
your changes working on that board.
Thanks,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [PATCH] pasemi: don't auto-select CONFIG_EMBEDDED
From: Olof Johansson @ 2007-07-06 20:15 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
Disable auto-select of CONFIG_EMBEDDED. ELECTRA_IDE selects PATA_PLATFORM
which should be sufficient.
Signed-off-by: Olof Johansson <olof@lixom.net>
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index 4275ff8..95cd90f 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -5,7 +5,6 @@ config PPC_PASEMI
select MPIC
select PPC_UDBG_16550
select PPC_NATIVE
- select EMBEDDED
help
This option enables support for PA Semi's PWRficient line
of SoC processors, including PA6T-1682M
^ permalink raw reply related
* Re: PowerPC equivalent to dma_mmap_writecombine()?
From: Timur Tabi @ 2007-07-06 20:19 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200707051813.53762.arnd@arndb.de>
Arnd Bergmann wrote:
> Not sure exactly what arm does here, but it sounds like you want
> to call remap_pfn_range with the _PAGE_NO_CACHE bit set in the
> protection flags, and _PAGE_GUARDED not set.
I always have a hard time with these mapping functions. Is this right?
vma->vm_page_prot = __pgprot((pgprot_val(vma->vm_page_prot) | _PAGE_NO_CACHE) &
~_PAGE_GUARDED));
ret = remap_pfn_range(vma, vma->vm_start, runtime->dma_addr, runtime->dma_bytes,
vma->vm_page_prot);
Alternatively, could I use function snd_pcm_lib_mmap_iomem() (sound/core/pcm_native.c)?
It looks like it does the right thing, although it doesn't unset the guarded bit. If
that's wrong, I can submit a patch to unset that bit on PowerPC, but like I said, I can
never quite get my head around this mapping stuff.
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* Re: PowerPC equivalent to dma_mmap_writecombine()?
From: Arnd Bergmann @ 2007-07-06 21:26 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <468EA3DA.8070903@freescale.com>
On Friday 06 July 2007, Timur Tabi wrote:
> Arnd Bergmann wrote:
>=20
> > Not sure exactly what arm does here, but it sounds like you want
> > to call remap_pfn_range with the _PAGE_NO_CACHE bit set in the
> > protection flags, and _PAGE_GUARDED not set.
>=20
> I always have a hard time with these mapping functions. =A0Is this right?
>=20
> vma->vm_page_prot =3D __pgprot((pgprot_val(vma->vm_page_prot) | _PAGE_NO_=
CACHE) &=20
> ~_PAGE_GUARDED));
>=20
> ret =3D remap_pfn_range(vma, vma->vm_start, runtime->dma_addr, runtime->d=
ma_bytes,=20
> vma->vm_page_prot);
>=20
> Alternatively, could I use function snd_pcm_lib_mmap_iomem() (sound/core/=
pcm_native.c)?=20
> It looks like it does the right thing, although it doesn't unset the guar=
ded bit. =A0If=20
> that's wrong, I can submit a patch to unset that bit on PowerPC, but like=
I said, I can=20
> never quite get my head around this mapping stuff.
The guarded bit is disabled by default, so you don't need t remove it, so
the function you quoted should be alright for this purpose. Not sure if you
need the ioremap in there though.
Arnd <><
^ permalink raw reply
* Minor: Removed double return.
From: Manish Ahuja @ 2007-07-06 21:59 UTC (permalink / raw)
To: ppc-dev
[-- Attachment #1: Type: text/plain, Size: 154 bytes --]
Found 2 instances of return one right after each other in
arch_add_memory(). This minor patch fixes it.
Signed-off-by:Manish Ahuja <mahuja@us.ibm.com>
[-- Attachment #2: double-return --]
[-- Type: text/plain, Size: 382 bytes --]
Index: 2.6.22-rc4/arch/powerpc/mm/mem.c
===================================================================
--- 2.6.22-rc4.orig/arch/powerpc/mm/mem.c 2007-06-11 21:10:46.000000000 -0500
+++ 2.6.22-rc4/arch/powerpc/mm/mem.c 2007-06-29 22:52:42.000000000 -0500
@@ -129,8 +129,6 @@
zone = pgdata->node_zones;
return __add_pages(zone, start_pfn, nr_pages);
-
- return 0;
}
/*
^ permalink raw reply
* Re: [PATCH 2.6.23] 83xx USB platform code rework
From: Grant Likely @ 2007-07-06 22:27 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, paulus
In-Reply-To: <11834557963629-git-send-email-leoli@freescale.com>
On 7/3/07, Li Yang <leoli@freescale.com> wrote:
> Add 831x USB platform setup code and rework 834x USB
> platform setup code. Move USB platform code to usb.c
> for different boards with CPU of the same series to share
> the USB initialization code.
>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> Respin for 2.6.22-rc7. Remove USB_EHCI_FSL selects in Kconfig, as they
> will be enabled in USB Kconfig.
>
> arch/powerpc/platforms/83xx/Makefile | 2 +-
> arch/powerpc/platforms/83xx/mpc8313_rdb.c | 1 +
> arch/powerpc/platforms/83xx/mpc834x_mds.c | 49 +-------
> arch/powerpc/platforms/83xx/mpc83xx.h | 28 ++++-
> arch/powerpc/platforms/83xx/usb.c | 181 +++++++++++++++++++++++++++++
> 5 files changed, 213 insertions(+), 48 deletions(-)
> create mode 100644 arch/powerpc/platforms/83xx/usb.c
>
> diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile
> index 31a91b5..5a98f88 100644
> --- a/arch/powerpc/platforms/83xx/Makefile
> +++ b/arch/powerpc/platforms/83xx/Makefile
> @@ -1,7 +1,7 @@
> #
> # Makefile for the PowerPC 83xx linux kernel.
> #
> -obj-y := misc.o
> +obj-y := misc.o usb.o
> obj-$(CONFIG_PCI) += pci.o
> obj-$(CONFIG_MPC8313_RDB) += mpc8313_rdb.o
> obj-$(CONFIG_MPC832x_RDB) += mpc832x_rdb.o
> diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> index 96970ac..a404910 100644
> --- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> @@ -53,6 +53,7 @@ static void __init mpc8313_rdb_setup_arch(void)
>
> ppc_md.pci_exclude_device = mpc83xx_exclude_device;
> #endif
> + mpc831x_usb_cfg();
> }
>
> void __init mpc8313_rdb_init_IRQ(void)
> diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
> index 10394b2..28b3840 100644
> --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
> +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
> @@ -44,55 +44,16 @@ unsigned long isa_mem_base = 0;
> #endif
>
> #define BCSR5_INT_USB 0x02
> -/* Note: This is only for PB, not for PB+PIB
> - * On PB only port0 is connected using ULPI */
> -static int mpc834x_usb_cfg(void)
> +static int mpc834xemds_usb_cfg(void)
> {
> - unsigned long sccr, sicrl;
> - void __iomem *immap;
> + struct device_node *np;
> void __iomem *bcsr_regs = NULL;
> u8 bcsr5;
> - struct device_node *np = NULL;
> - int port0_is_dr = 0;
> -
> - if ((np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr")) != NULL)
> - port0_is_dr = 1;
> - if ((np = of_find_compatible_node(NULL, "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(), 0x1000);
> - 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);
>
> + mpc834x_usb_cfg();
> /* Map BCSR area */
> np = of_find_node_by_name(NULL, "bcsr");
> - if (np != 0) {
> + if (np) {
> struct resource res;
>
> of_address_to_resource(np, 0, &res);
> @@ -134,7 +95,7 @@ static void __init mpc834x_mds_setup_arch(void)
> ppc_md.pci_exclude_device = mpc83xx_exclude_device;
> #endif
>
> - mpc834x_usb_cfg();
> + mpc834xemds_usb_cfg();
> }
>
> static void __init mpc834x_mds_init_IRQ(void)
> diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
> index 9cd03b5..a44e5b1 100644
> --- a/arch/powerpc/platforms/83xx/mpc83xx.h
> +++ b/arch/powerpc/platforms/83xx/mpc83xx.h
> @@ -6,6 +6,7 @@
>
> /* System Clock Control Register */
> #define MPC83XX_SCCR_OFFS 0xA08
> +#define MPC83XX_SCCR_USB_MASK 0x00f00000
> #define MPC83XX_SCCR_USB_MPHCM_11 0x00c00000
> #define MPC83XX_SCCR_USB_MPHCM_01 0x00400000
> #define MPC83XX_SCCR_USB_MPHCM_10 0x00800000
> @@ -15,12 +16,31 @@
>
> /* system i/o configuration register low */
> #define MPC83XX_SICRL_OFFS 0x114
> -#define MPC83XX_SICRL_USB0 0x40000000
> -#define MPC83XX_SICRL_USB1 0x20000000
> +#define MPC834X_SICRL_USB_MASK 0x60000000
> +#define MPC834X_SICRL_USB0 0x40000000
> +#define MPC834X_SICRL_USB1 0x20000000
> +#define MPC831X_SICRL_USB_MASK 0x00000c00
> +#define MPC831X_SICRL_USB_ULPI 0x00000800
>
> /* system i/o configuration register high */
> #define MPC83XX_SICRH_OFFS 0x118
> -#define MPC83XX_SICRH_USB_UTMI 0x00020000
> +#define MPC834X_SICRH_USB_UTMI 0x00020000
> +#define MPC831X_SICRH_USB_MASK 0x000000e0
> +#define MPC831X_SICRH_USB_ULPI 0x000000a0
> +
> +/* USB Control Register */
> +#define FSL_USB2_CONTROL_OFFS 0x500
> +#define CONTROL_UTMI_PHY_EN 0x00000200
> +#define CONTROL_REFSEL_48MHZ 0x00000080
> +#define CONTROL_PHY_CLK_SEL_ULPI 0x00000400
> +#define CONTROL_OTG_PORT 0x00000020
> +
> +/* USB PORTSC Registers */
> +#define FSL_USB2_PORTSC1_OFFS 0x184
> +#define FSL_USB2_PORTSC2_OFFS 0x188
> +#define PORTSCX_PTW_16BIT 0x10000000
> +#define PORTSCX_PTS_UTMI 0x00000000
> +#define PORTSCX_PTS_ULPI 0x80000000
>
> /*
> * Declaration for the various functions exported by the
> @@ -31,5 +51,7 @@ extern int add_bridge(struct device_node *dev);
> extern int mpc83xx_exclude_device(u_char bus, u_char devfn);
> extern void mpc83xx_restart(char *cmd);
> extern long mpc83xx_time_init(void);
> +extern int mpc834x_usb_cfg(void);
> +extern int mpc831x_usb_cfg(void);
>
> #endif /* __MPC83XX_H__ */
> diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
> new file mode 100644
> index 0000000..e7fdf01
> --- /dev/null
> +++ b/arch/powerpc/platforms/83xx/usb.c
> @@ -0,0 +1,181 @@
> +/*
> + * Freescale 83xx USB SOC setup code
> + *
> + * Copyright (C) 2007 Freescale Semiconductor, Inc.
> + * Author: Li Yang
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +
> +#include <linux/stddef.h>
> +#include <linux/kernel.h>
> +#include <linux/errno.h>
> +
> +#include <asm/io.h>
> +#include <asm/prom.h>
> +#include <sysdev/fsl_soc.h>
> +
> +#include "mpc83xx.h"
> +
> +
> +#ifdef CONFIG_MPC834x
> +int mpc834x_usb_cfg(void)
> +{
> + unsigned long sccr, sicrl, sicrh;
> + void __iomem *immap;
> + struct device_node *np = NULL;
> + int port0_is_dr = 0, port1_is_dr = 0;
> + const void *prop, *dr_mode;
> +
> + immap = ioremap(get_immrbase(), 0x1000);
> + if (!immap)
> + return -ENOMEM;
> +
> + /* Read registers */
> + /* Note: DR and MPH must use the same clock setting in SCCR */
> + sccr = in_be32(immap + MPC83XX_SCCR_OFFS) & ~MPC83XX_SCCR_USB_MASK;
> + sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK;
> + sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI;
> +
> + np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
> + if (np) {
> + sccr |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
> +
> + prop = of_get_property(np, "phy_type", NULL);
> + if (prop && (!strcmp(prop, "utmi") ||
> + !strcmp(prop, "utmi_wide"))) {
> + sicrl |= MPC834X_SICRL_USB0 | MPC834X_SICRL_USB1;
> + sicrh |= MPC834X_SICRH_USB_UTMI;
> + port1_is_dr = 1;
> + } else if (prop && !strcmp(prop, "serial")) {
> + dr_mode = of_get_property(np, "dr_mode", NULL);
> + if (dr_mode && !strcmp(dr_mode, "otg")) {
> + sicrl |= MPC834X_SICRL_USB0 | MPC834X_SICRL_USB1;
> + port1_is_dr = 1;
> + } else {
> + sicrl |= MPC834X_SICRL_USB0;
> + }
> + } else if (prop && !strcmp(prop, "ulpi")) {
> + sicrl |= MPC834X_SICRL_USB0;
> + } else {
> + printk(KERN_WARNING "834x USB PHY type not supported\n");
> + }
> + port0_is_dr = 1;
> + of_node_put(np);
> + }
> + np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph");
> + if (np) {
> + sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
> +
> + prop = of_get_property(np, "port0", NULL);
> + if (prop) {
> + if (port0_is_dr)
> + printk(KERN_WARNING
> + "834x USB port0 can't be used by both DR and MPH!\n");
> + sicrl |= MPC834X_SICRL_USB0;
> + }
> + prop = of_get_property(np, "port1", NULL);
> + if (prop) {
> + if (port1_is_dr)
> + printk(KERN_WARNING
> + "834x USB port1 can't be used by both DR and MPH!\n");
> + sicrl |= MPC834X_SICRL_USB1;
> + }
> + of_node_put(np);
> + }
> +
> + /* Write back */
> + out_be32(immap + MPC83XX_SCCR_OFFS, sccr);
> + out_be32(immap + MPC83XX_SICRL_OFFS, sicrl);
> + out_be32(immap + MPC83XX_SICRH_OFFS, sicrh);
> +
> + iounmap(immap);
> + return 0;
> +}
> +#endif /* CONFIG_MPC834x */
> +
> +#ifdef CONFIG_PPC_MPC831x
> +int mpc831x_usb_cfg(void)
> +{
> + u32 temp;
> + void __iomem *immap, *usb_regs;
> + struct device_node *np = NULL;
> + const void *prop;
> + struct resource res;
> + int ret = 0;
> +#ifdef CONFIG_USB_OTG
> + const void *dr_mode;
> +#endif
> +
> + np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
> + if (!np)
> + return -ENODEV;
> + prop = of_get_property(np, "phy_type", NULL);
> +
> + /* Map IMMR space for pin and clock settings */
> + immap = ioremap(get_immrbase(), 0x1000);
> + if (!immap) {
> + of_node_put(np);
> + return -ENOMEM;
> + }
> +
> + /* Configure clock */
> + temp = in_be32(immap + MPC83XX_SCCR_OFFS);
> + temp &= ~MPC83XX_SCCR_USB_MASK;
> + temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
> + out_be32(immap + MPC83XX_SCCR_OFFS, temp);
> +
> + /* Configure pin mux for ULPI. There is no pin mux for UTMI */
> + if (!strcmp(prop, "ulpi")) {
> + temp = in_be32(immap + MPC83XX_SICRL_OFFS);
> + temp &= ~MPC831X_SICRL_USB_MASK;
> + temp |= MPC831X_SICRL_USB_ULPI;
> + out_be32(immap + MPC83XX_SICRL_OFFS, temp);
> +
> + temp = in_be32(immap + MPC83XX_SICRH_OFFS);
> + temp &= ~MPC831X_SICRH_USB_MASK;
> + temp |= MPC831X_SICRH_USB_ULPI;
> + out_be32(immap + MPC83XX_SICRH_OFFS, temp);
> + }
> +
> + iounmap(immap);
> +
> + /* Map USB SOC space */
> + ret = of_address_to_resource(np, 0, &res);
> + if (ret) {
> + of_node_put(np);
> + return ret;
> + }
> + usb_regs = ioremap(res.start, res.end - res.start + 1);
> +
> + /* Using on-chip PHY */
> + if (!strcmp(prop, "utmi_wide") ||
> + !strcmp(prop, "utmi")) {
> + /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
> + out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
> + CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
> + /* Using external UPLI PHY */
> + } else if (!strcmp(prop, "ulpi")) {
> + /* Set PHY_CLK_SEL to ULPI */
> + temp = CONTROL_PHY_CLK_SEL_ULPI;
> +#ifdef CONFIG_USB_OTG
> + /* Set OTG_PORT */
> + dr_mode = of_get_property(np, "dr_mode", NULL);
> + if (dr_mode && !strcmp(dr_mode, "otg"))
> + temp |= CONTROL_OTG_PORT;
> +#endif /* CONFIG_USB_OTG */
> + out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp);
> + } else {
> + printk(KERN_WARNING "831x USB PHY type not supported\n");
> + ret = -EINVAL;
> + }
> +
> + iounmap(usb_regs);
> + of_node_put(np);
> + return ret;
> +}
> +#endif /* CONFIG_PPC_MPC831x */
> --
> 1.5.2.GIT
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [PATCH] pseries: Re: Minor: Removed double return.
From: Linas Vepstas @ 2007-07-06 22:58 UTC (permalink / raw)
To: Manish Ahuja; +Cc: ppc-dev
In-Reply-To: <468EBB5B.2070309@austin.ibm.com>
You want to say its a patch in the subject line.
--linas
On Fri, Jul 06, 2007 at 04:59:55PM -0500, Manish Ahuja wrote:
> Found 2 instances of return one right after each other in
> arch_add_memory(). This minor patch fixes it.
> Signed-off-by:Manish Ahuja <mahuja@us.ibm.com>
>
>
> Index: 2.6.22-rc4/arch/powerpc/mm/mem.c
> ===================================================================
> --- 2.6.22-rc4.orig/arch/powerpc/mm/mem.c 2007-06-11 21:10:46.000000000 -0500
> +++ 2.6.22-rc4/arch/powerpc/mm/mem.c 2007-06-29 22:52:42.000000000 -0500
> @@ -129,8 +129,6 @@
> zone = pgdata->node_zones;
>
> return __add_pages(zone, start_pfn, nr_pages);
> -
> - return 0;
> }
>
> /*
^ permalink raw reply
* [PATCH] Add USB support to mpc8349-mitx board port
From: Grant Likely @ 2007-07-06 22:29 UTC (permalink / raw)
To: paulus, linuxppc-dev, galak, leoli, kim.phillips
From: Grant Likely <grant.likely@secretlab.ca>
This patch depends on Li Yang's patch: "83xx USB platform code rework"
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/83xx/mpc834x_itx.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 40a0194..1ace7ac 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -63,6 +63,8 @@ static void __init mpc834x_itx_setup_arch(void)
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
+
+ mpc834x_usb_cfg();
}
static void __init mpc834x_itx_init_IRQ(void)
^ permalink raw reply related
* Re: [PATCH] Add USB support to mpc8349-mitx board port
From: Arnd Bergmann @ 2007-07-06 23:48 UTC (permalink / raw)
To: linuxppc-dev; +Cc: leoli, paulus
In-Reply-To: <20070706222909.19943.39455.stgit@trillian.secretlab.ca>
On Saturday 07 July 2007, Grant Likely wrote:
> --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> @@ -63,6 +63,8 @@ static void __init mpc834x_itx_setup_arch(void)
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0ppc_md.pci_exclude_device =3D mpc83xx_exclude_dev=
ice;
> =A0#endif
> +
> +=A0=A0=A0=A0=A0=A0=A0mpc834x_usb_cfg();
> =A0}
Why is that necessary? Shouldn't there be an of_platform_driver that
simply does all the setup automatically if the device is present?
Arnd <><
^ permalink raw reply
* Re: Executing from readablee, no-exec pages
From: Benjamin Herrenschmidt @ 2007-07-07 2:33 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev, paulus
In-Reply-To: <1183732922.2747.36.camel@shinybook.infradead.org>
On Fri, 2007-07-06 at 10:42 -0400, David Woodhouse wrote:
> On Thu, 2007-07-05 at 16:55 -0500, Scott Wood wrote:
> > To maintain compatibility with these versions, we could change the test
> > in do_page_fault() to include VM_READ as well as VM_EXEC on targets that
> > don't have a separate exec-bit in hardware (are there any powerpc mmus
> > that do?).
>
> 64-bit implementations since POWER4 have separate exec permissions,
> don't they? So any userspace which tries to execute non-executable pages
> is already broken when running on a ppc64 machine; I wouldn't worry too
> much about letting it break on ppc32 too.
>
> We already use vDSO signal trampolines even on the 32-bit kernel, right?
The problem was with old glibc 32 bits which used to jump to an
instruction in the .got iirc that wasn't in an executable section
Ben.
^ permalink raw reply
* Re: Executing from readablee, no-exec pages
From: Benjamin Herrenschmidt @ 2007-07-07 2:33 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
In-Reply-To: <20070706164942.GA10806@ld0162-tx32.am.freescale.net>
> Well, it means that leaving VM_READ out of the check (except where the
> hardware PTE has an exec bit) isn't really buying us anything
> security-wise (especially since the primary reason for no-exec protection
> is to avoid code injections via stack overflow, and those pages will
> usually already be present), so it doesn't hurt much to let things keep
> working.
>
> At the least, I'd like it to keep working for a few more kernel releases
> (with a warning printed when a VM_EXEC-only test would have failed), so
> people have time to upgrade glibc.
I agree. Care to send a patch ? :-0
Ben.
^ permalink raw reply
* [PATCH] Handle reg-shift property for of_serial ports
From: David Woodhouse @ 2007-07-07 4:58 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, arnd
The MV64660 has reg-shift==2 for its otherwise 16550-compatible uarts.
While the bootwrapper copes with this, of_serial.c doesn't. (The udbg
code doesn't either, but I'll fix that later).
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 7ffdaea..0761ff9 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -25,12 +25,13 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
{
struct resource resource;
struct device_node *np = ofdev->node;
- const unsigned int *clk, *spd;
+ const unsigned int *clk, *spd, *rs;
int ret;
memset(port, 0, sizeof *port);
spd = of_get_property(np, "current-speed", NULL);
clk = of_get_property(np, "clock-frequency", NULL);
+ rs = of_get_property(np, "reg-shift", NULL);
if (!clk) {
dev_warn(&ofdev->dev, "no clock-frequency property set\n");
return -ENODEV;
@@ -48,6 +49,8 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
port->iotype = UPIO_MEM;
port->type = type;
port->uartclk = *clk;
+ if (rs)
+ port->regshift = *rs;
port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
| UPF_FIXED_PORT;
port->dev = &ofdev->dev;
--
dwmw2
^ permalink raw reply related
* Re: Mem-2-Mem DMA - Generalized API
From: Timur Tabi @ 2007-07-07 5:24 UTC (permalink / raw)
To: Clifford Wolf; +Cc: linuxppc-embedded
In-Reply-To: <20070704090554.GA30693@clifford.at>
Clifford Wolf wrote:
> Hi,
>
> On Mon, Jun 25, 2007 at 08:01:10PM +0200, Clifford Wolf wrote:
>> I've put a 'draft header file' of an api as I would have expected it
>> online: [...]
>
> Ok, so here comes the first implementation:
> (I also have other projects, so it took a while.. ;-)
>
> http://www.clifford.at/priv/dmatransfer-20070704.diff
Why aren't you following the DMA API in include/linux/dmaengine.h?
^ permalink raw reply
* Re: [PATCH] Add USB support to mpc8349-mitx board port
From: Grant Likely @ 2007-07-07 5:46 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, paulus, leoli, Timur Tabi
In-Reply-To: <200707070148.20526.arnd@arndb.de>
On 7/6/07, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 07 July 2007, Grant Likely wrote:
> > --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > @@ -63,6 +63,8 @@ static void __init mpc834x_itx_setup_arch(void)
> >
> > ppc_md.pci_exclude_device = mpc83xx_exclude_device;
> > #endif
> > +
> > +mpc834x_usb_cfg();
> > }
>
> Why is that necessary? Shouldn't there be an of_platform_driver that
> simply does all the setup automatically if the device is present?
This call is actually for SoC setup stuff. There are actually 2 USB
engines on the SoC, and this call figures out what mode the pins are
supposed to be in. I think this stuff firmly falls into the platform
setup arena since it is highly chip specific.
You bring up a good point though. The current usb support code in
sysdev/fsl_soc.c uses arch_initcall(fsl_usb_of_init) to go searching
for USB interfaces in the device tree, which are EHCI (and sometimes
OTG) compatible. fsl_usb_of_init calls
platform_device_register_simple() for each USB device found which is
kind of a round about way of doing things. That should probably be
depreciated and an of_platform_device binding should be added to the
EHCI driver.
This same comment probably goes for the other arch_initcall functions
in fsl_soc.c which do exactly the same thing for other devices.
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* [PATCH 00/11] dtc: some fixes, and make asm labels for data
From: Milton Miller @ 2007-07-07 6:18 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, David Gibson
The following series adds the features of labeling memory reserve
slots and labeling specific bytes or cells of property data. When
translating from dts to asm, a global symbol is created with the
name matching the label in the dts file.
With these features a program does not need to understand the
flattened device tree headers, offsets, layouts, or alignments to
modify a property's contents. Instead it can read or write to the
bytes or words addressed by a global symbol.
In addition the series contains 3 fixes to the compiler (one major
- incorrect output, one recognising an input error, and one compiler
warning), a source dtc for use as a testcase, and two formatting
changes to the generated assembly.
I verified the label placement in the asm output and compared the
dts to dtb output with outptut of dts to asm after cc -c ond objcopy
-o binary, the difference was trailing padding of the assembled
version. I also compared the dts to dts output with the dtb to dts
of the assembled version. Although I did not include the assembled
output with the testcase, it should be placed in the test directory
when the samples there are upgraded to version 17.
I have not studied the tests directory since the new libfdt test
suite was merged to evaluate how to test the labels point at the
property.
I choose not to attempt writing the labels when generating dts
output at this time, although I did consider it. The code currently
resolves node references to phandles creating the properties if
needed, so creating dts from dts is already a lossy operation. I
felt there was no benefit in preserving the labels until there is
a method to read and write some kind of symbol or map file of labels
with dtb input and therefore couldn't justify writing the code to
split the data as it is output. Such code could be used to avoid
formatting a list of strings as list of cells or bytes.
I did not provide a method to label the address and size fields of
a memory reserve entry. Although it could be implemented, I didn't
deem it necessary as there is no header before the address field
and placing a label on the size field of a reserve created with the
start-end syntax would be misleading.
I did not include a prefix when generating the labels, matching the
existing labels output on node and property tags. If code is later
added to change the _dt label prefix used in the header to allow
multiple trees to be linked in one program, a prefix should be added
to the labels to create a a seperate namespace for each dts.
milton
^ permalink raw reply
* [PATCH 01/11] dtc: fix asm for version 17
From: Milton Miller @ 2007-07-07 6:18 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <dtc-5-00.miltonm@bga.com>
The version 17 flat device tree format added struct size. When
writing versin 17 assembly output the field must be emitted.
Signed-off-by: Milton Miller <miltonm@bga.com>
---
Found when trying to parse the binary from the assembled output.
Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c 2007-06-14 22:56:59.000000000 -0500
+++ dtc/flattree.c 2007-06-14 22:59:00.000000000 -0500
@@ -477,6 +477,10 @@ void dt_to_asm(FILE *f, struct boot_info
fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
symprefix, symprefix);
+ if (vi->flags & FTF_STRUCTSIZE)
+ fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
+ symprefix, symprefix);
+
/*
* Reserve map entries.
* Align the reserve map to a doubleword boundary.
^ permalink raw reply
* [PATCH 02/11] dtc: move declaration of yyerror
From: Milton Miller @ 2007-07-07 6:18 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <dtc-5-00.miltonm@bga.com>
yyerror() is used by both dtc-parser.y and dtc-lexer.l, so move
the declaration to srcpos.h.
Signed-off-by: Milton Miller <miltonm@bga.com>
---
eliminates implicit declaration warning.
Index: dtc/dtc-parser.y
===================================================================
--- dtc.orig/dtc-parser.y 2007-06-14 23:16:18.000000000 -0500
+++ dtc/dtc-parser.y 2007-06-14 23:16:25.000000000 -0500
@@ -26,7 +26,6 @@
#include "srcpos.h"
int yylex(void);
-void yyerror(char const *);
cell_t cell_from_string(char *s, unsigned int base);
extern struct boot_info *the_boot_info;
Index: dtc/srcpos.h
===================================================================
--- dtc.orig/srcpos.h 2007-06-14 23:16:18.000000000 -0500
+++ dtc/srcpos.h 2007-06-14 23:16:25.000000000 -0500
@@ -62,6 +62,7 @@ typedef struct YYLTYPE {
+extern void yyerror(char const *);
extern int srcpos_filenum;
^ permalink raw reply
* [PATCH 03/11] dtc: complain about unparsed digits in cell lists
From: Milton Miller @ 2007-07-07 6:18 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <dtc-5-00.miltonm@bga.com>
Check that strtoul() parsed the complete string.
As with the number overflow case, write a non-fatal error
message to stdout.
Signed-off-by: Milton Miller <miltonm@bga.com>
---
I saw the FIXME and knew how to fix it.
I think the severity should be higher, but opted for the
detailed error message compared to the fixed string of
yyerror() and its immediate termination of parsing.
Index: dtc/dtc-parser.y
===================================================================
--- dtc.orig/dtc-parser.y 2007-06-14 22:59:04.000000000 -0500
+++ dtc/dtc-parser.y 2007-06-14 23:01:32.000000000 -0500
@@ -192,19 +192,27 @@ void yyerror (char const *s)
* Convert a string representation of a numeric cell
* in the given base into a cell.
*
- * FIXME: The string "abc123", base 10, should be flagged
- * as an error due to the leading "a", but isn't yet.
+ * FIXME: should these specification errors be fatal instead?
*/
cell_t cell_from_string(char *s, unsigned int base)
{
cell_t c;
+ char *e;
+
+ c = strtoul(s, &e, base);
+ if (*e) {
+ fprintf(stderr,
+ "Line %d: Invalid cell value '%s' : "
+ "%c is not a base %d digit; %d assumed\n",
+ yylloc.first_line, s, *e, base, c);
+ }
- c = strtoul(s, NULL, base);
if (errno == EINVAL || errno == ERANGE) {
fprintf(stderr,
"Line %d: Invalid cell value '%s'; %d assumed\n",
yylloc.first_line, s, c);
+ errno = 0;
}
return c;
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox