summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Collapse)Author
2014-04-16ENGR00300430-1 mtd: spi-nor: copy the SPI NOR commands to a new header fileHuang Shijie
This patch adds a new header :spi-nor.h, and copies all the SPI NOR commands and relative macros into this new header. This hearder can be used by the m25p80.c and other spi-nor controller, such as Freescale's Quadspi. Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: mux: Add support for read-only muxes.Tomasz Figa
Some platforms have read-only clock muxes that are preconfigured at reset and cannot be changed at runtime. This patch extends mux clock driver to allow handling such read-only muxes by adding new CLK_MUX_READ_ONLY mux flag. Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: mux: add CLK_MUX_HIWORD_MASKHaojian Zhuang
In both Hisilicon & Rockchip Cortex-A9 based chips, they don't use the paradigm of reading-changing-writing the register contents. Instead they use a hiword mask to indicate the changed bits. When b01 should be set as switching mux, it also needs to indicate the change by setting hiword mask (b11 << 16). The patch adds mux flag for this usage. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: divider: add CLK_DIVIDER_HIWORD_MASK flagHaojian Zhuang
In both Hisilicon & Rockchip Cortex-A9 based chips, they don't use the paradigm of reading-changing-writing the register contents. Instead they use a hiword mask to indicate the changed bits. When b01 should be set as setting divider, it also needs to indicate the change by setting hiword mask (b11 << 16). The patch adds divider flag for this usage. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: clk-mux: implement remuxing on set_rateJames Hogan
Implement clk-mux remuxing if the CLK_SET_RATE_NO_REPARENT flag isn't set. This implements determine_rate for clk-mux to propagate to each parent and to choose the best one (like clk-divider this chooses the parent which provides the fastest rate <= the requested rate). The determine_rate op is implemented as a core helper function so that it can be easily used by more complex clocks which incorporate muxes. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: add CLK_SET_RATE_NO_REPARENT flagJames Hogan
Add a CLK_SET_RATE_NO_REPARENT clock flag, which will prevent muxes being reparented during clk_set_rate. To avoid breaking existing platforms, all callers of clk_register_mux() are adjusted to pass the new flag. Platform maintainers are encouraged to remove the flag if they wish to allow mux reparenting on set_rate. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Viresh Kumar <viresh.linux@gmail.com> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Cc: Chao Xie <xiechao.mail@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: "Emilio López" <emilio@elopez.com.ar> Cc: Gregory CLEMENT <gregory.clement@free-electrons.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Prashant Gaikwad <pgaikwad@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Peter De Schrijver <pdeschrijver@nvidia.com> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Andrew Chew <achew@nvidia.com> Cc: Doug Anderson <dianders@chromium.org> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Paul Walmsley <pwalmsley@nvidia.com> Cc: Sylwester Nawrocki <s.nawrocki@samsung.com> Cc: Thomas Abraham <thomas.abraham@linaro.org> Cc: Tomasz Figa <t.figa@samsung.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: spear-devel@list.st.com Cc: linux-tegra@vger.kernel.org Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com> Acked-by: Stephen Warren <swarren@nvidia.com> [tegra] Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> [sunxi] Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com> [Zynq] Signed-off-by: Mike Turquette <mturquette@linaro.org>
2014-04-16clk: add support for clock reparent on set_rateJames Hogan
Add core support to allow clock implementations to select the best parent clock when rounding a rate, e.g. the one which can provide the closest clock rate to that requested. This is by way of adding a new clock op, determine_rate(), which is like round_rate() but has an extra parameter to allow the clock implementation to optionally select a different parent clock. The core then takes care of reparenting the clock when setting the rate. The parent change takes place with the help of some new private data members. struct clk::new_parent specifies a clock's new parent (NULL indicates no change), and struct clk::new_child specifies a clock's new child (whose new_parent member points back to it). The purpose of these are to allow correct walking of the future tree for notifications prior to actually reparenting any clocks, specifically to skip child clocks who are being reparented to another clock (they will be notified via the new parent), and to include any new child clock. These pointers are set by clk_calc_subtree(), and the new_child pointer gets cleared when a child is actually reparented to avoid duplicate POST_RATE_CHANGE notifications. Each place where round_rate() is called, determine_rate() is checked first and called in preference. This restructures a few of the call sites to simplify the logic into if/else blocks. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16clk: abstract parent cacheJames Hogan
Abstract access to the clock parent cache by defining clk_get_parent_by_index(clk, index). This allows access to parent clocks from clock drivers. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Mike Turquette <mturquette@linaro.org> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: parse out the JEDEC compliant NANDHuang Shijie
This patch adds the parsing code for the JEDEC compliant NAND. Since we need the 0x40 as the column address, this patch also makes the NAND_CMD_PARAM to use the 8-bit address only. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: add a helper to get the supported features for JEDECHuang Shijie
Add a helper to get the supported features for JEDEC compliant NAND. Also add a macro JEDEC_FEATURE_16_BIT_BUS. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: add fields for JEDEC in nand_chipHuang Shijie
Add the jedec_version field, and add an anonymous union which contains the nand_onfi_params and nand_jedec_params. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: add the data structures for JEDEC parameter pageHuang Shijie
Create the nand_jedec_params{} and jedec_ecc_info{} according to the JESD230A (Revision of JESD230, October 2012). Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16ENGR00299323-13 ARM:imx:imx6sx: add enet init for imx6sx platformFugang Duan
- Init GPR1 register to select enet1 and enet2 refrence clock from internal PLL. - Add enet MAC address checking from fuse. - Add some phy fixup, set RGMII IO voltage to 1.8V. Signed-off-by: Fugang Duan <B38611@freescale.com>
2014-04-16mtd: nand: fix misspelling in ONFI parameter field nameBrian Norris
s/strenght/strength/ This field isn't used anywhere, so this rename is safe. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: force NAND_CMD_READID onto 8-bit busBrian Norris
The NAND command helpers tend to automatically shift the column address for x16 bus devices, since most commands expect a word address, not a byte address. The Read ID command, however, expects an 8-bit address (i.e., 0x00, 0x20, or 0x40 should not be translated to 0x00, 0x10, or 0x20). This fixes the column address for a few drivers which imitate the nand_base defaults. Note that I don't touch sh_flctl.c, since it already handles this problem slightly differently (note its comment "READID is always performed using an 8-bit bus"). I have not tested this patch, as I only have x8 parts up for testing at this point. Hopefully that can change soon... Signed-off-by: Brian Norris <computersforpeace@gmail.com> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-By: Pekon Gupta <pekon@ti.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: remove the NAND_MAX_PAGESIZE/NAND_MAX_OOBSIZEHuang Shijie
There is no reference to these two macros now. Just remove them. Signed-off-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: kill the the NAND_MAX_PAGESIZE/NAND_MAX_OOBSIZE for nand_buffers{}Huang Shijie
The patch converts the arrays to buffer pointers for nand_buffers{}. The cafe_nand.c is the only NAND_OWN_BUFFERS user which allocates nand_buffers{} itself. This patch disables the DMA for nand_scan_ident, and restores the DMA status after we finish the nand_scan_ident. This way, we can get page size and OOB size and use them to allocate cafe->dmabuf. Since the cafe_nand.c uses the NAND_ECC_HW_SYNDROME ECC mode, we do not allocate the buffers for @ecccalc and @ecccode. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: add Intel manufacturer IDHuang Shijie
Add the Intel manufacturer Id. Tested with Intel JS29F32G08ACMD1(4096 + 224) which is ONFI 2.0 compliant nand. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: add SanDisk manufacturer IDHuang Shijie
Add the manufactor ID for SanDisk. Make preparation for SanDisk SDTNRGAMA-008G. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-16mtd: nand: don't use {read,write}_buf for 8-bit transfersUwe Kleine-König
According to the Open NAND Flash Interface Specification (ONFI) Revision 3.1 "Parameters are always transferred on the lower 8-bits of the data bus." for the Get Features and Set Features commands. So using read_buf and write_buf is wrong for 16-bit wide nand chips as they use I/O[15:0]. The Get Features command is easily fixed using 4 times the read_byte callback. For Set Features implement a new overwritable callback "write_byte". Still I expect the default to work just fine for all controllers and making it overwriteable was just done for symmetry. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [Brian: fixed warning] Tested-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: use __packed shorthandBrian Norris
To be consistent with the rest of include/linux/mtd/nand.h, we should use the __packed shorthand instead of __attribute__((packed)). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: support Micron READ RETRYBrian Norris
Micron provides READ RETRY support via the ONFI vendor-specific parameter block (to indicate how many read-retry modes are available) and the ONFI {GET,SET}_FEATURES commands with a vendor-specific feature address (to support reading/switching the current read-retry mode). The recommended sequence is as follows: 1. Perform PAGE_READ operation 2. If no ECC error, we are done 3. Run SET_FEATURES with feature address 89h, mode 1 4. Retry PAGE_READ operation 5. If ECC error and there are remaining supported modes, increment the mode and return to step 3. Otherwise, this is a true ECC error. 6. Run SET_FEATURES with feature address 89h, mode 0, to return to the default state. This patch implements the chip->setup_read_retry() callback for Micron and fills in the chip->read_retries. Tested on Micron MT29F32G08CBADA, which supports 8 read-retry modes. The Micron vendor-specific table was checked against the datasheets for the following Micron NAND: Needs retry Cell-type Part number Vendor revision Byte 180 ----------- --------- ---------------- --------------- ------------ No SLC MT29F16G08ABABA 1 Reserved (0) No MLC MT29F32G08CBABA 1 Reserved (0) No SLC MT29F1G08AACWP 1 0 Yes MLC MT29F32G08CBADA 1 08h Yes MLC MT29F64G08CBABA 2 08h Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: add generic READ RETRY supportBrian Norris
Modern MLC (and even SLC?) NAND can experience a large number of bitflips (beyond the recommended correctability capacity) due to drifts in the voltage threshold (Vt). These bitflips can cause ECC errors to occur well within the expected lifetime of the flash. To account for this, some manufacturers provide a mechanism for shifting the Vt threshold after a corrupted read. The generic pattern seems to be that a particular flash has N read retry modes (where N = 0, traditionally), and after an ECC failure, the host should reconfigure the flash to use the next available mode, then retry the read operation. This process repeats until all bitfips can be corrected or until the host has tried all available retry modes. This patch adds the infrastructure support for a vendor-specific/flash-specific callback, used for setting the read-retry mode (i.e., voltage threshold). For now, this patch always returns the flash to mode 0 (the default mode) after a successful read-retry, according to the flowchart found in Micron's datasheets. This may need to change in the future if it is determined that eventually, mode 0 is insufficient for the majority of the flash cells (and so for performance reasons, we should leave the flash in mode 1, 2, etc.). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16mtd: nand: add ONFI vendor block for MicronBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Huang Shijie <b32955@freescale.com>
2014-04-16ENGR00292408-1 usb: chipidea: add query_available_role interfacePeter Chen
The glue layer may need to know current available role, add ci_hdrc_query_available_role for that. Signed-off-by: Peter Chen <peter.chen@freescale.com>
2014-04-16ENGR00291282-4 usb: chipidea: imx: add HSIC supportPeter Chen
Add imx6 HSIC support Signed-off-by: Peter Chen <peter.chen@freescale.com>
2014-04-16ENGR00293234 PXP: let irq_pending variable to be atomicFancy Fang
Change irq_pending field in struct pxp_irq_info to a atomic type. So the spin lock in pxp_irq_info is unnecessary. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00293211 PXP: bind allocated DMA channels to opened device file descriptorFancy Fang
The allocated DMA channels via some opened file descriptor is better to be bound to this descriptor. Since this can avoid some application to fake a channel id which may be requested by other applications to request PXP service. And also, this make it easier to release the dma channel when application exists abnormally or forgets to release it explicitly. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00293119 PXP: change the dma buffer lists management for PXP deviceFancy Fang
Create pxp_info struct data for each opened device file descriptor. And bind all the allocated dma buffers to this struct for each opened file. This makes the dma buffer lists management safer, more effective and more flexible. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00292816 PXP: move two struct definitions to pxp_device.hFancy Fang
Move two struct definitions defined in pxp_device.c to pxp_device.h. Now the pxp_device.h has been created for PXP device driver. So all the type definition should stay in header file not c source file. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00292775 mipi csi2: Refine register accessLiu Ying
The original mipi csi2 driver uses readl()/writel() to access the 32 bit mipi csi2 registers in the following way where info->mipi_csi2_base is a pointer which points to a 32 bit I/O memory cell of the mipi csi2's base address: writel(value, info->mipi_csi2_base + offset); readl(info->mipi_csi2_base + offset); This makes the register offset values shrink 4 times, comparing to the offset values documented in the reference manual. For example, we need to change the offset value from 0x004 to 0x001 so that we may access the register MIPI_CSI2_N_LANES correctly. This patch redefines the type of info->mipi_csi2_base to 'void __iomem *', then the offset values can be the same to what they are documented. Also, the macro names for the registers are aligned to the documentation. Acked-by: Robby Cai <R63905@freescale.com> Cc: Oliver Brown <oliver.brown@freescale.com> Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2014-04-16ENGR00292562 PXP: move the definitions used only by PXP device to a new ↵Fancy Fang
header file Some definitions used only by PXP device driver should not stay in pxp_dma.h which is shared by PXP, EPDC and V4L2. So the patch creates a new header file pxp_device.h to hold these definitions. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00291731 PXP: move pxp_irq_info definition from PXP dma to PXP deviceFancy Fang
struct pxp_irq_info is only used by PXP device driver, so it is unreasonable to define it in pxp_dma.h which will be included by EPDC, V4L2 PXP and PXP device driver. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00291729 PXP: remove a mutex lock from pxp channelFancy Fang
This mutex lock is no longer necessary in PXP dma driver. After the commit "ENGR00291400 PXP: Organize PXP task queue to be FIFO", protection fields can be protected by the spin lock in PXP channel now. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00291658 PXP: allow PXP device users to submit multiple tasks before ↵Fancy Fang
start PXP After the commit "ffcad666548417ef21937e0a755d85ab922313a9" pushed, adding this support in PXP device driver is also necessary. This change allows users to submit more than one PXP tasks followd by only one wait for finished ioctl. It means that users can wait for more than one tasks done by calling one PXP_IOC_WAIT4CMPLT ioctl. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00291400 PXP: Organize PXP task queue to be FIFOFancy Fang
The requested PXP tasks were handled based on channel unit. All the tasks in one channel were handled one by one, and the tasks in another channel only can get chance after all the tasks in previous channel were finished. So this may allow some channel occupies PXP hardware exclusively all the time, and other channels may never get PXP services. So this change makes the PXP task queue to be a FIFO to avoid this kind of unfair usage for PXP. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00290664 PXP: allocate DMA TX descriptors on demand instead of in PXP ↵Fancy Fang
initialization In previous PXP driver, the number of tx descriptors allocated for each channel is a constant 16 and they can only be allocated during PXP initialization. But since the driver allows users to queue more than one PXP tasks for each channel before issuing pending tasks, so in this case the descriptors may be not enough for some cases. Signed-off-by: Fancy Fang <B47543@freescale.com>
2014-04-16ENGR00290361-1 IPUv3 IC:Add check for a IDMAC errataLiu Ying
The IPUv3 IDMAC has a bug to read 32bpp pixels from a graphics plane whose alpha component is at the most significant 8 bits. The bug only impacts on cases in which the relevant separate alpha channel is enabled. This patch adds check for the errata so that the bad cases won't be triggered. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2014-04-16ENGR00289406-1 mmc: sdhci: add quirk for get max timeout counterDong Aisheng
The max timeout counter of some SoCs like i.MX6 uSDHC may not be standard, add SDHCI_QUIRK2_NOSTD_TIMEOUT_COUNTER quirk to get the correct max timeout counter from platform specific code. Then we can calculate the correct max_discard_to value. Signed-off-by: Dong Aisheng <b29396@freescale.com>
2014-04-16of: pci: add registry of MSI chipsThomas Petazzoni
This commit adds a very basic registry of msi_chip structures, so that an IRQ controller driver can register an msi_chip, and a PCIe host controller can find it, based on a 'struct device_node'. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-04-16of/pci: Add of_pci_parse_bus_range() functionThierry Reding
This function can be used to parse a bus-range property as specified by device nodes representing PCI bridges. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-04-16of/pci: Add of_pci_get_devfn() functionThierry Reding
This function can be used to parse the device and function number from a standard 5-cell PCI resource. PCI_SLOT() and PCI_FUNC() can be used on the returned value obtain the device and function numbers respectively. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-04-16PCI: Introduce new MSI chip infrastructureThierry Reding
The new struct msi_chip is used to associated an MSI controller with a PCI bus. It is automatically handed down from the root to its children during bus enumeration. This patch provides default (weak) implementations for the architecture- specific MSI functions (arch_setup_msi_irq(), arch_teardown_msi_irq() and arch_msi_check_device()) which check if a PCI device's bus has an attached MSI chip and forward the call appropriately. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Daniel Price <daniel.price@gmail.com> Tested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-04-16PCI: use weak functions for MSI arch-specific functionsThomas Petazzoni
Until now, the MSI architecture-specific functions could be overloaded using a fairly complex set of #define and compile-time conditionals. In order to prepare for the introduction of the msi_chip infrastructure, it is desirable to switch all those functions to use the 'weak' mechanism. This commit converts all the architectures that were overidding those MSI functions to use the new strategy. Note that we keep two separate, non-weak, functions default_teardown_msi_irqs() and default_restore_msi_irqs() for the default behavior of the arch_teardown_msi_irqs() and arch_restore_msi_irqs(), as the default behavior is needed by x86 PCI code. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Tested-by: Daniel Price <daniel.price@gmail.com> Tested-by: Thierry Reding <thierry.reding@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: linuxppc-dev@lists.ozlabs.org Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: x86@kernel.org Cc: Russell King <linux@arm.linux.org.uk> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: linux-ia64@vger.kernel.org Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: David S. Miller <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Cc: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-04-16PCI: Allocate only as many MSI vectors as requested by driverAlexander Gordeev
Because of the encoding of the "Multiple Message Capable" and "Multiple Message Enable" fields, a device can only advertise that it's capable of a power-of-two number of vectors, and the OS can only enable a power-of-two number. For example, a device that's limited internally to using 18 vectors would have to advertise that it's capable of 32. The 14 extra vectors consume vector numbers and IRQ descriptors even though the device can't actually use them. This fix introduces a 'msi_desc::nvec_used' field to address this issue. When non-zero, it is the actual number of MSIs the device will send, as requested by the device driver. This value should be used by architectures to set up and tear down only as many interrupt resources as the device will actually use. Note, although the existing 'msi_desc::multiple' field might seem redundant, in fact it is not. The number of MSIs advertised need not be the smallest power-of-two larger than the number of MSIs the device will send. Thus, it is not always possible to derive the former from the latter, so we need to keep them both to handle this case. [bhelgaas: changelog, rename to "nvec_used"] Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-04-16ARM: imx6q: Add PCIe bits to GPR syscon definitionSean Cross
PCIe requires additional bits be defined for GPR8 and GPR12. Signed-off-by: Sean Cross <xobs@kosagi.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> (cherry picked from commit 8d6a35fb13406f87d926fffeee0d70360ce3077d)
2014-04-16ENGR00288567 Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits ↵Richard Zhu
definitions of gpr" switch to community upstreamed pcie driver. Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions of gpr" This reverts commit 0ddad708c7484a8b5d2016d31fda2bd8b9b8f275. Signed-off-by: Richard Zhu <r65037@freescale.com>
2014-04-16ENGR00287992-4 usb: chipidea: Add usb charger detect notifyPeter Chen
- Change .notify's return value from void to int. - Add CI_HDRC_CONTROLLER_CHARGER_EVENT and CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger detection flow. - Add usb_gadget_vbus_connect for only notify udc when vbus is on, the main reason we add it is we don't want the first notification when the vbus is off, it causes the dev->power.usage_count equals -1 when do charger detection. Signed-off-by: Peter Chen <peter.chen@freescale.com>
2014-04-16ENGR00287992-1 power: imx6: add imx6 USB charger detectionPeter Chen
Add imx6 USB charger detection, the vbus supplier will create and remove struct usb_charger, and notify vbus connect and disconnect event. The detail USB charger detection flow is at: "i.MX6 RM, Chapter Universal Serial Bus 2.0 Integrated PHY (USB-PHY), Charger detection, Charger detection software flow". Since imx6 only has charger detection function, and no charging current function is existed. It the user wants the detection abilities from SoC, it can use this detection method (add imx6-usb-charger-detection at dts). If the charger IC already has USB charger detection function, and the user wants to use the detection method from charger IC, please do not add imx6-usb-charger-detection property at dts. Signed-off-by: Peter Chen <peter.chen@freescale.com>
2014-04-16ENGR00287256 mxc: mlb: Fix the SYNC mode hang issue when connected with MITBLuwei Zhou
This patch fixes the hang and crash issue of MLB SYNC mode in the driver. The MITB will casue Sabreauto to hang and crash when testing the SYNC mode. It is because MITB will cause something error on MLB bus when stopping the SYNC test. The Sabreauto will keep entering error ISR and hang. Since we don't know the details about MITB, we make drivers provide IO_CTRL interface to disable the interrupt in SYNC mode. Signed-off-by: Luwei Zhou <b45643@freescale.com>