Merge branches 'topic/drivers/fpga-20141006', 'topic/drivers/mmc-20141006', 'topic...
authorMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:45:55 +0000 (17:45 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:45:55 +0000 (17:45 +0200)
arch/arm/include/asm/system.h
arch/arm/lib/cache-cp15.c
drivers/fpga/altera.c
drivers/mmc/dw_mmc.c
drivers/net/designware.c
drivers/net/phy/micrel.c
include/altera.h
include/configs/axs101.h
include/configs/socfpga_cyclone5.h
include/dwmmc.h

index d51ba668f32373f0be80f68bbdc4207048e10082..ca2d44faf4e935e7f80f7acff6adb5e96192d5cf 100644 (file)
@@ -185,6 +185,7 @@ enum dcache_option {
        DCACHE_OFF = 0x12,
        DCACHE_WRITETHROUGH = 0x1a,
        DCACHE_WRITEBACK = 0x1e,
+       DCACHE_WRITEALLOC = 0x16,
 };
 
 /* Size of an MMU section */
index 3e62d58542359c2f91e157a0954f9362a33b2817..2155fe818717163caaa59428dbd842e0ffd926db 100644 (file)
@@ -73,6 +73,8 @@ __weak void dram_bank_mmu_setup(int bank)
             i++) {
 #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
                set_section_dcache(i, DCACHE_WRITETHROUGH);
+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
+               set_section_dcache(i, DCACHE_WRITEALLOC);
 #else
                set_section_dcache(i, DCACHE_WRITEBACK);
 #endif
index 6e34a8e56e9c1191514901727e92c05b3c0d94e1..fd2b4f0103d2e0061cc4f2b975afa18508817305 100644 (file)
  *  Altera FPGA support
  */
 #include <common.h>
+#include <errno.h>
 #include <ACEX1K.h>
 #include <stratixII.h>
 
-/* Define FPGA_DEBUG to get debug printf's */
-/* #define FPGA_DEBUG */
+/* Define FPGA_DEBUG to 1 to get debug printf's */
+#define FPGA_DEBUG     0
 
-#ifdef FPGA_DEBUG
-#define        PRINTF(fmt,args...)     printf (fmt ,##args)
-#else
-#define PRINTF(fmt,args...)
-#endif
-
-/* Local Static Functions */
-static int altera_validate (Altera_desc * desc, const char *fn);
-
-/* ------------------------------------------------------------------------- */
-int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
-{
-       int ret_val = FPGA_FAIL;        /* assume a failure */
-
-       if (!altera_validate (desc, (char *)__FUNCTION__)) {
-               printf ("%s: Invalid device descriptor\n", __FUNCTION__);
-       } else {
-               switch (desc->family) {
-               case Altera_ACEX1K:
-               case Altera_CYC2:
+static const struct altera_fpga {
+       enum altera_family      family;
+       const char              *name;
+       int                     (*load)(Altera_desc *, const void *, size_t);
+       int                     (*dump)(Altera_desc *, const void *, size_t);
+       int                     (*info)(Altera_desc *);
+} altera_fpga[] = {
 #if defined(CONFIG_FPGA_ACEX1K)
-                       PRINTF ("%s: Launching the ACEX1K Loader...\n",
-                                       __FUNCTION__);
-                       ret_val = ACEX1K_load (desc, buf, bsize);
+       { Altera_ACEX1K, "ACEX1K", ACEX1K_load, ACEX1K_dump, ACEX1K_info },
+       { Altera_CYC2,   "ACEX1K", ACEX1K_load, ACEX1K_dump, ACEX1K_info },
 #elif defined(CONFIG_FPGA_CYCLON2)
-                       PRINTF ("%s: Launching the CYCLONE II Loader...\n",
-                                       __FUNCTION__);
-                       ret_val = CYC2_load (desc, buf, bsize);
-#else
-                       printf ("%s: No support for ACEX1K devices.\n",
-                                       __FUNCTION__);
+       { Altera_ACEX1K, "CycloneII", CYC2_load, CYC2_dump, CYC2_info },
+       { Altera_CYC2,   "CycloneII", CYC2_load, CYC2_dump, CYC2_info },
 #endif
-                       break;
-
 #if defined(CONFIG_FPGA_STRATIX_II)
-               case Altera_StratixII:
-                       PRINTF ("%s: Launching the Stratix II Loader...\n",
-                               __FUNCTION__);
-                       ret_val = StratixII_load (desc, buf, bsize);
-                       break;
+       { Altera_StratixII, "StratixII", StratixII_load,
+         StratixII_dump, StratixII_info },
 #endif
-               default:
-                       printf ("%s: Unsupported family type, %d\n",
-                                       __FUNCTION__, desc->family);
-               }
+};
+
+static int altera_validate(Altera_desc *desc, const char *fn)
+{
+       if (!desc) {
+               printf("%s: NULL descriptor!\n", fn);
+               return -EINVAL;
+       }
+
+       if ((desc->family < min_altera_type) ||
+           (desc->family > max_altera_type)) {
+               printf("%s: Invalid family type, %d\n", fn, desc->family);
+               return -EINVAL;
        }
 
-       return ret_val;
+       if ((desc->iface < min_altera_iface_type) ||
+           (desc->iface > max_altera_iface_type)) {
+               printf("%s: Invalid Interface type, %d\n", fn, desc->iface);
+               return -EINVAL;
+       }
+
+       if (!desc->size) {
+               printf("%s: NULL part size\n", fn);
+               return -EINVAL;
+       }
+
+       return 0;
 }
 
-int altera_dump(Altera_desc *desc, const void *buf, size_t bsize)
+static const struct altera_fpga *
+altera_desc_to_fpga(Altera_desc *desc, const char *fn)
 {
-       int ret_val = FPGA_FAIL;        /* assume a failure */
+       int i;
 
-       if (!altera_validate (desc, (char *)__FUNCTION__)) {
-               printf ("%s: Invalid device descriptor\n", __FUNCTION__);
-       } else {
-               switch (desc->family) {
-               case Altera_ACEX1K:
-#if defined(CONFIG_FPGA_ACEX)
-                       PRINTF ("%s: Launching the ACEX1K Reader...\n",
-                                       __FUNCTION__);
-                       ret_val = ACEX1K_dump (desc, buf, bsize);
-#else
-                       printf ("%s: No support for ACEX1K devices.\n",
-                                       __FUNCTION__);
-#endif
-                       break;
+       if (altera_validate(desc, fn)) {
+               printf("%s: Invalid device descriptor\n", fn);
+               return NULL;
+       }
 
-#if defined(CONFIG_FPGA_STRATIX_II)
-               case Altera_StratixII:
-                       PRINTF ("%s: Launching the Stratix II Reader...\n",
-                               __FUNCTION__);
-                       ret_val = StratixII_dump (desc, buf, bsize);
+       for (i = 0; i < ARRAY_SIZE(altera_fpga); i++) {
+               if (desc->family == altera_fpga[i].family)
                        break;
-#endif
-               default:
-                       printf ("%s: Unsupported family type, %d\n",
-                                       __FUNCTION__, desc->family);
-               }
        }
 
-       return ret_val;
+       if (i == ARRAY_SIZE(altera_fpga)) {
+               printf("%s: Unsupported family type, %d\n", fn, desc->family);
+               return NULL;
+       }
+
+       return &altera_fpga[i];
 }
 
-int altera_info( Altera_desc *desc )
+int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
 {
-       int ret_val = FPGA_FAIL;
+       const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__);
 
-       if (altera_validate (desc, (char *)__FUNCTION__)) {
-               printf ("Family:        \t");
-               switch (desc->family) {
-               case Altera_ACEX1K:
-                       printf ("ACEX1K\n");
-                       break;
-               case Altera_CYC2:
-                       printf ("CYCLON II\n");
-                       break;
-               case Altera_StratixII:
-                       printf ("Stratix II\n");
-                       break;
-                       /* Add new family types here */
-               default:
-                       printf ("Unknown family type, %d\n", desc->family);
-               }
-
-               printf ("Interface type:\t");
-               switch (desc->iface) {
-               case passive_serial:
-                       printf ("Passive Serial (PS)\n");
-                       break;
-               case passive_parallel_synchronous:
-                       printf ("Passive Parallel Synchronous (PPS)\n");
-                       break;
-               case passive_parallel_asynchronous:
-                       printf ("Passive Parallel Asynchronous (PPA)\n");
-                       break;
-               case passive_serial_asynchronous:
-                       printf ("Passive Serial Asynchronous (PSA)\n");
-                       break;
-               case altera_jtag_mode:          /* Not used */
-                       printf ("JTAG Mode\n");
-                       break;
-               case fast_passive_parallel:
-                       printf ("Fast Passive Parallel (FPP)\n");
-                       break;
-               case fast_passive_parallel_security:
-                       printf
-                           ("Fast Passive Parallel with Security (FPPS) \n");
-                       break;
-                       /* Add new interface types here */
-               default:
-                       printf ("Unsupported interface type, %d\n", desc->iface);
-               }
-
-               printf("Device Size:   \t%zd bytes\n"
-                     "Cookie:        \t0x%x (%d)\n",
-                     desc->size, desc->cookie, desc->cookie);
-
-               if (desc->iface_fns) {
-                       printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
-                       switch (desc->family) {
-                       case Altera_ACEX1K:
-                       case Altera_CYC2:
-#if defined(CONFIG_FPGA_ACEX1K)
-                               ACEX1K_info (desc);
-#elif defined(CONFIG_FPGA_CYCLON2)
-                               CYC2_info (desc);
-#else
-                               /* just in case */
-                               printf ("%s: No support for ACEX1K devices.\n",
-                                               __FUNCTION__);
-#endif
-                               break;
-#if defined(CONFIG_FPGA_STRATIX_II)
-                       case Altera_StratixII:
-                               StratixII_info (desc);
-                               break;
-#endif
-                               /* Add new family types here */
-                       default:
-                               /* we don't need a message here - we give one up above */
-                               break;
-                       }
-               } else {
-                       printf ("No Device Function Table.\n");
-               }
-
-               ret_val = FPGA_SUCCESS;
-       } else {
-               printf ("%s: Invalid device descriptor\n", __FUNCTION__);
-       }
+       if (!fpga)
+               return FPGA_FAIL;
 
-       return ret_val;
+       debug_cond(FPGA_DEBUG, "%s: Launching the %s Loader...\n",
+                  __func__, fpga->name);
+       if (fpga->load)
+               return fpga->load(desc, buf, bsize);
+       return 0;
 }
 
-/* ------------------------------------------------------------------------- */
+int altera_dump(Altera_desc *desc, const void *buf, size_t bsize)
+{
+       const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__);
+
+       if (!fpga)
+               return FPGA_FAIL;
 
-static int altera_validate (Altera_desc * desc, const char *fn)
+       debug_cond(FPGA_DEBUG, "%s: Launching the %s Reader...\n",
+                  __func__, fpga->name);
+       if (fpga->dump)
+               return fpga->dump(desc, buf, bsize);
+       return 0;
+}
+
+int altera_info(Altera_desc *desc)
 {
-       int ret_val = false;
-
-       if (desc) {
-               if ((desc->family > min_altera_type) &&
-                       (desc->family < max_altera_type)) {
-                       if ((desc->iface > min_altera_iface_type) &&
-                               (desc->iface < max_altera_iface_type)) {
-                               if (desc->size) {
-                                       ret_val = true;
-                               } else {
-                                       printf ("%s: NULL part size\n", fn);
-                               }
-                       } else {
-                               printf ("%s: Invalid Interface type, %d\n",
-                                       fn, desc->iface);
-                       }
-               } else {
-                       printf ("%s: Invalid family type, %d\n", fn, desc->family);
-               }
+       const struct altera_fpga *fpga = altera_desc_to_fpga(desc, __func__);
+
+       if (!fpga)
+               return FPGA_FAIL;
+
+       printf("Family:        \t%s\n", fpga->name);
+
+       printf("Interface type:\t");
+       switch (desc->iface) {
+       case passive_serial:
+               printf("Passive Serial (PS)\n");
+               break;
+       case passive_parallel_synchronous:
+               printf("Passive Parallel Synchronous (PPS)\n");
+               break;
+       case passive_parallel_asynchronous:
+               printf("Passive Parallel Asynchronous (PPA)\n");
+               break;
+       case passive_serial_asynchronous:
+               printf("Passive Serial Asynchronous (PSA)\n");
+               break;
+       case altera_jtag_mode:          /* Not used */
+               printf("JTAG Mode\n");
+               break;
+       case fast_passive_parallel:
+               printf("Fast Passive Parallel (FPP)\n");
+               break;
+       case fast_passive_parallel_security:
+               printf("Fast Passive Parallel with Security (FPPS)\n");
+               break;
+               /* Add new interface types here */
+       default:
+               printf("Unsupported interface type, %d\n", desc->iface);
+       }
+
+       printf("Device Size:   \t%zd bytes\n"
+              "Cookie:        \t0x%x (%d)\n",
+              desc->size, desc->cookie, desc->cookie);
+
+       if (desc->iface_fns) {
+               printf("Device Function Table @ 0x%p\n", desc->iface_fns);
+               if (fpga->info)
+                       fpga->info(desc);
        } else {
-               printf ("%s: NULL descriptor!\n", fn);
+               printf("No Device Function Table.\n");
        }
 
-       return ret_val;
+       return FPGA_SUCCESS;
 }
-
-/* ------------------------------------------------------------------------- */
index 0df30bc04530e162603f3f7ae801518f775ae5ef..785eed567c3f370e45fb3fc2febd6887750acaa7 100644 (file)
@@ -119,7 +119,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 
        while (dwmci_readl(host, DWMCI_STATUS) & DWMCI_BUSY) {
                if (get_timer(start) > timeout) {
-                       printf("Timeout on data busy\n");
+                       printf("%s: Timeout on data busy\n", __func__);
                        return TIMEOUT;
                }
        }
@@ -177,14 +177,24 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                }
        }
 
-       if (i == retry)
+       if (i == retry) {
+               printf("%s: Timeout.\n", __func__);
                return TIMEOUT;
+       }
 
        if (mask & DWMCI_INTMSK_RTO) {
-               debug("Response Timeout..\n");
+               /*
+                * Timeout here is not necessarily fatal. (e)MMC cards
+                * will splat here when they receive CMD55 as they do
+                * not support this command and that is exactly the way
+                * to tell them apart from SD cards. Thus, this output
+                * below shall be debug(). eMMC cards also do not favor
+                * CMD8, please keep that in mind.
+                */
+               debug("%s: Response Timeout.\n", __func__);
                return TIMEOUT;
        } else if (mask & DWMCI_INTMSK_RE) {
-               debug("Response Error..\n");
+               printf("%s: Response Error.\n", __func__);
                return -1;
        }
 
@@ -204,7 +214,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                do {
                        mask = dwmci_readl(host, DWMCI_RINTSTS);
                        if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) {
-                               debug("DATA ERROR!\n");
+                               printf("%s: DATA ERROR!\n", __func__);
                                return -1;
                        }
                } while (!(mask & DWMCI_INTMSK_DTO));
@@ -232,16 +242,16 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
        if ((freq == host->clock) || (freq == 0))
                return 0;
        /*
-        * If host->get_mmc_clk didn't define,
+        * If host->get_mmc_clk isn't defined,
         * then assume that host->bus_hz is source clock value.
-        * host->bus_hz should be set from user.
+        * host->bus_hz should be set by user.
         */
        if (host->get_mmc_clk)
                sclk = host->get_mmc_clk(host);
        else if (host->bus_hz)
                sclk = host->bus_hz;
        else {
-               printf("Didn't get source clock value..\n");
+               printf("%s: Didn't get source clock value.\n", __func__);
                return -EINVAL;
        }
 
@@ -260,7 +270,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
        do {
                status = dwmci_readl(host, DWMCI_CMD);
                if (timeout-- < 0) {
-                       printf("TIMEOUT error!!\n");
+                       printf("%s: Timeout!\n", __func__);
                        return -ETIMEDOUT;
                }
        } while (status & DWMCI_CMD_START);
@@ -275,7 +285,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
        do {
                status = dwmci_readl(host, DWMCI_CMD);
                if (timeout-- < 0) {
-                       printf("TIMEOUT error!!\n");
+                       printf("%s: Timeout!\n", __func__);
                        return -ETIMEDOUT;
                }
        } while (status & DWMCI_CMD_START);
