Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 05/19] mfd: wm8350-irq: Fix 'line over 80 chars' warning
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406027485-15657-1-git-send-email-lee.jones@linaro.org>

This is part of an effort to clean-up the MFD subsystem.

WARNING: line over 80 characters
+       wm8350->irq_base = irq_alloc_descs(irq_base, 0, ARRAY_SIZE(wm8350_irqs), 0);

total: 0 errors, 1 warnings, 552 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/wm8350-irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/wm8350-irq.c b/drivers/mfd/wm8350-irq.c
index cd01f79..813ff50 100644
--- a/drivers/mfd/wm8350-irq.c
+++ b/drivers/mfd/wm8350-irq.c
@@ -497,7 +497,8 @@ int wm8350_irq_init(struct wm8350 *wm8350, int irq,
 	if (pdata && pdata->irq_base > 0)
 		irq_base = pdata->irq_base;
 
-	wm8350->irq_base = irq_alloc_descs(irq_base, 0, ARRAY_SIZE(wm8350_irqs), 0);
+	wm8350->irq_base =
+		irq_alloc_descs(irq_base, 0, ARRAY_SIZE(wm8350_irqs), 0);
 	if (wm8350->irq_base < 0) {
 		dev_warn(wm8350->dev, "Allocating irqs failed with %d\n",
 			wm8350->irq_base);
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 04/19] mfd: mcp-core: Fix 'blank line after declarations' warning
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406027485-15657-1-git-send-email-lee.jones@linaro.org>

This is part of an effort to clean-up the MFD subsystem.

WARNING: Missing a blank line after declarations
+       unsigned long flags;
+       spin_lock_irqsave(&mcp->lock, flags);

total: 0 errors, 1 warnings, 238 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/mcp-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c
index 62e5e36..7f5066e 100644
--- a/drivers/mfd/mcp-core.c
+++ b/drivers/mfd/mcp-core.c
@@ -137,6 +137,7 @@ EXPORT_SYMBOL(mcp_reg_read);
 void mcp_enable(struct mcp *mcp)
 {
 	unsigned long flags;
+
 	spin_lock_irqsave(&mcp->lock, flags);
 	if (mcp->use_count++ == 0)
 		mcp->ops->enable(mcp);
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 03/19] mfd: tps80031: Fix 'missing break or fall-through comment' warning
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406027485-15657-1-git-send-email-lee.jones@linaro.org>

This is part of an effort to clean-up the MFD subsystem.

WARNING: Possible switch case/default not preceeded by break or fallthrough comment
+       case TPS80031_BACKUP_REG:

total: 0 errors, 1 warnings, 573 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/tps80031.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index ed6c5b0..7a3806c 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -334,6 +334,7 @@ static bool rd_wr_reg_id1(struct device *dev, unsigned int reg)
 	case TPS80031_PREQ1_RES_ASS_A ... TPS80031_PREQ3_RES_ASS_C:
 	case TPS80031_SMPS_OFFSET ... TPS80031_BATDEBOUNCING:
 	case TPS80031_CFG_INPUT_PUPD1 ... TPS80031_CFG_SMPS_PD:
+		/* Fall through */
 	case TPS80031_BACKUP_REG:
 		return true;
 	default:
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 02/19] mfd: max8925-i2c: Fix 'blank line after declarations' warning
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406027485-15657-1-git-send-email-lee.jones@linaro.org>

This is part of an effort to clean-up the MFD subsystem.

WARNING: Missing a blank line after declarations
+       int ret;
+       ret = i2c_add_driver(&max8925_driver);

total: 0 errors, 1 warnings, 275 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max8925-i2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index a83eed5..ecbe78e 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -257,9 +257,11 @@ static struct i2c_driver max8925_driver = {
 static int __init max8925_i2c_init(void)
 {
 	int ret;
+
 	ret = i2c_add_driver(&max8925_driver);
 	if (ret != 0)
 		pr_err("Failed to register MAX8925 I2C driver: %d\n", ret);
+
 	return ret;
 }
 subsys_initcall(max8925_i2c_init);
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 01/19] mfd: max77686: Fix 'line over 80 chars' warning
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406027485-15657-1-git-send-email-lee.jones@linaro.org>

This is part of an effort to clean-up the MFD subsystem.

+WARNING: line over 80 characters
+                                      &max77686_rtc_regmap_config);

total: 0 errors, 1 warnings, 299 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max77686.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 8650832..f2bd699 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -166,7 +166,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
 	i2c_set_clientdata(max77686->rtc, max77686);
 
 	max77686->rtc_regmap = devm_regmap_init_i2c(max77686->rtc,
-						    &max77686_rtc_regmap_config);
+						&max77686_rtc_regmap_config);
 	if (IS_ERR(max77686->rtc_regmap)) {
 		ret = PTR_ERR(max77686->rtc_regmap);
 		dev_err(max77686->dev, "failed to allocate RTC regmap: %d\n",
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 00/19] mfd: Fix checkpatch errors
From: Lee Jones @ 2014-07-22 11:11 UTC (permalink / raw)
  To: linux-arm-kernel

I'm going through the subsystem rectifying all of the warnings/errors
checkpatch finds.  Please review as appropriate.

Lee Jones (19):
  mfd: max77686: Fix 'line over 80 chars' warning
  mfd: max8925-i2c: Fix 'blank line after declarations' warning
  mfd: tps80031: Fix 'missing break or fall-through comment' warning
  mfd: mcp-core: Fix 'blank line after declarations' warning
  mfd: wm8350-irq: Fix 'line over 80 chars' warning
  mfd: dm355evm_msp: Fix checkpatch error: insert space after ','
  mfd: sec-core: Fix 'missing blank line after declarations' warning
  mfd: twl6040: Fix 'insert space after ','', error
  mfd: ezx-pcap: Repair coding style errors picked up with checkpatch
  mfd: lp8788-irq: Fix 'missing blank line after declarations' warning
  mfd: twl4030-irq: Fix style warnings relating to pr_warn() and sizeof()
  mfd: max8925-core: Fix 'missing blank line after declarations' warning
  mfd: wm8350-i2c: Replace spaces with tabs
  mfd: twl6030-irq: Extinguish coding style warnings
  mfd: tc6387xb: Remove unnecessary braces and correct style warnings
  mfd: si476x-cmd: Remedy checkpatch style complains
  mfd: ipaq-micro: Fix coding style errors/warnings reported by checkpatch
  mfd: kempld-core: Correct a variety of checkpatch warnings
  mfd: wm8997-tables: Suppress 'line over 80 chars' warnings

 drivers/mfd/dm355evm_msp.c  |  2 +-
 drivers/mfd/ezx-pcap.c      |  6 +++---
 drivers/mfd/ipaq-micro.c    |  8 ++++----
 drivers/mfd/kempld-core.c   | 10 ++++++----
 drivers/mfd/lp8788-irq.c    |  2 ++
 drivers/mfd/max77686.c      |  2 +-
 drivers/mfd/max8925-core.c  |  2 ++
 drivers/mfd/max8925-i2c.c   |  2 ++
 drivers/mfd/mcp-core.c      |  1 +
 drivers/mfd/sec-core.c      |  1 +
 drivers/mfd/si476x-cmd.c    | 12 ++++++------
 drivers/mfd/tc6387xb.c      |  7 +++----
 drivers/mfd/tps80031.c      |  1 +
 drivers/mfd/twl4030-irq.c   |  6 +++---
 drivers/mfd/twl6030-irq.c   |  4 +++-
 drivers/mfd/twl6040.c       |  2 +-
 drivers/mfd/wm8350-i2c.c    |  8 ++++----
 drivers/mfd/wm8350-irq.c    |  3 ++-
 drivers/mfd/wm8997-tables.c |  8 ++++----
 19 files changed, 50 insertions(+), 37 deletions(-)

-- 
1.8.3.2

^ permalink raw reply

* [GIT PULL 1/5] Samsung non-critical-fixes for v3.17
From: Kukjin Kim @ 2014-07-22 11:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140719215942.GC15676@quad.lixom.net>

Olof Johansson wrote:
> 
> On Sat, Jul 19, 2014 at 09:51:45AM +0900, Kukjin Kim wrote:
> > The following changes since commit 1795cd9b3a91d4b5473c97f491d63892442212ab:
> >
> >   Linux 3.16-rc5 (2014-07-13 14:04:33 -0700)
> >
> > are available in the git repository at:
> >
> 
> > git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> > tags/fixes-for-3.17
> >
> > for you to fetch changes up to 042b687f880adcca77847688aac35e2e16927944:
> >
> >   ARM: EXYNOS: Fix build breakge with PM_SLEEP=n (2014-07-19
> > 04:45:02 +0900)
> >
> > ----------------------------------------------------------------
> > Samsung non critical fixes for v3.17
> > - update exynos_defconfig for remove outdated configs and
> > enable most of the configs used on latest exynos platforms
> > - fix build breakge for exynos_defconfig with PM_SLEEP=n
> 
> Hi,
> 
Hi, Olof,

> We now separate out defconfigs (as you might have noticed if you looked
> at our tree). I don't see any dependencies between these changes and
> the rest so I'll cherry-pick the patches into fixes-non-critical (for
> the build fix) and defconfig for that patch.
> 
OK, I'm fine and I will follow the way next time.

Thanks for your cherry-pick and pulling other trees.

- Kukjin

^ permalink raw reply

* [PATCH v2 1/4] mfd: pm8xxx-spmi: add support for Qualcomm SPMI PMICs
From: Lee Jones @ 2014-07-22 11:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1405613855-27572-2-git-send-email-svarbanov@mm-sol.com>

On Thu, 17 Jul 2014, Stanimir Varbanov wrote:

> From: Josh Cartwright <joshc@codeaurora.org>
> 
> The Qualcomm SPMI PMIC chips are components used with the
> Snapdragon 800 series SoC family.  This driver exists
> largely as a glue mfd component, it exists to be an owner
> of an SPMI regmap for children devices described in
> device tree.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>

Needs to be signed off by the author.

> ---
>  drivers/mfd/Kconfig       |   16 +++++++++++
>  drivers/mfd/Makefile      |    1 +
>  drivers/mfd/pm8xxx-spmi.c |   63 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 80 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/pm8xxx-spmi.c

[...]

> +++ b/drivers/mfd/pm8xxx-spmi.c
> @@ -0,0 +1,63 @@
> +/*
> + * Copyright (c) 2014, The Linux Foundation. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 and
> + * only version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */

There should be a '\n' here.

> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/spmi.h>
> +#include <linux/regmap.h>
> +#include <linux/of_platform.h>

[...]

> +MODULE_DESCRIPTION("PM8XXX SPMI PMIC driver");
> +MODULE_ALIAS("platform:" KBUILD_MODNAME);
> +MODULE_AUTHOR("The Linux Foundation");

The Linux Foundation did not write this patch.

> +MODULE_LICENSE("GPL v2");

Appart from that:

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [GIT PULL 4/5] Samsung exynos_mct update for v3.17
From: Kukjin Kim @ 2014-07-22 10:59 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <53CCD3AB.7040205@linaro.org>

Daniel Lezcano wrote:
> 
> On 07/20/2014 12:06 AM, Olof Johansson wrote:
> > On Sat, Jul 19, 2014 at 09:52:52AM +0900, Kukjin Kim wrote:
> >> Note that this is also based on 3.16-rc5 because of dependency with
> >> previous samsung fixes including exynos_mct already merged in
> >> mainline during -rc.
> >>
> >> The following changes since commit 1795cd9b3a91d4b5473c97f491d63892442212ab:
> >>
> >>    Linux 3.16-rc5 (2014-07-13 14:04:33 -0700)
> >>
> >> are available in the git repository at:
> >>
> >
> >> git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> >> tags/exynos-mct
> >>
> >> for you to fetch changes up to 1a631118c1d085fe162f3b6d44f710c72206ef2d:
> >>
> >>    clocksource: exynos_mct: Only use 32-bits where possible
> >> (2014-07-19 03:07:52 +0900)
> >>
> >> ----------------------------------------------------------------
> >> exynos_mct update for v3.17
> >> - only use 32-bit access for performance benefits on exynos
> >>    32-bit system and this means ARCH timer should be supported
> >>    on exynos 64-bit system instead of current MCT.
> >> - use readl_relaxed/writel_relaxed to consistently use the
> >>    proper functions in exynos_mct.
> >
> > There's no reason for these to go through arm-soc, is there? They should
> > go through the clocksource tree (Daniel Lezcano / Thomas Gleixner). They
> > also lack acks from them if they for some reason need to go through arm-soc.
> 
Olof, you're right. The branch has no dependency with arm-soc so I agreed.

> Yes, that's right. Furthermore I have been discussing with Doug about
> these patches before.
> 
> Kukjin, is there any dependency on these patches ?
> 
Yeah, Daniel, it should be handled in the clocksource tree so how should I do
for it?

Thanks,
Kukjin

^ permalink raw reply

* [PATCH 2/2] iio: adc: exynos_adc: Add support for S3C24xx ADC
From: Heiko Stübner @ 2014-07-22 10:44 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <5200888.DXoC06U953@wuerfel>

Am Dienstag, 22. Juli 2014, 10:39:38 schrieb Arnd Bergmann:
> On Tuesday 22 July 2014 11:11:14 Chanwoo Choi wrote:
> > This patch add support for s3c2410/s3c2416/s3c2440/s3c2443 ADC. The
> > s3c24xx
> > is alomost same as ADCv1. But, There are a little difference as following:
> > - ADCMUX register address to select channel
> > - ADCDAT mask (10bit or 12bit ADC resolution according to SoC version)
> 
> Very good, thanks for doing this patch!
> 
> (adding Heiko to Cc, he's probably interested in seeing this as well.

indeed. Thanks for implementing this.

While trying to build a test setup for this, I noticed two points:

(1) I'm not sure what the second register (a "phy enable register" according
to the binding) is supposed to be.
According to binding and adc code it is mandatory, but I didn't find any
lone adc register in the s3c2416 manual.


(2) You might need something along the lines of:

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 11b048a..088c99a 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -129,7 +129,7 @@ config AT91_ADC
 
 config EXYNOS_ADC
        tristate "Exynos ADC driver support"
-       depends on ARCH_EXYNOS || (OF && COMPILE_TEST)
+       depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
        help
          Core support for the ADC block found in the Samsung EXYNOS series
          of SoCs for drivers such as the touchscreen and hwmon to use to share


Thanks
Heiko

> 
> One comment:
> > @@ -101,12 +107,14 @@ struct exynos_adc {
> > 
> >  	struct completion	completion;
> >  	
> >  	u32			value;
> > 
> > +	u32			value2;
> > 
> >  	unsigned int            version;
> >  
> >  };
> > 
> > ...
> > @@ -365,7 +448,7 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
> > 
> >  		ret = -ETIMEDOUT;
> >  	
> >  	} else {
> >  	
> >  		*val = info->value;
> > 
> > -		*val2 = 0;
> > +		*val2 = info->value2;
> > 
> >  		ret = IIO_VAL_INT;
> >  	
> >  	}
> > 
> > @@ -377,9 +460,11 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
> > 
> >  static irqreturn_t exynos_adc_isr(int irq, void *dev_id)
> >  {
> >  
> >  	struct exynos_adc *info = (struct exynos_adc *)dev_id;
> > 
> > +	u32 mask = info->data->mask;
> > 
> >  	/* Read value */
> > 
> > -	info->value = readl(ADC_V1_DATX(info->regs)) & ADC_DATX_MASK;
> > +	info->value = readl(ADC_V1_DATX(info->regs)) & mask;
> > +	info->value2 = readl(ADC_V1_DATY(info->regs)) & mask;
> > 
> >  	/* clear irq */
> >  	if (info->data->clear_irq)
> 
> If I understand it right, this would only be necessary if we want
> to do the touchscreen driver as a separate iio client using the
> in-kernel interfaces. As Jonathan Cameron commented, we probably
> don't want to do that though. Even if we do, it should be a separate
> patch and not mixed in with the s3c24xx support.
> 
> Aside from this:
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> 	Arnd

^ permalink raw reply related

* [PATCH v2 4/4] mfd: pm8921: rename pm8921-core driver
From: Lee Jones @ 2014-07-22 10:32 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1405613855-27572-5-git-send-email-svarbanov@mm-sol.com>

On Thu, 17 Jul 2014, Stanimir Varbanov wrote:

> The pm8921-core driver presently supports pm8921 and pm8058
> Qualcomm PMICs.  To avoid confusion with new generation PMICs
> (like pm8941) rename the pm8921-core driver to more
> appropriate name pm8xxx-ssbi, which reflects better that
> those chips use SSBI interface.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> ---
>  drivers/mfd/Kconfig                          |   14 +++++-----
>  drivers/mfd/Makefile                         |    2 +-
>  drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} |   38 +++++++++++++-------------
>  3 files changed, 27 insertions(+), 27 deletions(-)
>  rename drivers/mfd/{pm8921-core.c => pm8xxx-ssbi.c} (92%)

Patch looks fine to me.

  Acked-by: Lee Jones <lee.jones@linaro.org>

I'm assuming we want to wait for the others in the set to be ready
before applying?

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [GIT PULL 2/3] ARM: tegra: move fuse code out of arch/arm
From: Catalin Marinas @ 2014-07-22 10:27 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAOesGMgvd1HbjywN7BDPtr8ZU7vucWH48B=AW3TZjng73YA8WA@mail.gmail.com>

