summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2014-06-04HACK: drm/nouveau: prime: Pin buffer objects to VRAMHEADmasterThierry Reding1-2/+31
This is currently required to work around the lack of proper SMMU support on Tegra. Ideally buffer objects could always be pinned to GART and the SMMU will take care of mapping them to a linear I/O virtual address range for importers. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm/nouveau: Fix mapping of big pagesThierry Reding1-2/+6
This patch courtesy of Alexandre Courbot (via IRC). An improved version of this has been submitted upstream for review. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04HACK: Disable IOMMU for nowThierry Reding1-0/+2
2014-06-04drm/prime: Use unsigned type for number of pagesThierry Reding1-1/+1
The number of pages can never be negative, so an unsigned type is enough. This also matches the type of the n_pages argument of the sg_alloc_table_from_pages() function. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04regulator: as3722: Make 0 a valid selectorThierry Reding1-0/+2
As of commit 064d5cd110f9 (regulator: core: Fix the init of DT defined fixed regulators) the regulator core tries to query the current voltage of a regulator when applying constraints. This exposes a bug in the AS3722 regulator driver which fails to read the voltage of disabled regulators. The reason is that the hardware is programmed to a selector of 0, but none of the voltage tables include 0 as a valid selector. The datasheets indicate that 0 is a valid selector when the regulators are powered off. To fix this, add a range including selector 0 to the voltage tables. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm/tegra: Allow non-authenticated processes to create buffer objectsThierry Reding1-1/+1
This matches what other drivers do for equivalent IOCTLs. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04tiling bo params fixupThierry Reding2-3/+2
2014-06-04drm/tegra: Add SET/GET_TILING IOCTLsThierry Reding1-0/+95
These IOCTLs can be used to set the tiling mode of a buffer object after it has been allocated or imported. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm/tegra: Implement more tiling modesThierry Reding5-21/+116
Tegra124 supports a block-linear mode in addition to the regular pitch linear and tiled modes. Add support for these by moving the internal representation into a structure rather than a simple flag. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04fence: Use smp_mb__before_atomic()Thierry Reding1-2/+2
Commit febdbfe8a91c (arch: Prepare for smp_mb__{before,after}_atomic()) deprecated the smp_mb__{before,after}_{atomic,clear}_{dec,inc,bit}*() functions in favour of the unified smp_mb__{before,after}_atomic(). Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04WIP: PCI: tegra: Remove several fixupsThierry Reding1-15/+0
The bridge fixup is not needed since the PCI core will enable I/O and memory accesses as well as bus mastering on bridge devices by default. Also disable the root port class fixup for device IDs 0x0e1c and 0xe1d since those devices apparently don't exist. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04WIP: memory: Add Tegra124 memory controller supportThierry Reding2-0/+178
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04retry on timeoutThierry Reding1-1/+4
2014-06-04clk: tegra124: Enable hda to hdmi clocksDylan Reid1-0/+5
Add the clocks used for HDMI audio played through the HDA controller. Initialize the codec clock to 48Mhz and the HDA clock to 102MHz per the TRM. Signed-off-by: Dylan Reid <dgreid@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm/plane: Fix a couple of checkpatch warningsThierry Reding1-3/+3
Code should be indented using tabs rather than spaces (see CodingStyle) and the canonical form to declare a constant static variable is using "static const" rather than "const static". Fixes the following warnings from checkpatch: $ scripts/checkpatch.pl -f drivers/gpu/drm/drm_plane_helper.c WARNING: storage class should be at the beginning of the declaration #40: FILE: drivers/gpu/drm/drm_plane_helper.c:40: +const static uint32_t safe_modeset_formats[] = { WARNING: please, no spaces at the start of a line #41: FILE: drivers/gpu/drm/drm_plane_helper.c:41: + DRM_FORMAT_XRGB8888,$ WARNING: please, no spaces at the start of a line #42: FILE: drivers/gpu/drm/drm_plane_helper.c:42: + DRM_FORMAT_ARGB8888,$ Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04WIP: drm/plane: Use unsigned int for format countThierry Reding2-3/+3
Rather than the sized uint32_t, use an unsized unsigned int to specify the format count. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm/plane: Fix sparse warningsThierry Reding1-0/+1
Include the drm_plane_helper.h header file to fix the following sparse warnings: CHECK drivers/gpu/drm/drm_plane_helper.c drivers/gpu/drm/drm_plane_helper.c:102:5: warning: symbol 'drm_primary_helper_update' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:219:5: warning: symbol 'drm_primary_helper_disable' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:233:6: warning: symbol 'drm_primary_helper_destroy' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:241:30: warning: symbol 'drm_primary_helper_funcs' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:259:18: warning: symbol 'drm_primary_helper_create_plane' was not declared. Should it be static? Doing that makes gcc complain as follows: CC drivers/gpu/drm/drm_plane_helper.o drivers/gpu/drm/drm_plane_helper.c:260:19: error: conflicting types for 'drm_primary_helper_create_plane' struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ In file included from drivers/gpu/drm/drm_plane_helper.c:29:0: include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_create_plane': drivers/gpu/drm/drm_plane_helper.c:274:11: warning: assignment discards 'const' qualifier from pointer target type formats = safe_modeset_formats; ^ In file included from include/linux/linkage.h:6:0, from include/linux/kernel.h:6, from include/drm/drmP.h:45, from drivers/gpu/drm/drm_plane_helper.c:27: drivers/gpu/drm/drm_plane_helper.c: At top level: drivers/gpu/drm/drm_plane_helper.c:289:15: error: conflicting types for 'drm_primary_helper_create_plane' EXPORT_SYMBOL(drm_primary_helper_create_plane); ^ include/linux/export.h:57:21: note: in definition of macro '__EXPORT_SYMBOL' extern typeof(sym) sym; \ ^ drivers/gpu/drm/drm_plane_helper.c:289:1: note: in expansion of macro 'EXPORT_SYMBOL' EXPORT_SYMBOL(drm_primary_helper_create_plane); ^ In file included from drivers/gpu/drm/drm_plane_helper.c:29:0: include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ Which can easily be fixed by making the signatures of the implementation and the prototype match. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm: Use const data when creating blob propertiesThierry Reding1-2/+2
Creating a blob property will always copy the input data so the data that is passed in can be const. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04drm: Use size_t for blob property sizesThierry Reding1-3/+5
size_t is the standard type when dealing with sizes of all kinds. Use it consistently when instantiating DRM blob properties. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04Merge branch 'staging/tegra' into staging/masterThierry Reding2-0/+8
Conflicts: arch/arm/boot/dts/tegra124.dtsi arch/arm/configs/tegra_defconfig
2014-06-04Merge branch 'staging/gk20a' into staging/masterThierry Reding39-95/+1841
2014-06-04Merge branch 'staging/drm/panel' into staging/masterThierry Reding1-0/+19
2014-06-04Merge branch 'staging/drm/tegra' into staging/masterThierry Reding20-231/+400
2014-06-04Merge branch 'staging/host1x' into staging/masterThierry Reding4-21/+47
2014-06-04Merge branch 'staging/drm/fixes' into staging/masterThierry Reding23-77/+130
2014-06-04Merge branch 'staging/pci' into staging/masterThierry Reding6-99/+479
2014-06-04Merge branch 'staging/iommu' into staging/masterThierry Reding6-192/+493
2014-06-04Merge branch 'staging/xusb-padctl' into staging/masterThierry Reding3-0/+920
2014-06-04WIP: clk: tegra: Add 297 MHz and 148.5 MHz frequencies for pll_d2Thierry Reding1-0/+2
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04WIP: clk: tegra: Enable spread-spectrum for PLLEThierry Reding1-0/+6
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Add Tegra124 supportThierry Reding1-31/+180
The PCIe controller on Tegra124 has two root ports that can be used in a x4/x1 or x2/x1 configuration and can run at PCIe 2.0 link speeds (up to 5 GT/s). The PHY programming has been moved into a separate controller, so the driver now needs to request an external PHY referenced using the device tree. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Implement accurate power supply schemeThierry Reding1-61/+87
The current description of power supplies doesn't match the hardware. Instead it's designed to support the needs of current designs, which will break as soon as a new design appears that cannot be described using the current assumptions. In order to fully support all possible future designs, all power supply inputs to the PCIe block need to be accurately described and separately configurable. Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Thierry Reding <treding@nvidia.com> --- Changes in v2: - fix typo "enable" -> "disable"
2014-06-04PCI: tegra: Make sure the PCIe PLL is really resetThierry Reding1-0/+7
Depending on the prior state of the controller, the PLL reset may not be pulsed. Clear the register bit and set it after a small delay to ensure that the PLL is really reset. Signed-off-by: Eric Yuen <eyuen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Fix extended configuration space mappingPeter Daifuku1-1/+1
The 16 chunks of 64 KiB that need to be stitched together to make up the configuration space for one bus (1 MiB) are located 24 bits (== 16 MiB) apart in physical address space. This is determined by the start of the extended register field (bits 24-27) in the physical mapping. Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Clear CLKREQ# enable on port disableThierry Reding1-0/+5
When a root port is disabled, disable the CLKREQ# signal if available. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Allow building as a moduleThierry Reding1-1/+1
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: Export pci_create_root_bus()Thierry Reding1-0/+1
This function is commonly used by PCIe host controller drivers. Export it so that these drivers can be built as modules. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: Export MSI helpersThierry Reding1-0/+3
The mask_msi_irq(), unmask_msi_irq() and write_msi_msg() functions are typically used by PCIe host controller drivers. Export them so that these drivers can be built as modules. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-04PCI: tegra: Support driver unbindingThierry Reding1-1/+44
Implement the platform driver's .remove() callback to free all resources allocated during driver setup and call pci_common_exit() to cleanup ARM specific datastructures. Unmap the fixed PCI I/O mapping by calling the new pci_iounmap_io() function in the new .teardown() callback. Finally, no longer set the .suppress_bind_attrs field to true to allow the driver to unbind from a device. Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: add multiple asid_security supportHiroshi Doyu1-6/+32
In Tegra124 the number of MC_SMMU_ASID_SECURITY_# registers increased. Now this info is provided as platfrom data. If no platfrom data the default valude(1) is used. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: adjust TLB_FLUSH_ASID bit rangeHiroshi Doyu1-3/+6
TLB_FLUSH_ASID bit range depends on the number of asids to support other number than the current 4, especially for a new Tegra124. Based on Terje's internal patch. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Cc: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: {TLB,PTC} reset value per SoCHiroshi Doyu1-4/+13
T124 has some new register bits in {TLB,PTC}_CONFIG: - TLB_RR_ARB and PTC_REQ_LIMIT - TLB_ACTIVE_LINES 0x20 instead of 0x10 They are defined as platform data now. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: support more than 32 bit paHiroshi Doyu1-7/+29
Add support for more than 32 bit physical address. If physical address space is 32bit, there will be no register write happening. Based on Pavan's internal patch. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Cc: Pavan Kunapuli <pkunapuli@nvidia.com> Cc: Mark Zhang <markz@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: add support platform dataHiroshi Doyu1-23/+45
The later Tegra SoC(>= T124) has more registers for MC_SMMU_TRANSLATION_ENABLE_*. Now those info is provided as platfrom data. If those varies a lot on SoCs in the future, we can consider putting them into DT later. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: convert swgroup ID to asid offsetHiroshi Doyu1-3/+18
Provide a conversion table from swgroup ID to MC_SMMU_<swgroup name>_ASID_0 register offset to support non-linear conversion. This conversion used to be exactly linear but after T124 we need a conversion table to support non-linear cases. We would also need another table to convert swgroup ID to HOTRESET bit. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra124: smmu: optionaly AHB enables SMMUHiroshi Doyu1-4/+4
SMMU used to depend on AHB bus. AHB driver needs to be populated and AHB_XBAR_CTRL_SMMU_INIT_DONE bit needs to be set earliear than SMMU being populated. Later Tegra SoC (>= T124) doesn't need AHB to enable SMMU on AHB_XBAR_CTRL for AHB_XBAR_CTRL_SMMU_INIT_DONE any more. This setting bit is now optional, depending on DT passing ahb phandle or not. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra: smmu: add SMMU to an global iommu listHiroshi Doyu1-24/+29
This allows to inquire if SMMU is populated or not. Suggested by Thierry Reding and copied his example code. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra: smmu: Rename hwgrp -> swgroupsHiroshi Doyu1-18/+18
Use the correct term for SWGROUP related variables and macros. The term "swgroup" is the collection of "memory client". A "memory client" usually represents a HardWare Accelerator(HWA) like GPU. Sometimes a strut device can belong to multiple "swgroup" so that "swgroup's'" is used here. This "swgroups" is the term used in Tegra TRM. Rename along with TRM. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra: smmu: allow duplicate ASID wirteHiroshi Doyu1-12/+8
The device, which belongs to the same ASID, can try to enable the same ASID as the other swgroup devices. This should be allowed but just skip the actual register write. If the write value is different, it will return -EINVAL. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-06-03iommu/tegra: smmu: get swgroups from DT "iommus="Hiroshi Doyu1-18/+116
This provides the info about which swgroups a device belongs to. This info is passed from DT. This is necessary for the unified SMMU driver among Tegra SoCs since each has different H/W accelerators. Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>