08 Jun, 2017

40 commits

  • It is wrong to pass 'int' to IS_ERR_VALUE(), Linus's commit
    aa00edc1 point out this abuse.

    This patch use operator instead.

    Signed-off-by: Haibo Chen

    Haibo Chen
     
  • Remove the TI wifi from defconfig and include the head file host.h
    which contain the definition of struct mmc_host to avoid the following
    compile warning:

    In file included from drivers/net/wireless/ti/wlcore/sdio.c:28:0:
    ./include/linux/mmc/sdio.h:193:35: warning: 'struct mmc_host' declared inside parameter list
    void mmc_sdio_force_remove(struct mmc_host *host);
    ^
    ./include/linux/mmc/sdio.h:193:35: warning: its scope is only this definition or declaration, which is probably not what you want

    Signed-off-by: Haibo Chen

    Haibo Chen
     
  • If bootargs with 'heartbeat_off' setting, will remove heartbeat feature
    in kernel and M4 will not reset A7 even A7 hang. It's useful for debug
    in A7 if you want to connect debugger, otherwise M4 will reset A7 core
    if A7 core halt more than 30s.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • The rpmsg driver probe function such as pm_rpmsg_probe is called by rpmsg
    rx callback, so we can't wait in pm_rpmsg_probe for any completion which
    issued by callback itself, otherwise, timeout triggered definitily, because
    your last callback no chance to reurn to handle the next callback unless
    timeout happened. This patch move the rpmsg send code from pm_rpmsg_probe
    to delay work.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • cancel heartbeat workqueue to make sure no any heartbeat message will
    be sent to M4 after M4 thought A7 core enter VLLS mode.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • Heatbeat workqueue and suspend/resume may call pm_send_message at the same
    time as pf1550-regulator-rpmsg driver, so add mutex to avoid the potential
    pm_qpos_* reentry issue.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • Multi drivers(mmc, cpufreq..) may access pf1550 regulator rpmsg driver at
    the same time, so we have to add mutex for this multi-entry case. Otherwise
    the below kernel warning maybe triggered:

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 19 at kernel/power/qos.c:453 pf1550_send_message+0x4c/0xf8()
    pm_qos_add_request() called for already added request
    Modules linked in:
    CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted 4.1.33-02293-g80b8c19 #636
    Hardware name: Freescale i.MX7ULP (Device Tree)
    Workqueue: events od_dbs_timer
    [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
    [] (show_stack) from [] (dump_stack+0x88/0x9c)
    [] (dump_stack) from [] (warn_slowpath_common+0x80/0xb0)
    [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40)
    [] (warn_slowpath_fmt) from [] (pf1550_send_message+0x4c/0xf8)
    [] (pf1550_send_message) from [] (pf1550_get_voltage+0x48/0x5c)
    [] (pf1550_get_voltage) from [] (_regulator_get_voltage+0x68/0xb4)
    [] (_regulator_get_voltage) from [] (_regulator_do_set_voltage+0x5c/0x3e4)
    [] (_regulator_do_set_voltage) from [] (regulator_set_voltage+0xb0/0x14c)
    [] (regulator_set_voltage) from [] (imx7ulp_set_target+0x178/0x238)
    [] (imx7ulp_set_target) from [] (__cpufreq_driver_target+0x164/0x294)
    [] (__cpufreq_driver_target) from [] (dbs_check_cpu+0x1a0/0x1e0)
    [] (dbs_check_cpu) from [] (od_dbs_timer+0x80/0x138)
    [] (od_dbs_timer) from [] (process_one_work+0x118/0x3e4)
    [] (process_one_work) from [] (worker_thread+0x4c/0x4f4)
    [] (worker_thread) from [] (kthread+0xdc/0xf4)
    [] (kthread) from [] (ret_from_fork+0x14/0x2c)
    ---[ end trace f8281ecde7a0b4ce ]---
    ------------[ cut here ]------------

    Signed-off-by: Robin Gong

    Robin Gong
     
  • Put the three dsi domains into reset state when dsi is disabled
    to avoid dsi being an unstable state before next time enabled.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • Put the three dsi domains into reset state before dsi is
    shutdown to avoid dsi being a unstable state.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The overlay framebuffer fb1 access maybe accessed when fb0
    is in the blank state in which all the lcd clocks have been
    disabled.

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • The double MU count operations should be only done when changing the
    MMDC frequency from 400MHz to a low frequency(100MHz or 24MHz).
    Otherwise, the MU count may overflow and lead to system hang/panic issue.

    This is basically a porting of 4d09bf110b878a6f720ee9d19c8b64ceace95fbe
    to imx6dq lppdr2.

    Also a member "freq" has been added to the mmdc_settings_info structure
    to store the current ddr frequency on iram settings to be able to execute
    the double MU count, only on 400MHz mode and bypass the operation
    otherwise within the update freq routine.

    Signed-off-by: Juan Gutierrez

    Juan Gutierrez
     
  • In the mipi_dsi_shutdown() function, it accesses some dsi registers.
    But in some cases, the esc_clk may be disabled at this moment. So
    first enable this clock then do other shutdown works. Otherwise,
    it may cause kernel panic dump as belows when rebooting system:

    Unhandled fault: imprecise external abort (0x1c06) at 0x0033802c
    pgd = b0a24000
    [0033802c] *pgd=908f1831, *pte=6320775f, *ppte=63207c7f
    Internal error: : 1c06 [#1] PREEMPT SMP ARM
    Modules linked in:
    CPU: 0 PID: 1059 Comm: reboot Not tainted 4.1.33-02248-g22f8d64-dirty #513
    Hardware name: Freescale i.MX7ULP (Device Tree)
    task: b0f56600 ti: b08e8000 task.ti: b08e8000
    PC is at mipi_dsi_pkt_write+0x38/0x1b0
    LR is at mipi_dsi_wr_tx_header.constprop.2+0x6c/0x94
    pc : [] lr : [] psr: 60070013
    sp : b08e9c00 ip : 00000001 fp : 00000000
    r10: 00000000 r9 : b024a810 r8 : b00c5044
    r7 : 80cac4d8 r6 : 80bd2504 r5 : b024a810 r4 : b024a810
    r3 : c0920000 r2 : 00000000 r1 : 60070013 r0 : 00000023
    Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    Control: 10c53c7d Table: 90a2406a DAC: 00000015
    Process reboot (pid: 1059, stack limit = 0xb08e8210)
    Stack: (0xb08e9c00 to 0xb08ea000)
    9c00: 00000000 80066e30 00000000 b00c5000 20070113 b024a810 b024a810 b00c5010
    9c20: 80cac4d8 b00c5044 80c54020 00000000 00000000 802fdba4 00000028 00000000
    9c40: bf672edc 00000001 80bdff40 8007ad7c 8004993c 8082eb30 00000000 80be0140
    9c60: 80bcddc0 80832cd8 80c517f1 80bcddc0 b08e9c70 80bdfb40 b0004c60 00000000
    9c80: 00000009 00000000 00000009 00000000 80c576c0 00000000 80bd20a8 8003b9d8
    9ca0: 00000000 b08e9d68 b08e9ca0 80c576c0 0000000a ffffb7c1 80bd2100 80bcbbe8
    9cc0: 00000000 80bcd800 b0f56600 bf672800 b0f56648 b00fab08 b00fab10 8005fc30
    9ce0: 00000017 00000000 00000000 8006ff84 c080200c 00000026 80bd2838 b08e9d28
    9d00: 80361f04 80c586d6 80c586d6 8035b2a8 80361f04 b02b3610 80bd2504 001c0700
    9d20: 003c0700 8036212c 80bff3b0 80c58198 80bdf8a0 20070093 00000199 8082e868
    9d40: 00000000 80bdf8a0 80c58198 00000000 00000199 8082eadc 80c58198 8006e8b0
    9d60: 00000400 80c5f48c 00000029 80c98ac8 80c58198 80c98098 60070013 00000000
    9d80: 80bdf880 00000001 00000000 80c58198 00000000 00000029 00000001 80c58198
    9da0: 00000029 00000001 00000000 8006e654 00000000 8006ee2c 00000000 00000000
    9dc0: 00000000 00000000 80c98ae6 00000029 00000000 00000000 00000000 60070013
    9de0: 00000000 00000000 00000000 8006f214 b024a810 b00c5010 80cac4d8 b00c5044
    9e00: 80c54020 00000000 00000000 8006f238 80a580f0 b08e9e34 00000000 80824414
    9e20: 80a58148 b08e9e34 b024a810 802fdc6c 80a580f0 80872338 00000000 802fdc80
    9e40: 60070013 b024a810 b00c1a10 802fdd10 802fdcf0 b00c5010 b00c1a10 8038e8a8
    9e60: b00c501c 8038b3cc 01234567 00000000 80bdee38 00000000 fee1dead 8000f644
    9e80: b08e8000 800529cc 00000000 80052c24 bf699000 00000001 00000000 800b3498
    9ea0: 00000000 bfca9160 bf699000 80bd04b8 bfca9160 00000000 80c50880 800b5460
    9ec0: b08e9ed4 00000000 b08e9ec8 00000000 b074ad10 00000000 00359000 b074a7e8
    9ee0: b08e9f20 b074ad10 b0a56e00 00351000 b074ad10 800d3cb8 b0a56e00 00000000
    9f00: b074ad10 00351000 00000001 00000001 b08e9f24 b0001680 00000001 00000001
    9f20: b08e9f34 bf672e00 b086a240 bf672e00 ae13f550 ae13f5a0 00080040 00000001
    9f40: b086a240 ae1533f0 00000000 b07e1d90 ae13f550 40000010 b086a240 800ed1b0
    9f60: 00000020 00000000 b0f569f8 00000000 b0f569f8 00000000 80c57c28 b0f56600
    9f80: 00000000 8004f358 b086a240 b08e8000 8000f644 7eec5e14 00000003 00000000
    9fa0: 00000058 8000f4c0 7eec5e14 00000003 fee1dead 28121969 01234567 00000000
    9fc0: 7eec5e14 00000003 00000000 00000058 00000000 00000000 00000000 00000000
    9fe0: 76f3ec10 7eec5c7c 00010fc8 76f3ec30 60070010 fee1dead 00000000 00000000
    [] (mipi_dsi_pkt_write) from [] (mipi_dsi_dcs_cmd.part.0+0x24/0x2c)
    [] (mipi_dsi_dcs_cmd.part.0) from [] (mipi_display_enter_sleep+0x30/0xa0)
    [] (mipi_display_enter_sleep) from [] (mipi_dsi_shutdown+0x20/0x9c)
    [] (mipi_dsi_shutdown) from [] (platform_drv_shutdown+0x18/0x28)
    [] (platform_drv_shutdown) from [] (device_shutdown+0xdc/0x1e4)
    [] (device_shutdown) from [] (kernel_restart+0xc/0x50)
    [] (kernel_restart) from [] (SyS_reboot+0xc8/0x1b8)
    [] (SyS_reboot) from [] (ret_fast_syscall+0x0/0x3c)
    Code: e34860bd e58da000 e1a0200c ebffff90 (f57ff04e)
    ---[ end trace 9f61c48a242457f2 ]---

    Signed-off-by: Fancy Fang

    Fancy Fang
     
  • Adding the corresponding brackets were missing when introducing
    a new phy fixup function. This patch fix it.

    Signed-off-by: Juan Gutierrez

    Juan Gutierrez
     
  • Currently the M4 audio driver don't support mono channel, so remove it.
    After mono channel is supported in M4 os, this commit should be reverted.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • The rpmsg-audio and wm8960-audio use same device in two way, there is
    conflict when enabled together.
    imx7ulp-evk-wm8960.dts is for demo usage, there is a hardware issue
    (TKT320235) that EDMA interrupt can't wake up the A7 core, so there
    is glitch noise occassionally.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • Now, M4 rpmsg add free buffer feature that free the reciever buffer and update
    some rpmsg structure data in share memory(DDR) once M4 receive the message from
    A7 side, that means M4 will access DDR after it receive the vlls message(A7 enter
    VLLS mode quickly), thus M4 hang because DDR in slef-refresh...
    This patch move the vlls message notification ahead to driver suspend and add
    acknowledgement to make sure no any DDR access comes from M4 side after A7 enter
    suspend.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • add heartbeat device node to add suspend/resume in
    arch/arm/mach-imx/pm-rpmsg.c

    Signed-off-by: Robin Gong

    Robin Gong
     
  • some cmd is sent by workqueue, others are sent by call send message
    function directly, for workqueue may have delay, so there is occasion
    that cmd is not sent in order.
    Add flush_workqueue before the CLOSE and SUSPEND to make sure previous
    cmd is finished in that time.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • The M4 audio driver only support 8k/16k/32k/44k/48kHz sample rate.
    so remove other rate in supported list.

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • In userspace, user can not distinguish fb0 and fb1, so add fb1/name property to
    distinguish them.

    Signed-off-by: Guoniu.Zhou

    Guoniu.Zhou
     
  • Enbale cpufreq support for i.MX7ULP in defconfig.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • Add cpufreq device on i.MX7ULP.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • According to the i.MX7ULP RM & datasheet, when A7 is in RUN mode,
    the max CPU frequency it can run at is 500MHz, if we want to increase
    the A7 CPU frequency to 800MHz, we need to change the A7 from RUN mode
    to HSRUN mode. And only when A7 is in RUN mode, we can enter STOP mode
    and VLLS mode.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • Add CPU setpoints property on i.MX7ULP A0 part, the setpoints table is a preliminary
    one, will update it according to the datasheet when the final one is available.

    The setpoints we can currently used is as below:
    416072 KHz/0.925V,
    531648 KHz/1.025V;

    Signed-off-by: Bai Ping

    Bai Ping
     
  • Add HSRUN mode clocks on i.MX7ULP. we also add a fake clock mux ARM
    to make the clock tree more easy to handle in cpufreq.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • Enable HSRUN mode on i.MX7ULP.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • The GPT timer counter clock should be sourced from GPT_3M clock to avoid
    counter clock frequency changed due to system bus clock changes.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • Add gpt_3m clock source on i.MX6SLL.

    Signed-off-by: Bai Ping

    Bai Ping
     
  • This typo issue will cause that wrong cmd send to M4 side.

    Fixes: 3e13a631aee0 ("MLK-13904-1: ASoC: fsl: add audio cpu dai driver base on rpmsg")

    Signed-off-by: Shengjiu Wang

    Shengjiu Wang
     
  • Message can be transferred between remote
    device and iMX7ULP M4.
    Then the message can be transferred between A7
    and M4 by rpmsg channel.
    demo howto:
    - insmode the imx_rpmsg_tty.ko module after
    login A7/Linux.
    - Receive messages. Used the following command
    to dump out the msg from the virtual tty.
    ./unit_tests/mxc_mcc_tty_test.out /dev/ttyRPMSG 115200 R 100 1000 &
    - Send: use the following command to send the
    message to M4.
    echo /dev/ttyRPMSG

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • add the virtual tty rpmsg channel, thus the message can
    be transferred between A core and M core by rpmsg

    Signed-off-by: Richard Zhu

    Richard Zhu
     
  • built in rpmsg audio driver

    Signed-off-by: Shengjiu Wang
    Acked-by: Robin Gong

    Shengjiu Wang
     
  • audio will use the fourth slot in rpmsg address space.

    Signed-off-by: Shengjiu Wang
    Acked-by: Robin Gong

    Shengjiu Wang
     
  • Add machine driver, which is using the dummy codec.

    Signed-off-by: Shengjiu Wang
    Acked-by: Robin Gong

    Shengjiu Wang
     
  • Add platform driver, each step like set hw param, trigger start
    trigger stop, and so on, will call the rpmsg api.

    Signed-off-by: Shengjiu Wang
    Acked-by: Robin Gong

    Shengjiu Wang
     
  • Add the cpu dai driver, as the rpmsg_send api can't be used in
    atomic context, so using the workqueue instead of calling
    rpmsg_send() directly.
    The detail communication stack is defined in header file.

    Signed-off-by: Shengjiu Wang
    Acked-by: Robin Gong

    Shengjiu Wang
     
  • 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
     
  • The wakeup on USB port should be determined by user, but not enabled
    by default.

    Signed-off-by: Peter Chen

    Peter Chen
     
  • Fix following build error by changing type to '__u64'.

    include/uapi/linux/pxp_dma.h:230:2: error: unknown type name 'u64'
    u64 lut_sels;
    ^~~

    Signed-off-by: Robby Cai

    Robby Cai
     
  • The two properties pm-ignore-notify and keep-power-in-suspend need
    to remove for the sd slot on base board(sd1 slot).

    If not, after system suspend, once remove the card from sd1 slot,
    then system can't resume successfully, resume process hung due to
    dead lock.

    Signed-off-by: Haibo Chen

    Haibo Chen