Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] gpio: Add simple poweroff-gpio driver
From: Stephen Warren @ 2012-11-11 22:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352650891-18356-2-git-send-email-andrew@lunn.ch>

On 11/11/2012 09:21 AM, Andrew Lunn wrote:
> From: Jamie Lentin <jm@lentin.co.uk>
> 
> Given appropriate devicetree bindings, this driver registers a
> pm_power_off function to set a GPIO line high/low to power down
> your board.

This feature will be useful for the Tegra TrimSlice board too.

> diff --git a/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt b/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt

> +Required properties:
> +- compatible : should be "gpio-poweroff".
> +- gpios : The GPIO to set high/low, see "gpios property" in
> +  Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be
> +  low to power down the board set it to "Active Low", otherwise set
> +  gpio to "Active High".

Unfortunately, not all GPIO bindings support active high/low flags in
the GPIO specifier. As such, the flags there are basically useless.
Other bindings (e.g. IIRC the fixed-regulator binding) have added a
separate active-high property to indicate the GPIO polarity. This
binding should probably follow suite.

^ permalink raw reply

* S-o-b for 48efdd2 "Add a pm_power_off function that resets us, ..."
From: Stephen Warren @ 2012-11-11 21:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <2C2B34F818605C4A9351ED6A537A43841DE6D823@SJEXCHMB09.corp.ad.broadcom.com>

On 11/09/2012 04:09 AM, Dominic Cobley wrote:
> I'm happy to give permission for s.o.b. to be commits made by me. Is that sufficient?

Assuming you've read Documentation/SubmittingPatches and can fulfill the
conditions to apply an S-o-b (noting that many commits in your 3.6.y
branch are authored by other people, so you'd need their S-o-b first
most likely)...

For individual commits, you can always respond to the email requests
with the desired S-o-b line in question, i.e. just write the following
with your name/email:

Signed-off-by: Random J Developer <random@developer.example.org>

Perhaps you can also just state that the S-o-b line you write applies to
any commit currently in th 3.6.y branch.

> If that's not sufficient can you give me git commands that will do what you want?

Something like the following would do:

git checkout rpi-3.6.y

git rebase -i c6092bb74442d4ee1dfea60e2934915836f53528 # 3.6.1

In the editor that pops up, for any commit that you can S-o-b, change
"pick" to "reword" or "edit", then save the document. See the
instructions in the editor.

If you chose to use "reword", the editor will pop up again for each
commit. Write or paste your S-o-b into the commit description in the
appropriate place.

If you chose to use "edit", git will return the shell, and then you run
"git commit --amend -s" to edit the commit description (-s adds your
S-o-b automatically) and then "git rebase --continue" to continue the
rebase operation at the next commit.

Finally, push the modified branch to the git server.

Note that this process will change the git commit IDs of the commits in
your branch, which will be rather unfortunate for downstream users, and
will probably break unmerged github pull requests. Depending on any
"customer's" familiarity with git, this may be a minor or major issue...
For this reason, it's a good idea to add the S-o-b lines before you
first push the commits to the git server; use "git commit -s" rather
than "git commit", and making sure any contributors whose patches you
accept have done the same themselves.

Thanks!

^ permalink raw reply

* [PATCH v2] Add support for generic BCM SoC chipsets
From: Stephen Warren @ 2012-11-11 21:40 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAA-5wcDo2OJSD9O4YfJkxYDukCSMJo46at2NR9e41fZbAhh7wA@mail.gmail.com>

On 11/11/2012 10:32 AM, Christian Daudt wrote:
> 
> 
> On Sun, Nov 11, 2012 at 7:53 AM, Florian Fainelli <florian@openwrt.org
> <mailto:florian@openwrt.org>> wrote:
> 
>     Hi Christian,
> 
>     On Sunday 11 November 2012 06:57:14 Christian Daudt wrote:
>     > In order to start upstreaming Broadcom SoC support, create
>     > a starting hierarchy, arch and dts files.
>     > The first support SoC family that is planned is the
>     > BCM281XX (BCM28145/28150/28155/28160) family of dual A9 mobile SoC
>     cores
>     > This code is just the skeleton code for get the machine upstreamed. It
>     > has been made MULTIPLATFORM compatible.
>     > Next steps
>     > ----------
>     > Upstream a basic set of drivers - sufficient for a console boot to
>     > ramdisk. These will includer timer, gpio, i2c drivers.
>     > After this basic set, we will proceed with a more comprehensive set
>     > of drivers for the 281XX SoC family.
> 
>     Would not it make more sense to use mach-bcm281xx as a directory
>     name instead
>     of mach-bcm which sounds a tad too generic? This would also make it
>     consistent
>     with Domenico's mach-bcm47xx and the existing bcm47xx and bcm63xx
>     MIPS-based
>     SoC support.
> 
> 
> I'm following the other mobile ARM SoCs which all have a single mach-
> directory for various families of chips (mach-tegra, mach-omap2,
> etc...). Plus the intent is to have a single set of mach files that
> works across bcm SoCs, so it is preferable to keep it in a single mach-bcm.

It's quite possible to create one directory now, e.g. mach-bcm281xx, and
then when consolidation with other mach-bcm* happens, merge all those
directories into a single mach-bcm. I would tend to prefer (but only
lightly) using mach-bcm281xx now and then renaming later, unless you
plan on expanding the SoC support in the pretty near future.

^ permalink raw reply

* [PATCH] Add support for generic BCM SoC chipsets
From: Stephen Warren @ 2012-11-11 21:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <509FA975.6060203@broadcom.com>

On 11/11/2012 06:34 AM, Christian Daudt wrote:
> On 12-11-08 07:24 PM, Stephen Warren wrote:
>> On 11/08/2012 09:13 AM, Christian Daudt wrote:

>>> +	uart at 3e000000 {
>>> +		compatible = "snps,dw-apb-uart";
>>
>> You probably want to include SoC-specific compatible values for all the
>> IP blocks too.
>
> I don't follow this part. Do you mean to replace that line with
> something like 'compatible = "snps,sw-apb-uart", "bcm, bcm28x11-uart"' ?
> If so, I don't think that that is necessary - right now there is nothing
> BCM specific about this.

I would expect:

compatible = "bcm,bcm28x11-uart", "snps,sw-apb-uart";

The device-tree convention is for the compatible value to always include
a specific representation of the exact instance of the HW first (i.e.
"bcm,bcm28x11-uart"), and then also describe any base value that the HW
is compatible with, or describes the IP block that was instantiated
(i.e. "snps,sw-apb-uart"). While the first more-specific value may not
be strictly required to make the code work from the start, it is
required so that if in the future it is discovered that the HW needs
some unexpected quirk or workaround in the driver, the compatible
property (for any old device tree that was loaded onto the HW
previously) already includes the required value to indicate the specific
HW, and hence allow the workaround to be applied.

^ permalink raw reply

* usb clock not found on imx27 when using dt
From: Philippe Reynes @ 2012-11-11 20:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

I try to add the support of usb on my armadeus apf27,
but there is a problem when try to reclaim the clock.
imx_usb mxc-ehci.0: Failed to get clock, err=-2

To avoid adding too many attachment to this mail,
I've put all the information on a website. You can
found them here:? http://ryu.zarb.org/~trem/armadeus/


The initial issue is in the directory : 20121110

boot-3.7-rc4.log : boot log with the issue
linux-3.7-rc4.config : the configuration file for the kernel
investifation.txt : the description of my investigation.


I've tried to fix the clock issue, but another issue occurs.
The information about this "fix" is in : 20121111
boot-3.7-rc4.log : boot log with the new issue
issue.txt : the description of the change done on the kernel

I've got severals questions :
- does my dts correct with usb change ?
- does someone has already tested usb on imx27 with dt ?

Regards,
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121111/3bbd3fdc/attachment-0001.html>

^ permalink raw reply

* [PATCH 0/2] clk: ux500: Make mtu driver use apb_pclock
From: Linus Walleij @ 2012-11-11 18:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121110012449.16569.82732@nucleus>

On Sat, Nov 10, 2012 at 2:24 AM, Mike Turquette <mturquette@linaro.org> wrote:
> Quoting Linus Walleij (2012-10-24 10:25:26)
>> On Wed, Oct 24, 2012 at 2:13 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
>>
>> > From: Ulf Hansson <ulf.hansson@linaro.org>
>> >
>> > The apb clock was before the "common" clock driver for ux500 was merged,
>> > handled internally by the clock driver. Now this clock needs to be managed
>> > from the mtu driver as a separate clock.
>> >
>> > This patches is based in 3.7 rc2.
>> >
>> > It is important the "ARM nomadik patch" is merged together with the
>> > clock patch to not break boot. Therefore I suggest this series to go
>> > through Mike Turquettes clock tree.
>>
>> OK go ahead:
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> I've taken these into clk-next.  While the patches are trivial I'd still
> prefer a changelog in the future.  For instance, it would be nice to
> explain why removing the block comment is OK in the first patch.

So there may be some collision in linux-next due to this,
because I've moved the nomadik timer to
drivers/clksrc and deleted the entire plat-nomadik
directory.

I don't know quite how ingenious git is in detecting
patches on moved files, but if it's causing trouble
I think it's better if you could ACK them and we
could reubmit them to ARM SoC on the multiplatform
branch. i.e. this one:
http://git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=shortlog;h=refs/heads/next/multiplatform

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH v2] Add support for generic BCM SoC chipsets
From: Florian Fainelli @ 2012-11-11 18:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAA-5wcDo2OJSD9O4YfJkxYDukCSMJo46at2NR9e41fZbAhh7wA@mail.gmail.com>

On Sunday 11 November 2012 09:32:13 Christian Daudt wrote:
> On Sun, Nov 11, 2012 at 7:53 AM, Florian Fainelli <florian@openwrt.org>wrote:
> 
> > Hi Christian,
> >
> > On Sunday 11 November 2012 06:57:14 Christian Daudt wrote:
> > > In order to start upstreaming Broadcom SoC support, create
> > > a starting hierarchy, arch and dts files.
> > > The first support SoC family that is planned is the
> > > BCM281XX (BCM28145/28150/28155/28160) family of dual A9 mobile SoC cores
> > > This code is just the skeleton code for get the machine upstreamed. It
> > > has been made MULTIPLATFORM compatible.
> > > Next steps
> > > ----------
> > > Upstream a basic set of drivers - sufficient for a console boot to
> > > ramdisk. These will includer timer, gpio, i2c drivers.
> > > After this basic set, we will proceed with a more comprehensive set
> > > of drivers for the 281XX SoC family.
> >
> > Would not it make more sense to use mach-bcm281xx as a directory name
> > instead
> > of mach-bcm which sounds a tad too generic? This would also make it
> > consistent
> > with Domenico's mach-bcm47xx and the existing bcm47xx and bcm63xx
> > MIPS-based
> > SoC support.
> >
> 
> I'm following the other mobile ARM SoCs which all have a single mach-
> directory for various families of chips (mach-tegra, mach-omap2, etc...).
> Plus the intent is to have a single set of mach files that works across bcm
> SoCs, so it is preferable to keep it in a single mach-bcm.

Your argument does not make sense here, if I follow your point, these
directories should have been named mach-nvidia or mach-ti respectively if I 
follow your convention (you use the vendor name, not a commercial product name)

I do understand your intent, yet you announce support for BCM281xx SoCs, and
one of your dtsi file is bcm281xx.dtsi. At least something like mach-bcmmobile
sounds better to me.

We have had the inclusion of the "socfpga" platform which is already very
badly named because it does not make it clear that it is an Altera platform and
not some generic SoC + FPGA platform.

Anyway, that's just my 2 cents.
-- 
Florian

^ permalink raw reply

* [PATCH 0/5] clk: ux500: Add clock lookups for u8500
From: Linus Walleij @ 2012-11-11 18:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121110010750.17381.1960@nucleus>

On Sat, Nov 10, 2012 at 2:07 AM, Mike Turquette <mturquette@ti.com> wrote:
> Quoting Lee Jones (2012-10-25 00:51:38)
>> On Mon, 22 Oct 2012, Ulf Hansson wrote:
>>
>> > From: Ulf Hansson <ulf.hansson@linaro.org>
>> >
>> > Step by step, clock lookups for u8500 are being added in this set
>> > of patches.
>> >
>> > These patches will require additional patches for sound/soc/ux500/
>> > driver as well as drivers/i2c/busses/i2c-nomadik driver to prevent
>> > the boot for ux500 from break. Those patches are being merged through
>> > separate trees.
>> >
>> > Ulf Hansson (5):
>> >   clk: ux500: Register i2c clock lookups for u8500
>> >   clk: ux500: Register ssp clock lookups for u8500
>> >   clk: ux500: Register msp clock lookups for u8500
>> >   clk: ux500: Update rtc clock lookup for u8500
>> >   clk: ux500: Register slimbus clock lookups for u8500
>>
>> Acked-by: Lee Jones <lee.jones@linaro.org>
>>
>> Can I also mention that these need to go into the -rcs at the
>> earliest opportunity please, as it is preventing ~50% of the
>> devices from functioning on all of the ST-Ericsson development
>> boards.
>>
>> This is a massive blocker for us!
>>
>
> I've taken these patches into clk-next.  Do you need them in as a late
> fix in the 3.7 cycle or is your urgent need only for 3.8 development?

