* [PATCH] ARM i.MX SPI driver changes for i.MX53 support
From: Grant Likely @ 2011-01-13 3:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTimfcxbPq8G_LjO8tz8=nANFkd=5AJYjkTZQyrYG@mail.gmail.com>
On Thu, Jan 13, 2011 at 11:12:07AM +0800, Yong Shen wrote:
> Thanks Grant. I am not asking somebody to merge it right now. I just
> wonder who will take it, since maintainers change from time to time.
Okay. :-) For spi stuff, I usually apply it to my tree, unless it
has dependencies on stuff in someone else's tree. At the very least
spi patches must have either my or David Gibson's ack.
g.
>
> Yong
>
> On Thu, Jan 13, 2011 at 11:05 AM, Grant Likely
> <grant.likely@secretlab.ca> wrote:
> > On Thu, Jan 13, 2011 at 11:01:44AM +0800, Yong Shen wrote:
> >> Seems no comments from spi-devel list. This patch is also:
> >> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> >>
> >> Who will take this patch into a tree?
> >
> > Patience Yong. ?You only posted it two days ago. ?It takes time for
> > people to notice and respond some times.
> >
> > Normally, I wouldn't pick up a patch in the middle of the merge
> > window, but this is pretty trivial, so I'll bend the rules this time.
> >
> > g.
> >
> >>
> >> Yong
> >>
> >> On Tue, Jan 11, 2011 at 5:21 PM, ?<yong.shen@freescale.com> wrote:
> >> > From: Yong Shen <yong.shen@freescale.com>
> >> >
> >> > 1. Change the Kconfig to include i.MX53
> >> > 2. add devtype entry for i.MX53
> >> >
> >> > Signed-off-by: Yong Shen <yong.shen@freescale.com>
> >> > Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> >> > ---
> >> > ?drivers/spi/Kconfig ? | ? ?4 ++--
> >> > ?drivers/spi/spi_imx.c | ? ?6 ++++++
> >> > ?2 files changed, 8 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> >> > index 78f9fd0..04965e2 100644
> >> > --- a/drivers/spi/Kconfig
> >> > +++ b/drivers/spi/Kconfig
> >> > @@ -153,10 +153,10 @@ config SPI_IMX_VER_0_4
> >> > ? ? ? ?def_bool y if ARCH_MX31
> >> >
> >> > ?config SPI_IMX_VER_0_7
> >> > - ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51
> >> > + ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51 || ARCH_MX53
> >> >
> >> > ?config SPI_IMX_VER_2_3
> >> > - ? ? ? def_bool y if ARCH_MX51
> >> > + ? ? ? def_bool y if ARCH_MX51 || ARCH_MX53
> >> >
> >> > ?config SPI_IMX
> >> > ? ? ? ?tristate "Freescale i.MX SPI controllers"
> >> > diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
> >> > index 55a38e2..9b8a733 100644
> >> > --- a/drivers/spi/spi_imx.c
> >> > +++ b/drivers/spi/spi_imx.c
> >> > @@ -747,6 +747,12 @@ static struct platform_device_id spi_imx_devtype[] = {
> >> > ? ? ? ? ? ? ? ?.name = "imx51-ecspi",
> >> > ? ? ? ? ? ? ? ?.driver_data = SPI_IMX_VER_2_3,
> >> > ? ? ? ?}, {
> >> > + ? ? ? ? ? ? ? .name = "imx53-cspi",
> >> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_0_7,
> >> > + ? ? ? }, {
> >> > + ? ? ? ? ? ? ? .name = "imx53-ecspi",
> >> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_2_3,
> >> > + ? ? ? }, {
> >> > ? ? ? ? ? ? ? ?/* sentinel */
> >> > ? ? ? ?}
> >> > ?};
> >> > --
> >> > 1.7.1
> >> >
> >> >
> >> >
> >>
> >> _______________________________________________
> >> linux-arm-kernel mailing list
> >> linux-arm-kernel at lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
^ permalink raw reply
* [PATCH] ARM i.MX SPI driver changes for i.MX53 support
From: Yong Shen @ 2011-01-13 3:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113030553.GC1392@angua.secretlab.ca>
Thanks Grant. I am not asking somebody to merge it right now. I just
wonder who will take it, since maintainers change from time to time.
Yong
On Thu, Jan 13, 2011 at 11:05 AM, Grant Likely
<grant.likely@secretlab.ca> wrote:
> On Thu, Jan 13, 2011 at 11:01:44AM +0800, Yong Shen wrote:
>> Seems no comments from spi-devel list. This patch is also:
>> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>>
>> Who will take this patch into a tree?
>
> Patience Yong. ?You only posted it two days ago. ?It takes time for
> people to notice and respond some times.
>
> Normally, I wouldn't pick up a patch in the middle of the merge
> window, but this is pretty trivial, so I'll bend the rules this time.
>
> g.
>
>>
>> Yong
>>
>> On Tue, Jan 11, 2011 at 5:21 PM, ?<yong.shen@freescale.com> wrote:
>> > From: Yong Shen <yong.shen@freescale.com>
>> >
>> > 1. Change the Kconfig to include i.MX53
>> > 2. add devtype entry for i.MX53
>> >
>> > Signed-off-by: Yong Shen <yong.shen@freescale.com>
>> > Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
>> > ---
>> > ?drivers/spi/Kconfig ? | ? ?4 ++--
>> > ?drivers/spi/spi_imx.c | ? ?6 ++++++
>> > ?2 files changed, 8 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
>> > index 78f9fd0..04965e2 100644
>> > --- a/drivers/spi/Kconfig
>> > +++ b/drivers/spi/Kconfig
>> > @@ -153,10 +153,10 @@ config SPI_IMX_VER_0_4
>> > ? ? ? ?def_bool y if ARCH_MX31
>> >
>> > ?config SPI_IMX_VER_0_7
>> > - ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51
>> > + ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51 || ARCH_MX53
>> >
>> > ?config SPI_IMX_VER_2_3
>> > - ? ? ? def_bool y if ARCH_MX51
>> > + ? ? ? def_bool y if ARCH_MX51 || ARCH_MX53
>> >
>> > ?config SPI_IMX
>> > ? ? ? ?tristate "Freescale i.MX SPI controllers"
>> > diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
>> > index 55a38e2..9b8a733 100644
>> > --- a/drivers/spi/spi_imx.c
>> > +++ b/drivers/spi/spi_imx.c
>> > @@ -747,6 +747,12 @@ static struct platform_device_id spi_imx_devtype[] = {
>> > ? ? ? ? ? ? ? ?.name = "imx51-ecspi",
>> > ? ? ? ? ? ? ? ?.driver_data = SPI_IMX_VER_2_3,
>> > ? ? ? ?}, {
>> > + ? ? ? ? ? ? ? .name = "imx53-cspi",
>> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_0_7,
>> > + ? ? ? }, {
>> > + ? ? ? ? ? ? ? .name = "imx53-ecspi",
>> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_2_3,
>> > + ? ? ? }, {
>> > ? ? ? ? ? ? ? ?/* sentinel */
>> > ? ? ? ?}
>> > ?};
>> > --
>> > 1.7.1
>> >
>> >
>> >
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH] ARM i.MX SPI driver changes for i.MX53 support
From: Grant Likely @ 2011-01-13 3:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTikErJYCNRM1+-hx5Qrk_iW4Ad7fE1iFUODmqK6A@mail.gmail.com>
On Thu, Jan 13, 2011 at 11:01:44AM +0800, Yong Shen wrote:
> Seems no comments from spi-devel list. This patch is also:
> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
>
> Who will take this patch into a tree?
Patience Yong. You only posted it two days ago. It takes time for
people to notice and respond some times.
Normally, I wouldn't pick up a patch in the middle of the merge
window, but this is pretty trivial, so I'll bend the rules this time.
g.
>
> Yong
>
> On Tue, Jan 11, 2011 at 5:21 PM, <yong.shen@freescale.com> wrote:
> > From: Yong Shen <yong.shen@freescale.com>
> >
> > 1. Change the Kconfig to include i.MX53
> > 2. add devtype entry for i.MX53
> >
> > Signed-off-by: Yong Shen <yong.shen@freescale.com>
> > Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > ?drivers/spi/Kconfig ? | ? ?4 ++--
> > ?drivers/spi/spi_imx.c | ? ?6 ++++++
> > ?2 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> > index 78f9fd0..04965e2 100644
> > --- a/drivers/spi/Kconfig
> > +++ b/drivers/spi/Kconfig
> > @@ -153,10 +153,10 @@ config SPI_IMX_VER_0_4
> > ? ? ? ?def_bool y if ARCH_MX31
> >
> > ?config SPI_IMX_VER_0_7
> > - ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51
> > + ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51 || ARCH_MX53
> >
> > ?config SPI_IMX_VER_2_3
> > - ? ? ? def_bool y if ARCH_MX51
> > + ? ? ? def_bool y if ARCH_MX51 || ARCH_MX53
> >
> > ?config SPI_IMX
> > ? ? ? ?tristate "Freescale i.MX SPI controllers"
> > diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
> > index 55a38e2..9b8a733 100644
> > --- a/drivers/spi/spi_imx.c
> > +++ b/drivers/spi/spi_imx.c
> > @@ -747,6 +747,12 @@ static struct platform_device_id spi_imx_devtype[] = {
> > ? ? ? ? ? ? ? ?.name = "imx51-ecspi",
> > ? ? ? ? ? ? ? ?.driver_data = SPI_IMX_VER_2_3,
> > ? ? ? ?}, {
> > + ? ? ? ? ? ? ? .name = "imx53-cspi",
> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_0_7,
> > + ? ? ? }, {
> > + ? ? ? ? ? ? ? .name = "imx53-ecspi",
> > + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_2_3,
> > + ? ? ? }, {
> > ? ? ? ? ? ? ? ?/* sentinel */
> > ? ? ? ?}
> > ?};
> > --
> > 1.7.1
> >
> >
> >
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [PATCH] ARM i.MX SPI driver changes for i.MX53 support
From: Yong Shen @ 2011-01-13 3:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294737713-24015-2-git-send-email-yong.shen@freescale.com>
Seems no comments from spi-devel list. This patch is also:
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Who will take this patch into a tree?
Yong
On Tue, Jan 11, 2011 at 5:21 PM, <yong.shen@freescale.com> wrote:
> From: Yong Shen <yong.shen@freescale.com>
>
> 1. Change the Kconfig to include i.MX53
> 2. add devtype entry for i.MX53
>
> Signed-off-by: Yong Shen <yong.shen@freescale.com>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> ?drivers/spi/Kconfig ? | ? ?4 ++--
> ?drivers/spi/spi_imx.c | ? ?6 ++++++
> ?2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index 78f9fd0..04965e2 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -153,10 +153,10 @@ config SPI_IMX_VER_0_4
> ? ? ? ?def_bool y if ARCH_MX31
>
> ?config SPI_IMX_VER_0_7
> - ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51
> + ? ? ? def_bool y if ARCH_MX25 || ARCH_MX35 || ARCH_MX51 || ARCH_MX53
>
> ?config SPI_IMX_VER_2_3
> - ? ? ? def_bool y if ARCH_MX51
> + ? ? ? def_bool y if ARCH_MX51 || ARCH_MX53
>
> ?config SPI_IMX
> ? ? ? ?tristate "Freescale i.MX SPI controllers"
> diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
> index 55a38e2..9b8a733 100644
> --- a/drivers/spi/spi_imx.c
> +++ b/drivers/spi/spi_imx.c
> @@ -747,6 +747,12 @@ static struct platform_device_id spi_imx_devtype[] = {
> ? ? ? ? ? ? ? ?.name = "imx51-ecspi",
> ? ? ? ? ? ? ? ?.driver_data = SPI_IMX_VER_2_3,
> ? ? ? ?}, {
> + ? ? ? ? ? ? ? .name = "imx53-cspi",
> + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_0_7,
> + ? ? ? }, {
> + ? ? ? ? ? ? ? .name = "imx53-ecspi",
> + ? ? ? ? ? ? ? .driver_data = SPI_IMX_VER_2_3,
> + ? ? ? }, {
> ? ? ? ? ? ? ? ?/* sentinel */
> ? ? ? ?}
> ?};
> --
> 1.7.1
>
>
>
^ permalink raw reply
* [PATCH/RFC 2/3] ARM: S5PV310: Add a platform helper for MIPI DSIM/CSIS setup
From: Sylwester Nawrocki @ 2011-01-13 2:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <020401cbb2c1$ef9f7c30$cede7490$%kim@samsung.com>
On 01/13/2011 10:33 AM, Kukjin Kim wrote:
> Sylwester Nawrocki wrote:
>>
>> MIPI_PHYn_CONTROL registers are shared between MIPI DSIM
>> and MIPI CSIS drivers so a spinlock is used to protect multiple
>> access to these registers. Also a proper state of a common
>> PHY enable bit is maintained in order to avoid a DSIM
>> and CSIS driver conflict.
>>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
...
>
> Basically, it's not good that each machine(SoC) has each own setup-mipi...
> Because it is very similar(almost same)...means can move it in plat-s5p with
> following.
>
> 1. # of MIPI PHY can be calculated by platform device id
> 2. can use same definition of MIPI PHY control address with same name
> re-mapping.
Yes, I agree with that. Originally I had it done it plat-s5p, I will
prepare a merged version. The main difference between s5pv210 and s5pv310
indeed was the register naming and placement in PMU or CLK subsystem, so the
register address definitions were in regs-clk.h or regs-pmu.h. So there
just will have to be included different header files depending on on SoC
architecture.
Regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center
^ permalink raw reply
* [PATCH/RFC 1/3] ARM: S5P: Add a platform callback for MIPI CSIS PHY control
From: Sylwester Nawrocki @ 2011-01-13 2:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <020301cbb2c1$5ed9dec0$1c8d9c40$%kim@samsung.com>
Hi Kukjin,
thank you for the update.
On 01/13/2011 10:29 AM, Kukjin Kim wrote:
> Sylwester Nawrocki wrote:
>>
>> The phy_enable callback in struct s5p_platform_mipi_csis is added
>> to allow the CSIS driver to control its PHY enable and reset signals.
>> This allows to use same MIPI CSIS driver across various SoCs.
>>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> arch/arm/plat-s5p/dev-csis0.c | 2 +-
>> arch/arm/plat-s5p/dev-csis1.c | 2 +-
>> arch/arm/plat-s5p/include/plat/csis.h | 28 --------------------
>> arch/arm/plat-s5p/include/plat/mipi_csis.h | 39
>> ++++++++++++++++++++++++++++
>> 4 files changed, 41 insertions(+), 30 deletions(-)
>> delete mode 100644 arch/arm/plat-s5p/include/plat/csis.h
>> create mode 100644 arch/arm/plat-s5p/include/plat/mipi_csis.h
>>
...
>
> I think should be separated like following.
>
> If required, ...
>
> 1. change copyright
> 2. rename csis.h to mipi_csis.h
I don't want to bother with a separate patches for that, just prefer
to drop the above changes.
> 3. add phy enable feature
OK, I would reduce the patch to that change only.
Regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center
^ permalink raw reply
* [PATCH v4 08/10] ARM: mxs: add ocotp read function
From: Shawn Guo @ 2011-01-13 1:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110112160106.GI24920@pengutronix.de>
On Wed, Jan 12, 2011 at 05:01:06PM +0100, Uwe Kleine-K?nig wrote:
> Hello Sascha,
>
> On Wed, Jan 12, 2011 at 03:50:36PM +0100, Sascha Hauer wrote:
> > On Wed, Jan 12, 2011 at 02:47:12PM +0800, Shawn Guo wrote:
> > > On Tue, Jan 11, 2011 at 02:31:37PM +0100, Sascha Hauer wrote:
> > > > On Thu, Jan 06, 2011 at 03:13:16PM +0800, Shawn Guo wrote:
> > > > > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > > > > ---
> > > > > Changes for v4:
> > > > > - Call cpu_relax() during polling
> > > > >
> > > > > Changes for v2:
> > > > > - Add mutex locking for mxs_read_ocotp()
> > > > > - Use type size_t for count and i
> > > > > - Add comment for clk_enable/disable skipping
> > > > > - Add ERROR bit clearing and polling step
> > > > >
> > > > > arch/arm/mach-mxs/Makefile | 2 +-
> > > > > arch/arm/mach-mxs/include/mach/common.h | 1 +
> > > > > arch/arm/mach-mxs/ocotp.c | 79 +++++++++++++++++++++++++++++++
> > > > > 3 files changed, 81 insertions(+), 1 deletions(-)
> > > > > create mode 100644 arch/arm/mach-mxs/ocotp.c
> > > > >
> > > > > diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> > > > > index 39d3f9c..f23ebbd 100644
> > > > > --- a/arch/arm/mach-mxs/Makefile
> > > > > +++ b/arch/arm/mach-mxs/Makefile
> > > > > @@ -1,5 +1,5 @@
> > > > > # Common support
> > > > > -obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
> > > > > +obj-y := clock.o devices.o gpio.o icoll.o iomux.o ocotp.o system.o timer.o
> > > > >
> > > > > obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
> > > > > obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
> > > > > diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
> > > > > index 59133eb..cf02552 100644
> > > > > --- a/arch/arm/mach-mxs/include/mach/common.h
> > > > > +++ b/arch/arm/mach-mxs/include/mach/common.h
> > > > > @@ -13,6 +13,7 @@
> > > > >
> > > > > struct clk;
> > > > >
> > > > > +extern int mxs_read_ocotp(int offset, int count, u32 *values);
> > > > > extern int mxs_reset_block(void __iomem *);
> > > > > extern void mxs_timer_init(struct clk *, int);
> > > > >
> > > > > diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
> > > > > new file mode 100644
> > > > > index 0000000..e2d39aa
> > > > > --- /dev/null
> > > > > +++ b/arch/arm/mach-mxs/ocotp.c
> > > > > @@ -0,0 +1,79 @@
> > > > > +/*
> > > > > + * Copyright 2010 Freescale Semiconductor, Inc. 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 as published by
> > > > > + * the Free Software Foundation; either version 2 of the License, or
> > > > > + * (at your option) any later version.
> > > > > + *
> > > > > + * 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.
> > > > > + */
> > > > > +
> > > > > +#include <linux/delay.h>
> > > > > +#include <linux/err.h>
> > > > > +#include <linux/mutex.h>
> > > > > +
> > > > > +#include <mach/mxs.h>
> > > > > +
> > > > > +#define BM_OCOTP_CTRL_BUSY (1 << 8)
> > > > > +#define BM_OCOTP_CTRL_ERROR (1 << 9)
> > > > > +#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
> > > > > +
> > > > > +static DEFINE_MUTEX(ocotp_mutex);
> > > > > +
> > > > > +int mxs_read_ocotp(unsigned offset, size_t count, u32 *values)
> > > > > +{
> > > > > + void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
> > > > > + int timeout = 0x400;
> > > > > + size_t i;
> > > > > +
> > > > > + mutex_lock(&ocotp_mutex);
> > > > > +
> > > > > + /*
> > > > > + * clk_enable(hbus_clk) for ocotp can be skipped
> > > > > + * as it must be on when system is running.
> > > > > + */
> > > > > +
> > > > > + /* try to clear ERROR bit */
> > > > > + __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
> > > >
> > > > This operation does not try to clear the error bit but actually clears
> > > > it...
> > > >
> > > > > +
> > > > > + /* check both BUSY and ERROR cleared */
> > > > > + while ((__raw_readl(ocotp_base) &
> > > > > + (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
> > > > > + cpu_relax();
> > > >
> > > > ...which means you do not have to poll the error bit here...
> > > >
> > > > > +
> > > > > + if (unlikely(!timeout))
> > > > > + goto error_unlock;
> > > > > +
> > > > > + /* open OCOTP banks for read */
> > > > > + __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> > > > > +
> > > > > + /* approximately wait 32 hclk cycles */
> > > > > + udelay(1);
> > > > > +
> > > > > + /* poll BUSY bit becoming cleared */
> > > > > + timeout = 0x400;
> > > > > + while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
> > > > > + cpu_relax();
> > > >
> > > > ...which means you can factor out a ocotp_wait_busy function and let the
> > > > code speak instead of the comments.
> > > >
> > > > > +
> > > > > + if (unlikely(!timeout))
> > > > > + goto error_unlock;
> > > > > +
> > > > > + for (i = 0; i < count; i++, offset += 4)
> > > > > + *values++ = __raw_readl(ocotp_base + offset);
> > > >
> > > > The registers in the ocotp are 16 byte aligned. Does it really make
> > > > sense to provide a function allowing to read the gaps between the
> > > > registers?
> > > >
> > > Good catch. The count was added to ease the consecutive otp word
> > > reading, as there is bank open/close cost for otp read. What about
> > > the following changes?
> > >
> > > int mxs_read_ocotp(unsigned offset, size_t otp_word_cnt, u32 *values)
> > > {
> > > ......
> > >
> > > for (i = 0; i < otp_word_cnt; i++, offset += 0x10)
> > > *values++ = __raw_readl(ocotp_base + offset);
> > >
> > > ......
> > > }
> >
> > I would rather make a function like this:
> >
> > static u32 ocotp[0x27];
> >
> > const u32 *mxs_get_ocotp(void)
> > {
> > static int once = 0;
> >
> > if (once)
> > return ocotp
> >
> > /* bank open */
> >
> > for (i = 0; i < 0x27; i++)
> > ocotp[i] = readl(ocotp_base + 0x20 + i * 0x10)
> >
> > /* bank_close */
> >
> > once = 1;
> >
> > return ocotp;
> which is save on UP when it's not called from irq context.
>
> Additionally I suggest a #define for 0x27 and 0x20.
>
So I will keep the mutex and not read SRK bits.
Thanks for the comments.
--
Regards,
Shawn
^ permalink raw reply
* [PATCH/RFC 2/3] ARM: S5PV310: Add a platform helper for MIPI DSIM/CSIS setup
From: Kukjin Kim @ 2011-01-13 1:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294153764-25006-3-git-send-email-s.nawrocki@samsung.com>
Sylwester Nawrocki wrote:
>
> MIPI_PHYn_CONTROL registers are shared between MIPI DSIM
> and MIPI CSIS drivers so a spinlock is used to protect multiple
> access to these registers. Also a proper state of a common
> PHY enable bit is maintained in order to avoid a DSIM
> and CSIS driver conflict.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/mach-s5pv310/Kconfig | 6 ++
> arch/arm/mach-s5pv310/Makefile | 2 +
> arch/arm/mach-s5pv310/include/mach/map.h | 7 +--
> arch/arm/mach-s5pv310/include/mach/regs-pmu.h | 6 ++
> arch/arm/mach-s5pv310/setup-mipi.c | 62
> +++++++++++++++++++++++++
> 5 files changed, 79 insertions(+), 4 deletions(-)
> create mode 100644 arch/arm/mach-s5pv310/setup-mipi.c
>
> diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
> index b7aa3cd..2420076 100644
> --- a/arch/arm/mach-s5pv310/Kconfig
> +++ b/arch/arm/mach-s5pv310/Kconfig
> @@ -15,6 +15,11 @@ config CPU_S5PV310
> help
> Enable S5PV310 CPU support
>
> +config S5PV310_SETUP_MIPI
> + bool
> + help
> + Common setup code for MIPI CSIS/DSIM channels 0 and 1.
> +
> config S5PV310_DEV_PD
> bool
> help
> @@ -96,6 +101,7 @@ config MACH_UNIVERSAL_C210
> select S3C_DEV_HSMMC3
> select S5PV310_SETUP_SDHCI
> select S3C_DEV_I2C1
> + select S5PV310_SETUP_MIPI
> select S5PV310_SETUP_I2C1
> help
> Machine support for Samsung Mobile Universal S5PC210 Reference
> diff --git a/arch/arm/mach-s5pv310/Makefile
b/arch/arm/mach-s5pv310/Makefile
> index 651f193..7f1b89b 100644
> --- a/arch/arm/mach-s5pv310/Makefile
> +++ b/arch/arm/mach-s5pv310/Makefile
> @@ -29,6 +29,8 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) +=
mach-universal_c210.o
> # device support
>
> obj-y += dev-audio.o
> +
> +obj-$(CONFIG_S5PV310_SETUP_MIPI) += setup-mipi.o
> obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o
>
> obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
> diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-
> s5pv310/include/mach/map.h
> index 33bcff2..6635287 100644
> --- a/arch/arm/mach-s5pv310/include/mach/map.h
> +++ b/arch/arm/mach-s5pv310/include/mach/map.h
> @@ -65,8 +65,7 @@
> #define S5PV310_PA_GPIO2 (0x11000000)
> #define S5PV310_PA_GPIO3 (0x03860000)
>
> -#define S5PV310_PA_MIPI_CSIS0 0x11880000
> -#define S5PV310_PA_MIPI_CSIS1 0x11890000
> +#define S5PV310_PA_MIPI_CSIS(x) (0x11880000 + ((x) *
0x10000))
>
> #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
>
> @@ -124,7 +123,7 @@
> #define S3C_PA_IIC7 S5PV310_PA_IIC(7)
> #define S3C_PA_RTC S5PV310_PA_RTC
> #define S3C_PA_WDT S5PV310_PA_WATCHDOG
> -#define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0
> -#define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1
> +#define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS(0)
> +#define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS(1)
>
> #endif /* __ASM_ARCH_MAP_H */
> diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
b/arch/arm/mach-
> s5pv310/include/mach/regs-pmu.h
> index fb333d0..bef8102 100644
> --- a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> +++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
> @@ -27,4 +27,10 @@
>
> #define S5P_INT_LOCAL_PWR_EN 0x7
>
> +#define S5P_MIPI_PHY0_CONTROL S5P_PMUREG(0x0710)
> +#define S5P_MIPI_PHY1_CONTROL S5P_PMUREG(0x0714)
> +#define S5P_MIPI_PHY_ENABLE (1 << 0)
> +#define S5P_MIPI_PHY_SRESETN (1 << 1)
> +#define S5P_MIPI_PHY_MRESETN (1 << 2)
> +
> #endif /* __ASM_ARCH_REGS_PMU_H */
> diff --git a/arch/arm/mach-s5pv310/setup-mipi.c b/arch/arm/mach-
> s5pv310/setup-mipi.c
> new file mode 100644
> index 0000000..fc91a29
> --- /dev/null
> +++ b/arch/arm/mach-s5pv310/setup-mipi.c
> @@ -0,0 +1,62 @@
> +/* linux/arch/arm/mach-s5pv310/setup-mipi.c
> + *
> + * Copyright (c) 2010 Samsung Electronics Co., Ltd
> + *
> + * S5PV310 - Helper functions for MIPI CSIS/DSIM PHY control
> + *
> + * 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/platform_device.h>
> +#include <linux/io.h>
> +#include <linux/spinlock.h>
> +#include <mach/regs-pmu.h>
> +
> +/* Global MIPI CSIS or DSIM PHY enable and reset control. */
> +static int s5p_mipi_phy_control(struct platform_device *pdev, bool on,
u32
> rst)
> +{
> + static DEFINE_SPINLOCK(lock);
> + void __iomem *addr;
> + unsigned long flags;
> + int pid;
> + u32 cfg;
> +
> + if (pdev == NULL)
> + return -EINVAL;
> +
> + pid = pdev->id;
> + if (pid != 0 && pid != 1)
> + return -EINVAL;
> +
> + addr = pid ? S5P_MIPI_PHY1_CONTROL : S5P_MIPI_PHY0_CONTROL;
> +
> + spin_lock_irqsave(&lock, flags);
> +
> + cfg = __raw_readl(addr) & ~rst;
> + if (on)
> + cfg |= rst;
> + __raw_writel(cfg, addr);
> +
> + if (on)
> + cfg |= S5P_MIPI_PHY_ENABLE;
> + else if (!(cfg & (S5P_MIPI_PHY_SRESETN | S5P_MIPI_PHY_MRESETN) &
~rst))
> + cfg &= ~S5P_MIPI_PHY_ENABLE;
> +
> + __raw_writel(cfg, addr);
> +
> + spin_unlock_irqrestore(&lock, flags);
> + return 0;
> +}
> +
> +int s5p_csis_phy_enable(struct platform_device *pdev, bool on)
> +{
> + return s5p_mipi_phy_control(pdev, on, S5P_MIPI_PHY_SRESETN);
> +}
> +
> +int s5p_dsim_phy_enable(struct platform_device *pdev, bool on)
> +{
> + return s5p_mipi_phy_control(pdev, on, S5P_MIPI_PHY_MRESETN);
> +}
> --
> 1.7.3.4
Basically, it's not good that each machine(SoC) has each own setup-mipi...
Because it is very similar(almost same)...means can move it in plat-s5p with
following.
1. # of MIPI PHY can be calculated by platform device id
2. can use same definition of MIPI PHY control address with same name
re-mapping.
And hmm...need to re-think about this after this merge window...
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply
* [PATCH/RFC 1/3] ARM: S5P: Add a platform callback for MIPI CSIS PHY control
From: Kukjin Kim @ 2011-01-13 1:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294153764-25006-2-git-send-email-s.nawrocki@samsung.com>
Sylwester Nawrocki wrote:
>
> The phy_enable callback in struct s5p_platform_mipi_csis is added
> to allow the CSIS driver to control its PHY enable and reset signals.
> This allows to use same MIPI CSIS driver across various SoCs.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/plat-s5p/dev-csis0.c | 2 +-
> arch/arm/plat-s5p/dev-csis1.c | 2 +-
> arch/arm/plat-s5p/include/plat/csis.h | 28 --------------------
> arch/arm/plat-s5p/include/plat/mipi_csis.h | 39
> ++++++++++++++++++++++++++++
> 4 files changed, 41 insertions(+), 30 deletions(-)
> delete mode 100644 arch/arm/plat-s5p/include/plat/csis.h
> create mode 100644 arch/arm/plat-s5p/include/plat/mipi_csis.h
>
> diff --git a/arch/arm/plat-s5p/dev-csis0.c b/arch/arm/plat-s5p/dev-csis0.c
> index dfab1c8..57efe9c 100644j
> --- a/arch/arm/plat-s5p/dev-csis0.c
> +++ b/arch/arm/plat-s5p/dev-csis0.c
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (C) 2010 Samsung Electronics
> + * Copyright (C) 2010 Samsung Electronics Co., Ltd
> *
> * S5P series device definition for MIPI-CSIS channel 0
> *
> diff --git a/arch/arm/plat-s5p/dev-csis1.c b/arch/arm/plat-s5p/dev-csis1.c
> index e3053f2..c61b46b 100644
> --- a/arch/arm/plat-s5p/dev-csis1.c
> +++ b/arch/arm/plat-s5p/dev-csis1.c
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (C) 2010 Samsung Electronics
> + * Copyright (C) 2010 Samsung Electronics Co., Ltd
> *
> * S5P series device definition for MIPI-CSIS channel 1
> *
> diff --git a/arch/arm/plat-s5p/include/plat/csis.h b/arch/arm/plat-
> s5p/include/plat/csis.h
> deleted file mode 100644
> index 51e308c..0000000
> --- a/arch/arm/plat-s5p/include/plat/csis.h
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -/*
> - * Copyright (C) 2010 Samsung Electronics
> - *
> - * S5P series MIPI CSI slave device support
> - *
> - * 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.
> - */
> -
> -#ifndef PLAT_S5P_CSIS_H_
> -#define PLAT_S5P_CSIS_H_ __FILE__
> -
> -/**
> - * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS
> - * @clk_rate: bus clock frequency
> - * @lanes: number of data lanes used
> - * @alignment: data alignment in bits
> - * @hs_settle: HS-RX settle time
> - */
> -struct s5p_platform_mipi_csis {
> - unsigned long clk_rate;
> - u8 lanes;
> - u8 alignment;
> - u8 hs_settle;
> -};
> -
> -#endif /* PLAT_S5P_CSIS_H_ */
> diff --git a/arch/arm/plat-s5p/include/plat/mipi_csis.h b/arch/arm/plat-
> s5p/include/plat/mipi_csis.h
> new file mode 100644
> index 0000000..0b22065
> --- /dev/null
> +++ b/arch/arm/plat-s5p/include/plat/mipi_csis.h
> @@ -0,0 +1,39 @@
> +/*
> + * Copyright (C) 2010 Samsung Electronics, Co. Ltd
> + *
> + * S5P series MIPI CSI slave device support
> + *
> + * 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.
> + */
> +
> +#ifndef PLAT_S5P_MIPI_CSIS_H_
> +#define PLAT_S5P_MIPI_CSIS_H_ __FILE__
> +
> +struct platform_device;
> +
> +/**
> + * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS
> + * @clk_rate: bus clock frequency
> + * @lanes: number of data lanes used
> + * @alignment: data alignment in bits
> + * @hs_settle: HS-RX settle time
> + */
> +struct s5p_platform_mipi_csis {
> + unsigned long clk_rate;
> + u8 lanes;
> + u8 alignment;
> + u8 hs_settle;
> + int (*phy_enable)(struct platform_device *pdev, bool on);
> +};
> +
> +/**
> + * struct s5p_csis_phy_control - global MIPI-CSIS PHY control
> + * @pdev: platform device the mipi phy state is to be changed for
> + * @on: true to enable CSIS PHY and assert its reset,
> + * false will disable the PHY and put into reset state
> + */
> +int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
> +
> +#endif /* PLAT_S5P_MIPI_CSIS_H_ */
> --
> 1.7.3.4
I think should be separated like following.
If required, ...
1. change copyright
2. rename csis.h to mipi_csis.h
3. add phy enable feature
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Dima Zavin @ 2011-01-13 0:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294877317-25832-1-git-send-email-dima@android.com>
Thanks for the review.
--Dima
On Wed, Jan 12, 2011 at 4:08 PM, Dima Zavin <dima@android.com> wrote:
> Do not use memory bank info to request the "system ram" resources as
> they do not track holes created by memblock_remove inside
> machine's reserve callback. If the removed memory is passed as
> platform_device's ioresource, then drivers that call
> request_mem_region would fail due to a conflict with the incorrectly
> configured system ram resource.
>
> Instead, iterate through the regions of memblock.memory and add
> those as "System RAM" resources.
>
> Signed-off-by: Dima Zavin <dima@android.com>
> ---
> ?arch/arm/kernel/setup.c | ? 16 ++++++----------
> ?1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 336f14e..470efbc 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -517,25 +517,21 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
> ?#endif
> ?}
>
> -static void __init
> -request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
> +static void __init request_standard_resources(struct machine_desc *mdesc)
> ?{
> + ? ? ? struct memblock_region *region;
> ? ? ? ?struct resource *res;
> - ? ? ? int i;
>
> ? ? ? ?kernel_code.start ? = virt_to_phys(_text);
> ? ? ? ?kernel_code.end ? ? = virt_to_phys(_etext - 1);
> ? ? ? ?kernel_data.start ? = virt_to_phys(_sdata);
> ? ? ? ?kernel_data.end ? ? = virt_to_phys(_end - 1);
>
> - ? ? ? for (i = 0; i < mi->nr_banks; i++) {
> - ? ? ? ? ? ? ? if (mi->bank[i].size == 0)
> - ? ? ? ? ? ? ? ? ? ? ? continue;
> -
> + ? ? ? for_each_memblock(memory, region) {
> ? ? ? ? ? ? ? ?res = alloc_bootmem_low(sizeof(*res));
> ? ? ? ? ? ? ? ?res->name ?= "System RAM";
> - ? ? ? ? ? ? ? res->start = mi->bank[i].start;
> - ? ? ? ? ? ? ? res->end ? = mi->bank[i].start + mi->bank[i].size - 1;
> + ? ? ? ? ? ? ? res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
> + ? ? ? ? ? ? ? res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
> ? ? ? ? ? ? ? ?res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
>
> ? ? ? ? ? ? ? ?request_resource(&iomem_resource, res);
> @@ -857,7 +853,7 @@ void __init setup_arch(char **cmdline_p)
> ? ? ? ?arm_memblock_init(&meminfo, mdesc);
>
> ? ? ? ?paging_init(mdesc);
> - ? ? ? request_standard_resources(&meminfo, mdesc);
> + ? ? ? request_standard_resources(mdesc);
>
> ?#ifdef CONFIG_SMP
> ? ? ? ?if (is_smp())
> --
> 1.7.3.1
>
>
^ permalink raw reply
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Dima Zavin @ 2011-01-13 0:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110112235223.GM11039@n2100.arm.linux.org.uk>
Do not use memory bank info to request the "system ram" resources as
they do not track holes created by memblock_remove inside
machine's reserve callback. If the removed memory is passed as
platform_device's ioresource, then drivers that call
request_mem_region would fail due to a conflict with the incorrectly
configured system ram resource.
Instead, iterate through the regions of memblock.memory and add
those as "System RAM" resources.
Signed-off-by: Dima Zavin <dima@android.com>
---
arch/arm/kernel/setup.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 336f14e..470efbc 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -517,25 +517,21 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
#endif
}
-static void __init
-request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
+static void __init request_standard_resources(struct machine_desc *mdesc)
{
+ struct memblock_region *region;
struct resource *res;
- int i;
kernel_code.start = virt_to_phys(_text);
kernel_code.end = virt_to_phys(_etext - 1);
kernel_data.start = virt_to_phys(_sdata);
kernel_data.end = virt_to_phys(_end - 1);
- for (i = 0; i < mi->nr_banks; i++) {
- if (mi->bank[i].size == 0)
- continue;
-
+ for_each_memblock(memory, region) {
res = alloc_bootmem_low(sizeof(*res));
res->name = "System RAM";
- res->start = mi->bank[i].start;
- res->end = mi->bank[i].start + mi->bank[i].size - 1;
+ res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
+ res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
request_resource(&iomem_resource, res);
@@ -857,7 +853,7 @@ void __init setup_arch(char **cmdline_p)
arm_memblock_init(&meminfo, mdesc);
paging_init(mdesc);
- request_standard_resources(&meminfo, mdesc);
+ request_standard_resources(mdesc);
#ifdef CONFIG_SMP
if (is_smp())
--
1.7.3.1
^ permalink raw reply related
* [PATCH 2/2] mach-mmp: PXA910 Drive Strength FAST using wrong value
From: Eric Miao @ 2011-01-12 23:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <2F4B855B-51EF-49A9-B0AC-F2B75E3FE639@marvell.com>
On Fri, Jan 7, 2011 at 1:27 PM, Philip Rakity <prakity@marvell.com> wrote:
>
> Drive strength for PXA910 is a 2 bit value but because of the mapping in
> plat-pxa/mfp.h needs to be shifted up one bit to handle real
> location in mfp registers. ?(MMP2 and PXA910 drive strength start
> at bit 11 while PXA168 starts at bit 10).
>
> Values 0, 1, 2, and 3 effectively need to be
> 0, 2, 4, and 6 to fit into register. ?8 does not work.
>
> Signed-off-by: Philip Rakity <prakity@marvell.com>
Applied.
> ---
> ?arch/arm/mach-mmp/include/mach/mfp-pxa910.h | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
> index 7e8a80f..fbd7ee8 100644
> --- a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
> +++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
> @@ -6,7 +6,7 @@
> ?#define MFP_DRIVE_VERY_SLOW ? ?(0x0 << 13)
> ?#define MFP_DRIVE_SLOW ? ? ? ? (0x2 << 13)
> ?#define MFP_DRIVE_MEDIUM ? ? ? (0x4 << 13)
> -#define MFP_DRIVE_FAST ? ? ? ? (0x8 << 13)
> +#define MFP_DRIVE_FAST ? ? ? ? (0x6 << 13)
>
> ?/* UART2 */
> ?#define GPIO47_UART2_RXD ? ? ? MFP_CFG(GPIO47, AF6)
> --
> 1.7.0.4
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH 1/7] ARM: integrator cp: init clocks early and add sp804 clock
From: Russell King - ARM Linux @ 2011-01-12 23:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-2-git-send-email-robherring2@gmail.com>
On Wed, Jan 12, 2011 at 05:31:57PM -0600, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
>
> Move clock initialization to mdesc->init_early and add a clock for
> sp804 timer.
Please wait for my patches to do this. I've already got them committed
and waiting - init_early was originally intended to solve the sched_clock
initialization issue...
I'll be pushing that stuff out after the merge window has closed.
^ permalink raw reply
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Russell King - ARM Linux @ 2011-01-12 23:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294874560-16542-1-git-send-email-dima@android.com>
On Wed, Jan 12, 2011 at 03:22:40PM -0800, Dima Zavin wrote:
> @@ -518,8 +518,9 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
> }
>
> static void __init
> -request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
> +request_standard_resources(struct machine_desc *mdesc)
Almost there. This line can now be combined with the preceding line
without wrapping over the 80 column limit.
> {
> + struct memblock_type *mem = &memblock.memory;
> struct resource *res;
> int i;
>
> @@ -528,14 +529,11 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
> kernel_data.start = virt_to_phys(_sdata);
> kernel_data.end = virt_to_phys(_end - 1);
>
> - for (i = 0; i < mi->nr_banks; i++) {
> - if (mi->bank[i].size == 0)
> - continue;
> -
> + for (i = 0; i < mem->cnt; i++) {
Hmm, probably shouldn't rely on that - we should be using the accessors
which memblock people have provided for us.
for_each_memblock(memory, mem) {
> res = alloc_bootmem_low(sizeof(*res));
> res->name = "System RAM";
> - res->start = mi->bank[i].start;
> - res->end = mi->bank[i].start + mi->bank[i].size - 1;
> + res->start = mem->regions[i].base;
> + res->end = mem->regions[i].base + mem->regions[i].size - 1;
res->start = __pfn_to_phys(memblock_region_memory_base_pfn(mem));
res->end = __pfn_to_phys(memblock_region_memory_end_pfn(mem)) - 1;
And I'd say ignore the 80-column limit on that because of the excessively
long memblock function names.
^ permalink raw reply
* [PATCH 7/7] ARM: vexpress: add smp_twd clock
From: Rob Herring @ 2011-01-12 23:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Add smp_twd clock and call twd_timer_init to enable using it.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/mach-vexpress/ct-ca9x4.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index db4614c..62d5a2d 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -53,9 +53,6 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
static void __init ct_ca9x4_map_io(void)
{
-#ifdef CONFIG_LOCAL_TIMERS
- twd_base = MMIO_P2V(A9_MPCORE_TWD);
-#endif
v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
}
@@ -183,10 +180,17 @@ static struct clk osc1_clk = {
.rate = 24000000,
};
+static struct clk twd_clk = {
+ .rate = 200000000,
+};
+
static struct clk_lookup lookups[] = {
{ /* CLCD */
.dev_id = "ct:clcd",
.clk = &osc1_clk,
+ }, { /* TWD */
+ .dev_id = "smp_twd",
+ .clk = &twd_clk,
},
};
@@ -194,6 +198,10 @@ static void __init ct_ca9x4_init_early(void)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
v2m_init_early();
+
+#ifdef CONFIG_LOCAL_TIMERS
+ twd_timer_init(MMIO_P2V(A9_MPCORE_TWD));
+#endif
}
static struct resource pmu_resources[] = {
--
1.7.1
^ permalink raw reply related
* [PATCH 6/7] ARM: smp_twd: add clock api support
From: Rob Herring @ 2011-01-12 23:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
The private timer freq is currently dynamically detected
using jiffies count to determine the rate. This method adds
a delay to boot-up, so use the clock api instead to get the
clock rate.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/include/asm/smp_twd.h | 1 +
arch/arm/kernel/smp_twd.c | 11 +++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index fed9981..6b0f591 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -24,5 +24,6 @@ extern void __iomem *twd_base;
int twd_timer_ack(void);
void twd_timer_setup(struct clock_event_device *);
+void twd_timer_init(void __iomem *base);
#endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index dd79074..9a20729 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/clk.h>
+#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/delay.h>
@@ -145,3 +147,12 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
clockevents_register_device(clk);
}
+
+void __init twd_timer_init(void __iomem *base)
+{
+ struct clk *clk = clk_get_sys("smp_twd", NULL);
+ if (!IS_ERR(clk))
+ twd_timer_rate = clk_get_rate(clk);
+
+ twd_base = base;
+}
--
1.7.1
^ permalink raw reply related
* [PATCH 5/7] ARM: timer-sp: support timer clock freq other than 1MHz
From: Rob Herring @ 2011-01-12 23:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
The timer-sp code is fixed to 1MHz timer clock. Add clock api
calls to get the timer clock frequency and support for independent
clock frequencies.
Rename timer names for clocksource and clockevent to timer-sp or
the clock connection ID string if provided.
Compile tested on integrator, realview, versatile, and vexpress. Boot
tested on vexpress.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/common/timer-sp.c | 43 +++++++++++++++++++++---------
arch/arm/include/asm/hardware/timer-sp.h | 4 +-
arch/arm/mach-integrator/integrator_cp.c | 4 +-
arch/arm/mach-realview/core.c | 4 +-
arch/arm/mach-versatile/core.c | 4 +-
arch/arm/mach-vexpress/v2m.c | 4 +-
6 files changed, 40 insertions(+), 23 deletions(-)
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 6ef3342..c5572d0 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -18,6 +18,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/clk.h>
+#include <linux/err.h>
#include <linux/clocksource.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
@@ -26,12 +28,7 @@
#include <asm/hardware/arm_timer.h>
-/*
- * These timers are currently always setup to be clocked at 1MHz.
- */
-#define TIMER_FREQ_KHZ (1000)
-#define TIMER_RELOAD (TIMER_FREQ_KHZ * 1000 / HZ)
-
+static unsigned long sp804_clksrc_rate;
static void __iomem *clksrc_base;
static cycle_t sp804_read(struct clocksource *cs)
@@ -40,19 +37,28 @@ static cycle_t sp804_read(struct clocksource *cs)
}
static struct clocksource clocksource_sp804 = {
- .name = "timer3",
.rating = 200,
.read = sp804_read,
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
-void __init sp804_clocksource_init(void __iomem *base)
+void __init sp804_clocksource_init(void __iomem *base, char *clk_id)
{
+ struct clk *clk;
struct clocksource *cs = &clocksource_sp804;
+ cs->name = clk_id ? clk_id : "timer-sp";
+
clksrc_base = base;
+ clk = clk_get_sys("sp804", clk_id);
+ if (IS_ERR(clk) || clk_enable(clk))
+ panic("sp804 clksrc: cannot get clock\n");
+
+ clk_enable(clk);
+ sp804_clksrc_rate = clk_get_rate(clk);
+
/* setup timer 0 as free-running clocksource */
writel(0, clksrc_base + TIMER_CTRL);
writel(0xffffffff, clksrc_base + TIMER_LOAD);
@@ -60,10 +66,11 @@ void __init sp804_clocksource_init(void __iomem *base)
writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
clksrc_base + TIMER_CTRL);
- clocksource_register_khz(cs, TIMER_FREQ_KHZ);
+ clocksource_register_hz(cs, sp804_clksrc_rate);
}
+static unsigned long sp804_clkevt_rate;
static void __iomem *clkevt_base;
/*
@@ -90,7 +97,7 @@ static void sp804_set_mode(enum clock_event_mode mode,
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
- writel(TIMER_RELOAD, clkevt_base + TIMER_LOAD);
+ writel(sp804_clkevt_rate / HZ, clkevt_base + TIMER_LOAD);
ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
break;
@@ -120,7 +127,6 @@ static int sp804_set_next_event(unsigned long next,
}
static struct clock_event_device sp804_clockevent = {
- .name = "timer0",
.shift = 32,
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
.set_mode = sp804_set_mode,
@@ -136,14 +142,25 @@ static struct irqaction sp804_timer_irq = {
.dev_id = &sp804_clockevent,
};
-void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq)
+void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq,
+ char *clk_id)
{
+ struct clk *clk;
struct clock_event_device *evt = &sp804_clockevent;
+ evt->name = clk_id ? clk_id : "timer-sp";
+
clkevt_base = base;
+ clk = clk_get_sys("sp804", clk_id);
+ if (IS_ERR(clk) || clk_enable(clk))
+ panic("sp804 clkevt: cannot get clock\n");
+
+ clk_enable(clk);
+ sp804_clkevt_rate = clk_get_rate(clk);
+
evt->irq = timer_irq;
- evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift);
+ evt->mult = div_sc(sp804_clkevt_rate, NSEC_PER_SEC, evt->shift);
evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
diff --git a/arch/arm/include/asm/hardware/timer-sp.h b/arch/arm/include/asm/hardware/timer-sp.h
index 21e75e3..dc31cb0 100644
--- a/arch/arm/include/asm/hardware/timer-sp.h
+++ b/arch/arm/include/asm/hardware/timer-sp.h
@@ -1,2 +1,2 @@
-void sp804_clocksource_init(void __iomem *);
-void sp804_clockevents_init(void __iomem *, unsigned int);
+void sp804_clocksource_init(void __iomem *, char *);
+void sp804_clockevents_init(void __iomem *, unsigned int, char *);
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index d99a880..10ba4f0 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -598,8 +598,8 @@ static void __init intcp_timer_init(void)
writel(0, TIMER1_VA_BASE + TIMER_CTRL);
writel(0, TIMER2_VA_BASE + TIMER_CTRL);
- sp804_clocksource_init(TIMER2_VA_BASE);
- sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1);
+ sp804_clocksource_init(TIMER2_VA_BASE, NULL);
+ sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, NULL);
}
static struct sys_timer cp_timer = {
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 16b8a81..1a9d0f9 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -702,8 +702,8 @@ void __init realview_timer_init(unsigned int timer_irq)
writel(0, timer2_va_base + TIMER_CTRL);
writel(0, timer3_va_base + TIMER_CTRL);
- sp804_clocksource_init(timer3_va_base);
- sp804_clockevents_init(timer0_va_base, timer_irq);
+ sp804_clocksource_init(timer3_va_base, NULL);
+ sp804_clockevents_init(timer0_va_base, timer_irq, NULL);
}
/*
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 399e2ef..b0685ad 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -939,8 +939,8 @@ static void __init versatile_timer_init(void)
writel(0, TIMER2_VA_BASE + TIMER_CTRL);
writel(0, TIMER3_VA_BASE + TIMER_CTRL);
- sp804_clocksource_init(TIMER3_VA_BASE);
- sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1);
+ sp804_clocksource_init(TIMER3_VA_BASE, NULL);
+ sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, NULL);
}
struct sys_timer versatile_timer = {
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index e371d99..8bb28b9 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -55,8 +55,8 @@ static void __init v2m_timer_init(void)
writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
- sp804_clocksource_init(MMIO_P2V(V2M_TIMER1));
- sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
+ sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), NULL);
+ sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0, NULL);
}
struct sys_timer v2m_timer = {
--
1.7.1
^ permalink raw reply related
* [PATCH 4/7] ARM: vexpress: init clocks early and add sp804 clock
From: Rob Herring @ 2011-01-12 23:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Move clock initialization to mdesc->init_early and add a clock for
sp804 timer.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/mach-vexpress/core.h | 1 +
arch/arm/mach-vexpress/ct-ca9x4.c | 13 +++++++++----
arch/arm/mach-vexpress/v2m.c | 14 ++++++++++++--
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index 362780d..e0312a1 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -21,4 +21,5 @@ struct amba_device name##_device = { \
struct map_desc;
void v2m_map_io(struct map_desc *tile, size_t num);
+void v2m_init_early(void);
extern struct sys_timer v2m_timer;
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index e628402..db4614c 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -71,8 +71,8 @@ static void __init ct_ca9x4_timer_init(void)
writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
- sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1));
- sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0);
+ sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), NULL);
+ sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0, NULL);
}
static struct sys_timer ct_ca9x4_timer = {
@@ -190,6 +190,12 @@ static struct clk_lookup lookups[] = {
},
};
+static void __init ct_ca9x4_init_early(void)
+{
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+ v2m_init_early();
+}
+
static struct resource pmu_resources[] = {
[0] = {
.start = IRQ_CT_CA9X4_PMU_CPU0,
@@ -234,8 +240,6 @@ static void __init ct_ca9x4_init(void)
l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);
#endif
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++)
amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);
@@ -245,6 +249,7 @@ static void __init ct_ca9x4_init(void)
MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
.boot_params = PHYS_OFFSET + 0x00000100,
.map_io = ct_ca9x4_map_io,
+ .init_early = ct_ca9x4_init_early,
.init_irq = ct_ca9x4_init_irq,
#if 0
.timer = &ct_ca9x4_timer,
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index a9ed342..e371d99 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -300,6 +300,10 @@ static struct clk osc2_clk = {
.rate = 24000000,
};
+static struct clk sp804_clk = {
+ .rate = 1000000,
+};
+
static struct clk dummy_apb_pclk;
static struct clk_lookup v2m_lookups[] = {
@@ -330,9 +334,17 @@ static struct clk_lookup v2m_lookups[] = {
}, { /* CLCD */
.dev_id = "mb:clcd",
.clk = &osc1_clk,
+ }, { /* SP804 Timer */
+ .dev_id = "sp804",
+ .clk = &sp804_clk,
},
};
+void __init v2m_init_early(void)
+{
+ clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
+}
+
static void v2m_power_off(void)
{
if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0))
@@ -349,8 +361,6 @@ static int __init v2m_init(void)
{
int i;
- clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
-
platform_device_register(&v2m_pcie_i2c_device);
platform_device_register(&v2m_ddc_i2c_device);
platform_device_register(&v2m_flash_device);
--
1.7.1
^ permalink raw reply related
* [PATCH 3/7] ARM: versatile: init clocks early and add sp804 clock
From: Rob Herring @ 2011-01-12 23:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Move clock initialization to mdesc->init_early and add a clock for
sp804 timer.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/mach-versatile/core.c | 18 ++++++++++++++----
arch/arm/mach-versatile/core.h | 1 +
arch/arm/mach-versatile/versatile_ab.c | 1 +
arch/arm/mach-versatile/versatile_pb.c | 1 +
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 13a83e4..399e2ef 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -417,6 +417,10 @@ static struct clk ref24_clk = {
.rate = 24000000,
};
+static struct clk sp804_clk = {
+ .rate = 1000000,
+};
+
static struct clk dummy_apb_pclk;
static struct clk_lookup lookups[] = {
@@ -453,9 +457,19 @@ static struct clk_lookup lookups[] = {
}, { /* CLCD */
.dev_id = "dev:20",
.clk = &osc4_clk,
+ }, { /* SP804 Timer */
+ .dev_id = "sp804",
+ .clk = &sp804_clk,
}
};
+void __init versatile_init_early(void)
+{
+ osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+}
+
/*
* CLCD support.
*/
@@ -867,10 +881,6 @@ void __init versatile_init(void)
{
int i;
- osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
-
- clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
platform_device_register(&versatile_flash_device);
platform_device_register(&versatile_i2c_device);
platform_device_register(&smc91x_device);
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
index 9d39886..e04768a 100644
--- a/arch/arm/mach-versatile/core.h
+++ b/arch/arm/mach-versatile/core.h
@@ -25,6 +25,7 @@
#include <linux/amba/bus.h>
extern void __init versatile_init(void);
+extern void __init versatile_init_early(void);
extern void __init versatile_init_irq(void);
extern void __init versatile_map_io(void);
extern struct sys_timer versatile_timer;
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index aa9730f..f8ae64b 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100,
.map_io = versatile_map_io,
+ .init_early = versatile_init_early,
.init_irq = versatile_init_irq,
.timer = &versatile_timer,
.init_machine = versatile_init,
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index bf46964..97fb306 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -110,6 +110,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100,
.map_io = versatile_map_io,
+ .init_early = versatile_init_early,
.init_irq = versatile_init_irq,
.timer = &versatile_timer,
.init_machine = versatile_pb_init,
--
1.7.1
^ permalink raw reply related
* [PATCH 2/7] ARM: realview: init clocks early and add sp804 clock
From: Rob Herring @ 2011-01-12 23:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Move clock initialization to mdesc->init_early and add a clock for
sp804 timer.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/mach-realview/core.c | 12 ++++++++----
arch/arm/mach-realview/core.h | 1 +
arch/arm/mach-realview/realview_eb.c | 1 +
arch/arm/mach-realview/realview_pb1176.c | 1 +
arch/arm/mach-realview/realview_pb11mp.c | 1 +
arch/arm/mach-realview/realview_pba8.c | 1 +
arch/arm/mach-realview/realview_pbx.c | 1 +
7 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 1c6602c..16b8a81 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -314,6 +314,10 @@ static struct clk ref24_clk = {
.rate = 24000000,
};
+static struct clk sp804_clk = {
+ .rate = 1000000,
+};
+
static struct clk dummy_apb_pclk;
static struct clk_lookup lookups[] = {
@@ -356,10 +360,13 @@ static struct clk_lookup lookups[] = {
}, { /* SSP */
.dev_id = "dev:ssp0",
.clk = &ref24_clk,
+ }, { /* SP804 Timer */
+ .dev_id = "sp804",
+ .clk = &sp804_clk,
}
};
-static int __init clk_init(void)
+void __init realview_init_early(void)
{
if (machine_is_realview_pb1176())
oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET;
@@ -367,10 +374,7 @@ static int __init clk_init(void)
oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET;
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- return 0;
}
-core_initcall(clk_init);
/*
* CLCD support.
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 693239d..cb44595 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -65,6 +65,7 @@ extern int realview_eth_register(const char *name, struct resource *res);
extern int realview_usb_register(struct resource *res);
extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
char **from, struct meminfo *meminfo);
+extern void realview_init_early(void);
extern void (*realview_reset)(char);
#endif
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 6ef5c5e..c00e527 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -487,6 +487,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
.boot_params = PHYS_OFFSET + 0x00000100,
.fixup = realview_fixup,
.map_io = realview_eb_map_io,
+ .init_early = realview_init_early,
.init_irq = gic_init_irq,
.timer = &realview_eb_timer,
.init_machine = realview_eb_init,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index cbdc97a..f0447bb 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -382,6 +382,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
.boot_params = PHYS_OFFSET + 0x00000100,
.fixup = realview_pb1176_fixup,
.map_io = realview_pb1176_map_io,
+ .init_early = realview_init_early,
.init_irq = gic_init_irq,
.timer = &realview_pb1176_timer,
.init_machine = realview_pb1176_init,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 8e8ab7d..3b4f788 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -384,6 +384,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
.boot_params = PHYS_OFFSET + 0x00000100,
.fixup = realview_fixup,
.map_io = realview_pb11mp_map_io,
+ .init_early = realview_init_early,
.init_irq = gic_init_irq,
.timer = &realview_pb11mp_timer,
.init_machine = realview_pb11mp_init,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 841118e..f98d4fa 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -334,6 +334,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
.boot_params = PHYS_OFFSET + 0x00000100,
.fixup = realview_fixup,
.map_io = realview_pba8_map_io,
+ .init_early = realview_init_early,
.init_irq = gic_init_irq,
.timer = &realview_pba8_timer,
.init_machine = realview_pba8_init,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 02b755b..b0521e1 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -417,6 +417,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
.boot_params = PHYS_OFFSET + 0x00000100,
.fixup = realview_pbx_fixup,
.map_io = realview_pbx_map_io,
+ .init_early = realview_init_early,
.init_irq = gic_init_irq,
.timer = &realview_pbx_timer,
.init_machine = realview_pbx_init,
--
1.7.1
^ permalink raw reply related
* [PATCH 1/7] ARM: integrator cp: init clocks early and add sp804 clock
From: Rob Herring @ 2011-01-12 23:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294875123-14086-1-git-send-email-robherring2@gmail.com>
From: Rob Herring <rob.herring@calxeda.com>
Move clock initialization to mdesc->init_early and add a clock for
sp804 timer.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/mach-integrator/integrator_cp.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 85e48a5..d99a880 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -305,14 +305,25 @@ static struct clk cp_auxclk = {
.params = &cp_auxvco_params,
.vcoreg = CM_AUXOSC,
};
+static struct clk sp804_clk = {
+ .rate = 1000000,
+};
static struct clk_lookup cp_lookups[] = {
{ /* CLCD */
.dev_id = "mb:c0",
.clk = &cp_auxclk,
- },
+ }, { /* SP804 Timer */
+ .dev_id = "sp804",
+ .clk = &sp804_clk,
+ }
};
+static void __init intcp_init_early(void)
+{
+ clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups));
+}
+
/*
* Flash handling.
*/
@@ -569,7 +580,6 @@ static void __init intcp_init(void)
{
int i;
- clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups));
platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
@@ -601,6 +611,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
.boot_params = 0x00000100,
.map_io = intcp_map_io,
.reserve = integrator_reserve,
+ .init_early = intcp_init_early,
.init_irq = intcp_init_irq,
.timer = &cp_timer,
.init_machine = intcp_init,
--
1.7.1
^ permalink raw reply related
* [PATCH 0/7] ARM: add clock api to sp804 and smp_twd timers
From: Rob Herring @ 2011-01-12 23:31 UTC (permalink / raw)
To: linux-arm-kernel
From: Rob Herring <rob.herring@calxeda.com>
Russell,
Here is updated patch series based on your previous comments. As I mentioned,
the problem making the clock api mandatory for smp_twd is I don't know what the
frequency of the timer is on various platforms or an understanding of what
their clock trees look like to do a proper implementation of the clocks. I did
add clocks for vexpress as I can test that platform.
Rob
Rob Herring (7):
ARM: integrator cp: init clocks early and add sp804 clock
ARM: realview: init clocks early and add sp804 clock
ARM: versatile: init clocks early and add sp804 clock
ARM: vexpress: init clocks early and add sp804 clock
ARM: timer-sp: support timer clock freq other than 1MHz
ARM: smp_twd: add clock api support
ARM: vexpress: add smp_twd clock
arch/arm/common/timer-sp.c | 43 +++++++++++++++++++++---------
arch/arm/include/asm/hardware/timer-sp.h | 4 +-
arch/arm/include/asm/smp_twd.h | 1 +
arch/arm/kernel/smp_twd.c | 11 +++++++
arch/arm/mach-integrator/integrator_cp.c | 19 ++++++++++---
arch/arm/mach-realview/core.c | 16 +++++++----
arch/arm/mach-realview/core.h | 1 +
arch/arm/mach-realview/realview_eb.c | 1 +
arch/arm/mach-realview/realview_pb1176.c | 1 +
arch/arm/mach-realview/realview_pb11mp.c | 1 +
arch/arm/mach-realview/realview_pba8.c | 1 +
arch/arm/mach-realview/realview_pbx.c | 1 +
arch/arm/mach-versatile/core.c | 22 +++++++++++----
arch/arm/mach-versatile/core.h | 1 +
arch/arm/mach-versatile/versatile_ab.c | 1 +
arch/arm/mach-versatile/versatile_pb.c | 1 +
arch/arm/mach-vexpress/core.h | 1 +
arch/arm/mach-vexpress/ct-ca9x4.c | 27 ++++++++++++++-----
arch/arm/mach-vexpress/v2m.c | 18 +++++++++---
19 files changed, 129 insertions(+), 42 deletions(-)
^ permalink raw reply
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Dima Zavin @ 2011-01-12 23:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTin6oZKrq-z6yEQqGhAcknfDkW0PEaYMfGS7gJq8@mail.gmail.com>
Do not use memory bank info to request the "system ram" resources as
they do not track holes created by memblock_remove inside
machine's reserve callback. If the removed memory is passed as
platform_device's ioresource, then drivers that call
request_mem_region would fail due to a conflict with the incorrectly
configured system ram resource.
Instead, iterate through the regions of memblock.memory and add
those as "System RAM" resources.
Signed-off-by: Dima Zavin <dima@android.com>
---
arch/arm/kernel/setup.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 336f14e..b291a6b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -518,8 +518,9 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
}
static void __init
-request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
+request_standard_resources(struct machine_desc *mdesc)
{
+ struct memblock_type *mem = &memblock.memory;
struct resource *res;
int i;
@@ -528,14 +529,11 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
kernel_data.start = virt_to_phys(_sdata);
kernel_data.end = virt_to_phys(_end - 1);
- for (i = 0; i < mi->nr_banks; i++) {
- if (mi->bank[i].size == 0)
- continue;
-
+ for (i = 0; i < mem->cnt; i++) {
res = alloc_bootmem_low(sizeof(*res));
res->name = "System RAM";
- res->start = mi->bank[i].start;
- res->end = mi->bank[i].start + mi->bank[i].size - 1;
+ res->start = mem->regions[i].base;
+ res->end = mem->regions[i].base + mem->regions[i].size - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
request_resource(&iomem_resource, res);
@@ -857,7 +855,7 @@ void __init setup_arch(char **cmdline_p)
arm_memblock_init(&meminfo, mdesc);
paging_init(mdesc);
- request_standard_resources(&meminfo, mdesc);
+ request_standard_resources(mdesc);
#ifdef CONFIG_SMP
if (is_smp())
--
1.7.3.1
^ permalink raw reply related
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Dima Zavin @ 2011-01-12 23:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110112231138.GL11039@n2100.arm.linux.org.uk>
yes. I'll respin the patch.
On Wed, Jan 12, 2011 at 3:11 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Jan 12, 2011 at 02:35:57PM -0800, Dima Zavin wrote:
>> Do not use memory bank info to request the "system ram" resources as
>> they do not track holes created by memblock_remove inside
>> machine's reserve callback. If the removed memory is passed as
>> platform_device's ioresource, then drivers that call
>> request_mem_region would fail due to a conflict with the incorrectly
>> configured system ram resource.
>>
>> Instead, iterate through the regions of memblock.memory and add
>> those as "System RAM" resources.
>>
>> Signed-off-by: Dima Zavin <dima@android.com>
>> ---
>> ?arch/arm/kernel/setup.c | ? 10 ++++------
>> ?1 files changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
>> index 336f14e..c3aa394 100644
>> --- a/arch/arm/kernel/setup.c
>> +++ b/arch/arm/kernel/setup.c
>> @@ -520,6 +520,7 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
>> ?static void __init
>> ?request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
>
> Doesn't this means we can get rid of the 'mi' argument?
>
^ permalink raw reply
* [PATCH] ARM: use memblock memory regions for "System RAM" I/O resources
From: Russell King - ARM Linux @ 2011-01-12 23:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294871757-11391-1-git-send-email-dima@android.com>
On Wed, Jan 12, 2011 at 02:35:57PM -0800, Dima Zavin wrote:
> Do not use memory bank info to request the "system ram" resources as
> they do not track holes created by memblock_remove inside
> machine's reserve callback. If the removed memory is passed as
> platform_device's ioresource, then drivers that call
> request_mem_region would fail due to a conflict with the incorrectly
> configured system ram resource.
>
> Instead, iterate through the regions of memblock.memory and add
> those as "System RAM" resources.
>
> Signed-off-by: Dima Zavin <dima@android.com>
> ---
> arch/arm/kernel/setup.c | 10 ++++------
> 1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 336f14e..c3aa394 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -520,6 +520,7 @@ setup_ramdisk(int doload, int prompt, int image_start, unsigned int rd_sz)
> static void __init
> request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
Doesn't this means we can get rid of the 'mi' argument?
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox