From 2e7db33d4be94b82d7818b3f60d5852b8840364f Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 23 Feb 2012 10:09:07 +0100 Subject: ARM: add initial i.MX6 support Signed-off-by: Sascha Hauer --- drivers/mci/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig index 73efa66374..b1a678e17a 100644 --- a/drivers/mci/Kconfig +++ b/drivers/mci/Kconfig @@ -54,7 +54,7 @@ config MCI_IMX config MCI_IMX_ESDHC bool "i.MX esdhc" - depends on ARCH_IMX25 || ARCH_IMX35 || ARCH_IMX51 || ARCH_IMX53 + depends on ARCH_IMX help Enable this entry to add support to read and write SD cards on a Freescale i.MX25/35/51 based system. -- cgit v1.2.3 From e0c18c08665b93b3c81eb7ab504238cda85c2674 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 5 Oct 2011 09:08:13 +0200 Subject: serial i.MX: i.MX6 support Signed-off-by: Sascha Hauer --- drivers/serial/serial_imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 72771fc104..1e1e8e3157 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -162,7 +162,7 @@ #endif #if defined CONFIG_ARCH_IMX31 || defined CONFIG_ARCH_IMX35 || \ defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX51 || \ - defined CONFIG_ARCH_IMX53 + defined CONFIG_ARCH_IMX53 || defined CONFIG_ARCH_IMX6 # define UCR1_VAL (0) # define UCR3_VAL (0x700 | UCR3_RXDMUXSEL) # define UCR4_VAL UCR4_CTSTL_32 -- cgit v1.2.3 From 86cfd96af42178a85ec085ddd5e2f471a02041db Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 12 Apr 2012 23:21:18 +0200 Subject: net fec: Add i.MX6 support Currently only 100Mb/s is tested. Freescale's U-Boot suggests that there are some additional adjustments necessary for Gigabit support. Signed-off-by: Sascha Hauer --- drivers/net/fec_imx.c | 25 ++++++++++++++++++++++--- include/fec.h | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c index 08cd761438..599a9b4099 100644 --- a/drivers/net/fec_imx.c +++ b/drivers/net/fec_imx.c @@ -274,7 +274,7 @@ static int fec_set_hwaddr(struct eth_device *dev, unsigned char *mac) static int fec_init(struct eth_device *dev) { struct fec_priv *fec = (struct fec_priv *)dev->priv; - u32 rcntl; + u32 rcntl, xwmrk; /* * Clear FEC-Lite interrupt event register(IEVENT) @@ -317,13 +317,25 @@ static int fec_init(struct eth_device *dev) writel(FEC_MIIGSK_ENR_EN, fec->regs + FEC_MIIGSK_ENR); } } + + if (fec->xcv_type == RGMII) + rcntl |= 1 << 6; + writel(rcntl, fec->regs + FEC_R_CNTRL); /* * Set Opcode/Pause Duration Register */ writel(0x00010020, fec->regs + FEC_OP_PAUSE); - writel(0x2, fec->regs + FEC_X_WMRK); + + xwmrk = 0x2; + + /* set ENET tx at store and forward mode */ + if (cpu_is_mx6()) + xwmrk |= 1 << 8; + + writel(xwmrk, fec->regs + FEC_X_WMRK); + /* * Set multicast address filter */ @@ -349,6 +361,7 @@ static int fec_open(struct eth_device *edev) { struct fec_priv *fec = (struct fec_priv *)edev->priv; int ret; + u32 ecr; /* * Initialize RxBD/TxBD rings @@ -363,7 +376,13 @@ static int fec_open(struct eth_device *edev) /* * Enable FEC-Lite controller */ - writel(FEC_ECNTRL_ETHER_EN, fec->regs + FEC_ECNTRL); + ecr = FEC_ECNTRL_ETHER_EN; + + /* Enable Swap to support little-endian device */ + if (cpu_is_mx6()) + ecr |= 0x100; + + writel(ecr, fec->regs + FEC_ECNTRL); /* * Enable SmartDMA receive task */ diff --git a/include/fec.h b/include/fec.h index 85691b6854..f56b02309d 100644 --- a/include/fec.h +++ b/include/fec.h @@ -33,6 +33,7 @@ typedef enum { MII10, MII100, RMII, + RGMII, } xceiver_type; /* -- cgit v1.2.3 From 6f20c7bc709dd5875b1066d5dae99d52cc18d51c Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 23 Feb 2012 10:13:40 +0100 Subject: mmc i.MX esdhc: Add i.MX6 support Signed-off-by: Sascha Hauer --- drivers/mci/imx-esdhc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index 6d0883c68b..ae3c805997 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -24,7 +24,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ - #include #include #include @@ -60,7 +59,8 @@ struct fsl_esdhc { u32 autoc12err; u32 hostcapblt; u32 wml; - char reserved1[8]; + u32 mixctrl; + char reserved1[4]; u32 fevt; char reserved2[168]; u32 hostver; @@ -234,7 +234,7 @@ static int esdhc_setup_data(struct mci_host *mci, struct mci_data *data) static int esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data) { - u32 xfertyp; + u32 xfertyp, mixctrl; u32 irqstat; struct fsl_esdhc_host *host = to_fsl_esdhc(mci); struct fsl_esdhc *regs = host->regs; @@ -266,6 +266,15 @@ esdhc_send_cmd(struct mci_host *mci, struct mci_cmd *cmd, struct mci_data *data) /* Send the command */ esdhc_write32(®s->cmdarg, cmd->cmdarg); + + if (cpu_is_mx6()) { + /* write lower-half of xfertyp to mixctrl */ + mixctrl = xfertyp & 0xFFFF; + /* Keep the bits 22-25 of the register as is */ + mixctrl |= (esdhc_read32(®s->mixctrl) & (0xF << 22)); + esdhc_write32(®s->mixctrl, mixctrl); + } + esdhc_write32(®s->xfertyp, xfertyp); /* Wait for the command to complete */ -- cgit v1.2.3 From 7753263c50d17696e487e188c1ef73df31c8ecff Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 13 Apr 2012 10:40:05 +0200 Subject: net mii: Add mii_open/mii_close functions Some phys need board specific fixups. To be able to do this from board code add mii_open/mii_close functions so that the board can use the regular mii_read/mii_write functions. Signed-off-by: Sascha Hauer --- drivers/net/miidev.c | 20 ++++++++++++++++++++ include/miidev.h | 5 +++++ 2 files changed, 25 insertions(+) (limited to 'drivers') diff --git a/drivers/net/miidev.c b/drivers/net/miidev.c index 3b73133201..cc84e63f1e 100644 --- a/drivers/net/miidev.c +++ b/drivers/net/miidev.c @@ -28,6 +28,8 @@ #include #include +static LIST_HEAD(miidev_list); + int miidev_restart_aneg(struct mii_device *mdev) { int status, timeout; @@ -226,6 +228,7 @@ static int miidev_probe(struct device_d *dev) mdev->cdev.priv = mdev; mdev->cdev.dev = dev; devfs_create(&mdev->cdev); + list_add_tail(&mdev->list, &miidev_list); return 0; } @@ -233,10 +236,27 @@ static void miidev_remove(struct device_d *dev) { struct mii_device *mdev = dev->priv; + list_del(&mdev->list); + free(mdev->cdev.name); devfs_remove(&mdev->cdev); } +struct mii_device *mii_open(const char *name) +{ + struct mii_device *mdev; + + list_for_each_entry(mdev, &miidev_list, list) { + if (!strcmp(name, mdev->cdev.name)) + return mdev; + } + return NULL; +} + +void mii_close(struct mii_device *mdev) +{ +} + static struct driver_d miidev_drv = { .name = "miidev", .probe = miidev_probe, diff --git a/include/miidev.h b/include/miidev.h index 8cd4c45000..622784f681 100644 --- a/include/miidev.h +++ b/include/miidev.h @@ -43,6 +43,7 @@ struct mii_device { struct eth_device *edev; struct cdev cdev; + struct list_head list; }; int mii_register(struct mii_device *dev); @@ -65,4 +66,8 @@ static int inline mii_read(struct mii_device *dev, int addr, int reg) { return dev->read(dev, addr, reg); } + +struct mii_device *mii_open(const char *name); +void mii_close(struct mii_device *mdev); + #endif /* __MIIDEV_H__ */ -- cgit v1.2.3