From 362635bd50e386770ebaa2d5d090eb8cbf96430b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Tue, 18 Sep 2012 04:48:42 +0000 Subject: [PATCH 1/6] mx51evk: Add CONFIG_REVISION_TAG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FSL 2.6.35 kernel assumes that the bootloader passes the CONFIG_REVISION_TAG information. If this data is not present, the kernel misconfigures the TZIC, which results in the timer interrupt handler never being called, so the kernel deadlocks while calibrating its delay. Suggested-by: Greg Topmiller Signed-off-by: Benoît Thébaudeau Cc: Stefano Babic Cc: Fabio Estevam Acked-by: Fabio Estevam --- arch/arm/include/asm/arch-mx5/imx-regs.h | 2 ++ board/freescale/mx51evk/mx51evk.c | 8 ++++++++ include/configs/mx51evk.h | 1 + 3 files changed, 11 insertions(+) diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h b/arch/arm/include/asm/arch-mx5/imx-regs.h index d1ef15d04..46017f4ad 100644 --- a/arch/arm/include/asm/arch-mx5/imx-regs.h +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h @@ -321,6 +321,8 @@ #define BOARD_REV_1_0 0x0 #define BOARD_REV_2_0 0x1 +#define BOARD_VER_OFFSET 0x8 + #define IMX_IIM_BASE (IIM_BASE_ADDR) #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__)) diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index 7a0682a7e..a94701cbf 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -60,6 +60,14 @@ int dram_init(void) return 0; } +u32 get_board_rev(void) +{ + u32 rev = get_cpu_rev(); + if (!gpio_get_value(IMX_GPIO_NR(1, 22))) + rev |= BOARD_REV_2_0 << BOARD_VER_OFFSET; + return rev; +} + static void setup_iomux_uart(void) { unsigned int pad = PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE | diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h index ba4a4a623..7b027b42a 100644 --- a/include/configs/mx51evk.h +++ b/include/configs/mx51evk.h @@ -44,6 +44,7 @@ #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG +#define CONFIG_REVISION_TAG #define CONFIG_OF_LIBFDT From 5527024fdb10798d2975197f287457b29e2d4084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Wed, 8 Aug 2012 03:55:32 +0000 Subject: [PATCH 2/6] KARO TX25: Fix NAND Flash R/W cycle times MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NAND Flash of the KARO TX25 board is a Samsung K9F1G08U0B with 25-ns R/W cycle times. However, the NFC clock for this board was set to 66.5 MHz, so using the NFC driver in symmetric mode (i.e. 1 NFC clock cycle = 1 NF R/W cycle) resulted in NF R/W cycle times of 15 ns, hence corrupted NF accesses. This patch fixes this issue by setting the NFC clock to the highest frequency complying to the 25-ns NF R/W cycle times specification, i.e. 33.25 MHz. Signed-off-by: Benoît Thébaudeau Cc: John Rigby Cc: Scott Wood Cc: Stefano Babic Cc: Daniel Gachet Acked-by: Stefano Babic --- board/karo/tx25/lowlevel_init.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board/karo/tx25/lowlevel_init.S b/board/karo/tx25/lowlevel_init.S index 823df1070..eb3f18780 100644 --- a/board/karo/tx25/lowlevel_init.S +++ b/board/karo/tx25/lowlevel_init.S @@ -66,6 +66,14 @@ write32 0x53f80064, 0x45600000 write32 0x53f80008, 0x20034000 + /* + * PCDR2: NFC = 33.25 MHz + * This is required for the NAND Flash of this board, which is a Samsung + * K9F1G08U0B with 25-ns R/W cycle times, in order to make it work with + * the NFC driver in symmetric (i.e. one-cycle) mode. + */ + write32 0x53f80020, 0x01010103 + /* * enable all implemented clocks in all three * clock control registers From 5436eaeab9155633fd858e0a6b876d1077348d94 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 21 Sep 2012 10:00:53 +0000 Subject: [PATCH 3/6] mx28evk: Remove fecmxc_mii_postcall() fecmxc_mii_postcall() is specific to the KSZ9021 PHY on m28evk and should not be used on mx28evk, which has LAN8270 instead. Signed-off-by: Fabio Estevam Acked-by: Marek Vasut --- board/freescale/mx28evk/mx28evk.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/board/freescale/mx28evk/mx28evk.c b/board/freescale/mx28evk/mx28evk.c index d782aea61..6e719ffc3 100644 --- a/board/freescale/mx28evk/mx28evk.c +++ b/board/freescale/mx28evk/mx28evk.c @@ -100,19 +100,6 @@ int board_mmc_init(bd_t *bis) #ifdef CONFIG_CMD_NET -#define MII_OPMODE_STRAP_OVERRIDE 0x16 -#define MII_PHY_CTRL1 0x1e -#define MII_PHY_CTRL2 0x1f - -int fecmxc_mii_postcall(int phy) -{ - miiphy_write("FEC1", phy, MII_BMCR, 0x9000); - miiphy_write("FEC1", phy, MII_OPMODE_STRAP_OVERRIDE, 0x0202); - if (phy == 3) - miiphy_write("FEC1", 3, MII_PHY_CTRL2, 0x8180); - return 0; -} - int board_eth_init(bd_t *bis) { struct mxs_clkctrl_regs *clkctrl_regs = @@ -152,24 +139,12 @@ int board_eth_init(bd_t *bis) return -EINVAL; } - ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall); - if (ret) { - puts("FEC MXS: Unable to register FEC0 mii postcall\n"); - return ret; - } - dev = eth_get_dev_by_name("FEC1"); if (!dev) { puts("FEC MXS: Unable to get FEC1 device entry\n"); return -EINVAL; } - ret = fecmxc_register_mii_postcall(dev, fecmxc_mii_postcall); - if (ret) { - puts("FEC MXS: Unable to register FEC1 mii postcall\n"); - return ret; - } - return ret; } From 5f8e17ce158894b46acb25b975c579fae2350523 Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Sun, 23 Sep 2012 07:30:54 +0000 Subject: [PATCH 4/6] i.MX: mxc_ipuv3_fb: add ipuv3_fb_shutdown() routine to stop IPU frame buffer Signed-off-by: Eric Nelson Tested-by: Fabio Estevam --- drivers/video/mxc_ipuv3_fb.c | 20 ++++++++++++++++++++ include/ipu_pixfmt.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c index c38e22de1..47b336e7a 100644 --- a/drivers/video/mxc_ipuv3_fb.c +++ b/drivers/video/mxc_ipuv3_fb.c @@ -38,6 +38,7 @@ #include "videomodes.h" #include "ipu.h" #include "mxcfb.h" +#include "ipu_regs.h" static int mxcfb_map_video_memory(struct fb_info *fbi); static int mxcfb_unmap_video_memory(struct fb_info *fbi); @@ -576,6 +577,25 @@ err0: return ret; } +void ipuv3_fb_shutdown(void) +{ + int i; + struct ipu_stat *stat = (struct ipu_stat *)IPU_STAT; + + for (i = 0; i < ARRAY_SIZE(mxcfb_info); i++) { + struct fb_info *fbi = mxcfb_info[i]; + if (fbi) { + struct mxcfb_info *mxc_fbi = fbi->par; + ipu_disable_channel(mxc_fbi->ipu_ch); + ipu_uninit_channel(mxc_fbi->ipu_ch); + } + } + for (i = 0; i < ARRAY_SIZE(stat->int_stat); i++) { + __raw_writel(__raw_readl(&stat->int_stat[i]), + &stat->int_stat[i]); + } +} + void *video_hw_init(void) { int ret; diff --git a/include/ipu_pixfmt.h b/include/ipu_pixfmt.h index 0019898d5..4baa71187 100644 --- a/include/ipu_pixfmt.h +++ b/include/ipu_pixfmt.h @@ -77,5 +77,6 @@ #define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */ int ipuv3_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt); +void ipuv3_fb_shutdown(void); #endif From e1eb75b535fd3976cf68aa29a970efb9bdd138be Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Sun, 23 Sep 2012 07:30:55 +0000 Subject: [PATCH 5/6] i.MX: shut down video before launch of O/S Signed-off-by: Eric Nelson --- arch/arm/imx-common/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index fa1d46804..a10d12d97 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef CONFIG_FSL_ESDHC #include @@ -138,3 +139,11 @@ u32 get_ahb_clk(void) return get_periph_clk() / (ahb_podf + 1); } + +#if defined(CONFIG_VIDEO_IPUV3) +void arch_preboot_os(void) +{ + /* disable video before launching O/S */ + ipuv3_fb_shutdown(); +} +#endif From 7577a4b3c27af9ad21a4aedf732754ae96225448 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 21 Sep 2012 03:02:03 +0000 Subject: [PATCH 6/6] mx28evk: Add missing 'setexpr' command The environment now uses expressions but we missed the setexpr command was not being include. This patch adds it. Signed-off-by: Otavio Salvador --- include/configs/mx28evk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h index dffb744c3..7cdbec68d 100644 --- a/include/configs/mx28evk.h +++ b/include/configs/mx28evk.h @@ -63,6 +63,7 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_NFS #define CONFIG_CMD_PING +#define CONFIG_CMD_SETEXPR #define CONFIG_CMD_SF #define CONFIG_CMD_SPI #define CONFIG_CMD_USB