* [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Sascha Hauer @ 2011-01-14 8:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294989894-20780-1-git-send-email-shawn.guo@freescale.com>
On Fri, Jan 14, 2011 at 03:24:54PM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> ---
> arch/arm/mach-mxs/Kconfig | 4 ++
> arch/arm/mach-mxs/Makefile | 3 +
> arch/arm/mach-mxs/include/mach/common.h | 1 +
> arch/arm/mach-mxs/ocotp.c | 90 +++++++++++++++++++++++++++++++
> 4 files changed, 98 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mxs/ocotp.c
>
> diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
> index 8bfc8df..cd2fbdf 100644
> --- a/arch/arm/mach-mxs/Kconfig
> +++ b/arch/arm/mach-mxs/Kconfig
> @@ -2,6 +2,9 @@ if ARCH_MXS
>
> source "arch/arm/mach-mxs/devices/Kconfig"
>
> +config MXS_OCOTP
> + bool
> +
> config SOC_IMX23
> bool
> select CPU_ARM926T
> @@ -26,6 +29,7 @@ config MACH_MX28EVK
> select SOC_IMX28
> select MXS_HAVE_AMBA_DUART
> select MXS_HAVE_PLATFORM_FEC
> + select MXS_OCOTP
> default y
> help
> Include support for MX28EVK platform. This includes specific
> diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
> index 39d3f9c..623899b 100644
> --- a/arch/arm/mach-mxs/Makefile
> +++ b/arch/arm/mach-mxs/Makefile
> @@ -1,6 +1,9 @@
> # Common support
> obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
>
> +obj-$(CONFIG_PM) += pm.o
> +obj-$(CONFIG_MXS_OCOTP) += ocotp.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..635bb5d 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 const u32 *mxs_get_ocotp(void);
> 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..eb2eab7
> --- /dev/null
> +++ b/arch/arm/mach-mxs/ocotp.c
> @@ -0,0 +1,90 @@
> +/*
> + * 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 OCOTP_WORD_OFFSET 0x20
> +#define OCOTP_WORD_COUNT 0x20
> +
> +#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);
> +static u32 ocotp_words[OCOTP_WORD_COUNT];
> +
> +const u32 *mxs_get_ocotp(void)
> +{
> + void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
> + int timeout = 0x400;
> + size_t i;
> + static int once = 0;
> +
> + if (once)
> + return ocotp_words;
> +
> + 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);
> +
> + /* check both BUSY and ERROR cleared */
> + while ((__raw_readl(ocotp_base) &
> + (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
> + cpu_relax();
> +
> + 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();
> +
> + if (unlikely(!timeout))
> + goto error_unlock;
> +
> + for (i = 0; i < OCOTP_WORD_COUNT; i++)
> + ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
> + i * 0x10);
> +
> + /* close banks for power saving */
> + __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
> +
> + mutex_unlock(&ocotp_mutex);
> +
> + once = 1;
> +
> + return ocotp_words;
> +
> +error_unlock:
> + mutex_unlock(&ocotp_mutex);
> + pr_err("%s: timeout in reading OCOTP\n", __func__);
> + return NULL;
> +}
EXPORT_SYMBOL?
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
* [PATCH] ARM: mxs: pass fec device name via platform data
From: Uwe Kleine-König @ 2011-01-14 8:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294988000-20232-1-git-send-email-shawn.guo@freescale.com>
On Fri, Jan 14, 2011 at 02:53:20PM +0800, Shawn Guo wrote:
> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> ---
> arch/arm/mach-mxs/devices/platform-fec.c | 11 ++++++-----
> arch/arm/mach-mxs/include/mach/devices-common.h | 1 +
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
> index c42dff7..75eb26b 100644
> --- a/arch/arm/mach-mxs/devices/platform-fec.c
> +++ b/arch/arm/mach-mxs/devices/platform-fec.c
> @@ -10,20 +10,21 @@
> #include <mach/mx28.h>
> #include <mach/devices-common.h>
>
> -#define mxs_fec_data_entry_single(soc, _id) \
> +#define mxs_fec_data_entry_single(soc, _devid, _id) \
> { \
> + .devid = _devid, \
> .id = _id, \
> .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \
> .irq = soc ## _INT_ENET_MAC ## _id, \
> }
>
> -#define mxs_fec_data_entry(soc, _id) \
> - [_id] = mxs_fec_data_entry_single(soc, _id)
> +#define mxs_fec_data_entry(soc, _devid, _id) \
> + [_id] = mxs_fec_data_entry_single(soc, _devid, _id)
>
> #ifdef CONFIG_SOC_IMX28
> const struct mxs_fec_data mx28_fec_data[] __initconst = {
> #define mx28_fec_data_entry(_id) \
> - mxs_fec_data_entry(MX28, _id)
> + mxs_fec_data_entry(MX28, "imx28-fec", _id)
> mx28_fec_data_entry(0),
> mx28_fec_data_entry(1),
> };
> @@ -45,6 +46,6 @@ struct platform_device *__init mxs_add_fec(
> },
> };
>
> - return mxs_add_platform_device("imx28-fec", data->id,
> + return mxs_add_platform_device(data->devid, data->id,
> res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
> }
> diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
> index 6c3d1a1..10fbcfd 100644
> --- a/arch/arm/mach-mxs/include/mach/devices-common.h
> +++ b/arch/arm/mach-mxs/include/mach/devices-common.h
> @@ -33,6 +33,7 @@ int __init mxs_add_duart(const struct amba_device *dev);
> /* fec */
> #include <linux/fec.h>
> struct mxs_fec_data {
> + const char *devid;
> int id;
> resource_size_t iobase;
> resource_size_t iosize;
> --
> 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. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH] mm/init.c: fix compilation warning
From: Russell King - ARM Linux @ 2011-01-14 8:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294989051-830-1-git-send-email-viresh.kumar@st.com>
On Fri, Jan 14, 2011 at 12:40:51PM +0530, Viresh Kumar wrote:
> This patch fixes following warning:
> mm/init.c:606: warning: format '%08lx' expects type 'long unsigned int', but
> argument 12 has type 'unsigned int'
The problem is in your definition of VMALLOC_END. It should be typed
unsigned long - so have a UL suffix on the number.
^ permalink raw reply
* [PATCH] Introduce VPR200 board.
From: Uwe Kleine-König @ 2011-01-14 8:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294962532-15790-2-git-send-email-marc@cpdesign.com.au>
Hi Marc,
On Fri, Jan 14, 2011 at 10:48:52AM +1100, Marc Reilly wrote:
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
> arch/arm/mach-mx3/Kconfig | 15 ++
> arch/arm/mach-mx3/Makefile | 1 +
> arch/arm/mach-mx3/mach-vpr200.c | 404 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 420 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-mx3/mach-vpr200.c
>
> diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
> index 0717f88..ca63c35 100644
> --- a/arch/arm/mach-mx3/Kconfig
> +++ b/arch/arm/mach-mx3/Kconfig
> @@ -229,4 +229,19 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
>
> endchoice
>
> +config MACH_VPR200
> + bool "Support VPR200 platform"
> + select SOC_IMX35
> + select IMX_HAVE_PLATFORM_FSL_USB2_UDC
> + select IMX_HAVE_PLATFORM_IMX2_WDT
> + select IMX_HAVE_PLATFORM_IMX_UART
> + select IMX_HAVE_PLATFORM_IMX_I2C
> + select IMX_HAVE_PLATFORM_MXC_EHCI
> + select IMX_HAVE_PLATFORM_MXC_NAND
> + select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
> + select IMX_HAVE_PLATFORM_MXC_PWM
> + help
> + Include support for VPR200 platform. This includes specific
> + configurations for the board and its peripherals.
> +
> endif
> diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
> index 8db1329..bc7294f 100644
> --- a/arch/arm/mach-mx3/Makefile
> +++ b/arch/arm/mach-mx3/Makefile
> @@ -22,3 +22,4 @@ obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
> obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o
> obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o
> obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd-baseboard.o
> +obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
> diff --git a/arch/arm/mach-mx3/mach-vpr200.c b/arch/arm/mach-mx3/mach-vpr200.c
> new file mode 100644
> index 0000000..a4f0514
> --- /dev/null
> +++ b/arch/arm/mach-mx3/mach-vpr200.c
> @@ -0,0 +1,404 @@
> +/*
> + * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
> + * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix
> + * Copyright 2010 Creative Product Design
> + *
> + * Derived from mx35 3stack.
> + * Original author: Fabio Estevam <fabio.estevam@freescale.com>
> + *
> + * 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/types.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/mtd/physmap.h>
> +#include <linux/memory.h>
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <asm/mach/time.h>
> +#include <asm/mach/map.h>
> +
> +#include <mach/hardware.h>
> +#include <mach/common.h>
> +#include <mach/iomux-mx35.h>
> +#include <mach/irqs.h>
> +#include <mach/ipu.h>
> +#include <mach/mx3fb.h>
> +
> +#include <linux/i2c.h>
> +#include <linux/i2c/at24.h>
> +#include <linux/regulator/machine.h>
> +#include <linux/mfd/mc13xxx.h>
> +#include <video/platform_lcd.h>
> +
> +#include "devices-imx35.h"
> +#include "devices.h"
> +
> +#define GPIO_LCDPWR IMX_GPIO_NR(1, 2)
> +#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
> +
> +#define GPIO_BUTTON1 IMX_GPIO_NR(1, 4)
> +#define GPIO_BUTTON2 IMX_GPIO_NR(1, 5)
> +#define GPIO_BUTTON3 IMX_GPIO_NR(1, 7)
> +#define GPIO_BUTTON4 IMX_GPIO_NR(1, 8)
> +#define GPIO_BUTTON5 IMX_GPIO_NR(1, 9)
> +#define GPIO_BUTTON6 IMX_GPIO_NR(1, 10)
> +#define GPIO_BUTTON7 IMX_GPIO_NR(1, 11)
> +#define GPIO_BUTTON8 IMX_GPIO_NR(1, 12)
> +
> +static const struct fb_videomode fb_modedb[] = {
> + {
> + /* 800x480 @ 60 Hz */
> + .name = "PT0708048",
> + .refresh = 60,
> + .xres = 800,
> + .yres = 480,
> + .pixclock = KHZ2PICOS(33260),
> + .left_margin = 50,
> + .right_margin = 156,
> + .upper_margin = 10,
> + .lower_margin = 10,
> + .hsync_len = 1, /* note: DE only display */
> + .vsync_len = 1, /* note: DE only display */
> + .sync = FB_SYNC_CLK_IDLE_EN | FB_SYNC_OE_ACT_HIGH,
> + .vmode = FB_VMODE_NONINTERLACED,
> + .flag = 0,
> + }, {
> + /* 800x480 @ 60 Hz */
> + .name = "CTP-CLAA070LC0ACW",
> + .refresh = 60,
> + .xres = 800,
> + .yres = 480,
> + .pixclock = KHZ2PICOS(27000),
> + .left_margin = 50,
> + .right_margin = 50, /* whole line should have 900 clocks */
> + .upper_margin = 10,
> + .lower_margin = 10, /* whole frame should have 500 lines */
> + .hsync_len = 1, /* note: DE only display */
> + .vsync_len = 1, /* note: DE only display */
> + .sync = FB_SYNC_CLK_IDLE_EN | FB_SYNC_OE_ACT_HIGH,
> + .vmode = FB_VMODE_NONINTERLACED,
> + .flag = 0,
> + }
> +};
> +
> +static struct ipu_platform_data mx3_ipu_data = {
> + .irq_base = MXC_IPU_IRQ_START,
> +};
> +
> +static struct mx3fb_platform_data mx3fb_pdata = {
> + .dma_dev = &mx3_ipu.dev,
> + .name = "PT0708048",
> + .mode = fb_modedb,
> + .num_modes = ARRAY_SIZE(fb_modedb),
> +};
> +
> +static struct physmap_flash_data vpr200_flash_data = {
> + .width = 2,
> +};
> +
> +static struct resource vpr200_flash_resource = {
> + .start = MX35_CS0_BASE_ADDR,
> + .end = MX35_CS0_BASE_ADDR + SZ_64M - 1,
> + .flags = IORESOURCE_MEM,
> +};
> +
> +static struct platform_device vpr200_flash = {
> + .name = "physmap-flash",
> + .id = 0,
> + .dev = {
> + .platform_data = &vpr200_flash_data,
> + },
> + .resource = &vpr200_flash_resource,
> + .num_resources = 1,
> +};
> +
> +static const struct mxc_nand_platform_data
> + vpr200_nand_board_info __initconst = {
> + .width = 1,
> + .hw_ecc = 1,
> + .flash_bbt = 1,
> +};
> +
> +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
I'd prefer to have unconditional device registration.
> +#include <linux/gpio_keys.h>
> +#define VPR_KEY_DEBOUNCE 500
> +
> +static struct gpio_keys_button vpr200_gpio_keys_table[] = {
> + {KEY_F2, GPIO_BUTTON1, 1, "vpr-keys: F2", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F3, GPIO_BUTTON2, 1, "vpr-keys: F3", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F4, GPIO_BUTTON3, 1, "vpr-keys: F4", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F5, GPIO_BUTTON4, 1, "vpr-keys: F5", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F6, GPIO_BUTTON5, 1, "vpr-keys: F6", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F7, GPIO_BUTTON6, 1, "vpr-keys: F7", 0, VPR_KEY_DEBOUNCE},
> + {KEY_F8, GPIO_BUTTON7, 1, "vpr-keys: F8", 1, VPR_KEY_DEBOUNCE},
> + {KEY_F9, GPIO_BUTTON8, 1, "vpr-keys: F9", 1, VPR_KEY_DEBOUNCE},
> +};
> +
> +static struct gpio_keys_platform_data vpr200_gpio_keys_data = {
> + .buttons = vpr200_gpio_keys_table,
> + .nbuttons = ARRAY_SIZE(vpr200_gpio_keys_table),
> +};
> +
> +static struct platform_device vpr200_device_gpiokeys = {
> + .name = "gpio-keys",
> + .dev = {
> + .platform_data = &vpr200_gpio_keys_data,
> + }
> +};
> +
> +static void vpr200_init_keys(void)
> +{
> + gpio_request(GPIO_BUTTON1, "BUTTON1");
> + gpio_direction_input(GPIO_BUTTON1);
> + gpio_free(GPIO_BUTTON1);
> +
> + gpio_request(GPIO_BUTTON2, "BUTTON2");
> + gpio_direction_input(GPIO_BUTTON2);
> + gpio_free(GPIO_BUTTON2);
> +
> + gpio_request(GPIO_BUTTON3, "BUTTON3");
> + gpio_direction_input(GPIO_BUTTON3);
> + gpio_free(GPIO_BUTTON3);
> +
> + gpio_request(GPIO_BUTTON4, "BUTTON4");
> + gpio_direction_input(GPIO_BUTTON4);
> + gpio_free(GPIO_BUTTON4);
> +
> + gpio_request(GPIO_BUTTON5, "BUTTON5");
> + gpio_direction_input(GPIO_BUTTON5);
> + gpio_free(GPIO_BUTTON5);
> +
> + gpio_request(GPIO_BUTTON6, "BUTTON6");
> + gpio_direction_input(GPIO_BUTTON6);
> + gpio_free(GPIO_BUTTON6);
> +
> + gpio_request(GPIO_BUTTON7, "BUTTON7");
> + gpio_direction_input(GPIO_BUTTON7);
> + gpio_free(GPIO_BUTTON7);
> +
> + gpio_request(GPIO_BUTTON8, "BUTTON8");
> + gpio_direction_input(GPIO_BUTTON8);
> + gpio_free(GPIO_BUTTON8);
Hmm, doesn't the gpio-keys driver does that already?
And to do it really correct, you need to check for errors returned by
gpio_request and gpio_direction_input.
Provided you really need it, I'd do it as follows:
int ret;
#define setup_for_gpiokey(nr) \
ret = gpio_request(GPIO_BUTTON ## nr, "BUTTON" #nr); \
if (ret) \
return ret; \
ret = gpio_direction_input(GPIO_BUTTON ## nr); \
if (ret) \
return ret; \
gpio_free(GPIO_BUTTON ## nr);
setup_for_gpiokey(1);
setup_for_gpiokey(2);
setup_for_gpiokey(3);
setup_for_gpiokey(4);
...
return platform_device_register(&vpr200_device_gpiokeys);
> +
> + platform_device_register(&vpr200_device_gpiokeys);
> +}
> +#else
> +
> +static void vpr200_init_keys(void)
> +{
> +}
> +#endif
> +
> +static struct mc13xxx_platform_data board_pmic = {
> + .flags = MC13XXX_USE_ADC | MC13XXX_USE_TOUCHSCREEN,
> +};
if you make device registration conditional, then please #ifdef
board_pmic away, too.
> +#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
> +static const struct imxi2c_platform_data vpr200_i2c0_data __initconst = {
> + .bitrate = 50000,
> +};
> +
> +static struct at24_platform_data board_eeprom = {
> + .byte_len = 2048 / 8,
> + .page_size = 1,
> +};
> +
> +static struct i2c_board_info vpr200_i2c_devices[] = {
> + {
> + I2C_BOARD_INFO("at24", 0x50), /* E0=0, E1=0, E2=0 */
> + .platform_data = &board_eeprom,
> + }, {
> + I2C_BOARD_INFO("mc13892", 0x08),
> + .platform_data = &board_pmic,
> + .irq = gpio_to_irq(GPIO_PMIC_INT),
> + }
> +};
> +#endif
> +
> +static iomux_v3_cfg_t vpr200_pads[] = {
> + /* UART1 */
> + MX35_PAD_CTS1__UART1_CTS,
> + MX35_PAD_RTS1__UART1_RTS,
> + MX35_PAD_TXD1__UART1_TXD_MUX,
> + MX35_PAD_RXD1__UART1_RXD_MUX,
> + /* UART3 */
> + MX35_PAD_ATA_DATA10__UART3_RXD_MUX,
> + MX35_PAD_ATA_DATA11__UART3_TXD_MUX,
> + /* FEC */
> + MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
> + MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
> + MX35_PAD_FEC_RX_DV__FEC_RX_DV,
> + MX35_PAD_FEC_COL__FEC_COL,
> + MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
> + MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
> + MX35_PAD_FEC_TX_EN__FEC_TX_EN,
> + MX35_PAD_FEC_MDC__FEC_MDC,
> + MX35_PAD_FEC_MDIO__FEC_MDIO,
> + MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
> + MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
> + MX35_PAD_FEC_CRS__FEC_CRS,
> + MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
> + MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
> + MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
> + MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
> + MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
> + MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
> + /* Display */
> + MX35_PAD_LD0__IPU_DISPB_DAT_0,
> + MX35_PAD_LD1__IPU_DISPB_DAT_1,
> + MX35_PAD_LD2__IPU_DISPB_DAT_2,
> + MX35_PAD_LD3__IPU_DISPB_DAT_3,
> + MX35_PAD_LD4__IPU_DISPB_DAT_4,
> + MX35_PAD_LD5__IPU_DISPB_DAT_5,
> + MX35_PAD_LD6__IPU_DISPB_DAT_6,
> + MX35_PAD_LD7__IPU_DISPB_DAT_7,
> + MX35_PAD_LD8__IPU_DISPB_DAT_8,
> + MX35_PAD_LD9__IPU_DISPB_DAT_9,
> + MX35_PAD_LD10__IPU_DISPB_DAT_10,
> + MX35_PAD_LD11__IPU_DISPB_DAT_11,
> + MX35_PAD_LD12__IPU_DISPB_DAT_12,
> + MX35_PAD_LD13__IPU_DISPB_DAT_13,
> + MX35_PAD_LD14__IPU_DISPB_DAT_14,
> + MX35_PAD_LD15__IPU_DISPB_DAT_15,
> + MX35_PAD_LD16__IPU_DISPB_DAT_16,
> + MX35_PAD_LD17__IPU_DISPB_DAT_17,
> + MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
> + MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
> + MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
> + /* LCD Enable */
> + MX35_PAD_D3_VSYNC__GPIO1_2,
> + /* USBOTG */
> + MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR,
> + MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC,
> + /* SDCARD */
> + MX35_PAD_SD1_CMD__ESDHC1_CMD,
> + MX35_PAD_SD1_CLK__ESDHC1_CLK,
> + MX35_PAD_SD1_DATA0__ESDHC1_DAT0,
> + MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
> + MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
> + MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
> + /* PMIC */
> + MX35_PAD_GPIO2_0__GPIO2_0,
> + /* GPIO keys */
> + MX35_PAD_SCKR__GPIO1_4,
> + MX35_PAD_COMPARE__GPIO1_5,
> + MX35_PAD_SCKT__GPIO1_7,
> + MX35_PAD_FST__GPIO1_8,
> + MX35_PAD_HCKT__GPIO1_9,
> + MX35_PAD_TX5_RX0__GPIO1_10,
> + MX35_PAD_TX4_RX1__GPIO1_11,
> + MX35_PAD_TX3_RX2__GPIO1_12,
> +};
> +static void vpr200_lcd_power_set(struct plat_lcd_data *pd,
> + unsigned int power)
> +{
> + if (power)
> + gpio_direction_output(GPIO_LCDPWR, 0);
> + else
> + gpio_direction_output(GPIO_LCDPWR, 1);
calling gpio_set_value is cheaper than gpio_direction_output. And you
can do
gpio_set_value(GPIO_LCDPWR, !power)
(provided that you called gpio_direction_output once before as you do
below in the init function).
> +}
> +
> +static struct plat_lcd_data vpr200_lcd_power_data = {
> + .set_power = vpr200_lcd_power_set,
> +};
> +
> +static struct platform_device vpr200_lcd_powerdev = {
> + .name = "platform-lcd",
> + .dev.platform_data = &vpr200_lcd_power_data,
> +};
> +
> +/* USB Device config */
> +static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
> + .operating_mode = FSL_USB2_DR_DEVICE,
> + .phy_mode = FSL_USB2_PHY_UTMI,
> + .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
> +};
> +
> +#if defined(CONFIG_USB_ULPI)
> +/* USB HOST config */
> +static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
> + .portsc = MXC_EHCI_MODE_SERIAL,
> + .flags = MXC_EHCI_INTERFACE_SINGLE_UNI |
> + MXC_EHCI_INTERNAL_PHY,
> +};
> +#endif
> +
> +static struct platform_device *devices[] __initdata = {
> + &vpr200_flash,
> + &vpr200_lcd_powerdev,
> +};
> +
> +/*
> + * Board specific initialization.
> + */
> +static void __init mxc_board_init(void)
can you please call that vpr200_init or similar?
> +{
> + mxc_iomux_v3_setup_multiple_pads(vpr200_pads, ARRAY_SIZE(vpr200_pads));
> +
> + imx35_add_fec(NULL);
> + imx35_add_imx2_wdt(NULL);
> +
> + platform_add_devices(devices, ARRAY_SIZE(devices));
> +
> + gpio_request(GPIO_LCDPWR, "LCDPWR");
> + gpio_direction_output(GPIO_LCDPWR, 0);
> + gpio_free(GPIO_LCDPWR);
Are you sure this gpio_free is correct?
> +
> + gpio_request(GPIO_PMIC_INT, "PMIC_INT");
> + gpio_direction_input(GPIO_PMIC_INT);
> + gpio_free(GPIO_PMIC_INT);
ditto.
And as above, error checking please.
> +
> + imx35_add_imx_uart0(NULL);
> + imx35_add_imx_uart2(NULL);
> +
> + mxc_register_device(&mx3_ipu, &mx3_ipu_data);
> + mxc_register_device(&mx3_fb, &mx3fb_pdata);
> +
> + imx35_add_fsl_usb2_udc(&otg_device_pdata);
> +
> +#if defined(CONFIG_USB_ULPI)
> + imx35_add_mxc_ehci_hs(&usb_host_pdata);
> +#endif
> +
> + imx35_add_mxc_nand(&vpr200_nand_board_info);
> + imx35_add_sdhci_esdhc_imx(0, NULL);
> +
> +#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
> + i2c_register_board_info(0, vpr200_i2c_devices,
> + ARRAY_SIZE(vpr200_i2c_devices));
> +
> + imx35_add_imx_i2c0(&vpr200_i2c0_data);
> +#endif
> +
> + vpr200_init_keys();
> +}
> +
> +static void __init vpr200_timer_init(void)
> +{
> + mx35_clocks_init();
> +}
> +
> +struct sys_timer vpr200_timer = {
> + .init = vpr200_timer_init,
> +};
> +
> +MACHINE_START(VPR200, "VPR200")
> + /* Maintainer: Creative Product Design */
> + .boot_params = MX3x_PHYS_OFFSET + 0x100,
I hope you don't need this line.
> + .map_io = mx35_map_io,
> + .init_irq = mx35_init_irq,
> + .init_machine = mxc_board_init,
> + .timer = &vpr200_timer,
> +MACHINE_END
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH v4 08/10] ARM: mxs: add ocotp read function
From: Sascha Hauer @ 2011-01-14 8:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113151939.GX24920@pengutronix.de>
On Thu, Jan 13, 2011 at 04:19:39PM +0100, Uwe Kleine-K?nig 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
> is it worth to make ocotp optional? (and let evk select
> CONFIG_MXS_OCOTP)
I think not.
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
* [PATCH] ARM mxs: clkdev related compile fixes
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-14 8:27 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294934365-17087-1-git-send-email-u.kleine-koenig@pengutronix.de>
On 16:59 Thu 13 Jan , Uwe Kleine-K?nig wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
>
> Since commit
>
> 6d803ba (ARM: 6483/1: arm & sh: factorised duplicated clkdev.c)
>
> platforms need to select CLKDEV_LOOKUP instead of COMMON_CLKDEV and need
> to include <linux/clkdev.h>.
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> Cc: Lothar Wa?mann <LW@KARO-electronics.de>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> [ukl: make commit log more verbose; remove selection of COMMON_CLKDEV]
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Best Regards,
J.
^ permalink raw reply
* [PATCH 1/2] arm: mx50_rdp: add fec support
From: Richard Zhao @ 2011-01-14 8:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110114075024.GB24920@pengutronix.de>
On Fri, Jan 14, 2011 at 08:50:24AM +0100, Uwe Kleine-K?nig wrote:
> Hello Richard,
>
> On Fri, Jan 14, 2011 at 02:55:36PM +0800, Richard Zhao wrote:
> > +static const struct fec_platform_data fec_data = {
> This can be __initconst.
Right, Thanks.
>
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-K?nig |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
>
^ permalink raw reply
* [PATCH v4 05/10] net/fec: add dual fec support for mx28
From: Uwe Kleine-König @ 2011-01-14 7:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110114054838.GA14491@freescale.com>
On Fri, Jan 14, 2011 at 01:48:40PM +0800, Shawn Guo wrote:
> Hi Uwe,
>
> On Thu, Jan 13, 2011 at 03:48:05PM +0100, Uwe Kleine-K?nig wrote:
>
> [...]
>
> > > +/* Controller is ENET-MAC */
> > > +#define FEC_QUIRK_ENET_MAC (1 << 0)
> > does this really qualify to be a quirk?
> >
> My understanding is that ENET-MAC is a type of "quirky" FEC
> controller.
>
> > > +/* Controller needs driver to swap frame */
> > > +#define FEC_QUIRK_SWAP_FRAME (1 << 1)
> > IMHO this is a bit misnamed. FEC_QUIRK_NEEDS_BE_DATA or similar would
> > be more accurate.
> >
> When your make this change, you may want to pick a better name for
> function swap_buffer too.
>
> [...]
>
> > > +static void *swap_buffer(void *bufaddr, int len)
> > > +{
> > > + int i;
> > > + unsigned int *buf = bufaddr;
> > > +
> > > + for (i = 0; i < (len + 3) / 4; i++, buf++)
> > > + *buf = cpu_to_be32(*buf);
> > if len isn't a multiple of 4 this accesses bytes behind len. Is this
> > generally OK here? (E.g. because skbs always have a length that is a
> > multiple of 4?)
> The len may not be a multiple of 4. But I believe bufaddr is always
> a buffer allocated in a length that is a multiple of 4, and the 1~3
> bytes exceeding the len very likely has no data that matters. But
> yes, it deserves a safer implementation.
Did you test what happens if bufaddr isn't aligned? Does it work at all
then?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH 1/2] arm: mx50_rdp: add fec support
From: Uwe Kleine-König @ 2011-01-14 7:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294988137-24654-1-git-send-email-richard.zhao@freescale.com>
Hello Richard,
On Fri, Jan 14, 2011 at 02:55:36PM +0800, Richard Zhao wrote:
> +static const struct fec_platform_data fec_data = {
This can be __initconst.
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH] ARM: vfp: Fix up exception location in Thumb mode
From: Colin Cross @ 2011-01-14 7:42 UTC (permalink / raw)
To: linux-arm-kernel
The exception handler in entry-armv.S checks for thumb mode and
correctly determines the exception location and instruction,
but VFP_bounce uses the uncorrected location off the stack.
If the VFP exception occured in Thumb mode, fix up the
exception location to match the value that would be returned
in ARM mode.
Fixes segfaults in userspace applications running in Thumb mode
caused by a handled VFP exception returning to the middle of the
instruction that triggered the exception.
Change-Id: I6c6ba1ab88e107bec166ea334d7e0974a4f6bfba
Signed-off-by: Colin Cross <ccross@android.com>
---
arch/arm/vfp/vfpmodule.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 0797cb5..63ed73d 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -275,6 +275,16 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
pr_debug("VFP: bounce: trigger %08x fpexc %08x\n", trigger, fpexc);
/*
+ * If the exception occured in thumb mode, pc is exception location + 2,
+ * the middle of the 32-bit VFP instruction. Add 2 to get exception
+ * location + 4, the same we get in ARM mode.
+ */
+#ifdef CONFIG_ARM_THUMB
+ if (regs->ARM_cpsr & PSR_T_BIT)
+ regs->ARM_pc += 2;
+#endif
+
+ /*
* At this point, FPEXC can have the following configuration:
*
* EX DEX IXE
--
1.7.3.1
^ permalink raw reply related
* i.MX & IRQF_ONESHOT
From: Eric Bénard @ 2011-01-14 7:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113212401.GZ24920@pengutronix.de>
On 13/01/2011 22:24, Uwe Kleine-K?nig wrote:
> On Thu, Jan 13, 2011 at 10:12:23PM +0100, Eric B?nard wrote:
>> On 13/01/2011 19:15, Thomas Gleixner wrote:
>>> On Thu, 13 Jan 2011, Nicolas Ferre wrote:
>>>> Le 13/01/2011 10:13, Uwe Kleine-K?nig :
>>>>> On Thu, Jan 13, 2011 at 09:25:19AM +0100, Eric B?nard wrote:
>>>>>> Commenting out this line in the ads7846 driver makes it work again.
>>>>>> Am I missing something obvious or is there a reason for IRQF_ONESHOT
>>>>>> creating trouble with gpio irq or SPI on i.MX ?
>>>>> I don't know. Is the irq masked? pending?
>>>>
>>>> Just to let you know that I have the same issue on my at91sam9g10ek:
>>>> atmel_spi + ads7846 (using ADS7843e actually).
>>>> ... solved by same workaround.
>>>
>>> Eric, Nicolas: How are the interrupt handlers set for the relevant
>>> interrupt lines and how are the interrupt pins configured?
>>>
>> on the i.MX27 :
>> - gpio configured as a plain input (in function ads7846_dev_init()
>> in arch/arm/mach-imx/eukrea_mbimx27-baseboard.c)
>> - threaded interrupt handler registered with flags
>> IRQF_TRIGGER_FALLING | IRQF_ONESHOT (in function ads7846_probe() in
>> drivers/input/touchscreen/ads7846.c)
> I didn't recheck the hw manual, but adding IRQF_TRIGGER_FALLING calls
> gpio_set_irq_type (defined in arch/arm/plat-mxc/gpio.c) which results
> into something called GPIO_INT_FALL_EDGE being written into a register.
>
> So I'd say it's configured to be edge sensitive.
>
I confirm this point : the gpio is configured to trigger an irq on falling edge.
Eric
^ permalink raw reply
* [PATCH v5 09/10] ARM: mxs/mx28evk: read fec mac address from ocotp
From: Shawn Guo @ 2011-01-14 7:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294297998-26930-1-git-send-email-shawn.guo@freescale.com>
Read fec mac address from ocotp and save it into fec_platform_data
mac field for fec driver to use.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/mach-mx28evk.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index 8e2c597..e8db99f 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -119,7 +119,7 @@ static void __init mx28evk_fec_reset(void)
gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
}
-static struct fec_platform_data mx28_fec_pdata[] = {
+static struct fec_platform_data mx28_fec_pdata[] __initdata = {
{
/* fec0 */
.phy = PHY_INTERFACE_MODE_RMII,
@@ -129,12 +129,45 @@ static struct fec_platform_data mx28_fec_pdata[] = {
},
};
+static int __init mx28evk_fec_get_mac(void)
+{
+ int i;
+ u32 val;
+ const u32 *ocotp = mxs_get_ocotp();
+
+ if (!ocotp)
+ goto error;
+
+ /*
+ * OCOTP only stores the last 4 octets for each mac address,
+ * so hard-code Freescale OUI (00:04:9f) here.
+ */
+ for (i = 0; i < 2; i++) {
+ val = ocotp[i * 4];
+ mx28_fec_pdata[i].mac[0] = 0x00;
+ mx28_fec_pdata[i].mac[1] = 0x04;
+ mx28_fec_pdata[i].mac[2] = 0x9f;
+ mx28_fec_pdata[i].mac[3] = (val >> 16) & 0xff;
+ mx28_fec_pdata[i].mac[4] = (val >> 8) & 0xff;
+ mx28_fec_pdata[i].mac[5] = (val >> 0) & 0xff;
+ }
+
+ return 0;
+
+error:
+ pr_err("%s: timeout when reading fec mac from OCOTP\n", __func__);
+ return -ETIMEDOUT;
+}
+
static void __init mx28evk_init(void)
{
mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
mx28_add_duart();
+ if (mx28evk_fec_get_mac())
+ pr_warn("%s: failed on fec mac setup\n", __func__);
+
mx28evk_fec_reset();
mx28_add_fec(0, &mx28_fec_pdata[0]);
mx28_add_fec(1, &mx28_fec_pdata[1]);
--
1.7.1
^ permalink raw reply related
* [PATCH v5 08/10] ARM: mxs: add ocotp read function
From: Shawn Guo @ 2011-01-14 7:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294297998-26930-1-git-send-email-shawn.guo@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/Kconfig | 4 ++
arch/arm/mach-mxs/Makefile | 3 +
arch/arm/mach-mxs/include/mach/common.h | 1 +
arch/arm/mach-mxs/ocotp.c | 90 +++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-mxs/ocotp.c
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8bfc8df..cd2fbdf 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -2,6 +2,9 @@ if ARCH_MXS
source "arch/arm/mach-mxs/devices/Kconfig"
+config MXS_OCOTP
+ bool
+
config SOC_IMX23
bool
select CPU_ARM926T
@@ -26,6 +29,7 @@ config MACH_MX28EVK
select SOC_IMX28
select MXS_HAVE_AMBA_DUART
select MXS_HAVE_PLATFORM_FEC
+ select MXS_OCOTP
default y
help
Include support for MX28EVK platform. This includes specific
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 39d3f9c..623899b 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -1,6 +1,9 @@
# Common support
obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
+obj-$(CONFIG_PM) += pm.o
+obj-$(CONFIG_MXS_OCOTP) += ocotp.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..635bb5d 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 const u32 *mxs_get_ocotp(void);
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..eb2eab7
--- /dev/null
+++ b/arch/arm/mach-mxs/ocotp.c
@@ -0,0 +1,90 @@
+/*
+ * 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 OCOTP_WORD_OFFSET 0x20
+#define OCOTP_WORD_COUNT 0x20
+
+#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);
+static u32 ocotp_words[OCOTP_WORD_COUNT];
+
+const u32 *mxs_get_ocotp(void)
+{
+ void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
+ int timeout = 0x400;
+ size_t i;
+ static int once = 0;
+
+ if (once)
+ return ocotp_words;
+
+ 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);
+
+ /* check both BUSY and ERROR cleared */
+ while ((__raw_readl(ocotp_base) &
+ (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
+ cpu_relax();
+
+ 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();
+
+ if (unlikely(!timeout))
+ goto error_unlock;
+
+ for (i = 0; i < OCOTP_WORD_COUNT; i++)
+ ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
+ i * 0x10);
+
+ /* close banks for power saving */
+ __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
+
+ mutex_unlock(&ocotp_mutex);
+
+ once = 1;
+
+ return ocotp_words;
+
+error_unlock:
+ mutex_unlock(&ocotp_mutex);
+ pr_err("%s: timeout in reading OCOTP\n", __func__);
+ return NULL;
+}
--
1.7.1
^ permalink raw reply related
* [PATCH] mm/init.c: fix compilation warning
From: Viresh Kumar @ 2011-01-14 7:10 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes following warning:
mm/init.c:606: warning: format '%08lx' expects type 'long unsigned int', but
argument 12 has type 'unsigned int'
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
arch/arm/mm/init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069..2d54070 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -593,7 +593,7 @@ void __init mem_init(void)
#ifdef CONFIG_MMU
MLM(CONSISTENT_BASE, CONSISTENT_END),
#endif
- MLM(VMALLOC_START, VMALLOC_END),
+ MLM(VMALLOC_START, (unsigned long) VMALLOC_END),
MLM(PAGE_OFFSET, (unsigned long)high_memory),
#ifdef CONFIG_HIGHMEM
MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
--
1.7.2.2
^ permalink raw reply related
* [PATCH v5] ARM: mx28: add the second fec device registration
From: Shawn Guo @ 2011-01-14 7:04 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113144900.GT24920@pengutronix.de>
Hi Uwe,
On Thu, Jan 13, 2011 at 03:49:00PM +0100, Uwe Kleine-K?nig wrote:
> On Tue, Jan 11, 2011 at 08:09:24PM +0800, Shawn Guo wrote:
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > ---
> > Changes for v5:
> > - Do not use CONFIG_FEC2 which is a fec driver configration
> >
> > arch/arm/mach-mxs/mach-mx28evk.c | 26 +++++++++++++++++++++++---
> > 1 files changed, 23 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
> > index d162e95..8e2c597 100644
> > --- a/arch/arm/mach-mxs/mach-mx28evk.c
> > +++ b/arch/arm/mach-mxs/mach-mx28evk.c
> > @@ -57,6 +57,19 @@ static const iomux_cfg_t mx28evk_pads[] __initconst = {
> > (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > MX28_PAD_ENET_CLK__CLKCTRL_ENET |
> > (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + /* fec1 */
> > + MX28_PAD_ENET0_CRS__ENET1_RX_EN |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_RXD2__ENET1_RXD0 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_RXD3__ENET1_RXD1 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_COL__ENET1_TX_EN |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_TXD2__ENET1_TXD0 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > + MX28_PAD_ENET0_TXD3__ENET1_TXD1 |
> > + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> > /* phy power line */
> > MX28_PAD_SSP1_DATA3__GPIO_2_15 |
> > (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
> > @@ -106,8 +119,14 @@ static void __init mx28evk_fec_reset(void)
> > gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
> > }
> >
> > -static const struct fec_platform_data mx28_fec_pdata __initconst = {
> > - .phy = PHY_INTERFACE_MODE_RMII,
> > +static struct fec_platform_data mx28_fec_pdata[] = {
> this can still be initdata, doesn't it?
>
Sascha has merged the patch. This one line change may not deserve
a separate patch, so I will take care of it when updating the file
with new version of ocotp patch.
--
Regards,
Shawn
^ permalink raw reply
* [PATCH 2/2] arm: mx50_rdp: add i2c bus support
From: Richard Zhao @ 2011-01-14 6:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294988137-24654-1-git-send-email-richard.zhao@freescale.com>
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
---
arch/arm/mach-mx5/board-mx50_rdp.c | 7 +++++++
arch/arm/mach-mx5/devices-mx50.h | 3 +++
arch/arm/plat-mxc/devices/platform-imx-i2c.c | 10 ++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
index c174188..a7c53e6 100644
--- a/arch/arm/mach-mx5/board-mx50_rdp.c
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -184,6 +184,10 @@ static inline void mx50_rdp_fec_reset(void)
gpio_set_value(FEC_RESET_B, 1);
}
+static const struct imxi2c_platform_data i2c_data __initconst = {
+ .bitrate = 100000,
+};
+
/*
* Board specific initialization.
*/
@@ -196,6 +200,9 @@ static void __init mx50_rdp_board_init(void)
imx50_add_imx_uart(1, &uart_pdata);
mx50_rdp_fec_reset();
imx50_add_fec(&fec_data);
+ imx50_add_imx_i2c(0, &i2c_data);
+ imx50_add_imx_i2c(1, &i2c_data);
+ imx50_add_imx_i2c(2, &i2c_data);
}
static void __init mx50_rdp_timer_init(void)
diff --git a/arch/arm/mach-mx5/devices-mx50.h b/arch/arm/mach-mx5/devices-mx50.h
index e1093db..c9e4282 100644
--- a/arch/arm/mach-mx5/devices-mx50.h
+++ b/arch/arm/mach-mx5/devices-mx50.h
@@ -29,3 +29,6 @@ extern const struct imx_fec_data imx50_fec_data __initconst;
#define imx50_add_fec(pdata) \
imx_add_fec(&imx50_fec_data, pdata)
+extern const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst;
+#define imx50_add_imx_i2c(id, pdata) \
+ imx_add_imx_i2c(&imx50_imx_i2c_data[id], pdata)
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
index 7ba94e1..2ab74f0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
@@ -69,6 +69,16 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
};
#endif /* ifdef CONFIG_SOC_IMX35 */
+#ifdef CONFIG_SOC_IMX50
+const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
+#define imx50_imx_i2c_data_entry(_id, _hwid) \
+ imx_imx_i2c_data_entry(MX50, _id, _hwid, SZ_4K)
+ imx50_imx_i2c_data_entry(0, 1),
+ imx50_imx_i2c_data_entry(1, 2),
+ imx50_imx_i2c_data_entry(2, 3),
+};
+#endif /* ifdef CONFIG_SOC_IMX51 */
+
#ifdef CONFIG_SOC_IMX51
const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
#define imx51_imx_i2c_data_entry(_id, _hwid) \
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/2] arm: mx50_rdp: add fec support
From: Richard Zhao @ 2011-01-14 6:55 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
---
arch/arm/mach-mx5/Kconfig | 1 +
arch/arm/mach-mx5/board-mx50_rdp.c | 22 ++++++++++++++++++++--
arch/arm/mach-mx5/devices-mx50.h | 5 +++++
arch/arm/plat-mxc/devices/platform-fec.c | 5 +++++
4 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index f2f0731..64d2bf9 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -142,6 +142,7 @@ config MACH_MX50_RDP
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
select IMX_HAVE_PLATFORM_SPI_IMX
+ select IMX_HAVE_PLATFORM_FEC
help
Include support for MX50 reference design platform (RDP) board. This
includes specific configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
index fd32e4c..c174188 100644
--- a/arch/arm/mach-mx5/board-mx50_rdp.c
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -37,6 +37,9 @@
#include "devices-mx50.h"
+#define FEC_EN IMX_GPIO_NR(6, 23)
+#define FEC_RESET_B IMX_GPIO_NR(4, 12)
+
static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
/* SD1 */
MX50_PAD_ECSPI2_SS0__GPIO_4_19,
@@ -102,7 +105,7 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
MX50_PAD_I2C3_SCL__USBOTG_OC,
MX50_PAD_SSI_RXC__FEC_MDIO,
- MX50_PAD_SSI_RXC__FEC_MDIO,
+ MX50_PAD_SSI_RXFS__FEC_MDC,
MX50_PAD_DISP_D0__FEC_TXCLK,
MX50_PAD_DISP_D1__FEC_RX_ER,
MX50_PAD_DISP_D2__FEC_RX_DV,
@@ -111,7 +114,6 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
MX50_PAD_DISP_D5__FEC_TX_EN,
MX50_PAD_DISP_D6__FEC_TXD1,
MX50_PAD_DISP_D7__FEC_TXD0,
- MX50_PAD_SSI_RXFS__FEC_MDC,
MX50_PAD_I2C3_SDA__GPIO_6_23,
MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
@@ -168,6 +170,20 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
};
+static const struct fec_platform_data fec_data = {
+ .phy = PHY_INTERFACE_MODE_RMII,
+};
+
+static inline void mx50_rdp_fec_reset(void)
+{
+ gpio_request(FEC_EN, "fec-en");
+ gpio_direction_output(FEC_EN, 0);
+ gpio_request(FEC_RESET_B, "fec-reset_b");
+ gpio_direction_output(FEC_RESET_B, 0);
+ msleep(1);
+ gpio_set_value(FEC_RESET_B, 1);
+}
+
/*
* Board specific initialization.
*/
@@ -178,6 +194,8 @@ static void __init mx50_rdp_board_init(void)
imx50_add_imx_uart(0, &uart_pdata);
imx50_add_imx_uart(1, &uart_pdata);
+ mx50_rdp_fec_reset();
+ imx50_add_fec(&fec_data);
}
static void __init mx50_rdp_timer_init(void)
diff --git a/arch/arm/mach-mx5/devices-mx50.h b/arch/arm/mach-mx5/devices-mx50.h
index 98ab074..e1093db 100644
--- a/arch/arm/mach-mx5/devices-mx50.h
+++ b/arch/arm/mach-mx5/devices-mx50.h
@@ -24,3 +24,8 @@
extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst;
#define imx50_add_imx_uart(id, pdata) \
imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
+
+extern const struct imx_fec_data imx50_fec_data __initconst;
+#define imx50_add_fec(pdata) \
+ imx_add_fec(&imx50_fec_data, pdata)
+
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index b50c351..4f52996 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -31,6 +31,11 @@ const struct imx_fec_data imx35_fec_data __initconst =
imx_fec_data_entry_single(MX35);
#endif
+#ifdef CONFIG_SOC_IMX50
+const struct imx_fec_data imx50_fec_data __initconst =
+ imx_fec_data_entry_single(MX50);
+#endif
+
#ifdef CONFIG_SOC_IMX51
const struct imx_fec_data imx51_fec_data __initconst =
imx_fec_data_entry_single(MX51);
--
1.6.3.3
^ permalink raw reply related
* [PATCH] ARM: mxs: pass fec device name via platform data
From: Shawn Guo @ 2011-01-14 6:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113150622.GV24920@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
---
arch/arm/mach-mxs/devices/platform-fec.c | 11 ++++++-----
arch/arm/mach-mxs/include/mach/devices-common.h | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
index c42dff7..75eb26b 100644
--- a/arch/arm/mach-mxs/devices/platform-fec.c
+++ b/arch/arm/mach-mxs/devices/platform-fec.c
@@ -10,20 +10,21 @@
#include <mach/mx28.h>
#include <mach/devices-common.h>
-#define mxs_fec_data_entry_single(soc, _id) \
+#define mxs_fec_data_entry_single(soc, _devid, _id) \
{ \
+ .devid = _devid, \
.id = _id, \
.iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \
.irq = soc ## _INT_ENET_MAC ## _id, \
}
-#define mxs_fec_data_entry(soc, _id) \
- [_id] = mxs_fec_data_entry_single(soc, _id)
+#define mxs_fec_data_entry(soc, _devid, _id) \
+ [_id] = mxs_fec_data_entry_single(soc, _devid, _id)
#ifdef CONFIG_SOC_IMX28
const struct mxs_fec_data mx28_fec_data[] __initconst = {
#define mx28_fec_data_entry(_id) \
- mxs_fec_data_entry(MX28, _id)
+ mxs_fec_data_entry(MX28, "imx28-fec", _id)
mx28_fec_data_entry(0),
mx28_fec_data_entry(1),
};
@@ -45,6 +46,6 @@ struct platform_device *__init mxs_add_fec(
},
};
- return mxs_add_platform_device("imx28-fec", data->id,
+ return mxs_add_platform_device(data->devid, data->id,
res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
}
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
index 6c3d1a1..10fbcfd 100644
--- a/arch/arm/mach-mxs/include/mach/devices-common.h
+++ b/arch/arm/mach-mxs/include/mach/devices-common.h
@@ -33,6 +33,7 @@ int __init mxs_add_duart(const struct amba_device *dev);
/* fec */
#include <linux/fec.h>
struct mxs_fec_data {
+ const char *devid;
int id;
resource_size_t iobase;
resource_size_t iosize;
--
1.7.1
^ permalink raw reply related
* [PATCH v4 06/10] ARM: mx28: update clock and device name for dual fec support
From: Shawn Guo @ 2011-01-14 6:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113150622.GV24920@pengutronix.de>
Hi Uwe,
On Thu, Jan 13, 2011 at 04:06:22PM +0100, Uwe Kleine-K?nig wrote:
> Hi Shawn,
>
> On Thu, Jan 06, 2011 at 03:13:14PM +0800, Shawn Guo wrote:
> > Change device name from "fec" to "imx28-fec", so that fec driver
> > can distinguish mx28.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
> > ---
> > Changes for v4:
> > - Use "imx28-fec" as fec device name
> >
> > Changes for v3:
> > - Change device name to "enet-mac"
> >
> > arch/arm/mach-mxs/clock-mx28.c | 3 ++-
> > arch/arm/mach-mxs/devices/platform-fec.c | 2 +-
> > 2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> > index f20b254..e2a8b0f 100644
> > --- a/arch/arm/mach-mxs/clock-mx28.c
> > +++ b/arch/arm/mach-mxs/clock-mx28.c
> > @@ -606,7 +606,8 @@ static struct clk_lookup lookups[] = {
> > _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)
> > /* for amba-pl011 driver */
> > _REGISTER_CLOCK("duart", NULL, uart_clk)
> > - _REGISTER_CLOCK("fec.0", NULL, fec_clk)
> > + _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk)
> > + _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk)
> > _REGISTER_CLOCK("rtc", NULL, rtc_clk)
> > _REGISTER_CLOCK("pll2", NULL, pll2_clk)
> > _REGISTER_CLOCK(NULL, "hclk", hbus_clk)
> > diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
> > index c08168c..c42dff7 100644
> > --- a/arch/arm/mach-mxs/devices/platform-fec.c
> > +++ b/arch/arm/mach-mxs/devices/platform-fec.c
> > @@ -45,6 +45,6 @@ struct platform_device *__init mxs_add_fec(
> > },
> > };
> >
> > - return mxs_add_platform_device("fec", data->id,
> > + return mxs_add_platform_device("imx28-fec", data->id,
> IMHO "imx28-fec" shouldn't be hard coded here but come from data. See
> imx-spi device registration for an example.
>
Sascha has merged the patch, so I will send a follow-up patch.
--
Regards,
Shawn
^ permalink raw reply
* [PATCH] mm/alignment.c: fixing compilation warning
From: Viresh Kumar @ 2011-01-14 6:25 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes following compilation warning:
warning: ?offset.un? may be used uninitialized in this function
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
arch/arm/mm/alignment.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 724ba3b..c5379f6 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -717,7 +717,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs,
static int
do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
{
- union offset_union offset;
+ union offset_union offset = {0};
unsigned long instr = 0, instrptr;
int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs);
unsigned int type;
--
1.7.2.2
^ permalink raw reply related
* [PATCH] ARM: make head.S less dependent on the compile time PHYS_OFFSET define
From: Nicolas Pitre @ 2011-01-14 6:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113232327.GG24149@n2100.arm.linux.org.uk>
On Thu, 13 Jan 2011, Russell King - ARM Linux wrote:
> On Thu, Jan 13, 2011 at 05:04:28PM -0500, Nicolas Pitre wrote:
> > + .macro phys_offset, rd
> > + mov \rd, pc
> > + and \rd, \rd, #0xf8000000
> > + .endm
>
> We can do loads better than that, as the p2v fixup code has proven.
> Now that r8 has been eliminated, I may rebase the p2v stuff ontop of
> that commit, and move the computation of phys_offset out of the p2v
> fixup code - and have it in r8 for __create_page_tables to use.
> FYI, the real PHYS_OFFSET value can be found by (eg):
>
> 1: .long .
> .long PAGE_OFFSET
>
> adr r0, 1b
> ldmia r0, {r1, r2}
> sub r1, r0, r1
> add r3, r2, r1
>
> r1 now contains the offset between virtual and physical spaces, r2
> contains the compile-time PAGE_OFFSET constant, and r3 the runtime
> equivalent of PHYS_OFFSET.
>
> None of this uses troublesome masking which will trip up on platforms
> such as MSM - we really must stop writing code which assumes that
> physical memory is aligned to >= 32MB.
That is more reliable indeed. But without visibility into your reworked
version of that code I opted for a less intrusive solution.
Unfortunately this trick can't work for CONFIG_AUTO_ZRELADDR.
Nicolas
^ permalink raw reply
* [PATCH v4 05/10] net/fec: add dual fec support for mx28
From: Shawn Guo @ 2011-01-14 5:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110113144805.GS24920@pengutronix.de>
Hi Uwe,
On Thu, Jan 13, 2011 at 03:48:05PM +0100, Uwe Kleine-K?nig wrote:
[...]
> > +/* Controller is ENET-MAC */
> > +#define FEC_QUIRK_ENET_MAC (1 << 0)
> does this really qualify to be a quirk?
>
My understanding is that ENET-MAC is a type of "quirky" FEC
controller.
> > +/* Controller needs driver to swap frame */
> > +#define FEC_QUIRK_SWAP_FRAME (1 << 1)
> IMHO this is a bit misnamed. FEC_QUIRK_NEEDS_BE_DATA or similar would
> be more accurate.
>
When your make this change, you may want to pick a better name for
function swap_buffer too.
[...]
> > +static void *swap_buffer(void *bufaddr, int len)
> > +{
> > + int i;
> > + unsigned int *buf = bufaddr;
> > +
> > + for (i = 0; i < (len + 3) / 4; i++, buf++)
> > + *buf = cpu_to_be32(*buf);
> if len isn't a multiple of 4 this accesses bytes behind len. Is this
> generally OK here? (E.g. because skbs always have a length that is a
> multiple of 4?)
The len may not be a multiple of 4. But I believe bufaddr is always
a buffer allocated in a length that is a multiple of 4, and the 1~3
bytes exceeding the len very likely has no data that matters. But
yes, it deserves a safer implementation.
[...]
> > + /*
> > + * The dual fec interfaces are not equivalent with enet-mac.
> > + * Here are the differences:
> > + *
> > + * - fec0 supports MII & RMII modes while fec1 only supports RMII
> > + * - fec0 acts as the 1588 time master while fec1 is slave
> > + * - external phys can only be configured by fec0
> > + *
> > + * That is to say fec1 can not work independently. It only works
> > + * when fec0 is working. The reason behind this design is that the
> > + * second interface is added primarily for Switch mode.
> > + *
> > + * Because of the last point above, both phys are attached on fec0
> > + * mdio interface in board design, and need to be configured by
> > + * fec0 mii_bus.
> > + */
> > + if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) {
> > + /* fec1 uses fec0 mii_bus */
> > + fep->mii_bus = fec0_mii_bus;
> > + return 0;
> What happens if imx28-fec.1 is probed before imx28-fec.0?
It's something that generally should not happen, as these two fec are
not equivalent, and fec.1 should always be added after fec.0 if you
intend to get dual interfaces. But yes, we should add error checking
for this case in the driver.
--
Regards,
Shawn
^ permalink raw reply
* [PATCH V3 25/63 resend] Newly erased page read workaround
From: viresh kumar @ 2011-01-14 5:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <6187de0568d1ea8a6aeb6c3ca54ac6684bee9973.1292833228.git.viresh.kumar@st.com>
On 12/20/2010 02:49 PM, Viresh KUMAR wrote:
> From: Vipin Kumar <vipin.kumar@st.com>
>
> A newly erased page contains ff in data as well as spare area. While reading an
> erased page, the read out ecc from spare area does not match the ecc generated
> by fsmc ecc hardware accelarator. This is because ecc of data ff ff is not ff
> ff. This leads to errors when jffs2 fs erases and reads back the pages to
> ensure consistency.
>
> This patch adds a software workaround to ensure that the ecc check is not
> performed for erased pages. An erased page is checked by checking data as ff ff.
David,
Does this patch looks fine to you??
--
viresh
^ permalink raw reply
* still nfs problems [Was: Linux 2.6.37-rc8]
From: Andy Isaacson @ 2011-01-14 4:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294972823.2841.2.camel@heimdal.trondhjem.org>
On Thu, Jan 13, 2011 at 09:40:23PM -0500, Trond Myklebust wrote:
> > My server is running 2.6.36.1, filesystem is ext3 on sda3 on AHCI,
> > client is currently running 2.6.37-rc1. I'm assuming that 37a09f will
> > fix it.
>
> Why are you sticking to 2.6.37-rc1 when the final 2.6.37 is out? There
> have been several readdir bugfixes merged in the months since -rc1 came
> out.
No good reason, just hadn't run into any reasons to update; switching
kernels is nonzero cost since the machine in question runs some out of
tree modules ergo updating is slightly more involved than "make && make
install". Above and beyond the costs of rebooting and losing state.
Actual bug is obviously a good reason to update though.
-andy
^ permalink raw reply
* [PATCH] ARM: msm: 7x30: don't force a gpiomux table for the whole arch
From: Rohit Vaswani @ 2011-01-14 3:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1294686030-9817-1-git-send-email-dima@android.com>
On 1/10/2011 11:00 AM, Dima Zavin wrote:
> This is completely board specific and therefore must be provided
> on a per-board basis.
>
> Change-Id: I96f922ad9bb9cbce7874c5ae6ac0d7479b7a2124
> Signed-off-by: Dima Zavin<dima@android.com>
>
Tested-by: Rohit Vaswani <rvaswani@codeaurora.org>
Thanks,
Rohit Vaswani
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ 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