On Mon, Jul 21, 2014 at 05:46:02PM +0100, Olof Johansson wrote:
> On Mon, Jul 21, 2014 at 9:38 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 07/21/2014 09:54 AM, Catalin Marinas wrote:
> >> We have a similar issue with arm64 vexpress (well, just on the model)
> >> where vexpress_sysreg_init() is a core_initcall (should be fine as
> >> arch_initcall) as it needs to be done before of_platform_populate().
> >> Pawel on cc should know more of the history here.
> >>
> >> I recall there were also some discussions about a SoC driver model which
> >> hangs off the top compatible string in the DT (e.g. "arm,vexpress") and
> >> allow (minimal) code to be run slightly earlier, though still not
> >> earlier than arch_initcall.
> >
> > I guess that would work out OK; if we force the driver that binds to a
> > top-level compatible value of "nvidia,tegraNNN" to probe first, and it
> > then calls out to all the low-level init code in a sane order, that
> > would solve the problem. I'm not sure that's any better than having a
> > machine descriptor with an "init" function though; wrapping all this in
> > a driver just seems like overhead, but it would work out OK.
> 
> This is exactly the same as having a machine descriptor, but the
> arch/arm64 maintainers don't have to look at it so they don't think it
> is one.
> 
> So now we need to find a place for machine descriptors somewhere under
> drivers/* too. Sigh. Agreed, this is nothing but overhead and
> overabstraction.

You are missing the point. It's not the machine descriptor (or mach-*
directories) I want to hide but rather the need for early SoC specific
initialisation. Always providing a machine descriptor with hooks for
early SoC initialisation does not provide any incentive for people to
think properly about what's early hardware configuration (usually done
by firmware), what's actually needed for CPU booting (SoC-independent
with a secondary booting protocol selectable from a small set) and how
the rest of the SoC fits with the Linux device model. It's also aimed at
pushing back on hardware people who think they can mess up, for example,
a GIC implementation because the rest is just software and you can
always add #ifdefs.

On 32-bit ARM this was not always possible (non-standard essential
peripherals like IRQ controller, timers) but with arm64 we have the
things needed to be able to boot an SoC to arch_initcall level without
any early hooks. I agree that on occasion we may need some early SoC
code just because of some (bad) hardware design or simply to work around
firmware/hardware bugs (and Pawel's patch is a nice approach). But this
should definitely not be the norm and I disagree with moving entire
arch/arm/mach-* code to drivers/soc just because one can't decide where
early SoC initialisation belongs to. Also the legacy firmware argument
doesn't hold for ARMv8/arm64 since the CPU now starts at EL3 in AArch64
mode and you need code there before Linux is invoked (at EL2 or EL1).

In the Tegra fuse case, it's not actually some hardware configuration
that needs to be set up early but rather a driver dependency
initialisation which is not (cannot be) handled by the DT. This is not
that different from the vexpress sysregs mfd where we worked around
using an initcall. It's not ideal, I would prefer something simpler like
sibling DT node sorting during unflattening (or maybe addressing issues
with deferred probing if there are any) rather than working around it
using machine_desc.

-- 
Catalin

^ permalink raw reply

* [PATCH] ARM: imx6: fix SMP compilation again
From: Arnd Bergmann @ 2014-07-22 10:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140722085055.GX8537@dragon>

On Tuesday 22 July 2014 16:50:56 Shawn Guo wrote:
> On Tue, Jul 22, 2014 at 10:30:50AM +0200, Arnd Bergmann wrote:
> > My earlier patch 1fc593feaf8e ("ARM: imx: build i.MX6 functions
> > only when needed") fixed a problem with building an i.MX5 kernel,
> > but missed the corner case of building a kernel for i.MX5 with
> > SMP enabled. It is an extremely rare case that has only now
> > happened after many thousands of randconfig kernel builds.
> > 
> > The error message I get is
> > arch/arm/mach-imx/built-in.o: In function `v7_secondary_startup':
> > :(.text+0x5124): undefined reference to `v7_invalidate_l1'
> 
> I cannot reproduce it, and unsure how it happens.
> 
> The v7_invalidate_l1() is defined in arch/arm/mm/cache-v7.S, and should
> be available for i.MX5 build.
> 

Ah, you are right, I got the text wrong here, and I think I now understand
why it didn't happen earlier. Updated patch below (same patch, new
text).

8<-------------
Subject: [PATCH] ARM: imx6: fix SMP compilation again

My earlier patch 1fc593feaf8e ("ARM: imx: build i.MX6 functions
only when needed") fixed a problem with building an i.MX5 kernel,
but now the problem has returned for the case where we allow
ARMv6K SMP builds in multiplatform. With CONFIG_CPU_V7 disabled,
but i.MX3 and SMP enabled, we get this build error:

arch/arm/mach-imx/built-in.o: In function `v7_secondary_startup':
:(.text+0x5124): undefined reference to `v7_invalidate_l1'

This puts the code inside of an "ifdef CONFIG_SMP" to hopefully
do the right thing in all configurations.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index ac88599ca080..23c02932bf84 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -93,9 +93,11 @@ obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o
 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
 obj-$(CONFIG_HAVE_IMX_SRC) += src.o
+ifdef CONFIG_SOC_IMX6
 AFLAGS_headsmp.o :=-Wa,-march=armv7-a
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
+endif
 obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
 obj-$(CONFIG_SOC_IMX6SX) += clk-imx6sx.o mach-imx6sx.o

^ permalink raw reply related

* [linux-sunxi] GSoC 2014 #1 status report - Improving Allwinner SoC support
From: Chen-Yu Tsai @ 2014-07-22 10:22 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAGb2v67YZVnY1869uau_R7MGKGW2EeS2P0qtN0TX_0Uan-aRNw@mail.gmail.com>

On Sun, Jul 20, 2014 at 12:18 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> Hi Emilio,
>
> On Sun, Jul 20, 2014 at 3:41 AM, Emilio L?pez <emilio@elopez.com.ar> wrote:
>> Hi everyone,
>>
>> Here's this week's update on my GSoC project; if you missed the first issue
>> or you want a refresher of what this is about, you can read it on the list
>> archives[0]
>>
>> A couple of days after the last report, and with the help of Jon Smirl, I
>> got the hardware working on mainline Linux, first on only 16 bit stereo
>> mode, then mono as well, and later on, also on 24 bit mode. The first thing
>> I had to do was rework the cyclic DMA code to make it perform decently and
>> avoid underruns. The rest took a bit of playing with values and reading the
>> Allwinner documentation. There is one unresolved issue with 24 bit audio
>> still - for some reason, the volume is really low compared to the same track
>> played on 16 bit. Unfortunately the SDK driver doesn't support 24 bit, so
>> it's hard to compare with anything else.
>
> So I have not experimented on this, it's just a hunch:
> Could it be that the 24bit audio samples you're sending to the audio codec
> is aligned incorrectly? So the sample is actually seen as down-shifted by
> 8 bits, resulting in the low volume?

So the user manual says that 24 bit samples should be right justified,
or in the most significant bytes. The way to do it in ASoC is to declare
support 32 bit, instead of 24 bit, audio, and also set .sig_bits to 24.

See: http://www.spinics.net/lists/alsa-devel/msg40846.html

This makes ALSA send 32bit data, and the hardware will drop the lower 8
bits. S24_LE denotes 24bit in the lower bits, and thus we cannot use it.

However, there is something puzzling about the FIFO modes. The manual
says that with TX FIFO modes 00/10, 16 bit audio should take the most
significant 2 bytes of the FIFO as the audio sample to convert. However
the DMA engine looks like it's writing the least significant 2 bytes.
I know the code as it is now works, but still I think we should get
this straightened out.

As a side note, the code still needs some cleaning up. I see some
duplicate codec/dais.

> I'll grab your tree and test 24bit tomorrow. (Good thing I have 24 bit
> music files.) :)

I now have my CubieTruck singing nicely with 24 bit music. Either the
player or ALSA will extend the 24 bits to 32 bits. The only downside
is you cannot specify S24_LE when streaming directly to the hardware
device.


Cheers
ChenYu

>> Aside from the audio stuff, I worked a bit on the DMA driver, after
>> realizing memcpy could be optimized a fair bit. By using proper alignment
>> and choosing the best bus width and as big a burst as possible, I was able
>> to go from a totally unscientifically measured ~3MB/s to ~13MB/s on a single
>> thread, single channel, 1000 iterations dmatest run with noverify=0. I will
>> be sending a v3 with these new changes as well as addressing comments I
>> received in the next few days.
>
> This still seems quite slow? I think there was a discussion about this
> on IRC, you included? Any followups there?
>
>> To round up on this week's developments, I also worked on the audio clock
>> representation, involving PLL2, the codec clock gate and "module 1" clocks
>> (AC97, SPDIF, IIS) to enable Jon to work on IIS. Patches for these clocks
>> will be out in the list soon as well.
>
> Thanks! I look forward to them.
>
>
> Cheers
> ChenYu
>
>> You can expect the next status report in about a week's time.
>>
>> Cheers!
>>
>> Emilio
>>
>> [0]
>> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/271150.html

^ permalink raw reply

* [PATCH V2 1/2] ARM: DRA7: hwmod: Add data for RTC
From: Lokesh Vutla @ 2014-07-22 10:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1404894932-26677-2-git-send-email-lokeshvutla@ti.com>

Hi Paul,
On Wednesday 09 July 2014 02:05 PM, Lokesh Vutla wrote:
> Add hwmod data for RTC
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
> Reviewed-by: Rajendra Nayak <rnayak@ti.com>
Can you take this patch. I have submitted logs also.

Thanks and regards,
Lokesh
> ---
> Changes since V1:
> Rebased on top of linux-next 20140708.
> 
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c |   41 +++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> index 20b4398..d8032b9 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> @@ -1249,6 +1249,38 @@ static struct omap_hwmod dra7xx_qspi_hwmod = {
>  };
>  
>  /*
> + * 'rtcss' class
> + *
> + */
> +static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
> +	.sysc_offs	= 0x0078,
> +	.sysc_flags	= SYSC_HAS_SIDLEMODE,
> +	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
> +			   SIDLE_SMART_WKUP),
> +	.sysc_fields	= &omap_hwmod_sysc_type3,
> +};
> +
> +static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
> +	.name	= "rtcss",
> +	.sysc	= &dra7xx_rtcss_sysc,
> +};
> +
> +/* rtcss */
> +static struct omap_hwmod dra7xx_rtcss_hwmod = {
> +	.name		= "rtcss",
> +	.class		= &dra7xx_rtcss_hwmod_class,
> +	.clkdm_name	= "rtc_clkdm",
> +	.main_clk	= "sys_32k_ck",
> +	.prcm = {
> +		.omap4 = {
> +			.clkctrl_offs = DRA7XX_CM_RTC_RTCSS_CLKCTRL_OFFSET,
> +			.context_offs = DRA7XX_RM_RTC_RTCSS_CONTEXT_OFFSET,
> +			.modulemode   = MODULEMODE_SWCTRL,
> +		},
> +	},
> +};
> +
> +/*
>   * 'sata' class
>   *
>   */
> @@ -2344,6 +2376,14 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__qspi = {
>  	.user		= OCP_USER_MPU | OCP_USER_SDMA,
>  };
>  
> +/* l4_per3 -> rtcss */
> +static struct omap_hwmod_ocp_if dra7xx_l4_per3__rtcss = {
> +	.master		= &dra7xx_l4_per3_hwmod,
> +	.slave		= &dra7xx_rtcss_hwmod,
> +	.clk		= "l4_root_clk_div",
> +	.user		= OCP_USER_MPU | OCP_USER_SDMA,
> +};
> +
>  static struct omap_hwmod_addr_space dra7xx_sata_addrs[] = {
>  	{
>  		.name		= "sysc",
> @@ -2673,6 +2713,7 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
>  	&dra7xx_l4_cfg__mpu,
>  	&dra7xx_l4_cfg__ocp2scp1,
>  	&dra7xx_l3_main_1__qspi,
> +	&dra7xx_l4_per3__rtcss,
>  	&dra7xx_l4_cfg__sata,
>  	&dra7xx_l4_cfg__smartreflex_core,
>  	&dra7xx_l4_cfg__smartreflex_mpu,
> 

^ permalink raw reply

* [PATCH RFC 5/9] ARM: Add L1 PTE non-secure mapping
From: Daniel Thompson @ 2014-07-22 10:16 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140721164634.GF21766@n2100.arm.linux.org.uk>

On 21/07/14 17:46, Russell King - ARM Linux wrote:
> On Mon, Jul 21, 2014 at 03:47:16PM +0100, Daniel Thompson wrote:
>> From: Marek Vasut <marex@denx.de>
>>
>> Add new device type, MT_DEVICE_NS. This type sets the NS bit in L1 PTE [1].
>> Accesses to a memory region which is mapped this way generate non-secure
>> access to that memory area. One must be careful here, since the NS bit is
>> only available in L1 PTE, therefore when creating the mapping, the mapping
>> must be at least 1 MiB big and must be aligned to 1 MiB. If that condition
>> was false, the kernel would use regular L2 page mapping for this area instead
>> and the NS bit setting would be ineffective.
> 
> Right, so this says that PTE mappings are not permissible.
> 
>> +	[MT_DEVICE_NS] = {	  /* Non-secure accesses from secure mode */
>> +		.prot_pte	= PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED |
>> +				  L_PTE_SHARED,
>> +		.prot_l1	= PMD_TYPE_TABLE,
> 
> However, by filling in prot_pte and prot_l1, you're telling the code that
> it /can/ setup such a mapping.  This is screwed.

I'll fix this.


> If you want to deny anything but section mappings (because they don't work)
> then you omit prot_pte and prot_l1.  With those omitted, if someone tries
> to abuse this mapping type, then this check in create_mapping() will
> trigger:
> 
>         if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
>                 printk(KERN_WARNING "BUG: map for 0x%08llx at 0x%08lx can not "
>                        "be mapped using pages, ignoring.\n",
>                        (long long)__pfn_to_phys(md->pfn), addr);
>                 return;
>         }
> 
> ioremap doesn't have that check; it assumes that it will always be setting
> up PTE mappings via ioremap_page_range().  In fact, on many platforms
> that's the only option.

I have proposed a patch (which I just noticed is currently *really*
broken but ignore that for now) to prevent the fallback to
ioremap_page_range(). As you say this leaves nothing but the lookup in
the static mappings for many platforms.

That patches looks at PMD_SECT_NS directly but could be changed to zero
check ->prot_l1 instead.

That removes the danger of spuriously getting bad mappings but is
certainly not elegant.


> So making this interface available via ioremap() seems pointless - but
> more importantly it's extremely error-prone.  So, MT_DEVICE_NS shouldn't
> be using 4 at all, shouldn't be in asm/io.h, but should be with the
> private MT_* definitions in map.h.

I wanted to use ioremap() because it allows platform neutral code in the
GIC driver to look up a staticly configured non-secure aliased mapping
for the GIC (if it exists). Also given the mapping is used for register
I/O ioremap() also felt "right".

Is new API better? A very thin wrapper around find_static_vm_paddr()?

I guess the best thing would be to allocate the mapping dynamically. It
might be possible for __arm_ioremap_pfn_caller() to change the NS flag
in the first-level table after allocating a naturally aligned 1MB
vm_area and before updating the second-level? We are not required to use
sections, however all pages that share a L1 entry get the same security
flags.


Daniel.

^ permalink raw reply

* [PATCH v2 1/3] usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC
From: Lee Jones @ 2014-07-22 10:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140722091800.GB8233@griffinp-ThinkPad-X1-Carbon-2nd>

> Thanks for reviewing, see my comments inline below: -

In future, it's best to only reply to questions, or review comments
that you disagree with.  Anything that you will action or agree with
can be snipped along with any irrelevant code from your reply and
replaced with "<snip>" or "[...]".  If you are planning on actioning
everything and no not disagree with anything there's no need to reply
at all.

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH] drm: shmobile: fix warnings
From: Dave Airlie @ 2014-07-22 10:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140722085225.GI21766@n2100.arm.linux.org.uk>

On 22 July 2014 18:52, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> On Sun, Jul 13, 2014 at 12:19:03PM +0100, Russell King wrote:
>> drivers/gpu/drm/shmobile/shmob_drm_drv.c:300:5: warning: "CONFIG_PM_SLEEP" is not defined [-Wundef]
>>
>> Always use #ifdef with CONFIG symbols, never just bare #if
>>
>> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>
> Ping?
>

I merged all these to -next earlier today,

I'm still looking at the other ones that have dependant patches on
Greg on how best to merge.

Dave.

^ permalink raw reply

* [Re-send PATCH 1/1] arm: dra7xx: Add hwmod data for MDIO and CPSW
From: Mugunthan V N @ 2014-07-22 10:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140717074948.GF18374@atomide.com>

On Thursday 17 July 2014 01:19 PM, Tony Lindgren wrote:
> We seem to have this layout WR_SOFT_RESET and WR_CONTROL in the TRM:
>
> WR_SOFT_RESET
> [0]     SOFT_RESET
>
> WR_CONTROL
> [3:2]   MMR_STDBYMODE   0 = force-idle, 1 = no-standby
> [1:0]   MMR_IDLEMODE    0 = force-idle, 1 = no-idle
>
> And so it seems to match what am33xx also has for am33xx_cpgmac_sysc
> and am33xx TRM for 14.5.9 CONTROL register. So as far as I'm concerned:
>
> Acked-by: Tony Lindgren <tony@atomide.com>
Paul,

Can you pull this patch as Tony acked the patch.

Regards
Mugunthan V N

^ permalink raw reply

* [PATCH v2] bus: ARM CCN PMU driver
From: Pawel Moll @ 2014-07-22 10:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1405091188-31754-1-git-send-email-pawel.moll@arm.com>

Hi Arnd, Kevin, Olof, 

On Fri, 2014-07-11 at 16:06 +0100, Pawel Moll wrote:
> Driver providing perf backend for ARM Cache Coherent Network
> interconnect. Supports counting all hardware events and crosspoint
> watchpoints.
> 
> Currently works with CCN-504 only, although there should be
> no changes required for CCN-508 (just impossible to test it now).
> 
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>

Would you consider taking this through arm-soc tree? There isn't
anything in MAINTAINERS, but I vaguely remember Arnd proposing this
directory in the first place...

Cheers!

Pawel

^ permalink raw reply

* [PATCH v9] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2014-07-22 10:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1404824767.21897.7.camel@hornet>

On Tue, 2014-07-08 at 14:06 +0100, Pawel Moll wrote:
> On Tue, 2014-06-24 at 12:55 +0100, Pawel Moll wrote:
> > This patch adds basic DT bindings for the PL11x CLCD cells
> > and make their fbdev driver use them.
> > 
> > Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> 
> As two weeks passed without any further comment, I'm assuming that there
> are no more obstacles for this patch to be merged.
> 
> Tomi, will you pick it up for 3.17, as you offered? Russell, if you
> prefer to take it via your tree, it's in your system as 8005/4.

Ping...

Tomi?

Pawe?

^ permalink raw reply

* [PATCH v2] platform: Make platform_bus device a platform device
From: Pawel Moll @ 2014-07-22 10:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140721184007.GB572@kroah.com>

... describing the root of the device tree, so one can write
a platform driver initializing the platform.

All references to platform_bus device have been fixed up,
although in most cases they could be simply removed or
replaced by NULL (platform devices with no parent are adopted
by main platform_bus device automagically).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---

Changes since v1:

* rebase on top of v3.16-rc6

* fixed up all new explicit references to platform_bus,
  with majority in mach-shmobile; 99% of them seem completely
  useless and I was *very* tempted to replace them with
  NULL - all reasons for and against this are welcomed

 arch/arm/mach-bcm/board_bcm21664.c      |  2 +-
 arch/arm/mach-bcm/board_bcm281xx.c      |  2 +-
 arch/arm/mach-clps711x/board-edb7211.c  |  6 ++---
 arch/arm/mach-clps711x/board-p720t.c    |  6 ++---
 arch/arm/mach-imx/devices/devices.c     |  4 ++--
 arch/arm/mach-imx/mach-mx27ads.c        |  2 +-
 arch/arm/mach-shmobile/board-ape6evm.c  | 14 ++++++------
 arch/arm/mach-shmobile/board-bockw.c    | 22 +++++++++---------
 arch/arm/mach-shmobile/board-genmai.c   |  6 ++---
 arch/arm/mach-shmobile/board-koelsch.c  | 28 +++++++++++------------
 arch/arm/mach-shmobile/board-lager.c    | 40 ++++++++++++++++-----------------
 arch/arm/mach-shmobile/board-marzen.c   |  2 +-
 arch/arm/mach-shmobile/setup-r7s72100.c |  2 +-
 arch/arm/mach-shmobile/setup-r8a73a4.c  |  8 +++----
 arch/arm/mach-shmobile/setup-r8a7778.c  | 14 ++++++------
 arch/arm/mach-shmobile/setup-r8a7779.c  |  6 ++---
 arch/arm/mach-shmobile/setup-r8a7790.c  | 10 ++++-----
 arch/arm/mach-shmobile/setup-r8a7791.c  |  8 +++----
 arch/unicore32/kernel/puv3-core.c       |  2 +-
 arch/unicore32/kernel/puv3-nb0916.c     |  6 ++---
 drivers/base/platform.c                 | 18 ++++++++++-----
 drivers/char/tile-srom.c                |  2 +-
 drivers/mmc/host/sdhci-pltfm.c          |  2 +-
 drivers/scsi/hosts.c                    |  2 +-
 include/linux/platform_device.h         |  2 +-
 25 files changed, 111 insertions(+), 105 deletions(-)

diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c
index f0521cc..310dae9 100644
--- a/arch/arm/mach-bcm/board_bcm21664.c
+++ b/arch/arm/mach-bcm/board_bcm21664.c
@@ -61,7 +61,7 @@ static void bcm21664_restart(enum reboot_mode mode, const char *cmd)
 static void __init bcm21664_init(void)
 {
 	of_platform_populate(NULL, of_default_bus_match_table, NULL,
-		&platform_bus);
+		&platform_bus.dev);
 	kona_l2_cache_init();
 }
 
diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c
index 1ac59fc..00aa22a 100644
--- a/arch/arm/mach-bcm/board_bcm281xx.c
+++ b/arch/arm/mach-bcm/board_bcm281xx.c
@@ -59,7 +59,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
 static void __init bcm281xx_init(void)
 {
 	of_platform_populate(NULL, of_default_bus_match_table, NULL,
-		&platform_bus);
+		&platform_bus.dev);
 	kona_l2_cache_init();
 }
 
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c
index f9828f8..425a00b 100644
--- a/arch/arm/mach-clps711x/board-edb7211.c
+++ b/arch/arm/mach-clps711x/board-edb7211.c
@@ -158,16 +158,16 @@ static void __init edb7211_init_late(void)
 	gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios));
 
 	platform_device_register(&edb7211_flash_pdev);
-	platform_device_register_data(&platform_bus, "platform-lcd", 0,
+	platform_device_register_data(&platform_bus.dev, "platform-lcd", 0,
 				      &edb7211_lcd_power_pdata,
 				      sizeof(edb7211_lcd_power_pdata));
-	platform_device_register_data(&platform_bus, "generic-bl", 0,
+	platform_device_register_data(&platform_bus.dev, "generic-bl", 0,
 				      &edb7211_lcd_backlight_pdata,
 				      sizeof(edb7211_lcd_backlight_pdata));
 	platform_device_register_simple("video-clps711x", 0, NULL, 0);
 	platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
 					ARRAY_SIZE(edb7211_cs8900_resource));
-	platform_device_register_data(&platform_bus, "i2c-gpio", 0,
+	platform_device_register_data(&platform_bus.dev, "i2c-gpio", 0,
 				      &edb7211_i2c_pdata,
 				      sizeof(edb7211_i2c_pdata));
 }
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c
index 0cf0e51..70423c2 100644
--- a/arch/arm/mach-clps711x/board-p720t.c
+++ b/arch/arm/mach-clps711x/board-p720t.c
@@ -348,14 +348,14 @@ static void __init p720t_init_late(void)
 {
 	WARN_ON(gpio_request_array(p720t_gpios, ARRAY_SIZE(p720t_gpios)));
 
-	platform_device_register_data(&platform_bus, "platform-lcd", 0,
+	platform_device_register_data(&platform_bus.dev, "platform-lcd", 0,
 				      &p720t_lcd_power_pdata,
 				      sizeof(p720t_lcd_power_pdata));
-	platform_device_register_data(&platform_bus, "generic-bl", 0,
+	platform_device_register_data(&platform_bus.dev, "generic-bl", 0,
 				      &p720t_lcd_backlight_pdata,
 				      sizeof(p720t_lcd_backlight_pdata));
 	platform_device_register_simple("video-clps711x", 0, NULL, 0);
-	platform_device_register_data(&platform_bus, "leds-gpio", 0,
+	platform_device_register_data(&platform_bus.dev, "leds-gpio", 0,
 				      &p720t_gpio_led_pdata,
 				      sizeof(p720t_gpio_led_pdata));
 }
diff --git a/arch/arm/mach-imx/devices/devices.c b/arch/arm/mach-imx/devices/devices.c
index 1b4366a..48c3817 100644
--- a/arch/arm/mach-imx/devices/devices.c
+++ b/arch/arm/mach-imx/devices/devices.c
@@ -24,12 +24,12 @@
 
 struct device mxc_aips_bus = {
 	.init_name	= "mxc_aips",
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 };
 
 struct device mxc_ahb_bus = {
 	.init_name	= "mxc_ahb",
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 };
 
 int __init mxc_device_init(void)
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 2f834ce..e8e50d0 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -245,7 +245,7 @@ static void __init mx27ads_regulator_init(void)
 	vchip->set		= vgpio_set;
 	gpiochip_add(vchip);
 
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage",
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage",
 				      PLATFORM_DEVID_AUTO,
 				      &mx27ads_lcd_regulator_pdata,
 				      sizeof(mx27ads_lcd_regulator_pdata));
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index fe071a9..f132d8a 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -248,29 +248,29 @@ static void __init ape6evm_add_standard_devices(void)
 
 	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
 
-	platform_device_register_resndata(&platform_bus, "smsc911x", -1,
+	platform_device_register_resndata(&platform_bus.dev, "smsc911x", -1,
 					  lan9220_res, ARRAY_SIZE(lan9220_res),
 					  &lan9220_data, sizeof(lan9220_data));
 
 	regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers,
 				     ARRAY_SIZE(vcc_mmc0_consumers), 2800000);
-	platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mmcif", 0,
 					  mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
 					  &mmcif0_pdata, sizeof(mmcif0_pdata));
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", 2,
 				      &vcc_sdhi0_info, sizeof(vcc_sdhi0_info));
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 0,
 					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
 					  &sdhi0_pdata, sizeof(sdhi0_pdata));
 	regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers,
 				     ARRAY_SIZE(vcc_sdhi1_consumers), 3300000);
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 1,
 					  sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
 					  &sdhi1_pdata, sizeof(sdhi1_pdata));
-	platform_device_register_data(&platform_bus, "gpio-keys", -1,
+	platform_device_register_data(&platform_bus.dev, "gpio-keys", -1,
 				      &ape6evm_keys_pdata,
 				      sizeof(ape6evm_keys_pdata));
-	platform_device_register_data(&platform_bus, "leds-gpio", -1,
+	platform_device_register_data(&platform_bus.dev, "leds-gpio", -1,
 				      &ape6evm_leds_pdata,
 				      sizeof(ape6evm_leds_pdata));
 }
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index f444be2..07b9d2f 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -177,7 +177,7 @@ static struct renesas_usbhs_platform_info usbhs_info __initdata = {
 #define USB1_DEVICE	"renesas_usbhs"
 #define ADD_USB_FUNC_DEVICE_IF_POSSIBLE()			\
 	platform_device_register_resndata(			\
-		&platform_bus, "renesas_usbhs", -1,		\
+		&platform_bus.dev, "renesas_usbhs", -1,		\
 		usbhsf_resources,				\
 		ARRAY_SIZE(usbhsf_resources),			\
 		&usbhs_info, sizeof(struct renesas_usbhs_platform_info))
@@ -236,7 +236,7 @@ static struct sh_eth_plat_data ether_platform_data __initdata = {
 };
 
 static struct platform_device_info ether_info __initdata = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "r8a777x-ether",
 	.id		= -1,
 	.res		= ether_resources,
@@ -322,7 +322,7 @@ static struct resource vin##idx##_resources[] __initdata = {		\
 };									\
 									\
 static struct platform_device_info vin##idx##_info __initdata = {	\
-	.parent		= &platform_bus,				\
+	.parent		= &platform_bus.dev,				\
 	.name		= "r8a7778-vin",				\
 	.id		= idx,						\
 	.res		= vin##idx##_resources,				\
@@ -621,10 +621,10 @@ static void __init bockw_init(void)
 	/* VIN1 has a pin conflict with Ether */
 	if (!IS_ENABLED(CONFIG_SH_ETH))
 		platform_device_register_full(&vin1_info);
-	platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
+	platform_device_register_data(&platform_bus.dev, "soc-camera-pdrv", 0,
 				      &iclink0_ml86v7667,
 				      sizeof(iclink0_ml86v7667));
-	platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
+	platform_device_register_data(&platform_bus.dev, "soc-camera-pdrv", 1,
 				      &iclink1_ml86v7667,
 				      sizeof(iclink1_ml86v7667));
 
@@ -637,12 +637,12 @@ static void __init bockw_init(void)
 	r8a7778_pinmux_init();
 
 	platform_device_register_resndata(
-		&platform_bus, "sh_mmcif", -1,
+		&platform_bus.dev, "sh_mmcif", -1,
 		mmc_resources, ARRAY_SIZE(mmc_resources),
 		&sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));
 
 	platform_device_register_resndata(
-		&platform_bus, "rcar_usb_phy", -1,
+		&platform_bus.dev, "rcar_usb_phy", -1,
 		usb_phy_resources,
 		ARRAY_SIZE(usb_phy_resources),
 		&usb_phy_platform_data,
@@ -668,7 +668,7 @@ static void __init bockw_init(void)
 		iowrite16(val, fpga + IRQ0MR);
 
 		platform_device_register_resndata(
-			&platform_bus, "smsc911x", -1,
+			&platform_bus.dev, "smsc911x", -1,
 			smsc911x_resources, ARRAY_SIZE(smsc911x_resources),
 			&smsc911x_data, sizeof(smsc911x_data));
 	}
@@ -685,7 +685,7 @@ static void __init bockw_init(void)
 		iounmap(base);
 
 		platform_device_register_resndata(
-			&platform_bus, "sh_mobile_sdhi", 0,
+			&platform_bus.dev, "sh_mobile_sdhi", 0,
 			sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
 			&sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
 	}
@@ -700,7 +700,7 @@ static void __init bockw_init(void)
 		"ak4554-adc-dac", 1, NULL, 0);
 
 	pdev = platform_device_register_resndata(
-		&platform_bus, "rcar_sound", -1,
+		&platform_bus.dev, "rcar_sound", -1,
 		rsnd_resources, ARRAY_SIZE(rsnd_resources),
 		&rsnd_info, sizeof(rsnd_info));
 