@@ -290,7 +300,7 @@ static void dwmci_set_ios(struct mmc *mmc)
        struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
        u32 ctype, regs;
 
-       debug("Buswidth = %d, clock: %d\n",mmc->bus_width, mmc->clock);
+       debug("Buswidth = %d, clock: %d\n", mmc->bus_width, mmc->clock);
 
        dwmci_setup_bus(host, mmc->clock);
        switch (mmc->bus_width) {
@@ -329,7 +339,7 @@ static int dwmci_init(struct mmc *mmc)
        dwmci_writel(host, DWMCI_PWREN, 1);
 
        if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) {
-               debug("%s[%d] Fail-reset!!\n",__func__,__LINE__);
+               printf("%s[%d] Fail-reset!!\n", __func__, __LINE__);
                return -1;
        }
 
index 7186e3b491ecabd6128720a6284a1ef42d4b93c0..9ded8950b83d22aa6021ed8e81ee4141e6d85a23 100644 (file)
@@ -279,19 +279,21 @@ static int dw_eth_send(struct eth_device *dev, void *packet, int length)
        struct eth_dma_regs *dma_p = priv->dma_regs_p;
        u32 desc_num = priv->tx_currdescnum;
        struct dmamacdescr *desc_p = &priv->tx_mac_descrtable[desc_num];
