Changeset 18224


Ignore:
Timestamp:
01/19/12 17:27:49 (16 months ago)
Author:
BrainSlayer
Message:

other drivers for lantiq

Location:
src/linux/universal/linux-3.2/drivers
Files:
22 added
14 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.2/drivers/gpio/gpiolib.c

    r18171 r18224  
    6565#define GPIO_TRIGGER_MASK       (BIT(FLAG_TRIG_FALL) | BIT(FLAG_TRIG_RISE)) 
    6666 
    67 #ifdef CONFIG_DEBUG_FS 
     67//#ifdef CONFIG_DEBUG_FS 
    6868        const char              *label; 
    69 #endif 
     69//#endif 
    7070}; 
    7171static struct gpio_desc gpio_desc[ARCH_NR_GPIOS]; 
     
    7777static inline void desc_set_label(struct gpio_desc *d, const char *label) 
    7878{ 
    79 #ifdef CONFIG_DEBUG_FS 
     79//#ifdef CONFIG_DEBUG_FS 
    8080        d->label = label; 
    81 #endif 
     81//#endif 
    8282} 
    8383 
     
    728728        if (desc->chip->names && desc->chip->names[gpio - desc->chip->base]) 
    729729                ioname = desc->chip->names[gpio - desc->chip->base]; 
    730  
     730        else 
     731                ioname = gpio_desc[gpio].label; 
    731732        if (status == 0) { 
    732733                struct device   *dev; 
     
    13481349        if (test_bit(FLAG_REQUESTED, &gpio_desc[gpio].flags) == 0) 
    13491350                return NULL; 
    1350 #ifdef CONFIG_DEBUG_FS 
     1351//#ifdef CONFIG_DEBUG_FS 
    13511352        return gpio_desc[gpio].label; 
    1352 #else 
    1353         return "?"; 
    1354 #endif 
     1353//#else 
     1354//      return "?"; 
     1355//#endif 
    13551356} 
    13561357EXPORT_SYMBOL_GPL(gpiochip_is_requested); 
  • src/linux/universal/linux-3.2/drivers/i2c/busses/Kconfig

    r18197 r18224  
    284284comment "I2C system bus drivers (mostly embedded / system-on-chip)" 
    285285 
     286config I2C_FALCON 
     287        tristate "Falcon I2C interface" 
     288#       depends on SOC_FALCON 
     289 
    286290config I2C_AT91 
    287291        tristate "Atmel AT91 I2C Two-Wire interface (TWI)" 
  • src/linux/universal/linux-3.2/drivers/i2c/busses/Makefile

    r18197 r18224  
    8888obj-$(CONFIG_SCx200_ACB)        += scx200_acb.o 
    8989obj-$(CONFIG_SCx200_I2C)        += scx200_i2c.o 
     90obj-$(CONFIG_I2C_FALCON)        += i2c-falcon.o 
    9091 
    9192ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG 
  • src/linux/universal/linux-3.2/drivers/mtd/maps/Makefile

    r18190 r18224  
    6363obj-$(CONFIG_MACH_AR7240)       += nvram_kernel.o 
    6464obj-$(CONFIG_MACH_GW2388)       += nvram_kernel.o 
     65obj-$(CONFIG_LANTIQ)            += nvram_kernel.o 
    6566obj-$(CONFIG_ARCH_IXP4XX)       += nvram_kernel.o 
    6667obj-$(CONFIG_X86)               += nvram_kernel_x86.o 
  • src/linux/universal/linux-3.2/drivers/mtd/maps/lantiq-flash.c

    r18171 r18224  
    1919#include <linux/mtd/cfi.h> 
    2020#include <linux/platform_device.h> 
     21#include <linux/squashfs_fs.h> 
    2122#include <linux/mtd/physmap.h> 
     23 
     24#include "../mtdcore.h" 
    2225 
    2326#include <lantiq_soc.h> 
     
    3336 * unlock addresses to ensure that access to the NOR device works correctly. 
    3437 */ 
     38 
     39static struct mtd_partition ifxmips_partitions[] = { 
     40        { 
     41                .name = "uboot", 
     42                .offset = 0x00000000, 
     43                .size = 0x00020000, 
     44        }, 
     45        { 
     46                .name = "uboot-env", 
     47                .offset = 0x00020000, 
     48                .size = 0x0, 
     49        }, 
     50        { 
     51                .name = "kernel", 
     52                .offset = 0x0, 
     53                .size = 0x0, 
     54        }, 
     55        { 
     56                .name = "rootfs", 
     57                .offset = 0x0, 
     58                .size = 0x0, 
     59        }, 
     60        { 
     61                .name = "nvram", 
     62                .offset = 0x0, 
     63                .size = 0x0, 
     64        }, 
     65        { 
     66                .name = "board_config", 
     67                .offset = 0x0, 
     68                .size = 0x0, 
     69        }, 
     70        { 
     71                .name = "fullflash", 
     72                .offset = 0x0, 
     73                .size = 0x0, 
     74        }, 
     75        { 
     76                .name = "ddwrt", 
     77                .offset = 0x0, 
     78                .size = 0x0, 
     79        }, 
     80}; 
     81 
     82static struct mtd_partition ifxmips_meta_partition = { 
     83        .name = "linux", 
     84        .offset = 0x00030000, 
     85        .size = 0x0, 
     86}; 
     87 
     88 
     89static unsigned long 
     90find_uImage_size(struct map_info *map, unsigned long offset) 
     91{ 
     92#define UBOOT_MAGIC     0x56190527 
     93        unsigned long magic; 
     94        unsigned long temp; 
     95        map->copy_from(map, &magic, offset, 4); 
     96        if (le32_to_cpu(magic) != UBOOT_MAGIC) 
     97                return 0; 
     98        map->copy_from(map, &temp, offset + 12, 4); 
     99        printk("uImage size %X\n",temp + 0x40); 
     100        return temp + 0x40; 
     101} 
     102 
     103static int 
     104detect_squashfs_partition(struct map_info *map, unsigned long offset) 
     105{ 
     106        unsigned long temp; 
     107        map->copy_from(map, &temp, offset, 4); 
     108        return le32_to_cpu(temp) == SQUASHFS_MAGIC; 
     109} 
     110 
     111#ifdef CONFIG_AR9 
     112#define RESERVE 6 
     113#else 
     114#define RESERVE 3 
     115#endif 
    35116 
    36117enum { 
     
    107188        spin_unlock_irqrestore(&ebu_lock, flags); 
    108189} 
     190static const char *part_probe_types[] = { "cmdlinepart", NULL }; 
     191 
    109192 
    110193static int __init 
     
    113196        struct physmap_flash_data *ltq_mtd_data = dev_get_platdata(&pdev->dev); 
    114197        struct ltq_mtd *ltq_mtd; 
     198        struct mtd_partition *parts = NULL; 
    115199        struct resource *res; 
     200        int nr_parts = 0; 
     201        unsigned long uimage_size; 
    116202        struct cfi_private *cfi; 
    117         int err; 
     203        int err,i; 
     204        int kernel_part = 2, rootfs_part = 3; 
     205        int num_parts = ARRAY_SIZE(ifxmips_partitions); 
    118206 
    119207        ltq_mtd = kzalloc(sizeof(struct ltq_mtd), GFP_KERNEL); 
     
    169257        cfi->addr_unlock2 ^= 1; 
    170258 
    171         err = mtd_device_parse_register(ltq_mtd->mtd, NULL, 0, 
    172                         ltq_mtd_data->parts, ltq_mtd_data->nr_parts); 
    173         if (err) { 
    174                 dev_err(&pdev->dev, "failed to add partitions\n"); 
    175                 goto err_destroy; 
    176         } 
     259        nr_parts = parse_mtd_partitions(ltq_mtd->mtd, part_probe_types, &parts, 0); 
     260        printk(KERN_EMERG "parse_mtd returns %d\n",nr_parts); 
     261        if (nr_parts > 0) { 
     262                printk(KERN_INFO "ifxmips_mtd: found %d partitions from cmdline\n", err); 
     263                num_parts = err; 
     264                kernel_part = 0; 
     265                rootfs_part = 0; 
     266                for (i = 0; i < num_parts; i++) { 
     267                        if (strcmp(parts[i].name, "kernel") == 0) 
     268                                kernel_part = i; 
     269                        if (strcmp(parts[i].name, "rootfs") == 0) 
     270                                rootfs_part = i; 
     271                } 
     272        } else { 
     273                /* if the flash is 64k sectors, the kernel will reside at 0xb0030000 
     274                   if the flash is 128k sectors, the kernel will reside at 0xb0040000 */ 
     275                ifxmips_partitions[1].size = ltq_mtd->mtd->erasesize; 
     276                ifxmips_partitions[2].offset = ifxmips_partitions[1].offset + ltq_mtd->mtd->erasesize; 
     277                parts = &ifxmips_partitions[0]; 
     278        } 
     279 
     280        /* dynamic size detection only if rootfs-part follows kernel-part */ 
     281        if (kernel_part+1 == rootfs_part) { 
     282                for (i=0;i<0xa0000;i+=0x10000) 
     283                { 
     284                uimage_size = find_uImage_size(ltq_mtd->map,i); 
     285                if (uimage_size>0) 
     286                    break; 
     287                } 
     288                parts[0].offset=0; 
     289                parts[0].size=i-ltq_mtd->mtd->erasesize; 
     290                parts[1].offset=parts[0].size; 
     291                parts[1].size=ltq_mtd->mtd->erasesize; 
     292                parts[kernel_part].offset=i; 
     293                uimage_size &= ~(4096 -1); 
     294                uimage_size += 4096; 
     295                 
     296                if (detect_squashfs_partition(ltq_mtd->map,parts[kernel_part].offset + uimage_size)) { 
     297                        printk(KERN_INFO "ltq_mtd: found a squashfs following the uImage\n"); 
     298                } 
     299                 
     300                parts[kernel_part].size = uimage_size; 
     301                parts[rootfs_part].offset = parts[kernel_part].offset + parts[kernel_part].size; 
     302                struct squashfs_super_block sb; 
     303                ltq_mtd->map->copy_from(ltq_mtd->map, &sb, parts[rootfs_part].offset, sizeof(struct squashfs_super_block)); 
     304                int jffsoffset = sb.bytes_used; 
     305                jffsoffset += parts[rootfs_part].offset; 
     306                jffsoffset += (ltq_mtd->mtd->erasesize - 1); 
     307                jffsoffset &= ~(ltq_mtd->mtd->erasesize - 1); 
     308                parts[rootfs_part].size = jffsoffset - parts[rootfs_part].offset; 
     309                parts[7].offset = jffsoffset; 
     310                parts[7].size = (ltq_mtd->mtd->size - (ltq_mtd->mtd->erasesize*RESERVE)) - jffsoffset; 
     311                ifxmips_meta_partition.offset = parts[kernel_part].offset; 
     312                ifxmips_meta_partition.size = parts[kernel_part].size + parts[rootfs_part].size + parts[7].size; 
     313        } 
     314 
     315        if (err <= 0) { 
     316//                      parts[3].size -= (ltq_mtd->erasesize*3); 
     317                        parts[4].offset = ltq_mtd->mtd->size - (ltq_mtd->mtd->erasesize*RESERVE); 
     318                        parts[4].size = ltq_mtd->mtd->erasesize; 
     319                        parts[5].offset = ltq_mtd->mtd->size - (ltq_mtd->mtd->erasesize); 
     320                        parts[5].size = ltq_mtd->mtd->erasesize; 
     321                        parts[6].offset = 0; 
     322                        parts[6].size = ltq_mtd->mtd->size; 
     323//                      ifxmips_meta_partition.size -= lq_mtd->erasesize; 
     324        } 
     325 
     326        add_mtd_partitions(ltq_mtd->mtd, parts, num_parts); 
     327        add_mtd_partitions(ltq_mtd->mtd, &ifxmips_meta_partition, 1); 
    177328 
    178329        return 0; 
  • src/linux/universal/linux-3.2/drivers/mtd/mtdpart.c

    r18171 r18224  
    875875#endif /* CONFIG_MTD_ROOTFS_SPLIT */ 
    876876 
     877 
     878 
    877879/* 
    878880 * This function, given a master MTD object and a partition table, creates 
  • src/linux/universal/linux-3.2/drivers/mtd/nand/plat_nand.c

    r18171 r18224  
    7676        data->chip.write_buf = pdata->ctrl.write_buf; 
    7777        data->chip.read_buf = pdata->ctrl.read_buf; 
     78        data->chip.read_byte = pdata->ctrl.read_byte; 
    7879        data->chip.chip_delay = pdata->chip.chip_delay; 
    7980        data->chip.options |= pdata->chip.options; 
  • src/linux/universal/linux-3.2/drivers/spi/Kconfig

    r18210 r18224  
    219219          This drivers supports the MPC52xx SPI controller in master SPI 
    220220          mode. 
     221 
     222config SPI_FALCON 
     223        tristate "Falcon SPI controller support" 
     224        depends on SOC_FALCON 
    221225 
    222226config SPI_MPC52xx_PSC 
     
    420424          SPI driver for Nuvoton NUC900 series ARM SoCs 
    421425 
     426config SPI_XWAY 
     427        tristate "Lantiq XWAY SPI controller" 
     428        depends on LANTIQ && SOC_TYPE_XWAY 
     429        select SPI_BITBANG 
     430        help 
     431          This driver supports the Lantiq SoC SPI controller in master 
     432          mode. 
     433 
    422434# 
    423435# Add new SPI master controllers in alphabetical order above this line 
  • src/linux/universal/linux-3.2/drivers/spi/Makefile

    r18191 r18224  
    6161obj-$(CONFIG_SPI_IXP4XX)                += spi-ixp4xx.o 
    6262obj-$(CONFIG_SPI_IXP4XX)                += spi-ixp4xx-gw2355.o 
     63obj-$(CONFIG_SPI_XWAY)                  += spi-xway.o 
     64obj-$(CONFIG_SPI_FALCON)                += spi-falcon.o 
     65  
    6366 
    6467# special build for s3c24xx spi driver with fiq support 
  • src/linux/universal/linux-3.2/drivers/usb/Kconfig

    r18171 r18224  
    133133source "drivers/usb/host/Kconfig" 
    134134 
     135source "drivers/usb/dwc_otg/Kconfig" 
     136 
    135137source "drivers/usb/musb/Kconfig" 
    136138 
  • src/linux/universal/linux-3.2/drivers/usb/Makefile

    r18171 r18224  
    3131obj-$(CONFIG_USB_WUSB)          += wusbcore/ 
    3232 
     33obj-$(CONFIG_DWC_OTG)           += dwc_otg/ 
     34 
    3335obj-$(CONFIG_USB_ACM)           += class/ 
    3436obj-$(CONFIG_USB_PRINTER)       += class/ 
  • src/linux/universal/linux-3.2/drivers/usb/core/hub.c

    r18171 r18224  
    29512951        } else if (udev->speed != USB_SPEED_HIGH 
    29522952                        && hdev->speed == USB_SPEED_HIGH) { 
    2953                 if (!hub->tt.hub) { 
     2953/*              if (!hub->tt.hub) { 
    29542954                        dev_err(&udev->dev, "parent hub has no TT\n"); 
    29552955                        retval = -EINVAL; 
    29562956                        goto fail; 
    2957                 } 
     2957                }*/ 
    29582958                udev->tt = &hub->tt; 
    29592959                udev->ttport = port1; 
  • src/linux/universal/linux-3.2/drivers/usb/dwc/Kconfig

    r18171 r18224  
    99config USB_DWC_OTG 
    1010        tristate "Synopsys DWC OTG Controller" 
    11         depends on USB 
     11        depends on USB && ARCH_CNS3XXX 
    1212        help 
    1313           This driver provides USB Device Controller support for the 
  • src/linux/universal/linux-3.2/drivers/watchdog/lantiq_wdt.c

    r18171 r18224  
    1717#include <linux/io.h> 
    1818 
    19 #include <lantiq.h> 
     19#include <lantiq_soc.h> 
    2020 
    2121/* Section 3.4 of the datasheet 
Note: See TracChangeset for help on using the changeset viewer.