linux.git
6 years agoMLK-19517-02 brcmfmac: handle compressed tx status signal
Chung-Hsien Hsu [Tue, 8 May 2018 07:29:35 +0000 (15:29 +0800)]
MLK-19517-02 brcmfmac: handle compressed tx status signal

Firmware inform the driver about tx status by normal tx status signal
or compressed tx status signal. This patch adds support to handle the
compressed tx status signal.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit: 480bdeffb48904468ca5591721b148a736e03d68)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19517-01 brcmfmac: add CYW89342 PCIE device
Saint Chuang [Fri, 4 May 2018 08:49:53 +0000 (03:49 -0500)]
MLK-19517-01 brcmfmac: add CYW89342 PCIE device

CYW89342 is a 2x2 MIMO,802.11a/b/g/n/ac,SDIO 3.0 and PCIe 3.0 for WLAN.
It is an automotive wireless chip.

Signed-off-by: Saint Chuang <jiac@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit: 53fda4df73934276239dc5b43cceecf2d9f62c52)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19091 cfg80211: make phy index match after wiphy dev is released
Andy Duan [Thu, 13 Sep 2018 09:23:37 +0000 (17:23 +0800)]
MLK-19091 cfg80211: make phy index match after wiphy dev is released

During insmod/rmmod test, the phy index increases that cause troube
for test case. To make global variable wiphy_counter match between
creat and free wiphy device, it needs to decrease the atomic counter
when wiphy device is freed.

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19516 brcmfmac: fix 4339 CRC error under SDIO 3.0 SDR104 mode
Double Lo [Thu, 6 Sep 2018 05:49:41 +0000 (00:49 -0500)]
MLK-19516 brcmfmac: fix 4339 CRC error under SDIO 3.0 SDR104 mode

This patch fixes 4339 CRC error while running Tput test with
suspend/resume test script. Update F2 Watermark to 48 to avoid
CRC error.

The continuous failure messages before system crash:
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 25600 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
brcmfmac: brcmf_sdiod_sglist_rw: CMD53 sg block read failed -84
brcmfmac: brcmf_sdio_rxglom: glom read of 24576 bytes failed: -5
brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame

Tested-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-21 brcmfmac: Remove WOWL configuration in disconnect state
Double Lo [Tue, 13 Mar 2018 08:22:20 +0000 (03:22 -0500)]
MLK-18675-21 brcmfmac: Remove WOWL configuration in disconnect state

Set wowl configuration in disconnect state is redundant.
Remove it to fix no scan result issue after resume.

Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-20 brcmfmac: Support wake on ping packet
Double Lo [Tue, 6 Feb 2018 11:07:05 +0000 (05:07 -0600)]
MLK-18675-20 brcmfmac: Support wake on ping packet

FMAC driver need to provide a dummy wowlan filter for kernel and
provided the well configured wowlan stack. So the system will
keep driver in connected state in suspend mode and can be wake
up by ping packet.

Enable unicast packet filter before system suspend and
disable it after resume.

Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-19 brcmfmac: make firmware eap_restrict a module parameter
Wright Feng [Fri, 2 Mar 2018 06:45:32 +0000 (00:45 -0600)]
MLK-18675-19 brcmfmac: make firmware eap_restrict a module parameter

When eap_restrict is enabled, firmware will toss non-802.1x frames from
tx/rx data path if station not yet authorized.
Internal firmware eap_restrict is disabled by default. This patch makes
it possible to enable firmware eap_restrict by specifying
eap_restrict=1 as module parameter.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-18 brcmfmac: add a module parameter to set scheduling priority of sdio_dpc
Wright Feng [Fri, 2 Mar 2018 02:41:21 +0000 (20:41 -0600)]
MLK-18675-18 brcmfmac: add a module parameter to set scheduling priority of sdio_dpc

To enhance RX throughput, we add a module parameter "sdio_dpc_prio" to let
user can set scheduling  priority for sdio_dpc. It can improve RX
throughput by reducing the receiving time in sdio_dpc.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-17 brcmfmac: fix system warning message during wowl suspend
Double Lo [Mon, 5 Feb 2018 10:33:49 +0000 (04:33 -0600)]
MLK-18675-17 brcmfmac: fix system warning message during wowl suspend

There is a system warning message, warn_slowpath-fmt, during suspend
while using supplicant join AP and enable wowl feature by IW command.
It's cuased by brcmf_pno_remove_request path can't find the reqid.
This fix will not go to remove pno request function if there is no
pno scan.

Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-16 brcmfmac: do not print ulp_sdioctrl get error
Naveen [Tue, 6 Feb 2018 06:22:58 +0000 (11:52 +0530)]
MLK-18675-16 brcmfmac: do not print ulp_sdioctrl get error

Don't print ulp_sdioctrl get error as errors are expected for non ulp
cases.

Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-15 brcmfmac: support AP isolation
Wright Feng [Wed, 31 Jan 2018 10:07:12 +0000 (04:07 -0600)]
MLK-18675-15 brcmfmac: support AP isolation

Hostap daemon has a parameter "ap_isolate which is used to prevent
low-level bridging of frames between associated stations in the BSS.
For driver side, we add cfg80211 ops method change_bss to support
setting AP isolation from user space.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-14 brcmfmac: Add support for 43428 SDIO device ID
Wright Feng [Mon, 29 Jan 2018 02:52:08 +0000 (20:52 -0600)]
MLK-18675-14 brcmfmac: Add support for 43428 SDIO device ID

The device 43428 is a new SDIO device ID but shares the same WLAN core
with device 43430a1. It is a 1x1 802.11b/g/n 2.4GHz HT20,
256-QAM/Turbo QAM WLAN chip.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-13 brcmfmac: add FT-based AKMs in brcmf_set_key_mgmt() for FT support
Chung-Hsien Hsu [Thu, 1 Feb 2018 03:50:33 +0000 (11:50 +0800)]
MLK-18675-13 brcmfmac: add FT-based AKMs in brcmf_set_key_mgmt() for FT support

Add WLAN_AKM_SUITE_FT_8021X and WLAN_AKM_SUITE_FT_PSK in
brcmf_set_key_mgmt() for FT support.

Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agobrcmfmac: Fix compilation error
Vipul Kumar [Tue, 8 Jan 2019 09:13:36 +0000 (14:43 +0530)]
brcmfmac: Fix compilation error

This patch fix the below compilation errors.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_ulp_pre_redownload_check’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2631:10: error: implicit declaration of function ‘brcmf_sdiod_regrb’; did you mean ‘brcmf_sdiod_readb’? [-Werror=implicit-function-declaration]
  value = brcmf_sdiod_regrb(bus->sdiodev, SDIO_CCCR_IOEx, &err);
          ^~~~~~~~~~~~~~~~~
          brcmf_sdiod_readb
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:437:2: error: implicit declaration of function ‘brcmf_sdiod_regrl’; did you mean ‘brcmf_sdiod_readl’? [-Werror=implicit-function-declaration]
  brcmf_sdiod_regrl(sdh, D11SHM_ADDR(offset), ret)
  ^~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2636:18: note: in expansion of macro ‘D11SHM_RD’
   ulp_wake_ind = D11SHM_RD(bus->sdiodev, M_ULP_WAKE_IND(
                  ^~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:434:2: error: implicit declaration of function ‘brcmf_sdiod_regwl’; did you mean ‘brcmf_sdiod_readl’? [-Werror=implicit-function-declaration]
  brcmf_sdiod_regwl(sdh, D11SHM_ADDR(offset), val, ret)
  ^~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2654:4: note: in expansion of macro ‘D11SHM_WR’
    D11SHM_WR(bus->sdiodev, M_DS1_CTRL_SDIO(
    ^~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_firmware_callback’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4388:9: error: implicit declaration of function ‘brcmf_bus_started’; did you mean ‘brcmf_bus_txctl’? [-Werror=implicit-function-declaration]
   err = brcmf_bus_started(dev);
         ^~~~~~~~~~~~~~~~~
         brcmf_bus_txctl
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o' failed
make[6]: *** [drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o] Error 1

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agobrcmfmac: pass struct in brcmf_fw_get_firmwares()
Vipul Kumar [Tue, 8 Jan 2019 08:59:39 +0000 (14:29 +0530)]
brcmfmac: pass struct in brcmf_fw_get_firmwares()

As per 'commit d09ae51a4b67 ("brcmfmac: pass struct in
brcmf_fw_get_firmwares()")', make changes in the brcmf_fw_get_firmwares()
call to fix the compilation error.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_ulp_reinit_fw’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:45: error: ‘BRCMF_FW_REQUEST_NVRAM’ undeclared (first use in this function); did you mean ‘BRCMF_FW_TYPE_NVRAM’?
  err = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM,
                                             ^~~~~~~~~~~~~~~~~~~~~~
                                             BRCMF_FW_TYPE_NVRAM
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:45: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2598:17: error: passing argument 3 of ‘brcmf_fw_get_firmwares’ from incompatible pointer type [-Werror=incompatible-pointer-types]
          sdiodev->fw_name, sdiodev->nvram_name,
          ~~~~~~~^~~~~~~~~
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:22,
                 from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h:93:14: note: expected ‘void (*)(struct device *, int,  struct brcmf_fw_request *)’ but argument is of type ‘char *’
       void (*fw_cb)(struct device *dev, int err,
       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       struct brcmf_fw_request *req));
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:8: error: too many arguments to function ‘brcmf_fw_get_firmwares’
  err = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM,
        ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:22,
                 from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h:92:5: note: declared here
 int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
     ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-12 brcmfmac: DS1 Exit should re download the firmware.
Naveen [Tue, 9 Jan 2018 06:03:10 +0000 (11:33 +0530)]
MLK-18675-12 brcmfmac: DS1 Exit should re download the firmware.

In Deep Sleep mode ARM is off and once Exit trigger comes than
Mail Box Interrupt comes to Host and whole Re Initiation should be done
in the ARM to start TX/RX.

Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Vipul: Fixed merge conflicts
Conflict:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-11 brcmfmac: 43012 Update F2 Watermark to 0x60 to fix DMA Error during...
Naveen [Thu, 4 Jan 2018 06:04:15 +0000 (11:34 +0530)]
MLK-18675-11 brcmfmac: 43012 Update F2 Watermark to 0x60 to fix DMA Error during UDP RX Traffic.

The number of words that the read FIFO has to contain except
the end of frame before sends data back to the host.
Max watermark = (512B - 2* (BurstLength))/4 =
(512 - 128)/4 = 384/4 = 0x60
so if burst length (i.e. BurstLength = 64) is increased,
watermark has to be reduced. This is the optimal setting for this chip.

Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-10 brcmfmac: calling skb_orphan before sending skb to SDIO bus
Wright Feng [Tue, 2 Jan 2018 02:12:54 +0000 (20:12 -0600)]
MLK-18675-10 brcmfmac: calling skb_orphan before sending skb to SDIO bus

Linux 3.6 introduces TSQ which has a per socket threshold for TCP Tx
packet to reduce latency. In fcmode 1/2, host driver enqueues skb in
hanger and TCP doesn't push new skb frees until host frees the skb when
receiving fwstatus event. So using skb_orphan before sending skb to bus
will make the skb removing the ownership of socket. With this patch, we
got better throughput in fcmode 1/2.

Tested 43455 TCP throughput in 20 MHz bandwidth with/without this patch.
fcmode 0: 59.5 / 59.6 (Mbps)
fcmode 1: 59.3 / 23.4 (Mbps)
fcmode 2: 59.6 / 21.5 (Mbps)

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-07 brcmfmac: Saverestore support changes for 43012
Andy Duan [Mon, 25 Jun 2018 08:54:07 +0000 (16:54 +0800)]
MLK-18675-07 brcmfmac: Saverestore support changes for 43012

Saverestore register settings for 43012.

Signed-off-by: Praveen Babu Chandran <pucn@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Vipul: updated while rebase on v4.19
conflicts:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-06 brcmfmac: set apsta to 1 when AP start on primary interface.
Wright Feng [Mon, 11 Sep 2017 07:48:57 +0000 (02:48 -0500)]
MLK-18675-06 brcmfmac: set apsta to 1 when AP start on primary interface.

APSTA can work on two band concurrently with using VSDB(Virtual
Simultaneous Dual-Band) or RSDB(Real Simultaneous Dual-Band) features.
In this case, we have to keep apsta is 1 in firmware side. However, if
we start wpa_supplicant on wlan0 and then start hostapd on wlan 1, the
apsta will be set to 0, and we will see data stall on wlan0(station)
So that, we only set apsta to 1 when AP start on primary interface.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-05 brcmfmac: Add support for CYW43012 SDIO chipset
Chi-Hsien Lin [Tue, 20 Jun 2017 07:20:23 +0000 (02:20 -0500)]
MLK-18675-05 brcmfmac: Add support for CYW43012 SDIO chipset

CYW43012 is a 1x1 802.11a/b/g/n Dual-Band HT20, 256-QAM/Turbo QAM. It
is an Ultra Low Power WLAN+BT combo chip.

Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Vipul: updated whilre rebase on v4.19
conflicts:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-04 brcmfmac: return -EPERM when getting error in vendor command handler
Wright Feng [Tue, 22 Aug 2017 03:36:04 +0000 (22:36 -0500)]
MLK-18675-04 brcmfmac: return -EPERM when getting error in vendor command handler

Firmware returns proprietary error code when getting error in
fil_cmd_data_set or fil_cmd_data_get. Sometimes the vendor tool or
utilities which uses libnl may stuck in some commands when wl is down.
For example, issue "scan" command after issuing "down" command, the
"scan" command will be the blocking call and stuck as no response from
firmware. It is caused by that firmware returns BCME_NOTUP(-4) when wl
is down, but in Linux the -4 is -EINTR, so libnl catches the error and
not pass to upper layer.
Because of that, the driver should return Linux error code instead of the
proprietary error code, and the tools or utilities need to get the real
firmware error code by another command "bcmerrorstr" after receiving
the error.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-03 brcmfmac: Add sg parameters dts parsing
Chi-Hsien Lin [Tue, 15 Aug 2017 05:25:14 +0000 (00:25 -0500)]
MLK-18675-03 brcmfmac: Add sg parameters dts parsing

broken_sg_support, sd_head_align, and sd_sgentry_align are used in
brcmfmac code but not configurable in dts file. Add the parsing logic.
Now they can be configured like below in dts:
brcm,broken_sg_support;
brcm,sd_head_align = /bits/ 16 <4>;
brcm,sd_sgentry_align = /bits/ 16 <4>;

Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agobrcmfmac: Rename / replace old IO functions with simpler ones.
Vipul Kumar [Tue, 8 Jan 2019 06:46:20 +0000 (12:16 +0530)]
brcmfmac: Rename / replace old IO functions with simpler ones.

As per 'commit 71bd508d7ded ("brcmfmac: Rename / replace old IO functions
with simpler ones.")', rename/ replace old IO functions to fix the
compilation errors.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_firmware_callback’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4116:4: error: implicit declaration of function ‘brcmf_sdiod_regwb’; did you mean ‘brcmf_sdiod_readb’? [-Werror=implicit-function-declaration]
    brcmf_sdiod_regwb(sdiodev, SBSDIO_WATERMARK, CY_4373_F2_WATERMARK, &err);
    ^~~~~~~~~~~~~~~~~
    brcmf_sdiod_readb
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4116:22: error: ‘sdiodev’ undeclared (first use in this function); did you mean ‘sdiod’?
    brcmf_sdiod_regwb(sdiodev, SBSDIO_WATERMARK, CY_4373_F2_WATERMARK, &err);
                      ^~~~~~~
                      sdiod
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4116:22: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4117:13: error: implicit declaration of function ‘brcmf_sdiod_regrb’; did you mean ‘brcmf_sdiod_readb’? [-Werror=implicit-function-declaration]
    devctl = brcmf_sdiod_regrb(sdiodev, SBSDIO_DEVICE_CTL, &err);
             ^~~~~~~~~~~~~~~~~
             brcmf_sdiod_readb
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o' failed

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agobrcmfmac: Fix compilation error
Vipul Kumar [Tue, 8 Jan 2019 06:30:10 +0000 (12:00 +0530)]
brcmfmac: Fix compilation error

As per 'commit 2d6edad4b2da ("brcmfmac: remove duplicate pointer variable
from brcmf_sdio_firmware_callback()")', make changes to fix the
compilation error.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_firmware_callback’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4112:11: error: ‘sdiodev’ undeclared (first use in this function); did you mean ‘sdiod’?
   switch (sdiodev->func0->device) {
           ^~~~~~~
           sdiod
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4112:11: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agobrcmfmac: Remove array of functions
Vipul Kumar [Tue, 8 Jan 2019 06:24:52 +0000 (11:54 +0530)]
brcmfmac: Remove array of functions

As per 'commit c9aa7a91de74 ("brcmfmac: Remove array of functions")'
replace the array of functions with a pair of pointers to the
relevant functions to fix the compilation errors.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c: In function ‘brcmf_sdiod_probe’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c:920:15: error: ‘struct brcmf_sdio_dev’ has no member named ‘func’; did you mean ‘func1’?
  if (sdiodev->func[0]->device == SDIO_DEVICE_ID_CYPRESS_4373) {
               ^~~~
               func1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c:924:37: error: ‘struct brcmf_sdio_dev’ has no member named ‘func’; did you mean ‘func1’?
  ret = sdio_set_block_size(sdiodev->func[2], f2_blksz);
                                     ^~~~
                                     func1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_firmware_callback’:

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-18675-02 brcmfmac: Set F2 blksz and Watermark to 256 for 4373
Wright Feng [Tue, 20 Jun 2017 10:11:24 +0000 (05:11 -0500)]
MLK-18675-02 brcmfmac: Set F2 blksz and Watermark to 256 for 4373

We got SDIO_CRC_ERROR with 4373 on SDR104 when doing bi-directional
throughput test. Setting F2 blocksize and enable watermark to 256 to
guarantee the operation stability.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflictts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17362-01 Changes for wireless and cfg80211 support
Nakul Kachhwaha [Tue, 28 Feb 2017 06:17:01 +0000 (11:47 +0530)]
MLK-17362-01 Changes for wireless and cfg80211 support

[Patch] Pulling the following commits and some general changes
from custom v3.10 kernel for supporting qcacld2.0 on kernel v4.9.11.
1. cfg80211: Using new wiphy flag WIPHY_FLAG_DFS_OFFLOAD
When flag WIPHY_FLAG_DFS_OFFLOAD is defined, the driver would handle
all the DFS related operations. Therefore the kernel needs to ignore
the DFS state that it uses to block the userspace calls to the driver
through cfg80211 APIs. Also it should treat the userspace calls to
start radar detection as a no-op.

Please note that changes in util.c is not picked up explicitly.
Kernel v4.9.11 uses wrapper cfg80211_get_chans_dfs_required which takes
care of this change.

Change-Id: I9dd2076945581ca67e54dfc96dd3dbc526c6f0a2
IRs-Fixed: 202686

2. New db.txt from git/sforshee/wireless-regdb.git
CONFIG_CFG80211_INTERNAL_REGDB is enabled in build. This causes
kernel warn messages as db.txt is empty. A new db.txt is added
from:
git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git

IRs-Fixed: 202686

3. Picked up the declaration and definition of the function
cfg80211_is_gratuitous_arp_unsolicited_na

Change-Id: I1e4083a2327c121073226aa6b75bb6b5b97cec00
CRs-fixed: 1079453

Signed-off-by: Nakul Kachhwaha <nkachh@codeaurora.org>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
(TODO: checkpatch warnings)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17136 ath10k: clear fetch board fail log
Gao Pan [Tue, 8 Jan 2019 05:46:48 +0000 (11:16 +0530)]
MLK-17136 ath10k: clear fetch board fail log

Below fail log is caused by firmware version issue.
"ath10k_pci 0000:01:00.0: failed to fetch board data"

To clear the log, ath10k_dbg is used to replace ath10k_err.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17033: ath10k: fix suspend/resume fail issue
Gao Pan [Fri, 1 Dec 2017 05:17:07 +0000 (13:17 +0800)]
MLK-17033: ath10k: fix suspend/resume fail issue

qca6174 wifi driver causes system hang during suspend/resume stress test.
This patch fix this suspend/resume fail issue.

Signed-off-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry-picked from 72fbaf4aa36e7407108d1c0b7d857287f84bee3d)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-17819 ARM: imx7ulp: update iomux header for i.MX7ULP B0 silicon
Fugang Duan [Thu, 15 Mar 2018 09:36:29 +0000 (17:36 +0800)]
MLK-17819 ARM: imx7ulp: update iomux header for i.MX7ULP B0 silicon

- Update iomux header for i.MX7ULP B0 silicon.
- Align the pin func name with header file for all dts files.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Shenwei Wang <shenwei.wang@nxp.com>
During the 4.14 rebase all intermediate commits were adjusted for
upstream prefix so this has many fewer dts changes.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13441-1 ARM: imx7ulp: iomux: add imx7ulp header file
Andy Duan [Mon, 9 May 2016 09:54:12 +0000 (17:54 +0800)]
MLK-13441-1 ARM: imx7ulp: iomux: add imx7ulp header file

Add imx7ulp header file.

Two changes base on original header file from iomux tool team:
- Remove the mux register column since mux and conf is shared in
  one register.
- IOMUX_0 part:
  The register address: 0x4103_d000 ~ 0x4103_d0cc, the header file
  offset is 0xdxxx, now change it to 0x0xxx. The common base address
  0x4103_d000 is defined by dts file.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Renamed to same convention as upstream

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip
Peter Chen [Mon, 24 Jul 2017 09:30:23 +0000 (17:30 +0800)]
MLK-16065-5 extcon: ptn5150: add PTN5150 Type-C CC logic chip

Add NXP PTN5150 Type-C CC logic chip, this chip supplies CC flip
function automatically, and the driver will notify extcon
consumer (USB controller driver) attach and detach events.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14720 epdc: correct WFE setting when bypass legacy process
Robby Cai [Thu, 20 Apr 2017 09:17:42 +0000 (17:17 +0800)]
MLK-14720 epdc: correct WFE setting when bypass legacy process

set WFE (WFE_A on imx7d, and WFE_B on imx6ull/imx6sll) input address to
framebuffer start address, and set left/top coordinate since the framebuffer is
the original source of WFE (i.e., not from PXP output) when bypass legacy mode.
The patch also limits the condition to bypass legacy mode when not use
EPDC_FLAG_USE_ALT_BUFFER.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 7f19940705902623166777c675f5e10c9e7fc477)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15030: EPDC: Filled stride value of s0_param layer
Guoniu.Zhou [Sat, 10 Jun 2017 07:51:59 +0000 (15:51 +0800)]
MLK-15030: EPDC: Filled stride value of s0_param layer

When epdc driver use pxp, it didn't fill stride value of s0_parm, so it leads to
epdc can display picture normally.

So fill it in this patch.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14516 epdc: bypass pxp legacy process when there's no transformation
Robby Cai [Thu, 9 Mar 2017 13:42:04 +0000 (21:42 +0800)]
MLK-14516 epdc: bypass pxp legacy process when there's no transformation

when there's no transform (Y8 format in framebuffer, no rotation,
no look-up transformation such as CMAP, no scaling/flip, etc.)
and no dithering, bypass pxp legacy process to save time.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13982: 4.9 rebase: EPDC does not work
Cristina Ciocan [Mon, 27 Feb 2017 10:04:17 +0000 (12:04 +0200)]
MLK-13982: 4.9 rebase: EPDC does not work

The Linux kernel regulator core implementation does not accept negative
voltage values; all negative values are treated as errors.

The problem with the EPDC is that the panel uses a negative voltage
regulator which fails to be enabled by the regulator core. This issue has
slipped up until the 4.9 rebase because the voltage range [min, max] was
checked against only when min = max. This has been fixed in 4.9, resulting
in errors in the VCOM regulator driver.

The fix is to use the negative values when communicating with the hardware,
but send only positive values to the regulator core.

This patch sends the absolute value to the regulator core and transforms
the received value (from the regulator core) to negative one before sending
it to hardware.

Fix device tree to deal with negative voltage regulator values by setting
min_value = -real_max_value and vice versa. Boards affected:
- imx6dl-sabresd
- imx6ull-14x14-ddr3-arm2
- imx7d-12x12-lpddr3-arm2
- imx7d-sdb
- imx6sll-evk
- imx6sl-evk
- imx6sll-lpddr3-arm2

Signed-off-by: Cristina Ciocan <cristina-mihaela.ciocan@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12179 epdc: use outer_flush_range instead of outer_flush_all
Robby Cai [Tue, 12 Jan 2016 08:35:12 +0000 (16:35 +0800)]
MLK-12179 epdc: use outer_flush_range instead of outer_flush_all

l2c210_flush_all, the underlying implementation of outer_flush_all()
has the constraint on 4.1 kernel that, it can not be called under interrupt
 context. However the EPDC driver can not guarantee this condition at
calling point, thus it could cause kernel dump. This has been observed on
i.MX6SL, and theorically on other platforms like i.MX6DL
(using PL310 L2 cache). So use outer_flush_range to fix it.

Although we don't have such issue on i.MX7D (not PL310 L2), we still prefer
to use outer_flush_range() for legacy software dithering support and
for easy maintenance. Then we do the change in both EPDC driver.

------------[ cut here ]------------
Kernel BUG at 800204d8 [verbose debug info unavailable]
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
Modules linked in: galcore(O) evbug
CPU: 0 PID: 842 Comm: kworker/u3:1 Tainted: G           O    4.1.8-1.0.0+ge352a0b #1
Hardware name: Freescale i.MX6 SoloLite (Device Tree)
Workqueue: EPDC Submit epdc_submit_work_func
task: a8a8f900 ti: a92a4000 task.ti: a92a4000
PC is at l2c210_flush_all+0x5c/0x60
LR is at epdc_submit_work_func+0x684/0xbf8
pc : [<800204d8>]    lr : [<8030702c>]    psr: 600b0013
sp : a92a5e90  ip : a9150c8c  fp : a8480518
r10: a84a28c0  r9 : 00000008  r8 : a9150644
r7 : a91512e0  r6 : 0000012c  r5 : a91512e0  r4 : a91512dc
r3 : a00b0013  r2 : 80b184a0  r1 : 701fe019  r0 : f4a02000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: a943404a  DAC: 00000015
Process kworker/u3:1 (pid: 842, stack limit = 0xa92a4210)
Stack: (0xa92a5e90 to 0xa92a6000)
5e80:                                     a92a5ed0 8005d058 0000bbc2 a851d4c0
5ea0: 00000000 a9150000 a8480000 a8480440 00000190 00000193 55555556 a84a28c0
5ec0: a8480518 a8500000 80b18088 a94f3900 00000000 00000000 00000190 0000012c
5ee0: a94f3900 a8480518 a87e8d80 a8479000 a845a200 00000020 00000000 a8479000
5f00: a8479000 80046458 a92a4000 a8479000 a8479014 a8479000 a87e8d98 a8479014

...

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12144 epdc: fix gpio active level to enable epdc signal
Robby Cai [Thu, 7 Jan 2016 10:19:34 +0000 (18:19 +0800)]
MLK-12144 epdc: fix gpio active level to enable epdc signal

There's a GPIO pin to enable epdc signals on some platform like i.MX7D SDB.
However, it's changed from active-low to active-high on i.MX7D SDB RevB
board.
Enhance the driver to handle the active level automatically, then only
need to adjust gpio as well as active level in dts file if necessary.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-11476 iio: adc: Enable i.MX6SX adc driver.
Luwei Zhou [Thu, 6 Mar 2014 07:47:47 +0000 (15:47 +0800)]
MLK-11476 iio: adc: Enable i.MX6SX adc driver.

Enable i.MX6SX adc driver. ADC driver will try getting ADC controller
channel number via device tree, because i.MX chip enable 4 channels
on each controller.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit 14a6a98f64e26702b1c0ecfc7d58a45ee5752d54)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19258-4 doc: dts: ci-hdrc-usb2: add property for picophy
Peter Chen [Tue, 21 Aug 2018 09:15:36 +0000 (17:15 +0800)]
MLK-19258-4 doc: dts: ci-hdrc-usb2: add property for picophy

Add two parameters which are used to tune USB signal for picophy,
picophy is used at imx7d and imx845.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-18535-13 dt-bindings: display: bridge: add sec-dsim bindings
Fancy Fang [Thu, 7 Jun 2018 07:13:57 +0000 (15:13 +0800)]
MLK-18535-13 dt-bindings: display: bridge: add sec-dsim bindings

Add the device-tree bindings for the display bridge
Samsung MIPI DSIM on i.MX platforms.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-17491-40 dt-bindings: clock: add imx7ulp clock binding doc
Dong Aisheng [Sat, 13 May 2017 09:25:03 +0000 (17:25 +0800)]
MLK-17491-40 dt-bindings: clock: add imx7ulp clock binding doc

i.MX7ULP Clock functions are under joint control of the System
Clock Generation (SCG) modules, Peripheral Clock Control (PCC)
modules, and Core Mode Controller (CMC)1 blocks

Note IMX7ULP has two clock domains: M4 and A7. This binding doc
is only for A7 clock domain.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-16973-1 dt-bindings: display: Add JDI TX26D202VM0BWA LCD panel bindings
Liu Ying [Fri, 24 Nov 2017 07:34:03 +0000 (15:34 +0800)]
MLK-16973-1 dt-bindings: display: Add JDI TX26D202VM0BWA LCD panel bindings

The JDI TX26D202VM0BWA LCD panel is a 10.1" panel
with a 1920x1200 (WUXGA) resolution.
The panel has dual LVDS channels.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3
Peter Chen [Tue, 25 Jul 2017 01:38:25 +0000 (09:38 +0800)]
MLK-16065-6 doc: binding: cdns-usb3: add binding-doc for Cadence USB3

Add binding-doc for Cadence USB3

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15001-24 dt-bindings: Add ITE vendor prefix
Liu Ying [Mon, 27 Mar 2017 03:31:45 +0000 (11:31 +0800)]
MLK-15001-24 dt-bindings: Add ITE vendor prefix

Add vendor prefix for ITE Tech Inc. http://ite.com.tw/en

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15001-19 dt-bindings: Add Mixel vendor prefix
Liu Ying [Mon, 24 Apr 2017 05:57:11 +0000 (13:57 +0800)]
MLK-15001-19 dt-bindings: Add Mixel vendor prefix

Add vendor prefix for Mixel, Inc. http://mixel.com

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14972-01 doc: dt-bindings: add imx sc temp sensor binding doc
Bai Ping [Wed, 24 May 2017 07:38:45 +0000 (15:38 +0800)]
MLK-14972-01 doc: dt-bindings: add imx sc temp sensor binding doc

Add i.MX8QM/QXP temp sensor binding doc.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15004-6: Document: sound: update document for audio
Shengjiu Wang [Mon, 5 Jun 2017 08:01:04 +0000 (16:01 +0800)]
MLK-15004-6: Document: sound: update document for audio

update compatible string for imx-audio-cs42888.txt and fsl,esai.txt

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14985-1 Documentation: i2c: add dt documentation for isl29023
Gao Pan [Wed, 31 May 2017 08:36:17 +0000 (16:36 +0800)]
MLK-14985-1 Documentation: i2c: add dt documentation for isl29023

Add dt documentation for intersil ISL29023 ambient light sensor.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12284-2 doc: syscon: add clocks as optional property
Dong Aisheng [Thu, 28 Aug 2014 09:01:34 +0000 (17:01 +0800)]
MLK-12284-2 doc: syscon: add clocks as optional property

User can specify clocks in devicetree which is used for accessing the
registers in this regmap.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 4a89ef5b579e6fb5640df099ee13939ca6d3a325)
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMGS-577 ARM: Export the cache management symbols when !MULTI_CACHE
Shawn Xiao [Fri, 17 Apr 2015 02:48:09 +0000 (10:48 +0800)]
MGS-577 ARM: Export the cache management symbols when !MULTI_CACHE

When compiling a GPU module without CONFIG_MULTI_CACHE enabled, the
compiler prompt warning which says symbol v7_dma_map_area and
v7_dma_flush_area not exported. And when insmod GPU module, it also
warns the above two symbols not found, which cause insmod module failed.

This patch export these dma access functions and fix these issues.

Signed-off-by: Shawn Xiao <b49994@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-18834 ion: Enable ion on Kernel 4.14
Song Bing [Wed, 11 Jul 2018 00:36:06 +0000 (17:36 -0700)]
MLK-18834 ion: Enable ion on Kernel 4.14

Enable ion driver on Linux platform for Kernel 4.14.

Signed-off-by: Song Bing <bing.song@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-16784-2 documentation: sound: add documentation for PDM
Cosmin-Gabriel Samoila [Wed, 30 May 2018 14:38:14 +0000 (17:38 +0300)]
MLK-16784-2 documentation: sound: add documentation for PDM

Add documentation for micfil IP.

Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-17429-2 Documentation: add doc for EMVSIM
Gao Pan [Fri, 19 Jan 2018 07:50:51 +0000 (15:50 +0800)]
MLK-17429-2 Documentation: add doc for EMVSIM

add devicetree binding doc for add for EMVSIM

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-17429-1 Documentation: add doc for SIMv2
Gao Pan [Fri, 19 Jan 2018 07:38:39 +0000 (15:38 +0800)]
MLK-17429-1 Documentation: add doc for SIMv2