It is regressing the above drivers (i2c, ssp, etc) so they need to
go into v3.7-rc:s...

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH v2] pinctrl/nomadik: make independent of prcmu driver
From: Linus Walleij @ 2012-11-11 18:40 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <509D3A53.6080007@wwwdotorg.org>

On Fri, Nov 9, 2012 at 6:16 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:

> [Me]
>> +     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> +     if (res) {
>> +             npct->prcm_base = devm_ioremap(&pdev->dev, res->start,
>> +                                            resource_size(res));
>> +             if (!npct->prcm_base) {
>> +                     dev_err(&pdev->dev,
>> +                             "failed to ioremap PRCM registers\n");
>> +                     return -ENOMEM;
>> +             }
>> +     } else {
>> +             dev_info(&pdev->dev,
>> +                      "No PRCM base, assume no ALT-Cx control is available\n");
>> +     }
>
> Where is "assume no ALT-Cx control is available" implemented; I don't
> see anything that uses npct->prcm_base to conditionally enable/block any
> features. Is it just assumed that the DT won't contain any entries that
> trigger writes to the PRCM registers? That seems fragile; it could cause
> a "user"-triggered kernel crash.

Yeah. That's been in for a while, so this patch in itself is not making
things more fragile, it came with the first Alt-Cx patch.
So it is indeed based on good faith in the maps.

I'm poking Jean-Nicolas to have a look at hardening
this with some check, ping!

> Aside from that, this seems fine. Much smaller than V1:-)

Yeah, thanks for poking us...

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH 2/4] gpio: samsung: Skip registration if pinctrl driver is present on Exynos4x12
From: Linus Walleij @ 2012-11-11 18:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <0e8301cdbe62$56a1d010$03e57030$%kim@samsung.com>

On Fri, Nov 9, 2012 at 11:09 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
>> On Wed, Nov 7, 2012 at 5:41 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
>>
>> > A commit 1b6056d6 ("pinctrl: samsung: Include bank-specific eint offset
>> in
>> > bank struct") which is in your pinctrl tree (samsung branch) changed
>> > macro(EXYNOS_PIN_BANK_EINTG) to add offset. Eventually, this series(due
>> to
>> > 3rd patch, pinctrl: samsung: Add support for Exynos4x12) breaks
>> compilation
>> > without the commit. So if you don't have a plan to rebase samsung branch
>> of
>> > your pinctrl tree, I'd like to merge it in my tree. Is it ok to you?
>>
>> Sure tell me when you've merged it and I'll drop commit 1b6056d6
>> from my tree.
>>
>
> Thanks :-)
>
> (- some guys in Cc...)
>
> But having a problem, the 'it' means the commit 1b6056d6? If so, I couldn't
> cherry-pick only that because of dependency with other commits 40ba622 and
> 3a232ba.
>
> $ git cherry-pick -s 40ba622
> [next/dt-exynos4x12 3b1977c] pinctrl: samsung: Assing pin numbers
> dynamically
>  Author: Tomasz Figa <t.figa@samsung.com>
>  3 files changed, 62 insertions(+), 54 deletions(-)
>
> $ git cherry-pick -s 3a232ba
> [next/dt-exynos4x12 7fa08a4] pinctrl: samsung: Remove static pin
> enumerations
>  Author: Tomasz Figa <t.figa@samsung.com>
>  1 files changed, 96 insertions(+), 215 deletions(-)
>  rewrite drivers/pinctrl/pinctrl-exynos.h (66%)
>
> $ git cherry-pick -s 1b6056d
> [next/dt-exynos4x12 86010aa] pinctrl: samsung: Include bank-specific eint
> offset in bank struct
>  Author: Tomasz Figa <t.figa@samsung.com>
>  3 files changed, 30 insertions(+), 29 deletions(-)
>
> I could cherry-pick clearly with 2 more commits.
>
> Can you drop above 3 commits in your tree? If many conflicts happens during
> rebasing, how about that I merge your pinctrl/samsung branch into Samsung
> tree?...

Why not :-)

I have removed the samsung branch from my for-next to avoid
clashes.

So please bring the samsung branch into you tree and fix
everything up there.

Axel Lin has sent some tree-wide cleanups but let's hope they don't
hit samsung so much, or they will need to be postponed/dropped.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH] pinctrl: SPEAr: Add SoC specific gpio configuration routines
From: Linus Walleij @ 2012-11-11 18:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <440eeee0b362a9b2db3749a49c78b6aabdd5ad6a.1352298892.git.viresh.kumar@linaro.org>

On Wed, Nov 7, 2012 at 3:37 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:

> From: Shiraz Hashim <shiraz.hashim@st.com>
>
> Different SPEAr SoCs have different approach to configure pins as gpios. Some
> configure a group of gpios with single register bit and others have one bit per
> gpio pin. Only earlier one is implemented till now, this patch adds support for
> later one.
>
> Here we add callbacks to SoC specific code to configure gpios in
> gpio_request_enable(). That will do additional SoC specific configuration to
> enable gpio pins.
>
> We also implement this callback for SPEAr1340 in this patch.
>
> Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied.

Thanks!
Linus Walleij

^ permalink raw reply

* [PATCH V2 5/5] ARM: SPEAr: Add plgpio node in device tree dtsi files
From: Linus Walleij @ 2012-11-11 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <32141e19f71afa93cf743cffaab4c4794ee4b008.1351330569.git.viresh.kumar@linaro.org>

On Sat, Oct 27, 2012 at 11:51 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:

> This patch adds plgpio nodes in SPEAr DT files.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied this as well.

Yours,
Linus Walleij

^ permalink raw reply

* [PATCH V2 4/5] pinctrl: SPEAr: Add gpio ranges support
From: Linus Walleij @ 2012-11-11 18:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <3b2f9fa0864f1f736e24ee0dbc081cd9a79b7468.1351330569.git.viresh.kumar@linaro.org>

On Sat, Oct 27, 2012 at 11:51 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:

> Most of SPEAr SoCs, which support pinctrl, can configure & use pads as gpio.
> This patch gpio enable support for SPEAr pinctrl drivers.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Now, as I have brought in v3.7-rc5, I have applied this patch
that depended on the fixes.

Yours,
Linus Walleij

^ permalink raw reply

* [RFC] dt/platform: Use cell-index for device naming if available
From: Grant Likely @ 2012-11-11 17:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <509F0E56.6080806@gmail.com>

