Merge tag 'lsk-v3.10-android-14.07' into develop-3.10
author黄涛 <huangtao@rock-chips.com>
Wed, 6 Aug 2014 07:34:14 +0000 (15:34 +0800)
committer黄涛 <huangtao@rock-chips.com>
Wed, 6 Aug 2014 07:34:14 +0000 (15:34 +0800)
LSK v3.10 Android 14.07 release

Conflicts:
drivers/clocksource/arm_arch_timer.c
lib/Makefile

21 files changed:
1  2 
Makefile
arch/arm/include/asm/arch_timer.h
arch/arm64/include/asm/arch_timer.h
drivers/ata/libata-core.c
drivers/clocksource/arm_arch_timer.c
drivers/cpufreq/Makefile
drivers/cpufreq/cpufreq_interactive.c
drivers/cpufreq/cpufreq_stats.c
drivers/hwmon/Kconfig
drivers/i2c/busses/Kconfig
drivers/input/Kconfig
drivers/input/Makefile
drivers/mmc/host/rtsx_pci_sdmmc.c
drivers/staging/android/ion/rockchip/rockchip_ion.c
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
drivers/usb/core/driver.c
drivers/usb/core/hub.c
drivers/usb/serial/option.c
include/asm-generic/vmlinux.lds.h
lib/Makefile

diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
index c5c162b76d39531c151e03bae6fe94152ce391d5,67bbbd8ae507b5e4e937abcf616288861d430182..ecfa6bcc3d2cf4466b173e989fe2772e233fb51c
@@@ -245,6 -419,23 +419,27 @@@ struct timecounter *arch_timer_get_time
        return &timecounter;
  }
  
+ static void __init arch_counter_register(unsigned type)
+ {
+       u64 start_count;
+       /* Register the CP15 based counter if we have one */
+       if (type & ARCH_CP15_TIMER)
+               arch_timer_read_counter = arch_counter_get_cntvct;
+       else
+               arch_timer_read_counter = arch_counter_get_cntvct_mem;
++      if (!arch_timer_use_virtual)
++              if (arch_timer_read_counter == arch_counter_get_cntvct)
++                      arch_timer_read_counter = arch_counter_get_cntpct;
++
+       start_count = arch_timer_read_counter();
+       clocksource_register_hz(&clocksource_counter, arch_timer_rate);
+       cyclecounter.mult = clocksource_counter.mult;
+       cyclecounter.shift = clocksource_counter.shift;
+       timecounter_init(&timecounter, &cyclecounter, start_count);
+ }
  static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
  {
        pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n",
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 1b7621cae0165e89a1e2d4e124ca7c39ce325634,ee4c06520bb436a12c4d80f26a0df277b63652e9..d84c599c7bce180a8075f39589de744563173e3c
@@@ -23,6 -23,8 +23,8 @@@ obj-$(CONFIG_INPUT_JOYSTICK)  += joystic
  obj-$(CONFIG_INPUT_TABLET)    += tablet/
  obj-$(CONFIG_INPUT_TOUCHSCREEN)       += touchscreen/
  obj-$(CONFIG_INPUT_MISC)      += misc/
 -
 +obj-$(CONFIG_SENSOR_DEVICE) += sensors/
  obj-$(CONFIG_INPUT_APMPOWER)  += apm-power.o
  obj-$(CONFIG_INPUT_KEYRESET)  += keyreset.o
+ obj-$(CONFIG_INPUT_KEYCOMBO)  += keycombo.o
Simple merge
index 6b4790ca8fb342e41587ec7437a3fafb755b1aa7,0000000000000000000000000000000000000000..113dfea29e365e27016aaeed946954fcde9731bb
mode 100755,000000..100755
--- /dev/null
@@@ -1,401 -1,0 +1,401 @@@
-       __be32 *prop;
-       unsigned long len;
 +/*
 + * drivers/gpu/rockchip/rockchip_ion.c
 + *
 + * Copyright (C) 2011 Google, Inc.
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * 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.
 + *
 + */
 +
 +#include <linux/err.h>
 +#include <linux/platform_device.h>
 +#include <linux/slab.h>
 +#include <linux/rockchip_ion.h>
 +#include <linux/uaccess.h>
 +#include "../ion_priv.h"
 +#include <linux/dma-buf.h>
 +#include <linux/dma-contiguous.h>
 +#include <linux/memblock.h>
 +
 +#ifdef CONFIG_OF
 +#include <linux/of.h>
 +#include <linux/of_gpio.h>
 +#include <video/of_display_timing.h>
 +#include <linux/of_fdt.h>
 +#endif
 +
 +static struct ion_device *idev;
 +static int num_heaps;
 +static struct ion_heap **heaps;
 +
 +struct ion_heap_desc {
 +      unsigned int id;
 +      enum ion_heap_type type;
 +      const char *name;
 +};
 +
 +extern struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
 +                                              int id);
 +extern int ion_handle_put(struct ion_handle *handle);
 +
 +static struct ion_heap_desc ion_heap_meta[] = {
 +      {
 +              .id             = ION_VMALLOC_HEAP_ID,
 +              .type   = ION_HEAP_TYPE_SYSTEM,
 +              .name   = ION_VMALLOC_HEAP_NAME,
 +      },
 +      {
 +              .id             = ION_CMA_HEAP_ID,
 +              .type   = ION_HEAP_TYPE_DMA,
 +              .name   = ION_CMA_HEAP_NAME,
 +      },
 +      {
 +              .id             = ION_IOMMU_HEAP_ID,
 +              .type   = ION_HEAP_TYPE_DMA,//ION_HEAP_TYPE_IOMMU,
 +              .name   = ION_IOMMU_HEAP_NAME,
 +      },
 +      {
 +              .id     = ION_DRM_HEAP_ID,
 +              .type   = ION_HEAP_TYPE_DMA,
 +              .name   = ION_DRM_HEAP_NAME,
 +      },
 +      {
 +              .id     = ION_CARVEOUT_HEAP_ID,
 +              .type   = ION_HEAP_TYPE_CARVEOUT,
 +              .name   = ION_CARVEOUT_HEAP_NAME,
 +      },
 +};
 +
 +struct device rockchip_ion_cma_dev = {
 +      .coherent_dma_mask = DMA_BIT_MASK(32),
 +      .init_name = "rockchip_ion_cma",
 +};
 +
 +static int rockchip_ion_populate_heap(struct ion_platform_heap *heap)
 +{
 +      unsigned int i;
 +      int ret = -EINVAL;
 +      unsigned int len = ARRAY_SIZE(ion_heap_meta);
 +      for (i = 0; i < len; ++i) {
 +              if (ion_heap_meta[i].id == heap->id) {
 +                      heap->name = ion_heap_meta[i].name;
 +                      heap->type = ion_heap_meta[i].type;
 +                      if(heap->id == ION_CMA_HEAP_ID)
 +                              heap->priv = &rockchip_ion_cma_dev;
 +                      ret = 0;
 +                      break;
 +              }
 +      }
 +      if (ret)
 +              pr_err("%s: Unable to populate heap, error: %d", __func__, ret);
 +      return ret;
 +}
 +
 +static int rockchip_ion_get_heap_base_size(struct device_node *node,
 +                               struct ion_platform_heap *heap)
 +{
 +      unsigned int val[2];
 +      int ret = 0;
 +
 +      ret = of_property_read_u32_array(node,
 +                      "reg", val, 2);
 +      if (!ret) {
 +              heap->base = val[0];
 +              heap->size = val[1];
 +      }
 +
 +      pr_debug("heap: %x@%lx\n", heap->size, heap->base);
 +
 +      return 0;
 +}
 +
 +static struct ion_platform_data *rockchip_ion_parse_dt(
 +                                      struct device *dev)
 +{
 +      struct device_node *dt_node = dev->of_node;
 +      struct ion_platform_data *pdata = 0;
 +      struct device_node *node;
 +      uint32_t val = 0;
 +      int ret = 0;
 +      uint32_t num_heaps = 0;
 +      int idx = 0;
 +
 +      for_each_child_of_node(dt_node, node)
 +              num_heaps++;
 +
 +      pr_info("%s: num_heaps = %d\n", __func__, num_heaps);
 +        
 +      if (!num_heaps)
 +              return ERR_PTR(-EINVAL);
 +
 +      pdata = kzalloc(sizeof(struct ion_platform_data) +
 +                      num_heaps*sizeof(struct ion_platform_heap), GFP_KERNEL);
 +      if (!pdata)
 +              return ERR_PTR(-ENOMEM);
 +      pdata->heaps = (struct ion_platform_heap*)((void*)pdata+sizeof(struct ion_platform_data));
 +      pdata->nr = num_heaps;
 +        
 +      for_each_child_of_node(dt_node, node) {
 +              ret = of_property_read_u32(node, "rockchip,ion_heap", &val);
 +              if (ret) {
 +                      pr_err("%s: Unable to find reg key", __func__);
 +                      goto free_heaps;
 +              }
 +              pdata->heaps[idx].id = val;
 +
 +              ret = rockchip_ion_populate_heap(&pdata->heaps[idx]);
 +              if (ret)
 +                      goto free_heaps;
 +
 +//            rockchip_ion_get_heap_align(node, &pdata->heaps[idx]);
 +              ret = rockchip_ion_get_heap_base_size(node, &pdata->heaps[idx]);
 +              if (ret)
 +                      goto free_heaps;
 +
 +//            rockchip_ion_get_heap_adjacent(node, &pdata->heaps[idx]);
 +              pr_info("%d:  %d  %d  %s  0x%p\n", idx, pdata->heaps[idx].type, pdata->heaps[idx].id, pdata->heaps[idx].name, pdata->heaps[idx].priv);
 +
 +              ++idx;
 +      }
 +
 +      return pdata;
 +
 +free_heaps:
 +      kfree(pdata);
 +      return ERR_PTR(ret);
 +}
 +
 +struct ion_client *rockchip_ion_client_create(const char *name)
 +{
 +      return ion_client_create(idev, name);
 +}
 +EXPORT_SYMBOL(rockchip_ion_client_create);
 +
 +static long rockchip_custom_ioctl (struct ion_client *client, unsigned int cmd,
 +                            unsigned long arg)
 +{
 +      pr_debug("[%s %d] cmd=%X\n", __func__, __LINE__, cmd);
 +
 +      switch (cmd) {
 +      case ION_IOC_CLEAN_CACHES:
 +      case ION_IOC_INV_CACHES:
 +      case ION_IOC_CLEAN_INV_CACHES:
 +              break;
 +      case ION_IOC_GET_PHYS:
 +      {
 +              struct ion_phys_data data;
 +              struct ion_handle *handle;
 +              int ret;
 +              
 +              if (copy_from_user(&data, (void __user *)arg,
 +                                      sizeof(struct ion_phys_data)))
 +                      return -EFAULT;
 +
 +              handle = ion_handle_get_by_id(client, data.handle);
 +              if (IS_ERR(handle))
 +                      return PTR_ERR(handle);
 +
 +              ret = ion_phys(client, handle, &data.phys, (size_t *)&data.size);
 +              pr_debug("ret=%d, phys=0x%lX\n", ret, data.phys);
 +              ion_handle_put(handle);
 +              if(ret < 0)
 +                      return ret;
 +              if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_phys_data)))
 +                      return -EFAULT;
 +              break;
 +      }
 +      case ION_IOC_GET_SHARE_ID:
 +      {
 +              struct ion_share_id_data data;
 +              struct dma_buf *dmabuf = NULL;
 +
 +              if (copy_from_user(&data, (void __user *)arg,
 +                                      sizeof(struct ion_share_id_data)))
 +                      return -EFAULT;
 +
 +              dmabuf = dma_buf_get(data.fd);
 +              if (IS_ERR(dmabuf))
 +                      return PTR_ERR(dmabuf);
 +
 +              data.id = (unsigned int)dmabuf;
 +//            dma_buf_put(dmabuf);
 +
 +              if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_id_data)))
 +                      return -EFAULT;
 +
 +              break;
 +      }
 +      case ION_IOC_SHARE_BY_ID:
 +      {
 +              struct ion_share_id_data data;
 +              int fd = 0;
 +
 +              if (copy_from_user(&data, (void __user *)arg,
 +                                      sizeof(struct ion_share_id_data)))
 +                      return -EFAULT;
 +
 +              fd = dma_buf_fd((struct dma_buf*)data.id, O_CLOEXEC);
 +              if (fd < 0)
 +                      return fd;
 +
 +              data.fd = fd;
 +
 +              if (copy_to_user((void __user *)arg, &data, sizeof(struct ion_share_id_data)))
 +                      return -EFAULT;
 +
 +              break;
 +      }
 +      default:
 +              return -ENOTTY;
 +      }
 +      
 +      return 0;
 +}
 +
 +static int rockchip_ion_probe(struct platform_device *pdev)
 +{
 +      struct ion_platform_data *pdata;
 +      unsigned int pdata_needs_to_be_freed;
 +      int err;
 +      int i;
 +
 +      err = device_register(&rockchip_ion_cma_dev);
 +      if (err) {
 +              pr_err("Could not register %s\n", dev_name(&rockchip_ion_cma_dev));
 +              return err;
 +      }
 +
 +      if (pdev->dev.of_node) {
 +              pdata = rockchip_ion_parse_dt(&pdev->dev);
 +              if (IS_ERR(pdata)) {
 +                      return PTR_ERR(pdata);
 +              }
 +              pdata_needs_to_be_freed = 1;
 +      } else {
 +              pdata = pdev->dev.platform_data;
 +              pdata_needs_to_be_freed = 0;
 +      }
 +
 +      num_heaps = pdata->nr;
 +      heaps = kzalloc(sizeof(struct ion_heap *) * num_heaps, GFP_KERNEL);
 +
 +      idev = ion_device_create(rockchip_custom_ioctl);
 +      if (IS_ERR_OR_NULL(idev)) {
 +              kfree(heaps);
 +              return PTR_ERR(idev);
 +      }
 +      /* create the heaps as specified in the board file */
 +      for (i = 0; i < num_heaps; i++) {
 +              struct ion_platform_heap *heap_data = &pdata->heaps[i];
 +
 +              heaps[i] = ion_heap_create(heap_data);
 +              if (IS_ERR_OR_NULL(heaps[i])) {
 +                      err = PTR_ERR(heaps[i]);
 +                      goto err;
 +              }
 +              ion_device_add_heap(idev, heaps[i]);
 +      }
 +      platform_set_drvdata(pdev, idev);
 +      if (pdata_needs_to_be_freed)
 +              kfree(pdata);
 +
 +      pr_info("Rockchip ion module is successfully loaded (%s)\n", ROCKCHIP_ION_VERSION);
 +      return 0;
 +err:
 +      for (i = 0; i < num_heaps; i++) {
 +              if (heaps[i])
 +              ion_heap_destroy(heaps[i]);
 +      }
 +      if (pdata_needs_to_be_freed)
 +              kfree(pdata);
 +      kfree(heaps);
 +      return err;
 +}
 +
 +static int rockchip_ion_remove(struct platform_device *pdev)
 +{
 +      struct ion_device *idev = platform_get_drvdata(pdev);
 +      int i;
 +
 +      ion_device_destroy(idev);
 +      for (i = 0; i < num_heaps; i++)
 +              ion_heap_destroy(heaps[i]);
 +      kfree(heaps);
 +      return 0;
 +}
 +
 +int __init rockchip_ion_find_reserve_mem(unsigned long node, const char *uname,
 +                              int depth, void *data)
 +{
 +#ifdef CONFIG_CMA
++      const __be32 *prop;
++      int len;
 +      phys_addr_t size;
 +      phys_addr_t base;
 +      u32 heap_type;
 +
 +      if (!of_flat_dt_is_compatible(node, "rockchip,ion-reserve"))
 +              return 0;
 +
 +      prop = of_get_flat_dt_prop(node, "reg", &len);
 +      if (!prop || (len != 2 * sizeof(unsigned long)))
 +              return 0;
 +
 +      base = be32_to_cpu(prop[0]);
 +      size = be32_to_cpu(prop[1]);
 +
 +      prop = of_get_flat_dt_prop(node, "rockchip,ion_heap", &len);
 +      if (!prop || (len != sizeof(unsigned long)))
 +              return 0;
 +
 +      heap_type = be32_to_cpu(prop[0]);
 +
 +      pr_info("%s: heap type is %x\n", __func__, heap_type);
 +
 +      if (heap_type==ION_CARVEOUT_HEAP_ID) {
 +              pr_info("%s: reserve carveout memory: %x@%x\n", __func__, size, base);
 +              memblock_remove(base, size);
 +      } else {
 +              pr_info("%s: reserve cma memory: %x@%x\n", __func__, size, base);
 +              dma_declare_contiguous(&rockchip_ion_cma_dev, size, base, 0);
 +      }
 +#endif
 +
 +      return 0;
 +}
 +
 +static const struct of_device_id rockchip_ion_dt_ids[] = {
 +      { .compatible = "rockchip,ion", },
 +      {}
 +};
 +
 +static struct platform_driver ion_driver = {
 +      .probe = rockchip_ion_probe,
 +      .remove = rockchip_ion_remove,
 +      .driver = {
 +              .name = "ion-rockchip",
 +              .owner  = THIS_MODULE,
 +              .of_match_table = of_match_ptr(rockchip_ion_dt_ids),
 +      },
 +};
 +
 +static int __init ion_init(void)
 +{
 +      return platform_driver_register(&ion_driver);
 +}
 +
 +static void __exit ion_exit(void)
 +{
 +      platform_driver_unregister(&ion_driver);
 +}
 +
 +subsys_initcall(ion_init);
 +module_exit(ion_exit);
 +
Simple merge
Simple merge
Simple merge
index 010d070c9798a77a3df9d24e731393658d26fb88,46efdca96952705541f2decafb654c0c437de050..eff3ee6a62e07f36c0e3c965440f20ecde646811
mode 100755,100644..100755
Simple merge
Simple merge
diff --cc lib/Makefile
index 3bf1387a187c8e5281296195b9a42f9eb397b404,3def8e1ce90512bb033fdc1baa7f40aa5a82335b..d2541cd840103ffb86aa0686bf8000f646a54fb9
@@@ -140,9 -140,8 +140,10 @@@ obj-$(CONFIG_GENERIC_STRNLEN_USER) += s
  
  obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
  
- libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o
 +obj-$(CONFIG_PIE) += pie.o
 +
+ libfdt_files = fdt.o fdt_ro.o fdt_wip.o fdt_rw.o fdt_sw.o fdt_strerror.o \
+              fdt_empty_tree.o
  $(foreach file, $(libfdt_files), \
        $(eval CFLAGS_$(file) = -I$(src)/../scripts/dtc/libfdt))
  lib-$(CONFIG_LIBFDT) += $(libfdt_files)