add devicetree binding doc for SIMv2

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-16347-2: Documentation: devicetree: Added nwl to vendor-prefixes
Robert Chiras [Mon, 16 Oct 2017 11:07:24 +0000 (14:07 +0300)]
MLK-16347-2: Documentation: devicetree: Added nwl to vendor-prefixes

Added nwl to Documentation in vendor-prefixes.txt, since a new driver
from Nortwest Logic was added to devicetree.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14451: Documentation: Add dt documentation for fxas2100x and fxos8700
Adriana Reus [Thu, 13 Apr 2017 07:47:48 +0000 (10:47 +0300)]
MLK-14451: Documentation: Add dt documentation for fxas2100x and fxos8700

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13562 ion: Add devicetree bindings for mxc ion
Song Bing [Wed, 30 Nov 2016 08:41:21 +0000 (16:41 +0800)]
MLK-13562 ion: Add devicetree bindings for mxc ion

Add devicetree bindings for mxc ion

Signed-off-by: Song Bing <bing.song@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12684-3: Documentation: gpmi-nand: document the gpmi-nand compatibility
Han Xu [Tue, 19 Apr 2016 20:28:44 +0000 (15:28 -0500)]
MLK-12684-3: Documentation: gpmi-nand: document the gpmi-nand compatibility

Document the gpmi-nand compatibility for i.MX6ULL and others

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12602: Documentation: gpmi-nand: legacy bch geometry option for NAND
Han Xu [Mon, 28 Mar 2016 16:19:44 +0000 (11:19 -0500)]
MLK-12602: Documentation: gpmi-nand: legacy bch geometry option for NAND

document the new option for legacy bch geometry support.

Conflicts:
Documentation/devicetree/bindings/mtd/gpmi-nand.txt

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit c1c24ecd24cb808e825eb13a3e3d016c283322cc)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-11606-01: dcic: Porting dcic driver from 3.14.y
Sandor Yu [Sat, 10 Oct 2015 07:45:29 +0000 (15:45 +0800)]
MLK-11606-01: dcic: Porting dcic driver from 3.14.y

Initial the mxc dcic driver.
Baseline copied from imx_3.14.y branch.

Signed-off-by: Sandor Yu <R01008@freescale.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15083 watchdog: imx2_wdt: fallback to timeout reset if explicit reset fails
Octavian Purdila [Wed, 21 Jun 2017 08:01:23 +0000 (11:01 +0300)]
MLK-15083 watchdog: imx2_wdt: fallback to timeout reset if explicit reset fails

If explicit reset fails fallback using the watchdog timeout. We
already have set the timeout counter to 0, but we might need to ping
the watchdog to load the new timeout, if a previous watchdog timeout
value has already been set.

We also decrease the time we spend waiting, to give a chance to log
that the explicit reset failed and that we fallback to watchdog
timeout reset.

Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13632 driver: watchdog: Fix system reset when sending wdog unlock sequence
Bai Ping [Mon, 19 Dec 2016 10:11:07 +0000 (18:11 +0800)]
MLK-13632 driver: watchdog: Fix system reset when sending wdog unlock sequence

For i.MX7ULP wdog, when we want to unlock the wdog with 16bit unlock command,
the two unlock command sequence must be write to WDOG_CNT register within 16 bus
clocks, otherwise, system may be reset unexpected. As writel include memory barrier,
if we use writel to send the unlock command, it may take more time than 16 bus clock,
so we should use writel_relaxed to write the unlock command to the CNT register.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13564 driver: watchdog: Add system reboot support on imx7ulp
Bai Ping [Mon, 5 Dec 2016 06:31:53 +0000 (14:31 +0800)]
MLK-13564 driver: watchdog: Add system reboot support on imx7ulp

Add system reboot for i.MX7ULP. As there is no other way to reboot the
system, so use wdog restart handler to trigger the system reboot.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Arul: Fix for 4.19 kernel.
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13535 driver: watchdog: fix wdog reset after resume from vlls mode
Bai Ping [Tue, 29 Nov 2016 06:52:46 +0000 (14:52 +0800)]
MLK-13535 driver: watchdog: fix wdog reset after resume from vlls mode

When resuming from VLLS mode, the wdog will be reset, the first we configure
the wdog, an initial timeout value should be write into the TOVAL register,
otherwise, the wdog will not be initialized successfully.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13520-02 driver: watchdog: Add watchdog driver for imx7ulp
Bai Ping [Thu, 24 Nov 2016 06:44:38 +0000 (14:44 +0800)]
MLK-13520-02 driver: watchdog: Add watchdog driver for imx7ulp

Add watchdog driver for i.MX7ULP.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-18771 ahci: imx: add the bist mode sysfile callback
Richard Zhu [Thu, 5 Jul 2018 02:39:43 +0000 (10:39 +0800)]
MLK-18771 ahci: imx: add the bist mode sysfile callback

In order to do SATA compliance tests, add the bist mode
sysfile callback to generate kinds of test patterns.
- Add the "ahci-imx.bist=1" into kernel command line to
register the bist mode enable callback.
- Use "echo <pattern_#> /sys/devices/.../ahci_bist_pattern"
to generate the responding test pattern.
- Use "cat /sys/devices/.../ahci_bist_pattern" to check
the current pattern configuration.
NOTE:
LBP 0, LFTP 1, MFTP 2, HFTP 3.
- Adjust the TX-DEEMP and COMINT to pass the compliance tests.

BuildInfo:
- SCFW 685bd659, SECO-FW 00000000, IMX-MKIMAGE 53974947, ATF 625d9ed
- U-Boot 2017.03-01018-g6045484

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-11681-2 ata: imx: enable sata on imx6qp
Richard Zhu [Fri, 9 Oct 2015 06:43:24 +0000 (14:43 +0800)]
MLK-11681-2 ata: imx: enable sata on imx6qp

Since the version of the imx6qp's ahci controller
is same to the version of imx6q ahci controller.
So, this work-around should be applied to imx6qp
ahci too.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit 31a7eab5be9843263535306dbaa08592b66714e5)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-10456-2 ata: imx: add the reset for 6qp sata
Richard Zhu [Fri, 13 Mar 2015 07:38:56 +0000 (15:38 +0800)]
MLK-10456-2 ata: imx: add the reset for 6qp sata

- add the sata phy power down and phy reset for 6qp
sata

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit b1270554354d46cf7676e354e63ec4f11766e6f6)
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-11444 ata: imx: cmd buf corruption errata bug fix
Richard Zhu [Tue, 7 Jul 2015 07:29:01 +0000 (15:29 +0800)]
MLK-11444 ata: imx: cmd buf corruption errata bug fix

errata:
When a read command returns less data than specified in the PRDs (for
example, there are two PRDs for this command, but the device returns a
number of bytes which is less than in the first PRD), the second PRD of
this command is  not read out of the PRD FIFO, causing the next command
to use this PRD erroneously.

workaround
- forces sg_tablesize = 1
- modified the sg_io function in block/scsi_ioctl.c to use a 64k buffer
  allocated with dma_alloc_coherent during the probe in ahci_imx
- In order to fix the scsi/sata hang, when CD_ROM and HDD are
  accessed simultaneously after the workaround is applied.
  Do not go to sleep in scsi_eh_handler, when there is host failed.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19048: pinctrl: add defer probe check for pinctrl setting assertion
Andy Duan [Thu, 26 Jul 2018 10:48:03 +0000 (18:48 +0800)]
MLK-19048: pinctrl: add defer probe check for pinctrl setting assertion

Pinctrl support of a device tree property "pinctrl-assert-gpios"
under client device node to select function at a board level pin
multiplexer. The pin route is controlled by a GPIO or i2c/spi expander
GPIO.

For i2c/spi expander GPIO, it may be loaded after client device that
set "pinctrl-assert-gpios" property in devicetree. Then the client device's
pin function doesn't work.

So it should add defer probe check for the GPIO pin.

Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-17491-9 pinctrl: imx: cleanup gpio_set_direction
Dong Aisheng [Wed, 6 Sep 2017 07:46:00 +0000 (15:46 +0800)]
MLK-17491-9 pinctrl: imx: cleanup gpio_set_direction

First of all, the design of using CONFIG_IBE_OBE is wrong as both VF and
IMX has IBE and OBE while current code defined it in common code but for
only IMX which causes a bit confusing.

Second, remove the following invalid comments as we will clear IBE.
"IBE always enabled allows us to read the value on the wire"

Last, replace the complicated "if else" statement with a much simpler one.

Cc: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Fixes: 07787c40ff3b ("MLK-13485-3 pinctrl: imx: modify the imx pinctrl to support imx7ulp gpio")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-15128-3 pinctrl: freescale: support scu and memmap pinctrl together
Anson Huang [Tue, 20 Jun 2017 15:05:52 +0000 (23:05 +0800)]
MLK-15128-3 pinctrl: freescale: support scu and memmap pinctrl together

As i.MX8MQ is a ARM64 SoC but it does NOT use SCU pinctrl, so
need to support both SCU and MEMMAP pinctrl together for ARM64
build.

use IMX8_USE_SCU flag to distinguish SCU and MEMMAP pinctrl
type.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14946-2: pinctrl: imx8qm/qxp: switch to use new format
Peng Fan [Thu, 18 May 2017 10:06:58 +0000 (18:06 +0800)]
MLK-14946-2: pinctrl: imx8qm/qxp: switch to use new format

switch to use new format. Split mux out from pad config.
Change the high two bits in pad config to 0, because driver
will automatically set that two bits to 1.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
[Arul: Fix merge conflicts, Skipped arm64 dts files]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-14012 pinctrl: imx: fix imx_pinctrl_parse_pin
Peng Fan [Tue, 21 Feb 2017 02:51:23 +0000 (10:51 +0800)]
MLK-14012 pinctrl: imx: fix imx_pinctrl_parse_pin

list is a local variable, each time imx_pinctrl_parse_pin is
invoked, list points to the first pin. Directly use list_p in
imx_pinctrl_parse_pin to fix it.

When splitting pinctrl-imx.c, two pieces code is correctly moved.
 - In imx_pmx_set_one_pin, when mux_reg is -1, need to return 0 to
   let the caller continue the loop.
 - In imx_pinctrl_parse_pin, need to use (mux_reg != -1) when calculating
   the pin_id.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13911-7 drivers: pinctrl: support i.MX8 SCU
Peng Fan [Sat, 18 Feb 2017 12:08:43 +0000 (20:08 +0800)]
MLK-13911-7 drivers: pinctrl: support i.MX8 SCU

On i.MX8QM/QXP, pin is handled by SCU, A53/72 can not directly
handle pinmux as i.MX6/7.

Split the original pinctrl-imx.c to two parts, the pinctrl-memmap.c
will handle the memory mapped access for i.MX6/7. pinctrl-imx.c
will be shared by legacy i.mx and i.MX8.

Introduce pinctrl-scu.c to handle the connection with SCU to configure
pin settings.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Rebased on top of 4.14 changes

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agopinctrl: imx7ulp: HACK: remove generic_pinconf = true
Leonard Crestez [Tue, 13 Mar 2018 16:35:58 +0000 (18:35 +0200)]
pinctrl: imx7ulp: HACK: remove generic_pinconf = true

This makes imx7ulp boot.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13441-11 pinctrl: pinctrl-imx7ulp: update support for iomux controller
Andy Duan [Mon, 9 May 2016 09:58:15 +0000 (17:58 +0800)]
MLK-13441-11 pinctrl: pinctrl-imx7ulp: update support for iomux controller

Add support for imx7ulp iomux controller.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Merged with upstream 4.14 version

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-13303-6 pinctrl: freescale: imx6sll: add pinctrl driver
Anson Huang [Sun, 9 Oct 2016 10:16:44 +0000 (18:16 +0800)]
MLK-13303-6 pinctrl: freescale: imx6sll: add pinctrl driver