-
+       uint32_t desc_start = (uint32_t)desc_p;
+       uint32_t desc_end = desc_start +
+               roundup(sizeof(*desc_p), ARCH_DMA_MINALIGN);
+       uint32_t data_start = (uint32_t)desc_p->dmamac_addr;
+       uint32_t data_end = data_start +
+               roundup(length, ARCH_DMA_MINALIGN);
        /*
         * Strictly we only need to invalidate the "txrx_status" field
         * for the following check, but on some platforms we cannot
-        * invalidate only 4 bytes, so roundup to
-        * ARCH_DMA_MINALIGN. This is safe because the individual
-        * descriptors in the array are each aligned to
-        * ARCH_DMA_MINALIGN.
+        * invalidate only 4 bytes, so we flush the entire descriptor,
+        * which is 16 bytes in total. This is safe because the
+        * individual descriptors in the array are each aligned to
+        * ARCH_DMA_MINALIGN and padded appropriately.
         */
-       invalidate_dcache_range(
-               (unsigned long)desc_p,
-               (unsigned long)desc_p +
-               roundup(sizeof(desc_p->txrx_status), ARCH_DMA_MINALIGN));
+       invalidate_dcache_range(desc_start, desc_end);
 
        /* Check if the descriptor is owned by CPU */
        if (desc_p->txrx_status & DESC_TXSTS_OWNBYDMA) {
@@ -299,11 +301,10 @@ static int dw_eth_send(struct eth_device *dev, void *packet, int length)
                return -1;
        }
 
-       memcpy((void *)desc_p->dmamac_addr, packet, length);
+       memcpy(desc_p->dmamac_addr, packet, length);
 
        /* Flush data to be sent */
-       flush_dcache_range((unsigned long)desc_p->dmamac_addr,
-                          (unsigned long)desc_p->dmamac_addr + length);
+       flush_dcache_range(data_start, data_end);
 
 #if defined(CONFIG_DW_ALTDESCRIPTOR)
        desc_p->txrx_status |= DESC_TXSTS_TXFIRST | DESC_TXSTS_TXLAST;
@@ -321,8 +322,7 @@ static int dw_eth_send(struct eth_device *dev, void *packet, int length)
 #endif
 
        /* Flush modified buffer descriptor */
-       flush_dcache_range((unsigned long)desc_p,
-                          (unsigned long)desc_p + sizeof(struct dmamacdescr));
+       flush_dcache_range(desc_start, desc_end);
 
        /* Test the wrap-around condition. */
        if (++desc_num >= CONFIG_TX_DESCR_NUM)
@@ -342,11 +342,14 @@ static int dw_eth_recv(struct eth_device *dev)
        u32 status, desc_num = priv->rx_currdescnum;
        struct dmamacdescr *desc_p = &priv->rx_mac_descrtable[desc_num];
        int length = 0;
+       uint32_t desc_start = (uint32_t)desc_p;
+       uint32_t desc_end = desc_start +
+               roundup(sizeof(*desc_p), ARCH_DMA_MINALIGN);
+       uint32_t data_start = (uint32_t)desc_p->dmamac_addr;
+       uint32_t data_end;
 
        /* Invalidate entire buffer descriptor */
-       invalidate_dcache_range((unsigned long)desc_p,
-                               (unsigned long)desc_p +
-                               sizeof(struct dmamacdescr));
+       invalidate_dcache_range(desc_start, desc_end);
 
        status = desc_p->txrx_status;
 
@@ -357,9 +360,8 @@ static int dw_eth_recv(struct eth_device *dev)
                         DESC_RXSTS_FRMLENSHFT;
 
                /* Invalidate received data */
-               invalidate_dcache_range((unsigned long)desc_p->dmamac_addr,
-                                       (unsigned long)desc_p->dmamac_addr +
-                                       roundup(length, ARCH_DMA_MINALIGN));
+               data_end = data_start + roundup(length, ARCH_DMA_MINALIGN);
+               invalidate_dcache_range(data_start, data_end);
 
                NetReceive(desc_p->dmamac_addr, length);
 
@@ -370,9 +372,7 @@ static int dw_eth_recv(struct eth_device *dev)
                desc_p->txrx_status |= DESC_RXSTS_OWNBYDMA;
 
                /* Flush only status field - others weren't changed */
-               flush_dcache_range((unsigned long)&desc_p->txrx_status,
-                                  (unsigned long)&desc_p->txrx_status +
-                                  sizeof(desc_p->txrx_status));
+               flush_dcache_range(desc_start, desc_end);
 
                /* Test the wrap-around condition. */
                if (++desc_num >= CONFIG_RX_DESCR_NUM)
index 5d7e3be52e095cf06977b7f5ee68b575f2a284f4..507b9a368be72e6d24fea6da9f169cbc2c4cb579 100644 (file)
@@ -25,8 +25,7 @@ static struct phy_driver KSZ804_driver = {
 #ifndef CONFIG_PHY_MICREL_KSZ9021
 /*
  * I can't believe Micrel used the exact same part number
- * for the KSZ9021
- * Shame Micrel, Shame!!!!!
+ * for the KSZ9021. Shame Micrel, Shame!
  */
 static struct phy_driver KS8721_driver = {
        .name = "Micrel KS8721BL",
@@ -40,7 +39,7 @@ static struct phy_driver KS8721_driver = {
 #endif
 
 
-/**
+/*
  * KSZ9021 - KSZ9031 common
  */
 
@@ -69,8 +68,8 @@ static int ksz90xx_startup(struct phy_device *phydev)
                phydev->speed = SPEED_10;
        return 0;
 }
-#ifdef CONFIG_PHY_MICREL_KSZ9021
 
+#ifdef CONFIG_PHY_MICREL_KSZ9021
 /*
  * KSZ9021
  */
index ae5f7eec463db4f2c6269413ae303760065b7899..e266a6449c52103d79d657923594a307f1bb068c 100644 (file)
 #ifndef _ALTERA_H_
 #define _ALTERA_H_
 
-typedef enum {                         /* typedef Altera_iface */
-       min_altera_iface_type,          /* insert all new types after this */
-       passive_serial,                 /* serial data and external clock */
-       passive_parallel_synchronous,   /* parallel data */
-       passive_parallel_asynchronous,  /* parallel data */
-       passive_serial_asynchronous,    /* serial data w/ internal clock (not used)     */
-       altera_jtag_mode,               /* jtag/tap serial (not used ) */
-       fast_passive_parallel,          /* fast passive parallel (FPP) */
-       fast_passive_parallel_security, /* fast passive parallel with security (FPPS) */
-       max_altera_iface_type           /* insert all new types before this */
-} Altera_iface;                                /* end, typedef Altera_iface */
+enum altera_iface {
+       /* insert all new types after this */
+       min_altera_iface_type,
+       /* serial data and external clock */
+       passive_serial,
+       /* parallel data */
+       passive_parallel_synchronous,
+       /* parallel data */
+       passive_parallel_asynchronous,
+       /* serial data w/ internal clock (not used) */
+       passive_serial_asynchronous,
+       /* jtag/tap serial (not used ) */
+       altera_jtag_mode,
+       /* fast passive parallel (FPP) */
+       fast_passive_parallel,
+       /* fast passive parallel with security (FPPS) */
+       fast_passive_parallel_security,
+       /* insert all new types before this */
+       max_altera_iface_type,
+};
 
-typedef enum {                 /* typedef Altera_Family */
-       min_altera_type,        /* insert all new types after this */
-       Altera_ACEX1K,          /* ACEX1K Family */
-       Altera_CYC2,            /* CYCLONII Family */
-       Altera_StratixII,       /* StratixII Family */
-/* Add new models here */
-       max_altera_type         /* insert all new types before this */
-} Altera_Family;               /* end, typedef Altera_Family */
+enum altera_family {
+       /* insert all new types after this */
+       min_altera_type,
+       /* ACEX1K Family */
+       Altera_ACEX1K,
+       /* CYCLONII Family */
+       Altera_CYC2,
+       /* StratixII Family */
+       Altera_StratixII,
 
-typedef struct {               /* typedef Altera_desc */
-       Altera_Family   family; /* part type */
-       Altera_iface    iface;  /* interface type */
-       size_t          size;   /* bytes of data part can accept */
-       void *          iface_fns;/* interface function table */
-       void *          base;   /* base interface address */
-       int             cookie; /* implementation specific cookie */
-} Altera_desc;                 /* end, typedef Altera_desc */
+       /* Add new models here */
+
+       /* insert all new types before this */
+       max_altera_type,
+};
+
+typedef struct {
+       /* part type */
+       enum altera_family      family;
+       /* interface type */
+       enum altera_iface       iface;
+       /* bytes of data part can accept */
+       size_t                  size;
+       /* interface function table */
+       void                    *iface_fns;
+       /* base interface address */
+       void                    *base;
+       /* implementation specific cookie */
+       int                     cookie;
+} Altera_desc;
 
 /* Generic Altera Functions
  *********************************************************************/
index c22d6d0c758fd1ae6fe200943c0784777b0f3776..1bf83907221f777485497cd59139764dc4478cbc 100644 (file)
  */
 #define CONFIG_DESIGNWARE_ETH
 #define CONFIG_DW_AUTONEG
-#define CONFIG_DW_SEARCH_PHY
 #define CONFIG_NET_MULTI
 
 /*
index 5d145cd821b78465a6e21328cef37dd22ea78a31..39e9368340e08cd1594b6260f1406acc0c686e23 100644 (file)
 /* designware */
 #define CONFIG_NET_MULTI
 #define CONFIG_DW_ALTDESCRIPTOR
-#define CONFIG_DW_SEARCH_PHY
 #define CONFIG_MII
 #define CONFIG_PHY_GIGE
 #define CONFIG_DW_AUTONEG
index b67f11b113fe8a66f9084e992a20c85d34906a36..109f7c8ac7f7e677c5357b7ab3bbf55d984a1859 100644 (file)
@@ -157,7 +157,7 @@ struct dwmci_idmac {
        u32 cnt;
        u32 addr;
        u32 next_addr;
-};
+} __aligned(ARCH_DMA_MINALIGN);
 
 static inline void dwmci_writel(struct dwmci_host *host, int reg, u32 val)
 {