On Sun, Nov 11, 2012 at 2:32 AM, Rob Herring <robherring2@gmail.com> wrote:
> On 11/09/2012 06:48 PM, Stepan Moskovchenko wrote:
>> Use the cell-index property to construct names for platform
>> devices, falling back on the existing scheme of using the
>> device register address if cell-index is not specified.
>>
>> The cell-index property is a more useful device identifier,
>> especially in systems containing several numbered instances
>> of a particular hardware block, since it more easily
>> illustrates how devices relate to each other.
>>
>> Additionally, userspace software may rely on the classic
>> <name>.<id> naming scheme to access device attributes in
>> sysfs, without having to know the physical addresses of
>> that device on every platform the userspace software may
>> support. Using cell-index for device naming allows the
>> device addresses to be hidden from userspace and to be
>> exposed by logical device number without having to rely on
>> auxdata to perform name overrides. This allows userspace to
>> make assumptions about which sysfs nodes map to which
>> logical instance of a specific hardware block.
>>
>> Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
>> ---
>> I had also considered using something like the linux,label property to allow
>> custom names for platform devices without resorting to auxdata, but the
>> cell-index approach seems more in line with what cell-index was intended for
>> and with what the pre-DT platform device naming scheme used to be. Please let
>> me know if you think there is a better way to accomplish this.
>>
>> This is just being sent out as an RFC for now. If there are no objections, I
>> will send this out as an official patch, along with (or combined with) a patch
>> to fix up the device names in things like clock tables of any affected
>> platforms.
>
> cell-index is basically deprecated. This has been discussed multiple
> times in the past. You can use auxdata if you really need to have the
> old name.

Actually, I think it would be fine to use an /aliases entry to set the
device name. That's the place to put global namespace information.

g.

^ permalink raw reply

* [PATCH v2] Add support for generic BCM SoC chipsets
From: Christian Daudt @ 2012-11-11 17:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <12188358.5I1Xcz160E@bender>

On Sun, Nov 11, 2012 at 7:53 AM, Florian Fainelli <florian@openwrt.org>wrote:

> Hi Christian,
>
> On Sunday 11 November 2012 06:57:14 Christian Daudt wrote:
> > In order to start upstreaming Broadcom SoC support, create
> > a starting hierarchy, arch and dts files.
> > The first support SoC family that is planned is the
> > BCM281XX (BCM28145/28150/28155/28160) family of dual A9 mobile SoC cores
> > This code is just the skeleton code for get the machine upstreamed. It
> > has been made MULTIPLATFORM compatible.
> > Next steps
> > ----------
> > Upstream a basic set of drivers - sufficient for a console boot to
> > ramdisk. These will includer timer, gpio, i2c drivers.
> > After this basic set, we will proceed with a more comprehensive set
> > of drivers for the 281XX SoC family.
>
> Would not it make more sense to use mach-bcm281xx as a directory name
> instead
> of mach-bcm which sounds a tad too generic? This would also make it
> consistent
> with Domenico's mach-bcm47xx and the existing bcm47xx and bcm63xx
> MIPS-based
> SoC support.
>

I'm following the other mobile ARM SoCs which all have a single mach-
directory for various families of chips (mach-tegra, mach-omap2, etc...).
Plus the intent is to have a single set of mach files that works across bcm
SoCs, so it is preferable to keep it in a single mach-bcm.

 thanks,
  csd



> --
> Florian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121111/24d6e94c/attachment-0001.html>

^ permalink raw reply

* [PATCH] ARM: Orion: Remove redundent init_dma_coherent_pool_size()
From: Andrew Lunn @ 2012-11-11 17:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352356737-14413-1-git-send-email-m.szyprowski@samsung.com>

The patch:

mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls

makes these calls on Kirkword and Orion5x redundent. The drivers are
not making atomic requests for coherent memory and hence the default
pool size is now sufficient.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/mach-kirkwood/common.c |    7 -------
 arch/arm/mach-orion5x/common.c  |    7 -------
 2 files changed, 14 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 2c6c218..8080ceb 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -505,13 +505,6 @@ void __init kirkwood_wdt_init(void)
 void __init kirkwood_init_early(void)
 {
 	orion_time_set_base(TIMER_VIRT_BASE);
-
-	/*
-	 * Some Kirkwood devices allocate their coherent buffers from atomic
-	 * context. Increase size of atomic coherent pool to make sure such
-	 * the allocations won't fail.
-	 */
-	init_dma_coherent_pool_size(SZ_1M);
 }
 
 int kirkwood_tclk;
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index b3eb3da..3e07f52 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -194,13 +194,6 @@ void __init orion5x_wdt_init(void)
 void __init orion5x_init_early(void)
 {
 	orion_time_set_base(TIMER_VIRT_BASE);
-
-	/*
-	 * Some Orion5x devices allocate their coherent buffers from atomic
-	 * context. Increase size of atomic coherent pool to make sure such
-	 * the allocations won't fail.
-	 */
-	init_dma_coherent_pool_size(SZ_1M);
 }
 
 int orion5x_tclk;
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH] mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls
From: Andrew Lunn @ 2012-11-11 17:22 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352356737-14413-1-git-send-email-m.szyprowski@samsung.com>

On Thu, Nov 08, 2012 at 07:38:57AM +0100, Marek Szyprowski wrote:
> dmapool always calls dma_alloc_coherent() with GFP_ATOMIC flag, regardless
> the flags provided by the caller. This causes excessive pruning of
> emergency memory pools without any good reason. This patch changes the code
> to correctly use gfp flags provided by the dmapool caller. This should
> solve the dmapool usage on ARM architecture, where GFP_ATOMIC DMA
> allocations can be served only from the special, very limited memory pool.
> 
> Reported-by: Soren Moch <smoch@web.de>
> Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Tested-by: Andrew Lunn <andrew@lunn.ch>

I tested this on a Kirkwood QNAP after removing the call to
init_dma_coherent_pool_size().

	Andrew


> ---
>  mm/dmapool.c |   27 +++++++--------------------
>  1 file changed, 7 insertions(+), 20 deletions(-)
> 
> diff --git a/mm/dmapool.c b/mm/dmapool.c
> index c5ab33b..86de9b2 100644
> --- a/mm/dmapool.c
> +++ b/mm/dmapool.c
> @@ -62,8 +62,6 @@ struct dma_page {		/* cacheable header for 'allocation' bytes */
>  	unsigned int offset;
>  };
>  
> -#define	POOL_TIMEOUT_JIFFIES	((100 /* msec */ * HZ) / 1000)
> -
>  static DEFINE_MUTEX(pools_lock);
>  
>  static ssize_t
> @@ -227,7 +225,6 @@ static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags)
>  		memset(page->vaddr, POOL_POISON_FREED, pool->allocation);
>  #endif
>  		pool_initialise_page(pool, page);
> -		list_add(&page->page_list, &pool->page_list);
>  		page->in_use = 0;
>  		page->offset = 0;
>  	} else {
> @@ -315,30 +312,21 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
>  	might_sleep_if(mem_flags & __GFP_WAIT);
>  
>  	spin_lock_irqsave(&pool->lock, flags);
> - restart:
>  	list_for_each_entry(page, &pool->page_list, page_list) {
>  		if (page->offset < pool->allocation)
>  			goto ready;
>  	}
> -	page = pool_alloc_page(pool, GFP_ATOMIC);
> -	if (!page) {
> -		if (mem_flags & __GFP_WAIT) {
> -			DECLARE_WAITQUEUE(wait, current);
>  
> -			__set_current_state(TASK_UNINTERRUPTIBLE);
> -			__add_wait_queue(&pool->waitq, &wait);
> -			spin_unlock_irqrestore(&pool->lock, flags);
> +	/* pool_alloc_page() might sleep, so temporarily drop &pool->lock */
> +	spin_unlock_irqrestore(&pool->lock, flags);
>  
> -			schedule_timeout(POOL_TIMEOUT_JIFFIES);
> +	page = pool_alloc_page(pool, mem_flags);
> +	if (!page)
> +		return NULL;
>  
> -			spin_lock_irqsave(&pool->lock, flags);
> -			__remove_wait_queue(&pool->waitq, &wait);
> -			goto restart;
> -		}
> -		retval = NULL;
> -		goto done;
> -	}
> +	spin_lock_irqsave(&pool->lock, flags);
>  
> +	list_add(&page->page_list, &pool->page_list);
>   ready:
>  	page->in_use++;
>  	offset = page->offset;
> @@ -348,7 +336,6 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
>  #ifdef	DMAPOOL_DEBUG
>  	memset(retval, POOL_POISON_ALLOCATED, pool->size);
>  #endif
> - done:
>  	spin_unlock_irqrestore(&pool->lock, flags);
>  	return retval;
>  }
> -- 
> 1.7.9.5
> 

^ permalink raw reply

* [PATCH 3/3] ARM: Kirkwood: Convert IB62x0 to use gpio-poweroff.
From: Andrew Lunn @ 2012-11-11 16:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352650891-18356-1-git-send-email-andrew@lunn.ch>

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-ib62x0.dts |    6 ++++++
 arch/arm/mach-kirkwood/board-ib62x0.c |   13 -------------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 66794ed..9b0e2e3 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -79,4 +79,10 @@
 			gpios = <&gpio0 27 0>;
 		};
 	};
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		gpios = <&gpio0 24 1>;
+	};
+
+
 };
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index cfc47f8..7b8adf5 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -17,7 +17,6 @@
 #include <linux/mtd/partitions.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
 #include <linux/input.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -25,8 +24,6 @@
 #include "common.h"
 #include "mpp.h"
 
-#define IB62X0_GPIO_POWER_OFF	24
-
 static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
 };
@@ -49,11 +46,6 @@ static unsigned int ib62x0_mpp_config[] __initdata = {
 	0
 };
 
-static void ib62x0_power_off(void)
-{
-	gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
-}
-
 void __init ib62x0_init(void)
 {
 	/*
@@ -63,9 +55,4 @@ void __init ib62x0_init(void)
 
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&ib62x0_ge00_data);
-	if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
-	    gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
-		pm_power_off = ib62x0_power_off;
-	else
-		pr_err("board-ib62x0: failed to configure power-off GPIO\n");
 }
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 2/3] ARM: Kirkwood: Convert DNSKW to use gpio-poweroff.
From: Andrew Lunn @ 2012-11-11 16:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352650891-18356-1-git-send-email-andrew@lunn.ch>

Also enable the gpio-poweroff driver when DT is used.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Jamie Lentin <jm@lentin.co.uk>
---
 arch/arm/boot/dts/kirkwood-dnskw.dtsi |    5 +++++
 arch/arm/mach-kirkwood/Kconfig        |    1 +
 arch/arm/mach-kirkwood/board-dnskw.c  |   12 ------------
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 9b32d02..22aa07a 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -35,6 +35,11 @@
 				      6000 2>;
 	};
 
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		gpios = <&gpio1 4 0>;
+	};
+
 	ocp at f1000000 {
 		sata at 80000 {
 			status = "okay";
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 50bca50..a0f4f47 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -47,6 +47,7 @@ config MACH_GURUPLUG
 config ARCH_KIRKWOOD_DT
 	bool "Marvell Kirkwood Flattened Device Tree"
 	select USE_OF
+	select GPIO_POWEROFF
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened device tree.
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index 43d16d6..549369e 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -57,11 +57,6 @@ static unsigned int dnskw_mpp_config[] __initdata = {
 	0
 };
 
-static void dnskw_power_off(void)
-{
-	gpio_set_value(36, 1);
-}
-
 /* Register any GPIO for output and set the value */
 static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 {
@@ -81,13 +76,6 @@ void __init dnskw_init(void)
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dnskw_ge00_data);
 
-	/* Register power-off GPIO. */
-	if (gpio_request(36, "dnskw:power:off") == 0
-	    && gpio_direction_output(36, 0) == 0)
-		pm_power_off = dnskw_power_off;
-	else
-		pr_err("dnskw: failed to configure power-off GPIO\n");
-
 	/* Ensure power is supplied to both HDDs */
 	dnskw_gpio_register(39, "dnskw:power:sata0", 1);
 	dnskw_gpio_register(40, "dnskw:power:sata1", 1);
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 1/3] gpio: Add simple poweroff-gpio driver
From: Andrew Lunn @ 2012-11-11 16:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352650891-18356-1-git-send-email-andrew@lunn.ch>

From: Jamie Lentin <jm@lentin.co.uk>

Given appropriate devicetree bindings, this driver registers a
pm_power_off function to set a GPIO line high/low to power down
your board.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 .../devicetree/bindings/gpio/gpio-poweroff.txt     |   22 ++++
 drivers/gpio/Kconfig                               |   10 ++
 drivers/gpio/Makefile                              |    2 +
 drivers/gpio/gpio-poweroff.c                       |  129 ++++++++++++++++++++
 4 files changed, 163 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
 create mode 100644 drivers/gpio/gpio-poweroff.c

diff --git a/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt b/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
new file mode 100644
index 0000000..558cdf3
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
@@ -0,0 +1,22 @@
+GPIO line that should be set high/low to power off a device
+
+Required properties:
+- compatible : should be "gpio-poweroff".
+- gpios : The GPIO to set high/low, see "gpios property" in
+  Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be
+  low to power down the board set it to "Active Low", otherwise set
+  gpio to "Active High".
+
+Optional properties:
+- input : Initially configure the GPIO line as an input. Only reconfigure
+  it to an output when the pm_power_off function is called. If this optional
+  property is not specified, the GPIO is initialized as an output in its
+  inactive state.
+
+
+Examples:
+
+gpio-poweroff {
+	compatible = "gpio-poweroff";
+	gpios = <&gpio 4 0>; /* GPIO 4 Active Low */
+};
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index d055cee..5ec1714 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -75,6 +75,16 @@ config GPIO_SYSFS
 	  Kernel drivers may also request that a particular GPIO be
 	  exported to userspace; this can be useful when debugging.
 
+config GPIO_POWEROFF
+	tristate "GPIO power-off driver"
+	depends on OF_GPIO
+	help
+	  This driver supports turning off your device via a GPIO line.
+	  If your device needs a GPIO high/low to power down, say Y and
+	  create a binding in your devicetree.
+
+	  If unsure, say N
+
 config GPIO_GENERIC
 	tristate
 
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 9aeed67..a8efda3 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -5,6 +5,8 @@ ccflags-$(CONFIG_DEBUG_GPIO)	+= -DDEBUG
 obj-$(CONFIG_GPIOLIB)		+= gpiolib.o devres.o
 obj-$(CONFIG_OF_GPIO)		+= gpiolib-of.o
 
+obj-$(CONFIG_GPIO_POWEROFF)	+= gpio-poweroff.o
+
 # Device drivers. Generally keep list sorted alphabetically
 obj-$(CONFIG_GPIO_GENERIC)	+= gpio-generic.o
 
diff --git a/drivers/gpio/gpio-poweroff.c b/drivers/gpio/gpio-poweroff.c
new file mode 100644
index 0000000..101ad57
--- /dev/null
+++ b/drivers/gpio/gpio-poweroff.c
@@ -0,0 +1,129 @@
+/*
+ * Toggles a GPIO pin to power down a device
+ *
+ * Jamie Lentin <jm@lentin.co.uk>
+ * Andrew Lunn <andrew@lunn.ch>
+ *
+ * Copyright (C) 2012 Jamie Lentin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/of_platform.h>
+#include <linux/of_gpio.h>
+#include <linux/module.h>
+
+/*
+ * Hold configuration here, cannot be more than one instance of the driver
+ * since pm_power_off itself is global.
+ */
+static int gpio_num = -1;
+static int gpio_active_low;
+
+static void gpio_poweroff_do_poweroff(void)
+{
+	BUG_ON(gpio_num == -1);
+
+	/* drive it active */
+	gpio_direction_output(gpio_num, !gpio_active_low);
+	mdelay(100);
+	/* rising edge or drive inactive */
+	gpio_set_value(gpio_num, gpio_active_low);
+	mdelay(100);
+	/* falling edge */
+	gpio_set_value(gpio_num, !gpio_active_low);
+
+	/* give it some time */
+	mdelay(100);
+
+	WARN_ON(1);
+}
+
+static int __devinit gpio_poweroff_probe(struct platform_device *pdev)
+{
+	enum of_gpio_flags flags;
+	bool input = false;
+	int ret;
+
+	/* If a pm_power_off function has already been added, leave it alone */
+	if (pm_power_off != NULL) {
+		pr_err("%s: pm_power_off function already registered",
+		       __func__);
+		return -EBUSY;
+	}
+
+	gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
+	if (gpio_num < 0) {
+		pr_err("%s: Could not get GPIO configuration: %d",
+		       __func__, gpio_num);
+		return -ENODEV;
+	}
+	gpio_active_low = flags & OF_GPIO_ACTIVE_LOW;
+
+	if (of_get_property(pdev->dev.of_node, "input", NULL))
+		input = true;
+
+	ret = gpio_request(gpio_num, "poweroff-gpio");
+	if (ret) {
+		pr_err("%s: Could not get GPIO %d", __func__, gpio_num);
+		return ret;
+	}
+	if (input) {
+		if (gpio_direction_input(gpio_num)) {
+			pr_err("Could not set direction of GPIO %d to input",
+			       gpio_num);
+			goto err;
+		}
+	} else {
+		if (gpio_direction_output(gpio_num, gpio_active_low)) {
+			pr_err("Could not set direction of GPIO %d", gpio_num);
+			goto err;
+		}
+	}
+
+	pm_power_off = &gpio_poweroff_do_poweroff;
+	return 0;
+
+err:
+	gpio_free(gpio_num);
+	return -ENODEV;
+}
+
+static int __devexit gpio_poweroff_remove(struct platform_device *pdev)
+{
+	if (gpio_num != -1)
+		gpio_free(gpio_num);
+	if (pm_power_off == &gpio_poweroff_do_poweroff)
+		pm_power_off = NULL;
+
+	return 0;
+}
+
+static const struct of_device_id of_gpio_poweroff_match[] = {
+	{ .compatible = "gpio-poweroff", },
+	{},
+};
+
+static struct platform_driver gpio_poweroff_driver = {
+	.probe = gpio_poweroff_probe,
+	.remove = __devexit_p(gpio_poweroff_remove),
+	.driver = {
+		   .name = "poweroff-gpio",
+		   .owner = THIS_MODULE,
+		   .of_match_table = of_gpio_poweroff_match,
+		   },
+};
+
+module_platform_driver(gpio_poweroff_driver);
+
+MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>");
+MODULE_DESCRIPTION("GPIO poweroff driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:poweroff-gpio");
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH 0/3] GPIO driver to turn power off
From: Andrew Lunn @ 2012-11-11 16:21 UTC (permalink / raw)
  To: linux-arm-kernel

A few of the Kirkwood systems use a GPIO line to turn the power off on
shutdown. They request the GPIO line in the board setup code,
optionally setting it as an output and driving it inactive. They then
register a function for pm_power_off. At the end of the shutdown, this
function is called. The GPIO line is configured as an output, if not
already so, and then driven active. In order to cover the use case of
edges rather then levels, triggering power off, the GPIO line is then
toggled active and later inactive. This should allow the driver to be
used by PXA which also has boards using the same scheme.

The driver code was initially developed by Jamie Lentin and extended
to cover the PXA case by Andrew Lunn.