Add pinctrl driver support for i.MX6SLL.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
[Arul: Fix merge conficts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-12796-01 pinctrl: imx: Add iomuxc_snvs pinctrl driver for i.mx6ull
Bai Ping [Mon, 16 May 2016 05:38:02 +0000 (13:38 +0800)]
MLK-12796-01 pinctrl: imx: Add iomuxc_snvs pinctrl driver for i.mx6ull

On i.MX6ULL, the BOOT_MODEx and TAMPERx pin MUX and CTRL register
have been moved from IOMUXC to IOMUXC_SNVS, so the pinctrl driver
should be modified to support the IOMUXC_SNVS.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-11281-3 pinctrl: pinctrl-imx: add suspend/resume for LPSR
Robin Gong [Thu, 11 Jun 2015 09:23:32 +0000 (17:23 +0800)]
MLK-11281-3 pinctrl: pinctrl-imx: add suspend/resume for LPSR

To support pinctl hog restore after LPSR resume back,
add suspend/resume in pinctrl driver.

Signed-off-by: Robin Gong <b38343@freescale.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
6 years agoMLK-19414 can: flexcan: fix runtime PM warning
Joakim Zhang [Wed, 19 Sep 2018 07:07:33 +0000 (15:07 +0800)]
MLK-19414 can: flexcan: fix runtime PM warning

When do CAN wakeup test, it printed "flexcan 2094000.can: Unbalanced
pm_runtime_enable!" warning.

For wakeup system resume case, it will call pm_runtime_force_resume(),
however, pm_runtime_force_suspend() haven't been called in system suspend.
While pm_runtime_force_resume() will decrease the variable "disable_depth",
and pm_runtime_force_suspend() will increase "disable_depth". So, if we
didn't call pm_runtime_force_suspend() but called
pm_runtime_force_resume(), would produce this waring.

To fix this warning, pm_runtime_force_suspend() and
pm_runtime_force_resume() should appear in pairs.

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19557-2 can: flexcan: note for clock source select
Joakim Zhang [Wed, 12 Sep 2018 11:06:32 +0000 (19:06 +0800)]
MLK-19557-2 can: flexcan: note for clock source select

FLEXCAN has supported selecting the clock source to the CAN Protocol Engine
(PE). It's SoC Implementation dependent. Refer to RM for detailed
definition of each SoC.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19473 can: flexcan: clean up the code in flexcan
Joakim Zhang [Mon, 7 Jan 2019 09:19:35 +0000 (14:49 +0530)]
MLK-19473 can: flexcan: clean up the code in flexcan

This patch does't add new feature just clean up the code. We choose the
exist method in upstream to read/write registers, but modify the method
to read/write mailboxes. The struct of "flexcan_mb" and variables of
"tx_mb/tx_mb_reserved" will not be used, so delete them.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19351-5 can: flexcan: allow user to disable can fd mode from device
Dong AiSheng [Tue, 28 Aug 2018 07:41:51 +0000 (15:41 +0800)]
MLK-19351-5 can: flexcan: allow user to disable can fd mode from device
tree

Normally CAN FD capable device must work on FD mode as it has different
statically claimed bittiming capability.
This patch provides users to disable CAN FD capability if users want
to only work at normal mode.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19351-4 can: flexcan: add notes for available fd mode rate
Dong AiSheng [Tue, 28 Aug 2018 07:24:49 +0000 (15:24 +0800)]
MLK-19351-4 can: flexcan: add notes for available fd mode rate
combination

CAN FD can only support some specific bitrate combinations in FD mode
due to HW limitations. See below info mentioned in RM:
"To minimize errors when processing FD frames, use the same value
for FPRESDIV and PRESDIV (in CAN_CBT or CAN_CTRL1)."

Add notes in driver to let user know easily:

CAN FD supported rates combinations
* Combination 1:
*  Bitrate: 225000 375000 400000 425000 500000 875000
*  Data rate: 1000000
*
* Combination 2:
*  Bitrate:   550000 600000 625000 650000 675000 750000 775000
*             800000 850000 925000 950000 975000 1000000
*  Data rate: 1500000 2000000 2500000 3000000 3500000 4000000
*             5000000

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agocan: flexcan: Fix compilation error
Vipul Kumar [Mon, 7 Jan 2019 07:35:33 +0000 (13:05 +0530)]
can: flexcan: Fix compilation error

As per 'commit 88462d2a7830 ("can: flexcan: Remodel FlexCAN register r/w
APIs for big endian FlexCAN controllers.")', make changes to fix the
compilation error.

drivers/net/can/flexcan.c: In function ‘flexcan_set_bittiming’:
drivers/net/can/flexcan.c:1135:3: error: implicit declaration of function ‘flexcan_write’; did you mean ‘flexcan_write_le’? [-Werror=implicit-function-declaration]
   flexcan_write(reg, &regs->fdcbt);
   ^~~~~~~~~~~~~
   flexcan_write_le
In file included from drivers/net/can/flexcan.c:12:
drivers/net/can/flexcan.c:1146:7: error: implicit declaration of function ‘flexcan_read’; did you mean ‘flexcan_read_le’? [-Werror=implicit-function-declaration]
       flexcan_read(&regs->ctrl),
       ^~~~~~~~~~~~
./include/linux/netdevice.h:4636:46: note: in definition of macro ‘netdev_dbg’
   netdev_printk(KERN_DEBUG, __dev, format, ##args); \
                                              ^~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target 'drivers/net/can/flexcan.o' failed

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19351-3 can : flexcan: improve can fd bittiming setting
Dong AiSheng [Tue, 28 Aug 2018 07:08:40 +0000 (15:08 +0800)]
MLK-19351-3 can : flexcan: improve can fd bittiming setting

The CAN bit timing variables (PRESDIV, PROPSEG, PSEG1, PSEG2 and RJW)
can also be configured in CAN_CBT register, which extends the range of
all these variables. It can improve the bittiming accuracy.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19351-2 can: flexcan: add can fd bitrate switch support
Dong AiSheng [Mon, 7 Jan 2019 07:19:39 +0000 (12:49 +0530)]
MLK-19351-2 can: flexcan: add can fd bitrate switch support

Add can fd bitrate switch support

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Vipul: Fixed merge conflicts and 4.19 updates.
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agocan: flexcan: Fix compilation errors
Vipul Kumar [Mon, 7 Jan 2019 07:11:23 +0000 (12:41 +0530)]
can: flexcan: Fix compilation errors

As per commit 'e05237f9da42 (can: flexcan: remove not needed struct
flexcan_priv::tx_mb and struct flexcan_priv::tx_mb_idx)', make changes to
fix the compilation error.

drivers/net/can/flexcan.c: In function ‘flexcan_start_xmit’:
drivers/net/can/flexcan.c:711:33: error: ‘const struct flexcan_priv’ has no member named ‘tx_mb_idx’
   flexcan_mb_write_le(priv, priv->tx_mb_idx,
                                 ^~
drivers/net/can/flexcan.c:720:32: error: ‘const struct flexcan_priv’ has no member named ‘tx_mb_idx’
  flexcan_mb_write_le(priv, priv->tx_mb_idx, FLEXCAN_MB_ID, can_id);
                                ^~
drivers/net/can/flexcan.c:721:32: error: ‘const struct flexcan_priv’ has no member named ‘tx_mb_idx’
  flexcan_mb_write_le(priv, priv->tx_mb_idx, FLEXCAN_MB_CTRL, ctrl);
                                ^~
drivers/net/can/flexcan.c: In function ‘flexcan_irq’:
drivers/net/can/flexcan.c:992:33: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
   flexcan_mb_write_le(priv, priv->tx_mb_idx, FLEXCAN_MB_CTRL,
                                 ^~
drivers/net/can/flexcan.c: In function ‘flexcan_chip_start’:
drivers/net/can/flexcan.c:1231:16: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
   for (i = priv->tx_mb_idx; i < priv->mb_num ; i++) {
                ^~
drivers/net/can/flexcan.c:1242:32: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
  flexcan_mb_write_le(priv, priv->tx_mb_idx, FLEXCAN_MB_CTRL,
                                ^~
drivers/net/can/flexcan.c:1254:15: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
  for (i = priv->tx_mb_idx; i < priv->mb_num ; i++)
               ^~
drivers/net/can/flexcan.c: In function ‘flexcan_probe’:
drivers/net/can/flexcan.c:1642:8: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
    priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_TIMESTAMP_FD;
        ^~
drivers/net/can/flexcan.c:1646:8: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
    priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_TIMESTAMP;
        ^~
drivers/net/can/flexcan.c:1646:22: error: ‘FLEXCAN_TX_MB_OFF_TIMESTAMP’ undeclared (first use in this function); did you mean ‘FLEXCAN_TX_MB_OFF_TIMESTAMP_FD’?
    priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_TIMESTAMP;
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                      FLEXCAN_TX_MB_OFF_TIMESTAMP_FD
drivers/net/can/flexcan.c:1646:22: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/can/flexcan.c:1657:7: error: ‘struct flexcan_priv’ has no member named ‘tx_mb_idx’
   priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_FIFO;
       ^~
drivers/net/can/flexcan.c:1657:21: error: ‘FLEXCAN_TX_MB_OFF_FIFO’ undeclared (first use in this function); did you mean ‘FLEXCAN_ESR_BOFF_INT’?
   priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_FIFO;
                     ^~~~~~~~~~~~~~~~~~~~~~
                     FLEXCAN_ESR_BOFF_INT
scripts/Makefile.build:303: recipe for target 'drivers/net/can/flexcan.o' failed
make[3]: *** [drivers/net/can/flexcan.o] Error 1

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-19351-1 can: flexcan: add can fd mode support
Dong AiSheng [Mon, 7 Jan 2019 06:44:59 +0000 (12:14 +0530)]
MLK-19351-1 can: flexcan: add can fd mode support

Add CAN FD protocol support which supports extended frames up to 64
bytes

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Vipul: Fixed merge conflicts and make changes while rebase on v4.19
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
6 years agoMLK-19029 net: can: flexcan: fix the build warning
Peter Chen [Tue, 24 Jul 2018 08:39:08 +0000 (16:39 +0800)]
MLK-19029 net: can: flexcan: fix the build warning

linux-imx/drivers/net/can/flexcan.c: In function ‘flexcan_probe’:
linux-imx/drivers/net/can/flexcan.c:1506:2: warning: label
‘failed_register’ defined but not used [-Wunused-label]
  failed_register:
    ^~~~~~~~~~~~~~~

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-16757-2 can: flexcan: implement runtime pm
Dong Aisheng [Tue, 31 Oct 2017 10:06:44 +0000 (18:06 +0800)]
MLK-16757-2 can: flexcan: implement runtime pm

Implement runtime PM which will:
1) Keep device in suspend state (clocks disabled) if it's not openned
2) Make Power Domain framework be able to shutdown the corresponding power
domain of this device.

Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-16757-1 can: flexcan: disable clocks during suspend
Dong Aisheng [Mon, 30 Oct 2017 11:13:38 +0000 (19:13 +0800)]
MLK-16757-1 can: flexcan: disable clocks during suspend

Flexcan will be stopped during suspend if no wakeup function required
and enabled after resume accordingly. During this period, we could
explicitly disable clocks.

We do this by moving the clk_prepare_enable/clk_disable_unprepare into
flexcan_chip_start and flexcan_chip_stop functions which will be called
during suspend/resume function.

Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-12478-1 can: flexcan: add LPSR mode support
Dong Aisheng [Fri, 4 Mar 2016 08:11:40 +0000 (16:11 +0800)]
MLK-12478-1 can: flexcan: add LPSR mode support

For MX7D LPSR mode, the controller will lost power and got the
configuration state lost after system resume back.
So we need to set pinctrl state again and re-start chip to do
re-configuration after resume.

For wakeup case, we also need re-configure the chip in case the state
got lost. For interface is not up before suspend case, we don't need
re-configure as it will be configured by user later by interface up.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-12064 can: flexcan: fix timeout when set small bitrate
Dong Aisheng [Mon, 4 Jan 2016 12:55:55 +0000 (20:55 +0800)]
MLK-12064 can: flexcan: fix timeout when set small bitrate

Current we can meet timeout issue when setting a small bitrate
like 10000 as follows:
root@imx6qdlsolo:~# ip link set can0 up type can bitrate 10000
A link change request failed with some changes committed already.
Interface can0 may have been left with an inconsistent configuration,
please check.
RTNETLINK answers: Connection timed out

It is caused by calling of flexcan_chip_unfreeze() timeout.

Originally the code is using usleep_range(10, 20) for unfreeze operation,
but the patch (8badd65 can: flexcan: avoid calling usleep_range from
interrupt context) changed it into udelay(10) which is only a half delay
of before, there're also some other delay changes.

After only changed unfreeze delay back to udelay(20), the issue is gone.
So other timeout values are kept the same as 8badd65 changed.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-10211 can: flexcan: fix resume failed issue
Dong Aisheng [Wed, 11 Feb 2015 07:12:44 +0000 (15:12 +0800)]
MLK-10211 can: flexcan: fix resume failed issue

We can observe the following error during system resume.
dpm_run_callback(): platform_pm_resume+0x0/0x4c returns -110
PM: Device 2090000.can failed to resume: error -110

It is caused by the flexcan is in disable state and the clock is disabled
by default while the CAN is not up. During resume, the calling of
flexcan_chip_enable will obviously fail due to no clock.

The issue only happened when CAN device is not up. If CAN is up, clock is
there and no issue will happen.

Because the CAN is always in disabled state by default if it's not up.
We don't have to disable it again during suspend and enable it after
resume. This patch simply the suspend/resume to only enter/exit disabled
mode if CAN is up.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit d976d7c9d408c1275075d5870ccf6cb425720434)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-10131 flexcan: fix wakeup unwork issue
Dong Aisheng [Thu, 22 Jan 2015 13:48:07 +0000 (21:48 +0800)]
MLK-10131 flexcan: fix wakeup unwork issue

Original code will always disable flexcan during suspend no matter whether
wakeup feature is enabled.
It's caused by merge issue when doing kernel upgrade.

Fix it by removing that disable code.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 55c8670332973d3184816d3d16c2c3e07681c781)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
6 years agoMLK-10131 ENGR00300439-5 can: flexcan: parse stop mode control bits from device tree
Dong Aisheng [Mon, 24 Feb 2014 06:25:12 +0000 (14:25 +0800)]
MLK-10131 ENGR00300439-5 can: flexcan: parse stop mode control bits from device tree

Starting from IMX6, the flexcan stop mode control bits is SoC specific,
move it out of IP driver and parse it from devicetree.
It's good from maintain perspective and can avoid adding too many SoC
specifi bits in driver but with no IP changes when the IMX SoC series
keep growing.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 97b99b59c9f09d58ea35f3c0cf58665c20f2e292)
(cherry picked from commit 6355208605715f7cb9ea8c37e29c577785f66898)

Conflicts:
arch/arm/boot/dts/imx6qdl.dtsi
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>