* [PATCH] omap4: usb: explicitly configure MUSB pads
From: Felipe Balbi @ 2011-02-16 10:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297851135-25952-1-git-send-email-gadiyar@ti.com>
On Wed, Feb 16, 2011 at 03:42:15PM +0530, Anand Gadiyar wrote:
> Use the mux framework APIs to explicitly configure
> the MUSB pads. The MUSB controller in OMAP4 can use
> either the old ULPI interface, or the new internal PHY.
> Configure the pads accordingly.
>
> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
applied to musb-next, will send a pull request for Tony by friday.
--
balbi
^ permalink raw reply
* [PATCH V5 12/63] ST SPEAr: Adding support for CLCD on SPEAr3xx/6xx
From: Russell King - ARM Linux @ 2011-02-16 10:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110216095615.GA6504@n2100.arm.linux.org.uk>
On Wed, Feb 16, 2011 at 09:56:15AM +0000, Russell King - ARM Linux wrote:
> On Thu, Jan 20, 2011 at 12:55:51PM +0530, Viresh Kumar wrote:
> > diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> > index d916ac0..bf6632d 100644
> > --- a/drivers/video/Kconfig
> > +++ b/drivers/video/Kconfig
> > @@ -324,10 +324,22 @@ config FB_ARMCLCD
> >
> > choice
> >
> > - depends on FB_ARMCLCD && (ARCH_LH7A40X || ARCH_LH7952X)
> > + depends on FB_ARMCLCD && (ARCH_LH7A40X || ARCH_LH7952X || ARCH_SPEAR6XX || MACH_SPEAR300 || MACH_SPEAR320)
> > prompt "LCD Panel"
> > default FB_ARMCLCD_SHARP_LQ035Q7DB02
> >
> > +config FB_ARMCLCD_SHARP_LQ043T1DG01
> > + bool "SHARP LQ043T1DG01 CLCD 4.2\" TFT(480x272)"
> > + help
> > + This is an implementation of the Sharp LQ043T1DG01, a 4.2"
> > + color TFT panel. The native resolution is 480x272.
> > +
> > +config FB_ARMCLCD_SAMSUNG_LMS700
> > + bool "SAMSUNG CLCD 7\" TFT(800x480)"
> > + help
> > + This is an implementation of the Samsung LMS700, a 7"
> > + color TFT panel. The native resolution is 800x480.
> > +
> > config FB_ARMCLCD_SHARP_LQ035Q7DB02_HRTFT
> > bool "LogicPD LCD 3.5\" QVGA w/HRTFT IC"
> > help
>
> This choice stuff has gone with the removal of the lpd code from the
> kernel, and thus is unmergable. This kind of platform specific
> configuration has no business being in this file anyway.
The other thing is that the handling of BGR/RGB has changed in the
'versatile' branch too, so you may want to delay this patch until
later.
^ permalink raw reply
* [PATCH] omap4: usb: explicitly configure MUSB pads
From: Anand Gadiyar @ 2011-02-16 10:12 UTC (permalink / raw)
To: linux-arm-kernel
Use the mux framework APIs to explicitly configure
the MUSB pads. The MUSB controller in OMAP4 can use
either the old ULPI interface, or the new internal PHY.
Configure the pads accordingly.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
Each of these signals are brought out on exactly one pad,
so there is no conflict.
This patch was developed as part of bringing up the USBTLL
interface on OMAP4. However it's purely OMAP4 specific,
so it should go through Tony.
Applies against linux-next as of today.
arch/arm/mach-omap2/usb-musb.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
Index: linux-omap-usb/arch/arm/mach-omap2/usb-musb.c
===================================================================
--- linux-omap-usb.orig/arch/arm/mach-omap2/usb-musb.c
+++ linux-omap-usb/arch/arm/mach-omap2/usb-musb.c
@@ -31,6 +31,7 @@
#include <mach/am35xx.h>
#include <plat/usb.h>
#include "control.h"
+#include "mux.h"
#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X)
@@ -181,6 +182,43 @@ static struct platform_device musb_devic
.resource = musb_resources,
};
+static void usb_musb_mux_init(struct omap_musb_board_data *board_data)
+{
+ switch (board_data->interface_type) {
+ case MUSB_INTERFACE_UTMI:
+ omap_mux_init_signal("usba0_otg_dp", OMAP_PIN_INPUT);
+ omap_mux_init_signal("usba0_otg_dm", OMAP_PIN_INPUT);
+ break;
+ case MUSB_INTERFACE_ULPI:
+ omap_mux_init_signal("usba0_ulpiphy_clk",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_stp",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dir",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_nxt",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat0",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat1",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat2",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat3",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat4",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat5",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat6",
+ OMAP_PIN_INPUT_PULLDOWN);
+ omap_mux_init_signal("usba0_ulpiphy_dat7",
+ OMAP_PIN_INPUT_PULLDOWN);
+ break;
+ default:
+ break;
+ }
+}
void __init usb_musb_init(struct omap_musb_board_data *board_data)
{
if (cpu_is_omap243x()) {
@@ -199,6 +237,8 @@ void __init usb_musb_init(struct omap_mu
musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE;
musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N;
musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N;
+
+ usb_musb_mux_init(board_data);
}
musb_resources[0].end = musb_resources[0].start + SZ_4K - 1;
^ permalink raw reply
* [PATCH] ARM: errata: pl310 cache sync operation may be faulty
From: Catalin Marinas @ 2011-02-16 10:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110216050842.GB17274@bnru02>
On Wed, 2011-02-16 at 05:08 +0000, Srinidhi KASAGAR wrote:
> On Tue, Feb 15, 2011 at 17:38:52 +0100, Catalin Marinas wrote:
> > On 15 February 2011 11:18, srinidhi kasagar
> > <srinidhi.kasagar@stericsson.com> wrote:
> > > +config ARM_ERRATA_753970
> > > + bool "ARM errata: cache sync operation may be faulty"
> > > + depends on CACHE_PL310
> > > + help
> > > + This option enables the workaround for the 753970 PL310 erratum.
> >
> > Is this number correct? I couldn't find it in ARM's internal database.
>
> yes, we got this errata notice from ARM recently (10-feb-11), document
> revision 12.1
Ah, I found it (I was looking in the wrong place).
Catalin
^ permalink raw reply
* [PATCH V5 00/63] Updating SPEAr Support
From: Russell King - ARM Linux @ 2011-02-16 10:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D58E86E.3040100@st.com>
On Mon, Feb 14, 2011 at 02:01:42PM +0530, viresh kumar wrote:
> On 01/31/2011 02:52 PM, Russell King - ARM Linux wrote:
> >> > Should I push these patches to tracker now ?
> > I've not yet been through them. I only got part way through v4 before you
> > posted v5.
>
> Russell,
>
> Is there any further feedback on this patchset?
No idea, I've still not looked at them. I don't know when I'll be able to
look at them.
^ permalink raw reply
* [PATCH 2/2] ARM i.MX23/28: Add framebuffer device support
From: Sascha Hauer @ 2011-02-16 9:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297850199-1688-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/clock-mx23.c | 2 +-
arch/arm/mach-mxs/clock-mx28.c | 1 +
arch/arm/mach-mxs/devices-mx23.h | 4 ++
arch/arm/mach-mxs/devices-mx28.h | 4 ++
arch/arm/mach-mxs/devices/Kconfig | 4 ++
arch/arm/mach-mxs/devices/Makefile | 1 +
arch/arm/mach-mxs/devices/platform-mxsfb.c | 46 ++++++++++++++++++++++++++++
7 files changed, 61 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-mxs/devices/platform-mxsfb.c
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index ca72a05..bfc7f27 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -446,7 +446,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "hclk", hbus_clk)
_REGISTER_CLOCK(NULL, "usb", usb_clk)
_REGISTER_CLOCK(NULL, "audio", audio_clk)
- _REGISTER_CLOCK(NULL, "pwm", pwm_clk)
+ _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk)
};
static int clk_misc_init(void)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index fd1c4c5..6a7ebcb 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -620,6 +620,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "pwm", pwm_clk)
_REGISTER_CLOCK(NULL, "lradc", lradc_clk)
_REGISTER_CLOCK(NULL, "spdif", spdif_clk)
+ _REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
};
static int clk_misc_init(void)
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
index 1256788..b9745a2 100644
--- a/arch/arm/mach-mxs/devices-mx23.h
+++ b/arch/arm/mach-mxs/devices-mx23.h
@@ -10,7 +10,11 @@
*/
#include <mach/mx23.h>
#include <mach/devices-common.h>
+#include <mach/fb.h>
extern const struct amba_device mx23_duart_device __initconst;
#define mx23_add_duart() \
mxs_add_duart(&mx23_duart_device)
+
+struct platform_device *__init mx23_add_mxsfb(
+ const struct mxsfb_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
index 33773a6..c902dc7 100644
--- a/arch/arm/mach-mxs/devices-mx28.h
+++ b/arch/arm/mach-mxs/devices-mx28.h
@@ -10,6 +10,7 @@
*/
#include <mach/mx28.h>
#include <mach/devices-common.h>
+#include <mach/fb.h>
extern const struct amba_device mx28_duart_device __initconst;
#define mx28_add_duart() \
@@ -18,3 +19,6 @@ extern const struct amba_device mx28_duart_device __initconst;
extern const struct mxs_fec_data mx28_fec_data[] __initconst;
#define mx28_add_fec(id, pdata) \
mxs_add_fec(&mx28_fec_data[id], pdata)
+
+struct platform_device *__init mx28_add_mxsfb(
+ const struct mxsfb_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig
index cf7dc1a..1538cb9 100644
--- a/arch/arm/mach-mxs/devices/Kconfig
+++ b/arch/arm/mach-mxs/devices/Kconfig
@@ -4,3 +4,7 @@ config MXS_HAVE_AMBA_DUART
config MXS_HAVE_PLATFORM_FEC
bool
+
+config MXS_HAVE_PLATFORM_MXSFB
+ bool
+
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
index d0a09f6..0cf8b48 100644
--- a/arch/arm/mach-mxs/devices/Makefile
+++ b/arch/arm/mach-mxs/devices/Makefile
@@ -1,2 +1,3 @@
obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
+obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
diff --git a/arch/arm/mach-mxs/devices/platform-mxsfb.c b/arch/arm/mach-mxs/devices/platform-mxsfb.c
new file mode 100644
index 0000000..632bbdc
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-mxsfb.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
+ *
+ * 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 <asm/sizes.h>
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+#include <mach/fb.h>
+
+#ifdef CONFIG_SOC_IMX23
+struct platform_device *__init mx23_add_mxsfb(
+ const struct mxsfb_platform_data *pdata)
+{
+ struct resource res[] = {
+ {
+ .start = MX23_LCDIF_BASE_ADDR,
+ .end = MX23_LCDIF_BASE_ADDR + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ };
+
+ return mxs_add_platform_device_dmamask("imx23-fb", -1,
+ res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
+}
+#endif /* ifdef CONFIG_SOC_IMX23 */
+
+#ifdef CONFIG_SOC_IMX28
+struct platform_device *__init mx28_add_mxsfb(
+ const struct mxsfb_platform_data *pdata)
+{
+ struct resource res[] = {
+ {
+ .start = MX28_LCDIF_BASE_ADDR,
+ .end = MX28_LCDIF_BASE_ADDR + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ };
+
+ return mxs_add_platform_device_dmamask("imx28-fb", -1,
+ res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
+}
+#endif /* ifdef CONFIG_SOC_IMX28 */
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/2] video: Add i.MX23/28 framebuffer driver
From: Sascha Hauer @ 2011-02-16 9:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297850199-1688-1-git-send-email-s.hauer@pengutronix.de>
changes since v1:
- Add a LCDC_ prefix to the register names.
- use set/clear registers where appropriate
- protect call to mxsfb_disable_controller() in mxsfb_remove()
with a (host->enabled) as suggested by Lothar Wassmann
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-fbdev at vger.kernel.org
Cc: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/include/mach/fb.h | 48 ++
drivers/video/Kconfig | 9 +
drivers/video/Makefile | 1 +
drivers/video/mxsfb.c | 910 +++++++++++++++++++++++++++++++++++
4 files changed, 968 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-mxs/include/mach/fb.h
create mode 100644 drivers/video/mxsfb.c
diff --git a/arch/arm/mach-mxs/include/mach/fb.h b/arch/arm/mach-mxs/include/mach/fb.h
new file mode 100644
index 0000000..923f397
--- /dev/null
+++ b/arch/arm/mach-mxs/include/mach/fb.h
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __MACH_FB_H
+#define __MACH_FB_H
+
+#include <linux/fb.h>
+
+#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
+#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
+#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
+#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
+
+#define FB_SYNC_DATA_ENABLE_HIGH_ACT 64
+
+struct mxsfb_platform_data {
+ struct fb_videomode *mode_list;
+ unsigned mode_count;
+
+ unsigned default_bpp;
+
+ unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
+ unsigned ld_intf_width; /* refer STMLCDIF_* macros */
+
+ unsigned fb_size; /* Size of the video memory. If zero a
+ * default will be used
+ */
+ unsigned long fb_phys; /* physical address for the video memory. If
+ * zero the framebuffer memory will be dynamically
+ * allocated. If specified,fb_size must also be specified.
+ * fb_phys must be unused by Linux.
+ */
+};
+
+#endif /* __MACH_FB_H */
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6bafb51b..e0ea23f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2365,6 +2365,15 @@ config FB_JZ4740
help
Framebuffer support for the JZ4740 SoC.
+config FB_MXS
+ tristate "MXS LCD framebuffer support"
+ depends on FB && ARCH_MXS
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+ help
+ Framebuffer support for the MXS SoC.
+
source "drivers/video/omap/Kconfig"
source "drivers/video/omap2/Kconfig"
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 8c8fabd..9a096ae 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o
obj-$(CONFIG_FB_BFIN_7393) += bfin_adv7393fb.o
obj-$(CONFIG_FB_MX3) += mx3fb.o
obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o
+obj-$(CONFIG_FB_MXS) += mxsfb.o
# the test framebuffer is last
obj-$(CONFIG_FB_VIRTUAL) += vfb.o
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
new file mode 100644
index 0000000..ac9939b
--- /dev/null
+++ b/drivers/video/mxsfb.c
@@ -0,0 +1,910 @@
+/*
+ * Copyright (C) 2010 Juergen Beisert, Pengutronix
+ *
+ * This code is based on:
+ * Author: Vitaly Wool <vital@embeddedalley.com>
+ *
+ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Embedded Alley Solutions, 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.
+ */
+
+#define DRIVER_NAME "mxsfb"
+
+/**
+ * @file
+ * @brief LCDIF driver for i.MX23 and i.MX28
+ *
+ * The LCDIF support four modes of operation
+ * - MPU interface (to drive smart displays) -> not supported yet
+ * - VSYNC interface (like MPU interface plus Vsync) -> not supported yet
+ * - Dotclock interface (to drive LC displays with RGB data and sync signals)
+ * - DVI (to drive ITU-R BT656) -> not supported yet
+ *
+ * This driver depends on a correct setup of the pins used for this purpose
+ * (platform specific).
+ *
+ * For the developer: Don't forget to set the data bus width to the display
+ * in the imx_fb_videomode structure. You will else end up with ugly colours.
+ * If you fight against jitter you can vary the clock delay. This is a feature
+ * of the i.MX28 and you can vary it between 2 ns ... 8 ns in 2 ns steps. Give
+ * the required value in the imx_fb_videomode structure.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
+#include <mach/fb.h>
+#include <mach/hardware.h>
+#include <mach/mxs.h>
+
+#define REG_SET 4
+#define REG_CLR 8
+
+#define LCDC_CTRL 0x00
+#define LCDC_CTRL1 0x10
+#define LCDC_MX28_CTRL2 0x20
+#define LCDC_MX23_TRANSFER_COUNT 0x20
+#define LCDC_MX28_TRANSFER_COUNT 0x30
+#define LCDC_MX28_CUR_BUF 0x40
+#define LCDC_MX28_NEXT_BUF 0x50
+#define LCDC_MX23_CUR_BUF 0x30
+#define LCDC_MX23_NEXT_BUF 0x40
+#define LCDC_TIMING 0x60
+#define LCDC_VDCTRL0 0x70
+#define LCDC_VDCTRL1 0x80
+#define LCDC_VDCTRL2 0x90
+#define LCDC_VDCTRL3 0xa0
+#define LCDC_VDCTRL4 0xb0
+#define LCDC_DVICTRL0 0xc0
+#define LCDC_DVICTRL1 0xd0
+#define LCDC_DVICTRL2 0xe0
+#define LCDC_DVICTRL3 0xf0
+#define LCDC_DVICTRL4 0x100
+#define LCDC_MX28_DATA 0x180
+#define LCDC_MX23_DATA 0x1b0
+#define LCDC_MX28_DEBUG0 0x1d0
+#define LCDC_MX23_DEBUG0 0x1f0
+
+#define CTRL_SFTRST (1 << 31)
+#define CTRL_CLKGATE (1 << 30)
+#define CTRL_BYPASS_COUNT (1 << 19)
+#define CTRL_VSYNC_MODE (1 << 18)
+#define CTRL_DOTCLK_MODE (1 << 17)
+#define CTRL_DATA_SELECT (1 << 16)
+#define CTRL_SET_BUS_WIDTH(x) (((x) & 0x3) << 10)
+#define CTRL_GET_BUS_WIDTH(x) (((x) >> 10) & 0x3)
+#define CTRL_SET_WORD_LENGTH(x) (((x) & 0x3) << 8)
+#define CTRL_GET_WORD_LENGTH(x) (((x) >> 8) & 0x3)
+#define CTRL_MASTER (1 << 5)
+#define CTRL_DF16 (1 << 3)
+#define CTRL_DF18 (1 << 2)
+#define CTRL_DF24 (1 << 1)
+#define CTRL_RUN (1 << 0)
+
+#define CTRL1_FIFO_CLEAR (1 << 21)
+#define CTRL1_SET_BYTE_PACKAGING(x) (((x) & 0xf) << 16)
+#define CTRL1_GET_BYTE_PACKAGING(x) (((x) >> 16) & 0xf)
+
+#define TRANSFER_COUNT_SET_VCOUNT(x) (((x) & 0xffff) << 16)
+#define TRANSFER_COUNT_GET_VCOUNT(x) (((x) >> 16) & 0xffff)
+#define TRANSFER_COUNT_SET_HCOUNT(x) ((x) & 0xffff)
+#define TRANSFER_COUNT_GET_HCOUNT(x) ((x) & 0xffff)
+
+
+#define VDCTRL0_ENABLE_PRESENT (1 << 28)
+#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27)
+#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26)
+#define VDCTRL0_DOTCLK_ACTIVE_HIGH (1 << 25)
+#define VDCTRL0_POL_ACTIVE_HIGH (1 << 24)
+#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21)
+#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20)
+#define VDCTRL0_HALF_LINE (1 << 19)
+#define VDCTRL0_HALF_LINE_MODE (1 << 18)
+#define VDCTRL0_SET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
+#define VDCTRL0_GET_VSYNC_PULSE_WIDTH(x) ((x) & 0x3ffff)
+
+#define VDCTRL2_SET_HSYNC_PERIOD(x) ((x) & 0x3ffff)
+#define VDCTRL2_GET_HSYNC_PERIOD(x) ((x) & 0x3ffff)
+
+#define VDCTRL3_MUX_SYNC_SIGNALS (1 << 29)
+#define VDCTRL3_VSYNC_ONLY (1 << 28)
+#define SET_HOR_WAIT_CNT(x) (((x) & 0xfff) << 16)
+#define GET_HOR_WAIT_CNT(x) (((x) >> 16) & 0xfff)
+#define SET_VERT_WAIT_CNT(x) ((x) & 0xffff)
+#define GET_VERT_WAIT_CNT(x) ((x) & 0xffff)
+
+#define VDCTRL4_SET_DOTCLK_DLY(x) (((x) & 0x7) << 29) /* i.MX28 only */
+#define VDCTRL4_GET_DOTCLK_DLY(x) (((x) >> 29) & 0x7) /* i.MX28 only */
+#define VDCTRL4_SYNC_SIGNALS_ON (1 << 18)
+#define SET_DOTCLK_H_VALID_DATA_CNT(x) ((x) & 0x3ffff)
+
+#define DEBUG0_HSYNC (1 < 26)
+#define DEBUG0_VSYNC (1 < 25)
+
+#define MIN_XRES 120
+#define MIN_YRES 120
+
+#define RED 0
+#define GREEN 1
+#define BLUE 2
+#define TRANSP 3
+
+enum mxsfb_devtype {
+ MXSFB_MX23,
+ MXSFB_MX28,
+};
+
+/* CPU dependent register offsets */
+struct mxsfb_devdata {
+ unsigned transfer_count;
+ unsigned cur_buf;
+ unsigned next_buf;
+ unsigned debug0;
+ unsigned hs_wdth_mask;
+ unsigned hs_wdth_shift;
+};
+
+struct mxsfb_info {
+ struct fb_info fb_info;
+ struct platform_device *pdev;
+ struct clk *clk;
+ void __iomem *base; /* registers */
+ unsigned allocated_size;
+ int enabled;
+ unsigned ld_intf_width;
+ unsigned dotclk_delay;
+ const struct mxsfb_devdata *devdata;
+ int mapped;
+};
+
+static const struct mxsfb_devdata mxsfb_devdata[] = {
+ [MXSFB_MX23] = {
+ .transfer_count = LCDC_MX23_TRANSFER_COUNT,
+ .cur_buf = LCDC_MX23_CUR_BUF,
+ .next_buf = LCDC_MX23_NEXT_BUF,
+ .debug0 = LCDC_MX23_DEBUG0,
+ .hs_wdth_mask = 0xff,
+ .hs_wdth_shift = 24,
+ },
+ [MXSFB_MX28] = {
+ .transfer_count = LCDC_MX28_TRANSFER_COUNT,
+ .cur_buf = LCDC_MX28_CUR_BUF,
+ .next_buf = LCDC_MX28_NEXT_BUF,
+ .debug0 = LCDC_MX28_DEBUG0,
+ .hs_wdth_mask = 0x3fff,
+ .hs_wdth_shift = 18,
+ },
+};
+
+#define to_imxfb_host(x) (container_of(x, struct mxsfb_info, fb_info))
+
+/* mask and shift depends on architecture */
+static inline u32 set_hsync_pulse_width(struct mxsfb_info *host, unsigned val)
+{
+ return (val & host->devdata->hs_wdth_mask) <<
+ host->devdata->hs_wdth_shift;
+}
+
+static inline u32 get_hsync_pulse_width(struct mxsfb_info *host, unsigned val)
+{
+ return (val >> host->devdata->hs_wdth_shift) &
+ host->devdata->hs_wdth_mask;
+}
+
+static const struct fb_bitfield def_rgb565[] = {
+ [RED] = {
+ .offset = 11,
+ .length = 5,
+ },
+ [GREEN] = {
+ .offset = 5,
+ .length = 6,
+ },
+ [BLUE] = {
+ .offset = 0,
+ .length = 5,
+ },
+ [TRANSP] = { /* no support for transparency */
+ .length = 0,
+ }
+};
+
+static const struct fb_bitfield def_rgb666[] = {
+ [RED] = {
+ .offset = 16,
+ .length = 6,
+ },
+ [GREEN] = {
+ .offset = 8,
+ .length = 6,
+ },
+ [BLUE] = {
+ .offset = 0,
+ .length = 6,
+ },
+ [TRANSP] = { /* no support for transparency */
+ .length = 0,
+ }
+};
+
+static const struct fb_bitfield def_rgb888[] = {
+ [RED] = {
+ .offset = 16,
+ .length = 8,
+ },
+ [GREEN] = {
+ .offset = 8,
+ .length = 8,
+ },
+ [BLUE] = {
+ .offset = 0,
+ .length = 8,
+ },
+ [TRANSP] = { /* no support for transparency */
+ .length = 0,
+ }
+};
+
+static inline unsigned chan_to_field(unsigned chan, struct fb_bitfield *bf)
+{
+ chan &= 0xffff;
+ chan >>= 16 - bf->length;
+ return chan << bf->offset;
+}
+
+static int mxsfb_check_var(struct fb_var_screeninfo *var,
+ struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ const struct fb_bitfield *rgb = NULL;
+
+ if (var->xres < MIN_XRES)
+ var->xres = MIN_XRES;
+ if (var->yres < MIN_YRES)
+ var->yres = MIN_YRES;
+
+ var->xres_virtual = var->xres;
+
+ var->yres_virtual = var->yres;
+
+ switch (var->bits_per_pixel) {
+ case 16:
+ /* always expect RGB 565 */
+ rgb = def_rgb565;
+ break;
+ case 32:
+ switch (host->ld_intf_width) {
+ case STMLCDIF_8BIT:
+ pr_debug("Unsupported LCD bus width mapping\n");
+ break;
+ case STMLCDIF_16BIT:
+ case STMLCDIF_18BIT:
+ /* 24 bit to 18 bit mapping */
+ rgb = def_rgb666;
+ break;
+ case STMLCDIF_24BIT:
+ /* real 24 bit */
+ rgb = def_rgb888;
+ break;
+ }
+ break;
+ default:
+ pr_debug("Unsupported colour depth: %u\n", var->bits_per_pixel);
+ return -EINVAL;
+ }
+
+ /*
+ * Copy the RGB parameters for this display
+ * from the machine specific parameters.
+ */
+ var->red = rgb[RED];
+ var->green = rgb[GREEN];
+ var->blue = rgb[BLUE];
+ var->transp = rgb[TRANSP];
+
+ return 0;
+}
+
+static void mxsfb_enable_controller(struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ u32 reg;
+
+ dev_dbg(&host->pdev->dev, "%s\n", __func__);
+
+ clk_enable(host->clk);
+ clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
+
+ /* if it was disabled, re-enable the mode again */
+ writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_SET);
+
+ /* enable the SYNC signals first, then the DMA engine */
+ reg = readl(host->base + LCDC_VDCTRL4);
+ reg |= VDCTRL4_SYNC_SIGNALS_ON;
+ writel(reg, host->base + LCDC_VDCTRL4);
+
+ writel(CTRL_RUN, host->base + LCDC_CTRL + REG_SET);
+
+ host->enabled = 1;
+}
+
+static void mxsfb_disable_controller(struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ unsigned loop;
+ u32 reg;
+
+ dev_dbg(&host->pdev->dev, "%s\n", __func__);
+
+ /*
+ * Even if we disable the controller here, it will still continue
+ * until its FIFOs are running out of data
+ */
+ writel(CTRL_DOTCLK_MODE, host->base + LCDC_CTRL + REG_CLR);
+
+ loop = 1000;
+ while (loop) {
+ reg = readl(host->base + LCDC_CTRL);
+ if (!(reg & CTRL_RUN))
+ break;
+ loop--;
+ }
+
+ writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR);
+
+ clk_disable(host->clk);
+
+ host->enabled = 0;
+}
+
+static int mxsfb_set_par(struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ u32 ctrl, vdctrl0, vdctrl4;
+ int line_size, fb_size;
+ int reenable = 0;
+
+ line_size = fb_info->var.xres * (fb_info->var.bits_per_pixel >> 3);
+ fb_size = fb_info->var.yres_virtual * line_size;
+
+ if (fb_size > fb_info->fix.smem_len)
+ return -ENOMEM;
+
+ fb_info->fix.line_length = line_size;
+
+ /*
+ * It seems, you can't re-program the controller if it is still running.
+ * This may lead into shifted pictures (FIFO issue?).
+ * So, first stop the controller and drain its FIFOs
+ */
+ if (host->enabled) {
+ reenable = 1;
+ mxsfb_disable_controller(fb_info);
+ }
+
+ /* clear the FIFOs */
+ writel(CTRL1_FIFO_CLEAR, host->base + LCDC_CTRL1 + REG_SET);
+
+ ctrl = CTRL_BYPASS_COUNT | CTRL_MASTER |
+ CTRL_SET_BUS_WIDTH(host->ld_intf_width);;
+
+ switch (fb_info->var.bits_per_pixel) {
+ case 16:
+ dev_dbg(&host->pdev->dev, "Setting up RGB565 mode\n");
+ ctrl |= CTRL_SET_WORD_LENGTH(0);
+ writel(CTRL1_SET_BYTE_PACKAGING(0xf), host->base + LCDC_CTRL1);
+ break;
+ case 32:
+ dev_dbg(&host->pdev->dev, "Setting up RGB888/666 mode\n");
+ ctrl |= CTRL_SET_WORD_LENGTH(3);
+ switch (host->ld_intf_width) {
+ case STMLCDIF_8BIT:
+ dev_dbg(&host->pdev->dev,
+ "Unsupported LCD bus width mapping\n");
+ return -EINVAL;
+ case STMLCDIF_16BIT:
+ case STMLCDIF_18BIT:
+ /* 24 bit to 18 bit mapping */
+ ctrl |= CTRL_DF24; /* ignore the upper 2 bits in
+ * each colour component
+ */
+ break;
+ case STMLCDIF_24BIT:
+ /* real 24 bit */
+ break;
+ }
+ /* do not use packed pixels = one pixel per word instead */
+ writel(CTRL1_SET_BYTE_PACKAGING(0x7), host->base + LCDC_CTRL1);
+ break;
+ default:
+ dev_dbg(&host->pdev->dev, "Unhandled color depth of %u\n",
+ fb_info->var.bits_per_pixel);
+ return -EINVAL;
+ }
+
+ writel(ctrl, host->base + LCDC_CTRL);
+
+ writel(TRANSFER_COUNT_SET_VCOUNT(fb_info->var.yres) |
+ TRANSFER_COUNT_SET_HCOUNT(fb_info->var.xres),
+ host->base + host->devdata->transfer_count);
+
+ vdctrl0 = VDCTRL0_ENABLE_PRESENT | /* always in DOTCLOCK mode */
+ VDCTRL0_VSYNC_PERIOD_UNIT |
+ VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
+ VDCTRL0_SET_VSYNC_PULSE_WIDTH(fb_info->var.vsync_len);
+ if (fb_info->var.sync & FB_SYNC_HOR_HIGH_ACT)
+ vdctrl0 |= VDCTRL0_HSYNC_ACT_HIGH;
+ if (fb_info->var.sync & FB_SYNC_VERT_HIGH_ACT)
+ vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
+ if (fb_info->var.sync & FB_SYNC_DATA_ENABLE_HIGH_ACT)
+ vdctrl0 |= VDCTRL0_POL_ACTIVE_HIGH;
+
+ writel(vdctrl0, host->base + LCDC_VDCTRL0);
+
+ /* frame length in lines */
+ writel(fb_info->var.upper_margin + fb_info->var.vsync_len +
+ fb_info->var.lower_margin + fb_info->var.yres,
+ host->base + LCDC_VDCTRL1);
+
+ /* line length in units of clocks or pixels */
+ writel(set_hsync_pulse_width(host, fb_info->var.hsync_len) |
+ VDCTRL2_SET_HSYNC_PERIOD(fb_info->var.left_margin +
+ fb_info->var.hsync_len + fb_info->var.right_margin +
+ fb_info->var.xres),
+ host->base + LCDC_VDCTRL2);
+
+ writel(SET_HOR_WAIT_CNT(fb_info->var.left_margin +
+ fb_info->var.hsync_len) |
+ SET_VERT_WAIT_CNT(fb_info->var.upper_margin +
+ fb_info->var.vsync_len),
+ host->base + LCDC_VDCTRL3);
+
+ vdctrl4 = SET_DOTCLK_H_VALID_DATA_CNT(fb_info->var.xres);
+ if (cpu_is_mx28())
+ vdctrl4 |= VDCTRL4_SET_DOTCLK_DLY(host->dotclk_delay);
+ writel(vdctrl4, host->base + LCDC_VDCTRL4);
+
+ writel(fb_info->fix.smem_start +
+ fb_info->fix.line_length * fb_info->var.yoffset,
+ host->base + host->devdata->next_buf);
+
+ if (reenable)
+ mxsfb_enable_controller(fb_info);
+
+ return 0;
+}
+
+static int mxsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
+ u_int transp, struct fb_info *fb_info)
+{
+ unsigned int val;
+ int ret = -EINVAL;
+
+ /*
+ * If greyscale is true, then we convert the RGB value
+ * to greyscale no matter what visual we are using.
+ */
+ if (fb_info->var.grayscale)
+ red = green = blue = (19595 * red + 38470 * green +
+ 7471 * blue) >> 16;
+
+ switch (fb_info->fix.visual) {
+ case FB_VISUAL_TRUECOLOR:
+ /*
+ * 12 or 16-bit True Colour. We encode the RGB value
+ * according to the RGB bitfield information.
+ */
+ if (regno < 16) {
+ u32 *pal = fb_info->pseudo_palette;
+
+ val = chan_to_field(red, &fb_info->var.red);
+ val |= chan_to_field(green, &fb_info->var.green);
+ val |= chan_to_field(blue, &fb_info->var.blue);
+
+ pal[regno] = val;
+ ret = 0;
+ }
+ break;
+
+ case FB_VISUAL_STATIC_PSEUDOCOLOR:
+ case FB_VISUAL_PSEUDOCOLOR:
+ break;
+ }
+
+ return ret;
+}
+
+static int mxsfb_blank(int blank, struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+
+ switch (blank) {
+ case FB_BLANK_POWERDOWN:
+ case FB_BLANK_VSYNC_SUSPEND:
+ case FB_BLANK_HSYNC_SUSPEND:
+ case FB_BLANK_NORMAL:
+ if (host->enabled)
+ mxsfb_disable_controller(fb_info);
+ break;
+
+ case FB_BLANK_UNBLANK:
+ if (!host->enabled)
+ mxsfb_enable_controller(fb_info);
+ break;
+ }
+ return 0;
+}
+
+static int mxsfb_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *fb_info)
+{
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ unsigned offset;
+
+ if (var->xoffset != 0)
+ return -EINVAL;
+
+ offset = fb_info->fix.line_length * var->yoffset;
+
+ /* update on next VSYNC */
+ writel(fb_info->fix.smem_start + offset,
+ host->base + host->devdata->next_buf);
+
+ return 0;
+}
+
+static struct fb_ops mxsfb_ops = {
+ .owner = THIS_MODULE,
+ .fb_check_var = mxsfb_check_var,
+ .fb_set_par = mxsfb_set_par,
+ .fb_setcolreg = mxsfb_setcolreg,
+ .fb_blank = mxsfb_blank,
+ .fb_pan_display = mxsfb_pan_display,
+ .fb_fillrect = cfb_fillrect,
+ .fb_copyarea = cfb_copyarea,
+ .fb_imageblit = cfb_imageblit,
+};
+
+static int __devinit mxsfb_restore_mode(struct mxsfb_info *host)
+{
+ struct fb_info *fb_info = &host->fb_info;
+ unsigned line_count;
+ unsigned period;
+ unsigned long pa, fbsize;
+ int bits_per_pixel, ofs;
+ u32 transfer_count, vdctrl0, vdctrl2, vdctrl3, vdctrl4, ctrl;
+ struct fb_videomode vmode;
+
+ /* Only restore the mode when the controller is running */
+ ctrl = readl(host->base + LCDC_CTRL);
+ if (!(ctrl & CTRL_RUN))
+ return -EINVAL;
+
+ vdctrl0 = readl(host->base + LCDC_VDCTRL0);
+ vdctrl2 = readl(host->base + LCDC_VDCTRL2);
+ vdctrl3 = readl(host->base + LCDC_VDCTRL3);
+ vdctrl4 = readl(host->base + LCDC_VDCTRL4);
+
+ transfer_count = readl(host->base + host->devdata->transfer_count);
+
+ vmode.xres = TRANSFER_COUNT_GET_HCOUNT(transfer_count);
+ vmode.yres = TRANSFER_COUNT_GET_VCOUNT(transfer_count);
+
+ switch (CTRL_GET_WORD_LENGTH(ctrl)) {
+ case 0:
+ bits_per_pixel = 16;
+ break;
+ case 3:
+ bits_per_pixel = 32;
+ case 1:
+ default:
+ return -EINVAL;
+ }
+
+ fb_info->var.bits_per_pixel = bits_per_pixel;
+
+ vmode.pixclock = KHZ2PICOS(clk_get_rate(host->clk) / 1000U);
+ vmode.hsync_len = get_hsync_pulse_width(host, vdctrl2);
+ vmode.left_margin = GET_HOR_WAIT_CNT(vdctrl3) - vmode.hsync_len;
+ vmode.right_margin = VDCTRL2_GET_HSYNC_PERIOD(vdctrl2) - vmode.hsync_len -
+ vmode.left_margin - vmode.xres;
+ vmode.vsync_len = VDCTRL0_GET_VSYNC_PULSE_WIDTH(vdctrl0);
+ period = readl(host->base + LCDC_VDCTRL1);
+ vmode.upper_margin = GET_VERT_WAIT_CNT(vdctrl3) - vmode.vsync_len;
+ vmode.lower_margin = period - vmode.vsync_len - vmode.upper_margin - vmode.yres;
+
+ vmode.vmode = FB_VMODE_NONINTERLACED;
+
+ vmode.sync = 0;
+ if (vdctrl0 & VDCTRL0_HSYNC_ACT_HIGH)
+ vmode.sync |= FB_SYNC_HOR_HIGH_ACT;
+ if (vdctrl0 & VDCTRL0_VSYNC_ACT_HIGH)
+ vmode.sync |= FB_SYNC_VERT_HIGH_ACT;
+
+ pr_debug("Reconstructed video mode:\n");
+ pr_debug("%dx%d, hsync: %u left: %u, right: %u, vsync: %u, upper: %u, lower: %u\n",
+ vmode.xres, vmode.yres,
+ vmode.hsync_len, vmode.left_margin, vmode.right_margin,
+ vmode.vsync_len, vmode.upper_margin, vmode.lower_margin);
+ pr_debug("pixclk: %ldkHz\n", PICOS2KHZ(vmode.pixclock));
+
+ fb_add_videomode(&vmode, &fb_info->modelist);
+
+ host->ld_intf_width = CTRL_GET_BUS_WIDTH(ctrl);
+ host->dotclk_delay = VDCTRL4_GET_DOTCLK_DLY(vdctrl4);
+
+ fb_info->fix.line_length = vmode.xres * (bits_per_pixel >> 3);
+
+ pa = readl(host->base + host->devdata->cur_buf);
+ fbsize = fb_info->fix.line_length * vmode.yres;
+ if (pa < fb_info->fix.smem_start)
+ return -EINVAL;
+ if (pa + fbsize > fb_info->fix.smem_start + fb_info->fix.smem_len)
+ return -EINVAL;
+ ofs = pa - fb_info->fix.smem_start;
+ if (ofs) {
+ memmove(fb_info->screen_base, fb_info->screen_base + ofs, fbsize);
+ writel(fb_info->fix.smem_start, host->base + host->devdata->next_buf);
+ }
+
+ line_count = fb_info->fix.smem_len / fb_info->fix.line_length;
+ fb_info->fix.ypanstep = 1;
+
+ clk_enable(host->clk);
+ host->enabled = 1;
+
+ return 0;
+}
+
+static int __devinit mxsfb_init_fbinfo(struct mxsfb_info *host)
+{
+ struct fb_info *fb_info = &host->fb_info;
+ struct fb_var_screeninfo *var = &fb_info->var;
+ struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data;
+ dma_addr_t fb_phys;
+ void *fb_virt;
+ unsigned fb_size = pdata->fb_size;
+
+ fb_info->fbops = &mxsfb_ops;
+ fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
+ strlcpy(fb_info->fix.id, "mxs", sizeof(fb_info->fix.id));
+ fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
+ fb_info->fix.ypanstep = 1;
+ fb_info->fix.visual = FB_VISUAL_TRUECOLOR,
+ fb_info->fix.accel = FB_ACCEL_NONE;
+
+ var->bits_per_pixel = pdata->default_bpp ? pdata->default_bpp : 16;
+ var->nonstd = 0;
+ var->activate = FB_ACTIVATE_NOW;
+ var->accel_flags = 0;
+ var->vmode = FB_VMODE_NONINTERLACED;
+
+ host->dotclk_delay = pdata->dotclk_delay;
+ host->ld_intf_width = pdata->ld_intf_width;
+
+ /* Memory allocation for framebuffer */
+ if (pdata->fb_phys) {
+ if (!fb_size)
+ return -EINVAL;
+
+ fb_phys = pdata->fb_phys;
+
+ if (!request_mem_region(fb_phys, fb_size, host->pdev->name))
+ return -ENOMEM;
+
+ fb_virt = ioremap(fb_phys, fb_size);
+ if (!fb_virt) {
+ release_mem_region(fb_phys, fb_size);
+ return -ENOMEM;
+ }
+ host->mapped = 1;
+ } else {
+ if (!fb_size)
+ fb_size = SZ_2M; /* default */
+ fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
+ if (!fb_info->screen_base)
+ return -ENOMEM;
+
+ fb_phys = virt_to_phys(fb_virt);
+ }
+
+ fb_info->fix.smem_start = fb_phys;
+ fb_info->screen_base = fb_virt;
+ fb_info->screen_size = fb_info->fix.smem_len = fb_size;
+
+ if (mxsfb_restore_mode(host))
+ memset(fb_virt, 0, fb_size);
+
+ return 0;
+}
+
+static void __devexit mxsfb_free_videomem(struct mxsfb_info *host)
+{
+ struct fb_info *fb_info = &host->fb_info;
+
+ if (host->mapped) {
+ iounmap(fb_info->screen_base);
+ release_mem_region(fb_info->fix.smem_start,
+ fb_info->screen_size);
+ } else {
+ free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
+ }
+}
+
+static int __devinit mxsfb_probe(struct platform_device *pdev)
+{
+ struct mxsfb_platform_data *pdata = pdev->dev.platform_data;
+ struct resource *res;
+ struct mxsfb_info *host;
+ struct fb_info *fb_info;
+ struct fb_modelist *modelist;
+ int i, ret;
+
+ if (!pdata) {
+ dev_err(&pdev->dev, "No platformdata. Giving up\n");
+ return -ENODEV;
+ }
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&pdev->dev, "Cannot get memory IO resource\n");
+ return -ENODEV;
+ }
+
+ if (!request_mem_region(res->start, resource_size(res), pdev->name))
+ return -EBUSY;
+
+ fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
+ if (!fb_info) {
+ dev_err(&pdev->dev, "Failed to allocate fbdev\n");
+ ret = -ENOMEM;
+ goto error_alloc_info;
+ }
+
+ host = to_imxfb_host(fb_info);
+
+ host->base = ioremap(res->start, resource_size(res));
+ if (!host->base) {
+ dev_err(&pdev->dev, "ioremap failed\n");
+ ret = -ENOMEM;
+ goto error_ioremap;
+ }
+
+ host->pdev = pdev;
+ platform_set_drvdata(pdev, host);
+
+ host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data];
+
+ host->clk = clk_get(&host->pdev->dev, NULL);
+ if (IS_ERR(host->clk)) {
+ ret = PTR_ERR(host->clk);
+ goto error_getclock;
+ }
+
+ fb_info->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL);
+ if (!fb_info->pseudo_palette) {
+ ret = -ENOMEM;
+ goto error_pseudo_pallette;
+ }
+
+ INIT_LIST_HEAD(&fb_info->modelist);
+
+ ret = mxsfb_init_fbinfo(host);
+ if (ret != 0)
+ goto error_init_fb;
+
+ for (i = 0; i < pdata->mode_count; i++)
+ fb_add_videomode(&pdata->mode_list[i], &fb_info->modelist);
+
+ modelist = list_first_entry(&fb_info->modelist,
+ struct fb_modelist, list);
+ fb_videomode_to_var(&fb_info->var, &modelist->mode);
+
+ /* init the color fields */
+ mxsfb_check_var(&fb_info->var, fb_info);
+
+ platform_set_drvdata(pdev, fb_info);
+
+ ret = register_framebuffer(fb_info);
+ if (ret != 0) {
+ dev_err(&pdev->dev,"Failed to register framebuffer\n");
+ goto error_register;
+ }
+
+ if (!host->enabled) {
+ writel(0, host->base + LCDC_CTRL);
+ mxsfb_set_par(fb_info);
+ mxsfb_enable_controller(fb_info);
+ }
+
+ return 0;
+
+error_register:
+ if (host->enabled)
+ clk_disable(host->clk);
+ fb_destroy_modelist(&fb_info->modelist);
+error_init_fb:
+ kfree(fb_info->pseudo_palette);
+error_pseudo_pallette:
+ clk_put(host->clk);
+error_getclock:
+ iounmap(host->base);
+error_ioremap:
+ framebuffer_release(fb_info);
+error_alloc_info:
+ release_mem_region(res->start, resource_size(res));
+
+ return ret;
+}
+
+static int __devexit mxsfb_remove(struct platform_device *pdev)
+{
+ struct fb_info *fb_info = platform_get_drvdata(pdev);
+ struct mxsfb_info *host = to_imxfb_host(fb_info);
+ struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+ if (host->enabled)
+ mxsfb_disable_controller(fb_info);
+
+ unregister_framebuffer(fb_info);
+ kfree(fb_info->pseudo_palette);
+ mxsfb_free_videomem(host);
+ iounmap(host->base);
+ clk_put(host->clk);
+
+ framebuffer_release(fb_info);
+ release_mem_region(res->start, resource_size(res));
+
+ platform_set_drvdata(pdev, NULL);
+
+ return 0;
+}
+
+static struct platform_device_id mxsfb_devtype[] = {
+ {
+ .name = "imx23-fb",
+ .driver_data = MXSFB_MX23,
+ }, {
+ .name = "imx28-fb",
+ .driver_data = MXSFB_MX28,
+ }, {
+ },
+};
+MODULE_DEVICE_TABLE(platform, mxsfb_devtype);
+
+static struct platform_driver mxsfb_driver = {
+ .probe = mxsfb_probe,
+ .remove = __devexit_p(mxsfb_remove),
+ .id_table = mxsfb_devtype,
+ .driver = {
+ .name = DRIVER_NAME,
+ },
+};
+
+static int __init mxsfb_init(void)
+{
+ return platform_driver_register(&mxsfb_driver);
+}
+
+static void __exit mxsfb_exit(void)
+{
+ platform_driver_unregister(&mxsfb_driver);
+}
+
+module_init(mxsfb_init);
+module_exit(mxsfb_exit);
+
+MODULE_DESCRIPTION("Freescale mxs framebuffer driver");
+MODULE_AUTHOR("Sascha Hauer, Pengutronix");
+MODULE_LICENSE("GPL");
--
1.7.2.3
^ permalink raw reply related
* [PATCH v2] i.MX23/28 Framebuffer driver
From: Sascha Hauer @ 2011-02-16 9:56 UTC (permalink / raw)
To: linux-arm-kernel
This is the second version of the i.MX23/28 fb driver with
the changes integrated from the last review.
Sascha Hauer (2):
video: Add i.MX23/28 framebuffer driver
ARM i.MX23/28: Add framebuffer device support
arch/arm/mach-mxs/clock-mx23.c | 2 +-
arch/arm/mach-mxs/clock-mx28.c | 1 +
arch/arm/mach-mxs/devices-mx23.h | 4 +
arch/arm/mach-mxs/devices-mx28.h | 4 +
arch/arm/mach-mxs/devices/Kconfig | 4 +
arch/arm/mach-mxs/devices/Makefile | 1 +
arch/arm/mach-mxs/devices/platform-mxsfb.c | 46 ++
arch/arm/mach-mxs/include/mach/fb.h | 48 ++
drivers/video/Kconfig | 9 +
drivers/video/Makefile | 1 +
drivers/video/mxsfb.c | 910 ++++++++++++++++++++++++++++
11 files changed, 1029 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-mxs/devices/platform-mxsfb.c
create mode 100644 arch/arm/mach-mxs/include/mach/fb.h
create mode 100644 drivers/video/mxsfb.c
^ permalink raw reply
* [PATCH V5 12/63] ST SPEAr: Adding support for CLCD on SPEAr3xx/6xx
From: Russell King - ARM Linux @ 2011-02-16 9:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <9a376f8d8a927e333a36a04e9e40e801dbfe398f.1295499394.git.viresh.kumar@st.com>
On Thu, Jan 20, 2011 at 12:55:51PM +0530, Viresh Kumar wrote:
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index d916ac0..bf6632d 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -324,10 +324,22 @@ config FB_ARMCLCD
>
> choice
>
> - depends on FB_ARMCLCD && (ARCH_LH7A40X || ARCH_LH7952X)
> + depends on FB_ARMCLCD && (ARCH_LH7A40X || ARCH_LH7952X || ARCH_SPEAR6XX || MACH_SPEAR300 || MACH_SPEAR320)
> prompt "LCD Panel"
> default FB_ARMCLCD_SHARP_LQ035Q7DB02
>
> +config FB_ARMCLCD_SHARP_LQ043T1DG01
> + bool "SHARP LQ043T1DG01 CLCD 4.2\" TFT(480x272)"
> + help
> + This is an implementation of the Sharp LQ043T1DG01, a 4.2"
> + color TFT panel. The native resolution is 480x272.
> +
> +config FB_ARMCLCD_SAMSUNG_LMS700
> + bool "SAMSUNG CLCD 7\" TFT(800x480)"
> + help
> + This is an implementation of the Samsung LMS700, a 7"
> + color TFT panel. The native resolution is 800x480.
> +
> config FB_ARMCLCD_SHARP_LQ035Q7DB02_HRTFT
> bool "LogicPD LCD 3.5\" QVGA w/HRTFT IC"
> help
This choice stuff has gone with the removal of the lpd code from the
kernel, and thus is unmergable. This kind of platform specific
configuration has no business being in this file anyway.
^ permalink raw reply
* [PATCH 16/17] mc13xxx: mfd_cell is now implicitly available to drivers
From: Uwe Kleine-König @ 2011-02-16 9:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110211181921.3d561568@queued.net>
On Fri, Feb 11, 2011 at 06:19:21PM -0800, Andres Salomon wrote:
>
> The cell's platform_data is now accessed with a helper function;
> change clients to use that, and remove the now-unused data_size.
>
> Note that mfd-core no longer makes a copy of platform_data, but the
why was this changed and where? I'm not able to find your complete
series via gmane.
> mc13xxx-core driver creates the pdata structures on the stack. In
> order to get around that, the various ARM mach types that set the
> pdata have been changed to hold the variable in static (global) memory.
> Also note that __initdata references in aforementioned pdata structs
> have been dropped.
>
> Signed-off-by: Andres Salomon <dilinger@queued.net>
> ---
> arch/arm/mach-imx/mach-mx27_3ds.c | 6 +++++-
> arch/arm/mach-imx/mach-pcm038.c | 6 +++++-
> arch/arm/mach-mx3/mach-mx31_3ds.c | 6 +++++-
> arch/arm/mach-mx3/mach-mx31moboard.c | 6 +++++-
> drivers/leds/leds-mc13783.c | 6 +++---
> drivers/mfd/mc13xxx-core.c | 18 +++++-------------
> drivers/regulator/mc13783-regulator.c | 6 ++----
> drivers/regulator/mc13892-regulator.c | 6 ++----
> include/linux/mfd/mc13xxx.h | 3 +--
> 9 files changed, 33 insertions(+), 30 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
> index 1643315..f223371 100644
> --- a/arch/arm/mach-imx/mach-mx27_3ds.c
> +++ b/arch/arm/mach-imx/mach-mx27_3ds.c
> @@ -227,9 +227,13 @@ static struct mc13783_regulator_init_data mx27_3ds_regulators[] = {
> };
>
> /* MC13783 */
> -static struct mc13783_platform_data mc13783_pdata __initdata = {
isn't using __initdata here broken already before your patch? Was
introduced in c67a3e09. Fabio?
But in general I'd prefer to keep as much __initdata as possible because
this occupies less memory when using a multi-machine kernel.
> diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
> index a1d391b..052b133 100644
> --- a/include/linux/mfd/mc13xxx.h
> +++ b/include/linux/mfd/mc13xxx.h
> @@ -146,8 +146,7 @@ struct mc13xxx_platform_data {
> #define MC13XXX_USE_LED (1 << 5)
> unsigned int flags;
>
> - int num_regulators;
> - struct mc13xxx_regulator_init_data *regulators;
> + struct mc13xxx_regulator_platform_data *regulators;
> struct mc13xxx_leds_platform_data *leds;
> };
... so I'd prefer to embed a struct mc13xxx_regulator_platform_data into
mc13xxx_platform_data, not a pointer to it. This makes initialisation a
bit easier, too.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for iclks, OMAP2xxx
From: Rajendra Nayak @ 2011-02-16 9:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110216065030.22089.61217.stgit@twilight.localdomain>
Hi Paul,
> -----Original Message-----
> From: linux-arm-kernel-bounces at lists.infradead.org
[mailto:linux-arm-kernel-bounces at lists.infradead.org] On Behalf
> Of Paul Walmsley
> Sent: Wednesday, February 16, 2011 12:23 PM
> To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
> Subject: [PATCH 00/11] OMAP2+: clock: add clockfw autoidle for iclks,
OMAP2xxx
>
> Hello,
>
> This patch series adds clock framework-controlled autoidle support for
> the OMAP2xxx DPLL, APLLs, and OMAP2/3 interface clocks. The old
> direct register writes in the PM code to enable clock autoidle have been
> removed.
>
> This series also ensures that all clock autoidle is disabled during
> boot and only re-enabled if CONFIG_PM is enabled.
This does not seem to be the case. Maybe something like the
below patch is what is missing..
---
^ permalink raw reply
* [PATCH] OMAP2+: PM: Enable all clk autoidle only if CONFIG_PM
From: Rajendra Nayak @ 2011-02-16 9:26 UTC (permalink / raw)
To: linux-arm-kernel
Autoidle for all clocks is disabled during clock
framework initialization.
Enable them here (late in the boot process) only
if CONFIG_PM is enabled.
While here, also update the comment to remove
the TODO's which are already addressed.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/pm.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index b507702..f888986 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -262,13 +262,14 @@ static int __init omap2_common_pm_late_init(void)
/* Smartreflex device init */
omap_devinit_smartreflex();
+#ifdef CONFIG_PM
/*
- * Set all OMAP3/4 DPLLs to autoidle.
- * XXX TODO: Add all the iclk autoidles in here as well,
- * the OMAP2 DPLL, the OMAP2 APLLs, and the AUTOEXTCLKMODE
- * control here too.
+ * Set all OMAP2/3/4 DPLLs to autoidle.
+ * Set OMAP2 APLLs, and the AUTOEXTCLKMODE to autoidle.
+ * Set all the iclk autoidle,
*/
omap_clk_enable_autoidle_all();
+#endif
return 0;
}
--
1.7.0.4
--0016368e29f72cfb64049c6308f9
Content-Type: application/octet-stream;
name="0001-OMAP2-PM-Enable-all-clk-autoidle-only-if-CONFIG_PM.patch"
Content-Disposition: attachment;
filename="0001-OMAP2-PM-Enable-all-clk-autoidle-only-if-CONFIG_PM.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: cae10b18c864105_0.1
RnJvbSA1NzJiZjk1Y2Y0YWEzZDNhMWM3MzI1NGY2N2UyN2U2MmYxMDhmNGUxIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBSYWplbmRyYSBOYXlhayA8cm5heWFrQHRpLmNvbT4KRGF0ZTog
V2VkLCAxNiBGZWIgMjAxMSAxNDo1NjozNSArMDUzMApTdWJqZWN0OiBbUEFUQ0hdIE9NQVAyKzog
UE06IEVuYWJsZSBhbGwgY2xrIGF1dG9pZGxlIG9ubHkgaWYgQ09ORklHX1BNCgpBdXRvaWRsZSBm
b3IgYWxsIGNsb2NrcyBpcyBkaXNhYmxlZCBkdXJpbmcgY2xvY2sKZnJhbWV3b3JrIGluaXRpYWxp
emF0aW9uLgpFbmFibGUgdGhlbSBoZXJlIChsYXRlIGluIHRoZSBib290IHByb2Nlc3MpIG9ubHkK
aWYgQ09ORklHX1BNIGlzIGVuYWJsZWQuCgpXaGlsZSBoZXJlLCBhbHNvIHVwZGF0ZSB0aGUgY29t
bWVudCB0byByZW1vdmUKdGhlIFRPRE8ncyB3aGljaCBhcmUgYWxyZWFkeSBhZGRyZXNzZWQuCgpT
aWduZWQtb2ZmLWJ5OiBSYWplbmRyYSBOYXlhayA8cm5heWFrQHRpLmNvbT4KLS0tCiBhcmNoL2Fy
bS9tYWNoLW9tYXAyL3BtLmMgfCAgICA5ICsrKysrLS0tLQogMSBmaWxlcyBjaGFuZ2VkLCA1IGlu
c2VydGlvbnMoKyksIDQgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvYXJjaC9hcm0vbWFjaC1v
bWFwMi9wbS5jIGIvYXJjaC9hcm0vbWFjaC1vbWFwMi9wbS5jCmluZGV4IGI1MDc3MDIuLmY4ODg5
ODYgMTAwNjQ0Ci0tLSBhL2FyY2gvYXJtL21hY2gtb21hcDIvcG0uYworKysgYi9hcmNoL2FybS9t
YWNoLW9tYXAyL3BtLmMKQEAgLTI2MiwxMyArMjYyLDE0IEBAIHN0YXRpYyBpbnQgX19pbml0IG9t
YXAyX2NvbW1vbl9wbV9sYXRlX2luaXQodm9pZCkKIAkvKiBTbWFydHJlZmxleCBkZXZpY2UgaW5p
dCAqLwogCW9tYXBfZGV2aW5pdF9zbWFydHJlZmxleCgpOwogCisjaWZkZWYgQ09ORklHX1BNCiAJ
LyoKLQkgKiBTZXQgYWxsIE9NQVAzLzQgRFBMTHMgdG8gYXV0b2lkbGUuCi0JICogWFhYIFRPRE86
IEFkZCBhbGwgdGhlIGljbGsgYXV0b2lkbGVzIGluIGhlcmUgYXMgd2VsbCwKLQkgKiB0aGUgT01B
UDIgRFBMTCwgdGhlIE9NQVAyIEFQTExzLCBhbmQgdGhlIEFVVE9FWFRDTEtNT0RFCi0JICogY29u
dHJvbCBoZXJlIHRvby4KKwkgKiBTZXQgYWxsIE9NQVAyLzMvNCBEUExMcyB0byBhdXRvaWRsZS4K
KwkgKiBTZXQgT01BUDIgQVBMTHMsIGFuZCB0aGUgQVVUT0VYVENMS01PREUgdG8gYXV0b2lkbGUu
CisJICogU2V0IGFsbCB0aGUgaWNsayBhdXRvaWRsZSwKIAkgKi8KIAlvbWFwX2Nsa19lbmFibGVf
YXV0b2lkbGVfYWxsKCk7CisjZW5kaWYKIAogCXJldHVybiAwOwogfQotLSAKMS43LjAuNAoK
--0016368e29f72cfb64049c6308f9--
^ permalink raw reply related
* [PATCH] ARM: Thumb-2: Enable ARM/Thumb interworking for v7 cache maintenance
From: Dave Martin @ 2011-02-16 9:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110215180058.GS4152@n2100.arm.linux.org.uk>
On Tue, Feb 15, 2011 at 6:00 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Feb 15, 2011 at 05:56:05PM +0000, Dave Martin wrote:
>> Cache maintenence functions may need to be called from low-level
>> platform code (such as for omap3).
>
> I'd rather wait until we have the suspend stuff sorted out. ?I'm
> waiting for OMAP folk to sort out what's happening with the sleep*.S
> code so that it can have the generic CPU suspend code integrated.
> That could result in this change not being required.
>
OK; I guess we can work around this in the omap BSP for the time being.
---Dave
^ permalink raw reply
* [PATCH v2 1/2] ARM: IMX5: cpuidle driver
From: Yong Shen @ 2011-02-16 9:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110216091326.GD26437@pengutronix.de>
On Wed, Feb 16, 2011 at 10:13 AM, Sascha Hauer <s.hauer@pengutronix.de>wrote:
> On Wed, Feb 16, 2011 at 09:37:47AM +0100, Yong Shen wrote:
> > Hi Sascha,
> >
> >
> > > > + local_irq_disable();
> > > > + do_gettimeofday(&before);
> > > > +
> > > > + plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
> > > > + ~(MXC_CORTEXA8_PLAT_LPC_DSM);
> > >
> > > One thing that strikes me here is the fact that this code can probably
> > > run on i.MX53 aswell, right? It's only that these registers have
> > > different addresses on i.MX53. The MXC_ prefix is therefore not a good
> > > idea. Switching this to MX51_ and having an additional MX53_ register
> > > leads to code duplication. This shows that it's a bad idea to code
> > > fixed addresses in the code. We should go for base + offset instead
> > > so that this code will have a better start on i.MX53. This of course
> > > needs changes in the current crm_regs.h and probably in the i.MX51/53
> > > clock code.
> > >
> > Yes, for mx53, it is similar.
> > But for the case you are talking about, is it easier that we keep MXC_
> > prefix in this file and define MXC_ to MX51 or MX53 in crm_regs.h
> according
> > to which board is running?
>
> I don't understand. How can we 'define' (which is compile time) to
> something depending on the board (which is runtime)?
I ignored the goal is one image running on multiple SOCs.
>
> > In addition, registers for this code are not in one section, which means
> > many BASEx + offset there, if I understand right. Do you have a sample
> for
> > 'base + offset' case? since mx53 just came in, I am not sure about such
> > case.
>
> Forget it. I just realized that more or less by accident the virtual
> addresses for the i.MX51 and i.MX53 are the same.
>
So, the conclusion is: still using MXC_ prefix in this period. right?
Correct me.
Yong
>
> Sascha
>
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110216/1d858dad/attachment-0001.html>
^ permalink raw reply
* compiling 2.6.37 kernel in THUMB2 mode
From: Dave Martin @ 2011-02-16 9:19 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTinQzK=s_r+_uaNRkq4MTPcF4zVE2aHPx5cqwYAN@mail.gmail.com>
On Wed, Feb 16, 2011 at 9:17 AM, Dave Martin <dave.martin@linaro.org> wrote:
> Hi,
>
> On Wed, Feb 16, 2011 at 4:03 AM, Nicolas Pitre <nico@fluxnic.net> wrote:
>> On Tue, 15 Feb 2011, vb at vsbe.com wrote:
>>
>>> hello all,
>>>
>>> I am trying to compile the 2.6.37 kernel in THUMB2 mode and am
>>> experiencing some compilation problems. Some inline assembly in some
>>> files uses commands inappropriate for THUMB2 mode.
>>>
>>> I wonder if the kernel is expected to compile cleanly when
>>> CONFIG_THUMB2_KERNEL is enabled (and I am doing something wrong), or
>>> is it know not to compile/work in Thumb2 node for any reason?
>>
>> It is known not to compile in mainline right now depending on your
>> target, but fixes are slowly being merged upstream.
>>
>> Dave Martin is maintaining a Git tree with all the fixes required for
>> Thumb2 here (see the Thumb2 related branches):
>>
>> http://git.linaro.org/gitweb?p=people/dmart/linux-2.6-arm.git;a=summary
>>
>> Beware that some patches might not be final yet.
>
> Note that while the bulk of the kernel is Thumb-2 safe, there are
> occasional regressions, and individual platforms and drivers could
> still have problems. ?For now, I've been focusing on omap--- see
>
> git://git.linaro.org/people/dmart/linux-2.6-arm.git dirty/arm/omap-thumb2+merged
>
> ARM: Add local symbols in relocate_kernel.S to work around gas bugs
^ Oops, forgot to explain that line: this is the patch required to
work around a specific bug in the assembler. I'm not currently
proposing to merge this upstream, since I prefer the assembler to get
fixed...
You can grab this patch from the branch.
>
> If you're trying to support a specific board I'm unlikely to be able
> to debug it for you, but feel free to ping me with questions.
>
> Cheers
> ---Dave
>
^ permalink raw reply
* compiling 2.6.37 kernel in THUMB2 mode
From: Dave Martin @ 2011-02-16 9:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.LFD.2.00.1102152257500.14920@xanadu.home>
Hi,
On Wed, Feb 16, 2011 at 4:03 AM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Tue, 15 Feb 2011, vb at vsbe.com wrote:
>
>> hello all,
>>
>> I am trying to compile the 2.6.37 kernel in THUMB2 mode and am
>> experiencing some compilation problems. Some inline assembly in some
>> files uses commands inappropriate for THUMB2 mode.
>>
>> I wonder if the kernel is expected to compile cleanly when
>> CONFIG_THUMB2_KERNEL is enabled (and I am doing something wrong), or
>> is it know not to compile/work in Thumb2 node for any reason?
>
> It is known not to compile in mainline right now depending on your
> target, but fixes are slowly being merged upstream.
>
> Dave Martin is maintaining a Git tree with all the fixes required for
> Thumb2 here (see the Thumb2 related branches):
>
> http://git.linaro.org/gitweb?p=people/dmart/linux-2.6-arm.git;a=summary
>
> Beware that some patches might not be final yet.
Note that while the bulk of the kernel is Thumb-2 safe, there are
occasional regressions, and individual platforms and drivers could
still have problems. For now, I've been focusing on omap--- see
git://git.linaro.org/people/dmart/linux-2.6-arm.git dirty/arm/omap-thumb2+merged
ARM: Add local symbols in relocate_kernel.S to work around gas bugs
If you're trying to support a specific board I'm unlikely to be able
to debug it for you, but feel free to ping me with questions.
Cheers
---Dave
^ permalink raw reply
* [PATCH v2 1/2] ARM: IMX5: cpuidle driver
From: Sascha Hauer @ 2011-02-16 9:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTinj_8wqZ36TKdcx3L6CLaYyLD36ymFRq+KnyZXF@mail.gmail.com>
On Wed, Feb 16, 2011 at 09:37:47AM +0100, Yong Shen wrote:
> Hi Sascha,
>
>
> > > + local_irq_disable();
> > > + do_gettimeofday(&before);
> > > +
> > > + plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
> > > + ~(MXC_CORTEXA8_PLAT_LPC_DSM);
> >
> > One thing that strikes me here is the fact that this code can probably
> > run on i.MX53 aswell, right? It's only that these registers have
> > different addresses on i.MX53. The MXC_ prefix is therefore not a good
> > idea. Switching this to MX51_ and having an additional MX53_ register
> > leads to code duplication. This shows that it's a bad idea to code
> > fixed addresses in the code. We should go for base + offset instead
> > so that this code will have a better start on i.MX53. This of course
> > needs changes in the current crm_regs.h and probably in the i.MX51/53
> > clock code.
> >
> Yes, for mx53, it is similar.
> But for the case you are talking about, is it easier that we keep MXC_
> prefix in this file and define MXC_ to MX51 or MX53 in crm_regs.h according
> to which board is running?
I don't understand. How can we 'define' (which is compile time) to
something depending on the board (which is runtime)?
> In addition, registers for this code are not in one section, which means
> many BASEx + offset there, if I understand right. Do you have a sample for
> 'base + offset' case? since mx53 just came in, I am not sure about such
> case.
Forget it. I just realized that more or less by accident the virtual
addresses for the i.MX51 and i.MX53 are the same.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* newbie question: location of frame buffer driver for imx27
From: Jürgen Lambrecht @ 2011-02-16 8:58 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
we have the Freescale IMX27-PDK demo kit. Along with it, we got the
source code for the linux kernel version 2.6.22, and a lot of patches.
Also for the video part, there are a lot of patches, creating a
/drivers/video/mxc subdirectory.
In the linux sources 2.6.37, I only find 2 files: mx3fb.c (imx3x i
guess) and imxfb.c.
When we try to compile linux for the imx27 (with the latest ltib) there
are no framebuffers under devices.
Do I still need to patch linux/drivers/video for the imx27, or should it
work fine like it is?
(and if so, what do I do wrong ;-)
Kind regards,
Juergen
--
J?rgen Lambrecht
R&D Associate
Tel: +32 (0)51 303045 Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk
^ permalink raw reply
* platform data and mfd design question
From: Linus Walleij @ 2011-02-16 8:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D5AF554.2030208@codeaurora.org>
On 02/15/2011 10:51 PM, Abhijeet Dharmapurikar wrote:
> Msm on the other hand declares the struct mfd_cell subdevice[] array in
> the board file and passes this on to the core driver via platfom data.
>
This way the platform data tells the core driver what kind of
silicon it has "hey, PM8058, guess what, you have an RTC!"
which looks backwards to me, especially given that it does
not need any fancy platform data at all, just two IRQ numbers
which the core driver can very well handle.
For example: if the platform data (which is about how the
components are connected on the board etc) does not
provide the RTC resource, all of a sudden it appears to the
system as if the PM8058 does not have an RTC, but it does...
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH] spi/pl022: rid dangling labels
From: Linus Walleij @ 2011-02-16 8:40 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
Remove a compilation error regarding unused labels that came about
when simplifying the DMA code.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/spi/amba-pl022.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index 4cd05cc..14a451b 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -1030,8 +1030,6 @@ static int configure_dma(struct pl022 *pl022)
return 0;
-err_submit_tx:
-err_submit_rx:
err_txdesc:
dmaengine_terminate_all(txchan);
err_rxdesc:
--
1.7.3.2
^ permalink raw reply related
* [PATCH 1/9] mfd-core: rename platform_data field of mfd_cell to mfd_data
From: Linus Walleij @ 2011-02-16 8:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297808729-21110-2-git-send-email-dilinger@queued.net>
On 02/15/2011 11:25 PM, Andres Salomon wrote:
> Rename the platform_data variable to imply a distinction between
> common platform_data driver usage (typically accessed via
> pdev->dev.platform_data) and the way MFD passes data down to
> clients (using a wrapper named mfd_get_data).
>
> All clients have already been changed to use the wrapper function,
> so this can be a quick single-commit change that only touches things
> in drivers/mfd.
>
> Signed-off-by: Andres Salomon<dilinger@queued.net>
>
Thanks, I like easy-to-read code.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH v2 1/2] ARM: IMX5: cpuidle driver
From: Yong Shen @ 2011-02-16 8:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110216081103.GE2027@pengutronix.de>
Hi Sascha,
> > + local_irq_disable();
> > + do_gettimeofday(&before);
> > +
> > + plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
> > + ~(MXC_CORTEXA8_PLAT_LPC_DSM);
>
> One thing that strikes me here is the fact that this code can probably
> run on i.MX53 aswell, right? It's only that these registers have
> different addresses on i.MX53. The MXC_ prefix is therefore not a good
> idea. Switching this to MX51_ and having an additional MX53_ register
> leads to code duplication. This shows that it's a bad idea to code
> fixed addresses in the code. We should go for base + offset instead
> so that this code will have a better start on i.MX53. This of course
> needs changes in the current crm_regs.h and probably in the i.MX51/53
> clock code.
>
Yes, for mx53, it is similar.
But for the case you are talking about, is it easier that we keep MXC_
prefix in this file and define MXC_ to MX51 or MX53 in crm_regs.h according
to which board is running?
In addition, registers for this code are not in one section, which means
many BASEx + offset there, if I understand right. Do you have a sample for
'base + offset' case? since mx53 just came in, I am not sure about such
case.
yong
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110216/a8359ff2/attachment-0001.html>
^ permalink raw reply
* [PATCH v2 1/2] ARM: IMX5: cpuidle driver
From: Sascha Hauer @ 2011-02-16 8:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297416973-32740-2-git-send-email-yong.shen@linaro.org>
On Fri, Feb 11, 2011 at 10:36:12AM +0100, yong.shen at linaro.org wrote:
> From: Yong Shen <yong.shen@freescale.com>
>
> implement cpuidle driver for iMX5 SOCs, leave cpuidle params to board
> related code.
>
> Signed-off-by: Yong Shen <yong.shen@freescale.com>
> ---
> arch/arm/mach-mx5/Makefile | 1 +
> arch/arm/mach-mx5/cpuidle.c | 113 +++++++++++++++++++++++++++++++++++++++++++
> arch/arm/mach-mx5/cpuidle.h | 26 ++++++++++
> 3 files changed, 140 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mx5/cpuidle.c
> create mode 100644 arch/arm/mach-mx5/cpuidle.h
>
> diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
> index 0d43be9..12239e0 100644
> --- a/arch/arm/mach-mx5/Makefile
> +++ b/arch/arm/mach-mx5/Makefile
> @@ -7,6 +7,7 @@ obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
> obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
>
> obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
> +obj-$(CONFIG_CPU_IDLE) += cpuidle.o
> obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
> obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
> obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
> diff --git a/arch/arm/mach-mx5/cpuidle.c b/arch/arm/mach-mx5/cpuidle.c
> new file mode 100644
> index 0000000..9d77c47
> --- /dev/null
> +++ b/arch/arm/mach-mx5/cpuidle.c
> @@ -0,0 +1,113 @@
> +/*
> + * arch/arm/mach-mx5/cpuidle.c
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/io.h>
> +#include <linux/cpuidle.h>
> +#include <asm/proc-fns.h>
> +#include <mach/hardware.h>
> +#include "cpuidle.h"
> +#include "crm_regs.h"
> +
> +static struct imx_cpuidle_params *imx_cpuidle_params;
> +void imx_cpuidle_board_params(struct imx_cpuidle_params *cpuidle_params)
> +{
> + imx_cpuidle_params = cpuidle_params;
> +}
> +
> +extern int tzic_enable_wake(int is_idle);
> +static int imx_enter_idle(struct cpuidle_device *dev,
> + struct cpuidle_state *state)
> +{
> + struct timeval before, after;
> + int idle_time;
> + u32 plat_lpc, arm_srpgcr, ccm_clpcr;
> + u32 empgc0, empgc1;
> +
> + local_irq_disable();
> + do_gettimeofday(&before);
> +
> + plat_lpc = __raw_readl(MXC_CORTEXA8_PLAT_LPC) &
> + ~(MXC_CORTEXA8_PLAT_LPC_DSM);
One thing that strikes me here is the fact that this code can probably
run on i.MX53 aswell, right? It's only that these registers have
different addresses on i.MX53. The MXC_ prefix is therefore not a good
idea. Switching this to MX51_ and having an additional MX53_ register
leads to code duplication. This shows that it's a bad idea to code
fixed addresses in the code. We should go for base + offset instead
so that this code will have a better start on i.MX53. This of course
needs changes in the current crm_regs.h and probably in the i.MX51/53
clock code.
> + ccm_clpcr = __raw_readl(MXC_CCM_CLPCR) & ~(MXC_CCM_CLPCR_LPM_MASK);
> + arm_srpgcr = __raw_readl(MXC_SRPG_ARM_SRPGCR) & ~(MXC_SRPGCR_PCR);
> + empgc0 = __raw_readl(MXC_SRPG_EMPGC0_SRPGCR) & ~(MXC_SRPGCR_PCR);
> + empgc1 = __raw_readl(MXC_SRPG_EMPGC1_SRPGCR) & ~(MXC_SRPGCR_PCR);
> +
> + if (state == &dev->states[WAIT_CLK_ON])
> + ;
> + else if (state == &dev->states[WAIT_CLK_OFF])
> + ccm_clpcr |= (0x1 << MXC_CCM_CLPCR_LPM_OFFSET);
> + else if (state == &dev->states[WAIT_CLK_OFF_POWER_OFF]) {
> + /* Wait unclocked, power off */
> + plat_lpc |= MXC_CORTEXA8_PLAT_LPC_DSM
> + | MXC_CORTEXA8_PLAT_LPC_DBG_DSM;
> + arm_srpgcr |= MXC_SRPGCR_PCR;
> + ccm_clpcr |= (0x1 << MXC_CCM_CLPCR_LPM_OFFSET);
> + ccm_clpcr &= ~MXC_CCM_CLPCR_VSTBY;
> + ccm_clpcr &= ~MXC_CCM_CLPCR_SBYOS;
> + if (tzic_enable_wake(1) != 0) {
> + local_irq_enable();
> + return 0;
> + }
> + }
> +
> + __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
> + __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
> + __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
> +
> + cpu_do_idle();
> +
> + do_gettimeofday(&after);
> + local_irq_enable();
> + idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
> + (after.tv_usec - before.tv_usec);
> + return idle_time;
> +}
> +
> +static struct cpuidle_driver imx_cpuidle_driver = {
> + .name = "imx_idle",
> + .owner = THIS_MODULE,
> +};
> +
> +static DEFINE_PER_CPU(struct cpuidle_device, imx_cpuidle_device);
> +
> +static int __init imx_cpuidle_init(void)
> +{
> + struct cpuidle_device *device;
> + int i;
> +
> + if (imx_cpuidle_params == NULL)
> + return -ENODEV;
> +
> + cpuidle_register_driver(&imx_cpuidle_driver);
> +
> + device = &per_cpu(imx_cpuidle_device, smp_processor_id());
> + device->state_count = IMX_MAX_CPUIDLE_STATE;
> +
> + for (i = 0; i < IMX_MAX_CPUIDLE_STATE && i < CPUIDLE_STATE_MAX; i++) {
> + device->states[i].enter = imx_enter_idle;
> + device->states[i].exit_latency = imx_cpuidle_params[i].latency;
> + device->states[i].flags = CPUIDLE_FLAG_TIME_VALID;
> + }
> +
> + strcpy(device->states[WAIT_CLK_ON].name, "WFI 0");
> + strcpy(device->states[WAIT_CLK_ON].desc, "Wait with clock on");
> + strcpy(device->states[WAIT_CLK_OFF].name, "WFI 1");
> + strcpy(device->states[WAIT_CLK_OFF].desc, "Wait with clock off");
> + strcpy(device->states[WAIT_CLK_OFF_POWER_OFF].name, "WFI 2");
> + strcpy(device->states[WAIT_CLK_OFF_POWER_OFF].desc,
> + "Wait with clock off and power gating");
> +
> + if (cpuidle_register_device(device)) {
> + printk(KERN_ERR "imx_cpuidle_init: Failed registering\n");
> + return -ENODEV;
> + }
> + return 0;
> +}
> +
> +late_initcall(imx_cpuidle_init);
> diff --git a/arch/arm/mach-mx5/cpuidle.h b/arch/arm/mach-mx5/cpuidle.h
> new file mode 100644
> index 0000000..e5ba495
> --- /dev/null
> +++ b/arch/arm/mach-mx5/cpuidle.h
> @@ -0,0 +1,26 @@
> +/*
> + * arch/arm/mach-mx5/cpuidle.h
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +enum {
> + WAIT_CLK_ON, /* c1 */
> + WAIT_CLK_OFF, /* c2 */
> + WAIT_CLK_OFF_POWER_OFF, /* c3 */
> + IMX_MAX_CPUIDLE_STATE,
> +};
> +
> +struct imx_cpuidle_params {
> + unsigned int latency;
> +};
> +
> +#ifdef CONFIG_CPU_IDLE
> +extern void imx_cpuidle_board_params(struct imx_cpuidle_params *cpuidle_params);
> +#else
> +inline void imx_cpuidle_board_params(struct imx_cpuidle_params *cpuidle_params)
> +{}
> +#endif
> +
> --
> 1.7.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* [PATCH 3/3] mach-ux500: basic HREFv60 support
From: Linus Walleij @ 2011-02-16 8:07 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
The HREFv60 variant of the MOP500 family of boards remove the
external GPIO expander and route these pins back to some of the
readily available internal GPIO pins instead.
Based on a patch by Bibek Basu <bibek.basu@stericsson.com> for
an internal kernel version.
Cc: Bibek Basu <bibek.basu@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/mach-ux500/board-mop500-sdi.c | 34 +++++++++++++++++++-----
arch/arm/mach-ux500/board-mop500-stuib.c | 12 +++++++-
arch/arm/mach-ux500/board-mop500.c | 23 ++++++++++++++--
arch/arm/mach-ux500/board-mop500.h | 14 +++++++++-
arch/arm/mach-ux500/include/mach/uncompress.h | 6 +++-
5 files changed, 75 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 68c8375..70a486f 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -12,6 +12,7 @@
#include <linux/mmc/host.h>
#include <linux/platform_device.h>
+#include <asm/mach-types.h>
#include <plat/ste_dma40.h>
#include <mach/devices.h>
#include <mach/hardware.h>
@@ -68,7 +69,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
.ocr_mask = MMC_VDD_29_30,
.f_max = 100000000,
.capabilities = MMC_CAP_4_BIT_DATA,
- .gpio_cd = GPIO_SDMMC_CD,
.gpio_wp = -1,
#ifdef CONFIG_STE_DMA40
.dma_filter = stedma40_filter,
@@ -77,20 +77,36 @@ static struct mmci_platform_data mop500_sdi0_data = {
#endif
};
+/* GPIO pins used by the sdi0 level shifter */
+static int sdi0_en;
+static int sdi0_vsel;
+
void mop500_sdi_tc35892_init(void)
{
int ret;
- ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN");
+ if (machine_is_hrefv60()) {
+ sdi0_en = HREFV60_SDMMC_EN_GPIO;
+ sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
+ } else {
+ sdi0_en = GPIO_SDMMC_EN;
+ sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
+ }
+ ret = gpio_request(sdi0_en, "level shifter enable");
if (!ret)
- ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL,
- "GPIO_SDMMC_1V8_3V_SEL");
- if (ret)
+ ret = gpio_request(sdi0_vsel,
+ "level shifter 1v8-3v select");
+
+ if (ret) {
+ pr_warning("unable to config sdi0 gpios for level shifter.\n");
return;
+ }
- gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 0);
- gpio_direction_output(GPIO_SDMMC_EN, 1);
+ /* Select the default 2.9V and enable level shifter */
+ gpio_direction_output(sdi0_vsel, 0);
+ gpio_direction_output(sdi0_en, 1);
+ /* Add the device */
db8500_add_sdi0(&mop500_sdi0_data);
}
@@ -179,6 +195,10 @@ void __init mop500_sdi_init(void)
/* On-board eMMC */
db8500_add_sdi4(&mop500_sdi4_data);
+ if (machine_is_hrefv60())
+ mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
+ else
+ mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
/*
* sdi0 will finally be added when the TC35892 initializes and calls
* mop500_sdi_tc35892_init() above.
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 8b6323e..8c97977 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -12,6 +12,7 @@
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/input/matrix_keypad.h>
+#include <asm/mach-types.h>
#include "board-mop500.h"
@@ -154,7 +155,6 @@ static struct bu21013_platform_device tsc_plat_device = {
.cs_dis = bu21013_gpio_board_exit,
.irq_read_val = bu21013_read_pin_val,
.irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
- .cs_pin = GPIO_BU21013_CS,
.touch_x_max = TOUCH_XMAX,
.touch_y_max = TOUCH_YMAX,
.ext_clk = false,
@@ -167,7 +167,6 @@ static struct bu21013_platform_device tsc_plat2_device = {
.cs_dis = bu21013_gpio_board_exit,
.irq_read_val = bu21013_read_pin_val,
.irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
- .cs_pin = GPIO_BU21013_CS,
.touch_x_max = TOUCH_XMAX,
.touch_y_max = TOUCH_YMAX,
.ext_clk = false,
@@ -189,6 +188,15 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
void __init mop500_stuib_init(void)
{
+ if (machine_is_hrefv60()) {
+ tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
+ tsc_plat2_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
+ } else {
+ tsc_plat_device.cs_pin = GPIO_BU21013_CS;
+ tsc_plat2_device.cs_pin = GPIO_BU21013_CS;
+
+ }
+
mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib,
ARRAY_SIZE(mop500_i2c0_devices_stuib));
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 72448e1..8790d98 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -202,7 +202,6 @@ static struct gpio_keys_button mop500_gpio_keys[] = {
.desc = "SFH7741 Proximity Sensor",
.type = EV_SW,
.code = SW_FRONT_PROXIMITY,
- .gpio = GPIO_PROX_SENSOR,
.active_low = 0,
.can_disable = 1,
}
@@ -379,8 +378,18 @@ static void __init mop500_uart_init(void)
db8500_add_uart2(&uart2_plat);
}
-static void __init u8500_init_machine(void)
+static void __init mop500_init_machine(void)
{
+ /*
+ * The HREFv60 board removed a GPIO expander and routed
+ * all these GPIO pins to the internal GPIO controller
+ * instead.
+ */
+ if (machine_is_hrefv60())
+ mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
+ else
+ mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
+
u8500_init_devices();
mop500_pins_init();
@@ -407,5 +416,13 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
.init_irq = ux500_init_irq,
/* we re-use nomadik timer here */
.timer = &ux500_timer,
- .init_machine = u8500_init_machine,
+ .init_machine = mop500_init_machine,
+MACHINE_END
+
+MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
+ .boot_params = 0x100,
+ .map_io = u8500_map_io,
+ .init_irq = ux500_init_irq,
+ .timer = &ux500_timer,
+ .init_machine = mop500_init_machine,
MACHINE_END
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index 48abca7..56722f4 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,9 +7,21 @@
#ifndef __BOARD_MOP500_H
#define __BOARD_MOP500_H
-#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x))
+/* HREFv60-specific GPIO assignments, this board has no GPIO expander */
+#define HREFV60_TOUCH_RST_GPIO 143
+#define HREFV60_PROX_SENSE_GPIO 217
+#define HREFV60_HAL_SW_GPIO 145
+#define HREFV60_SDMMC_EN_GPIO 169
+#define HREFV60_SDMMC_1V8_3V_GPIO 5
+#define HREFV60_SDMMC_CD_GPIO 95
+#define HREFV60_ACCEL_INT1_GPIO 82
+#define HREFV60_ACCEL_INT2_GPIO 83
+#define HREFV60_MAGNET_DRDY_GPIO 32
+#define HREFV60_DISP1_RST_GPIO 65
+#define HREFV60_DISP2_RST_GPIO 66
/* GPIOs on the TC35892 expander */
+#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x))
#define GPIO_SDMMC_CD MOP500_EGPIO(3)
#define GPIO_PROX_SENSOR MOP500_EGPIO(7)
#define GPIO_BU21013_CS MOP500_EGPIO(13)
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 9a6614c..ab0fe14 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -50,7 +50,11 @@ static void flush(void)
static inline void arch_decomp_setup(void)
{
- if (machine_is_u8500())
+ /* Check in run time if we run on an U8500 or U5500 */
+ if (machine_is_u8500() ||
+ machine_is_svp8500v1() ||
+ machine_is_svp8500v2() ||
+ machine_is_hrefv60())
ux500_uart_base = U8500_UART2_BASE;
else if (machine_is_u5500())
ux500_uart_base = U5500_UART0_BASE;
--
1.7.3.2
^ permalink raw reply related
* [PATCH 2/3] mach-ux500: add hrefv60 GPIO pins
From: Linus Walleij @ 2011-02-16 8:07 UTC (permalink / raw)
To: linux-arm-kernel
From: Bibek Basu <bibek.basu@stericsson.com>
This will centralize all GPIO pin muxing for the different boards
in the MOP500 family to a single file. It also kills off the
deprecated support for the ED (Early Drop) ASIC, this should
never be spotted in the open and ST-Ericsson have internally
deprecated this hardware.
Signed-off-by: Bibek Basu <bibek.basu@stericsson.com>
[Rebasing and kill old ASIC support]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/mach-ux500/board-mop500-pins.c | 225 ++++++++++++++++++++++++++-----
arch/arm/mach-ux500/board-mop500-sdi.c | 65 +--------
2 files changed, 200 insertions(+), 90 deletions(-)
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index edd3a6b..fd4cf1c 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -8,19 +8,13 @@
#include <linux/init.h>
#include <linux/gpio.h>
+#include <asm/mach-types.h>
#include <plat/pincfg.h>
-
#include <mach/hardware.h>
#include "pins-db8500.h"
-static pin_cfg_t mop500_pins[] = {
- /* SSP0 */
- GPIO143_SSP0_CLK,
- GPIO144_SSP0_FRM,
- GPIO145_SSP0_RXD,
- GPIO146_SSP0_TXD,
-
+static pin_cfg_t mop500_pins_common[] = {
/* I2C */
GPIO147_I2C0_SCL,
GPIO148_I2C0_SDA,
@@ -31,6 +25,72 @@ static pin_cfg_t mop500_pins[] = {
GPIO229_I2C3_SDA,
GPIO230_I2C3_SCL,
+ /* MSP0 */
+ GPIO12_MSP0_TXD,
+ GPIO13_MSP0_TFS,
+ GPIO14_MSP0_TCK,
+ GPIO15_MSP0_RXD,
+
+ /* MSP2: HDMI */
+ GPIO193_MSP2_TXD,
+ GPIO194_MSP2_TCK,
+ GPIO195_MSP2_TFS,
+ GPIO196_MSP2_RXD | PIN_OUTPUT_LOW,
+
+ /* Touch screen INTERFACE */
+ GPIO84_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT1 */
+
+ /* STMPE1601/tc35893 keypad IRQ */
+ GPIO218_GPIO | PIN_INPUT_PULLUP,
+
+ /* MMC0 (MicroSD card) */
+ GPIO18_MC0_CMDDIR | PIN_OUTPUT_HIGH,
+ GPIO19_MC0_DAT0DIR | PIN_OUTPUT_HIGH,
+ GPIO20_MC0_DAT2DIR | PIN_OUTPUT_HIGH,
+
+ GPIO22_MC0_FBCLK | PIN_INPUT_NOPULL,
+ GPIO23_MC0_CLK | PIN_OUTPUT_LOW,
+ GPIO24_MC0_CMD | PIN_INPUT_PULLUP,
+ GPIO25_MC0_DAT0 | PIN_INPUT_PULLUP,
+ GPIO26_MC0_DAT1 | PIN_INPUT_PULLUP,
+ GPIO27_MC0_DAT2 | PIN_INPUT_PULLUP,
+ GPIO28_MC0_DAT3 | PIN_INPUT_PULLUP,
+
+ /* SDI1 (SDIO) */
+ GPIO208_MC1_CLK | PIN_OUTPUT_LOW,
+ GPIO209_MC1_FBCLK | PIN_INPUT_NOPULL,
+ GPIO210_MC1_CMD | PIN_INPUT_PULLUP,
+ GPIO211_MC1_DAT0 | PIN_INPUT_PULLUP,
+ GPIO212_MC1_DAT1 | PIN_INPUT_PULLUP,
+ GPIO213_MC1_DAT2 | PIN_INPUT_PULLUP,
+ GPIO214_MC1_DAT3 | PIN_INPUT_PULLUP,
+
+ /* MMC2 (On-board DATA INTERFACE eMMC) */
+ GPIO128_MC2_CLK | PIN_OUTPUT_LOW,
+ GPIO129_MC2_CMD | PIN_INPUT_PULLUP,
+ GPIO130_MC2_FBCLK | PIN_INPUT_NOPULL,
+ GPIO131_MC2_DAT0 | PIN_INPUT_PULLUP,
+ GPIO132_MC2_DAT1 | PIN_INPUT_PULLUP,
+ GPIO133_MC2_DAT2 | PIN_INPUT_PULLUP,
+ GPIO134_MC2_DAT3 | PIN_INPUT_PULLUP,
+ GPIO135_MC2_DAT4 | PIN_INPUT_PULLUP,
+ GPIO136_MC2_DAT5 | PIN_INPUT_PULLUP,
+ GPIO137_MC2_DAT6 | PIN_INPUT_PULLUP,
+ GPIO138_MC2_DAT7 | PIN_INPUT_PULLUP,
+
+ /* MMC4 (On-board STORAGE INTERFACE eMMC) */
+ GPIO197_MC4_DAT3 | PIN_INPUT_PULLUP,
+ GPIO198_MC4_DAT2 | PIN_INPUT_PULLUP,
+ GPIO199_MC4_DAT1 | PIN_INPUT_PULLUP,
+ GPIO200_MC4_DAT0 | PIN_INPUT_PULLUP,
+ GPIO201_MC4_CMD | PIN_INPUT_PULLUP,
+ GPIO202_MC4_FBCLK | PIN_INPUT_NOPULL,
+ GPIO203_MC4_CLK | PIN_OUTPUT_LOW,
+ GPIO204_MC4_DAT7 | PIN_INPUT_PULLUP,
+ GPIO205_MC4_DAT6 | PIN_INPUT_PULLUP,
+ GPIO206_MC4_DAT5 | PIN_INPUT_PULLUP,
+ GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP,
+
/* SKE keypad */
GPIO153_KP_I7,
GPIO154_KP_I6,
@@ -49,32 +109,133 @@ static pin_cfg_t mop500_pins[] = {
GPIO167_KP_O1,
GPIO168_KP_O0,
- /* GPIO_EXP_INT */
- GPIO217_GPIO,
-
- /* STMPE1601 IRQ */
- GPIO218_GPIO | PIN_INPUT_PULLUP,
-
- /* touch screen */
- GPIO84_GPIO | PIN_INPUT_PULLUP,
-
- /* USB OTG */
- GPIO256_USB_NXT | PIN_PULL_DOWN,
- GPIO257_USB_STP | PIN_PULL_UP,
- GPIO258_USB_XCLK | PIN_PULL_DOWN,
- GPIO259_USB_DIR | PIN_PULL_DOWN,
- GPIO260_USB_DAT7 | PIN_PULL_DOWN,
- GPIO261_USB_DAT6 | PIN_PULL_DOWN,
- GPIO262_USB_DAT5 | PIN_PULL_DOWN,
- GPIO263_USB_DAT4 | PIN_PULL_DOWN,
- GPIO264_USB_DAT3 | PIN_PULL_DOWN,
- GPIO265_USB_DAT2 | PIN_PULL_DOWN,
- GPIO266_USB_DAT1 | PIN_PULL_DOWN,
- GPIO267_USB_DAT0 | PIN_PULL_DOWN,
+ /* UART */
+ GPIO0_U0_CTSn | PIN_INPUT_PULLUP,
+ GPIO1_U0_RTSn | PIN_OUTPUT_HIGH,
+ GPIO2_U0_RXD | PIN_INPUT_PULLUP,
+ GPIO3_U0_TXD | PIN_OUTPUT_HIGH,
+
+ GPIO29_U2_RXD | PIN_INPUT_PULLUP,
+ GPIO30_U2_TXD | PIN_OUTPUT_HIGH,
+ GPIO31_U2_CTSn | PIN_INPUT_PULLUP,
+ GPIO32_U2_RTSn | PIN_OUTPUT_HIGH,
+
+ /* Display & HDMI HW sync */
+ GPIO68_LCD_VSI0 | PIN_INPUT_PULLUP,
+ GPIO69_LCD_VSI1 | PIN_INPUT_PULLUP,
+};
+
+static pin_cfg_t mop500_pins_default[] = {
+ /* SSP0 */
+ GPIO143_SSP0_CLK,
+ GPIO144_SSP0_FRM,
+ GPIO145_SSP0_RXD | PIN_PULL_DOWN,
+ GPIO146_SSP0_TXD,
+
+
+ GPIO217_GPIO | PIN_INPUT_PULLUP, /* TC35892 IRQ */
+
+ /* SDI0 (MicroSD card) */
+ GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH,
+
+ /* UART */
+ GPIO4_U1_RXD | PIN_INPUT_PULLUP,
+ GPIO5_U1_TXD | PIN_OUTPUT_HIGH,
+ GPIO6_U1_CTSn | PIN_INPUT_PULLUP,
+ GPIO7_U1_RTSn | PIN_OUTPUT_HIGH,
+};
+
+static pin_cfg_t mop500_pins_hrefv60[] = {
+ /* WLAN */
+ GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
+ GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
+
+ /* XENON Flashgun INTERFACE */
+ GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */
+ GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */
+ GPIO170_GPIO | PIN_OUTPUT_LOW, /* XENON_CHARGE */
+
+ /* Assistant LED INTERFACE */
+ GPIO21_GPIO | PIN_OUTPUT_LOW, /* XENON_EN1 */
+ GPIO64_IP_GPIO4 | PIN_OUTPUT_LOW, /* XENON_EN2 */
+
+ /* Magnetometer */
+ GPIO31_GPIO | PIN_INPUT_PULLUP, /* magnetometer_INT */
+ GPIO32_GPIO | PIN_INPUT_PULLDOWN, /* Magnetometer DRDY */
+
+ /* Display Interface */
+ GPIO65_GPIO | PIN_OUTPUT_LOW, /* DISP1 RST */
+ GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */
+
+ /* Touch screen INTERFACE */
+ GPIO143_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST1 */
+
+ /* Touch screen INTERFACE 2 */
+ GPIO67_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT2 */
+ GPIO146_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST2 */
+
+ /* ETM_PTM_TRACE INTERFACE */
+ GPIO70_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA23 */
+ GPIO71_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA22 */
+ GPIO72_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA21 */
+ GPIO73_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA20 */
+ GPIO74_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA19 */
+
+ /* NAHJ INTERFACE */
+ GPIO76_GPIO | PIN_OUTPUT_LOW,/* NAHJ_CTRL */
+ GPIO216_GPIO | PIN_OUTPUT_HIGH,/* NAHJ_CTRL_INV */
+
+ /* NFC INTERFACE */
+ GPIO77_GPIO | PIN_OUTPUT_LOW, /* NFC_ENA */
+ GPIO144_GPIO | PIN_INPUT_PULLDOWN, /* NFC_IRQ */
+ GPIO142_GPIO | PIN_OUTPUT_LOW, /* NFC_RESET */
+
+ /* Keyboard MATRIX INTERFACE */
+ GPIO90_MC5_CMD | PIN_OUTPUT_LOW, /* KP_O_1 */
+ GPIO87_MC5_DAT1 | PIN_OUTPUT_LOW, /* KP_O_2 */
+ GPIO86_MC5_DAT0 | PIN_OUTPUT_LOW, /* KP_O_3 */
+ GPIO96_KP_O6 | PIN_OUTPUT_LOW, /* KP_O_6 */
+ GPIO94_KP_O7 | PIN_OUTPUT_LOW, /* KP_O_7 */
+ GPIO93_MC5_DAT4 | PIN_INPUT_PULLUP, /* KP_I_0 */
+ GPIO89_MC5_DAT3 | PIN_INPUT_PULLUP, /* KP_I_2 */
+ GPIO88_MC5_DAT2 | PIN_INPUT_PULLUP, /* KP_I_3 */
+ GPIO91_GPIO | PIN_INPUT_PULLUP, /* FORCE_SENSING_INT */
+ GPIO92_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_RST */
+ GPIO97_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_WU */
+
+ /* DiPro Sensor Interface */
+ GPIO139_GPIO | PIN_INPUT_PULLUP, /* DIPRO_INT */
+
+ /* HAL SWITCH INTERFACE */
+ GPIO145_GPIO | PIN_INPUT_PULLDOWN,/* HAL_SW */
+
+ /* Audio Amplifier Interface */
+ GPIO149_GPIO | PIN_OUTPUT_LOW, /* VAUDIO_HF_EN */
+
+ /* GBF INTERFACE */
+ GPIO171_GPIO | PIN_OUTPUT_LOW, /* GBF_ENA_RESET */
+
+ /* MSP : HDTV INTERFACE */
+ GPIO192_GPIO | PIN_INPUT_PULLDOWN,
+
+ /* ACCELEROMETER_INTERFACE */
+ GPIO82_GPIO | PIN_INPUT_PULLUP, /* ACC_INT1 */
+ GPIO83_GPIO | PIN_INPUT_PULLUP, /* ACC_INT2 */
+
+ /* Proximity Sensor */
+ GPIO217_GPIO | PIN_INPUT_PULLUP,
+
+
};
void __init mop500_pins_init(void)
{
- nmk_config_pins(mop500_pins,
- ARRAY_SIZE(mop500_pins));
+ nmk_config_pins(mop500_pins_common,
+ ARRAY_SIZE(mop500_pins_common));
+ if (machine_is_hrefv60())
+ nmk_config_pins(mop500_pins_hrefv60,
+ ARRAY_SIZE(mop500_pins_hrefv60));
+ else
+ nmk_config_pins(mop500_pins_default,
+ ARRAY_SIZE(mop500_pins_default));
}
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index d1ae6a0..68c8375 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -12,59 +12,14 @@
#include <linux/mmc/host.h>
#include <linux/platform_device.h>
-#include <plat/pincfg.h>
#include <plat/ste_dma40.h>
#include <mach/devices.h>
#include <mach/hardware.h>
#include "devices-db8500.h"
-#include "pins-db8500.h"
#include "board-mop500.h"
#include "ste-dma40-db8500.h"
-static pin_cfg_t mop500_sdi_pins[] = {
- /* SDI0 (MicroSD slot) */
- GPIO18_MC0_CMDDIR,
- GPIO19_MC0_DAT0DIR,
- GPIO20_MC0_DAT2DIR,
- GPIO21_MC0_DAT31DIR,
- GPIO22_MC0_FBCLK,
- GPIO23_MC0_CLK,
- GPIO24_MC0_CMD,
- GPIO25_MC0_DAT0,
- GPIO26_MC0_DAT1,
- GPIO27_MC0_DAT2,
- GPIO28_MC0_DAT3,
-
- /* SDI4 (on-board eMMC) */
- GPIO197_MC4_DAT3,
- GPIO198_MC4_DAT2,
- GPIO199_MC4_DAT1,
- GPIO200_MC4_DAT0,
- GPIO201_MC4_CMD,
- GPIO202_MC4_FBCLK,
- GPIO203_MC4_CLK,
- GPIO204_MC4_DAT7,
- GPIO205_MC4_DAT6,
- GPIO206_MC4_DAT5,
- GPIO207_MC4_DAT4,
-};
-
-static pin_cfg_t mop500_sdi2_pins[] = {
- /* SDI2 (POP eMMC) */
- GPIO128_MC2_CLK,
- GPIO129_MC2_CMD,
- GPIO130_MC2_FBCLK,
- GPIO131_MC2_DAT0,
- GPIO132_MC2_DAT1,
- GPIO133_MC2_DAT2,
- GPIO134_MC2_DAT3,
- GPIO135_MC2_DAT4,
- GPIO136_MC2_DAT5,
- GPIO137_MC2_DAT6,
- GPIO138_MC2_DAT7,
-};
-
/*
* SDI 0 (MicroSD slot)
*/
@@ -216,22 +171,16 @@ static struct mmci_platform_data mop500_sdi4_data = {
void __init mop500_sdi_init(void)
{
- nmk_config_pins(mop500_sdi_pins, ARRAY_SIZE(mop500_sdi_pins));
+ /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
+ if (!cpu_is_u8500v10())
+ mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
+ db8500_add_sdi2(&mop500_sdi2_data);
+
+ /* On-board eMMC */
+ db8500_add_sdi4(&mop500_sdi4_data);
/*
* sdi0 will finally be added when the TC35892 initializes and calls
* mop500_sdi_tc35892_init() above.
*/
-
- /* PoP:ed eMMC */
- if (!cpu_is_u8500ed()) {
- nmk_config_pins(mop500_sdi2_pins, ARRAY_SIZE(mop500_sdi2_pins));
- /* POP eMMC on v1.0 has problems with high speed */
- if (!cpu_is_u8500v10())
- mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
- db8500_add_sdi2(&mop500_sdi2_data);
- }
-
- /* On-board eMMC */
- db8500_add_sdi4(&mop500_sdi4_data);
}
--
1.7.3.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox