* [Intel-gfx] [PATCH 1/2] drm: share drm_add_fake_info_node
From: Ben Widawsky @ 2014-01-15 20:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAKMK7uE7CSh1gcs341ji6duRH_FgNDhoMfZNc=4hoYf-an1M=w@mail.gmail.com>
On Wed, Jan 15, 2014 at 09:45:28AM +0100, Daniel Vetter wrote:
> On Wed, Jan 15, 2014 at 9:39 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Jan 15, 2014 at 12:40 AM, Russell King - ARM Linux
> > <linux@arm.linux.org.uk> wrote:
> >> On Wed, Jan 15, 2014 at 12:25:10AM +0100, Daniel Vetter wrote:
> >>> On Tue, Jan 14, 2014 at 06:14:06AM -0800, Ben Widawsky wrote:
> >>> > Both i915 and Armada had the exact same implementation. For an upcoming
> >>> > patch, I'd like to call this function from two different source files in
> >>> > i915, and having it available externally helps there too.
> >>> >
> >>> > While moving, add 'debugfs_' to the name in order to match the other drm
> >>> > debugfs helper functions.
> >>> >
> >>> > Cc: linux-arm-kernel at lists.infradead.org
> >>> > Cc: intel-gfx at lists.freedesktop.org
> >>> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> >>>
> >>> drm_debugfs_create_files in drm_debugfs.c has the almost same code again.
> >>> Now the problem here is that the interface is a bit botched up, since all
> >>> the users in i915 and armada actaully faile to clean up teh debugfs dentry
> >>> if drm_add_fake_info_node.
> >>
> >> That's not correct - armada does clean up these, I think you need to
> >> take a closer look at the code.
> >>
> >> We do this by setting node->info_ent to the file operations structure,
> >> which is a unique key to the file being registered.
> >>
> >> Upon failure to create the fake node, we appropriately call
> >> drm_debugfs_remove_files() with the first argument being a pointer to
> >> the file operations. This causes drm_debugfs_remove_files() to match
> >> the fake entry, call debugfs_remove() on the dentry, and remove the
> >> node from the list, and free the node structure we allocated.
> >>
> >> Upon driver teardown, we also call drm_debugfs_remove_files() but with
> >> each fops which should be registered, thus cleaning up each fake node
> >> which was created.
> >>
> >> So, Armada does clean up these entries properly.
> >
> > Indeed I've missed that and it's just i915 that botches this. I still
> > think the helper would be saner if it cleans up all its leftovers in
> > the failure case.
>
> Ok, now I've actually page all the stuff back in - if
> drm_add_fake_info_node fails we don't set up a drm_info_node structure
> and link it anywhere. Which means drm_debugfs_remove_files won't ever
> find it and hence can't possibly call debugfs_remove. Which means the
> debugfs dentry is leaked. So I think the semantics of that new debugfs
> helper should get fixed to also allocate and clean up the debugfs
> node.
>
> I agree that i915 is even worse since it doesn't bother to clean up
> any debugfs files at all in the failure case.
> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Perhaps I don't understand what you want here. The only failure path in
the fake entry creation does already call debugfs_remove.
if (node == NULL) {
debugfs_remove(ent);
return -ENOMEM;
}
So long as the function succeeds, the node will be findable and removable.
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply
* [PATCH v9 2/4] Documentation: Add documentation for APM X-Gene SoC SATA host controller DTS binding
From: Loc Ho @ 2014-01-15 20:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20140115111839.GB25824@e106331-lin.cambridge.arm.com>
Hi,
>> +- clocks : Reference to the clock entry.
>> +- phys : PHY reference with parameter 0.
>
> The specific value of the phy-specifier shouldn't matter to this
> binding. What should matter is what it logically corresponds to.
I not quite following this. Are you suggest that I drop the value 0.
In the binding, one needs to specify the mode of operation - 0 is for
SATA. Can you explain more?
-Loc
^ permalink raw reply
* [PATCH] ARM: OMAP2+: add missing ARCH_HAS_OPP
From: Nishanth Menon @ 2014-01-15 20:00 UTC (permalink / raw)
To: linux-arm-kernel
OMAP5, DRA7, AM43xx all have OPPs. So select the same to allow SoC
only configuration boot to work with OPP.
Reported-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
For DRA7, depends on: https://patchwork.kernel.org/patch/3465411/
arch/arm/mach-omap2/Kconfig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 35c23e5..66a9c4a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -50,6 +50,7 @@ config SOC_OMAP5
bool "TI OMAP5"
depends on ARCH_MULTI_V7
select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
select ARM_CPU_SUSPEND if PM
select ARM_GIC
select CPU_V7
@@ -63,6 +64,7 @@ config SOC_AM33XX
bool "TI AM33XX"
depends on ARCH_MULTI_V7
select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
select ARM_CPU_SUSPEND if PM
select CPU_V7
select MULTI_IRQ_HANDLER
@@ -72,6 +74,7 @@ config SOC_AM43XX
depends on ARCH_MULTI_V7
select CPU_V7
select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
select MULTI_IRQ_HANDLER
select ARM_GIC
select MACH_OMAP_GENERIC
@@ -80,6 +83,7 @@ config SOC_DRA7XX
bool "TI DRA7XX"
depends on ARCH_MULTI_V7
select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
select ARM_CPU_SUSPEND if PM
select ARM_GIC
select CPU_V7
--
1.7.9.5
^ permalink raw reply related
* OMAP baseline test results for v3.13-rc8
From: Paul Walmsley @ 2014-01-15 19:58 UTC (permalink / raw)
To: linux-arm-kernel
Here are some basic OMAP test results for Linux v3.13-rc8.
Logs and other details at:
http://www.pwsan.com/omap/testlogs/test_v3.13-rc8/20140113013852/
Test summary
------------
Build: zImage:
Pass ( 2/ 2): omap2plus_defconfig, omap2plus_defconfig_am33xx_only
Build: uImage+dtb:
Pass ( 3/ 3): omap2plus_defconfig_am33xx_only/am335x-bone,
omap2plus_defconfig/omap4-panda,
omap2plus_defconfig/omap4-panda-es
Build: uImage:
Pass (14/14): omap1_defconfig, omap1_defconfig_1510innovator_only,
omap1_defconfig_5912osk_only, omap2plus_defconfig,
omap2plus_defconfig_2430sdp_only,
omap2plus_defconfig_cpupm, omap2plus_defconfig_no_pm,
omap2plus_defconfig_n800_only_a,
omap2plus_defconfig_n800_multi_omap2xxx,
omap2plus_defconfig_omap2_4_only,
omap2plus_defconfig_omap3_4_only,
rmk_omap3430_ldp_allnoconfig,
rmk_omap3430_ldp_oldconfig,
rmk_omap4430_sdp_allnoconfig
Boot to userspace:
skip ( 2/ 2): 5912osk, 4460varsomom
Pass (10/10): 2430sdp, 3517evm, 3530es3beagle, 3730beaglexm,
37xxevm, 4430es2panda, 4460pandaes, am335xbone,
am335xbonelt, cmt3517
PM: chip retention via suspend:
FAIL ( 3/ 7): 2430sdp, 4430es2panda, 4460varsomom
Pass ( 4/ 7): 3530es3beagle, 3730beaglexm, 37xxevm, 4460pandaes
PM: chip retention via dynamic idle:
FAIL ( 5/ 7): 2430sdp, 37xxevm, 4430es2panda, 4460pandaes,
4460varsomom
Pass ( 2/ 7): 3530es3beagle, 3730beaglexm
PM: chip off except CORE via suspend:
Pass ( 1/ 1): 3730beaglexm
PM: chip off except CORE via dynamic idle:
Pass ( 1/ 1): 3730beaglexm
PM: chip off via suspend:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
PM: chip off via dynamic idle:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
vmlinux object size
(delta in bytes from test_v3.13-rc7 (d6e0a2dd12f4067a5bcefb8bbd8ddbeff800afbc)):
text data bss total kernel
+45 0 0 +45 omap1_defconfig
+49 -8 0 +41 omap1_defconfig_1510innovator_only
+77 0 0 +77 omap1_defconfig_5912osk_only
+5 0 0 +5 omap2plus_defconfig
+25 0 0 +25 omap2plus_defconfig_2430sdp_only
+5 0 0 +5 omap2plus_defconfig_cpupm
0 0 0 0 omap2plus_defconfig_n800_multi_omap2xxx
0 0 0 0 omap2plus_defconfig_n800_only_a
+5 0 0 +5 omap2plus_defconfig_no_pm
+69 0 0 +69 omap2plus_defconfig_omap2_4_only
+5 0 0 +5 omap2plus_defconfig_omap3_4_only
+80 0 -88 -8 rmk_omap3430_ldp_allnoconfig
+65 0 0 +65 rmk_omap3430_ldp_oldconfig
-16 0 -24 -40 rmk_omap4430_sdp_allnoconfig
+125 0 0 +125 rmk_omap4430_sdp_oldnoconfig
Boot-time memory difference
(delta in bytes from test_v3.13-rc7 (d6e0a2dd12f4067a5bcefb8bbd8ddbeff800afbc))
avail rsrvd high freed board kconfig
(no differences)
^ permalink raw reply
* v3.12 regression from "ARM: kirkwood: convert to DT irqchip and clocksource" on non-DT kirkwood platforms
From: Sebastian Hesselbarth @ 2014-01-15 19:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389777972.12434.115.camel@kazak.uk.xensource.com>
On 01/15/2014 10:26 AM, Ian Campbell wrote:
> On Wed, 2014-01-15 at 10:15 +0100, Sebastian Hesselbarth wrote:
>> On 01/15/14 09:40, Ian Campbell wrote:
>>> The bootlogs are below or in the bug. It stops after "Console: colour
>>> dummy device 80x30", I think next would normally be the
>>> BogoMIPS/calibrate_delay output.
>>
>> That would indicate the timer (clocksource) or irq (irqchip) is not
>> running correctly. Again, that could be non-DT and DT fighting for it.
>> I'll investigate that.
>
> That seems logical.
>
>> In the meantime, can you recompile your kernel and set
>> CONFIG_ARCH_KIRKWOOD_DT=n ?
>
> I can confirm that v3.13-rc8 with CONFIG_ARCH_KIRKWOOD_DT=n works.
>
Ian,
please try the following two patches on top of v3.13-rc8 and report
back, if it solves the regression.
I have tested this on a revived non-DT Kirkwood Dockstar with and
without DT support enabled. I also compile tested it for Orion5x
and Dove.
While I will not send any patches for non-DT mach-dove boards as
none of them is really used anymore, Gregory is on Cc for hopefully
testing orion5x.
For possible -stable patches, I know it is quite a huge patch but
I didn't dare to touch arch/arm/kernel/foo for this kind of regression.
Sebastian
(I hope the fscking Thunderbird inlines both patches correctly)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-orion-provide-C-style-interrupt-handler-for-MULT.patch
Type: text/x-patch
Size: 2724 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140115/2abdebf2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ARM-kirkwood-set-C-style-handle_irq-if-MULTI_IRQ_HAN.patch
Type: text/x-patch
Size: 8378 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140115/2abdebf2/attachment-0001.bin>
^ permalink raw reply
* OMAP baseline test results for v3.13-rc7
From: Paul Walmsley @ 2014-01-15 19:53 UTC (permalink / raw)
To: linux-arm-kernel
Here are some basic OMAP test results for Linux v3.13-rc7.
Logs and other details at:
http://www.pwsan.com/omap/testlogs/test_v3.13-rc7/20140107113336/
Test summary
------------
Build: zImage:
Pass ( 2/ 2): omap2plus_defconfig, omap2plus_defconfig_am33xx_only
Build: uImage:
Pass (14/14): omap1_defconfig, omap1_defconfig_1510innovator_only,
omap1_defconfig_5912osk_only, omap2plus_defconfig,
omap2plus_defconfig_2430sdp_only,
omap2plus_defconfig_cpupm, omap2plus_defconfig_no_pm,
omap2plus_defconfig_n800_only_a,
omap2plus_defconfig_n800_multi_omap2xxx,
omap2plus_defconfig_omap2_4_only,
omap2plus_defconfig_omap3_4_only,
rmk_omap3430_ldp_allnoconfig,
rmk_omap3430_ldp_oldconfig,
rmk_omap4430_sdp_allnoconfig
Build: uImage+dtb:
Pass ( 3/ 3): omap2plus_defconfig_am33xx_only/am335x-bone,
omap2plus_defconfig/omap4-panda,
omap2plus_defconfig/omap4-panda-es
Boot to userspace:
skip ( 2/ 2): 5912osk, 4460varsomom
Pass (10/10): 2430sdp, 3517evm, 3530es3beagle, 3730beaglexm,
37xxevm, 4430es2panda, 4460pandaes, am335xbone,
am335xbonelt, cmt3517
PM: chip retention via suspend:
FAIL ( 4/ 7): 2430sdp, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 3/ 7): 3530es3beagle, 3730beaglexm, 37xxevm
PM: chip retention via dynamic idle:
FAIL ( 5/ 7): 2430sdp, 37xxevm, 4430es2panda, 4460pandaes,
4460varsomom
Pass ( 2/ 7): 3530es3beagle, 3730beaglexm
PM: chip off except CORE via suspend:
Pass ( 1/ 1): 3730beaglexm
PM: chip off except CORE via dynamic idle:
Pass ( 1/ 1): 3730beaglexm
PM: chip off via suspend:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
PM: chip off via dynamic idle:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
vmlinux object size
(delta in bytes from test_v3.13-rc6 (802eee95bde72fd0cd0f3a5b2098375a487d1eda)):
text data bss total kernel
+128 0 0 +128 omap1_defconfig
+128 0 0 +128 omap1_defconfig_1510innovator_only
+96 0 0 +96 omap1_defconfig_5912osk_only
+348 0 0 +348 omap2plus_defconfig
+124 +8 0 +132 omap2plus_defconfig_2430sdp_only
+476 0 0 +476 omap2plus_defconfig_cpupm
-4 0 0 -4 omap2plus_defconfig_n800_multi_omap2xxx
-36 0 0 -36 omap2plus_defconfig_n800_only_a
+228 0 0 +228 omap2plus_defconfig_no_pm
+284 0 0 +284 omap2plus_defconfig_omap2_4_only
+348 +8 0 +356 omap2plus_defconfig_omap3_4_only
-32 +8 +8 -16 rmk_omap3430_ldp_allnoconfig
+24 +8 0 +32 rmk_omap3430_ldp_oldconfig
+24 +8 -48 -16 rmk_omap4430_sdp_allnoconfig
+16400 +6296 +1268 +23964 rmk_omap4430_sdp_oldnoconfig
Boot-time memory difference
(delta in bytes from test_v3.13-rc6 (802eee95bde72fd0cd0f3a5b2098375a487d1eda))
avail rsrvd high freed board kconfig
(no differences)
^ permalink raw reply
* [PATCH 4/6] ARM: DTS: tegra: add the DFLL IP block to the T114 SoC file
From: Gerhard Sittig @ 2014-01-15 19:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.02.1401132219150.11672@tamien>
On Mon, Jan 13, 2014 at 22:27 -0800, Paul Walmsley wrote:
>
> On Thu, 19 Dec 2013, Stephen Warren wrote:
>
> >On 12/19/2013 05:49 AM, Paul Walmsley wrote:
> >>Add basic DT bindings for the DFLL IP block for the NVIDIA Tegra114 SoC.
> >
> >>diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra114-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra114-dfll.txt
> >
> >>+- clocks : Must contain an array of two-cell arrays, one per clock.
> >>+ DFLL source clocks. At minimum this should include the
> >>+ reference clock source and the IP block's main clock
> >>+ source. Also it should contain the DFLL's I2C controller
> >>+ clock source. The format is <&clock-provider-phandle
> >>+ clock-id>.
> >
> >Entries in "clocks" aren't two cells, they're a phandle plus as many
> >cells as the node referenced by the phandle specifies.
>
> It's worth noting that the clock binding documentation itself refers
> to pairs:
>
> ----
>
> clocks: List of phandle and clock specifier pairs, one pair
> for each clock input to the device. Note: if the
> clock provider specifies '0' for #clock-cells, then
> only the phandle portion of the pair will appear.
>
> ----
>
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/clock/clock-bindings.txt#n50
>
> But given the ambiguity of that documentation, I basically agree, so
> have changed it to:
Please note that there neither is an ambiguity nor a conflict
here, and that you actually acknowledge what Stephen said:
Clocks get referenced by a pair which consists of a phandle for
the clock provider and a clock specifier. The clock specifier is
made of as many cells as the clock provider's #clock-cells
property defines (including none, or any other number than 1).
This is exactly what Stephen said: A "clocks" item does not need
to have two cells. The pair of phandle and clock specifier don't
necessarily translate into two cells, instead the number of cells
depends on the clock provider.
Also note that the phandle is specifically _not_ part of the
clock specifier.
virtually yours
Gerhard Sittig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
^ permalink raw reply
* OMAP baseline test results for v3.13-rc6
From: Paul Walmsley @ 2014-01-15 19:44 UTC (permalink / raw)
To: linux-arm-kernel
Here are some basic OMAP test results for Linux v3.13-rc6.
Logs and other details at:
http://www.pwsan.com/omap/testlogs/test_v3.13-rc6/20131229233555/
Test summary
------------
Build: zImage:
Pass ( 2/ 2): omap2plus_defconfig, omap2plus_defconfig_am33xx_only
Build: uImage:
Pass (14/14): omap1_defconfig, omap1_defconfig_1510innovator_only,
omap1_defconfig_5912osk_only, omap2plus_defconfig,
omap2plus_defconfig_2430sdp_only,
omap2plus_defconfig_cpupm, omap2plus_defconfig_no_pm,
omap2plus_defconfig_n800_only_a,
omap2plus_defconfig_n800_multi_omap2xxx,
omap2plus_defconfig_omap2_4_only,
omap2plus_defconfig_omap3_4_only,
rmk_omap3430_ldp_allnoconfig,
rmk_omap3430_ldp_oldconfig,
rmk_omap4430_sdp_allnoconfig
Build: uImage+dtb:
Pass ( 3/ 3): omap2plus_defconfig_am33xx_only/am335x-bone,
omap2plus_defconfig/omap4-panda,
omap2plus_defconfig/omap4-panda-es
Boot to userspace:
skip ( 2/ 2): 5912osk, 4460varsomom
Pass (10/10): 2430sdp, 3517evm, 3530es3beagle, 3730beaglexm,
37xxevm, 4430es2panda, 4460pandaes, am335xbone,
am335xbonelt, cmt3517
PM: chip retention via suspend:
FAIL ( 4/ 7): 2430sdp, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 3/ 7): 3530es3beagle, 3730beaglexm, 37xxevm
PM: chip retention via dynamic idle:
FAIL ( 5/ 7): 2430sdp, 37xxevm, 4430es2panda, 4460pandaes,
4460varsomom
Pass ( 2/ 7): 3530es3beagle, 3730beaglexm
PM: chip off except CORE via suspend:
Pass ( 1/ 1): 3730beaglexm
PM: chip off except CORE via dynamic idle:
Pass ( 1/ 1): 3730beaglexm
PM: chip off via suspend:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
PM: chip off via dynamic idle:
FAIL ( 4/ 5): 37xxevm, 4430es2panda, 4460pandaes, 4460varsomom
Pass ( 1/ 5): 3530es3beagle
vmlinux object size
(delta in bytes from test_v3.13-rc5
(413541dd66d51f791a0b169d9b9014e4f56be13c)):
text data bss total kernel
+140 0 0 +140 omap1_defconfig
+140 0 0 +140 omap1_defconfig_1510innovator_only
+140 0 0 +140 omap1_defconfig_5912osk_only
+352 0 0 +352 omap2plus_defconfig
+276 0 0 +276 omap2plus_defconfig_2430sdp_only
+496 0 0 +496 omap2plus_defconfig_cpupm
+172 0 0 +172 omap2plus_defconfig_n800_multi_omap2xxx
+140 0 0 +140 omap2plus_defconfig_n800_only_a
+4448 0 0 +4448 omap2plus_defconfig_no_pm
+332 +8 0 +340 omap2plus_defconfig_omap2_4_only
+288 0 0 +288 omap2plus_defconfig_omap3_4_only
+256 +32 -32 +256 rmk_omap3430_ldp_allnoconfig
+160 +64 0 +224 rmk_omap3430_ldp_oldconfig
+140 0 0 +140 rmk_omap4430_sdp_allnoconfig
+256 0 0 +256 rmk_omap4430_sdp_oldnoconfig
Boot-time memory difference
(delta in bytes from test_v3.13-rc5 (413541dd66d51f791a0b169d9b9014e4f56be13c))
avail rsrvd high freed board kconfig
-1007736k -39816k -269312k -384k 4460varsomom omap2plus_defconfig
The winter holidays seemed to be a good time for testbed disruptions here.
The 2430SDP lost its ability to communicate over Ethernet, so that's been
switched to serial booting. And the 4460 VAR-SOM-OM decided it was going
to modulate its serial console TXD line with a 60 Hz ersatz triangle wave,
strong enough to confuse the serial port it was hooked up to, so that
board is offline until I can track down what the problem is.
^ permalink raw reply
* [PATCHv13 00/40] ARM: TI SoC clock DT conversion
From: Tony Lindgren @ 2014-01-15 19:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20140115192340.4167.87685@quantum>
* Mike Turquette <mturquette@linaro.org> [140115 11:25]:
> Quoting Tony Lindgren (2014-01-15 09:13:23)
> > * Mike Turquette <mturquette@linaro.org> [140114 19:52]:
> > > >
> > > > These 40 patches apply very cleanly on top of clk-next with 2
> > > > exceptions:
> > > >
> > > > 1) I did not apply "[PATCH 30/42] ARM: dts: AM35xx: use DT clock data"
> > > > because I do not have arch/arm/boot/dts/am3517.dtsi in clk-next (based
> > > > on 3.13-rc1).
> > > >
> > > > 2) Minor merge conflict in arch/arm/boot/dts/omap3.dtsi which I think I
> > > > resolved correctly but would like verification.
> > > >
> > > > I'd prefer to simply merge these patches into clk-next, which is the
> > > > most straightforward route. Any ideas on how to handle the missing
> > > > AM35xx dtsi data? It can always go as a separate fix after this stuff
> > > > gets merged which, ironically, is how that file was created in the first
> > > > place.
> >
> > You could do something like this to take advantage of fast forward and
> > not have to do a merge back from mainline:
> >
> > $ git checkout -b am3517-clk v3.13-rc8 # or any other -rc with am3517.dtsi
> > $ git merge clk-next-omap # this fast forwards clk-next-omap to the desired -rc
> > $ git am am3517-clk-patch
> > $ git checkout clk-next
> > $ git merge clk-next-omap # this fast forwards clk-next to the desired -rc
>
> That makes sense, but is there anything bad about doing that for a
> branch you intend to send as a pull request? I don't see how any of the
> commits get re-written or anything... I just wonder if there is some
> subtlety that I am not accounting for that makes this approach bad for
> sending to Linus.
No there should not be any issues. That's the preferred way to keep
development branches updated and pullable in long term without any need
to rebase.
Note that there will be only a merge commit if there is a conflict,
otherwise the fast forward will be transparent. So the trick to avoiding
rebasing and back merges is to apply patches against what they need in a
local branch, then after testing merge that local branch into the development
branch. Then for the upsteam pull request, you just need to make it against
the -rc you merged in.
AFAIK what Linus does not like is doing a back merge to a development
branch from mainline, probably as it adds a pointless commit. Or rebasing
a branch as that way it won't stay pullable.
Regards,
Tony
^ permalink raw reply
* [PATCH v4 13/16] ARM: Add an emulate flag to the kprobes/uprobes instruction decode functions
From: David Long @ 2014-01-15 19:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1387551482.3404.63.camel@linaro1.home>
On 12/20/13 09:58, Jon Medhurst (Tixy) wrote:
> On Sun, 2013-12-15 at 23:08 -0500, David Long wrote:
>> From: "David A. Long" <dave.long@linaro.org>
>>
>> Add an emulate flag into the instruction interpreter, primarily for uprobes
>> support.
>>
>> Signed-off-by: David A. Long <dave.long@linaro.org>
>> ---
>> arch/arm/kernel/kprobes.c | 3 ++-
>> arch/arm/kernel/kprobes.h | 1 +
>> arch/arm/kernel/probes-arm.c | 4 ++--
>> arch/arm/kernel/probes-arm.h | 2 +-
>> arch/arm/kernel/probes-thumb.c | 8 ++++----
>> arch/arm/kernel/probes-thumb.h | 4 ++--
>> arch/arm/kernel/probes.c | 32 +++++++++++++++++++++++---------
>> arch/arm/kernel/probes.h | 2 +-
>> 8 files changed, 36 insertions(+), 20 deletions(-)
>>
>> diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
>> index 0d9d49b..04690f9 100644
>> --- a/arch/arm/kernel/kprobes.c
>> +++ b/arch/arm/kernel/kprobes.c
>> @@ -87,7 +87,8 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>> p->opcode = insn;
>> p->ainsn.insn = tmp_insn;
>>
>> - switch ((*decode_insn)(insn, &p->ainsn, actions)) {
>> + switch ((*decode_insn)(insn, &p->ainsn,
>> + true, actions)) {
>
> Any reason why the function args need splitting over two lines?
I undid the that change.
>> case INSN_REJECTED: /* not supported */
>> return -EINVAL;
>>
>
> [...]
>
>> --- a/arch/arm/kernel/probes.c
>> +++ b/arch/arm/kernel/probes.c
>> @@ -193,7 +193,7 @@ void __kprobes probes_emulate_none(probes_opcode_t opcode,
>> */
>> static probes_opcode_t __kprobes
>> prepare_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> - bool thumb)
>> + bool thumb)
>
> Seems like a spurious indentation change.
Fixed.
>> {
>> #ifdef CONFIG_THUMB2_KERNEL
>> if (thumb) {
>> @@ -218,7 +218,7 @@ prepare_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> */
>> static void __kprobes
>> set_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> - bool thumb)
>> + bool thumb)
>
> Another spurious whitespace change.
Fixed.
>> {
>> #ifdef CONFIG_THUMB2_KERNEL
>> if (thumb) {
>> @@ -253,7 +253,7 @@ set_emulated_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> * non-zero value, the corresponding nibble in pinsn is validated and modified
>> * according to the type.
>> */
>> -static bool __kprobes decode_regs(probes_opcode_t *pinsn, u32 regs)
>> +static bool __kprobes decode_regs(probes_opcode_t *pinsn, u32 regs, bool modify)
>> {
>> probes_opcode_t insn = *pinsn;
>> probes_opcode_t mask = 0xf; /* Start at least significant nibble */
>> @@ -317,9 +317,16 @@ static bool __kprobes decode_regs(probes_opcode_t *pinsn, u32 regs)
>> /* Replace value of nibble with new register number... */
>> insn &= ~mask;
>> insn |= new_bits & mask;
>> + if (modify) {
>> + /* Replace value of nibble with new register number */
>> + insn &= ~mask;
>> + insn |= new_bits & mask;
>> + }
>
> Huh? As is, the above addition doesn't do anything because insn has
> already been modified. I guess you played with the idea that you needed
> to avoid changing insn (you don't) and then didn't undo the experiment
> quite right. :-)
>
The conditional modification of the instruction was part of Rabin's
original work for uprobes, but I messed up the merge from an earlier
working version of my patches. My intention was/is to delete the old
unconditional code. Sounds like maybe you disagree though. The intent
is to only modify the instruction in the kprobes case.
>> }
>>
>> - *pinsn = insn;
>> + if (modify)
>> + *pinsn = insn;
>> +
>> return true;
>>
>> reject:
>> @@ -380,14 +387,15 @@ static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
>> */
>> int __kprobes
>> probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> - const union decode_item *table, bool thumb,
>> - const union decode_item *actions)
>> + const union decode_item *table, bool thumb,
>> + bool emulate, const union decode_item *actions)
>> {
>> struct decode_header *h = (struct decode_header *)table;
>> struct decode_header *next;
>> bool matched = false;
>>
>> - insn = prepare_emulated_insn(insn, asi, thumb);
>> + if (emulate)
>> + insn = prepare_emulated_insn(insn, asi, thumb);
>>
>> for (;; h = next) {
>> enum decode_type type = h->type_regs.bits & DECODE_TYPE_MASK;
>> @@ -402,7 +410,7 @@ probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>> if (!matched && (insn & h->mask.bits) != h->value.bits)
>> continue;
>>
>> - if (!decode_regs(&insn, regs))
>> + if (!decode_regs(&insn, regs, emulate))
>> return INSN_REJECTED;
>>
>> switch (type) {
>> @@ -415,7 +423,8 @@ probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
>>
>> case DECODE_TYPE_CUSTOM: {
>> struct decode_custom *d = (struct decode_custom *)h;
>> - return actions[d->decoder.bits].decoder(insn, asi, h);
>> + return actions[d->decoder.bits].decoder(insn,
>> + asi, h);
>
> No need to split the above line, you haven't changed it and it doesn't
> exceed 80 characters anyway.
Fixed.
> [Rest of patch cut]
>
-dl
^ permalink raw reply
* [PATCH V3 1/5] pinctrl: sh-pfc: r7s72100: Add RSPI support
From: Laurent Pinchart @ 2014-01-15 19:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACRpkdaZyZ1NUhOkXjJQ5_fBx+NiLTaUGX-iAh50UU9SRvt7hQ@mail.gmail.com>
Hi Linus,
On Wednesday 15 January 2014 10:14:53 Linus Walleij wrote:
> On Sun, Jan 12, 2014 at 11:48 AM, Geert Uytterhoeven
>
> <geert@linux-m68k.org> wrote:
> > From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > ---
> >
> > V2:
> > - No changes
> >
> > V3:
> > - No changes
>
> I'm expecting Laurent to queue this patch when he's happy with it
> (maybe he already said so in some other mail).
I'm fine with the patch, but I'm still waiting for Magnus to submit the next
version of the r7s72100 pinctrl support.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* [PATCH v7 2/2] ehci-platform: Add support for clks and phy passed through devicetree
From: Hans de Goede @ 2014-01-15 19:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389813883-567-1-git-send-email-hdegoede@redhat.com>
Currently ehci-platform is only used in combination with devicetree when used
with some Via socs. By extending it to (optionally) get clks and a phy from
devicetree, and enabling / disabling those on power_on / off, it can be used
more generically. Specifically after this commit it can be used for the
ehci controller on Allwinner sunxi SoCs.
Since ehci-platform is intended to handle any generic enough non pci ehci
device, add a "usb-ehci" compatibility string.
There already is a usb-ehci device-tree bindings document, update this
with clks and phy bindings info.
Although actually quite generic so far the via,vt8500 compatibilty string
had its own bindings document. Somehow we even ended up with 2 of them. Since
these provide no extra information over the generic usb-ehci documentation,
this patch removes them.
The ehci-ppc-of.c driver also claims the usb-ehci compatibility string,
even though it mostly is ibm,usb-ehci-440epx specific. ehci-platform.c is
not needed on ppc platforms, so add a !PPC_OF dependency to it to avoid
2 drivers claiming the same compatibility string getting build on ppc.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
Documentation/devicetree/bindings/usb/usb-ehci.txt | 25 +++-
.../devicetree/bindings/usb/via,vt8500-ehci.txt | 15 ---
.../devicetree/bindings/usb/vt8500-ehci.txt | 12 --
drivers/usb/host/Kconfig | 1 +
drivers/usb/host/ehci-platform.c | 149 +++++++++++++++++----
5 files changed, 142 insertions(+), 60 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
delete mode 100644 Documentation/devicetree/bindings/usb/vt8500-ehci.txt
diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
index fa18612..fad10f3 100644
--- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
@@ -7,13 +7,14 @@ Required properties:
(debug-port or other) can be also specified here, but only after
definition of standard EHCI registers.
- interrupts : one EHCI interrupt should be described here.
-If device registers are implemented in big endian mode, the device
-node should have "big-endian-regs" property.
-If controller implementation operates with big endian descriptors,
-"big-endian-desc" property should be specified.
-If both big endian registers and descriptors are used by the controller
-implementation, "big-endian" property can be specified instead of having
-both "big-endian-regs" and "big-endian-desc".
+
+Optional properties:
+ - big-endian-regs : boolean, set this for hcds with big-endian registers
+ - big-endian-desc : boolean, set this for hcds with big-endian descriptors
+ - big-endian : boolean, for hcds with big-endian-regs + big-endian-desc
+ - clocks : a list of phandle + clock specifier pairs
+ - phys : phandle + phy specifier pair
+ - phy-names : "usb"
Example (Sequoia 440EPx):
ehci at e0000300 {
@@ -23,3 +24,13 @@ Example (Sequoia 440EPx):
reg = <0 e0000300 90 0 e0000390 70>;
big-endian;
};
+
+Example (Allwinner sun4i A10 SoC):
+ ehci0: ehci at 0x01c14000 {
+ compatible = "allwinner,sun4i-a10-ehci", "usb-ehci";
+ reg = <0x01c14000 0x100>;
+ interrupts = <39>;
+ clocks = <&ahb_gates 1>;
+ phys = <&usbphy 1>;
+ phy-names = "usb";
+ };
diff --git a/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt b/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
deleted file mode 100644
index 17b3ad1..0000000
--- a/Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-VIA/Wondermedia VT8500 EHCI Controller
------------------------------------------------------
-
-Required properties:
-- compatible : "via,vt8500-ehci"
-- reg : Should contain 1 register ranges(address and length)
-- interrupts : ehci controller interrupt
-
-Example:
-
- ehci at d8007900 {
- compatible = "via,vt8500-ehci";
- reg = <0xd8007900 0x200>;
- interrupts = <43>;
- };
diff --git a/Documentation/devicetree/bindings/usb/vt8500-ehci.txt b/Documentation/devicetree/bindings/usb/vt8500-ehci.txt
deleted file mode 100644
index 5fb8fd6..0000000
--- a/Documentation/devicetree/bindings/usb/vt8500-ehci.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-VIA VT8500 and Wondermedia WM8xxx SoC USB controllers.
-
-Required properties:
- - compatible: Should be "via,vt8500-ehci" or "wm,prizm-ehci".
- - reg: Address range of the ehci registers. size should be 0x200
- - interrupts: Should contain the ehci interrupt.
-
-usb: ehci at D8007100 {
- compatible = "wm,prizm-ehci", "usb-ehci";
- reg = <0xD8007100 0x200>;
- interrupts = <1>;
-};
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index a9707da..e28cbe0 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -255,6 +255,7 @@ config USB_EHCI_ATH79
config USB_EHCI_HCD_PLATFORM
tristate "Generic EHCI driver for a platform device"
+ depends on !PPC_OF
default n
---help---
Adds an EHCI host driver for a generic platform device, which
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 7f30b71..d8aebc0 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -3,6 +3,7 @@
*
* Copyright 2007 Steven Brown <sbrown@cortland.com>
* Copyright 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
+ * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
*
* Derived from the ohci-ssb driver
* Copyright 2007 Michael Buesch <m@bues.ch>
@@ -18,6 +19,7 @@
*
* Licensed under the GNU/GPL. See COPYING for details.
*/
+#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/kernel.h>
@@ -25,6 +27,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
@@ -33,6 +36,13 @@
#include "ehci.h"
#define DRIVER_DESC "EHCI generic platform driver"
+#define EHCI_MAX_CLKS 3
+#define hcd_to_ehci_priv(h) ((struct ehci_platform_priv *)hcd_to_ehci(h)->priv)
+
+struct ehci_platform_priv {
+ struct clk *clks[EHCI_MAX_CLKS];
+ struct phy *phy;
+};
static const char hcd_name[] = "ehci-platform";
@@ -64,38 +74,90 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
return 0;
}
+static int ehci_platform_power_on(struct platform_device *dev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(dev);
+ struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
+ int clk, ret;
+
+ for (clk = 0; clk < EHCI_MAX_CLKS && priv->clks[clk]; clk++) {
+ ret = clk_prepare_enable(priv->clks[clk]);
+ if (ret)
+ goto err_disable_clks;
+ }
+
+ if (priv->phy) {
+ ret = phy_init(priv->phy);
+ if (ret)
+ goto err_disable_clks;
+
+ ret = phy_power_on(priv->phy);
+ if (ret)
+ goto err_exit_phy;
+ }
+
+ return 0;
+
+err_exit_phy:
+ phy_exit(priv->phy);
+err_disable_clks:
+ while (--clk >= 0)
+ clk_disable_unprepare(priv->clks[clk]);
+
+ return ret;
+}
+
+static void ehci_platform_power_off(struct platform_device *dev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(dev);
+ struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
+ int clk;
+
+ if (priv->phy) {
+ phy_power_off(priv->phy);
+ phy_exit(priv->phy);
+ }
+
+ for (clk = EHCI_MAX_CLKS - 1; clk >= 0; clk--)
+ if (priv->clks[clk])
+ clk_disable_unprepare(priv->clks[clk]);
+}
+
static struct hc_driver __read_mostly ehci_platform_hc_driver;
static const struct ehci_driver_overrides platform_overrides __initconst = {
- .reset = ehci_platform_reset,
+ .reset = ehci_platform_reset,
+ .extra_priv_size = sizeof(struct ehci_platform_priv),
};
-static struct usb_ehci_pdata ehci_platform_defaults;
+static struct usb_ehci_pdata ehci_platform_defaults = {
+ .power_on = ehci_platform_power_on,
+ .power_suspend = ehci_platform_power_off,
+ .power_off = ehci_platform_power_off,
+};
static int ehci_platform_probe(struct platform_device *dev)
{
struct usb_hcd *hcd;
struct resource *res_mem;
- struct usb_ehci_pdata *pdata;
- int irq;
- int err;
+ struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
+ struct ehci_platform_priv *priv;
+ int err, irq, clk = 0;
if (usb_disabled())
return -ENODEV;
/*
- * use reasonable defaults so platforms don't have to provide these.
- * with DT probing on ARM, none of these are set.
+ * Use reasonable defaults so platforms don't have to provide these
+ * with DT probing on ARM.
*/
- if (!dev_get_platdata(&dev->dev))
- dev->dev.platform_data = &ehci_platform_defaults;
+ if (!pdata)
+ pdata = &ehci_platform_defaults;
err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
if (err)
return err;
- pdata = dev_get_platdata(&dev->dev);
-
irq = platform_get_irq(dev, 0);
if (irq < 0) {
dev_err(&dev->dev, "no irq provided");
@@ -107,17 +169,40 @@ static int ehci_platform_probe(struct platform_device *dev)
return -ENXIO;
}
+ hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
+ dev_name(&dev->dev));
+ if (!hcd)
+ return -ENOMEM;
+
+ platform_set_drvdata(dev, hcd);
+ dev->dev.platform_data = pdata;
+ priv = hcd_to_ehci_priv(hcd);
+
+ if (pdata == &ehci_platform_defaults && dev->dev.of_node) {
+ priv->phy = devm_phy_get(&dev->dev, "usb");
+ if (IS_ERR(priv->phy)) {
+ err = PTR_ERR(priv->phy);
+ if (err == -EPROBE_DEFER)
+ goto err_put_hcd;
+ priv->phy = NULL;
+ }
+
+ for (clk = 0; clk < EHCI_MAX_CLKS; clk++) {
+ priv->clks[clk] = of_clk_get(dev->dev.of_node, clk);
+ if (IS_ERR(priv->clks[clk])) {
+ err = PTR_ERR(priv->clks[clk]);
+ if (err == -EPROBE_DEFER)
+ goto err_put_clks;
+ priv->clks[clk] = NULL;
+ break;
+ }
+ }
+ }
+
if (pdata->power_on) {
err = pdata->power_on(dev);
if (err < 0)
- return err;
- }
-
- hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
- dev_name(&dev->dev));
- if (!hcd) {
- err = -ENOMEM;
- goto err_power;
+ goto err_put_clks;
}
hcd->rsrc_start = res_mem->start;
@@ -126,21 +211,25 @@ static int ehci_platform_probe(struct platform_device *dev)
hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
- goto err_put_hcd;
+ goto err_power;
}
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err)
- goto err_put_hcd;
-
- platform_set_drvdata(dev, hcd);
+ goto err_power;
return err;
-err_put_hcd:
- usb_put_hcd(hcd);
err_power:
if (pdata->power_off)
pdata->power_off(dev);
+err_put_clks:
+ while (--clk >= 0)
+ clk_put(priv->clks[clk]);
+err_put_hcd:
+ if (pdata == &ehci_platform_defaults)
+ dev->dev.platform_data = NULL;
+
+ usb_put_hcd(hcd);
return err;
}
@@ -149,13 +238,19 @@ static int ehci_platform_remove(struct platform_device *dev)
{
struct usb_hcd *hcd = platform_get_drvdata(dev);
struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
+ struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
+ int clk;
usb_remove_hcd(hcd);
- usb_put_hcd(hcd);
if (pdata->power_off)
pdata->power_off(dev);
+ for (clk = 0; clk < EHCI_MAX_CLKS && priv->clks[clk]; clk++)
+ clk_put(priv->clks[clk]);
+
+ usb_put_hcd(hcd);
+
if (pdata == &ehci_platform_defaults)
dev->dev.platform_data = NULL;
@@ -206,8 +301,10 @@ static int ehci_platform_resume(struct device *dev)
static const struct of_device_id vt8500_ehci_ids[] = {
{ .compatible = "via,vt8500-ehci", },
{ .compatible = "wm,prizm-ehci", },
+ { .compatible = "usb-ehci", },
{}
};
+MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
static const struct platform_device_id ehci_platform_table[] = {
{ "ehci-platform", 0 },
--
1.8.4.2
^ permalink raw reply related
* [PATCH v7 1/2] ohci-platform: Add support for devicetree instantiation
From: Hans de Goede @ 2014-01-15 19:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389813883-567-1-git-send-email-hdegoede@redhat.com>
Add support for ohci-platform instantiation from devicetree, including
optionally getting clks and a phy from devicetree, and enabling / disabling
those on power_on / off.
This should allow using ohci-platform from devicetree in various cases.
Specifically after this commit it can be used for the ohci controller found
on Allwinner sunxi SoCs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---
Documentation/devicetree/bindings/usb/usb-ohci.txt | 22 +++
drivers/usb/host/ohci-platform.c | 164 ++++++++++++++++++---
2 files changed, 162 insertions(+), 24 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/usb-ohci.txt
diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
new file mode 100644
index 0000000..f9d6c73
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
@@ -0,0 +1,22 @@
+USB OHCI controllers
+
+Required properties:
+- compatible : "usb-ohci"
+- reg : ohci controller register range (address and length)
+- interrupts : ohci controller interrupt
+
+Optional properties:
+- clocks : a list of phandle + clock specifier pairs
+- phys : phandle + phy specifier pair
+- phy-names : "usb"
+
+Example:
+
+ ohci0: ohci at 0x01c14400 {
+ compatible = "allwinner,sun4i-a10-ohci", "usb-ohci";
+ reg = <0x01c14400 0x100>;
+ interrupts = <64>;
+ clocks = <&usb_clk 6>, <&ahb_gates 2>;
+ phys = <&usbphy 1>;
+ phy-names = "usb";
+ };
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index f351ff5..b2d0e1e 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -3,6 +3,7 @@
*
* Copyright 2007 Michael Buesch <m@bues.ch>
* Copyright 2011-2012 Hauke Mehrtens <hauke@hauke-m.de>
+ * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
*
* Derived from the OCHI-SSB driver
* Derived from the OHCI-PCI driver
@@ -14,11 +15,14 @@
* Licensed under the GNU/GPL. See COPYING for details.
*/
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
#include <linux/hrtimer.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/usb/ohci_pdriver.h>
#include <linux/usb.h>
@@ -27,6 +31,13 @@
#include "ohci.h"
#define DRIVER_DESC "OHCI generic platform driver"
+#define OHCI_MAX_CLKS 3
+#define hcd_to_ohci_priv(h) ((struct ohci_platform_priv *)hcd_to_ohci(h)->priv)
+
+struct ohci_platform_priv {
+ struct clk *clks[OHCI_MAX_CLKS];
+ struct phy *phy;
+};
static const char hcd_name[] = "ohci-platform";
@@ -48,11 +59,67 @@ static int ohci_platform_reset(struct usb_hcd *hcd)
return ohci_setup(hcd);
}
+static int ohci_platform_power_on(struct platform_device *dev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(dev);
+ struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
+ int clk, ret;
+
+ for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) {
+ ret = clk_prepare_enable(priv->clks[clk]);
+ if (ret)
+ goto err_disable_clks;
+ }
+
+ if (priv->phy) {
+ ret = phy_init(priv->phy);
+ if (ret)
+ goto err_disable_clks;
+
+ ret = phy_power_on(priv->phy);
+ if (ret)
+ goto err_exit_phy;
+ }
+
+ return 0;
+
+err_exit_phy:
+ phy_exit(priv->phy);
+err_disable_clks:
+ while (--clk >= 0)
+ clk_disable_unprepare(priv->clks[clk]);
+
+ return ret;
+}
+
+static void ohci_platform_power_off(struct platform_device *dev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(dev);
+ struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
+ int clk;
+
+ if (priv->phy) {
+ phy_power_off(priv->phy);
+ phy_exit(priv->phy);
+ }
+
+ for (clk = OHCI_MAX_CLKS - 1; clk >= 0; clk--)
+ if (priv->clks[clk])
+ clk_disable_unprepare(priv->clks[clk]);
+}
+
static struct hc_driver __read_mostly ohci_platform_hc_driver;
static const struct ohci_driver_overrides platform_overrides __initconst = {
- .product_desc = "Generic Platform OHCI controller",
- .reset = ohci_platform_reset,
+ .product_desc = "Generic Platform OHCI controller",
+ .reset = ohci_platform_reset,
+ .extra_priv_size = sizeof(struct ohci_platform_priv),
+};
+
+static struct usb_ohci_pdata ohci_platform_defaults = {
+ .power_on = ohci_platform_power_on,
+ .power_suspend = ohci_platform_power_off,
+ .power_off = ohci_platform_power_off,
};
static int ohci_platform_probe(struct platform_device *dev)
@@ -60,17 +127,23 @@ static int ohci_platform_probe(struct platform_device *dev)
struct usb_hcd *hcd;
struct resource *res_mem;
struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
- int irq;
- int err = -ENOMEM;
-
- if (!pdata) {
- WARN_ON(1);
- return -ENODEV;
- }
+ struct ohci_platform_priv *priv;
+ int err, irq, clk = 0;
if (usb_disabled())
return -ENODEV;
+ /*
+ * Use reasonable defaults so platforms don't have to provide these
+ * with DT probing on ARM.
+ */
+ if (!pdata)
+ pdata = &ohci_platform_defaults;
+
+ err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+
irq = platform_get_irq(dev, 0);
if (irq < 0) {
dev_err(&dev->dev, "no irq provided");
@@ -83,17 +156,40 @@ static int ohci_platform_probe(struct platform_device *dev)
return -ENXIO;
}
+ hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
+ dev_name(&dev->dev));
+ if (!hcd)
+ return -ENOMEM;
+
+ platform_set_drvdata(dev, hcd);
+ dev->dev.platform_data = pdata;
+ priv = hcd_to_ohci_priv(hcd);
+
+ if (pdata == &ohci_platform_defaults && dev->dev.of_node) {
+ priv->phy = devm_phy_get(&dev->dev, "usb");
+ if (IS_ERR(priv->phy)) {
+ err = PTR_ERR(priv->phy);
+ if (err == -EPROBE_DEFER)
+ goto err_put_hcd;
+ priv->phy = NULL;
+ }
+
+ for (clk = 0; clk < OHCI_MAX_CLKS; clk++) {
+ priv->clks[clk] = of_clk_get(dev->dev.of_node, clk);
+ if (IS_ERR(priv->clks[clk])) {
+ err = PTR_ERR(priv->clks[clk]);
+ if (err == -EPROBE_DEFER)
+ goto err_put_clks;
+ priv->clks[clk] = NULL;
+ break;
+ }
+ }
+ }
+
if (pdata->power_on) {
err = pdata->power_on(dev);
if (err < 0)
- return err;
- }
-
- hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
- dev_name(&dev->dev));
- if (!hcd) {
- err = -ENOMEM;
- goto err_power;
+ goto err_put_clks;
}
hcd->rsrc_start = res_mem->start;
@@ -102,21 +198,25 @@ static int ohci_platform_probe(struct platform_device *dev)
hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
- goto err_put_hcd;
+ goto err_power;
}
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err)
- goto err_put_hcd;
-
- platform_set_drvdata(dev, hcd);
+ goto err_power;
return err;
-err_put_hcd:
- usb_put_hcd(hcd);
err_power:
if (pdata->power_off)
pdata->power_off(dev);
+err_put_clks:
+ while (--clk >= 0)
+ clk_put(priv->clks[clk]);
+err_put_hcd:
+ if (pdata == &ohci_platform_defaults)
+ dev->dev.platform_data = NULL;
+
+ usb_put_hcd(hcd);
return err;
}
@@ -125,13 +225,22 @@ static int ohci_platform_remove(struct platform_device *dev)
{
struct usb_hcd *hcd = platform_get_drvdata(dev);
struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
+ struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
+ int clk;
usb_remove_hcd(hcd);
- usb_put_hcd(hcd);
if (pdata->power_off)
pdata->power_off(dev);
+ for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++)
+ clk_put(priv->clks[clk]);
+
+ usb_put_hcd(hcd);
+
+ if (pdata == &ohci_platform_defaults)
+ dev->dev.platform_data = NULL;
+
return 0;
}
@@ -178,6 +287,12 @@ static int ohci_platform_resume(struct device *dev)
#define ohci_platform_resume NULL
#endif /* CONFIG_PM */
+static const struct of_device_id ohci_platform_ids[] = {
+ { .compatible = "usb-ohci", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ohci_platform_ids);
+
static const struct platform_device_id ohci_platform_table[] = {
{ "ohci-platform", 0 },
{ }
@@ -198,6 +313,7 @@ static struct platform_driver ohci_platform_driver = {
.owner = THIS_MODULE,
.name = "ohci-platform",
.pm = &ohci_platform_pm_ops,
+ .of_match_table = ohci_platform_ids,
}
};
--
1.8.4.2
^ permalink raw reply related
* [PATCH v7 0/2] ohci and ehci-platform clks, phy and dt support
From: Hans de Goede @ 2014-01-15 19:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi All,
This version of my ohci and ehci-platform clks, phy and dt support patch-set,
really fixes the 2 small bugs Alan found.
Regards,
Hans
^ permalink raw reply
* [PATCHv13 00/40] ARM: TI SoC clock DT conversion
From: Mike Turquette @ 2014-01-15 19:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20140115171323.GA22739@atomide.com>
Quoting Tony Lindgren (2014-01-15 09:13:23)
> * Mike Turquette <mturquette@linaro.org> [140114 19:52]:
> > >
> > > These 40 patches apply very cleanly on top of clk-next with 2
> > > exceptions:
> > >
> > > 1) I did not apply "[PATCH 30/42] ARM: dts: AM35xx: use DT clock data"
> > > because I do not have arch/arm/boot/dts/am3517.dtsi in clk-next (based
> > > on 3.13-rc1).
> > >
> > > 2) Minor merge conflict in arch/arm/boot/dts/omap3.dtsi which I think I
> > > resolved correctly but would like verification.
> > >
> > > I'd prefer to simply merge these patches into clk-next, which is the
> > > most straightforward route. Any ideas on how to handle the missing
> > > AM35xx dtsi data? It can always go as a separate fix after this stuff
> > > gets merged which, ironically, is how that file was created in the first
> > > place.
>
> You could do something like this to take advantage of fast forward and
> not have to do a merge back from mainline:
>
> $ git checkout -b am3517-clk v3.13-rc8 # or any other -rc with am3517.dtsi
> $ git merge clk-next-omap # this fast forwards clk-next-omap to the desired -rc
> $ git am am3517-clk-patch
> $ git checkout clk-next
> $ git merge clk-next-omap # this fast forwards clk-next to the desired -rc
Tony,
That makes sense, but is there anything bad about doing that for a
branch you intend to send as a pull request? I don't see how any of the
commits get re-written or anything... I just wonder if there is some
subtlety that I am not accounting for that makes this approach bad for
sending to Linus.
Regards,
Mike
>
> Regards,
>
> Tony
^ permalink raw reply
* [PATCH v4 0/7] mtd: spi-nor: add a new framework for SPI NOR
From: Jagan Teki @ 2014-01-15 19:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1387950629-27448-1-git-send-email-b32955@freescale.com>
Hi,
On Wed, Dec 25, 2013 at 11:20 AM, Huang Shijie <b32955@freescale.com> wrote:
> 1.) Why add a new framework for SPI NOR?
> The SPI-NOR controller such as Freescale's Quadspi controller is working
> in a different way from the SPI bus. It should knows the NOR commands to
> find the right LUT sequence. Unfortunately, the current code can not meet
> this requirement.
>
> 2.) How does this patch set do?
> This patch set adds a new spi-nor layer.
> Before this patch, the layer is like:
>
> MTD
> ------------------------
> m25p80
> ------------------------
> spi bus driver
> ------------------------
> SPI NOR chip
>
> After this patch, the layer is like:
> MTD
> ------------------------
> spi-nor
> ------------------------
> m25p80
> ------------------------
> spi bus driver
> ------------------------
> SPI NOR chip
>
> With the spi-nor controller driver(Freescale Quadspi), it looks like:
> MTD
> ------------------------
> spi-nor
> ------------------------
> fsl-quadspi
> ------------------------
> SPI NOR chip
I'm new to this thread, may be I'll ask basic questions.
1) what does m25p80 contains with your new framework - will excludes
quad stuff if they add
2) I didn't understand why the controller driver fsl-quadspi will be
in mtd becuase as it's (q)spi driver
may does flash or non-flash functionalities if ie, the case should be
part of drivers/spi/*
3) Can you explain your framework precisely take an example of like
spi_controller_A with spi_flash_A
and qspi_controller_B and qspi_flash_B - how will this new framework operates.
>
> 3.) more details
> This patch set adds a new data structrue spi_nor{}, clones most the common
> code to spi-nor.c. Add spi_nor_xfer_cfg {} for the fundamental primitives:
> read_xfer/write_xfer.
>
> Make the m25p80.c/fsl_quaspi.c use the new APIs.
>
> 4.) Change log:
> v3 --> v4:
> [1] move the wait_till_ready to the @read hook.
> [2] convert to linux-doc style comment.
> [3] remove the some DT property for QuadSPI driver, such as
> "fsl,nor-size".
> [4] others
>
> v2 --> v3:
> [1] add prepare/unprepare hooks for spi_nor{}.
> [2] add a new "priv" field for spi_nor{}.
> [3] add the Freescale Quadspi driver which supports the Quad read by
> default.
>
> v1 --> v2:
> [1] follow Angus's advice, add more hooks and data structrures.
> [2] others.
>
>
> Huang Shijie (7):
> mtd: spi-nor: copy the SPI NOR commands to a new header file
> mtd: spi-nor: add the basic data structures
> mtd: spi-nor: add the framework for SPI NOR
> mtd: m25p80: use the SPI nor framework
> mtd: spi-nor: add a helper to find the spi_device_id
> Documentation: add the binding file for Freescale QuadSPI driver
> mtd: spi-nor: Add Freescale QuadSPI driver
>
> .../devicetree/bindings/mtd/fsl-quadspi.txt | 26 +
> drivers/mtd/Kconfig | 2 +
> drivers/mtd/Makefile | 1 +
> drivers/mtd/devices/Kconfig | 2 +-
> drivers/mtd/devices/m25p80.c | 1275 ++------------------
> drivers/mtd/spi-nor/Kconfig | 12 +
> drivers/mtd/spi-nor/Makefile | 2 +
> drivers/mtd/spi-nor/fsl-quadspi.c | 957 +++++++++++++++
> drivers/mtd/spi-nor/spi-nor.c | 1093 +++++++++++++++++
> include/linux/mtd/spi-nor.h | 194 +++
> 10 files changed, 2387 insertions(+), 1177 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/mtd/fsl-quadspi.txt
> create mode 100644 drivers/mtd/spi-nor/Kconfig
> create mode 100644 drivers/mtd/spi-nor/Makefile
> create mode 100644 drivers/mtd/spi-nor/fsl-quadspi.c
> create mode 100644 drivers/mtd/spi-nor/spi-nor.c
> create mode 100644 include/linux/mtd/spi-nor.h
>
--
Thanks,
Jagan.
^ permalink raw reply
* [RESEND][RFC PATCH 2/2] arm: Get rid of meminfo
From: Laura Abbott @ 2014-01-15 19:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389813057-26572-1-git-send-email-lauraa@codeaurora.org>
memblock is now fully integrated into the kernel and is the prefered
method for tracking memory. Rather than reinvent the wheel with
meminfo, migrate to using memblock directly instead of meminfo as
an intermediate.
TODO: fix early_mem, get rid of NR_BANKS?
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/include/asm/mach/arch.h | 4 +-
arch/arm/include/asm/memblock.h | 3 +-
arch/arm/include/asm/setup.h | 23 ------
arch/arm/kernel/atags_parse.c | 5 +-
arch/arm/kernel/setup.c | 33 +++------
arch/arm/mach-clps711x/board-clep7312.c | 7 +-
arch/arm/mach-clps711x/board-edb7211.c | 10 +--
arch/arm/mach-clps711x/board-p720t.c | 2 +-
| 2 +-
| 2 +-
arch/arm/mach-msm/board-halibut.c | 6 --
arch/arm/mach-msm/board-mahimahi.c | 13 +--
arch/arm/mach-msm/board-msm7x30.c | 3 +-
arch/arm/mach-msm/board-sapphire.c | 13 +--
arch/arm/mach-msm/board-trout.c | 8 +-
arch/arm/mach-orion5x/common.c | 3 +-
arch/arm/mach-orion5x/common.h | 3 +-
arch/arm/mach-pxa/cm-x300.c | 3 +-
arch/arm/mach-pxa/corgi.c | 10 +--
arch/arm/mach-pxa/eseries.c | 9 +-
arch/arm/mach-pxa/poodle.c | 8 +-
arch/arm/mach-pxa/spitz.c | 9 +--
arch/arm/mach-pxa/tosa.c | 8 +-
arch/arm/mach-realview/core.c | 11 +--
arch/arm/mach-realview/core.h | 3 +-
arch/arm/mach-realview/realview_pb1176.c | 8 +-
arch/arm/mach-realview/realview_pbx.c | 17 ++---
arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 8 +-
arch/arm/mach-sa1100/assabet.c | 2 +-
arch/arm/mm/init.c | 61 ++++++----------
arch/arm/mm/mmu.c | 122 ++++++++++--------------------
32 files changed, 143 insertions(+), 284 deletions(-)
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 17a3fa2..c43473a 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -14,7 +14,6 @@
#include <linux/reboot.h>
struct tag;
-struct meminfo;
struct pt_regs;
struct smp_operations;
#ifdef CONFIG_SMP
@@ -47,8 +46,7 @@ struct machine_desc {
enum reboot_mode reboot_mode; /* default restart mode */
struct smp_operations *smp; /* SMP operations */
bool (*smp_init)(void);
- void (*fixup)(struct tag *, char **,
- struct meminfo *);
+ void (*fixup)(struct tag *, char **);
void (*init_meminfo)(void);
void (*reserve)(void);/* reserve mem blocks */
void (*map_io)(void);/* IO mapping function */
diff --git a/arch/arm/include/asm/memblock.h b/arch/arm/include/asm/memblock.h
index c2f5102..bf47a6c 100644
--- a/arch/arm/include/asm/memblock.h
+++ b/arch/arm/include/asm/memblock.h
@@ -1,10 +1,9 @@
#ifndef _ASM_ARM_MEMBLOCK_H
#define _ASM_ARM_MEMBLOCK_H
-struct meminfo;
struct machine_desc;
-void arm_memblock_init(struct meminfo *, const struct machine_desc *);
+void arm_memblock_init(const struct machine_desc *);
phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);
#endif
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 8d6a089..0196091 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -26,29 +26,6 @@ static const struct tagtable __tagtable_##fn __tag = { tag, fn }
*/
#define NR_BANKS CONFIG_ARM_NR_BANKS
-struct membank {
- phys_addr_t start;
- phys_addr_t size;
- unsigned int highmem;
-};
-
-struct meminfo {
- int nr_banks;
- struct membank bank[NR_BANKS];
-};
-
-extern struct meminfo meminfo;
-
-#define for_each_bank(iter,mi) \
- for (iter = 0; iter < (mi)->nr_banks; iter++)
-
-#define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
-#define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
-#define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
-#define bank_phys_start(bank) (bank)->start
-#define bank_phys_end(bank) ((bank)->start + (bank)->size)
-#define bank_phys_size(bank) (bank)->size
-
extern int arm_add_memory(u64 start, u64 size);
extern void early_print(const char *str, ...);
extern void dump_machine_table(void);
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 8c14de8..7807ef5 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -22,6 +22,7 @@
#include <linux/fs.h>
#include <linux/root_dev.h>
#include <linux/screen_info.h>
+#include <linux/memblock.h>
#include <asm/setup.h>
#include <asm/system_info.h>
@@ -222,10 +223,10 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
}
if (mdesc->fixup)
- mdesc->fixup(tags, &from, &meminfo);
+ mdesc->fixup(tags, &from);
if (tags->hdr.tag == ATAG_CORE) {
- if (meminfo.nr_banks != 0)
+ if (memblock_phys_mem_size())
squash_mem_tags(tags);
save_atags(tags);
parse_tags(tags);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 5f4cb92..97ed3fc 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -625,15 +625,8 @@ void __init dump_machine_table(void)
int __init arm_add_memory(u64 start, u64 size)
{
- struct membank *bank = &meminfo.bank[meminfo.nr_banks];
u64 aligned_start;
- if (meminfo.nr_banks >= NR_BANKS) {
- pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n",
- (long long)start);
- return -EINVAL;
- }
-
/*
* Ensure that start/size are aligned to a page boundary.
* Size is appropriately rounded down, start is rounded up.
@@ -674,17 +667,17 @@ int __init arm_add_memory(u64 start, u64 size)
aligned_start = PHYS_OFFSET;
}
- bank->start = aligned_start;
- bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
+ start = aligned_start;
+ size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
/*
* Check whether this memory region has non-zero size or
* invalid node number.
*/
- if (bank->size == 0)
+ if (size == 0)
return -EINVAL;
- meminfo.nr_banks++;
+ memblock_add(start, size);
return 0;
}
@@ -692,6 +685,12 @@ int __init arm_add_memory(u64 start, u64 size)
* Pick out the memory size. We look for mem=size at start,
* where start and size are "size[KkMm]"
*/
+
+/*
+ * XXX this is busted when just using memblock. Need to add memblock
+ * hook to reset.
+ */
+
static int __init early_mem(char *p)
{
static int usermem __initdata = 0;
@@ -706,7 +705,6 @@ static int __init early_mem(char *p)
*/
if (usermem == 0) {
usermem = 1;
- meminfo.nr_banks = 0;
}
start = PHYS_OFFSET;
@@ -851,13 +849,6 @@ static void __init reserve_crashkernel(void)
static inline void reserve_crashkernel(void) {}
#endif /* CONFIG_KEXEC */
-static int __init meminfo_cmp(const void *_a, const void *_b)
-{
- const struct membank *a = _a, *b = _b;
- long cmp = bank_pfn_start(a) - bank_pfn_start(b);
- return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
-}
-
void __init hyp_mode_check(void)
{
#ifdef CONFIG_ARM_VIRT_EXT
@@ -900,12 +891,10 @@ void __init setup_arch(char **cmdline_p)
parse_early_param();
- sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
-
early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
setup_dma_zone(mdesc);
sanity_check_meminfo();
- arm_memblock_init(&meminfo, mdesc);
+ arm_memblock_init(mdesc);
paging_init(mdesc);
request_standard_resources(mdesc);
diff --git a/arch/arm/mach-clps711x/board-clep7312.c b/arch/arm/mach-clps711x/board-clep7312.c
index b476424..4d04b91 100644
--- a/arch/arm/mach-clps711x/board-clep7312.c
+++ b/arch/arm/mach-clps711x/board-clep7312.c
@@ -18,6 +18,7 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/string.h>
+#include <linux/memblock.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -26,11 +27,9 @@
#include "common.h"
static void __init
-fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi)
+fixup_clep7312(struct tag *tags, char **cmdline)
{
- mi->nr_banks=1;
- mi->bank[0].start = 0xc0000000;
- mi->bank[0].size = 0x01000000;
+ memblock_add(0xc0000000, 0x01000000);
}
MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c
index fe6184e..b617aa2 100644
--- a/arch/arm/mach-clps711x/board-edb7211.c
+++ b/arch/arm/mach-clps711x/board-edb7211.c
@@ -16,6 +16,7 @@
#include <linux/interrupt.h>
#include <linux/backlight.h>
#include <linux/platform_device.h>
+#include <linux/memblock.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/partitions.h>
@@ -133,7 +134,7 @@ static void __init edb7211_reserve(void)
}
static void __init
-fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
+fixup_edb7211(struct tag *tags, char **cmdline)
{
/*
* Bank start addresses are not present in the information
@@ -143,11 +144,8 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
* Banks sizes _are_ present in the param block, but we're
* not using that information yet.
*/
- mi->bank[0].start = 0xc0000000;
- mi->bank[0].size = SZ_8M;
- mi->bank[1].start = 0xc1000000;
- mi->bank[1].size = SZ_8M;
- mi->nr_banks = 2;
+ memblock_add(0xc0000000, SZ_8M);
+ memblock_add(0xc1000000, SZ_8M);
}
static void __init edb7211_init(void)
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c
index dd81b06..c1c6729 100644
--- a/arch/arm/mach-clps711x/board-p720t.c
+++ b/arch/arm/mach-clps711x/board-p720t.c
@@ -295,7 +295,7 @@ static struct generic_bl_info p720t_lcd_backlight_pdata = {
};
static void __init
-fixup_p720t(struct tag *tag, char **cmdline, struct meminfo *mi)
+fixup_p720t(struct tag *tag, char **cmdline)
{
/*
* Our bootloader doesn't setup any tags (yet).
--git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 9669cc0..de86ab6 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -76,7 +76,7 @@ __initcall(cats_hw_init);
* hard reboots fail on early boards.
*/
static void __init
-fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
+fixup_cats(struct tag *tags, char **cmdline)
{
screen_info.orig_video_lines = 25;
screen_info.orig_video_points = 16;
--git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index eb1fa5c..cdee08c 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -620,7 +620,7 @@ __initcall(nw_hw_init);
* the parameter page.
*/
static void __init
-fixup_netwinder(struct tag *tags, char **cmdline, struct meminfo *mi)
+fixup_netwinder(struct tag *tags, char **cmdline)
{
#ifdef CONFIG_ISAPNP
extern int isapnp_disable;
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index a775298..61bfe58 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -83,11 +83,6 @@ static void __init halibut_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init halibut_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
-{
-}
-
static void __init halibut_map_io(void)
{
msm_map_common_io();
@@ -100,7 +95,6 @@ static void __init halibut_init_late(void)
MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
.atag_offset = 0x100,
- .fixup = halibut_fixup,
.map_io = halibut_map_io,
.init_early = halibut_init_early,
.init_irq = halibut_init_irq,
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index 7d9981c..873c3ca 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -22,6 +22,7 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
+#include <linux/memblock.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -52,16 +53,10 @@ static void __init mahimahi_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init mahimahi_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init mahimahi_fixup(struct tag *tags, char **cmdline)
{
- mi->nr_banks = 2;
- mi->bank[0].start = PHYS_OFFSET;
- mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
- mi->bank[0].size = (219*1024*1024);
- mi->bank[1].start = MSM_HIGHMEM_BASE;
- mi->bank[1].node = PHYS_TO_NID(MSM_HIGHMEM_BASE);
- mi->bank[1].size = MSM_HIGHMEM_SIZE;
+ memblock_add(PHYS_OFFSET, 219*SZ_1M);
+ memblock_add(MSM_HIGHMEM_BASE, MSM_HIGHMEM_SIZE);
}
static void __init mahimahi_map_io(void)
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index 46de789..b621b23 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -40,8 +40,7 @@
#include "proc_comm.h"
#include "common.h"
-static void __init msm7x30_fixup(struct tag *tag, char **cmdline,
- struct meminfo *mi)
+static void __init msm7x30_fixup(struct tag *tag, char **cmdline)
{
for (; tag->hdr.size; tag = tag_next(tag))
if (tag->hdr.tag == ATAG_MEM && tag->u.mem.start == 0x200000) {
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 3276051..e509679 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -35,6 +35,7 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
+#include <linux/memblock.h>
#include "gpio_chip.h"
#include "board-sapphire.h"
@@ -74,22 +75,18 @@ static struct map_desc sapphire_io_desc[] __initdata = {
}
};
-static void __init sapphire_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init sapphire_fixup(struct tag *tags, char **cmdline)
{
int smi_sz = parse_tag_smi((const struct tag *)tags);
- mi->nr_banks = 1;
- mi->bank[0].start = PHYS_OFFSET;
- mi->bank[0].node = PHYS_TO_NID(PHYS_OFFSET);
if (smi_sz == 32) {
- mi->bank[0].size = (84*1024*1024);
+ memblock_add(PHYS_OFFSET, 84*SZ_1M);
} else if (smi_sz == 64) {
- mi->bank[0].size = (101*1024*1024);
+ memblock_add(PHYS_OFFSET, 101*SZ_1M);
} else {
+ memblock_add(PHYS_OFFSET, 101*SZ_1M);
/* Give a default value when not get smi size */
smi_sz = 64;
- mi->bank[0].size = (101*1024*1024);
}
}
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 015d544..58826cf 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/clkdev.h>
+#include <linux/memblock.h>
#include <asm/system_info.h>
#include <asm/mach-types.h>
@@ -55,12 +56,9 @@ static void __init trout_init_irq(void)
msm_init_irq();
}
-static void __init trout_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init trout_fixup(struct tag *tags, char **cmdline)
{
- mi->nr_banks = 1;
- mi->bank[0].start = PHYS_OFFSET;
- mi->bank[0].size = (101*1024*1024);
+ memblock_add(PHYS_OFFSET, 101*SZ_1M);
}
static void __init trout_init(void)
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 3f1de11..6bbb7b5 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -365,8 +365,7 @@ void orion5x_restart(enum reboot_mode mode, const char *cmd)
* Many orion-based systems have buggy bootloader implementations.
* This is a common fixup for bogus memory tags.
*/
-void __init tag_fixup_mem32(struct tag *t, char **from,
- struct meminfo *meminfo)
+void __init tag_fixup_mem32(struct tag *t, char **from)
{
for (; t->hdr.size; t = tag_next(t))
if (t->hdr.tag == ATAG_MEM &&
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index f565f99..175ec4c 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -71,9 +71,8 @@ void edmini_v2_init(void);
static inline void edmini_v2_init(void) {};
#endif
-struct meminfo;
struct tag;
-extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *);
+extern void __init tag_fixup_mem32(struct tag *, char **);
/*****************************************************************************
* Helpers to access Orion registers
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 584439bf..4d3588d 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -837,8 +837,7 @@ static void __init cm_x300_init(void)
cm_x300_init_bl();
}
-static void __init cm_x300_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init cm_x300_fixup(struct tag *tags, char **cmdline)
{
/* Make sure that mi->bank[0].start = PHYS_ADDR */
for (; tags->hdr.size; tags = tag_next(tags))
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index f162f1b..a763744 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -33,6 +33,7 @@
#include <linux/mtd/sharpsl.h>
#include <linux/input/matrix_keypad.h>
#include <linux/module.h>
+#include <linux/memblock.h>
#include <video/w100fb.h>
#include <asm/setup.h>
@@ -713,16 +714,13 @@ static void __init corgi_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init fixup_corgi(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init fixup_corgi(struct tag *tags, char **cmdline)
{
sharpsl_save_param();
- mi->nr_banks=1;
- mi->bank[0].start = 0xa0000000;
if (machine_is_corgi())
- mi->bank[0].size = (32*1024*1024);
+ memblock_add(0xa0000000, SZ_32M);
else
- mi->bank[0].size = (64*1024*1024);
+ memblock_add(0xa0000000, SZ_64M);
}
#ifdef CONFIG_MACH_CORGI
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index 8280ebca..cfb8641 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -21,6 +21,7 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/usb/gpio_vbus.h>
+#include <linux/memblock.h>
#include <video/w100fb.h>
@@ -41,14 +42,12 @@
#include "clock.h"
/* Only e800 has 128MB RAM */
-void __init eseries_fixup(struct tag *tags, char **cmdline, struct meminfo *mi)
+void __init eseries_fixup(struct tag *tags, char **cmdline)
{
- mi->nr_banks=1;
- mi->bank[0].start = 0xa0000000;
if (machine_is_e800())
- mi->bank[0].size = (128*1024*1024);
+ memblock_add(0xa0000000, SZ_128M);
else
- mi->bank[0].size = (64*1024*1024);
+ memblock_add(0xa0000000, SZ_64M);
}
struct gpio_vbus_mach_info e7xx_udc_info = {
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index aedf053..1319916 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -29,6 +29,7 @@
#include <linux/spi/ads7846.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/mtd/sharpsl.h>
+#include <linux/memblock.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -456,13 +457,10 @@ static void __init poodle_init(void)
poodle_init_spi();
}
-static void __init fixup_poodle(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init fixup_poodle(struct tag *tags, char **cmdline)
{
sharpsl_save_param();
- mi->nr_banks=1;
- mi->bank[0].start = 0xa0000000;
- mi->bank[0].size = (32*1024*1024);
+ memblock_add(0xa0000000, SZ_32M);
}
MACHINE_START(POODLE, "SHARP Poodle")
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 0b11c1a..51d814e 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -32,6 +32,7 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/reboot.h>
+#include <linux/memblock.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -971,13 +972,9 @@ static void __init spitz_init(void)
spitz_i2c_init();
}
-static void __init spitz_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init spitz_fixup(struct tag *tags, char **cmdline)
{
- sharpsl_save_param();
- mi->nr_banks = 1;
- mi->bank[0].start = 0xa0000000;
- mi->bank[0].size = (64*1024*1024);
+ memblock_addr(0xa0000000, SZ_64M);
}
#ifdef CONFIG_MACH_SPITZ
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index ef5557b..c158a6e 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -37,6 +37,7 @@
#include <linux/i2c/pxa-i2c.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/reboot.h>
+#include <linux/memblock.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -960,13 +961,10 @@ static void __init tosa_init(void)
platform_add_devices(devices, ARRAY_SIZE(devices));
}
-static void __init fixup_tosa(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init fixup_tosa(struct tag *tags, char **cmdline)
{
sharpsl_save_param();
- mi->nr_banks=1;
- mi->bank[0].start = 0xa0000000;
- mi->bank[0].size = (64*1024*1024);
+ memblock_add(0xa0000000, SZ_64M);
}
MACHINE_START(TOSA, "SHARP Tosa")
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 1d5ee5c..c2fae3a 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -31,6 +31,7 @@
#include <linux/amba/mmci.h>
#include <linux/gfp.h>
#include <linux/mtd/physmap.h>
+#include <linux/memblock.h>
#include <mach/hardware.h>
#include <asm/irq.h>
@@ -370,19 +371,15 @@ void __init realview_timer_init(unsigned int timer_irq)
/*
* Setup the memory banks.
*/
-void realview_fixup(struct tag *tags, char **from, struct meminfo *meminfo)
+void realview_fixup(struct tag *tags, char **from)
{
/*
* Most RealView platforms have 512MB contiguous RAM at 0x70000000.
* Half of this is mirrored at 0.
*/
#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
- meminfo->bank[0].start = 0x70000000;
- meminfo->bank[0].size = SZ_512M;
- meminfo->nr_banks = 1;
+ memblock_add(0x70000000, SZ_512M);
#else
- meminfo->bank[0].start = 0;
- meminfo->bank[0].size = SZ_256M;
- meminfo->nr_banks = 1;
+ memblock_add(0, SZ_256M);
#endif
}
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 602ca5e..844946d 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -51,8 +51,7 @@ extern int realview_flash_register(struct resource *res, u32 num);
extern int realview_eth_register(const char *name, struct resource *res);
extern int realview_usb_register(struct resource *res);
extern void realview_init_early(void);
-extern void realview_fixup(struct tag *tags, char **from,
- struct meminfo *meminfo);
+extern void realview_fixup(struct tag *tags, char **from);
extern struct smp_operations realview_smp_ops;
extern void realview_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index c5eade7..6abf6a0 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -32,6 +32,7 @@
#include <linux/irqchip/arm-gic.h>
#include <linux/platform_data/clk-realview.h>
#include <linux/reboot.h>
+#include <linux/memblock.h>
#include <mach/hardware.h>
#include <asm/irq.h>
@@ -339,15 +340,12 @@ static void realview_pb1176_restart(enum reboot_mode mode, const char *cmd)
dsb();
}
-static void realview_pb1176_fixup(struct tag *tags, char **from,
- struct meminfo *meminfo)
+static void realview_pb1176_fixup(struct tag *tags, char **from)
{
/*
* RealView PB1176 only has 128MB of RAM mapped at 0.
*/
- meminfo->bank[0].start = 0;
- meminfo->bank[0].size = SZ_128M;
- meminfo->nr_banks = 1;
+ memblock_add(0, SZ_128M);
}
static void __init realview_pb1176_init(void)
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 9d75493..60d322a 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -29,6 +29,7 @@
#include <linux/irqchip/arm-gic.h>
#include <linux/platform_data/clk-realview.h>
#include <linux/reboot.h>
+#include <linux/memblock.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
@@ -325,23 +326,19 @@ static void __init realview_pbx_timer_init(void)
realview_pbx_twd_init();
}
-static void realview_pbx_fixup(struct tag *tags, char **from,
- struct meminfo *meminfo)
+static void realview_pbx_fixup(struct tag *tags, char **from)
{
#ifdef CONFIG_SPARSEMEM
/*
* Memory configuration with SPARSEMEM enabled on RealView PBX (see
* asm/mach/memory.h for more information).
*/
- meminfo->bank[0].start = 0;
- meminfo->bank[0].size = SZ_256M;
- meminfo->bank[1].start = 0x20000000;
- meminfo->bank[1].size = SZ_512M;
- meminfo->bank[2].start = 0x80000000;
- meminfo->bank[2].size = SZ_256M;
- meminfo->nr_banks = 3;
+
+ memblock_add(0, SZ_256M);
+ memblock_add(0x20000000, SZ_512M);
+ memblock_add(0x80000000, SZ_256M);
#else
- realview_fixup(tags, from, meminfo);
+ realview_fixup(tags, from);
#endif
}
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index 86e2501..999c744 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -21,6 +21,7 @@
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/io.h>
+#include <linux/memblock.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -93,13 +94,10 @@ static struct platform_device *smdk2413_devices[] __initdata = {
&s3c2412_device_dma,
};
-static void __init smdk2413_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init smdk2413_fixup(struct tag *tags, char **cmdline)
{
if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
- mi->nr_banks=1;
- mi->bank[0].start = 0x30000000;
- mi->bank[0].size = SZ_64M;
+ memblock_add(0x30000000, SZ_64M);
}
}
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index f7ec9c5..aa550f5 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -22,6 +22,7 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/mtd/partitions.h>
+#include <linux/memblock.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -129,13 +130,10 @@ static struct platform_device *vstms_devices[] __initdata = {
&s3c2412_device_dma,
};
-static void __init vstms_fixup(struct tag *tags, char **cmdline,
- struct meminfo *mi)
+static void __init vstms_fixup(struct tag *tags, char **cmdline)
{
if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
- mi->nr_banks=1;
- mi->bank[0].start = 0x30000000;
- mi->bank[0].size = SZ_64M;
+ memblock_add(0x30000000, SZ_64M);
}
}
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index 8443a27..7dd894e 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -531,7 +531,7 @@ static void __init get_assabet_scr(void)
}
static void __init
-fixup_assabet(struct tag *tags, char **cmdline, struct meminfo *mi)
+fixup_assabet(struct tag *tags, char **cmdline)
{
/* This must be done before any call to machine_has_neponset() */
map_sa1100_gpio_regs();
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index e0e3968..c6ea491 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -81,24 +81,21 @@ __tagtable(ATAG_INITRD2, parse_tag_initrd2);
* initialization functions, as well as show_mem() for the skipping
* of holes in the memory map. It is populated by arm_add_memory().
*/
-struct meminfo meminfo;
-
void show_mem(unsigned int filter)
{
int free = 0, total = 0, reserved = 0;
- int shared = 0, cached = 0, slab = 0, i;
- struct meminfo * mi = &meminfo;
+ int shared = 0, cached = 0, slab = 0;
+ struct memblock_region *reg;
printk("Mem-info:\n");
show_free_areas(filter);
- for_each_bank (i, mi) {
- struct membank *bank = &mi->bank[i];
+ for_each_memblock (memory, reg) {
unsigned int pfn1, pfn2;
struct page *page, *end;
- pfn1 = bank_pfn_start(bank);
- pfn2 = bank_pfn_end(bank);
+ pfn1 = memblock_region_memory_base_pfn(reg);
+ pfn2 = memblock_region_memory_end_pfn(reg);
page = pfn_to_page(pfn1);
end = pfn_to_page(pfn2 - 1) + 1;
@@ -130,16 +127,9 @@ void show_mem(unsigned int filter)
static void __init find_limits(unsigned long *min, unsigned long *max_low,
unsigned long *max_high)
{
- struct meminfo *mi = &meminfo;
- int i;
-
- /* This assumes the meminfo array is properly sorted */
- *min = bank_pfn_start(&mi->bank[0]);
- for_each_bank (i, mi)
- if (mi->bank[i].highmem)
- break;
- *max_low = bank_pfn_end(&mi->bank[i - 1]);
- *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
+ *max_low = PFN_DOWN(memblock_get_current_limit());
+ *min = PFN_UP(memblock_start_of_DRAM());
+ *max_high = PFN_DOWN(memblock_end_of_DRAM());
}
static void __init arm_bootmem_init(unsigned long start_pfn,
@@ -327,14 +317,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
return phys;
}
-void __init arm_memblock_init(struct meminfo *mi,
- const struct machine_desc *mdesc)
+void __init arm_memblock_init(const struct machine_desc *mdesc)
{
- int i;
-
- for (i = 0; i < mi->nr_banks; i++)
- memblock_add(mi->bank[i].start, mi->bank[i].size);
-
/* Register the kernel text, kernel data and initrd with memblock. */
#ifdef CONFIG_XIP_KERNEL
memblock_reserve(__pa(_sdata), _end - _sdata);
@@ -466,48 +450,47 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn)
/*
* The mem_map array can get very big. Free the unused area of the memory map.
*/
-static void __init free_unused_memmap(struct meminfo *mi)
+static void __init free_unused_memmap(void)
{
- unsigned long bank_start, prev_bank_end = 0;
- unsigned int i;
+ unsigned long start, prev_end = 0;
+ struct memblock_region *reg;
/*
* This relies on each bank being in address order.
* The banks are sorted previously in bootmem_init().
*/
- for_each_bank(i, mi) {
- struct membank *bank = &mi->bank[i];
-
- bank_start = bank_pfn_start(bank);
+ for_each_memblock(memory, reg) {
+ start = __phys_to_pfn(reg->base);
#ifdef CONFIG_SPARSEMEM
/*
* Take care not to free memmap entries that don't exist
* due to SPARSEMEM sections which aren't present.
*/
- bank_start = min(bank_start,
- ALIGN(prev_bank_end, PAGES_PER_SECTION));
+ start = min(start,
+ ALIGN(prev_end, PAGES_PER_SECTION));
#else
/*
* Align down here since the VM subsystem insists that the
* memmap entries are valid from the bank start aligned to
* MAX_ORDER_NR_PAGES.
*/
- bank_start = round_down(bank_start, MAX_ORDER_NR_PAGES);
+ start = round_down(start, MAX_ORDER_NR_PAGES);
#endif
/*
* If we had a previous bank, and there is a space
* between the current bank and the previous, free it.
*/
- if (prev_bank_end && prev_bank_end < bank_start)
- free_memmap(prev_bank_end, bank_start);
+ if (prev_end && prev_end < start)
+ free_memmap(prev_end, start);
/*
* Align up here since the VM subsystem insists that the
* memmap entries are valid from the bank end aligned to
* MAX_ORDER_NR_PAGES.
*/
- prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
+ prev_end = ALIGN(start + __phys_to_pfn(reg->size),
+ MAX_ORDER_NR_PAGES);
}
#ifdef CONFIG_SPARSEMEM
@@ -589,7 +572,7 @@ void __init mem_init(void)
max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
/* this will put all unused low memory onto the freelists */
- free_unused_memmap(&meminfo);
+ free_unused_memmap();
free_all_bootmem();
#ifdef CONFIG_SA1111
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 4f08c13..394701c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1043,77 +1043,54 @@ early_param("vmalloc", early_vmalloc);
phys_addr_t arm_lowmem_limit __initdata = 0;
+static void remove_memblock(phys_addr_t base, phys_addr_t size)
+{
+ memblock_reserve(base, size);
+ memblock_free(base, size);
+ memblock_remove(base, size);
+}
+
void __init sanity_check_meminfo(void)
{
phys_addr_t memblock_limit = 0;
- int i, j, highmem = 0;
+ int highmem = 0;
phys_addr_t vmalloc_limit = __pa(vmalloc_min - 1) + 1;
+ struct memblock_region *reg;
- for (i = 0, j = 0; i < meminfo.nr_banks; i++) {
- struct membank *bank = &meminfo.bank[j];
- phys_addr_t size_limit;
-
- *bank = meminfo.bank[i];
- size_limit = bank->size;
+ for_each_memblock(memory, reg) {
+ phys_addr_t block_start = reg->base;
+ phys_addr_t block_end = reg->base + reg->size;
+ phys_addr_t size_limit = reg->size;
- if (bank->start >= vmalloc_limit)
+ if (reg->base >= vmalloc_limit)
highmem = 1;
else
- size_limit = vmalloc_limit - bank->start;
+ size_limit = vmalloc_limit - reg->base;
- bank->highmem = highmem;
-#ifdef CONFIG_HIGHMEM
- /*
- * Split those memory banks which are partially overlapping
- * the vmalloc area greatly simplifying things later.
- */
- if (!highmem && bank->size > size_limit) {
- if (meminfo.nr_banks >= NR_BANKS) {
- printk(KERN_CRIT "NR_BANKS too low, "
- "ignoring high memory\n");
- } else {
- memmove(bank + 1, bank,
- (meminfo.nr_banks - i) * sizeof(*bank));
- meminfo.nr_banks++;
- i++;
- bank[1].size -= size_limit;
- bank[1].start = vmalloc_limit;
- bank[1].highmem = highmem = 1;
- j++;
+ if (!IS_ENABLED(CONFIG_HIGHMEM) || cache_is_vipt_aliasing()) {
+
+ if (highmem) {
+ pr_notice("Ignoring ram at %pa-%pa (!CONFIG_HIGHMEM)\n",
+ &block_start, &block_end);
+ remove_memblock(block_start, block_end);
+ continue;
}
- bank->size = size_limit;
- }
-#else
- /*
- * Highmem banks not allowed with !CONFIG_HIGHMEM.
- */
- if (highmem) {
- printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx "
- "(!CONFIG_HIGHMEM).\n",
- (unsigned long long)bank->start,
- (unsigned long long)bank->start + bank->size - 1);
- continue;
- }
- /*
- * Check whether this memory bank would partially overlap
- * the vmalloc area.
- */
- if (bank->size > size_limit) {
- printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx "
- "to -%.8llx (vmalloc region overlap).\n",
- (unsigned long long)bank->start,
- (unsigned long long)bank->start + bank->size - 1,
- (unsigned long long)bank->start + size_limit - 1);
- bank->size = size_limit;
+ if (reg->size > size_limit) {
+ phys_addr_t overlap_size = reg->size - size_limit;
+
+ pr_notice("Truncating RAM at %pa-%pa to -%pa",
+ &block_start, &block_end, &overlap_size);
+ remove_memblock(vmalloc_limit, overlap_size);
+ block_end = vmalloc_limit;
+ }
}
-#endif
- if (!bank->highmem) {
- phys_addr_t bank_end = bank->start + bank->size;
- if (bank_end > arm_lowmem_limit)
- arm_lowmem_limit = bank_end;
+ if (!highmem) {
+ if (block_end > arm_lowmem_limit)
+ arm_lowmem_limit = reg->base + size_limit;
+
/*
* Find the first non-section-aligned page, and point
@@ -1129,35 +1106,16 @@ void __init sanity_check_meminfo(void)
* occurs before any free memory is mapped.
*/
if (!memblock_limit) {
- if (!IS_ALIGNED(bank->start, SECTION_SIZE))
- memblock_limit = bank->start;
- else if (!IS_ALIGNED(bank_end, SECTION_SIZE))
- memblock_limit = bank_end;
+ if (!IS_ALIGNED(block_start, SECTION_SIZE))
+ memblock_limit = block_start;
+ else if (!IS_ALIGNED(block_end, SECTION_SIZE))
+ memblock_limit = block_end;
}
- }
- j++;
- }
-#ifdef CONFIG_HIGHMEM
- if (highmem) {
- const char *reason = NULL;
- if (cache_is_vipt_aliasing()) {
- /*
- * Interactions between kmap and other mappings
- * make highmem support with aliasing VIPT caches
- * rather difficult.
- */
- reason = "with VIPT aliasing cache";
- }
- if (reason) {
- printk(KERN_CRIT "HIGHMEM is not supported %s, ignoring high memory\n",
- reason);
- while (j > 0 && meminfo.bank[j - 1].highmem)
- j--;
}
+
}
-#endif
- meminfo.nr_banks = j;
+
high_memory = __va(arm_lowmem_limit - 1) + 1;
/*
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply related
* [RESEND][RFC PATCH 1/2] mm/memblock: add memblock_get_current_limit
From: Laura Abbott @ 2014-01-15 19:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389813057-26572-1-git-send-email-lauraa@codeaurora.org>
Appart from setting the limit of memblock, it's also useful to be able
to get the limit to avoid recalculating it every time. Add the function
to do so.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
include/linux/memblock.h | 2 ++
mm/memblock.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 1ef6636..8a20a51 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -252,6 +252,8 @@ static inline void memblock_dump_all(void)
void memblock_set_current_limit(phys_addr_t limit);
+phys_addr_t memblock_get_current_limit(void);
+
/*
* pfn conversion functions
*
diff --git a/mm/memblock.c b/mm/memblock.c
index 64ed243..0ec3fc7 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1423,6 +1423,11 @@ void __init_memblock memblock_set_current_limit(phys_addr_t limit)
memblock.current_limit = limit;
}
+phys_addr_t __init_memblock memblock_get_current_limit(void)
+{
+ return memblock.current_limit;
+}
+
static void __init_memblock memblock_dump(struct memblock_type *type, char *name)
{
unsigned long long base, size;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply related
* [RESEND][RFC PATCH 0/2] Early patches to get rid of meminfo
From: Laura Abbott @ 2014-01-15 19:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
With the move away from bootmem and the convergence on memblock, it seems
like meminfo should be deprecated as well to avoid duplication. This is
a first pass attempt to just use memblock and not have meminfo integrated.
There is still a major issue in terms of actually specifying mem at location
on the command line but I wanted to send this out for some early feedback
before putting any more effort into this. I've done basic boot testing on
a simple DT target.
Thanks,
Laura
Laura Abbott (2):
mm/memblock: add memblock_get_current_limit
arm: Get rid of meminfo
arch/arm/include/asm/mach/arch.h | 4 +-
arch/arm/include/asm/memblock.h | 3 +-
arch/arm/include/asm/setup.h | 23 ------
arch/arm/kernel/atags_parse.c | 5 +-
arch/arm/kernel/setup.c | 33 +++------
arch/arm/mach-clps711x/board-clep7312.c | 7 +-
arch/arm/mach-clps711x/board-edb7211.c | 10 +--
arch/arm/mach-clps711x/board-p720t.c | 2 +-
arch/arm/mach-footbridge/cats-hw.c | 2 +-
arch/arm/mach-footbridge/netwinder-hw.c | 2 +-
arch/arm/mach-msm/board-halibut.c | 6 --
arch/arm/mach-msm/board-mahimahi.c | 13 +--
arch/arm/mach-msm/board-msm7x30.c | 3 +-
arch/arm/mach-msm/board-sapphire.c | 13 +--
arch/arm/mach-msm/board-trout.c | 8 +-
arch/arm/mach-orion5x/common.c | 3 +-
arch/arm/mach-orion5x/common.h | 3 +-
arch/arm/mach-pxa/cm-x300.c | 3 +-
arch/arm/mach-pxa/corgi.c | 10 +--
arch/arm/mach-pxa/eseries.c | 9 +-
arch/arm/mach-pxa/poodle.c | 8 +-
arch/arm/mach-pxa/spitz.c | 9 +--
arch/arm/mach-pxa/tosa.c | 8 +-
arch/arm/mach-realview/core.c | 11 +--
arch/arm/mach-realview/core.h | 3 +-
arch/arm/mach-realview/realview_pb1176.c | 8 +-
arch/arm/mach-realview/realview_pbx.c | 17 ++---
arch/arm/mach-s3c24xx/mach-smdk2413.c | 8 +-
arch/arm/mach-s3c24xx/mach-vstms.c | 8 +-
arch/arm/mach-sa1100/assabet.c | 2 +-
arch/arm/mm/init.c | 61 ++++++----------
arch/arm/mm/mmu.c | 122 ++++++++++--------------------
include/linux/memblock.h | 2 +
mm/memblock.c | 5 +
34 files changed, 150 insertions(+), 284 deletions(-)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* [RFC 0/2] Early patches to get rid of meminfo
From: Laura Abbott @ 2014-01-15 19:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAKv+Gu9bPJZFKoUFEW=-HvLJF8yaao6KJfwvQKgw4V+hgNZSJA@mail.gmail.com>
On 1/15/2014 10:03 AM, Ard Biesheuvel wrote:
> On 15 January 2014 19:01, Laura Abbott <lauraa@codeaurora.org> wrote:
>> On 1/15/2014 5:50 AM, Leif Lindholm wrote:
>>>
>>> Hi Laura,
>>>
>>> On Tue, Jan 14, 2014 at 09:55:20PM -0800, Laura Abbott wrote:
>>>>
>>>> With the move away from bootmem and the convergence on memblock, it seems
>>>> like meminfo should be deprecated as well to avoid duplication. This is
>>>> a first pass attempt to just use memblock and not have meminfo
>>>> integrated.
>>>> There is still a major issue in terms of actually specifying mem at location
>>>> on the command line but I wanted to send this out for some early feedback
>>>> before putting any more effort into this. I've done basic boot testing on
>>>> a simple DT target.
>>>
>>>
>>> I can't see 1/2 and 2/2 - either in my inbox or in the archive.
>>> Could you resend?
>>>
>>> /
>>> Leif
>>
>>
>>
>> The patches are being held for moderation because apparently they have "a
>> suspicious header". Not sure how the cover letter made it through but the
>> patches didn't. If they don't get approved by end of the day I'll try
>> re-sending.
>>
>
> Hi Laura,
>
> This is a known issue that is triggered by the fact that the word
> PATCH is missing from your subject line.
> Could you resend but replace 'RFC' with 'RFC PATCH' ?
>
Thanks for catching that, I will resend.
Laura
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* [BUG] FL1009: xHCI host not responding to stop endpoint command.
From: Arnaud Ebalard @ 2014-01-15 19:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D45C5AB@AcuExch.aculab.com>
Hi David,
David Laight <David.Laight@ACULAB.COM> writes:
>> I tried current 3.13.0-rc8 w/ 35773dac5f86 reverted and the result is
>> the same:
>
> That patch only affects an error code and stops the fs code retrying
> for ever.
Are you sure? ...
> Does everything work if you comment out the code in xhci-ring.c that adds
> NOP TRBs to the ring end in order to stop the LINK TRB appearing in the middle
> of a TB.
> The ethernet code needs it, but the disk transfers are (probably) aligned
> such that they don't.
... AFAICT, this is exactly what commit 35773dac5f86 does and reverting
it does not help. If I am mistaken, can you point which part you want me
to remove in the code to test?
I am slowly starting to see a bisect session coming ;-)
Cheers,
a+
^ permalink raw reply
* [PATCH v4 02/15] clk: Allow drivers to pass in a regmap
From: Stephen Boyd @ 2014-01-15 19:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20140115092857.4167.38854@quantum>
On 01/15, Mike Turquette wrote:
>
> So in summary: consolidation is over-rated. You can put your regmap
> functions into drivers/clk/msm/ and not convert over to struct clk_desc
> by the way, just to remove any confusion on that point.
>
Ok I've made the wrapper struct clk_regmap and posted the
patches. I think I've addressed all your concerns.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* [PATCH v6 1/2] ohci-platform: Add support for devicetree instantiation
From: Hans de Goede @ 2014-01-15 18:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <Pine.LNX.4.44L0.1401151123340.1587-100000@iolanthe.rowland.org>
Hi,
On 01/15/2014 05:30 PM, Alan Stern wrote:
> On Wed, 15 Jan 2014, Hans de Goede wrote:
>
>> +static int ohci_platform_power_on(struct platform_device *dev)
>> +{
>> + struct usb_hcd *hcd = platform_get_drvdata(dev);
>> + struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
>> + int clk, ret;
>> +
>> + for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) {
>
> You fixed this one...
>
>> @@ -125,13 +225,22 @@ static int ohci_platform_remove(struct platform_device *dev)
>> {
>> struct usb_hcd *hcd = platform_get_drvdata(dev);
>> struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
>> + struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd);
>> + int clk;
>>
>> usb_remove_hcd(hcd);
>> - usb_put_hcd(hcd);
>>
>> if (pdata->power_off)
>> pdata->power_off(dev);
>>
>> + for (clk = 0; priv->clks[clk] && clk < OHCI_MAX_CLKS; clk++)
>
> but not this one. :-( Same for the ehci-platform patch.
Oops, sorry about that, v7 coming up.
> In fact, it might be easier to make this loop go backward, like
> you do in the *_platform_power_off routines.
I prefer keep doing things forward here, the backward loop in
power_off is because the disable_unprepare must be done in reverse
order if the prepare_enable calls.
> Is there a devm-type routine that will take care of all this for you?
Nope, the downside of getting the clocks by index rather then by name
is that there are no devm routines for that.
Regards,
Hans
^ permalink raw reply
* [PATCH v5 14/14] devicetree: bindings: Document qcom,mmcc
From: Stephen Boyd @ 2014-01-15 18:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389811654-21397-1-git-send-email-sboyd@codeaurora.org>
Document the multimedia clock controller found on Qualcomm devices
Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
.../devicetree/bindings/clock/qcom,mmcc.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/qcom,mmcc.txt
diff --git a/Documentation/devicetree/bindings/clock/qcom,mmcc.txt b/Documentation/devicetree/bindings/clock/qcom,mmcc.txt
new file mode 100644
index 000000000000..d572e9964c54
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,mmcc.txt
@@ -0,0 +1,21 @@
+Qualcomm Multimedia Clock & Reset Controller Binding
+----------------------------------------------------
+
+Required properties :
+- compatible : shall contain only one of the following:
+
+ "qcom,mmcc-msm8660"
+ "qcom,mmcc-msm8960"
+ "qcom,mmcc-msm8974"
+
+- reg : shall contain base register location and length
+- #clock-cells : shall contain 1
+- #reset-cells : shall contain 1
+
+Example:
+ clock-controller at 4000000 {
+ compatible = "qcom,mmcc-msm8960";
+ reg = <0x4000000 0x1000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply related
* [PATCH v5 13/14] devicetree: bindings: Document qcom,gcc
From: Stephen Boyd @ 2014-01-15 18:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1389811654-21397-1-git-send-email-sboyd@codeaurora.org>
Document the global clock controller found on Qualcomm devices.
Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
.../devicetree/bindings/clock/qcom,gcc.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc.txt
diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc.txt b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
new file mode 100644
index 000000000000..767401f42871
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,gcc.txt
@@ -0,0 +1,21 @@
+Qualcomm Global Clock & Reset Controller Binding
+------------------------------------------------
+
+Required properties :
+- compatible : shall contain only one of the following:
+
+ "qcom,gcc-msm8660"
+ "qcom,gcc-msm8960"
+ "qcom,gcc-msm8974"
+
+- reg : shall contain base register location and length
+- #clock-cells : shall contain 1
+- #reset-cells : shall contain 1
+
+Example:
+ clock-controller at 900000 {
+ compatible = "qcom,gcc-msm8960";
+ reg = <0x900000 0x4000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ };
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply related
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