@@ -710,7 +710,7 @@ static void __init bockw_init(void)
 
 	for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) {
 		struct platform_device_info cardinfo = {
-			.parent         = &platform_bus,
+			.parent         = &platform_bus.dev,
 			.name           = "asoc-simple-card",
 			.id             = i,
 			.data           = &rsnd_card_info[i],
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
index c94201e..cec50d4 100644
--- a/arch/arm/mach-shmobile/board-genmai.c
+++ b/arch/arm/mach-shmobile/board-genmai.c
@@ -46,7 +46,7 @@ static const struct resource ether_resources[] __initconst = {
 };
 
 static const struct platform_device_info ether_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "r7s72100-ether",
 	.id		= -1,
 	.res		= ether_resources,
@@ -76,7 +76,7 @@ static const struct rspi_plat_data rspi_pdata __initconst = {
 };
 
 #define r7s72100_register_rspi(idx)					   \
-	platform_device_register_resndata(&platform_bus, "rspi-rz", idx,   \
+	platform_device_register_resndata(&platform_bus.dev, "rspi-rz", idx, \
 					rspi##idx##_resources,		   \
 					ARRAY_SIZE(rspi##idx##_resources), \
 					&rspi_pdata, sizeof(rspi_pdata))
@@ -118,7 +118,7 @@ R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
 R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
 
 #define r7s72100_register_scif(index)					       \
-	platform_device_register_resndata(&platform_bus, "sh-sci", index,      \
+	platform_device_register_resndata(&platform_bus.dev, "sh-sci", index,  \
 					  scif##index##_resources,	       \
 					  ARRAY_SIZE(scif##index##_resources), \
 					  &scif##index##_platform_data,	       \
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index c6c6889..2341edd 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -118,7 +118,7 @@ static const struct resource ether_resources[] __initconst = {
 };
 
 static const struct platform_device_info ether_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "r8a7791-ether",
 	.id		= -1,
 	.res		= ether_resources,
@@ -230,7 +230,7 @@ static const struct resource sata0_resources[] __initconst = {
 };
 
 static const struct platform_device_info sata0_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "sata-r8a7791",
 	.id		= 0,
 	.res		= sata0_resources,
@@ -439,13 +439,13 @@ static void __init koelsch_add_standard_devices(void)
 	r8a7791_pinmux_init();
 	r8a7791_add_standard_devices();
 	platform_device_register_full(&ether_info);
-	platform_device_register_data(&platform_bus, "leds-gpio", -1,
+	platform_device_register_data(&platform_bus.dev, "leds-gpio", -1,
 				      &koelsch_leds_pdata,
 				      sizeof(koelsch_leds_pdata));
-	platform_device_register_data(&platform_bus, "gpio-keys", -1,
+	platform_device_register_data(&platform_bus.dev, "gpio-keys", -1,
 				      &koelsch_keys_pdata,
 				      sizeof(koelsch_keys_pdata));
-	platform_device_register_resndata(&platform_bus, "qspi", 0,
+	platform_device_register_resndata(&platform_bus.dev, "qspi", 0,
 					  qspi_resources,
 					  ARRAY_SIZE(qspi_resources),
 					  &qspi_pdata, sizeof(qspi_pdata));
@@ -460,28 +460,28 @@ static void __init koelsch_add_standard_devices(void)
 	koelsch_add_i2c(4);
 	koelsch_add_i2c(5);
 
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 0,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", 0,
 				      &vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 1,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", 1,
 				      &vcc_sdhi1_info, sizeof(struct fixed_voltage_config));
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", 2,
 				      &vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
-	platform_device_register_data(&platform_bus, "gpio-regulator", 0,
+	platform_device_register_data(&platform_bus.dev, "gpio-regulator", 0,
 				      &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
-	platform_device_register_data(&platform_bus, "gpio-regulator", 1,
+	platform_device_register_data(&platform_bus.dev, "gpio-regulator", 1,
 				      &vccq_sdhi1_info, sizeof(struct gpio_regulator_config));
-	platform_device_register_data(&platform_bus, "gpio-regulator", 2,
+	platform_device_register_data(&platform_bus.dev, "gpio-regulator", 2,
 				      &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
 
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 0,
 					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
 					  &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
 
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 1,
 					  sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
 					  &sdhi1_info, sizeof(struct sh_mobile_sdhi_info));
 
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 2,
 					  sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
 					  &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
 
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index f8b1e05..ec3ba5f 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -277,7 +277,7 @@ static const struct resource ether_resources[] __initconst = {
 };
 
 static const struct platform_device_info ether_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "r8a7790-ether",
 	.id		= -1,
 	.res		= ether_resources,
@@ -354,7 +354,7 @@ static void __init lager_add_vin_device(unsigned idx,
 					struct rcar_vin_platform_data *pdata)
 {
 	struct platform_device_info vin_info = {
-		.parent		= &platform_bus,
+		.parent		= &platform_bus.dev,
 		.name		= "r8a7790-vin",
 		.id		= idx,
 		.res		= &vin_resources[idx * 2],
@@ -391,7 +391,7 @@ LAGER_CAMERA(1, "adv7180", 0x20, NULL, RCAR_VIN_BT656);
 
 static void __init lager_add_camera1_device(void)
 {
-	platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
+	platform_device_register_data(&platform_bus.dev, "soc-camera-pdrv", 1,
 				      &cam1_link, sizeof(cam1_link));
 	lager_add_vin_device(1, &vin1_pdata);
 }
@@ -403,7 +403,7 @@ static const struct resource sata1_resources[] __initconst = {
 };
 
 static const struct platform_device_info sata1_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "sata-r8a7790",
 	.id		= 1,
 	.res		= sata1_resources,
@@ -533,7 +533,7 @@ static struct usbhs_private usbhs_priv __initdata = {
 static void __init lager_register_usbhs(void)
 {
 	usb_bind_phy("renesas_usbhs", 0, "usb_phy_rcar_gen2");
-	platform_device_register_resndata(&platform_bus,
+	platform_device_register_resndata(&platform_bus.dev,
 					  "renesas_usbhs", -1,
 					  usbhs_resources,
 					  ARRAY_SIZE(usbhs_resources),
@@ -608,7 +608,7 @@ static struct asoc_simple_card_info rsnd_card_info = {
 static void __init lager_add_rsnd_device(void)
 {
 	struct platform_device_info cardinfo = {
-		.parent         = &platform_bus,
+		.parent         = &platform_bus.dev,
 		.name           = "asoc-simple-card",
 		.id             = -1,
 		.data           = &rsnd_card_info,
@@ -620,7 +620,7 @@ static void __init lager_add_rsnd_device(void)
 				ARRAY_SIZE(i2c2_devices));
 
 	platform_device_register_resndata(
-		&platform_bus, "rcar_sound", -1,
+		&platform_bus.dev, "rcar_sound", -1,
 		rsnd_resources, ARRAY_SIZE(rsnd_resources),
 		&rsnd_info, sizeof(rsnd_info));
 
@@ -663,7 +663,7 @@ static const struct resource pci1_resources[] __initconst = {
 };
 
 static const struct platform_device_info pci1_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "pci-rcar-gen2",
 	.id		= 1,
 	.res		= pci1_resources,
@@ -684,7 +684,7 @@ static const struct resource pci2_resources[] __initconst = {
 };
 
 static const struct platform_device_info pci2_info __initconst = {
-	.parent		= &platform_bus,
+	.parent		= &platform_bus.dev,
 	.name		= "pci-rcar-gen2",
 	.id		= 2,
 	.res		= pci2_resources,
@@ -795,16 +795,16 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
-	platform_device_register_data(&platform_bus, "leds-gpio", -1,
+	platform_device_register_data(&platform_bus.dev, "leds-gpio", -1,
 				      &lager_leds_pdata,
 				      sizeof(lager_leds_pdata));
-	platform_device_register_data(&platform_bus, "gpio-keys", -1,
+	platform_device_register_data(&platform_bus.dev, "gpio-keys", -1,
 				      &lager_keys_pdata,
 				      sizeof(lager_keys_pdata));
 	regulator_register_always_on(fixed_regulator_idx++,
 				     "fixed-3.3V", fixed3v3_power_consumers,
 				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-	platform_device_register_resndata(&platform_bus, "sh_mmcif", 1,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mmcif", 1,
 					  mmcif1_resources, ARRAY_SIZE(mmcif1_resources),
 					  &mmcif1_pdata, sizeof(mmcif1_pdata));
 
@@ -812,27 +812,27 @@ static void __init lager_add_standard_devices(void)
 
 	lager_add_du_device();
 
-	platform_device_register_resndata(&platform_bus, "qspi", 0,
+	platform_device_register_resndata(&platform_bus.dev, "qspi", 0,
 					  qspi_resources,
 					  ARRAY_SIZE(qspi_resources),
 					  &qspi_pdata, sizeof(qspi_pdata));
 	spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
 
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", fixed_regulator_idx++,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", fixed_regulator_idx++,
 				      &vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
-	platform_device_register_data(&platform_bus, "reg-fixed-voltage", fixed_regulator_idx++,
+	platform_device_register_data(&platform_bus.dev, "reg-fixed-voltage", fixed_regulator_idx++,
 				      &vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
 
-	platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
+	platform_device_register_data(&platform_bus.dev, "gpio-regulator", gpio_regulator_idx++,
 				      &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
-	platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
+	platform_device_register_data(&platform_bus.dev, "gpio-regulator", gpio_regulator_idx++,
 				      &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
 
 	lager_add_camera1_device();
 
 	platform_device_register_full(&sata1_info);
 
-	platform_device_register_resndata(&platform_bus, "usb_phy_rcar_gen2",
+	platform_device_register_resndata(&platform_bus.dev, "usb_phy_rcar_gen2",
 					  -1, usbhs_phy_resources,
 					  ARRAY_SIZE(usbhs_phy_resources),
 					  &usbhs_phy_pdata,
@@ -843,10 +843,10 @@ static void __init lager_add_standard_devices(void)
 
 	lager_add_rsnd_device();
 
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 0,
 					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
 					  &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
-	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
+	platform_device_register_resndata(&platform_bus.dev, "sh_mobile_sdhi", 2,
 					  sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
 					  &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
 }
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index d832a44..e374ce8 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -272,7 +272,7 @@ static struct resource vin##idx##_resources[] __initdata = {	\
 };								\
 								\
 static struct platform_device_info vin##idx##_info __initdata = { \
-	.parent		= &platform_bus,			\
+	.parent		= &platform_bus.dev,			\
 	.name		= "r8a7779-vin",			\
 	.id		= idx,					\
 	.res		= vin##idx##_resources,			\
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index 412e179..bb52e06 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -33,7 +33,7 @@ static struct resource mtu2_resources[] __initdata = {
 };
 
 #define r7s72100_register_mtu2()					\
-	platform_device_register_resndata(&platform_bus, "sh-mtu2",	\
+	platform_device_register_resndata(&platform_bus.dev, "sh-mtu2",	\
 					  -1, mtu2_resources,		\
 					  ARRAY_SIZE(mtu2_resources),	\
 					  NULL, 0)
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index 9333770..1a3bb18 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -68,7 +68,7 @@ R8A73A4_SCIFB(4, 0xe6ce0000, gic_spi(150)); /* SCIFB2 */
 R8A73A4_SCIFB(5, 0xe6cf0000, gic_spi(151)); /* SCIFB3 */
 
 #define r8a73a4_register_scif(index)					       \
-	platform_device_register_resndata(&platform_bus, "sh-sci", index,      \
+	platform_device_register_resndata(&platform_bus.dev, "sh-sci", index,      \
 					  scif##index##_resources,	       \
 					  ARRAY_SIZE(scif##index##_resources), \
 					  &scif##index##_platform_data,	       \
@@ -149,7 +149,7 @@ static const struct resource irqc1_resources[] = {
 };
 
 #define r8a73a4_register_irqc(idx)					\
-	platform_device_register_resndata(&platform_bus, "renesas_irqc", \
+	platform_device_register_resndata(&platform_bus.dev, "renesas_irqc", \
 					  idx, irqc##idx##_resources,	\
 					  ARRAY_SIZE(irqc##idx##_resources), \
 					  &irqc##idx##_data,		\
@@ -179,7 +179,7 @@ static struct resource cmt1_resources[] = {
 };
 
 #define r8a7790_register_cmt(idx)					\
-	platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
+	platform_device_register_resndata(&platform_bus.dev, "sh-cmt-48-gen2", \
 					  idx, cmt##idx##_resources,	\
 					  ARRAY_SIZE(cmt##idx##_resources), \
 					  &cmt##idx##_platform_data,	\
@@ -280,7 +280,7 @@ static struct resource dma_resources[] = {
 };
 
 #define r8a73a4_register_dmac()							\
-	platform_device_register_resndata(&platform_bus, "sh-dma-engine", 0,	\
+	platform_device_register_resndata(&platform_bus.dev, "sh-dma-engine", 0,\
 				dma_resources, ARRAY_SIZE(dma_resources),	\
 				&dma_pdata, sizeof(dma_pdata))
 
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index d311ef9..d497cad 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -64,7 +64,7 @@ R8A7778_SCIF(4, 0xffe44000, gic_iid(0x6a));
 R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
 
 #define r8a7778_register_scif(index)					       \
-	platform_device_register_resndata(&platform_bus, "sh-sci", index,      \
+	platform_device_register_resndata(&platform_bus.dev, "sh-sci", index,      \
 					  scif##index##_resources,	       \
 					  ARRAY_SIZE(scif##index##_resources), \
 					  &scif##index##_platform_data,	       \
@@ -84,7 +84,7 @@ static struct resource sh_tmu0_resources[] = {
 
 #define r8a7778_register_tmu(idx)			\
 	platform_device_register_resndata(		\
-		&platform_bus, "sh-tmu", idx,		\
+		&platform_bus.dev, "sh-tmu", idx,	\
 		sh_tmu##idx##_resources,		\
 		ARRAY_SIZE(sh_tmu##idx##_resources),	\
 		&sh_tmu##idx##_platform_data,		\
@@ -173,7 +173,7 @@ static struct resource ohci_resources[] __initdata = {
 
 #define USB_PLATFORM_INFO(hci)					\
 static struct platform_device_info hci##_info __initdata = {	\
-	.parent		= &platform_bus,			\
+	.parent		= &platform_bus.dev,			\
 	.name		= #hci "-platform",			\
 	.id		= -1,					\
 	.res		= hci##_resources,			\
@@ -212,7 +212,7 @@ R8A7778_GPIO(4);
 
 #define r8a7778_register_gpio(idx)				\
 	platform_device_register_resndata(			\
-		&platform_bus, "gpio_rcar", idx,		\
+		&platform_bus.dev, "gpio_rcar", idx,		\
 		r8a7778_gpio##idx##_resources,			\
 		ARRAY_SIZE(r8a7778_gpio##idx##_resources),	\
 		&r8a7778_gpio##idx##_platform_data,		\
@@ -496,8 +496,8 @@ static struct resource hpb_dmae_resources[] __initdata = {
 
 static void __init r8a7778_register_hpb_dmae(void)
 {
-	platform_device_register_resndata(&platform_bus, "hpb-dma-engine", -1,
-					  hpb_dmae_resources,
+	platform_device_register_resndata(&platform_bus.dev, "hpb-dma-engine",
+					  -1, hpb_dmae_resources,
 					  ARRAY_SIZE(hpb_dmae_resources),
 					  &dma_platform_data,
 					  sizeof(dma_platform_data));
@@ -565,7 +565,7 @@ void __init r8a7778_init_irq_extpin(int irlm)
 	r8a7778_init_irq_extpin_dt(irlm);
 	if (irlm)
 		platform_device_register_resndata(
-			&platform_bus, "renesas_intc_irqpin", -1,
+			&platform_bus.dev, "renesas_intc_irqpin", -1,
 			irqpin_resources, ARRAY_SIZE(irqpin_resources),
 			&irqpin_platform_data, sizeof(irqpin_platform_data));
 }
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index aba4ed6..ca9111f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -123,7 +123,7 @@ void __init r8a7779_init_irq_extpin(int irlm)
 	r8a7779_init_irq_extpin_dt(irlm);
 	if (irlm)
 		platform_device_register_resndata(
-			&platform_bus, "renesas_intc_irqpin", -1,
+			&platform_bus.dev, "renesas_intc_irqpin", -1,
 			irqpin0_resources, ARRAY_SIZE(irqpin0_resources),
 			&irqpin0_platform_data, sizeof(irqpin0_platform_data));
 }
@@ -632,8 +632,8 @@ static struct resource hpb_dmae_resources[] __initdata = {
 
 static void __init r8a7779_register_hpb_dmae(void)
 {
-	platform_device_register_resndata(&platform_bus, "hpb-dma-engine", -1,
-					  hpb_dmae_resources,
+	platform_device_register_resndata(&platform_bus.dev, "hpb-dma-engine",
+					  -1, hpb_dmae_resources,
 					  ARRAY_SIZE(hpb_dmae_resources),
 					  &dma_platform_data,
 					  sizeof(dma_platform_data));
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 6bd08b1..4bcb2f4 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -113,7 +113,7 @@ static struct resource r8a7790_audio_dmac_resources[] = {
 
 #define r8a7790_register_audio_dmac(id)				\
 	platform_device_register_resndata(			\
-		&platform_bus, "sh-dma-engine", id,		\
+		&platform_bus.dev, "sh-dma-engine", id,		\
 		&r8a7790_audio_dmac_resources[id * 3],	3,	\
 		&r8a7790_audio_dmac_platform_data,		\
 		sizeof(r8a7790_audio_dmac_platform_data))
@@ -149,7 +149,7 @@ R8A7790_GPIO(4);
 R8A7790_GPIO(5);
 
 #define r8a7790_register_gpio(idx)					\
-	platform_device_register_resndata(&platform_bus, "gpio_rcar", idx, \
+	platform_device_register_resndata(&platform_bus.dev, "gpio_rcar", idx, \
 		r8a7790_gpio##idx##_resources,				\
 		ARRAY_SIZE(r8a7790_gpio##idx##_resources),		\
 		&r8a7790_gpio##idx##_platform_data,			\
@@ -227,7 +227,7 @@ R8A7790_HSCIF(8, 0xe62c0000, gic_spi(154)); /* HSCIF0 */
 R8A7790_HSCIF(9, 0xe62c8000, gic_spi(155)); /* HSCIF1 */
 
 #define r8a7790_register_scif(index)					       \
-	platform_device_register_resndata(&platform_bus, "sh-sci", index,      \
+	platform_device_register_resndata(&platform_bus.dev, "sh-sci", index,  \
 					  scif##index##_resources,	       \
 					  ARRAY_SIZE(scif##index##_resources), \
 					  &scif##index##_platform_data,	       \
@@ -246,7 +246,7 @@ static const struct resource irqc0_resources[] __initconst = {
 };
 
 #define r8a7790_register_irqc(idx)					\
-	platform_device_register_resndata(&platform_bus, "renesas_irqc", \
+	platform_device_register_resndata(&platform_bus.dev, "renesas_irqc", \
 					  idx, irqc##idx##_resources,	\
 					  ARRAY_SIZE(irqc##idx##_resources), \
 					  &irqc##idx##_data,		\
@@ -273,7 +273,7 @@ static struct resource cmt0_resources[] = {
 };
 
 #define r8a7790_register_cmt(idx)					\
-	platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
+	platform_device_register_resndata(&platform_bus.dev, "sh-cmt-48-gen2", \
 					  idx, cmt##idx##_resources,	\
 					  ARRAY_SIZE(cmt##idx##_resources), \
 					  &cmt##idx##_platform_data,	\
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 04a96dd..bd5cef2 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -65,7 +65,7 @@ R8A7791_GPIO(6, 0xe6055400, 32);
 R8A7791_GPIO(7, 0xe6055800, 26);
 
 #define r8a7791_register_gpio(idx)					\
-	platform_device_register_resndata(&platform_bus, "gpio_rcar", idx, \
+	platform_device_register_resndata(&platform_bus.dev, "gpio_rcar", idx, \
 		r8a7791_gpio##idx##_resources,				\
 		ARRAY_SIZE(r8a7791_gpio##idx##_resources),		\
 		&r8a7791_gpio##idx##_platform_data,			\
@@ -122,7 +122,7 @@ R8A7791_SCIFA(13, 0xe6c78000, gic_spi(30)); /* SCIFA4 */
 R8A7791_SCIFA(14, 0xe6c80000, gic_spi(31)); /* SCIFA5 */
 
 #define r8a7791_register_scif(index)					       \
-	platform_device_register_resndata(&platform_bus, "sh-sci", index,      \
+	platform_device_register_resndata(&platform_bus.dev, "sh-sci", index,  \
 					  scif##index##_resources,	       \
 					  ARRAY_SIZE(scif##index##_resources), \
 					  &scif##index##_platform_data,	       \
@@ -138,7 +138,7 @@ static struct resource cmt0_resources[] = {
 };
 
 #define r8a7791_register_cmt(idx)					\
-	platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
+	platform_device_register_resndata(&platform_bus.dev, "sh-cmt-48-gen2", \
 					  idx, cmt##idx##_resources,	\
 					  ARRAY_SIZE(cmt##idx##_resources), \
 					  &cmt##idx##_platform_data,	\
@@ -163,7 +163,7 @@ static struct resource irqc0_resources[] = {
 };
 
 #define r8a7791_register_irqc(idx)					\
-	platform_device_register_resndata(&platform_bus, "renesas_irqc", \
+	platform_device_register_resndata(&platform_bus.dev, "renesas_irqc", \
 					  idx, irqc##idx##_resources,	\
 					  ARRAY_SIZE(irqc##idx##_resources), \
 					  &irqc##idx##_data,		\
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 254adee..28d1387 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -272,7 +272,7 @@ void __init puv3_core_init(void)
 	platform_device_register_simple("PKUnity-v3-UART", 1,
 			puv3_uart1_resources, ARRAY_SIZE(puv3_uart1_resources));
 	platform_device_register_simple("PKUnity-v3-AC97", -1, NULL, 0);
-	platform_device_register_resndata(&platform_bus, "musb_hdrc", -1,
+	platform_device_register_resndata(&platform_bus.dev, "musb_hdrc", -1,
 			puv3_usb_resources, ARRAY_SIZE(puv3_usb_resources),
 			&puv3_usb_plat, sizeof(puv3_usb_plat));
 }
diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c
index 0c6618e..4b1c462 100644
--- a/arch/unicore32/kernel/puv3-nb0916.c
+++ b/arch/unicore32/kernel/puv3-nb0916.c
@@ -112,13 +112,13 @@ int __init mach_nb0916_init(void)
 	platform_device_register_simple("PKUnity-v3-I2C", -1,
 			puv3_i2c_resources, ARRAY_SIZE(puv3_i2c_resources));
 
-	platform_device_register_data(&platform_bus, "pwm-backlight", -1,
+	platform_device_register_data(&platform_bus.dev, "pwm-backlight", -1,
 			&nb0916_backlight_data, sizeof(nb0916_backlight_data));
 
-	platform_device_register_data(&platform_bus, "gpio-keys", -1,
+	platform_device_register_data(&platform_bus.dev, "gpio-keys", -1,
 			&nb0916_gpio_button_data, sizeof(nb0916_gpio_button_data));
 
-	platform_device_register_resndata(&platform_bus, "physmap-flash", -1,
+	platform_device_register_resndata(&platform_bus.dev, "physmap-flash", -1,
 			&physmap_flash_resource, 1,
 			&physmap_flash_data, sizeof(physmap_flash_data));
 
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index eee48c4..f272603 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -30,8 +30,8 @@
 /* For automatically allocated device IDs */
 static DEFINE_IDA(platform_devid_ida);
 
-struct device platform_bus = {
-	.init_name	= "platform",
+struct platform_device platform_bus = {
+	.name	= "platform",
 };
 EXPORT_SYMBOL_GPL(platform_bus);
 
@@ -300,7 +300,7 @@ int platform_device_add(struct platform_device *pdev)
 		return -EINVAL;
 
 	if (!pdev->dev.parent)
-		pdev->dev.parent = &platform_bus;
+		pdev->dev.parent = &platform_bus.dev;
 
 	pdev->dev.bus = &platform_bus_type;
 
@@ -946,12 +946,18 @@ int __init platform_bus_init(void)
 
 	early_platform_cleanup();
 
-	error = device_register(&platform_bus);
+	dev_set_name(&platform_bus.dev, "%s", platform_bus.name);
+	error = device_register(&platform_bus.dev);
 	if (error)
 		return error;
 	error =  bus_register(&platform_bus_type);
-	if (error)
-		device_unregister(&platform_bus);
+	if (!error) {
+		platform_bus.dev.of_node = of_allnodes;
+		platform_bus.dev.bus = &platform_bus_type;
+		bus_add_device(&platform_bus.dev);
+	} else {
+		device_unregister(&platform_bus.dev);
+	}
 	return error;
 }
 
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c
index bd37747..4e4b7a2 100644
--- a/drivers/char/tile-srom.c
+++ b/drivers/char/tile-srom.c
@@ -350,7 +350,7 @@ static int srom_setup_minor(struct srom_dev *srom, int index)
 		       SROM_PAGE_SIZE_OFF, sizeof(srom->page_size)) < 0)
 		return -EIO;
 
-	dev = device_create(srom_class, &platform_bus,
+	dev = device_create(srom_class, &platform_bus.dev,
 			    MKDEV(srom_major, index), srom, "%d", index);
 	return PTR_ERR_OR_ZERO(dev);
 }
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 7e834fb..9a2b0d0 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -137,7 +137,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
 		dev_err(&pdev->dev, "Invalid iomem size!\n");
 
 	/* Some PCI-based MFD need the parent here */
-	if (pdev->dev.parent != &platform_bus && !np)
+	if (pdev->dev.parent != &platform_bus.dev && !np)
 		host = sdhci_alloc_host(pdev->dev.parent,
 			sizeof(struct sdhci_pltfm_host) + priv_size);
 	else
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 3cbb57a..c14c36f 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -218,7 +218,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
 		goto fail;
 
 	if (!shost->shost_gendev.parent)
-		shost->shost_gendev.parent = dev ? dev : &platform_bus;
+		shost->shost_gendev.parent = dev ? dev : &platform_bus.dev;
 	if (!dma_dev)
 		dma_dev = shost->shost_gendev.parent;
 
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 16f6654..a99032a 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -44,7 +44,7 @@ extern int platform_device_register(struct platform_device *);
 extern void platform_device_unregister(struct platform_device *);
 
 extern struct bus_type platform_bus_type;
-extern struct device platform_bus;
+extern struct platform_device platform_bus;
 
 extern void arch_setup_pdev_archdata(struct platform_device *);
 extern struct resource *platform_get_resource(struct platform_device *,
-- 
1.9.1

^ permalink raw reply related

* [PATCH 1/6] ARM: dts: vf610: add USB PHY and controller
From: Stefan Agner @ 2014-07-22  9:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140722022232.GR8537@dragon>

Am 2014-07-22 04:22, schrieb Shawn Guo:
> On Fri, Jul 18, 2014 at 07:01:37PM +0200, Stefan Agner wrote:
>> This adds USB PHY and USB controller nodes. Vybrid SoCs have two
>> independent USB cores which each supports DR (dual role). However,
>> real OTG is not supported since the OTG ID pin is not available.
>>
>> The PHYs are located within the anadig register range, hence we need
>> to change the length of the anadig registers.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>>  arch/arm/boot/dts/vf610.dtsi | 46 +++++++++++++++++++++++++++++++++++++++++---
>>  1 file changed, 43 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
>> index 6a6190c..f6c3f02 100644
>> --- a/arch/arm/boot/dts/vf610.dtsi
>> +++ b/arch/arm/boot/dts/vf610.dtsi
>> @@ -25,6 +25,8 @@
>>  		gpio2 = &gpio3;
>>  		gpio3 = &gpio4;
>>  		gpio4 = &gpio5;
>> +		usbphy0 = &usbphy0;
>> +		usbphy1 = &usbphy1;
>>  	};
>>
>>  	cpus {
>> @@ -285,9 +287,25 @@
>>  				gpio-ranges = <&iomuxc 0 128 7>;
>>  			};
>>
>> -			anatop at 40050000 {
>> -				compatible = "fsl,vf610-anatop";
>> -				reg = <0x40050000 0x1000>;
>> +			anatop: anatop at 40050000 {
>> +				compatible = "fsl,vf610-anatop", "syscon";
>> +				reg = <0x40050000 0x400>;
>> +			};
>> +
>> +			usbphy0: usbphy at 40050800 {
>> +				compatible = "fsl,vf610-usbphy", "fsl,imx23-usbphy";
> 
> Since phy driver will match "fsl,vf610-usbphy" anyway, we do not need
> "fsl,imx23-usbphy" here.

<snip>

>> @@ -309,6 +327,18 @@
>>  				reg = <0x4006b000 0x1000>;
>>  				#clock-cells = <1>;
>>  			};
>> +
>> +			usbdev0: usb at 40034000 {
>> +				compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
> 
> It doesn't really make any sense to have "fsl,imx6q-usb" here.  The
> following one should be less confusing.
> 
> 	compatible = "fsl,vf610-usb", "fsl,imx27-usb";


I don't quite understand the rule here, when do we drop compatible you
suggest in fsl,imx23-usbphy and when do we keep the "fallback" as we do
for the USB controller?

Documentation/devicetree/bindings/usb/mxs-phy.txt says:
> "fsl,imx23-usbphy" is still a fallback for other strings


And Documentation/devicetree/bindings/usb/ci-hdrc-imx.txt says:
> - compatible: Should be "fsl,imx27-usb"

--
Stefan

^ permalink raw reply

* [PATCH] phy: miphy365x: Select GENERIC_PHY instead of depending on it
From: Lee Jones @ 2014-07-22  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

Enabling GENERIC_PHY in the shared (by most ARM sub-architectures)
defconfig multi_v7_defconfig is prohibited.  Instead, we'll enable
it from the Kconfig whenever PHY_MIPHY365X is enabled.

Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/phy/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 5d54dcf..75cb9bc 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -34,9 +34,9 @@ config PHY_MVEBU_SATA
 config PHY_MIPHY365X
 	tristate "STMicroelectronics MIPHY365X PHY driver for STiH41x series"
 	depends on ARCH_STI
-	depends on GENERIC_PHY
 	depends on HAS_IOMEM
 	depends on OF
+	select GENERIC_PHY
 	help
 	  Enable this to support the miphy transceiver (for SATA/PCIE)
 	  that is part of STMicroelectronics STiH41x SoC series.
-- 
1.8.3.2

^ permalink raw reply related

* Kexec on arm64
From: Arun Chandran @ 2014-07-22  9:44 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1405551861.7262.26.camel@smoke>

On Thu, Jul 17, 2014 at 4:34 AM, Geoff Levand <geoff@infradead.org> wrote:
> Hi Feng,
>
> On Wed, 2014-07-16 at 10:57 -0700, Feng Kan wrote:
>> Just following up on the conversation. The cpu return address of 0 should work
>> in your case. Since thats the _start of the bootloader, it will run
>> some core init
>> code and then put the core back in wfe.
>
> OK, I fixed up my code so that zero is valid cpu return address.  Arun,
> could you try my latest I pushed out today?
>
Hi Geoff,

Sorry for the late reply I was away.

Yes I tried the new code.
My dts file has the below change.

################
diff --git a/arch/arm64/boot/dts/apm-storm.dtsi
b/arch/arm64/boot/dts/apm-storm.dtsi
index e0bf91d..b64e549 100644
--- a/arch/arm64/boot/dts/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm-storm.dtsi
@@ -24,64 +24,64 @@
                        compatible = "apm,potenza", "arm,armv8";
                        reg = <0x0 0x000>;
                        enable-method = "spin-table";
-                       cpu-release-addr = <0x1 0x0000fff8>;
-                       cpu-return-addr = <0x0 0x0> /* Updated by bootloader */
+                       cpu-release-addr = <0x40 0x0000fff8>;
+                       cpu-return-addr = <0x0 0x0>; /* Updated by bootloader */
                };
#################
All other cpu nodes have similar change.

1) Loading  ( I don't change commandline and dtb; assuming kexec will
reuse whatever
the booted kernel has as commandline and dtb)

# kexec -l vmlinux.strip
kexec version: 14.07.17.12.17-gb6cccb4
Modified cmdline: root=/dev/nfs
Unable to find /proc/device-tree//chosen/linux,stdout-path, printing
from purgatory is diabled
Modified cmdline: root=/dev/nfs
Unable to find /proc/device-tree//chosen/linux,stdout-path, printing
from purgatory is diabled
machine_kexec_prepare:508:
  kexec image info:
    type:        0
    start:       4000080004
    head:        0
    nr_segments: 2
      segment[0]: 0000004000080000 - 000000400088c000, 80c000h bytes, 2060 pages
kexec_is_dtb:115: magic: 4d5a0091 : 91005a4d : no
      segment[1]: 00000040008a0000 - 00000040008a3000, 3000h bytes, 3 pages
kexec_is_dtb:115: magic: d00dfeed : edfe0dd0 : yes
kexec_boot_info_init:384: cpu_count: 8
kexec_cpu_info_init:352: cpu-0: hwid-0, 'spin-table', cpu-release-addr
400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-1: hwid-1, 'spin-table', cpu-release-addr
400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-2: hwid-100, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-3: hwid-101, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-4: hwid-200, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-5: hwid-201, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-6: hwid-300, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-7: hwid-301, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_is_dtb:115: magic: 4d5a0091 : 91005a4d : no
kexec_is_dtb:115: magic: d00dfeed : edfe0dd0 : yes
kexec_boot_info_init:384: cpu_count: 8
kexec_cpu_info_init:352: cpu-0: hwid-0, 'spin-table', cpu-release-addr
400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-1: hwid-1, 'spin-table', cpu-release-addr
400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-2: hwid-100, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-3: hwid-101, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-4: hwid-200, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-5: hwid-201, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-6: hwid-300, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_info_init:352: cpu-7: hwid-301, 'spin-table',
cpu-release-addr 400000fff8, cpu-return-addr 0
kexec_cpu_check:440: hwid-0 OK
kexec_cpu_check:440: hwid-1 OK
kexec_cpu_check:440: hwid-100 OK
kexec_cpu_check:440: hwid-101 OK
kexec_cpu_check:440: hwid-200 OK
kexec_cpu_check:440: hwid-201 OK
kexec_cpu_check:440: hwid-300 OK
kexec_cpu_check:440: hwid-301 OK


2) Rebooting
#########################
# kexec -e
kexec version: 1kvm: exiting hardware virtualization
4.07.17.12.17-gbStarting new kernel
6cccb4
 Ump_spin_tanblaeb_lcpeu_d ite:127: oi dh:a n7d,l holding count: 0e
 kernel NULL pointer dereference at virtual address 00000291
smp_spin_Itnaibtlei_cpaul_diie:12z7:i nigd :c 3g,r oholding couunpt :s 0u
bsys cpu
smpL_isnpuixn _table_cpu_diev:e1r2s7i:o ni d: 6, hol3d.i1n6g. 0c-orucnt: 0
4+ (arun at arun-OptiPlex-9010) (gcc version 4.9.1 20140505 (prerelease)
(crosstool-NG linaro-1.13.1-4.9-2014.05 - Linaro GCC 4.9-2014.05) )
#25 SMP smp_sPpin_tablReE_EcMpPuT_ dTie:127: iude:  J5u, hlo ld2ing
coun2:
37:03 IST 2014
smp_Cspin_tPabUl:e _AcApruc_die:127: id: h46,4  hPorldiong count:c e0s
 or [500f0000] revision 0
smp_speifni_:t aGbeltet_cpu_die:i1n2g7 : ipd:a 2, holdinrga mceount:t e0
rs from FDT:
smep_fsip:i nC_atable_cpu_dien:'1t27: i df: 1i, holdinngd  cSoyusntt:e 0
m Table in device tree!
macchimne_kexaec:: 572C: smp_pMrAo:c efsasiorl_ied = 0
d to reserve 16 MiB
dachine_kexecO:n5 7n4o:
 e 0 totalpages: 4194304
a k e xec image inNfoor:m
 l zone: 57344 pages used for memmap
    type:        0
z   sta r tN:o     r  m4a0000800l04
 one: 4194304 pages, LIFO batch:31
    head:   P E R   43Cea9bPf002
U: Embedded 11 pages/cpu @ffffffc3fff7d000 s13120 r8192 d23744 u45056
    nrp_cspeug-maelnltosc: 2
: s13120 r8192 d23744 u45056 alloc=11*4096
   p c p usegment-[a0l]l:o c0:0 0[0000400]00 800 000[ -0 ]0000004000
881c 0[000],  280c000h bytes,  [200]6 0 3pages
 [0] 4 [0] 5 [0] 6 [0] 7
eexBeuc_is_dtb:1i1l5:t  m1a gizc: 0 : 0 : noon
 lists in Zone order, mobility grouping on.  Total pages: 4136960
/  K e r segment[1]: n0e0l0 00c0o400m08a0000 m-a n0d00
00040l008ai30n00e,:  3r000ho obty=tes, 3/ dpeagesv
 nfs rw nfsroot=10.162.103.228:/nfs_root/dora_june_6/apm-image-minimal-mustangbe
ip=10.162.103.21:10.162.103.228:10.162.103.1:255.255.255.0:mustangk:eextehc_0is:_odtb:1f15f:
 pmaangic:i 0c =: 0 : 1no
console=ttyS0,115200 earlyprintk=uart8250-32bit,0x1c020000 debug
maxcpus=8 swiotlb=65536 log_buf_len=1M
8aclhinoeg_kex_ec:582: cobnturfo_ll_ecode_page:        nf:f f1ff0fbc4edb67ee8
 576
6achinee_akrelxyec: 58l4: reobogo tb_ucfo dfe_buffer_physr:e e :0
000010435eaffb00007
 (92%)
macPhine_IkDexec:58 6h:a srehb otot_acode_bufferb:l e   e n t
rfifffffce3se:a f4f0b000
96 (order: 3, 32768 bytes)
macDhine_kexeecn:t5r88: ryel occate_neaw_ckheer nelh:a s     fffffhf
c0t0a0093b18
ble entries: 2097152 (order: 12, 16777216 bytes)
machineI_kneoxedc:5e90-: relocate_cnaecwh_ek ehransel_size: b8hh( 1t84)a bytes
ble entries: 1048576 (order: 11, 8388608 bytes)
machinMe_keemxoercy::5 913: kexec6_5d0t8b_6addr2:4 K
0/0100004600708a0000
77216K available (4360K kernel code, 299K rwdata, 1528K rodata, 6556K
init, 202K bss, 268592K reserved)
oacVhinei_kretxueacl: 595: kexec_kkeirmnaegle _mhead:     e m o r0y0
00l0043eaa9bf002y
 ut:
    vmalloc : 0xffffff8000000000 - 0xffffffbbffff0000   (245759 MB)
    vmemmap : 0xffffffbce0000000 - 0xffffffbcee000000   (   224 MB)
0  machine_ kmeoxdecu:l597:e kexecs_ k:i m0age_xsftarft:    f  f
f0f0b0f0f0c04000080004
 00000 - 0xffffffc000000000   (    64 MB)
    memory  : 0xffffffc000000000 - 0xffffffc400000000   ( 16384 MB)
      .init : 0xffffffc000642000 -machine_ke x0excf:f5f99:f
kexec_efntfrcy0_0d0ump:
ca9340   (  6557 kB)
      .text : 0xffffffc000080000 - 0xffffffc0006411c4   (  5893 kB)
f     .data : 0xffffffc000caa000 - 0xffffffc000cf4f28     (I
43ea9bf002 =  343ea9b0f000 (f0fffffc 3ekaB9)b
 000)
d D 40S0LU00B8:0 0H0W1 = a4000080000l i(gfnf=f6f4ffc,00008000 0O)r
######################

This doesn't seems to be working. Random behaviors are observed. Some
times it rebooted to u-boot
prompt. Sometimes kernel soft resets itself in an endless loop
(bootlog is repeating over and over again)

To debug what is happening I put a while(1) just before jumping into
kexec reboot code.

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 31cba91..8843623 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -85,6 +85,7 @@ void soft_restart(unsigned long addr)

        smp_secondary_shutdown();

+       while(1);
        /* Switch to the identity mapping */
        phys_reset = (phys_reset_t)virt_to_phys(cpu_reset);
        phys_reset(addr);

I break into target with BDI3000 now; and see the below output

TARGET#0>state
Core#0: halted 0xffffffc000085240 External Debug Request
Core#1: halted 0x0000004000080394 External Debug Request
Core#2: halted 0x0000004000080394 External Debug Request
Core#3: halted 0x0000004000080394 External Debug Request
Core#4: halted 0xffffffc0000802f8 External Debug Request
Core#5: halted 0x0000004000080394 External Debug Request
Core#6: halted 0xffffffc0000802f8 External Debug Request
Core#7: halted 0x0000004000080394 External Debug Request

I think some of the secondary CPUs are not behaving as expected;
As of now I don't have any clues for this.


--Arun

^ 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