Skip to contentSkip to conversation

BLOCK: Add freescale IMX51 PATA driver

PATCH New Marek Vasut 2 participants 7 messages Jan 12, 2011 – Jan 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 BLOCK: Add freescale IMX51 PATA driver

---
 drivers/block/Makefile  |    1 +
 drivers/block/mxc_ata.c |  149 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100644 drivers/block/mxc_ata.c
drivers/block/Makefile +1 -0
index e27175b..aa7dc87 100644
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
 COBJS-$(CONFIG_LIBATA) += libata.o
 COBJS-$(CONFIG_CMD_MG_DISK) += mg_disk.o
 COBJS-$(CONFIG_MVSATA_IDE) += mvsata_ide.o
+COBJS-$(CONFIG_MX51_PATA) += mxc_ata.o
 COBJS-$(CONFIG_PATA_BFIN) += pata_bfin.o
 COBJS-$(CONFIG_SATA_DWC) += sata_dwc.o
 COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
drivers/block/mxc_ata.c new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 2/2 iMX5: EfikaMX: Work-in-progress board support

---
 board/efikamx/Makefile     |   52 ++++
 board/efikamx/config.mk    |   25 ++
 board/efikamx/efikamx.c    |  668 ++++++++++++++++++++++++++++++++++++++++++++
 board/efikamx/imximage.cfg |  124 ++++++++
 boards.cfg                 |    1 +
 include/configs/efikamx.h  |  233 +++++++++++++++
 6 files changed, 1103 insertions(+), 0 deletions(-)
 create mode 100644 board/efikamx/Makefile
 create mode 100644 board/efikamx/config.mk
 create mode 100644 board/efikamx/efikamx.c
 create mode 100644 board/efikamx/imximage.cfg
 create mode 100644 include/configs/efikamx.h
board/efikamx/Makefile new file +52 -0
new file mode 100644
index 0000000..ee4a16e
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2010, Marek Vasut <[email protected]>
+#
+# BASED ON: imx51evk
+#
+# Copyright (C) 2007, Guennadi Liakhovetski <[email protected]>
+#
+# (C) Copyright 2009 Freescale Semiconductor, Inc.
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= efikamx.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/efikamx/config.mk new file +25 -0
new file mode 100644
index 0000000..6e90671
@@ -0,0 +1,25 @@
+#
+# Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+CONFIG_SYS_TEXT_BASE = 0x97800000
+IMX_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/imximage.cfg
+ALL += $(obj)u-boot.imx
board/efikamx/efikamx.c new file +668 -0

668 lines not on this page · raw message

board/efikamx/imximage.cfg new file +124 -0

124 lines not on this page · raw message

boards.cfg +1 -0
index 94b8745..6be81c1 100644
@@ -105,6 +105,7 @@ magnesium                    arm         arm926ejs   imx27lite           logicpd
 omap5912osk                  arm         arm926ejs   -                   ti             omap
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 ca9x4_ct_vxp                 arm         armv7       vexpress            armltd
+efikamx                      arm         armv7       efikamx             -              mx5
 mx51evk                      arm         armv7       mx51evk             freescale      mx5
 vision2                      arm         armv7       vision2             ttcontrol      mx5
 omap3_overo                  arm         armv7       overo               -              omap3
include/configs/efikamx.h new file +233 -0

233 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#2 lore raw

PATCH 2/2 iMX5: EfikaMX: Work-in-progress board support

Quoted 14 lines · Marek Vasut
---
 board/efikamx/Makefile     |   52 ++++
 board/efikamx/config.mk    |   25 ++
 board/efikamx/efikamx.c    |  668 ++++++++++++++++++++++++++++++++++++++++++++
 board/efikamx/imximage.cfg |  124 ++++++++
 boards.cfg                 |    1 +
 include/configs/efikamx.h  |  233 +++++++++++++++
 6 files changed, 1103 insertions(+), 0 deletions(-)
 create mode 100644 board/efikamx/Makefile
 create mode 100644 board/efikamx/config.mk
 create mode 100644 board/efikamx/efikamx.c
 create mode 100644 board/efikamx/imximage.cfg
 create mode 100644 include/configs/efikamx.h