Andrew Lunn (2):
  ARM: Kirkwood: Convert DNSKW to use gpio-poweroff.
  ARM: Kirkwood: Convert IB62x0 to use gpio-poweroff.

Jamie Lentin (1):
  gpio: Add simple poweroff-gpio driver

 .../devicetree/bindings/gpio/gpio-poweroff.txt     |   22 ++++
 arch/arm/boot/dts/kirkwood-dnskw.dtsi              |    5 +
 arch/arm/boot/dts/kirkwood-ib62x0.dts              |    6 +
 arch/arm/mach-kirkwood/Kconfig                     |    1 +
 arch/arm/mach-kirkwood/board-dnskw.c               |   12 --
 arch/arm/mach-kirkwood/board-ib62x0.c              |   13 --
 drivers/gpio/Kconfig                               |   10 ++
 drivers/gpio/Makefile                              |    2 +
 drivers/gpio/gpio-poweroff.c                       |  129 ++++++++++++++++++++
 9 files changed, 175 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
 create mode 100644 drivers/gpio/gpio-poweroff.c

-- 
1.7.10.4

^ permalink raw reply

* [PATCH v2] Add support for generic BCM SoC chipsets
From: Florian Fainelli @ 2012-11-11 15:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352645834-10173-1-git-send-email-csd@broadcom.com>

Hi Christian,

On Sunday 11 November 2012 06:57:14 Christian Daudt wrote:
> In order to start upstreaming Broadcom SoC support, create
> a starting hierarchy, arch and dts files.
> The first support SoC family that is planned is the
> BCM281XX (BCM28145/28150/28155/28160) family of dual A9 mobile SoC cores
> This code is just the skeleton code for get the machine upstreamed. It
> has been made MULTIPLATFORM compatible.
> Next steps
> ----------
> Upstream a basic set of drivers - sufficient for a console boot to
> ramdisk. These will includer timer, gpio, i2c drivers.
> After this basic set, we will proceed with a more comprehensive set
> of drivers for the 281XX SoC family.

Would not it make more sense to use mach-bcm281xx as a directory name instead
of mach-bcm which sounds a tad too generic? This would also make it consistent
with Domenico's mach-bcm47xx and the existing bcm47xx and bcm63xx MIPS-based
SoC support.
-- 
Florian

^ permalink raw reply

* [PATCH v2] Add support for generic BCM SoC chipsets
From: Christian Daudt @ 2012-11-11 14:57 UTC (permalink / raw)
  To: linux-arm-kernel

In order to start upstreaming Broadcom SoC support, create
a starting hierarchy, arch and dts files.
The first support SoC family that is planned is the
BCM281XX (BCM28145/28150/28155/28160) family of dual A9 mobile SoC cores
This code is just the skeleton code for get the machine upstreamed. It
has been made MULTIPLATFORM compatible.
Next steps
----------
Upstream a basic set of drivers - sufficient for a console boot to
ramdisk. These will includer timer, gpio, i2c drivers.
After this basic set, we will proceed with a more comprehensive set
of drivers for the 281XX SoC family.

v2 patch mods
--------
 - Remove l2x0_of_init call as there were problems with the code.
   A separate patch will be submitted with cache init code
 - Rename capri files and refs to bcm281xx-based names
 - Add bcm281xx binding doc
 - various misc cleanups

Signed-off-by: Christian Daudt <csd@broadcom.com>
---
 .../devicetree/bindings/arm/bcm/bcm281xx.txt       |    8 ++
 arch/arm/Kconfig                                   |    2 +
 arch/arm/Makefile                                  |    1 +
 arch/arm/boot/dts/Makefile                         |    1 +
 arch/arm/boot/dts/bcm28160-brt.dts                 |   30 +++++
 arch/arm/boot/dts/bcm281xx.dtsi                    |   50 +++++++++
 arch/arm/configs/bcm_defconfig                     |  114 ++++++++++++++++++++
 arch/arm/mach-bcm/Kconfig                          |   18 +++
 arch/arm/mach-bcm/Makefile                         |   13 +++
 arch/arm/mach-bcm/board_bcm.c                      |   58 ++++++++++
 10 files changed, 295 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm281xx.txt
 create mode 100644 arch/arm/boot/dts/bcm28160-brt.dts
 create mode 100644 arch/arm/boot/dts/bcm281xx.dtsi
 create mode 100644 arch/arm/configs/bcm_defconfig
 create mode 100644 arch/arm/mach-bcm/Kconfig
 create mode 100644 arch/arm/mach-bcm/Makefile
 create mode 100644 arch/arm/mach-bcm/board_bcm.c

diff --git a/Documentation/devicetree/bindings/arm/bcm/bcm281xx.txt b/Documentation/devicetree/bindings/arm/bcm/bcm281xx.txt
new file mode 100644
index 0000000..c47200f
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm/bcm281xx.txt
@@ -0,0 +1,8 @@
+Broadcom BCM281XX device tree bindings
+-------------------------------------------
+
+Boards with the bcm281xx SoC family shall have the following properties:
+
+Required root node property:
+
+compatible = "bcm,bcm281xx";
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ade7e92..3da77ba 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1022,6 +1022,8 @@ source "arch/arm/mach-mvebu/Kconfig"
 
 source "arch/arm/mach-at91/Kconfig"
 
+source "arch/arm/mach-bcm/Kconfig"
+
 source "arch/arm/mach-clps711x/Kconfig"
 
 source "arch/arm/mach-cns3xxx/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 5f914fc..8523fdb 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -137,6 +137,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
 # Machine directory name.  This list is sorted alphanumerically
 # by CONFIG_* macro name.
 machine-$(CONFIG_ARCH_AT91)		+= at91
+machine-$(CONFIG_ARCH_BCM)		+= bcm
 machine-$(CONFIG_ARCH_BCM2835)		+= bcm2835
 machine-$(CONFIG_ARCH_CLPS711X)		+= clps711x
 machine-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f37cf9f..25d347a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -17,6 +17,7 @@ dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb \
 	usb_a9263.dtb \
 	usb_a9g20.dtb
 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
+dtb-$(CONFIG_ARCH_BCM) += capri-brt.dtb
 dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
 	dove-cubox.dtb \
 	dove-dove-db.dtb
