* [PATCH RFC 1/2] Implementation of pci_fixup_irqs for descendants of a specified bus
From: Bjorn Helgaas @ 2013-01-31 0:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130118113742.GA9006@arm.com>
On Fri, Jan 18, 2013 at 4:37 AM, Andrew Murray <Andrew.Murray@arm.com> wrote:
> Continuing from discussion with Thierry (lkml.org/lkml/2013/1/18/107) perhaps
> this will be useful to fold into your patchset.
> ---
> This patch provides pci_bus_fixup_irqs which performs the same
> function as pci_fixup_irqs but only to descendants of the specified
> bus.
I think pci_fixup_irqs() is a broken design to begin with because it
is only called once at boot-time and it iterates over all the devices
we've found so far. Any hot-added devices never get the fixups.
Adding pci_bus_fixup_irqs() addresses part of that, by adding a way to
fixup a subset of devices, e.g., maybe it could be done for hot-added
things.
But I think it would be better to do a more extensive refactoring and
do the IRQ fixups directly somewhere in the pci_device_add() path.
That way we can do it a device at a time, for every device (present at
boot and hot-added later), and before any drivers claim the device.
> This can reduce unnecessary fixing up of device irqs when new buses
> are added.
>
> Signed-off-by: Andrew Murray <Andrew.Murray@arm.com>
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
> drivers/pci/setup-irq.c | 15 +++++++++++++++
> include/linux/pci.h | 3 +++
> 2 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
> index eb219a1..ea91874 100644
> --- a/drivers/pci/setup-irq.c
> +++ b/drivers/pci/setup-irq.c
> @@ -62,3 +62,18 @@ pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
> for_each_pci_dev(dev)
> pdev_fixup_irq(dev, swizzle, map_irq);
> }
> +
> +void __init
> +pci_bus_fixup_irqs(struct pci_bus *bus,
> + u8 (*swizzle)(struct pci_dev *, u8 *),
> + int (*map_irq)(const struct pci_dev *, u8, u8))
> +{
> + struct pci_dev *dev;
> +
> + list_for_each_entry(dev, &bus->devices, bus_list) {
> + pdev_fixup_irq(dev, swizzle, map_irq);
> +
> + if (dev->subordinate)
> + pci_bus_fixup_irqs(dev->subordinate, swizzle, map_irq);
> + }
> +}
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 5faa831..1b3c2eb 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -953,6 +953,9 @@ void pdev_enable_device(struct pci_dev *);
> int pci_enable_resources(struct pci_dev *, int mask);
> void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
> int (*)(const struct pci_dev *, u8, u8));
> +void pci_bus_fixup_irqs(struct pci_bus *bus,
> + u8 (*swizzle)(struct pci_dev *, u8 *),
> + int (*map_irq)(const struct pci_dev *, u8, u8));
> #define HAVE_PCI_REQ_REGIONS 2
> int __must_check pci_request_regions(struct pci_dev *, const char *);
> int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
> --
> 1.7.0.4
>
>
^ permalink raw reply
* [PATCH] ARM: imx: fix imx31-dt.c time-related warning
From: Shawn Guo @ 2013-01-31 0:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <51094AA4.6040001@wwwdotorg.org>
On Wed, Jan 30, 2013 at 09:30:28AM -0700, Stephen Warren wrote:
> I wasn't sure if the IMX maintainers had any branch based on the
> timer/cleanup branch already. On the off-chance you did, I sent the
> patch to you. If you don't, I can resend to the arm-soc maintainers.
I do not.
Shawn
^ permalink raw reply
* [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock
From: Jason Cooper @ 2013-01-31 0:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130130230518.GA7395@obsidianresearch.com>
On Wed, Jan 30, 2013 at 04:05:18PM -0700, Jason Gunthorpe wrote:
> On Wed, Jan 30, 2013 at 05:43:00PM -0500, Jason Cooper wrote:
> > > On 01/29/2013 09:32 PM, Jason Cooper wrote:
> > > >On Tue, Jan 29, 2013 at 09:08:46PM +0100, Sebastian Hesselbarth wrote:
> > > >>Leaves Issue 3, gbe forgets about its MAC address when gated or powered
> > > >>down. That should be done with local-mac-address passed by DT enabled
> > > >>u-boot or any other (dirty) ATAG hack ;)
> > > >
> > > >A patch to mv643xx_eth to pull this from DT should solve this.
> >
> > Somewhere, Jason Gunthorpe shared his patch to do this. I'll poke
> > around for it and try to get it merged in.
>
> Yes, you asked for the doc update and I haven't had a moment to get a
> tree setup for that..
Ahh, that's right. Sorry, wasn't trying to put pressure on you. Just
trying to make a reminder to myself of what to look for when I get to
around to it. (I have a separate IMAP folder for such things ;-) )
> Here are some words though:
>
> - local-mac-address : Optional, the MAC address to assign to the
> device. If not specified then the MAC address in the HW
> registers is used, but the driver can not be made modular.
I like it. If I haven't seen anything when I get to this, I'll add this
to your patch. Please Ack if it's ok. I prefer not to change peoples
patches without approval.
thx,
Jason.
>
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 7048d7c..2b2cfcb 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2891,6 +2891,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
> struct mv643xx_eth_private *mp;
> struct net_device *dev;
> struct resource *res;
> + const u8 *mac;
> + int len;
> int err;
>
> if (pdev->dev.of_node) {
> @@ -2912,6 +2914,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
> else
> pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
>
> + mac = of_get_property(pdev->dev.of_node, "local-mac-address", &len);
> + if (mac && len == 6)
> + memcpy(pd->mac_addr, mac, sizeof pd->mac_addr);
> +
> np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
> if (np) {
> pd->shared = of_find_device_by_node(np);
> --
> 1.7.5.4
>
^ permalink raw reply
* [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock
From: Jason Cooper @ 2013-01-31 0:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5109AB30.5020202@gmail.com>
On Thu, Jan 31, 2013 at 12:22:24AM +0100, Sebastian Hesselbarth wrote:
> On 01/31/2013 12:01 AM, Jason Cooper wrote:
> >As it stands, there are three patches to fix this issue:
> >
> >ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency
> >ARM: kirkwood: provide ge clock aliases for shared smi
> >ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels
>
> Actually, for the second patch I got distracted by the smi split patch
> set floating around. But that is not in current kernel and smi will not
> request any clock at all.
>
> If Simon can hit another round of testing without second patch included
> and agrees, I suggest to keep it for next release.
Ok, I'll wait for Simon on this. fixes can go anytime, so no rush.
Better to get it right the first (second?) time out.
> >wrt to ge losing mac addresses, both DT and non-DT booting are covered by
> >Sebastian's patches, for non-DT aware mv643xx_eth.
>
> non-DT already ungates ge0/1 clocks on registration and cannot loose its
> mac address, not my fix.
Yes, bad wording on my part. I meant that everything was magically
fixed by Sebastian and that his thesis should be approved without
challenge. ;-)
thx,
Jason.
^ permalink raw reply
* [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
From: Nicolas Pitre @ 2013-01-31 0:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130130232408.GL2637@n2100.arm.linux.org.uk>
On Wed, 30 Jan 2013, Russell King - ARM Linux wrote:
> On Wed, Jan 30, 2013 at 02:07:53PM -0500, Nicolas Pitre wrote:
> > On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
> >
> > > Currently, reading /proc/cpuinfo provides userspace with CPU ID of
> > > the CPU carrying out the read from the file.
> > > Userspace using this information may decide what module
> > > to load or how to configure some specific (and processor-depended)
> > > settings or so.
> > > However, since really different SoCs can share same ARM core,
> > > this information currently is not so useful.
> > > For example, TI OMAP4460 and OMAP4470 SoCs show the same
> > > information in the /proc/cpuinfo whereas they are different.
> > > Since in most cases ARM CPU is a part of some system on a chip (SoC),
> > > the "cpuinfo" file looks like exactly that place, where this
> > > information have to be displayed.
> > >
> > > So added new line "SoC name" in the "cpuinfo" output for system
> > > on a chip name. It is placed between CPU information and machine
> > > information, so the file structure looks gracefully (CPU-SoC-Hardware)
> > >
> > > Example:
> > >
> > > / # cat proc/cpuinfo
> > > [...]
> > > CPU variant : 0x2
> > > CPU part : 0xc09
> > > CPU revision : 10
> > >
> > > SoC name : OMAP4470
> > >
> > > Hardware : OMAP4 Blaze Tablet
> >
> > Please remove that extra blank line between "SoC name" and "Hardware".
> > The blank line after "CPU revision" is fine.
> >
> > Also, please rename this to "System name". Not all systems are "on
> > chip". By using "System name" this is more universally useful.
>
> You may notice I've already suggested that this should be using the SoC
> infrastructure to export this information, which was explicitly designed
> to do this.
Absolutely. If a mechanism is already in place then it should be used.
Nicolas
^ permalink raw reply
* [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock
From: Jason Gunthorpe @ 2013-01-31 0:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130131002916.GW7717@titan.lakedaemon.net>
On Wed, Jan 30, 2013 at 07:29:16PM -0500, Jason Cooper wrote:
> > Yes, you asked for the doc update and I haven't had a moment to get a
> > tree setup for that..
>
> Ahh, that's right. Sorry, wasn't trying to put pressure on you. Just
> trying to make a reminder to myself of what to look for when I get to
> around to it. (I have a separate IMAP folder for such things ;-) )
No worries, right now I'm in a spot where the lastest ARM stuff has
diverged so much that it is a major job to get my custom board working
against the latest tree, so I'm kinda stuck waiting on some spare
time/things to settle out...
> > Here are some words though:
> >
> > - local-mac-address : Optional, the MAC address to assign to the
> > device. If not specified then the MAC address in the HW
> > registers is used, but the driver can not be made modular.
>
> I like it. If I haven't seen anything when I get to this, I'll add this
> to your patch. Please Ack if it's ok. I prefer not to change peoples
> patches without approval.
Please feel free to merge this text and the patch into Ian's DT patch,
or rebase ontop of the latest version as you like:
Signed-off-by: Jason Gunthorpe
Thanks for sorting this ethernet stuff!
Jason
^ permalink raw reply
* [PATCH 2/6] ARM: cache: remove ARMv3 support code
From: Hyok S. Choi @ 2013-01-31 0:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359556069-28289-3-git-send-email-will.deacon@arm.com>
I know there is no v3 architecture in current platforms in mainline tree,
but can we _remove_ v3 support codes? IOW, Is there no platform port users
for ARM7 nommu families(such as ARM700 or ARM710)?
-----Original Message-----
From: Will Deacon [mailto:will.deacon at arm.com]
Sent: Wednesday, January 30, 2013 11:28 PM
To: linux-arm-kernel at lists.infradead.org
Cc: Will Deacon; Hyok S. Choi; Greg Ungerer
Subject: [PATCH 2/6] ARM: cache: remove ARMv3 support code
This is only used by 740t, which is a v4 core and (by my reading of the
datasheet for the CPU) ignores CRm for the cp15 cache flush operation,
making the v4 cache implementation in cache-v4.S sufficient for this CPU.
Tested with 740T core-tile on Integrator/AP baseboard.
Cc: Hyok S. Choi <hyok.choi@samsung.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/include/asm/glue-cache.h | 8 ---
arch/arm/mm/Kconfig | 5 +-
arch/arm/mm/Makefile | 1 -
arch/arm/mm/cache-v3.S | 137
--------------------------------------
arch/arm/mm/proc-arm740.S | 2 +-
5 files changed, 2 insertions(+), 151 deletions(-) delete mode 100644
arch/arm/mm/cache-v3.S
diff --git a/arch/arm/include/asm/glue-cache.h
b/arch/arm/include/asm/glue-cache.h
index cca9f15..ea289e1 100644
--- a/arch/arm/include/asm/glue-cache.h
+++ b/arch/arm/include/asm/glue-cache.h
@@ -19,14 +19,6 @@
#undef _CACHE
#undef MULTI_CACHE
-#if defined(CONFIG_CPU_CACHE_V3)
-# ifdef _CACHE
-# define MULTI_CACHE 1
-# else
-# define _CACHE v3
-# endif
-#endif
-
#if defined(CONFIG_CPU_CACHE_V4)
# ifdef _CACHE
# define MULTI_CACHE 1
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index
3fd629d..c430f46 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -43,7 +43,7 @@ config CPU_ARM740T
depends on !MMU
select CPU_32v4T
select CPU_ABRT_LV4T
- select CPU_CACHE_V3 # although the core is v4t
+ select CPU_CACHE_V4
select CPU_CP15_MPU
select CPU_PABRT_LEGACY
help
@@ -469,9 +469,6 @@ config CPU_PABRT_V7
bool
# The cache model
-config CPU_CACHE_V3
- bool
-
config CPU_CACHE_V4
bool
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index
8a9c4cb..c0fd3c1 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_CPU_PABRT_LEGACY) += pabort-legacy.o
obj-$(CONFIG_CPU_PABRT_V6) += pabort-v6.o
obj-$(CONFIG_CPU_PABRT_V7) += pabort-v7.o
-obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o
obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o
obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S deleted file
mode 100644 index 8a3fade..0000000
--- a/arch/arm/mm/cache-v3.S
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * linux/arch/arm/mm/cache-v3.S
- *
- * Copyright (C) 1997-2002 Russell king
- *
- * 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.
- */
-#include <linux/linkage.h>
-#include <linux/init.h>
-#include <asm/page.h>
-#include "proc-macros.S"
-
-/*
- * flush_icache_all()
- *
- * Unconditionally clean and invalidate the entire icache.
- */
-ENTRY(v3_flush_icache_all)
- mov pc, lr
-ENDPROC(v3_flush_icache_all)
-
-/*
- * flush_user_cache_all()
- *
- * Invalidate all cache entries in a particular address
- * space.
- *
- * - mm - mm_struct describing address space
- */
-ENTRY(v3_flush_user_cache_all)
- /* FALLTHROUGH */
-/*
- * flush_kern_cache_all()
- *
- * Clean and invalidate the entire cache.
- */
-ENTRY(v3_flush_kern_cache_all)
- /* FALLTHROUGH */
-
-/*
- * flush_user_cache_range(start, end, flags)
- *
- * Invalidate a range of cache entries in the specified
- * address space.
- *
- * - start - start address (may not be aligned)
- * - end - end address (exclusive, may not be aligned)
- * - flags - vma_area_struct flags describing address space
- */
-ENTRY(v3_flush_user_cache_range)
- mov ip, #0
- mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
- mov pc, lr
-
-/*
- * coherent_kern_range(start, end)
- *
- * Ensure coherency between the Icache and the Dcache in the
- * region described by start. If you have non-snooping
- * Harvard caches, you need to implement this function.
- *
- * - start - virtual start address
- * - end - virtual end address
- */
-ENTRY(v3_coherent_kern_range)
- /* FALLTHROUGH */
-
-/*
- * coherent_user_range(start, end)
- *
- * Ensure coherency between the Icache and the Dcache in the
- * region described by start. If you have non-snooping
- * Harvard caches, you need to implement this function.
- *
- * - start - virtual start address
- * - end - virtual end address
- */
-ENTRY(v3_coherent_user_range)
- mov r0, #0
- mov pc, lr
-
-/*
- * flush_kern_dcache_area(void *page, size_t size)
- *
- * Ensure no D cache aliasing occurs, either with itself or
- * the I cache
- *
- * - addr - kernel address
- * - size - region size
- */
-ENTRY(v3_flush_kern_dcache_area)
- /* FALLTHROUGH */
-
-/*
- * dma_flush_range(start, end)
- *
- * Clean and invalidate the specified virtual address range.
- *
- * - start - virtual start address
- * - end - virtual end address
- */
-ENTRY(v3_dma_flush_range)
- mov r0, #0
- mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
- mov pc, lr
-
-/*
- * dma_unmap_area(start, size, dir)
- * - start - kernel virtual start address
- * - size - size of region
- * - dir - DMA direction
- */
-ENTRY(v3_dma_unmap_area)
- teq r2, #DMA_TO_DEVICE
- bne v3_dma_flush_range
- /* FALLTHROUGH */
-
-/*
- * dma_map_area(start, size, dir)
- * - start - kernel virtual start address
- * - size - size of region
- * - dir - DMA direction
- */
-ENTRY(v3_dma_map_area)
- mov pc, lr
-ENDPROC(v3_dma_unmap_area)
-ENDPROC(v3_dma_map_area)
-
- .globl v3_flush_kern_cache_louis
- .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all
-
- __INITDATA
-
- @ define struct cpu_cache_fns (see <asm/cacheflush.h> and
proc-macros.S)
- define_cache_functions v3
diff --git a/arch/arm/mm/proc-arm740.S b/arch/arm/mm/proc-arm740.S index
dc5de5d..2088234 100644
--- a/arch/arm/mm/proc-arm740.S
+++ b/arch/arm/mm/proc-arm740.S
@@ -145,5 +145,5 @@ __arm740_proc_info:
.long arm740_processor_functions
.long 0
.long 0
- .long v3_cache_fns @ cache model
+ .long v4_cache_fns @ cache model
.size __arm740_proc_info, . - __arm740_proc_info
--
1.8.0
^ permalink raw reply related
* [PATCH v2 1/2] ARM: kirkwood: Ensure that kirkwood_ge0[01]_init() finds its clock
From: Jason Cooper @ 2013-01-31 0:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130130231552.GA7915@obsidianresearch.com>
On Wed, Jan 30, 2013 at 04:15:52PM -0700, Jason Gunthorpe wrote:
> On Wed, Jan 30, 2013 at 06:01:00PM -0500, Jason Cooper wrote:
>
> > Once we add proper DT support to mv643xx_eth, the local-mac-address will
> > need to be defined in the dtb. We should probably poke the other Jason
> > to see if there is a cooresponding u-boot patch to his local-mac-address
> > patch.
>
> Sorry I don't have a u-boot fix, we don't use u-boot here - but
> local-mac-address is common on other ARM drivers so I'd hope there is
> a u-boot facility for stuffing it already?
a quick search of the u-boot source reveals common/fdt_support.c:477:
do_fixup_by_path(fdt, path, "local-mac-address",
&mac_addr, 6, 1);
which is indeed called from bootm if u-boot is compiled with OF_LIBFDT.
I'll test this when I work on the mv643xx_eth DT binding series.
thx,
Jason.
^ permalink raw reply
* [PATCH v3 2/2] ARM: dove: split legacy and DT setup
From: Jason Cooper @ 2013-01-31 0:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359495695-29304-1-git-send-email-sebastian.hesselbarth@gmail.com>
On Tue, Jan 29, 2013 at 10:41:35PM +0100, Sebastian Hesselbarth wrote:
> In the beginning of DT for Dove it was reasonable to have it close to
> non-DT code. With improved DT support, it became more and more difficult
> to not break non-DT while changing DT code.
>
> This patch splits up DT board setup and introduces a DOVE_LEGACY config
> to allow to remove legacy code for DT-only kernels.
>
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Changelog:
> [v3]
> - also include new board-dt.c file that was missing in v2 of patch [2/2]
> (patch [1/2] has not changed and is not resent)
>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> ---
> arch/arm/mach-dove/Kconfig | 5 ++
> arch/arm/mach-dove/Makefile | 4 +-
> arch/arm/mach-dove/board-dt.c | 103 +++++++++++++++++++++++++++++++++++++++++
> arch/arm/mach-dove/common.c | 90 -----------------------------------
> arch/arm/mach-dove/common.h | 1 +
> 5 files changed, 112 insertions(+), 91 deletions(-)
> create mode 100644 arch/arm/mach-dove/board-dt.c
Applied to mvebu/boards
thx,
Jason.
^ permalink raw reply
* [PATCH v4 0/3] introduce static_vm for ARM-specific static mapped area
From: Joonsoo Kim @ 2013-01-31 1:00 UTC (permalink / raw)
To: linux-arm-kernel
In current implementation, we used ARM-specific flag, that is,
VM_ARM_STATIC_MAPPING, for distinguishing ARM specific static mapped area.
The purpose of static mapped area is to re-use static mapped area when
entire physical address range of the ioremap request can be covered
by this area.
This implementation causes needless overhead for some cases.
For example, assume that there is only one static mapped area and
vmlist has 300 areas. Every time we call ioremap, we check 300 areas for
deciding whether it is matched or not. Moreover, even if there is
no static mapped area and vmlist has 300 areas, every time we call
ioremap, we check 300 areas in now.
If we construct a extra list for static mapped area, we can eliminate
above mentioned overhead.
With a extra list, if there is one static mapped area,
we just check only one area and proceed next operation quickly.
In fact, it is not a critical problem, because ioremap is not frequently
used. But reducing overhead is better idea.
Another reason for doing this work is for removing vm_struct list management,
entirely. For more information, look at the following link.
http://lkml.org/lkml/2012/12/6/184
Changelog
v3->v4:
[2/3]: Changes from Nicolas' suggestion
- embed static_vm code in ioremap.c
- simplify struct static_vm
- remove init_static_vm, instead, add_static_vm_early() init static_vm
Use generic list for list management of static_vm
Convert spin_lock to rw_lock
Modify static_vm's flags bits
[3/3]: Rework according to [2/3] change
Rebased on v3.8-rc5
v2->v3:
coverletter: refer a link related to this work
[2/3]: drop @flags of find_static_vm_vaddr
Rebased on v3.8-rc4
v1->v2:
[2/3]: patch description is improved.
Rebased on v3.7-rc7
Joonsoo Kim (3):
ARM: vmregion: remove vmregion code entirely
ARM: ioremap: introduce an infrastructure for static mapped area
ARM: mm: use static_vm for managing static mapped areas
arch/arm/mm/Makefile | 2 +-
arch/arm/mm/ioremap.c | 147 +++++++++++++++++++++++-----------
arch/arm/mm/mm.h | 28 ++++---
arch/arm/mm/mmu.c | 47 ++++++-----
arch/arm/mm/vmregion.c | 205 ------------------------------------------------
arch/arm/mm/vmregion.h | 31 --------
6 files changed, 147 insertions(+), 313 deletions(-)
delete mode 100644 arch/arm/mm/vmregion.c
delete mode 100644 arch/arm/mm/vmregion.h
--
1.7.9.5
^ permalink raw reply
* [PATCH v4 1/3] ARM: vmregion: remove vmregion code entirely
From: Joonsoo Kim @ 2013-01-31 1:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359594008-14688-1-git-send-email-iamjoonsoo.kim@lge.com>
Now, there is no user for vmregion.
So remove it.
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 8a9c4cb..4e333fa 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -6,7 +6,7 @@ obj-y := dma-mapping.o extable.o fault.o init.o \
iomap.o
obj-$(CONFIG_MMU) += fault-armv.o flush.o idmap.o ioremap.o \
- mmap.o pgd.o mmu.o vmregion.o
+ mmap.o pgd.o mmu.o
ifneq ($(CONFIG_MMU),y)
obj-y += nommu.o
diff --git a/arch/arm/mm/vmregion.c b/arch/arm/mm/vmregion.c
deleted file mode 100644
index a631016..0000000
--- a/arch/arm/mm/vmregion.c
+++ /dev/null
@@ -1,205 +0,0 @@
-#include <linux/fs.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/slab.h>
-
-#include "vmregion.h"
-
-/*
- * VM region handling support.
- *
- * This should become something generic, handling VM region allocations for
- * vmalloc and similar (ioremap, module space, etc).
- *
- * I envisage vmalloc()'s supporting vm_struct becoming:
- *
- * struct vm_struct {
- * struct vmregion region;
- * unsigned long flags;
- * struct page **pages;
- * unsigned int nr_pages;
- * unsigned long phys_addr;
- * };
- *
- * get_vm_area() would then call vmregion_alloc with an appropriate
- * struct vmregion head (eg):
- *
- * struct vmregion vmalloc_head = {
- * .vm_list = LIST_HEAD_INIT(vmalloc_head.vm_list),
- * .vm_start = VMALLOC_START,
- * .vm_end = VMALLOC_END,
- * };
- *
- * However, vmalloc_head.vm_start is variable (typically, it is dependent on
- * the amount of RAM found at boot time.) I would imagine that get_vm_area()
- * would have to initialise this each time prior to calling vmregion_alloc().
- */
-
-struct arm_vmregion *
-arm_vmregion_alloc(struct arm_vmregion_head *head, size_t align,
- size_t size, gfp_t gfp, const void *caller)
-{
- unsigned long start = head->vm_start, addr = head->vm_end;
- unsigned long flags;
- struct arm_vmregion *c, *new;
-
- if (head->vm_end - head->vm_start < size) {
- printk(KERN_WARNING "%s: allocation too big (requested %#x)\n",
- __func__, size);
- goto out;
- }
-
- new = kmalloc(sizeof(struct arm_vmregion), gfp);
- if (!new)
- goto out;
-
- new->caller = caller;
-
- spin_lock_irqsave(&head->vm_lock, flags);
-
- addr = rounddown(addr - size, align);
- list_for_each_entry_reverse(c, &head->vm_list, vm_list) {
- if (addr >= c->vm_end)
- goto found;
- addr = rounddown(c->vm_start - size, align);
- if (addr < start)
- goto nospc;
- }
-
- found:
- /*
- * Insert this entry after the one we found.
- */
- list_add(&new->vm_list, &c->vm_list);
- new->vm_start = addr;
- new->vm_end = addr + size;
- new->vm_active = 1;
-
- spin_unlock_irqrestore(&head->vm_lock, flags);
- return new;
-
- nospc:
- spin_unlock_irqrestore(&head->vm_lock, flags);
- kfree(new);
- out:
- return NULL;
-}
-
-static struct arm_vmregion *__arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
-{
- struct arm_vmregion *c;
-
- list_for_each_entry(c, &head->vm_list, vm_list) {
- if (c->vm_active && c->vm_start == addr)
- goto out;
- }
- c = NULL;
- out:
- return c;
-}
-
-struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *head, unsigned long addr)
-{
- struct arm_vmregion *c;
- unsigned long flags;
-
- spin_lock_irqsave(&head->vm_lock, flags);
- c = __arm_vmregion_find(head, addr);
- spin_unlock_irqrestore(&head->vm_lock, flags);
- return c;
-}
-
-struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *head, unsigned long addr)
-{
- struct arm_vmregion *c;
- unsigned long flags;
-
- spin_lock_irqsave(&head->vm_lock, flags);
- c = __arm_vmregion_find(head, addr);
- if (c)
- c->vm_active = 0;
- spin_unlock_irqrestore(&head->vm_lock, flags);
- return c;
-}
-
-void arm_vmregion_free(struct arm_vmregion_head *head, struct arm_vmregion *c)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&head->vm_lock, flags);
- list_del(&c->vm_list);
- spin_unlock_irqrestore(&head->vm_lock, flags);
-
- kfree(c);
-}
-
-#ifdef CONFIG_PROC_FS
-static int arm_vmregion_show(struct seq_file *m, void *p)
-{
- struct arm_vmregion *c = list_entry(p, struct arm_vmregion, vm_list);
-
- seq_printf(m, "0x%08lx-0x%08lx %7lu", c->vm_start, c->vm_end,
- c->vm_end - c->vm_start);
- if (c->caller)
- seq_printf(m, " %pS", (void *)c->caller);
- seq_putc(m, '\n');
- return 0;
-}
-
-static void *arm_vmregion_start(struct seq_file *m, loff_t *pos)
-{
- struct arm_vmregion_head *h = m->private;
- spin_lock_irq(&h->vm_lock);
- return seq_list_start(&h->vm_list, *pos);
-}
-
-static void *arm_vmregion_next(struct seq_file *m, void *p, loff_t *pos)
-{
- struct arm_vmregion_head *h = m->private;
- return seq_list_next(p, &h->vm_list, pos);
-}
-
-static void arm_vmregion_stop(struct seq_file *m, void *p)
-{
- struct arm_vmregion_head *h = m->private;
- spin_unlock_irq(&h->vm_lock);
-}
-
-static const struct seq_operations arm_vmregion_ops = {
- .start = arm_vmregion_start,
- .stop = arm_vmregion_stop,
- .next = arm_vmregion_next,
- .show = arm_vmregion_show,
-};
-
-static int arm_vmregion_open(struct inode *inode, struct file *file)
-{
- struct arm_vmregion_head *h = PDE(inode)->data;
- int ret = seq_open(file, &arm_vmregion_ops);
- if (!ret) {
- struct seq_file *m = file->private_data;
- m->private = h;
- }
- return ret;
-}
-
-static const struct file_operations arm_vmregion_fops = {
- .open = arm_vmregion_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release,
-};
-
-int arm_vmregion_create_proc(const char *path, struct arm_vmregion_head *h)
-{
- proc_create_data(path, S_IRUSR, NULL, &arm_vmregion_fops, h);
- return 0;
-}
-#else
-int arm_vmregion_create_proc(const char *path, struct arm_vmregion_head *h)
-{
- return 0;
-}
-#endif
diff --git a/arch/arm/mm/vmregion.h b/arch/arm/mm/vmregion.h
deleted file mode 100644
index 0f5a5f2..0000000
--- a/arch/arm/mm/vmregion.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef VMREGION_H
-#define VMREGION_H
-
-#include <linux/spinlock.h>
-#include <linux/list.h>
-
-struct page;
-
-struct arm_vmregion_head {
- spinlock_t vm_lock;
- struct list_head vm_list;
- unsigned long vm_start;
- unsigned long vm_end;
-};
-
-struct arm_vmregion {
- struct list_head vm_list;
- unsigned long vm_start;
- unsigned long vm_end;
- int vm_active;
- const void *caller;
-};
-
-struct arm_vmregion *arm_vmregion_alloc(struct arm_vmregion_head *, size_t, size_t, gfp_t, const void *);
-struct arm_vmregion *arm_vmregion_find(struct arm_vmregion_head *, unsigned long);
-struct arm_vmregion *arm_vmregion_find_remove(struct arm_vmregion_head *, unsigned long);
-void arm_vmregion_free(struct arm_vmregion_head *, struct arm_vmregion *);
-
-int arm_vmregion_create_proc(const char *, struct arm_vmregion_head *);
-
-#endif
--
1.7.9.5
^ permalink raw reply related
* [PATCH v4 2/3] ARM: ioremap: introduce an infrastructure for static mapped area
From: Joonsoo Kim @ 2013-01-31 1:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359594008-14688-1-git-send-email-iamjoonsoo.kim@lge.com>
In current implementation, we used ARM-specific flag, that is,
VM_ARM_STATIC_MAPPING, for distinguishing ARM specific static mapped area.
The purpose of static mapped area is to re-use static mapped area when
entire physical address range of the ioremap request can be covered
by this area.
This implementation causes needless overhead for some cases.
For example, assume that there is only one static mapped area and
vmlist has 300 areas. Every time we call ioremap, we check 300 areas for
deciding whether it is matched or not. Moreover, even if there is
no static mapped area and vmlist has 300 areas, every time we call
ioremap, we check 300 areas in now.
If we construct a extra list for static mapped area, we can eliminate
above mentioned overhead.
With a extra list, if there is one static mapped area,
we just check only one area and proceed next operation quickly.
In fact, it is not a critical problem, because ioremap is not frequently
used. But reducing overhead is better idea.
Another reason for doing this work is for removing architecture dependency
on vmalloc layer. I think that vmlist and vmlist_lock is internal data
structure for vmalloc layer. Some codes for debugging and stat inevitably
use vmlist and vmlist_lock. But it is preferable that they are used
as least as possible in outside of vmalloc.c
Now, I introduce an ARM-specific infrastructure for static mapped area. In
the following patch, we will use this and resolve above mentioned problem.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 88fd86c..ceb34ae 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -39,6 +39,78 @@
#include <asm/mach/pci.h>
#include "mm.h"
+
+LIST_HEAD(static_vmlist);
+static DEFINE_RWLOCK(static_vmlist_lock);
+
+static struct static_vm *find_static_vm_paddr(phys_addr_t paddr,
+ size_t size, unsigned long flags)
+{
+ struct static_vm *svm;
+ struct vm_struct *vm;
+
+ read_lock(&static_vmlist_lock);
+ list_for_each_entry(svm, &static_vmlist, list) {
+ if (svm->flags != flags)
+ continue;
+
+ vm = &svm->vm;
+ if (vm->phys_addr > paddr ||
+ paddr + size - 1 > vm->phys_addr + vm->size - 1)
+ continue;
+
+ read_unlock(&static_vmlist_lock);
+ return svm;
+ }
+
+ return NULL;
+}
+
+struct static_vm *find_static_vm_vaddr(void *vaddr)
+{
+ struct static_vm *svm;
+ struct vm_struct *vm;
+
+ read_lock(&static_vmlist_lock);
+ list_for_each_entry(svm, &static_vmlist, list) {
+ vm = &svm->vm;
+
+ /* static_vmlist is ascending order */
+ if (vm->addr > vaddr)
+ break;
+
+ if (vm->addr <= vaddr && vm->addr + vm->size > vaddr) {
+ read_unlock(&static_vmlist_lock);
+ return svm;
+ }
+ }
+ read_unlock(&static_vmlist_lock);
+
+ return NULL;
+}
+
+void add_static_vm_early(struct static_vm *svm, unsigned long flags)
+{
+ struct static_vm *curr_svm;
+ struct vm_struct *vm;
+ void *vaddr;
+
+ vm_area_add_early(&svm->vm);
+
+ vaddr = svm->vm.addr;
+ svm->flags = flags;
+
+ write_lock(&static_vmlist_lock);
+ list_for_each_entry(curr_svm, &static_vmlist, list) {
+ vm = &curr_svm->vm;
+
+ if (vm->addr > vaddr)
+ break;
+ }
+ list_add_tail(&svm->list, &curr_svm->list);
+ write_unlock(&static_vmlist_lock);
+}
+
int ioremap_page(unsigned long virt, unsigned long phys,
const struct mem_type *mtype)
{
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index a8ee92d..fb45c79 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -1,4 +1,6 @@
#ifdef CONFIG_MMU
+#include <linux/list.h>
+#include <linux/vmalloc.h>
/* the upper-most page table pointer */
extern pmd_t *top_pmd;
@@ -65,6 +67,24 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
/* consistent regions used by dma_alloc_attrs() */
#define VM_ARM_DMA_CONSISTENT 0x20000000
+
+/* ARM specific static_vm->flags bits */
+#define STATIC_VM_MEM 0x00000001
+#define STATIC_VM_EMPTY 0x00000002
+#define STATIC_VM_MTYPE(mtype) ((mtype) << 20)
+
+#define STATIC_VM_TYPE(type, mtype) (type | STATIC_VM_MTYPE(mtype))
+
+struct static_vm {
+ struct vm_struct vm;
+ struct list_head list;
+ unsigned long flags;
+};
+
+extern struct list_head static_vmlist;
+extern struct static_vm *find_static_vm_vaddr(void *vaddr);
+extern void add_static_vm_early(struct static_vm *svm, unsigned long flags);
+
#endif
#ifdef CONFIG_ZONE_DMA
--
1.7.9.5
^ permalink raw reply related
* [PATCH v4 3/3] ARM: mm: use static_vm for managing static mapped areas
From: Joonsoo Kim @ 2013-01-31 1:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359594008-14688-1-git-send-email-iamjoonsoo.kim@lge.com>
A static mapped area is ARM-specific, so it is better not to use
generic vmalloc data structure, that is, vmlist and vmlist_lock
for managing static mapped area. And it causes some needless overhead and
reducing this overhead is better idea.
Now, we have newly introduced static_vm infrastructure.
With it, we don't need to iterate all mapped areas. Instead, we just
iterate static mapped areas. It helps to reduce an overhead of finding
matched area. And architecture dependency on vmalloc layer is removed,
so it will help to maintainability for vmalloc layer.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ceb34ae..7fe5b48 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -269,13 +269,14 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
const struct mem_type *type;
int err;
unsigned long addr;
- struct vm_struct * area;
+ struct vm_struct *area;
+ phys_addr_t paddr = __pfn_to_phys(pfn);
#ifndef CONFIG_ARM_LPAE
/*
* High mappings must be supersection aligned
*/
- if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
+ if (pfn >= 0x100000 && (paddr & ~SUPERSECTION_MASK))
return NULL;
#endif
@@ -291,24 +292,17 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
/*
* Try to reuse one of the static mapping whenever possible.
*/
- read_lock(&vmlist_lock);
- for (area = vmlist; area; area = area->next) {
- if (!size || (sizeof(phys_addr_t) == 4 && pfn >= 0x100000))
- break;
- if (!(area->flags & VM_ARM_STATIC_MAPPING))
- continue;
- if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
- continue;
- if (__phys_to_pfn(area->phys_addr) > pfn ||
- __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
- continue;
- /* we can drop the lock here as we know *area is static */
- read_unlock(&vmlist_lock);
- addr = (unsigned long)area->addr;
- addr += __pfn_to_phys(pfn) - area->phys_addr;
- return (void __iomem *) (offset + addr);
+ if (size && !((sizeof(phys_addr_t) == 4 && pfn >= 0x100000))) {
+ struct static_vm *svm;
+
+ svm = find_static_vm_paddr(paddr, size,
+ STATIC_VM_TYPE(STATIC_VM_MEM, mtype));
+ if (svm) {
+ addr = (unsigned long)svm->vm.addr;
+ addr += paddr - svm->vm.phys_addr;
+ return (void __iomem *) (offset + addr);
+ }
}
- read_unlock(&vmlist_lock);
/*
* Don't allow RAM to be mapped - this causes problems with ARMv6+
@@ -320,21 +314,21 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
if (!area)
return NULL;
addr = (unsigned long)area->addr;
- area->phys_addr = __pfn_to_phys(pfn);
+ area->phys_addr = paddr;
#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
if (DOMAIN_IO == 0 &&
(((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
cpu_is_xsc3()) && pfn >= 0x100000 &&
- !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
+ !((paddr | size | addr) & ~SUPERSECTION_MASK)) {
area->flags |= VM_ARM_SECTION_MAPPING;
err = remap_area_supersections(addr, pfn, size, type);
- } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) {
+ } else if (!((paddr | size | addr) & ~PMD_MASK)) {
area->flags |= VM_ARM_SECTION_MAPPING;
err = remap_area_sections(addr, pfn, size, type);
} else
#endif
- err = ioremap_page_range(addr, addr + size, __pfn_to_phys(pfn),
+ err = ioremap_page_range(addr, addr + size, paddr,
__pgprot(type->prot_pte));
if (err) {
@@ -418,34 +412,21 @@ __arm_ioremap_exec(unsigned long phys_addr, size_t size, bool cached)
void __iounmap(volatile void __iomem *io_addr)
{
void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
- struct vm_struct *vm;
+ struct static_vm *svm;
+
+ svm = find_static_vm_vaddr(addr);
+ if (svm)
+ return;
- read_lock(&vmlist_lock);
- for (vm = vmlist; vm; vm = vm->next) {
- if (vm->addr > addr)
- break;
- if (!(vm->flags & VM_IOREMAP))
- continue;
- /* If this is a static mapping we must leave it alone */
- if ((vm->flags & VM_ARM_STATIC_MAPPING) &&
- (vm->addr <= addr) && (vm->addr + vm->size > addr)) {
- read_unlock(&vmlist_lock);
- return;
- }
#if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE)
- /*
- * If this is a section based mapping we need to handle it
- * specially as the VM subsystem does not know how to handle
- * such a beast.
- */
- if ((vm->addr == addr) &&
- (vm->flags & VM_ARM_SECTION_MAPPING)) {
+ {
+ struct vm_struct *vm;
+
+ vm = find_vm_area(addr);
+ if (vm && (vm->flags & VM_ARM_SECTION_MAPPING))
unmap_area_sections((unsigned long)vm->addr, vm->size);
- break;
- }
-#endif
}
- read_unlock(&vmlist_lock);
+#endif
vunmap(addr);
}
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index fb45c79..24c1df4 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -54,16 +54,6 @@ extern void __flush_dcache_page(struct address_space *mapping, struct page *page
/* (super)section-mapped I/O regions used by ioremap()/iounmap() */
#define VM_ARM_SECTION_MAPPING 0x80000000
-/* permanent static mappings from iotable_init() */
-#define VM_ARM_STATIC_MAPPING 0x40000000
-
-/* empty mapping */
-#define VM_ARM_EMPTY_MAPPING 0x20000000
-
-/* mapping type (attributes) for permanent static mappings */
-#define VM_ARM_MTYPE(mt) ((mt) << 20)
-#define VM_ARM_MTYPE_MASK (0x1f << 20)
-
/* consistent regions used by dma_alloc_attrs() */
#define VM_ARM_DMA_CONSISTENT 0x20000000
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index ce328c7..a7dc9a2 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -757,21 +757,24 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
{
struct map_desc *md;
struct vm_struct *vm;
+ struct static_vm *svm;
if (!nr)
return;
- vm = early_alloc_aligned(sizeof(*vm) * nr, __alignof__(*vm));
+ svm = early_alloc_aligned(sizeof(*svm) * nr, __alignof__(*svm));
for (md = io_desc; nr; md++, nr--) {
create_mapping(md);
+
+ vm = &svm->vm;
vm->addr = (void *)(md->virtual & PAGE_MASK);
vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
vm->phys_addr = __pfn_to_phys(md->pfn);
- vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
- vm->flags |= VM_ARM_MTYPE(md->type);
+ vm->flags = VM_IOREMAP;
vm->caller = iotable_init;
- vm_area_add_early(vm++);
+ add_static_vm_early(svm++,
+ STATIC_VM_TYPE(STATIC_VM_MEM, md->type));
}
}
@@ -779,13 +782,16 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
void *caller)
{
struct vm_struct *vm;
+ struct static_vm *svm;
+
+ svm = early_alloc_aligned(sizeof(*svm), __alignof__(*svm));
- vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
+ vm = &svm->vm;
vm->addr = (void *)addr;
vm->size = size;
- vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
+ vm->flags = VM_IOREMAP;
vm->caller = caller;
- vm_area_add_early(vm);
+ add_static_vm_early(svm, STATIC_VM_TYPE(STATIC_VM_EMPTY, 0));
}
#ifndef CONFIG_ARM_LPAE
@@ -810,14 +816,20 @@ static void __init pmd_empty_section_gap(unsigned long addr)
static void __init fill_pmd_gaps(void)
{
+ struct static_vm *svm;
struct vm_struct *vm;
unsigned long addr, next = 0;
pmd_t *pmd;
- /* we're still single threaded hence no lock needed here */
- for (vm = vmlist; vm; vm = vm->next) {
- if (!(vm->flags & (VM_ARM_STATIC_MAPPING | VM_ARM_EMPTY_MAPPING)))
- continue;
+ /*
+ * We should not take a lock here, because pmd_empty_section_gap()
+ * invokes vm_reserve_area_early(), and then it call
+ * add_static_vm_early() which try to take a lock.
+ * We're still single thread, so traverse whole list without a lock
+ * is safe for now. And inserting new entry is also safe.
+ */
+ list_for_each_entry(svm, &static_vmlist, list) {
+ vm = &svm->vm;
addr = (unsigned long)vm->addr;
if (addr < next)
continue;
@@ -859,17 +871,12 @@ static void __init pci_reserve_io(void)
{
struct vm_struct *vm;
unsigned long addr;
+ struct static_vm *svm;
- /* we're still single threaded hence no lock needed here */
- for (vm = vmlist; vm; vm = vm->next) {
- if (!(vm->flags & VM_ARM_STATIC_MAPPING))
- continue;
- addr = (unsigned long)vm->addr;
- addr &= ~(SZ_2M - 1);
- if (addr == PCI_IO_VIRT_BASE)
- return;
+ svm = find_static_vm_vaddr((void *)PCI_IO_VIRT_BASE);
+ if (svm)
+ return;
- }
vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
}
#else
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 1/3] arm: mvebu: Add support for USB host controllers in Armada 370/XP
From: Nobuhiro Iwamatsu @ 2013-01-31 1:19 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CALF0-+Vg1WZA3m9G7mLU92BBuDpGLG-pmMM=XHtGm2UwnXXLUw@mail.gmail.com>
Hi, Ezequiel.
I checked with your first patch, that is no ploblem.
you dont need to change patch.
sorry for my noise.
best regards,
Nobuhiro
On Wed, Jan 30, 2013 at 3:56 AM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> Hi Jason,
>
> On Wed, Jan 23, 2013 at 2:40 PM, Jason Cooper <jason@lakedaemon.net> wrote:
>> On Wed, Jan 23, 2013 at 02:06:12PM -0300, Ezequiel Garcia wrote:
>>> Jason,
>>>
>>> On Wed, Jan 23, 2013 at 12:26 PM, Ezequiel Garcia <ezequiel.garcia@free-electrons.com> wrote:
>>> > The Armada 370 and Armada XP SoC has an Orion EHCI USB controller.
>>> > This patch adds support for this controller in Armada 370
>>> > and Armada XP SoC common device tree files.
>>> >
>>> > Cc: Lior Amsalem <alior@marvell.com>
>>> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>>> > Tested-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
>>> > Tested-by: Florian Fainelli <florian@openwrt.org>
>>> > Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>>> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
>>> > ---
>>> > Changes from v1:
>>> > * Remove uneeded USB_ARCH_HAS_EHCI selection as noted by Florian.
>>> >
>>> > arch/arm/boot/dts/armada-370-xp.dtsi | 15 +++++++++++++++
>>> > arch/arm/boot/dts/armada-370.dtsi | 9 +++++++++
>>> > arch/arm/boot/dts/armada-xp.dtsi | 17 +++++++++++++++++
>>> > 3 files changed, 41 insertions(+), 0 deletions(-)
>>>
>>> Do you think we're still in time to get this series into v3.9 (given
>>> we decide soon on the OpenBlocks issue)?
>>
>> That shouldn't be a problem.
>>
>
> Do you think we can take this series for v3.9 as it is?
> I have no problems making any changes if they are needed
> but I can't move forward with the OpenBlocks issue since
> I don't have access to the hardware.
>
> I think we can sanely merge this as it is, since it has been tested in
> every platform.
> If there's anything to change we can do it later, when I have more
> information about the
> OpenBlocks hardware.
>
> Thanks,
>
> --
> Ezequiel
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
^ permalink raw reply
* [PATCH v5 03/14] ARM: edma: add AM33XX support to the private EDMA API
From: Matt Porter @ 2013-01-31 1:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAHp75Vdbv2tSLKY8OpPD7Y2Bf2dL9qn-gG7w=9KxMqL_zPA6sw@mail.gmail.com>
On Wed, Jan 30, 2013 at 09:40:52AM +0200, Andy Shevchenko wrote:
> On Wed, Jan 30, 2013 at 8:41 AM, Matt Porter <mporter@ti.com> wrote:
> > On Mon, Jan 28, 2013 at 09:27:24PM +0200, Andy Shevchenko wrote:
> >> On Tue, Jan 15, 2013 at 10:32 PM, Matt Porter <mporter@ti.com> wrote:
> >> > Adds support for parsing the TI EDMA DT data into the required
> >> > EDMA private API platform data. Enables runtime PM support to
> >> > initialize the EDMA hwmod. Adds AM33XX EMDA crossbar event mux
> >> > support.
> >> >
> >> > Signed-off-by: Matt Porter <mporter@ti.com>
> >> > ---
> >> > arch/arm/common/edma.c | 314 ++++++++++++++++++++++++++++++++++--
> >> > include/linux/platform_data/edma.h | 1 +
> >> > 2 files changed, 306 insertions(+), 9 deletions(-)
> >> >
> >> > diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> >> > index 2dce245..beeb1d2 100644
> >> > --- a/arch/arm/common/edma.c
> >> > +++ b/arch/arm/common/edma.c
> >> > @@ -24,6 +24,13 @@
> >> > #include <linux/platform_device.h>
> >> > #include <linux/io.h>
> >> > #include <linux/slab.h>
> >> > +#include <linux/edma.h>
> >> > +#include <linux/err.h>
> >> > +#include <linux/of_address.h>
> >> > +#include <linux/of_device.h>
> >> > +#include <linux/of_dma.h>
> >> > +#include <linux/of_irq.h>
> >> > +#include <linux/pm_runtime.h>
> >> >
> >> > #include <linux/platform_data/edma.h>
> >> >
> >> > @@ -723,6 +730,9 @@ EXPORT_SYMBOL(edma_free_channel);
> >> > */
> >> > int edma_alloc_slot(unsigned ctlr, int slot)
> >> > {
> >> > + if (!edma_cc[ctlr])
> >> > + return -EINVAL;
> >> > +
> >> > if (slot >= 0)
> >> > slot = EDMA_CHAN_SLOT(slot);
> >> >
> >> > @@ -1366,31 +1376,291 @@ void edma_clear_event(unsigned channel)
> >> > EXPORT_SYMBOL(edma_clear_event);
> >> >
> >> > /*-----------------------------------------------------------------------*/
> >> > +static int edma_of_read_u32_to_s8_array(const struct device_node *np,
> >> > + const char *propname, s8 *out_values,
> >> > + size_t sz)
> >>
> >> I'm sorry I didn't get why you couldn't use of_property_read_u8_array() ?
> >> The similar comment to u16 and so on.
> >
> > There's some manipulation of the legacy Davinci platform data
> > structures going on here. The driving reason was to not change any of
> > the davinci platforms pdata which uses s8/s16 tables of mapping values
> > with signed values as terminators. These versions below add the
> > convert to the signed value and terminate the array as needed by the
> > existing driver. This will all go away when the driver is rewritten and
> > merged into drivers/dma/edma.c. At that point I want to throwaway all
> > these legacy data structures. First, there's some more drivers to
> > convert to dmaengine api.
> >
>
> I mean instead of custom functions you could use existing ones.
> And sign here will be implicitly applied.
Yes, sorry, wasn't following you at first. The is definitely much better
and does work fine. I will update this...thanks!
-Matt
> So, what I propose is to do something like this
>
> static int edma_of_read_u32_to_s8_array(const struct device_node *np,
> const char *propname, s8 *out_values,
> size_t sz)
> {
>
> int ret;
> ret = of_property_read_u8_array(np, propname, out_values, sz);
> if (ret)
> return ret;
>
> /* Terminate it */
> *out_values++ = -1;
> *out_values++ = -1;
> }
>
> > -Matt
> >>
> >> > +{
> >> > + struct property *prop = of_find_property(np, propname, NULL);
> >> > + const __be32 *val;
> >> > +
> >> > + if (!prop)
> >> > + return -EINVAL;
> >> > + if (!prop->value)
> >> > + return -ENODATA;
> >> > + if ((sz * sizeof(u32)) > prop->length)
> >> > + return -EOVERFLOW;
> >> > +
> >> > + val = prop->value;
> >> > +
> >> > + while (sz--)
> >> > + *out_values++ = (s8)(be32_to_cpup(val++) & 0xff);
> >> > +
> >> > + /* Terminate it */
> >> > + *out_values++ = -1;
> >> > + *out_values++ = -1;
> >> > +
> >> > + return 0;
> >> > +}
> >> > +
> >> > +static int edma_of_read_u32_to_s16_array(const struct device_node *np,
> >> > + const char *propname, s16 *out_values,
> >> > + size_t sz)
> >> > +{
> >> > + struct property *prop = of_find_property(np, propname, NULL);
> >> > + const __be32 *val;
> >> > +
> >> > + if (!prop)
> >> > + return -EINVAL;
> >> > + if (!prop->value)
> >> > + return -ENODATA;
> >> > + if ((sz * sizeof(u32)) > prop->length)
> >> > + return -EOVERFLOW;
> >> > +
> >> > + val = prop->value;
> >> > +
> >> > + while (sz--)
> >> > + *out_values++ = (s16)(be32_to_cpup(val++) & 0xffff);
> >> > +
> >> > + /* Terminate it */
> >> > + *out_values++ = -1;
> >> > + *out_values++ = -1;
> >> > +
> >> > + return 0;
> >> > +}
> >> > +
> >> > +static int edma_xbar_event_map(struct device *dev,
> >> > + struct device_node *node,
> >> > + struct edma_soc_info *pdata, int len)
> >> > +{
> >> > + int ret = 0;
> >> > + int i;
> >> > + struct resource res;
> >> > + void *xbar;
> >> > + const s16 (*xbar_chans)[2];
> >> > + u32 shift, offset, mux;
> >> > +
> >> > + xbar_chans = devm_kzalloc(dev,
> >> > + len/sizeof(s16) + 2*sizeof(s16),
> >> > + GFP_KERNEL);
> >> > + if (!xbar_chans)
> >> > + return -ENOMEM;
> >> > +
> >> > + ret = of_address_to_resource(node, 1, &res);
> >> > + if (IS_ERR_VALUE(ret))
> >> > + return -EIO;
> >> > +
> >> > + xbar = devm_ioremap(dev, res.start, resource_size(&res));
> >> > + if (!xbar)
> >> > + return -ENOMEM;
> >> > +
> >> > + ret = edma_of_read_u32_to_s16_array(node,
> >> > + "ti,edma-xbar-event-map",
> >> > + (s16 *)xbar_chans,
> >> > + len/sizeof(u32));
> >> > + if (IS_ERR_VALUE(ret))
> >> > + return -EIO;
> >> > +
> >> > + for (i = 0; xbar_chans[i][0] != -1; i++) {
> >> > + shift = (xbar_chans[i][1] % 4) * 8;
> >> > + offset = xbar_chans[i][1] >> 2;
> >> > + offset <<= 2;
> >> > + mux = readl((void *)((u32)xbar + offset));
> >> > + mux &= ~(0xff << shift);
> >> > + mux |= xbar_chans[i][0] << shift;
> >> > + writel(mux, (void *)((u32)xbar + offset));
> >> > + }
> >> > +
> >> > + pdata->xbar_chans = xbar_chans;
> >> > +
> >> > + return 0;
> >> > +}
> >> > +
> >> > +static int edma_of_parse_dt(struct device *dev,
> >> > + struct device_node *node,
> >> > + struct edma_soc_info *pdata)
> >> > +{
> >> > + int ret = 0;
> >> > + u32 value;
> >> > + struct property *prop;
> >> > + size_t sz;
> >> > + struct edma_rsv_info *rsv_info;
> >> > + const s16 (*rsv_chans)[2], (*rsv_slots)[2];
> >> > + const s8 (*queue_tc_map)[2], (*queue_priority_map)[2];
> >> > +
> >> > + memset(pdata, 0, sizeof(struct edma_soc_info));
> >> > +
> >> > + ret = of_property_read_u32(node, "dma-channels", &value);
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + pdata->n_channel = value;
> >> > +
> >> > + ret = of_property_read_u32(node, "ti,edma-regions", &value);
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + pdata->n_region = value;
> >> > +
> >> > + ret = of_property_read_u32(node, "ti,edma-slots", &value);
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + pdata->n_slot = value;
> >> > +
> >> > + pdata->n_cc = 1;
> >> > + pdata->n_tc = 3;
> >> > +
> >> > + rsv_info =
> >> > + devm_kzalloc(dev, sizeof(struct edma_rsv_info), GFP_KERNEL);
> >> > + if (!rsv_info)
> >> > + return -ENOMEM;
> >> > + pdata->rsv = rsv_info;
> >> > +
> >> > + /* Build the reserved channel/slots arrays */
> >> > + prop = of_find_property(node, "ti,edma-reserved-channels", &sz);
> >> > + if (prop) {
> >> > + rsv_chans = devm_kzalloc(dev,
> >> > + sz/sizeof(s16) + 2*sizeof(s16),
> >> > + GFP_KERNEL);
> >> > + if (!rsv_chans)
> >> > + return -ENOMEM;
> >> > + pdata->rsv->rsv_chans = rsv_chans;
> >> > +
> >> > + ret = edma_of_read_u32_to_s16_array(node,
> >> > + "ti,edma-reserved-channels",
> >> > + (s16 *)rsv_chans,
> >> > + sz/sizeof(u32));
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + }
> >> > +
> >> > + prop = of_find_property(node, "ti,edma-reserved-slots", &sz);
> >> > + if (prop) {
> >> > + rsv_slots = devm_kzalloc(dev,
> >> > + sz/sizeof(s16) + 2*sizeof(s16),
> >> > + GFP_KERNEL);
> >> > + if (!rsv_slots)
> >> > + return -ENOMEM;
> >> > + pdata->rsv->rsv_slots = rsv_slots;
> >> > +
> >> > + ret = edma_of_read_u32_to_s16_array(node,
> >> > + "ti,edma-reserved-slots",
> >> > + (s16 *)rsv_slots,
> >> > + sz/sizeof(u32));
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + }
> >> > +
> >> > + prop = of_find_property(node, "ti,edma-queue-tc-map", &sz);
> >> > + if (!prop)
> >> > + return -EINVAL;
> >> > +
> >> > + queue_tc_map = devm_kzalloc(dev,
> >> > + sz/sizeof(s8) + 2*sizeof(s8),
> >> > + GFP_KERNEL);
> >> > + if (!queue_tc_map)
> >> > + return -ENOMEM;
> >> > + pdata->queue_tc_mapping = queue_tc_map;
> >> > +
> >> > + ret = edma_of_read_u32_to_s8_array(node,
> >> > + "ti,edma-queue-tc-map",
> >> > + (s8 *)queue_tc_map,
> >> > + sz/sizeof(u32));
> >> > + if (ret < 0)
> >> > + return ret;
> >> > +
> >> > + prop = of_find_property(node, "ti,edma-queue-priority-map", &sz);
> >> > + if (!prop)
> >> > + return -EINVAL;
> >> > +
> >> > + queue_priority_map = devm_kzalloc(dev,
> >> > + sz/sizeof(s8) + 2*sizeof(s8),
> >> > + GFP_KERNEL);
> >> > + if (!queue_priority_map)
> >> > + return -ENOMEM;
> >> > + pdata->queue_priority_mapping = queue_priority_map;
> >> > +
> >> > + ret = edma_of_read_u32_to_s8_array(node,
> >> > + "ti,edma-queue-tc-map",
> >> > + (s8 *)queue_priority_map,
> >> > + sz/sizeof(u32));
> >> > + if (ret < 0)
> >> > + return ret;
> >> > +
> >> > + ret = of_property_read_u32(node, "ti,edma-default-queue", &value);
> >> > + if (ret < 0)
> >> > + return ret;
> >> > + pdata->default_queue = value;
> >> > +
> >> > + prop = of_find_property(node, "ti,edma-xbar-event-map", &sz);
> >> > + if (prop)
> >> > + ret = edma_xbar_event_map(dev, node, pdata, sz);
> >> > +
> >> > + return ret;
> >> > +}
> >> > +
> >> > +static struct of_dma_filter_info edma_filter_info = {
> >> > + .filter_fn = edma_filter_fn,
> >> > +};
> >> >
> >> > static int edma_probe(struct platform_device *pdev)
> >> > {
> >> > struct edma_soc_info **info = pdev->dev.platform_data;
> >> > + struct edma_soc_info *ninfo[EDMA_MAX_CC] = {NULL, NULL};
> >> > + struct edma_soc_info tmpinfo;
> >> > const s8 (*queue_priority_mapping)[2];
> >> > const s8 (*queue_tc_mapping)[2];
> >> > int i, j, off, ln, found = 0;
> >> > int status = -1;
> >> > const s16 (*rsv_chans)[2];
> >> > const s16 (*rsv_slots)[2];
> >> > + const s16 (*xbar_chans)[2];
> >> > int irq[EDMA_MAX_CC] = {0, 0};
> >> > int err_irq[EDMA_MAX_CC] = {0, 0};
> >> > - struct resource *r[EDMA_MAX_CC] = {NULL};
> >> > + struct resource *r[EDMA_MAX_CC] = {NULL, NULL};
> >> > + struct resource res[EDMA_MAX_CC];
> >> > resource_size_t len[EDMA_MAX_CC];
> >> > char res_name[10];
> >> > char irq_name[10];
> >> > + struct device_node *node = pdev->dev.of_node;
> >> > + struct device *dev = &pdev->dev;
> >> > + int ret;
> >> > +
> >> > + if (node) {
> >> > + info = ninfo;
> >> > + edma_of_parse_dt(dev, node, &tmpinfo);
> >> > + info[0] = &tmpinfo;
> >> > +
> >> > + dma_cap_set(DMA_SLAVE, edma_filter_info.dma_cap);
> >> > + of_dma_controller_register(dev->of_node,
> >> > + of_dma_simple_xlate,
> >> > + &edma_filter_info);
> >> > + }
> >> >
> >> > if (!info)
> >> > return -ENODEV;
> >> >
> >> > + pm_runtime_enable(dev);
> >> > + ret = pm_runtime_get_sync(dev);
> >> > + if (IS_ERR_VALUE(ret)) {
> >> > + dev_err(dev, "pm_runtime_get_sync() failed\n");
> >> > + return ret;
> >> > + }
> >> > +
> >> > for (j = 0; j < EDMA_MAX_CC; j++) {
> >> > - sprintf(res_name, "edma_cc%d", j);
> >> > - r[j] = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> >> > + if (!info[j]) {
> >> > + if (!found)
> >> > + return -ENODEV;
> >> > + break;
> >> > + }
> >> > + if (node) {
> >> > + ret = of_address_to_resource(node, j, &res[j]);
> >> > + if (!IS_ERR_VALUE(ret))
> >> > + r[j] = &res[j];
> >> > + } else {
> >> > + sprintf(res_name, "edma_cc%d", j);
> >> > + r[j] = platform_get_resource_byname(pdev,
> >> > + IORESOURCE_MEM,
> >> > res_name);
> >> > - if (!r[j] || !info[j]) {
> >> > + }
> >> > + if (!r[j]) {
> >> > if (found)
> >> > break;
> >> > else
> >> > @@ -1465,8 +1735,22 @@ static int edma_probe(struct platform_device *pdev)
> >> > }
> >> > }
> >> >
> >> > - sprintf(irq_name, "edma%d", j);
> >> > - irq[j] = platform_get_irq_byname(pdev, irq_name);
> >> > + /* Clear the xbar mapped channels in unused list */
> >> > + xbar_chans = info[j]->xbar_chans;
> >> > + if (xbar_chans) {
> >> > + for (i = 0; xbar_chans[i][1] != -1; i++) {
> >> > + off = xbar_chans[i][1];
> >> > + clear_bits(off, 1,
> >> > + edma_cc[j]->edma_unused);
> >> > + }
> >> > + }
> >> > +
> >> > + if (node)
> >> > + irq[j] = irq_of_parse_and_map(node, 0);
> >> > + else {
> >> > + sprintf(irq_name, "edma%d", j);
> >> > + irq[j] = platform_get_irq_byname(pdev, irq_name);
> >> > + }
> >> > edma_cc[j]->irq_res_start = irq[j];
> >> > status = request_irq(irq[j], dma_irq_handler, 0, "edma",
> >> > &pdev->dev);
> >> > @@ -1476,8 +1760,12 @@ static int edma_probe(struct platform_device *pdev)
> >> > goto fail;
> >> > }
> >> >
> >> > - sprintf(irq_name, "edma%d_err", j);
> >> > - err_irq[j] = platform_get_irq_byname(pdev, irq_name);
> >> > + if (node)
> >> > + err_irq[j] = irq_of_parse_and_map(node, 2);
> >> > + else {
> >> > + sprintf(irq_name, "edma%d_err", j);
> >> > + err_irq[j] = platform_get_irq_byname(pdev, irq_name);
> >> > + }
> >> > edma_cc[j]->irq_res_end = err_irq[j];
> >> > status = request_irq(err_irq[j], dma_ccerr_handler, 0,
> >> > "edma_error", &pdev->dev);
> >> > @@ -1538,9 +1826,17 @@ fail1:
> >> > return status;
> >> > }
> >> >
> >> > +static const struct of_device_id edma_of_ids[] = {
> >> > + { .compatible = "ti,edma3", },
> >> > + {}
> >> > +};
> >> >
> >> > static struct platform_driver edma_driver = {
> >> > - .driver.name = "edma",
> >> > + .driver = {
> >> > + .name = "edma",
> >> > + .of_match_table = edma_of_ids,
> >> > + },
> >> > + .probe = edma_probe,
> >> > };
> >> >
> >> > static int __init edma_init(void)
> >> > diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
> >> > index 2344ea2..ffc1fb2 100644
> >> > --- a/include/linux/platform_data/edma.h
> >> > +++ b/include/linux/platform_data/edma.h
> >> > @@ -177,6 +177,7 @@ struct edma_soc_info {
> >> >
> >> > const s8 (*queue_tc_mapping)[2];
> >> > const s8 (*queue_priority_mapping)[2];
> >> > + const s16 (*xbar_chans)[2];
> >> > };
> >> >
> >> > #endif
> >> > --
> >> > 1.7.9.5
> >> >
> >> > --
> >> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >> > the body of a message to majordomo at vger.kernel.org
> >> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > Please read the FAQ at http://www.tux.org/lkml/
> >>
> >>
> >>
> >> --
> >> With Best Regards,
> >> Andy Shevchenko
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> >> the body of a message to majordomo at vger.kernel.org
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source at linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
^ permalink raw reply
* [PATCH v6 09/10] spi: omap2-mcspi: add generic DMA request support to the DT binding
From: Matt Porter @ 2013-01-31 1:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201301300924.00508.arnd@arndb.de>
On Wed, Jan 30, 2013 at 09:24:00AM +0000, Arnd Bergmann wrote:
> On Wednesday 30 January 2013, Matt Porter wrote:
> > +Optional properties:
> > +- dmas: List of DMA controller phandle and DMA request ordered
> > + pairs. One tx and one rx pair is required for each chip
> > + select.
>
> The binding looks ok, but the wording is slightly incorrect here:
> strictly speaking, it's not a pair of controller phandle and request
> line number, but a DMA descriptor as specified in bindings/dma/dma.txt
> with a format specific to the dma engine being used. That can
> require more than just a single integer request number.
Correct. I will update accordingly.
-Matt
^ permalink raw reply
* [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat()
From: Matt Porter @ 2013-01-31 1:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <ee89773ba46d44da945eee7b07ab1dc4@DFLE73.ent.ti.com>
On Wed, Jan 30, 2013 at 09:27:18AM +0000, Arnd Bergmann wrote:
> On Wednesday 30 January 2013, Matt Porter wrote:
> > Adds a dma_request_slave_channel_compat() wrapper which accepts
> > both the arguments from dma_request_channel() and
> > dma_request_slave_channel(). Based on whether the driver is
> > instantiated via DT, the appropriate channel request call will be
> > made.
> >
> > This allows for a much cleaner migration of drivers to the
> > dmaengine DT API as platforms continue to be mixed between those
> > that boot using DT and those that do not.
> >
> > Suggested-by: Tony Lindgren <tony@atomide.com>
> > Signed-off-by: Matt Porter <mporter@ti.com>
> > Acked-by: Tony Lindgren <tony@atomide.com>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> > @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
> > struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
> > struct dma_chan *net_dma_find_channel(void);
> > #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
> > +#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
> > + __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
> > +
> > +static inline struct dma_chan
> > +*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn,
> > + void *fn_param, struct device *dev,
> > + char *name)
> > +{
> > + struct dma_chan *chan;
> > +
> > + chan = dma_request_slave_channel(dev, name);
> > + if (chan)
> > + return chan;
> > +
> > + return __dma_request_channel(mask, fn, fn_param);
> > +}
>
> After I have spent some more time with implementing the code for dw_dma,
> I think the mask is actually unnecessary here, the helper could just
> always set it to DMA_SLAVE before calling __dma_request_channel.
>
> It's not a bug to do it this way though, and it may help convert drivers
> a little easier if there is less to change.
Agreed.
-Matt
>
> Arnd
^ permalink raw reply
* Failure to boot...
From: Russell King - ARM Linux @ 2013-01-31 1:49 UTC (permalink / raw)
To: linux-arm-kernel
Having spent today sorting out the Realview EB boot, the last thing
I expected to find was that both my OMAP platforms are unbootable
to the point that absolutely nothing happens after the boot loader
transfers control.
I've not been running the boots for about a month, so I'm not sure
when this breakage crept in.
You can see the results in the boot logs on the website. Please
investigate. And I'll try without arm-soc tomorrow.
Very disappointed that the ARM kernel seems to be rather screwed at
the moment across multiple sub-arches.
^ permalink raw reply
* ARM: mach-shmobile: r8a7779, marzen: Reference DT implementation
From: Simon Horman @ 2013-01-31 1:50 UTC (permalink / raw)
To: linux-arm-kernel
Provide minimal DT initialisation for the r8a7779 SoC and
marzen board as a reference for developers.
In general the idea is to grow the hardware supported by this
initialisation as DT coverage of relevant drivers and other code
grows.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
overall diffstat:
arch/arm/boot/dts/Makefile | 1
arch/arm/boot/dts/r8a7779-marzen-reference.dts | 41 ++++++
arch/arm/boot/dts/r8a7779.dtsi | 85 ++++++++++++++
arch/arm/configs/marzen_defconfig | 2
arch/arm/mach-shmobile/Kconfig | 11 +
arch/arm/mach-shmobile/Makefile | 1
arch/arm/mach-shmobile/board-marzen-reference.c | 71 +++++++++++
arch/arm/mach-shmobile/include/mach/common.h | 3
arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++-
arch/arm/mach-shmobile/setup-r8a7779.c | 58 ++++++++-
10 files changed, 288 insertions(+), 12 deletions(-)
^ permalink raw reply
* [PATCH 1/4] ARM: mach-shmobile: marzen: defconfig: use regulators by default
From: Simon Horman @ 2013-01-31 1:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359597051-32700-1-git-send-email-horms+renesas@verge.net.au>
Use regulators by default
This is in preparation for initialising devices using DT.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/configs/marzen_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 728a43c..afee4a2 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -83,6 +83,8 @@ CONFIG_USB=y
CONFIG_USB_RCAR_PHY=y
CONFIG_MMC=y
CONFIG_MMC_SDHI=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DUMMY=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_OHCI_HCD=y
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/4] ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
From: Simon Horman @ 2013-01-31 1:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359597051-32700-1-git-send-email-horms+renesas@verge.net.au>
This allows the GIC interrupt controller of the r8a7779 SoC to be
initialised using a flattened device tree blob.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/boot/dts/r8a7779.dtsi | 40 ++++++++++++++++++++++++++
arch/arm/mach-shmobile/include/mach/common.h | 1 +
arch/arm/mach-shmobile/intc-r8a7779.c | 27 +++++++++++++----
3 files changed, 62 insertions(+), 6 deletions(-)
create mode 100644 arch/arm/boot/dts/r8a7779.dtsi
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
new file mode 100644
index 0000000..eadc12e
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -0,0 +1,40 @@
+/*
+ * Device Tree Source for Renesas r8a7740
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+ compatible = "renesas,r8a7779";
+
+ cpus {
+ cpu at 0 {
+ compatible = "arm,cortex-a9";
+ };
+ cpu at 1 {
+ compatible = "arm,cortex-a9";
+ };
+ cpu at 2 {
+ compatible = "arm,cortex-a9";
+ };
+ cpu at 3 {
+ compatible = "arm,cortex-a9";
+ };
+ };
+
+ gic: interrupt-controller at f0001000 {
+ compatible = "arm,cortex-a9-gic";
+ #interrupt-cells = <3>;
+ #address-cells = <1>;
+ interrupt-controller;
+ reg = <0xf0001000 0x1000>,
+ <0xf0000100 0x100>;
+ };
+};
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 16dab18..8ef7ebb 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -63,6 +63,7 @@ extern void r8a7740_pinmux_init(void);
extern void r8a7740_pm_init(void);
extern void r8a7779_init_irq(void);
+extern void r8a7779_init_irq_dt(void);
extern void r8a7779_map_io(void);
extern void r8a7779_earlytimer_init(void);
extern void r8a7779_add_early_devices(void);
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
index 8807c27..f9cc4bc 100644
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ b/arch/arm/mach-shmobile/intc-r8a7779.c
@@ -24,6 +24,7 @@
#include <linux/io.h>
#include <linux/irqchip/arm-gic.h>
#include <mach/common.h>
+#include <linux/irqchip.h>
#include <mach/intc.h>
#include <mach/r8a7779.h>
#include <asm/mach-types.h>
@@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
return 0; /* always allow wakeup */
}
-void __init r8a7779_init_irq(void)
+static void __init r8a7779_init_irq_common(void)
{
- void __iomem *gic_dist_base = IOMEM(0xf0001000);
- void __iomem *gic_cpu_base = IOMEM(0xf0000100);
-
- /* use GIC to handle interrupts */
- gic_init(0, 29, gic_dist_base, gic_cpu_base);
gic_arch_extn.irq_set_wake = r8a7779_set_wake;
/* route all interrupts to ARM */
@@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)
__raw_writel(0xbffffffc, INT2SMSKCR3);
__raw_writel(0x003fee3f, INT2SMSKCR4);
}
+
+void __init r8a7779_init_irq(void)
+{
+ void __iomem *gic_dist_base = IOMEM(0xf0001000);
+ void __iomem *gic_cpu_base = IOMEM(0xf0000100);
+
+ /* use GIC to handle interrupts */
+ gic_init(0, 29, gic_dist_base, gic_cpu_base);
+
+ r8a7779_init_irq_common();
+}
+
+#ifdef CONFIG_OF
+void __init r8a7779_init_irq_dt(void)
+{
+ irqchip_init();
+ r8a7779_init_irq_common();
+}
+#endif
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/4] ARM: mach-shmobile: r8a7779: Minimal setup using DT
From: Simon Horman @ 2013-01-31 1:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359597051-32700-1-git-send-email-horms+renesas@verge.net.au>
Allow a minimal setup of the r8a7779 SoC using a flattened device tree.
In particular, configure the i2c and ethernet controllers using a
flattened device tree.
SCI serial controller and TMU clock source, whose drivers do not yet
support configuration using a flattened device tree, are still configured
using C code in order to allow booting of a board with this SoC.
The ethernet controller also requires a regulator which is a board property.
A sample snippet DT for the marzen board is as follows:
/dts-v1/;
/include/ "r8a7779.dtsi"
/ {
fixedregulator3v3: fixedregulator at 0 {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};
&lan0 {
vddvario-supply = <&fixedregulator3v3>;
vdd33a-supply = <&fixedregulator3v3>;
};
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/boot/dts/r8a7779.dtsi | 45 ++++++++++++++++++++
arch/arm/mach-shmobile/include/mach/common.h | 2 +
arch/arm/mach-shmobile/setup-r8a7779.c | 58 +++++++++++++++++++++++---
3 files changed, 99 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
index eadc12e..9564040 100644
--- a/arch/arm/boot/dts/r8a7779.dtsi
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -37,4 +37,49 @@
reg = <0xf0001000 0x1000>,
<0xf0000100 0x100>;
};
+
+ i2c0: i2c at 0xffc70000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "renesas,rmobile-iic";
+ reg = <0xffc70000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 79 0x4>;
+ };
+
+ i2c1: i2c at 0xffc71000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "renesas,rmobile-iic";
+ reg = <0xffc71000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 82 0x4>;
+ };
+
+ i2c2: i2c at 0xffc72000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "renesas,rmobile-iic";
+ reg = <0xffc72000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 80 0x4>;
+ };
+
+ i2c3: i2c at 0xffc73000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "renesas,rmobile-iic";
+ reg = <0xffc73000 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 81 0x4>;
+ };
+
+ lan0: lan0 at 18000000 {
+ compatible = "smsc,lan9220", "smsc,lan9115";
+ reg = <0x18000000 0x100>;
+ phy-mode = "mii";
+ interrupt-parent = <&gic>;
+ interrupts = <0 28 0x4>;
+ reg-io-width = <4>;
+ };
};
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 8ef7ebb..4b85b18 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -67,7 +67,9 @@ extern void r8a7779_init_irq_dt(void);
extern void r8a7779_map_io(void);
extern void r8a7779_earlytimer_init(void);
extern void r8a7779_add_early_devices(void);
+extern void r8a7779_add_early_devices_dt(void);
extern void r8a7779_add_standard_devices(void);
+extern void r8a7779_add_standard_devices_dt(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
extern void r8a7779_pm_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index c54ff9b..d4818c2 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -321,7 +321,7 @@ static struct platform_device i2c3_device = {
.num_resources = ARRAY_SIZE(rcar_i2c3_res),
};
-static struct platform_device *r8a7779_early_devices[] __initdata = {
+static struct platform_device *r8a7779_early_devices_dt[] __initdata = {
&scif0_device,
&scif1_device,
&scif2_device,
@@ -330,15 +330,15 @@ static struct platform_device *r8a7779_early_devices[] __initdata = {
&scif5_device,
&tmu00_device,
&tmu01_device,
+};
+
+static struct platform_device *r8a7779_early_devices[] __initdata = {
&i2c0_device,
&i2c1_device,
&i2c2_device,
&i2c3_device,
};
-static struct platform_device *r8a7779_late_devices[] __initdata = {
-};
-
void __init r8a7779_add_standard_devices(void)
{
#ifdef CONFIG_CACHE_L2X0
@@ -349,10 +349,10 @@ void __init r8a7779_add_standard_devices(void)
r8a7779_init_pm_domains();
+ platform_add_devices(r8a7779_early_devices_dt,
+ ARRAY_SIZE(r8a7779_early_devices_dt));
platform_add_devices(r8a7779_early_devices,
ARRAY_SIZE(r8a7779_early_devices));
- platform_add_devices(r8a7779_late_devices,
- ARRAY_SIZE(r8a7779_late_devices));
}
/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
@@ -367,6 +367,8 @@ void __init r8a7779_earlytimer_init(void)
void __init r8a7779_add_early_devices(void)
{
+ early_platform_add_devices(r8a7779_early_devices_dt,
+ ARRAY_SIZE(r8a7779_early_devices_dt));
early_platform_add_devices(r8a7779_early_devices,
ARRAY_SIZE(r8a7779_early_devices));
@@ -386,3 +388,47 @@ void __init r8a7779_add_early_devices(void)
* command line in case of the marzen board.
*/
}
+
+#ifdef CONFIG_USE_OF
+void __init r8a7779_add_early_devices_dt(void)
+{
+ shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */
+
+ early_platform_add_devices(r8a7779_early_devices_dt,
+ ARRAY_SIZE(r8a7779_early_devices_dt));
+
+ /* Early serial console setup is not included here.
+ * See comment in r8a7779_add_early_devices().
+ */
+}
+
+static const struct of_dev_auxdata r8a7779_auxdata_lookup[] __initconst = {
+ {},
+};
+
+void __init r8a7779_add_standard_devices_dt(void)
+{
+ /* clocks are setup late during boot in the case of DT */
+ r8a7779_clock_init();
+
+ platform_add_devices(r8a7779_early_devices_dt,
+ ARRAY_SIZE(r8a7779_early_devices_dt));
+ of_platform_populate(NULL, of_default_bus_match_table,
+ r8a7779_auxdata_lookup, NULL);
+}
+
+static const char *r8a7779_compat_dt[] __initdata = {
+ "renesas,r8a7779",
+ NULL,
+};
+
+DT_MACHINE_START(SH73A0_DT, "Generic R8A7779 (Flattened Device Tree)")
+ .map_io = r8a7779_map_io,
+ .init_early = r8a7779_add_early_devices_dt,
+ .nr_irqs = NR_IRQS_LEGACY,
+ .init_irq = r8a7779_init_irq_dt,
+ .init_machine = r8a7779_add_standard_devices_dt,
+ .init_time = shmobile_timer_init,
+ .dt_compat = r8a7779_compat_dt,
+MACHINE_END
+#endif /* CONFIG_USE_OF */
--
1.7.10.4
^ permalink raw reply related
* [PATCH 4/4] ARM: mach-shmobile: marzen: Reference DT implementation
From: Simon Horman @ 2013-01-31 1:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1359597051-32700-1-git-send-email-horms+renesas@verge.net.au>
Provide alternate board code for the marzen to demonstrate
how DT may be used given the current state of driver
device tree support. This is intended to act as a reference
for mach-shmobile developers.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/r8a7779-marzen-reference.dts | 41 +++++++++++++
arch/arm/mach-shmobile/Kconfig | 11 ++++
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/board-marzen-reference.c | 71 +++++++++++++++++++++++
5 files changed, 125 insertions(+)
create mode 100644 arch/arm/boot/dts/r8a7779-marzen-reference.dts
create mode 100644 arch/arm/mach-shmobile/board-marzen-reference.c
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 2c6f9ef..6dfa67a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -123,6 +123,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \
dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
r8a7740-armadillo800eva.dtb \
r8a7740-armadillo800eva-reference.dtb \
+ r8a7779-marzen-reference.dtb \
sh73a0-kzm9g.dtb \
sh73a0-kzm9g-reference.dtb \
sh7372-mackerel.dtb \
diff --git a/arch/arm/boot/dts/r8a7779-marzen-reference.dts b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
new file mode 100644
index 0000000..377d8df
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779-marzen-reference.dts
@@ -0,0 +1,41 @@
+/*
+ * Reference Device Tree Source for the Marzen board
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Simon Horman
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/dts-v1/;
+/include/ "r8a7779.dtsi"
+
+/ {
+ model = "marzen";
+ compatible = "renesas,marzen-reference", "renesas,r8a7779";
+
+ chosen {
+ bootargs = "console=ttySC2,115200 earlyprintk=sh-sci.2,115200 ignore_loglevel root=/dev/nfs ip=on";
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x60000000 0x40000000>;
+ };
+
+ fixedregulator3v3: fixedregulator at 0 {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+};
+
+&lan0 {
+ vddvario-supply = <&fixedregulator3v3>;
+ vdd33a-supply = <&fixedregulator3v3>;
+};
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 5f61e8f..4695bf8 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -120,6 +120,17 @@ config MACH_MARZEN
select ARCH_REQUIRE_GPIOLIB
select REGULATOR_FIXED_VOLTAGE if REGULATOR
+config MACH_MARZEN_REFERENCE
+ bool "MARZEN board - Reference Device Tree Implementation"
+ depends on MACH_MARZEN
+ select USE_OF
+ ---help---
+ Use reference implementation of Marzen board support
+ which makes use of device tree at the expense
+ of not supporting a number of devices.
+
+ This is intended to aid developers
+
config MACH_KZM9D
bool "KZM9D board"
depends on ARCH_EMEV2
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index fd7ec65..6ab7ee2 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_MACH_MACKEREL_REFERENCE) += board-mackerel-reference.o
obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
obj-$(CONFIG_MACH_BONITO) += board-bonito.o
obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
+obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o
obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c
new file mode 100644
index 0000000..012548f
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-marzen-reference.c
@@ -0,0 +1,71 @@
+/*
+ * marzen board support - Reference DT implementation
+ *
+ * Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2011 Magnus Damm
+ * Copyright (C) 2013 Simon Horman
+ *
+ * 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; version 2 of the License.
+ *
+ * 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 for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/gpio.h>
+#include <mach/r8a7779.h>
+#include <mach/common.h>
+#include <mach/irqs.h>
+#include <asm/mach/arch.h>
+
+static void __init marzen_init(void)
+{
+ r8a7779_pinmux_init();
+
+ /* SCIF2 (CN18: DEBUG0) */
+ gpio_request(GPIO_FN_TX2_C, NULL);
+ gpio_request(GPIO_FN_RX2_C, NULL);
+
+ /* SCIF4 (CN19: DEBUG1) */
+ gpio_request(GPIO_FN_TX4, NULL);
+ gpio_request(GPIO_FN_RX4, NULL);
+
+ /* LAN89218 */
+ gpio_request(GPIO_FN_EX_CS0, NULL); /* nCS */
+ gpio_request(GPIO_FN_IRQ1_B, NULL); /* IRQ + PME */
+
+ /* SD0 (CN20) */
+ gpio_request(GPIO_FN_SD0_CLK, NULL);
+ gpio_request(GPIO_FN_SD0_CMD, NULL);
+ gpio_request(GPIO_FN_SD0_DAT0, NULL);
+ gpio_request(GPIO_FN_SD0_DAT1, NULL);
+ gpio_request(GPIO_FN_SD0_DAT2, NULL);
+ gpio_request(GPIO_FN_SD0_DAT3, NULL);
+ gpio_request(GPIO_FN_SD0_CD, NULL);
+ gpio_request(GPIO_FN_SD0_WP, NULL);
+
+ r8a7779_add_standard_devices_dt();
+}
+
+static const char *marzen_boards_compat_dt[] __initdata = {
+ "renesas,marzen-reference",
+ NULL,
+};
+
+DT_MACHINE_START(MARZEN, "marzen")
+ .smp = smp_ops(r8a7779_smp_ops),
+ .map_io = r8a7779_map_io,
+ .init_early = r8a7779_add_early_devices_dt,
+ .nr_irqs = NR_IRQS_LEGACY,
+ .init_irq = r8a7779_init_irq_dt,
+ .init_machine = marzen_init,
+ .init_time = shmobile_timer_init,
+ .dt_compat = marzen_boards_compat_dt,
+MACHINE_END
--
1.7.10.4
^ permalink raw reply related
* [RESEND PATCH v5 3/7] usb: chipidea: add otg id switch and vbus connect/disconnect detect
From: Peter Chen @ 2013-01-31 2:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <87d2wnm07r.fsf@ashishki-desk.ger.corp.intel.com>
On Wed, Jan 30, 2013 at 12:31:04PM +0200, Alexander Shishkin wrote:
> Peter Chen <peter.chen@freescale.com> writes:
>
> > On Wed, Jan 30, 2013 at 11:36:42AM +0530, kishon wrote:
> >> Hi,
> >>
> >> > bool global_phy;
> >> > struct usb_phy *transceiver;
> >> > struct usb_hcd *hcd;
> >> >- struct usb_otg otg;
> >> >+ struct usb_otg otg;
> >> You have added *otg* in previous patch and added a tab for *otg* in
> >> this patch.
> > thanks, I will change at previous patch
> >>
> >> >+
> >> >+#define CI_VBUS_STABLE_TIMEOUT 500
> >>
> >> Just curious.. how was this timeout value obtained?
> >
> > Just a timeout value, if the vbus goes to required value, it will quit.
> > Besides, 5s for vbus stable should be enough for an well behaviour hardware.
>
> Can you also mention this in the patch, since it raises questions?
Sure, do you have other ideas about next version patch?
>
> Thanks,
> --
> Alex
>
--
Best Regards,
Peter Chen
^ permalink raw reply
* [PATCH,RFC] usb: add devicetree helpers for determining dr_mode and phy_type
From: Peter Chen @ 2013-01-31 2:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130130140015.GZ1906@pengutronix.de>
On Wed, Jan 30, 2013 at 03:00:15PM +0100, Sascha Hauer wrote:
> On Wed, Jan 30, 2013 at 10:06:28AM +0800, Peter Chen wrote:
> > On Tue, Jan 29, 2013 at 01:55:04PM +0200, Alexander Shishkin wrote:
> > > Sascha Hauer <s.hauer@pengutronix.de> writes:
> > >
> > > > From: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > > >
> > > > This adds two little devicetree helper functions for determining the
> > > > dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from
> > > > the devicetree.
> > > >
> > > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > > > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > > > ---
> > > >
> > > > The properties and their values have been taken from the fsl-mph-dr driver.
> > > > This binding is also documented (though currently not used) for the tegra
> > > > ehci driver (Documentation/devicetree/bindings/usb/nvidia,tegra20-ehci.txt).
> > > > This is a first attempt to parse these bindings at a common place so that
> > > > others can make use of it.
> > > >
> > > > Basically I want to know whether this binding is recommended for new drivers
> > > > since normally the devicetree uses '-' instead of '_', and maybe there are
> > > > other problems with it.
> > > >
> > > > I need this binding for the chipidea driver. I suspect that the fsl-mph-dr
> > > > driver also really handles a chipidea core.
> > >
> > > As far as I know, it is a chipidea core. Adding Peter to Cc list, he can
> > > probably confirm.
> >
> > The fsl-mph-dr can't be used for chipdiea as it handles three platform
> > drivers for three roles (peripheral , host, otg). But chipidea only has
> > two platform drivers, one is the chipidea core, the other is related
> > controller wrapper.
>
> What do you mean by 'three platform drivers'? That's only how the driver
> is built, no? I was talking about the hardware the fsl-mph-dr driver
> handles which definitely smells like chipidea.
It creates host/device/otg platform device according to dr_mode from
the device tree.
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
--
Best Regards,
Peter Chen
^ 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