Could you describe better which is the current status for this porting and define what is already supported ? I mean, "work-in-progress" tells me nothing about which peripherals are working and which not. Could you add to your commit-id a short description, adding on which hardware u-boot is running (on the development board ? on efika smarttotp ? on efiga smartbook ? on all of them ?), and which peripherals are currently supported.

You should add your name to the MAINTAINERS file, too.

Quoted 20 lines
board/efikamx/efikamx.c new file +17 -0
new file mode 100644
index 0000000..10cf111
+/******************************************************************************
+ * Shared variables / local defines
+ ******************************************************************************/
+/* LED */
+#define	EFIKAMX_LED_BLUE	0x1
+#define	EFIKAMX_LED_GREEN	0x2
+#define	EFIKAMX_LED_RED		0x4
+
+void efikamx_toggle_led(uint32_t mask);
+
+/* Board revisions */
+#define	EFIKAMX_BOARD_REV_11	0x1
+#define	EFIKAMX_BOARD_REV_12	0x2
+#define	EFIKAMX_BOARD_REV_13	0x3
+#define	EFIKAMX_BOARD_REV_14	0x4
+
+/******************************************************************************

board/efikamx/efikamx.c line 68

Quoted 10 lines
board/efikamx/efikamx.c new file +10 -0
+ * Board identification
+ ******************************************************************************/
+static u32 board_rev;
+
+u32 get_efika_rev(void)
+{
+	u32 rev = 0;
+	/*
+	 * Retrieve board ID:
+	 * 	rev1.1: 1,1,1

^---spaces instead of tabs, please fix globally

board/efikamx/efikamx.c line 74

Quoted 6 lines
board/efikamx/efikamx.c new file +6 -0
+	 * 	rev1.2: 1,1,0
+	 * 	rev1.3: 1,0,1
+	 * 	rev1.4: 1,0,0
+	 */
+	mxc_request_iomux(MX51_PIN_NANDF_CS0, IOMUX_CONFIG_GPIO);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0), MXC_GPIO_DIRECTION_OUT);

Line too long, please fix globally.

board/efikamx/efikamx.c line 91

Quoted 4 lines
board/efikamx/efikamx.c new file +4 -0
+	mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_GPIO);
+	mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, PAD_CTL_100K_PU);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3), MXC_GPIO_DIRECTION_IN);
+	rev |= (!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;

Is it ok to leave the NAND pins configured as GPIO, or should they set back for the NFC controller ?

board/efikamx/efikamx.c line 133

Quoted 4 lines
board/efikamx/efikamx.c new file +4 -0
+/******************************************************************************
+ * SPI configuration
+ ******************************************************************************/
+#ifdef CONFIG_MXC_SPI

Is there a reason why CONFIG_MXC_SPI is not set ? As I understand, it is required to set the PMIC to make things working. If CONFIG_MXC_SPI, something wrong happens. I would prefer you drop the #ifdef, and instead of that you add a check at the beginning of the file reporting a compiler error if CONFIG_MXC_SPI is not set.

Quoted 14 lines
board/efikamx/efikamx.c new file +14 -0
+static void power_init(void)
+{
+	unsigned int val;
+	unsigned int reg;
+	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+
+	/* Write needed to Power Gate 2 register */
+	val = pmic_reg_read(REG_POWER_MISC);
+	val &= ~PWGT2SPIEN;
+	pmic_reg_write(REG_POWER_MISC, val);
+
+	/* Externally powered */
+	val = pmic_reg_read(REG_CHARGE);
+	val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;

board/efikamx/efikamx.c line 197

Quoted 10 lines
board/efikamx/efikamx.c new file +10 -0
+	pmic_reg_write(REG_CHARGE, val);
+
+	/* power up the system first */
+	pmic_reg_write(REG_POWER_MISC, PWUP);
+
+	/* NOTE: if (is_soc_rev(CHIP_REV_2_0) >= 0) */
+
+	/* Set core voltage to 1.1V */
+	val = pmic_reg_read(REG_SW_0);
+	val = (val & (~0x1F)) | 0x14;

Replace fix constants with defines, adding them to mc13892.h if they are missing.

board/efikamx/efikamx.c line 202

Quoted 5 lines
board/efikamx/efikamx.c new file +5 -0
+	pmic_reg_write(REG_SW_0, val);
+
+	/* Setup VCC (SW2) to 1.25 */
+	val = pmic_reg_read(REG_SW_1);
+	val = (val & (~0x1F)) | 0x1A;

Ditto

board/efikamx/efikamx.c line 504

Quoted 3 lines
board/efikamx/efikamx.c new file +3 -0
+	/* Green LED */
+	mxc_request_iomux(MX51_PIN_CSI1_VSYNC, IOMUX_CONFIG_ALT3);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC), MXC_GPIO_DIRECTION_OUT);

