Changeset 17826


Ignore:
Timestamp:
10/30/11 20:38:38 (19 months ago)
Author:
BrainSlayer
Message:

mmc/sdhci update

Location:
src/linux/laguna/linux-3.1
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/linux/laguna/linux-3.1/.config_laguna

    r17814 r17826  
    10921092# CONFIG_CICADA_PHY is not set 
    10931093# CONFIG_VITESSE_PHY is not set 
    1094 # CONFIG_SMSC_PHY is not set 
     1094CONFIG_SMSC_PHY=m 
    10951095# CONFIG_BROADCOM_PHY is not set 
    10961096# CONFIG_ICPLUS_PHY is not set 
     
    11081108# CONFIG_MDIO_BITBANG is not set 
    11091109# CONFIG_RTL8366_SMI is not set 
    1110 # CONFIG_NET_ETHERNET is not set 
     1110CONFIG_NET_ETHERNET=y 
     1111# CONFIG_AX88796 is not set 
     1112# CONFIG_HAPPYMEAL is not set 
     1113# CONFIG_SUNGEM is not set 
     1114# CONFIG_CASSINI is not set 
     1115# CONFIG_NET_VENDOR_3COM is not set 
     1116# CONFIG_SMC91X is not set 
     1117# CONFIG_DM9000 is not set 
     1118# CONFIG_ENC28J60 is not set 
     1119# CONFIG_ETHOC is not set 
     1120# CONFIG_SMC911X is not set 
     1121# CONFIG_SMSC911X is not set 
     1122# CONFIG_DNET is not set 
     1123CONFIG_NET_TULIP=y 
     1124CONFIG_DE2104X=m 
     1125CONFIG_DE2104X_DSL=0 
     1126CONFIG_TULIP=m 
     1127# CONFIG_TULIP_MWI is not set 
     1128# CONFIG_TULIP_MMIO is not set 
     1129# CONFIG_TULIP_NAPI is not set 
     1130CONFIG_DE4X5=m 
     1131CONFIG_WINBOND_840=m 
     1132CONFIG_DM9102=m 
     1133CONFIG_ULI526X=m 
     1134CONFIG_HP100=m 
     1135# CONFIG_IBM_NEW_EMAC_ZMII is not set 
     1136# CONFIG_IBM_NEW_EMAC_RGMII is not set 
     1137# CONFIG_IBM_NEW_EMAC_TAH is not set 
     1138# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 
     1139# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 
     1140# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 
     1141# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 
     1142CONFIG_NET_PCI=y 
     1143CONFIG_PCNET32=m 
     1144CONFIG_AMD8111_ETH=m 
     1145CONFIG_ADAPTEC_STARFIRE=m 
     1146CONFIG_KSZ884X_PCI=m 
     1147# CONFIG_B44 is not set 
     1148CONFIG_FORCEDETH=m 
     1149CONFIG_E100=m 
     1150CONFIG_FEALNX=m 
     1151CONFIG_NATSEMI=m 
     1152CONFIG_NE2K_PCI=m 
     1153CONFIG_8139CP=m 
     1154CONFIG_8139TOO=m 
     1155# CONFIG_8139TOO_PIO is not set 
     1156# CONFIG_8139TOO_TUNE_TWISTER is not set 
     1157# CONFIG_8139TOO_8129 is not set 
     1158# CONFIG_8139_OLD_RX_RESET is not set 
     1159CONFIG_R6040=m 
     1160CONFIG_SIS900=m 
     1161CONFIG_EPIC100=m 
     1162CONFIG_SMSC9420=m 
     1163CONFIG_SUNDANCE=m 
     1164# CONFIG_SUNDANCE_MMIO is not set 
     1165CONFIG_TLAN=m 
     1166# CONFIG_KS8851 is not set 
     1167# CONFIG_KS8851_MLL is not set 
     1168# CONFIG_VIA_RHINE is not set 
     1169# CONFIG_SC92031 is not set 
     1170CONFIG_ATL2=m 
     1171# CONFIG_FTMAC100 is not set 
    11111172CONFIG_NETDEV_1000=y 
    1112 # CONFIG_ACENIC is not set 
     1173CONFIG_ACENIC=m 
     1174# CONFIG_ACENIC_OMIT_TIGON_I is not set 
    11131175CONFIG_CNS3XXX_ETH=m 
    1114 # CONFIG_DL2K is not set 
    1115 # CONFIG_E1000 is not set 
    1116 # CONFIG_E1000E is not set 
    1117 # CONFIG_IP1000 is not set 
    1118 # CONFIG_IGB is not set 
    1119 # CONFIG_IGBVF is not set 
    1120 # CONFIG_NS83820 is not set 
    1121 # CONFIG_HAMACHI is not set 
    1122 # CONFIG_YELLOWFIN is not set 
    1123 # CONFIG_R8169 is not set 
    1124 # CONFIG_SIS190 is not set 
    1125 # CONFIG_SKGE is not set 
     1176CONFIG_DL2K=m 
     1177CONFIG_E1000=m 
     1178CONFIG_E1000E=m 
     1179CONFIG_IP1000=m 
     1180CONFIG_IGB=m 
     1181CONFIG_IGBVF=m 
     1182CONFIG_NS83820=m 
     1183CONFIG_HAMACHI=m 
     1184CONFIG_YELLOWFIN=m 
     1185CONFIG_R8169=m 
     1186CONFIG_SIS190=m 
     1187CONFIG_SKGE=m 
     1188CONFIG_SKGE_DEBUG=y 
     1189# CONFIG_SKGE_GENESIS is not set 
    11261190# CONFIG_SKY2 is not set 
    1127 # CONFIG_VIA_VELOCITY is not set 
    1128 # CONFIG_TIGON3 is not set 
    1129 # CONFIG_BNX2 is not set 
    1130 # CONFIG_CNIC is not set 
    1131 # CONFIG_QLA3XXX is not set 
    1132 # CONFIG_ATL1 is not set 
    1133 # CONFIG_ATL1E is not set 
    1134 # CONFIG_ATL1C is not set 
    1135 # CONFIG_JME is not set 
     1191CONFIG_VIA_VELOCITY=m 
     1192CONFIG_TIGON3=m 
     1193CONFIG_BNX2=m 
     1194CONFIG_CNIC=m 
     1195CONFIG_QLA3XXX=m 
     1196CONFIG_ATL1=m 
     1197CONFIG_ATL1E=m 
     1198CONFIG_ATL1C=m 
     1199CONFIG_JME=m 
    11361200# CONFIG_STMMAC_ETH is not set 
    1137 # CONFIG_PCH_GBE is not set 
     1201CONFIG_PCH_GBE=m 
    11381202# CONFIG_FTGMAC100 is not set 
    11391203# CONFIG_NETDEV_10000 is not set 
     
    18891953# CONFIG_DMADEVICES is not set 
    18901954# CONFIG_AUXDISPLAY is not set 
    1891 # CONFIG_UIO is not set 
     1955CONFIG_UIO=m 
     1956# CONFIG_UIO_CIF is not set 
     1957# CONFIG_UIO_PDRV is not set 
     1958# CONFIG_UIO_PDRV_GENIRQ is not set 
     1959# CONFIG_UIO_AEC is not set 
     1960# CONFIG_UIO_SERCOS3 is not set 
     1961# CONFIG_UIO_PCI_GENERIC is not set 
     1962# CONFIG_UIO_NETX is not set 
    18921963 
    18931964# 
  • src/linux/laguna/linux-3.1/arch/arm/mach-cns3xxx/devices.c

    r17814 r17826  
    100100{ 
    101101        u32 __iomem *gpioa = (void __iomem *) (CNS3XXX_MISC_BASE_VIRT + 0x0014); 
     102        u32 __iomem *iocdb_io = (void __iomem *) (CNS3XXX_MISC_BASE_VIRT + 0x0020); 
     103        unsigned long iocdb = 0; 
    102104        u32 gpioa_pins = __raw_readl(gpioa); 
    103105 
     
    109111        cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); 
    110112 
     113 
     114        iocdb = __raw_readl(iocdb_io);; 
     115        iocdb &= (~(3 << 10)); 
     116        iocdb |= (2 << 10); 
     117        __raw_writel(iocdb, iocdb_io); 
     118 
    111119        platform_device_register(&cns3xxx_sdhci_pdev); 
    112120} 
  • src/linux/laguna/linux-3.1/drivers/mmc/core/core.c

    r17814 r17826  
    10811081        mmc_host_clk_hold(host); 
    10821082        host->ios.timing = timing; 
     1083        if (host->ios.timing&MMC_TIMING_MMC_HS) 
     1084         host->ios.clock = 50000000;//jacky 
    10831085        mmc_set_ios(host); 
    10841086        mmc_host_clk_release(host); 
  • src/linux/laguna/linux-3.1/drivers/mmc/core/mmc.c

    r17814 r17826  
    300300                break; 
    301301        case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26: 
    302                 card->ext_csd.hs_max_dtr = 52000000; 
     302                card->ext_csd.hs_max_dtr = 50000000; 
    303303                break; 
    304304        case EXT_CSD_CARD_TYPE_26: 
    305                 card->ext_csd.hs_max_dtr = 26000000; 
     305                card->ext_csd.hs_max_dtr = 25000000; 
    306306                break; 
    307307        default: 
     
    558558 
    559559        /* The extra bit indicates that we support high capacity */ 
    560         err = mmc_send_op_cond(host, ocr | (1 << 30), &rocr); 
     560        err = mmc_send_op_cond(host, ocr , &rocr); 
    561561        if (err) 
    562562                goto err; 
     
    10221022 
    10231023        mmc_attach_bus_ops(host); 
     1024 
     1025//Jacky for eMMC capabilities 
     1026        host->caps   |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); 
     1027        host->caps   |= MMC_CAP_MMC_HIGHSPEED; 
     1028 
    10241029        if (host->ocr_avail_mmc) 
    10251030                host->ocr_avail = host->ocr_avail_mmc; 
  • src/linux/laguna/linux-3.1/drivers/mmc/host/sdhci-cns3xxx.c

    r17814 r17826  
     1/******************************************************************************* 
     2 * 
     3 *  drivers/mmc/host/sdhci-cns3xxx.c 
     4 * 
     5 *  SDHCI support for the CNS3XXX SOCs 
     6 * 
     7 *  Author: Scott Shu 
     8 * 
     9 *  Copyright (c) 2008 Cavium Networks  
     10 *  
     11 *  This file is free software; you can redistribute it and/or modify  
     12 *  it under the terms of the GNU General Public License, Version 2, as  
     13 *  published by the Free Software Foundation.  
     14 * 
     15 *  This file is distributed in the hope that it will be useful,  
     16 *  but AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty of  
     17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or  
     18 *  NONINFRINGEMENT.  See the GNU General Public License for more details.  
     19 * 
     20 *  You should have received a copy of the GNU General Public License  
     21 *  along with this file; if not, write to the Free Software  
     22 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA or  
     23 *  visit http://www.gnu.org/licenses/.  
     24 * 
     25 *  This file may also be available under a different license from Cavium.  
     26 *  Contact Cavium Networks for more information 
     27 * 
     28 ******************************************************************************/ 
     29 
     30#include <linux/delay.h> 
     31#include <linux/highmem.h> 
     32#include <linux/platform_device.h> 
     33#include <linux/dma-mapping.h> 
     34 
     35#include <linux/mmc/host.h> 
     36 
     37#include <asm/scatterlist.h> 
     38#include <asm/io.h> 
     39#include <linux/interrupt.h> 
     40 
     41 
     42#include "sdhci.h" 
     43 
     44#define MAX_BUS_CLK     (4) 
     45 
     46static unsigned use_dma = 0; 
     47 
     48struct sdhci_cns3xxx { 
     49        struct sdhci_host       *host; 
     50        struct platform_device  *pdev; 
     51        struct resource         *ioarea; 
     52        struct clk              *clk_io; 
     53        struct clk              *clk_bus[MAX_BUS_CLK]; 
     54}; 
     55 
     56static unsigned int sdhci_cns3xxx_get_max_clk(struct sdhci_host *host) 
     57{ 
     58        int clk = 50000000; 
     59 
     60        return clk; 
     61} 
     62 
     63static unsigned int sdhci_cns3xxx_get_timeout_clk(struct sdhci_host *host) 
     64{ 
     65        return sdhci_cns3xxx_get_max_clk(host) / 100000; 
     66} 
     67 
    168/* 
    2  * SDHCI support for CNS3xxx SoC 
    3  * 
    4  * Copyright 2008 Cavium Networks 
    5  * Copyright 2010 MontaVista Software, LLC. 
    6  * 
    7  * Authors: Scott Shu 
    8  *          Anton Vorontsov <avorontsov@mvista.com> 
    9  * 
    10  * This program is free software; you can redistribute it and/or modify 
    11  * it under the terms of the GNU General Public License version 2 as 
    12  * published by the Free Software Foundation. 
     69 * sdhci_cns3xxx_set_clock - callback on clock change 
     70 * 
     71 * When the card's clock is going to be changed, look at the new frequency 
     72 * and find the best clock source to go with it. 
    1373 */ 
    14  
    15 #include <linux/delay.h> 
    16 #include <linux/device.h> 
    17 #include <linux/mmc/host.h> 
    18 #include <mach/cns3xxx.h> 
    19 #include "sdhci-pltfm.h" 
    20  
    21 static unsigned int sdhci_cns3xxx_get_max_clk(struct sdhci_host *host) 
    22 { 
    23         return 150000000; 
    24 } 
    25  
    2674static void sdhci_cns3xxx_set_clock(struct sdhci_host *host, unsigned int clock) 
    2775{ 
    28         struct device *dev = mmc_dev(host->mmc); 
    29         int div = 1; 
    3076        u16 clk; 
    3177        unsigned long timeout; 
     78        int max_speed, div = 1; 
     79        int hclk = cns3xxx_cpu_clock()/4; 
    3280 
    3381        if (clock == host->clock) 
     
    3987                goto out; 
    4088 
    41         while (host->max_clk / div > clock) { 
    42                 /* 
    43                  * On CNS3xxx divider grows linearly up to 4, and then 
    44                  * exponentially up to 256. 
    45                  */ 
    46                 if (div < 4) 
    47                         div += 1; 
    48                 else if (div < 256) 
    49                         div *= 2; 
    50                 else 
    51                         break; 
    52         } 
    53  
    54         dev_dbg(dev, "desired SD clock: %d, actual: %d\n", 
    55                 clock, host->max_clk / div); 
    56  
    57         /* Divide by 3 is special. */ 
    58         if (div != 3) 
    59                 div >>= 1; 
    60  
    61         clk = div << SDHCI_DIVIDER_SHIFT; 
     89   /*  
     90        * SD frequency divider should be determined by HCLK 
     91        * the maximum SD clock is 25MHz (normal speed mode) or 50MHz (high speed mode) 
     92        * formula => SD clock = (HCLK / divisor) 
     93        */ 
     94        div = 1; 
     95        hclk = cns3xxx_cpu_clock()/4; 
     96 
     97        if (0x4 & sdhci_readw(host, 0x28)) { 
     98                max_speed = 50; 
     99        } else { 
     100                max_speed = 25; 
     101        } 
     102 
     103        while (max_speed < (hclk/div)) { div++; } 
     104                 
     105        switch (div) { 
     106        case 1: 
     107                clk = 0x00 << SDHCI_DIVIDER_SHIFT;      /* */ 
     108                break; 
     109        case 2: 
     110                clk = 0x01 << SDHCI_DIVIDER_SHIFT;      /* base clock divided by 2 */ 
     111                break; 
     112        case 3: 
     113                clk = 0x03 << SDHCI_DIVIDER_SHIFT;      /* base clock divided by 3 */ 
     114                break; 
     115        case 4: 
     116                clk = 0x02 << SDHCI_DIVIDER_SHIFT;      /* base clock divided by 4 */ 
     117                break; 
     118        case 5: case 6: case 7: case 8: 
     119                clk = 0x04 << SDHCI_DIVIDER_SHIFT;      /* base clock divided by 8 */ 
     120                break; 
     121        default: 
     122                clk = 0x08 << SDHCI_DIVIDER_SHIFT;      /* base clock divided by 16 */ 
     123        } 
     124 
     125        if (clock == 400000)  //for eMMC init 
     126        { 
     127            clk = 0x80 << 8;     
     128        }        
     129 
    62130        clk |= SDHCI_CLOCK_INT_EN; 
    63131        sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); 
    64132 
    65         timeout = 20; 
     133        timeout = 10; 
    66134        while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL)) 
    67                         & SDHCI_CLOCK_INT_STABLE)) { 
     135                & SDHCI_CLOCK_INT_STABLE)) { 
    68136                if (timeout == 0) { 
    69                         dev_warn(dev, "clock is unstable"); 
    70                         break; 
     137                        return; 
    71138                } 
    72139                timeout--; 
     
    76143        clk |= SDHCI_CLOCK_CARD_EN; 
    77144        sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); 
     145 
     146        host->timeout_clk = sdhci_cns3xxx_get_timeout_clk(host); 
    78147out: 
    79148        host->clock = clock; 
     149 
     150        sdhci_writew(host, 0x0007, SDHCI_TIMEOUT_CONTROL); 
    80151} 
    81152 
    82153static struct sdhci_ops sdhci_cns3xxx_ops = { 
    83         .get_max_clock  = sdhci_cns3xxx_get_max_clk, 
    84         .set_clock      = sdhci_cns3xxx_set_clock, 
     154        .get_max_clock          = sdhci_cns3xxx_get_max_clk, 
     155        .get_timeout_clock      = sdhci_cns3xxx_get_timeout_clk, 
     156        .set_clock              = sdhci_cns3xxx_set_clock, 
    85157}; 
    86158 
    87 static struct sdhci_pltfm_data sdhci_cns3xxx_pdata = { 
    88         .ops = &sdhci_cns3xxx_ops, 
    89         .quirks = SDHCI_QUIRK_BROKEN_DMA | 
    90                   SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | 
    91                   //SDHCI_QUIRK_INVERTED_WRITE_PROTECT | 
    92                   SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | 
    93                   SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | 
    94                   SDHCI_QUIRK_NONSTANDARD_CLOCK | 
    95                   SDHCI_QUIRK_BROKEN_CARD_DETECTION, 
    96 }; 
    97  
    98 static int __devinit sdhci_cns3xxx_probe(struct platform_device *pdev) 
    99 { 
    100         return sdhci_pltfm_register(pdev, &sdhci_cns3xxx_pdata); 
    101 } 
    102  
    103 static int __devexit sdhci_cns3xxx_remove(struct platform_device *pdev) 
    104 { 
    105         return sdhci_pltfm_unregister(pdev); 
    106 } 
     159static int sdhci_cns3xxx_probe(struct platform_device *pdev) 
     160{ 
     161        struct device *dev = &pdev->dev; 
     162        struct sdhci_host *host; 
     163        struct sdhci_cns3xxx *sc; 
     164        struct resource *res; 
     165        int ret, irq; 
     166 
     167        irq = platform_get_irq(pdev, 0); 
     168        if (irq < 0) { 
     169                dev_err(dev, "no irq specified\n"); 
     170                return irq; 
     171        } 
     172 
     173        res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
     174        if (!res) { 
     175                dev_err(dev, "no memory specified\n"); 
     176                return -ENOENT; 
     177        } 
     178 
     179        host = sdhci_alloc_host(dev, sizeof(*sc)); 
     180        if (IS_ERR(host)) { 
     181                dev_err(dev, "sdhci_alloc_host() failed\n"); 
     182                return PTR_ERR(host); 
     183        } 
     184 
     185        sc = sdhci_priv(host); 
     186 
     187        sc->host = host; 
     188        sc->pdev = pdev; 
     189 
     190        platform_set_drvdata(pdev, host); 
     191 
     192        sc->ioarea = request_mem_region(res->start, resource_size(res), mmc_hostname(host->mmc)); 
     193        if (!sc->ioarea) { 
     194                dev_err(dev, "failed to reserve register area\n"); 
     195                ret = -ENXIO; 
     196                goto err_req_regs; 
     197        } 
     198 
     199        host->ioaddr = ioremap_nocache(res->start, resource_size(res)); 
     200        if (!host->ioaddr) { 
     201                dev_err(dev, "failed to map registers\n"); 
     202                ret = -ENXIO; 
     203                goto err_req_regs; 
     204        } 
     205 
     206        host->hw_name = "cns3xxx"; 
     207        host->ops = &sdhci_cns3xxx_ops; 
     208        host->quirks = 0; 
     209        host->irq = irq; 
     210 
     211        if (use_dma != 1) { 
     212                host->quirks |= SDHCI_QUIRK_BROKEN_DMA; 
     213                host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; 
     214        } else { 
     215                host->quirks |= SDHCI_QUIRK_FORCE_DMA; 
     216                host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; 
     217                host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR | SDHCI_QUIRK_32BIT_DMA_SIZE); 
     218                host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ; 
     219                //host->quirks |= SDHCI_QUIRK_FORCE_BLK_SZ_2048; 
     220                //host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK; 
     221                host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; 
     222//              host->quirks |= SDHCI_QUIRK_AUTO_CMD12; 
     223//              host->quirks |= SDHCI_QUIRK_READ_WAIT_CTRL; 
     224        } 
     225 
     226        host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; 
     227 
     228        host->quirks |= SDHCI_QUIRK_NONSTANDARD_CLOCK; 
     229 
     230        ret = sdhci_add_host(host); 
     231        if (ret) { 
     232                dev_err(dev, "sdhci_add_host() failed (%d)\n", ret); 
     233                goto err_add_host; 
     234        } 
     235 
     236        return 0; 
     237 
     238err_add_host: 
     239        free_irq(host->irq, host); 
     240        iounmap(host->ioaddr); 
     241        release_resource(sc->ioarea); 
     242//      kfree(sc->ioarea); 
     243 
     244err_req_regs: 
     245        sdhci_free_host(host); 
     246 
     247        return ret; 
     248} 
     249 
     250static int sdhci_cns3xxx_remove(struct platform_device *pdev) 
     251{ 
     252        struct device *dev = &pdev->dev; 
     253        struct sdhci_host *host = dev_get_drvdata(dev); 
     254        struct resource *res; 
     255 
     256        pr_debug("%s: remove=%p\n", __func__, pdev); 
     257 
     258        sdhci_remove_host(host, 0); 
     259        sdhci_free_host(host); 
     260        res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 
     261        release_mem_region(res->start, resource_size(res)); 
     262 
     263        return 0; 
     264} 
     265 
     266#ifdef CONFIG_PM 
     267 
     268static int sdhci_cns3xxx_suspend(struct platform_device *dev, pm_message_t state) 
     269{ 
     270 
     271        return 0; 
     272} 
     273 
     274static int sdhci_cns3xxx_resume(struct platform_device *dev) 
     275{ 
     276 
     277        return 0; 
     278} 
     279 
     280#else 
     281#define sdhci_cns3xxx_suspend   NULL 
     282#define sdhci_cns3xxx_resume    NULL 
     283#endif /* CONFIG_PM */ 
    107284 
    108285static struct platform_driver sdhci_cns3xxx_driver = { 
     286        .probe          = sdhci_cns3xxx_probe, 
     287        .remove         = __devexit_p(sdhci_cns3xxx_remove), 
     288        .suspend        = sdhci_cns3xxx_suspend, 
     289        .resume         = sdhci_cns3xxx_resume, 
    109290        .driver         = { 
    110291                .name   = "sdhci-cns3xxx", 
    111292                .owner  = THIS_MODULE, 
    112293        }, 
    113         .probe          = sdhci_cns3xxx_probe, 
    114         .remove         = __devexit_p(sdhci_cns3xxx_remove), 
    115 #ifdef CONFIG_PM 
    116         .suspend        = sdhci_pltfm_suspend, 
    117         .resume         = sdhci_pltfm_resume, 
    118 #endif 
    119294}; 
    120295 
     296static char banner[] __initdata = KERN_INFO "sdhci-cns3xxx, (c) 2009 Cavium Networks\n"; 
     297 
    121298static int __init sdhci_cns3xxx_init(void) 
    122299{ 
     300//      unsigned long iocdb = 0; 
     301//      unsigned long gpioapin = __raw_readl(__io(CNS3XXX_MISC_BASE_VIRT + 0x0014)); 
     302 
     303        printk(banner); 
     304 
     305        // set SDIO drive strength to 2 (15.7 mA) 
     306//      iocdb = __raw_readl(__io(CNS3XXX_MISC_BASE_VIRT + 0x0020));; 
     307//      iocdb &= (~(3 << 10)); 
     308//      iocdb |= (2 << 10); 
     309//      __raw_writel(iocdb, __io(CNS3XXX_MISC_BASE_VIRT + 0x0020)); 
     310 
    123311        return platform_driver_register(&sdhci_cns3xxx_driver); 
    124312} 
     313 
     314static void __exit sdhci_cns3xxx_exit(void) 
     315{ 
     316        platform_driver_unregister(&sdhci_cns3xxx_driver); 
     317} 
     318 
    125319module_init(sdhci_cns3xxx_init); 
    126  
    127 static void __exit sdhci_cns3xxx_exit(void) 
    128 { 
    129         platform_driver_unregister(&sdhci_cns3xxx_driver); 
    130 } 
    131320module_exit(sdhci_cns3xxx_exit); 
    132321 
    133 MODULE_DESCRIPTION("SDHCI driver for CNS3xxx"); 
    134 MODULE_AUTHOR("Scott Shu, " 
    135               "Anton Vorontsov <avorontsov@mvista.com>"); 
    136 MODULE_LICENSE("GPL v2"); 
     322module_param(use_dma, uint, 0); 
     323 
     324MODULE_AUTHOR("Scott Shu"); 
     325MODULE_DESCRIPTION("Cavium Networks CNS3XXX SDHCI glue"); 
     326MODULE_LICENSE("GPL"); 
     327MODULE_ALIAS("platform:sdhci-cns3xxx"); 
     328 
     329MODULE_PARM_DESC(use_dma, "Whether to use DMA or not. Default = 0"); 
  • src/linux/laguna/linux-3.1/drivers/mmc/host/sdhci.c

    r17814 r17826  
    13281328        ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); 
    13291329 
     1330        if (ios->bus_width == MMC_BUS_WIDTH_8) //jacky for eMMC 
     1331                ctrl |= (0x1 << 5);//CNS34xxx proprietary 
     1332        else 
     1333                ctrl &= ~(0x1 << 5); 
     1334 
    13301335        if ((ios->timing == MMC_TIMING_SD_HS || 
    13311336             ios->timing == MMC_TIMING_MMC_HS) 
     
    13341339        else 
    13351340                ctrl &= ~SDHCI_CTRL_HISPD; 
     1341 
     1342        if (ios->timing == MMC_TIMING_MMC_HS)//for eMMC 
     1343                ctrl |= SDHCI_CTRL_HISPD;       else 
     1344                ctrl &= ~SDHCI_CTRL_HISPD; 
     1345 
     1346        if (ios->timing == MMC_TIMING_MMC_HS) 
     1347        {                 
     1348                sdhci_writeb(host, 0x3, 0x2d); 
     1349        }        
    13361350 
    13371351        if (host->version >= SDHCI_SPEC_300) { 
  • src/linux/laguna/linux-3.1/drivers/pci/pci.c

    r17814 r17826  
    32013201        u16 ctl, v; 
    32023202 
     3203#ifdef  CONFIG_ARCH_CNS3XXX 
     3204        if (rq != 128) 
     3205                rq = 128; 
     3206#else 
    32033207        if (rq < 128 || rq > 4096 || !is_power_of_2(rq)) 
    32043208                goto out; 
    3205  
     3209#endif 
    32063210        v = (ffs(rq) - 8) << 12; 
    32073211 
Note: See TracChangeset for help on using the changeset viewer.