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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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, ®s->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(®s->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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Dong Aisheng [Wed, 6 Nov 2013 11:10:28 +0000 (19:10 +0800)]
MLK-10131 ENGR00286724-8 can: flexcan: add self wakeup support
If wakeup is enabled, enter stop mode, else enter disabled mode.
Self wake can only work on stop mode.
For imx6q, the stop request has to be mannually assert on
IOMUX GPR13[28:29] register, we use syscon to control that bit.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit
7f8ef8eeb2bd93d75eb4c970bcaabcfd499d348d)
(cherry picked from commit
496fef522e515488147cce3adcc7f101bb532805)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Leonard Crestez [Fri, 23 Feb 2018 16:45:27 +0000 (18:45 +0200)]
MLK-10131 ENGR00286724-4 can: flexcan: add platform_data for transceiver_switch
It's used for transceiver_switch.
NOTE: it's newly added since it's deleted by upstream before.
However, the driver is still using it, so have to add it.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
In 4.14 upstream deleted flexcan_priv->pdata, add that back as well.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Thu, 19 Jan 2017 07:05:29 +0000 (15:05 +0800)]
MLK-13783 char: otp: no need to check bank0/bank1 when prog
Bank0/Bank1 are not in ECC mode, so no need to check.
Each bank contains 8 words, so we check (phy_index > 15).
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Wed, 18 Jan 2017 02:56:10 +0000 (10:56 +0800)]
MLK-13538-2 char: otp: support i.MX7ULP1
Add ULP1 OTP support.
No timing required for ULP1 OTP.
The CTRL_ADDR is 8 bits width.
When finished access to OTP, gate the power to OTP memory to save power.
Fix store, when invalid args, not return 0, but return the error values.
To ULP, fuse only support being programmed once, so add a check before
program.
Test log:
root@imx6qdlsolo:/sys/fsl_otp# cat HW_OCOTP_GP84
0x0
root@imx6qdlsolo:/sys/fsl_otp# echo 1 > HW_OCOTP_GP84
root@imx6qdlsolo:/sys/fsl_otp# cat HW_OCOTP_GP84
0x1
root@imx6qdlsolo:/sys/fsl_otp# echo 1 > HW_OCOTP_GP84
-sh: echo: write error: Operation not permitted
root@imx6qdlsolo:/sys/fsl_otp# echo fg > HW_OCOTP_GP84
-sh: echo: write error: Invalid argument
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(TODO: checkpatch warnings)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Fri, 18 Nov 2016 09:04:42 +0000 (17:04 +0800)]
MLK-13482 drivers: char: otp: support i.MX6SLL
Support i.MX6SLL OTP.
There are 4 works in bank7/bank8.
When read, use address offset.
When prog, use bank/index, note that bank7/bank8 we treat
them a single bank when prog.
Tested GP41 and GP31 read/write on eng sample chip.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit
f8698b66fcbec7409b738a4c5b05ba87f0342cf8)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Fri, 3 Jun 2016 03:15:48 +0000 (11:15 +0800)]
MLK-12879 char: otp: support i.MX6ULL
Add ocotp support for i.MX6ULL.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Mon, 15 Aug 2016 01:59:14 +0000 (20:59 -0500)]
MLK-13074 ARM: config: Enable the RNG driver in imx_v7_defconfig
Signed-off-by: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Dan Douglass [Thu, 20 Feb 2014 17:25:56 +0000 (11:25 -0600)]
MLK-12343 MX6SL-EVK missing hardware random number generator.
ENGR00292341 imx6sl hwrng
Add hwrng support for i.MX6SL.
1. Add RNG driver. This driver originated as fsl-rngc.c. It
has been modified to support device tree. The name has been
changed since it supports both b and c variants of RNG.
2. Added clock and compatible info to the device tree data.
3. Added the entry in the options in the Kconfig for hwrng.
(cherry picked from commit
1f3f2c0647b7319c4e23293a61512e4191593513)
[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Richard Zhu [Thu, 26 Nov 2015 01:36:48 +0000 (09:36 +0800)]
MLK-11894 imx: sema4: fix the out of bounds write
Fix the out of bounds write, and the dereference before
null check.
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
(cherry picked from commit
775ff0727166535e9b1ba1f70167e6a33fee5f13)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Tue, 15 Sep 2015 05:34:33 +0000 (13:34 +0800)]
MLK-11371-3 imx_v7_defconfig enable OTP driver
Default enable OTP driver.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Peng Fan [Tue, 18 Aug 2015 01:46:40 +0000 (09:46 +0800)]
MLK-11371-1 char: add fsl_otp device driver
This is porting of fsl_otp driver from imx_3.14.y to imx_4.1.y.
This patch mainly from the following:
commit:
292eff6d2c9064ecf15ed457140c1d743c2ead67
"ENGR00269945: char: add fsl_otp deivce driver"
This is a porting of fsl_otp driver from 3.0.35 kernel to 3.10. It
cleans up the driver a little bit and adds device tree probe support.
shawn.guo: cherry-pick commit
850237dccde7 from imx_3.10.y.
commit:
057a50039fac872fd19fe6c129a94face4231ae8
"MLK-10979-4 imx: ocotp add i.MX7D support and fix hole"
1. Add i.MX7D support
2. Fix hole addressing.
There is a hole in shadow registers address map of size 0x100
between bank 5 and bank 6 on iMX6QP, iMX6DQ, iMX6SDL, iMX6SX and
iMX6UL. Bank 5 ends at 0x6F0 and Bank 6 starts at 0x800. When reading
the fuses, should account for this hole in address space.
Similar hole exists between bank 14 and bank 15 of size 0x80 on
iMX6QP, iMX6DQ, iMX6SDL and iMX6SX.
Note: iMX6SL has only 0-7 banks and there is no hole.
Note: iMX6UL doesn't have this one.
When reading, the hole need to be considered to calculated the physical
address offset.
When writing, since only word index for i.MX6 and bank
index for i.MX7, there is no need to take the hole into consideration,
still use the bank/word index from fuse map.
3. Add i.MX6SL i.MX6UL fuse map table.
4. Tested read/write on mx6ul-14x14-ddr3-arm2 and mx7d-12x12-lpddr3-arm2 board.
Tested read on mx6sxsabresd board.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(Vipul: Fixed merge conflicts)
TODO: checkpatch warnings
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Anson Huang [Fri, 24 Aug 2018 06:17:58 +0000 (14:17 +0800)]
MLK-19326 gpio: mxc: fix possible race condition for PAD wakeup
This patch adds line 0 PAD wakeup support, it is missed previously,
also protect the PAD wakeup interrupt handle with spin lock to
avoid possible race condition of GPIO interrupt arriving during
PAD wakeup interrupt handling.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit
db842471137ef2758de6192f8f400e4b56da5d01)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Anson Huang [Thu, 23 Aug 2018 03:11:36 +0000 (11:11 +0800)]
MLK-19305-2 gpio: mxc: add gpio PAD wakeup support
This patch enables gpio pin's pad wakeup function which
is supported by SCFW, with pad wakeup enabled, GPIO's
power is no need to be enabled after suspend, hence
save a sub-system's power.
To enable pad wakeup, dtb needs to provide pad wakeup
number for each gpio port, and each pin has to provide
<pin_id, type, line>, they should be inside each gpio node,
this is for calling SCFW APIs to enable/disable pad wakeup,
example of adding GPIO4_22 pad wakeup in dtb:
gpio4: gpio@
5d0c0000 {
compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
reg = <0x0 0x5d0c0000 0x0 0x10000>;
interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
power-domains = <&pd_lsio_gpio4>;
interrupt-controller;
#interrupt-cells = <2>;
/* total pad wakeup number in gpio4 */
pad-wakeup-num = <1>;
/* SC_P_USDHC1_CD_B, SC_PAD_WAKEUP_LOW_LVL, LINE 22 */
pad-wakeup = <27 4 22>;
};
Pad wakeup will be enabled after GPIO port suspend, and
once any pad wakes up system, gpio driver will get the
wakeup line and handles the event during noirq resume
phase.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit
1c7ffe9bf3a115031cec8c759a4cd0e09146de09)
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Andy Duan [Fri, 17 Aug 2018 09:07:06 +0000 (17:07 +0800)]
MLK-19251-01 gpio: max732x: add output IO default voltage set
Add output IOs defalut voltage set in device tree by add property like:
out-default = /bits/ 16 <mask val>;
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Anson Huang [Mon, 16 Jul 2018 07:11:17 +0000 (15:11 +0800)]
MLK-18919 gpio: mxc: add independent gpio save regs for noirq suspend/resume
In system resume phase, the runtime resume will be called
after noirq resume, and the GPIO could be operated between
the noirq resume phase and the runtime resume phase, current
implementation of noirq suspend/resume shares same save
regs array with runtime suspend/resume, the GPIO operation
will be overwritten by runtime resume using old save regs
array, so adding independent gpio save regs for noirq
suspend/resume ONLY, and use noirq suspend/resume callback
instead of sharing runtime suspend/resume callback.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Anson Huang [Thu, 14 Jun 2018 06:49:21 +0000 (14:49 +0800)]
MLK-18611-2 gpio: mxc: add noirq suspend/resume support
On some i.MX platforms, GPIO banks may lose power
when system suspend, and some peripheral devices
resume may need to use GPIO during resume phase
before GPIO resume, so GPIO needs to be restored
as early as possible, this patch moves GPIO
restore operation to noirq resume phase.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Thu, 1 Feb 2018 05:53:24 +0000 (13:53 +0800)]
MLK-17736-01 gpio: imx-rpmsg: add gpio interrupt chip support
Add gpio interrupt chip support that only support wakeup feature
by M4 core.
Reviewed-by: Robin Gong<yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Dong Aisheng [Tue, 15 Aug 2017 03:32:18 +0000 (11:32 +0800)]
MLK-17491-14 gpio-vf610: add getting necessary clocks support
On MX7ULP, GPIO controller needs two necessary clocks:
Port module clock and GPIO module clock.
Add them as optional clocks to use.
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Wed, 17 Jan 2018 07:36:39 +0000 (15:36 +0800)]
MLK-17400-02 gpio: max732x: add device reset support
Add device reset for max732x driver.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Mon, 25 Dec 2017 09:44:28 +0000 (17:44 +0800)]
MLK-17290-05 gpio: mxc: save and restore gpio controller registers when power off
Save gpio controller registers before power off, and then restore these
registers after power on. There have two cases need to save/restore regs:
a. If sub_irqs/sub_gpios are not free/released, device suspend() force
runtime suspend and power domain off in suspended stage, it needs to
keep the previous registers value after device resume back.
b. If some sub_irqs set irq type just one time, then irqchip should
restore the registers for correct irq type.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fugang Duan [Tue, 19 Dec 2017 07:47:08 +0000 (15:47 +0800)]
MLK-17290-04 gpio: mxc: add runtime pm support
Add runtime pm support to automatically enable the ipg clock and power
domain if present.
To save power, suggest all sub-devices of the gpiochip/irq domain should
dynamically manage gpio/irq resources like:
gpio:
gpiod_request()
... //set gpio direction
gpiod_free()
irq:
devm_request_irq() //=> module active
devm_free_irq() //=>module is non-active or runtime idle
Since the driver support irqchip and gpiochip, any irq/gpio resource
requested by other modules the gpio controller clock and power domain
should be enabled. And the irqchip's parent's clock and power also should
be enabled if irq resoruce requested.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
[Arul: Fix merge conflicts]
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Srikanth Krishnakar [Sat, 23 Feb 2019 13:41:41 +0000 (19:11 +0530)]
Revert "gpio: mxc: move gpio noirq suspend/resume to syscore phase"
This reverts commit
ede7fb452221c2dc5a401eff4e920d79f3ed4662.
This breaks the existing gpio_dev_pm_ops implementation, hence revert
this upstream patch which is introduced in v4.19.24.
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
Fugang Duan [Thu, 15 Jun 2017 08:45:29 +0000 (16:45 +0800)]
MLK-15092 reset: gpio-reset: add post reset delay
Some devices need to wait for some milliseconds after reset, so add
post reset delay in the gpio-reset chip.
The post reset delay is optional.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Fancy Fang [Fri, 10 Mar 2017 02:22:27 +0000 (10:22 +0800)]
MLK-14362-2 backlight: gpio_backlight: add power management ops
Add suspend/resume power management operations for
gpio backlight.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Andy Duan [Wed, 22 Mar 2017 03:33:38 +0000 (11:33 +0800)]
MLK-14498-11 reset: gpio-reset: use the cansleep variant of the GPIO API
Use the cansleep variant of the GPIO API.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Peter Chen [Mon, 13 Feb 2017 07:14:17 +0000 (15:14 +0800)]
MLK-13912-2 gpio: gpio-vf610: mask interrupt on suspend for imx7ulp
At imx7ulp, any interrupts can wake system up from suspend at "standby"
mode, so we mask interrupt for gpio by default. The user can still
enable wakeup through /sys entry.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Andy Duan [Wed, 18 Jan 2017 05:20:32 +0000 (13:20 +0800)]
MLK-13773 gpio: pca953x: correct device_reset() return value check on kernel 4.1
Correct device_reset() return value checking.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shawn Guo [Mon, 15 Jul 2013 08:31:53 +0000 (16:31 +0800)]
MLK-11749: pinctrl: support pinctrl setting assertion via gpios
It's pretty common that on some reference design or validation boards,
one pin could be used by two devices on board, and the pin route is
controlled by a GPIO. So to assert the pin for given device, not only
the pinmux controller in SoC needs to be set up properly but also the
GPIO needs to be pulled up/down.
The patch adds support of a device tree property "pinctrl-assert-gpios"
under client device node. It plays pretty much like a board level pin
multiplexer, and steers the pin route by controlling the GPIOs. When
client device has the property represent in its node, pinctrl device
tree mapping function will firstly pull up/down the GPIOs to assert the
pins for the device at board level.
[shawn.guo: cherry-pick commit
e5a718edab82 from imx_3.10.y]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shawn Guo [Sun, 14 Jul 2013 13:10:37 +0000 (21:10 +0800)]
MLK-11395-2: reset: build in CONFIG_RESET_GPIO by default
GPIO is widely used as the reset control for various devices. Let's
build the support in by default.
[shawn.guo: cherry-pick commit
795fcb3bc5bb from imx_3.10.y]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
(cherry picked from commit
0cbf78b5b02c57e6fd0e57e811cfe56509c4fd24)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shawn Guo [Sun, 14 Jul 2013 12:41:00 +0000 (20:41 +0800)]
MLK-11395-1: reset: register gpio-reset driver in arch_initcall
It's a little bit late to register gpio-reset driver at module_init
time, because gpio-reset provides reset control via gpio for other
devices which are mostly probed at module_init time too. And it
becomes even worse, when the gpio comes from IO expander on I2C bus,
e.g. pca953x. In that case, gpio-reset needs to be ready before I2C
bus driver which is generally ready at subsys_initcall time. Let's
register gpio-reset driver in arch_initcall() to have it ready early
enough.
The defer probe mechanism is not used here, because a reset controller
driver should be reasonably registered early than other devices. More
importantly, defer probe doe not help in some nasty cases, e.g. the
gpio-pca953x device itself needs a reset from gpio-reset driver start
working.
[shawn.guo: cherry-pick commit
7153f05108ef from imx_3.10.y]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
(cherry picked from commit
11e3543010d4ed50db78a5fc809f24c89e8c6e30)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Philipp Zabel [Thu, 30 May 2013 09:09:00 +0000 (11:09 +0200)]
reset: Add driver for gpio-controlled reset pins
This driver implements a reset controller device that toggle a gpio
connected to a reset pin of a peripheral IC. The delay between assertion
and de-assertion of the reset signal can be configured via device tree.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Sandor Yu [Fri, 20 Mar 2015 06:58:20 +0000 (14:58 +0800)]
MLK-10449-1: 74x164: Add new property registers-default
For some platform such as imx7D SDB, one pin of 74x164 to
control all peripheral power supply(PERI_3V_EN).
The pin should keep in high voltage level when 74x164 loading,
otherwise the module depend on PERI_3V3 will lose power.
So add new property registers-default into 74x164 driver.
Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit:
61fe7af7e47dd8bf6acc91ceabd9e660d28de28a)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Shawn Guo [Sun, 14 Jul 2013 13:52:38 +0000 (21:52 +0800)]
MLK-11293: gpio: pca953x: add device_reset() call
The pca953x type of devices, e.g. max7310, may have a reset which needs
to be handled to get the device start working. Add a device_reset()
call for that, and defer the probe if the reset controller for that is
not ready yet.
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Bai Ping [Fri, 4 Jan 2019 07:39:27 +0000 (13:09 +0530)]
MLK-19589-03 driver: cpufreq: Add cpufreq support for imx6ulz
Add cpufreq support for i.MX6ULZ.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>