Line to long

board/efikamx/efikamx.c line 512

Quoted 3 lines
board/efikamx/efikamx.c new file +3 -0
+void efikamx_toggle_led(uint32_t mask)
+{
+	mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9), mask & EFIKAMX_LED_BLUE); 

^
|--- trailing whitespaces

board/efikamx/efikamx.c line 652

Quoted 2 lines
board/efikamx/efikamx.c new file +2 -0
+
+	switch (__raw_readl(SRC_BASE_ADDR + 0x8)) {

We have a structure for this register,please use struct src from imx_regs.h

board/efikamx/efikamx.c

Quoted 4 lines
board/efikamx/efikamx.c new file +4 -0
+# Boot Device : one of
+# spi, sd (the board has no nand neither onenand)
+
+# FIX XXX

Why fix ?

Quoted 30 lines
include/configs/efikamx.h new file +24 -0
new file mode 100644
index 0000000..cb29bcd
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2007, Guennadi Liakhovetski <[email protected]>
+ *
+ * (C) Copyright 2009 Freescale Semiconductor, Inc.
+ *
+ * Configuration settings for the MX51EVK Board
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H

include/configs/efikamx.h line 34

Quoted 10 lines
include/configs/efikamx.h new file +10 -0
+#define __CONFIG_H
+
+#include <asm/arch/imx-regs.h>
+#include <config_cmd_default.h>
+
+/*
+ * High Level Board Configuration Options
+ */
+/* An i.MX51 CPU */
+#define CONFIG_MX51

Move this define before including imx-regs.h. Patches for mx53evk are currently merged in u-boot-imx, and the imx-regs.h file has an #ifdef CONFIG_MX51 switch to define the different offsets for the two processors.

include/configs/efikamx.h line 100

Quoted 13 lines
include/configs/efikamx.h new file +13 -0
+/*
+ * SPI Interface
+ */
+#ifdef	CONFIG_CMD_SPI
+
+#define CONFIG_HARD_SPI			1
+#define CONFIG_MXC_SPI			1
+#define CONFIG_DEFAULT_SPI_BUS		1
+#define CONFIG_DEFAULT_SPI_MODE		(SPI_MODE_0 | SPI_CS_HIGH)
+
+/* SPI FLASH */
+#ifdef	CONFIG_CMD_SF
+#define CONFIG_FSL_SF

I see, I let this useless CONFIG_ when I developped the vision2 board. However, CONFIG_FSL_SF is not used at all in u-boot. It was a test I made using a SPI flash driver from Freescale's code. You should drop it, and I have to do the same for the vision2.

include/configs/efikamx.h line 104

Quoted 4 lines
include/configs/efikamx.h new file +4 -0
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SST
+#define CONFIG_SPI_FLASH_CS		(1 | 121 << 8)

Is it possible that the efika use exactly the same gpio (GPIO4_25) as the vision2 board, or it is only a cut&paste error ?

include/configs/efikamx.h line 150

Quoted 1 line
include/configs/efikamx.h new file +1 -0
+#define	__io

I think we have already discussed abot this define. Should it not move to another file, such as imx-regs.h ? Or is there a better solution ?

Best regards
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#3 lore raw

PATCH 2/2 iMX5: EfikaMX: Work-in-progress board support

Quoted 18 lines · On Thursday 13 January 2011 10:37:47 Stefano Babic wrote:
Quoted 16 lines · Marek Vasut

---

 board/efikamx/Makefile     |   52 ++++
 board/efikamx/config.mk    |   25 ++
 board/efikamx/efikamx.c    |  668
 ++++++++++++++++++++++++++++++++++++++++++++ board/efikamx/imximage.cfg
 |  124 ++++++++
 boards.cfg                 |    1 +
 include/configs/efikamx.h  |  233 +++++++++++++++
 6 files changed, 1103 insertions(+), 0 deletions(-)
 create mode 100644 board/efikamx/Makefile
 create mode 100644 board/efikamx/config.mk
 create mode 100644 board/efikamx/efikamx.c
 create mode 100644 board/efikamx/imximage.cfg
 create mode 100644 include/configs/efikamx.h
Quoted 7 lines

Could you describe better which is the current status for this porting and define what is already supported ? I mean, "work-in-progress" tells me nothing about which peripherals are working and which not. Could you add to your commit-id a short description, adding on which hardware u-boot is running (on the development board ? on efika smarttotp ? on efiga smartbook ? on all of them ?), and which peripherals are currently supported.

Will do, sry

Quoted 29 lines

You should add your name to the MAINTAINERS file, too.

Quoted 26 lines
board/efikamx/efikamx.c new file +1 -0
new file mode 100644
index 0000000..10cf111
+/***********************************************************************

******* + * Shared variables / local defines
+
************************************************************************
******/ +/* LED */

board/efikamx/efikamx.c new file +13 -0
+#define	EFIKAMX_LED_BLUE	0x1
+#define	EFIKAMX_LED_GREEN	0x2
+#define	EFIKAMX_LED_RED		0x4
+
+void efikamx_toggle_led(uint32_t mask);
+
+/* Board revisions */
+#define	EFIKAMX_BOARD_REV_11	0x1
+#define	EFIKAMX_BOARD_REV_12	0x2
+#define	EFIKAMX_BOARD_REV_13	0x3
+#define	EFIKAMX_BOARD_REV_14	0x4
+
+/***********************************************************************

******* + * Board identification
+
************************************************************************
******/ +static u32 board_rev;
+

Quoted 8 lines

board/efikamx/efikamx.c line 68

Quoted 6 lines
board/efikamx/efikamx.c new file +6 -0
+u32 get_efika_rev(void)
+{
+	u32 rev = 0;
+	/*
+	 * Retrieve board ID:
+	 * 	rev1.1: 1,1,1

^---spaces instead of tabs, please fix globally

Fixed in v2

Quoted 10 lines
Quoted 8 lines
board/efikamx/efikamx.c new file +6 -0
+	 * 	rev1.2: 1,1,0
+	 * 	rev1.3: 1,0,1
+	 * 	rev1.4: 1,0,0
+	 */
+	mxc_request_iomux(MX51_PIN_NANDF_CS0, IOMUX_CONFIG_GPIO);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_CS0),

MXC_GPIO_DIRECTION_OUT);