diff --git a/arch/arm/boot/dts/bcm28160-brt.dts b/arch/arm/boot/dts/bcm28160-brt.dts
new file mode 100644
index 0000000..1d0a217
--- /dev/null
+++ b/arch/arm/boot/dts/bcm28160-brt.dts
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2012 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+
+/include/ "bcm281xx.dtsi"
+
+/ {
+	model = "BCM28160 BRT board";
+	compatible = "bcm,bcm28160-brt", "bcm,bcm281xx";
+
+	memory {
+		reg = <0x80000000 0x40000000>; /* 1 GB */
+	};
+
+	uart at 3e000000 {
+		status = "okay";
+	};
+
+};
diff --git a/arch/arm/boot/dts/bcm281xx.dtsi b/arch/arm/boot/dts/bcm281xx.dtsi
new file mode 100644
index 0000000..e82713e
--- /dev/null
+++ b/arch/arm/boot/dts/bcm281xx.dtsi
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	model = "BCM281xx SoC";
+	compatible = "bcm,bcm281xx";
+	interrupt-parent = <&gic>;
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+	};
+
+	gic: interrupt-controller at 3ff00100 {
+		compatible = "arm,cortex-a9-gic";
+		#interrupt-cells = <3>;
+		#address-cells = <0>;
+		interrupt-controller;
+		reg = <0x3ff01000 0x1000>,
+		      <0x3ff00100 0x100>;
+	};
+
+	uart at 3e000000 {
+		compatible = "snps,dw-apb-uart";
+		status = "disabled";
+		reg = <0x3e000000 0x1000>;
+		clock-frequency = <13000000>;
+		interrupts = <0x0 67 0x4>;
+		reg-shift = <2>;
+		reg-io-width = <4>;
+	};
+
+	L2: l2-cache {
+		    compatible = "arm,pl310-cache";
+		    reg = <0x3ff20000 0x1000>;
+		    cache-unified;
+		    cache-level = <2>;
+	};
+};
diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig
new file mode 100644
index 0000000..e3bf2d6
--- /dev/null
+++ b/arch/arm/configs/bcm_defconfig
@@ -0,0 +1,114 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=19
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_BLK_CGROUP=y
+CONFIG_NAMESPACES=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_EMBEDDED=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ARCH_BCM=y
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_ERRATA_743622=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_COMPACTION is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_CMDLINE="console=ttyS0,115200n8 mem=128M"
+CONFIG_CPU_IDLE=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_PM_RUNTIME=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_BLK_DEV is not set
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_INPUT_FF_MEMLESS=y
+CONFIG_INPUT_JOYDEV=y
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_8250_DW=y
+CONFIG_HW_RANDOM=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_HWMON is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_FUSE_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_CONFIGFS_FS=y
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_PRINTK_TIME=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=110
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_LL=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC7=y
+CONFIG_XZ_DEC=y
+CONFIG_AVERAGE=y
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
new file mode 100644
index 0000000..8c1393a
--- /dev/null
+++ b/arch/arm/mach-bcm/Kconfig
@@ -0,0 +1,18 @@
+config ARCH_BCM
+	bool "Broadcom SoC" if ARCH_MULTI_V7
+	depends on MMU
+	select ARCH_REQUIRE_GPIOLIB
+	select ARM_ERRATA_754322
+	select ARM_ERRATA_764369 if SMP
+	select ARM_GIC
+	select CPU_V7
+	select GENERIC_CLOCKEVENTS
+	select GENERIC_GPIO
+	select GENERIC_TIME
+	select GPIO_BCM
+	select SPARSE_IRQ
+	select TICK_ONESHOT
+	help
+	  This enables support for system based on Broadcom SoCs.
+          It currently supports BCM28145/28150/28155/28160 chips.
+
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
new file mode 100644
index 0000000..bbf4122
--- /dev/null
+++ b/arch/arm/mach-bcm/Makefile
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2012 Broadcom Corporation
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation version 2.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+obj-$(CONFIG_ARCH_BCM) := board_bcm.o
diff --git a/arch/arm/mach-bcm/board_bcm.c b/arch/arm/mach-bcm/board_bcm.c
new file mode 100644
index 0000000..5afabab
--- /dev/null
+++ b/arch/arm/mach-bcm/board_bcm.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2.
+ *
+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+
+#include <asm/mach/arch.h>
+#include <asm/hardware/gic.h>
+
+#include <asm/mach/time.h>
+
+static const struct of_device_id irq_match[] = {
+	{.compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
+	{}
+};
+
+static void timer_init(void)
+{
+}
+
+static struct sys_timer timer = {
+	.init = timer_init,
+};
+
+static void __init init_irq(void)
+{
+	of_irq_init(irq_match);
+}
+
+static void __init board_init(void)
+{
+	of_platform_populate(NULL, of_default_bus_match_table, NULL,
+		&platform_bus);
+}
+
+static const char * const capri_dt_compat[] = { "bcm,capri", NULL, };
+
+DT_MACHINE_START(CAPRI_DT, "Broadcom Application Processor")
+	.init_irq = init_irq,
+	.timer = &timer,
+	.init_machine = board_init,
+	.dt_compat = capri_dt_compat,
+	.handle_irq = gic_handle_irq,
+MACHINE_END
-- 
1.7.1

^ permalink raw reply related

* No subject
From: Sammy Chan @ 2012-11-11 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

  http://ncompass1.altervista.org/wp-content/plugins/zgstplauaao/ugoogle.html

^ permalink raw reply

* [PATCH RFT 2/2] pinctrl: dove: Checking valid config in dove_audio1_ctrl_set
From: Axel Lin @ 2012-11-11 13:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1352641495.3113.1.camel@phoenix>

Move the code checking valid config to dove_audio1_ctrl_set(), this ensures we
always set valid config. And then dove_audio1_ctrl_get() always returns correct
config.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/mvebu/pinctrl-dove.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index e5cc694..a393790 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -217,12 +217,6 @@ static int dove_audio1_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
 	if (gcfg2 & DOVE_TWSI_OPTION3_GPIO)
 		*config |= BIT(0);
 
-	/* SSP/TWSI only if I2S1 not set*/
-	if ((*config & BIT(3)) == 0)
-		*config &= ~(BIT(2) | BIT(0));
-	/* TWSI only if SPDIFO not set*/
-	if ((*config & BIT(1)) == 0)
-		*config &= ~BIT(0);
 	return 0;
 }
 
@@ -234,6 +228,13 @@ static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
 	unsigned long gmpp = readl(DOVE_MPP_GENERAL_VIRT_BASE);
 	unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2);
 
+	/* SSP/TWSI only if I2S1 not set*/
+	if ((config & BIT(3)) == 0)
+		config &= ~(BIT(2) | BIT(0));
+	/* TWSI only if SPDIFO not set*/
+	if ((config & BIT(1)) == 0)
+		config &= ~BIT(0);
+
 	if (config & BIT(0))
 		gcfg2 |= DOVE_TWSI_OPTION3_GPIO;
 	else
-- 
1.7.9.5

^ permalink raw reply related


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