Line too long, please fix globally.

DTTO

Quoted 9 lines
Quoted 6 lines
board/efikamx/efikamx.c new file +3 -0
+	mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_GPIO);
+	mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, PAD_CTL_100K_PU);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3),

MXC_GPIO_DIRECTION_IN); + rev |=
(!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;

Is it ok to leave the NAND pins configured as GPIO, or should they set back for the NFC controller ?

I don't think there is even NAND used on efikamx. Though I might be mistaken.

Quoted 12 lines
Quoted 6 lines

+/*********************************************************************** ******* + * SPI configuration
+
************************************************************************
******/ +#ifdef CONFIG_MXC_SPI

Is there a reason why CONFIG_MXC_SPI is not set ? As I understand, it is required to set the PMIC to make things working. If CONFIG_MXC_SPI, something wrong happens. I would prefer you drop the #ifdef, and instead of that you add a check at the beginning of the file reporting a compiler error if CONFIG_MXC_SPI is not set.

I added compile-time check. Fixed in v2

Quoted 20 lines
Quoted 20 lines
board/efikamx/efikamx.c new file +19 -0
+static void power_init(void)
+{
+	unsigned int val;
+	unsigned int reg;
+	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE;
+
+	/* Write needed to Power Gate 2 register */
+	val = pmic_reg_read(REG_POWER_MISC);
+	val &= ~PWGT2SPIEN;
+	pmic_reg_write(REG_POWER_MISC, val);
+
+	/* Externally powered */
+	val = pmic_reg_read(REG_CHARGE);
+	val |= ICHRG0 | ICHRG1 | ICHRG2 | ICHRG3 | CHGAUTOB;
+	pmic_reg_write(REG_CHARGE, val);
+
+	/* power up the system first */
+	pmic_reg_write(REG_POWER_MISC, PWUP);
+
Quoted 8 lines

board/efikamx/efikamx.c line 197

Quoted 5 lines
board/efikamx/efikamx.c new file +5 -0
+	/* NOTE: if (is_soc_rev(CHIP_REV_2_0) >= 0) */
+
+	/* Set core voltage to 1.1V */
+	val = pmic_reg_read(REG_SW_0);
+	val = (val & (~0x1F)) | 0x14;

Replace fix constants with defines, adding them to mc13892.h if they are missing.

Is any sane datasheet for this thing available ? If so, can you link me to it please?

Quoted 9 lines

board/efikamx/efikamx.c line 202

Quoted 6 lines
board/efikamx/efikamx.c new file +5 -0
+	pmic_reg_write(REG_SW_0, val);
+
+	/* Setup VCC (SW2) to 1.25 */
+	val = pmic_reg_read(REG_SW_1);
+	val = (val & (~0x1F)) | 0x1A;

Ditto

Quoted 6 lines
Quoted 4 lines
board/efikamx/efikamx.c new file +3 -0
+	/* Green LED */
+	mxc_request_iomux(MX51_PIN_CSI1_VSYNC, IOMUX_CONFIG_ALT3);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_CSI1_VSYNC),

MXC_GPIO_DIRECTION_OUT);

Line to long

Fixed in v2

Quoted 8 lines

board/efikamx/efikamx.c line 512

Quoted 4 lines
board/efikamx/efikamx.c new file +3 -0
+void efikamx_toggle_led(uint32_t mask)
+{
+	mxc_gpio_set(IOMUX_TO_GPIO(MX51_PIN_CSI1_D9), mask & EFIKAMX_LED_BLUE);

^

|--- trailing whitespaces

Fixed in v2

Quoted 6 lines

board/efikamx/efikamx.c line 652

Quoted 3 lines
board/efikamx/efikamx.c new file +2 -0
+
+	switch (__raw_readl(SRC_BASE_ADDR + 0x8)) {

We have a structure for this register,please use struct src from imx_regs.h

Quoted 6 lines

board/efikamx/efikamx.c

Quoted 4 lines
board/efikamx/efikamx.c new file +4 -0
+# Boot Device : one of
+# spi, sd (the board has no nand neither onenand)
+
+# FIX XXX

Why fix ?

Ah, that's because I used SD card to boot it, it should officially boot from SPI nor. Fixed in v2

Quoted 37 lines
Quoted 37 lines
include/configs/efikamx.h new file +30 -0
new file mode 100644
index 0000000..cb29bcd
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2007, Guennadi Liakhovetski <[email protected]>
+ *
+ * (C) Copyright 2009 Freescale Semiconductor, Inc.
+ *
+ * Configuration settings for the MX51EVK Board
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <asm/arch/imx-regs.h>
+#include <config_cmd_default.h>
+
+/*
Quoted 8 lines

include/configs/efikamx.h line 34

Quoted 4 lines
include/configs/efikamx.h new file +4 -0
+ * High Level Board Configuration Options
+ */
+/* An i.MX51 CPU */
+#define CONFIG_MX51

Move this define before including imx-regs.h. Patches for mx53evk are currently merged in u-boot-imx, and the imx-regs.h file has an #ifdef CONFIG_MX51 switch to define the different offsets for the two processors.

Fixed in v2

Quoted 11 lines
Quoted 11 lines
include/configs/efikamx.h new file +10 -0
+/*
+ * SPI Interface
+ */
+#ifdef	CONFIG_CMD_SPI
+
+#define CONFIG_HARD_SPI			1
+#define CONFIG_MXC_SPI			1
+#define CONFIG_DEFAULT_SPI_BUS		1
+#define CONFIG_DEFAULT_SPI_MODE		(SPI_MODE_0 | SPI_CS_HIGH)
+
Quoted 8 lines

include/configs/efikamx.h line 100

Quoted 3 lines
include/configs/efikamx.h new file +3 -0
+/* SPI FLASH */
+#ifdef	CONFIG_CMD_SF
+#define CONFIG_FSL_SF

I see, I let this useless CONFIG_ when I developped the vision2 board. However, CONFIG_FSL_SF is not used at all in u-boot. It was a test I made using a SPI flash driver from Freescale's code. You should drop it, and I have to do the same for the vision2.

Fixed in v2

Quoted 8 lines

include/configs/efikamx.h line 104

Quoted 5 lines
include/configs/efikamx.h new file +4 -0
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SST
+#define CONFIG_SPI_FLASH_CS		(1 | 121 << 8)

Is it possible that the efika use exactly the same gpio (GPIO4_25) as the vision2 board, or it is only a cut&paste error ?

seems to be the same.

Quoted 5 lines

include/configs/efikamx.h line 150

Quoted 2 lines
include/configs/efikamx.h new file +1 -0
+#define	__io

I think we have already discussed abot this define. Should it not move to another file, such as imx-regs.h ? Or is there a better solution ?

The thread where we discussed this got deaf. I tried asking further, but no reply :-(

Quoted 3 lines

Best regards
Stefano Babic

Thanks for the review, it helped greatly.

Cheers

#4 lore raw

PATCH 2/2 iMX5: EfikaMX: Work-in-progress board support

Quoted 10 lines · Marek Vasut
Quoted 8 lines
Quoted 5 lines
board/efikamx/efikamx.c new file +3 -0
+	mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_GPIO);
+	mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, PAD_CTL_100K_PU);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3),

MXC_GPIO_DIRECTION_IN); + rev |=
(!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;

Is it ok to leave the NAND pins configured as GPIO, or should they set back for the NFC controller ?

I don't think there is even NAND used on efikamx. Though I might be mistaken.

Understood, then I agree to leave the iomux set with gpios.

Quoted 6 lines
Quoted 3 lines

Replace fix constants with defines, adding them to mc13892.h if they are missing.

Is any sane datasheet for this thing available ? If so, can you link me to it please?

There is a datasheet, I do not know if you can consider it "sane" ;-)

http://cache.freescale.com/files/analog/doc/data_sheet/MC13892.pdf?fpsp=1

The register description is quite spread in the manual. You can see the complete SPI Bitmap on pages 118-121.

I have already set most constants in include/mc13892.h, probably there are some missing.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+#define __io

I think we have already discussed abot this define. Should it not move to another file, such as imx-regs.h ? Or is there a better solution ?

The thread where we discussed this got deaf. I tried asking further, but no reply :-(

Agree, I remember the issue, I do not remember any decision. Anyway, I think the position of this macro is wrong. It is related to the processor, that can have it or not, and it is not related to the board. I see that in u-boot __io is defined in board configuration file, but I do not think it is correct.

At least I will suggest to move this define in the processor related file (-->imx-regs.h).

Cheers,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#5 lore raw

PATCH 2/2 iMX5: EfikaMX: Work-in-progress board support

Quoted 39 lines · On Thursday 13 January 2011 18:46:02 Stefano Babic wrote:
Quoted 11 lines · Marek Vasut
Quoted 8 lines
Quoted 5 lines
board/efikamx/efikamx.c new file +3 -0
+	mxc_request_iomux(MX51_PIN_NANDF_RB3, IOMUX_CONFIG_GPIO);
+	mxc_iomux_set_pad(MX51_PIN_NANDF_RB3, PAD_CTL_100K_PU);
+	mxc_gpio_direction(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3),

MXC_GPIO_DIRECTION_IN); + rev |=
(!!mxc_gpio_get(IOMUX_TO_GPIO(MX51_PIN_NANDF_RB3))) << 2;

Is it ok to leave the NAND pins configured as GPIO, or should they set back for the NFC controller ?

I don't think there is even NAND used on efikamx. Though I might be mistaken.

Understood, then I agree to leave the iomux set with gpios.

Quoted 5 lines
Quoted 2 lines

Replace fix constants with defines, adding them to mc13892.h if they are missing.

Is any sane datasheet for this thing available ? If so, can you link me to it please?

There is a datasheet, I do not know if you can consider it "sane" ;-)

http://cache.freescale.com/files/analog/doc/data_sheet/MC13892.pdf?fpsp=1

The register description is quite spread in the manual. You can see the complete SPI Bitmap on pages 118-121.

I have already set most constants in include/mc13892.h, probably there are some missing.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+#define __io

I think we have already discussed abot this define. Should it not move to another file, such as imx-regs.h ? Or is there a better solution ?

The thread where we discussed this got deaf. I tried asking further, but no reply :-(

Quoted 8 lines

Agree, I remember the issue, I do not remember any decision. Anyway, I think the position of this macro is wrong. It is related to the processor, that can have it or not, and it is not related to the board. I see that in u-boot __io is defined in board configuration file, but I do not think it is correct.

At least I will suggest to move this define in the processor related file (-->imx-regs.h).

This is a problem, if __io is defined there, it won't be defined in the ide driver.

Quoted 3 lines

Cheers,
Stefano

#6 lore raw

PATCH 1/2 BLOCK: Add freescale IMX51 PATA driver

In reply to Marek Vasut
Quoted 6 lines · Marek Vasut
---
 drivers/block/Makefile  |    1 +
 drivers/block/mxc_ata.c |  149 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100644 drivers/block/mxc_ata.c

Hi Marek,

drivers/block/mxc_ata.c line 97

Quoted 11 lines
drivers/block/mxc_ata.c new file +11 -0
+
+/* PIO timing table */
+#define	NR_PIO_SPECS	5
+uint16_t pio_t0[NR_PIO_SPECS]		= { 600, 383, 240, 180, 120 };
+uint16_t pio_t1[NR_PIO_SPECS]		= { 70,  50,  30,  30,  25 };
+uint16_t pio_t2_8[NR_PIO_SPECS]		= { 290, 290, 290, 80,  70 };
+uint16_t pio_t2_16[NR_PIO_SPECS]	= { 165, 125, 100, 80,  70 };
+uint16_t pio_t2i[NR_PIO_SPECS]		= { 40,  0,   0,   0,   0 };
+uint16_t pio_t4[NR_PIO_SPECS]		= { 30,  20,  15,  10,  10 };
+uint16_t pio_t9[NR_PIO_SPECS]		= { 20,  15,  10,  10,  10 };
+uint16_t pio_tA[NR_PIO_SPECS]		= { 50,  50,  50,  50,  50 };

As these array are only used here, they should be static.

drivers/block/mxc_ata.c line 119

Quoted 3 lines
drivers/block/mxc_ata.c new file +3 -0
+
+	/* Write TIME_2R/AX/RDX/4 */
+	val =	(((pio_t2_8[mode] + T) / T) << REG2OFF(&ata_cfg_regs->time_2r)) |

Line too long, please fix globally.

drivers/block/mxc_ata.c line 120

Quoted 1 line
drivers/block/mxc_ata.c new file +1 -0
+		(((pio_tA[mode] + T) / T + 2) << REG2OFF(&ata_cfg_regs->time_ax)) |

Ditto.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================