The DPHY(DSI PHY) in Rockchip rk3368 supports MIPI/TTL/LVDS
mode. Use the clock IDs (PCLK_DPHYRX and PCLK_DPHYTX0) for
DPHY clocks.
Change-Id: I6a133d6da839d6545e507f38b361b3457e5ff3ee
Signed-off-by: Jianqun xu <jay.xu@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Programmable THRE Interrupt mode in order to increase system
performance.
Change-Id: Ic1ef9ecae0c6feb00170ad97ee3c6245ca3bf068
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Most SOCS have only 8 or 6 channels, but have more than 16
peripherals. If those peripherals work together, some
fails to request dma channel, because there are no enough
channels. And maybe it's unnecessary to use dma for uart
tx. It is necessary for uart rx when hardware auto flow
control is not used.
&uart0 {
dma-names = "!tx", "rx"; // disable uart tx with dma
status = "okay";
};
Change-Id: Ia74477514ba57300a4d19a5c2565ae7b5b8ab521
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
To avoid "too much work for irq" issue, cherry pick the the patch.
It reads the RBR to clear the time out interrupt, but sometime the
rx fifo may be not empty while cpu reads the RBR. Which would cause
the data lost.
patch for "too much work":06451e93ab59e5b1843c29cbb468a274f4919563
By the way, current patch can't get rid of the risk entirely, so I
try a lot to solve it. Unfortunately, I only got the phenomenon that
lower pclk can reduce the probability. And I check the dw data sheet,
it has pclk and sclk, so there is synchronization problem. But it
only requires (slck < 4*pclk).
Change-Id: I01a36c689b43310294c45294abcf4982f5ddf2af
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Add wakeup-source to uart dts node to enable uart
wake up system when it receives data.
Change-Id: If4e82a4d3dbaca708209553dc3693089864c782f
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
before the patch:
ls /dev/ttyS
ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5 ttyS6 ttyS7
after the patch:
ls /dev/ttyS
ttyS3 ttyS4 ttyS6
Change-Id: I844523408751cb579bbfb50fafb7923d5c2cafdf
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
If external device sends data continuously, then uart is
always busy, and baud rate can't be set. It is useful
to reset uart and set loop back mode to make sure it is
idle.
Change-Id: I87286711870ff685ea29e36e61c97d45be5a6d08
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
To reduce the uart interrupts, which may cause:
serial8250: too much work for irq xx
Change-Id: I89e0d990677e4cffae431e60521b3e16e8381f05
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
The UART CPR may be 0 of some rockchip soc,
but it supports fifo and AFC, fifo entry is 32 default.
Change-Id: I44f420c556f703c2848c38dc8449546274ef887d
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Refer to E.2 (P67) of Device Class Definition for Human Interface
Devices V1.11, the bmAttributes field of the standard configuration
descriptor bit 5 should be set if the HID support Remote Wakeup.
This patch enable the usb HID to wake up the system if the HID
supports remote wakeup.
Change-Id: I169c49ff6187b6400b91633332a72964caca1a94
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit e1653e4dc5)
The userspace might check tty information in proc fs.
Folded following develop-4.4 commit changes into this patch:
77e938e49d ("fiq_debugger: Sanity check state in fiq_tty_proc_show")
Fix for 4.19.
Change-Id: If3e81aacbc7948dd3000606702296bc2b76bec09
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
If this cpu is not the same as current cpu, it means we don't use
current cpu any more, and this cpu handles uart interrupt. So it
is unnecessary to set uart interrupt to this cpu again.
Change-Id: Ia454af96ee766dcbc8b22339652a4aa7eb229568
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
1.When fiq debugger driver probes, and uart rx is pulled low.
The uart interrupt comes so early that uart handler can't be
called. Which makes interrupt come frequently and block the cpu.
2.Remove '<hit enter to activate fiq debugger>'.
Change-Id: I4656d6942bb2cbb0e992852a52bc82f71deadda8
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: Ia5a7e0c8bcdcc33880f6048d71068a5ccb1c042e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
(cherry picked from commit ae98ee15abc476711d04b5885848ee6570ee816d)
Because init.rc does the following operation, handle_sysrq
will do nothing. If we want to use sysrq, __handle_sysrq
can work.
write /proc/sys/kernel/sysrq 0
Change-Id: Ia51debd92f393326f183736e405e25dc4d6a2abc
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
update some features:
1. rename sip smc function name;
2. add serial hw irq and phyical base address parse;
3. use FIQ_DEBUGGER_TRUST_ZONE for armv7 and armv8.
Change-Id: I920899f30cadf1ec8380a2e70f5d1e0e801ec5c2
Signed-off-by: chenjh <chenjh@rock-chips.com>
cpu hotplug register to hotplug state machine.
use subsys_initcall.
Change-Id: I65431a7b22bf8dcd9b5d4c4a6c4967251038486e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This change allows to use same kernel image with
different console options for uart and fiq_debugger.
If fiq_debugger.disable will be set to 1/y/Y,
fiq_debugger will not be initialized.
Change-Id: I71fda54f5f863d13b1437b1f909e52dd375d002d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit 76d292f95a217b4ba236fd2db858ac99295fd832)
fiq_debugger is taking over uart, so it is necessary to disable
original uart in DT file. It can be done manually or by overlay.
Change-Id: I9f50ec15b0e22e602d73b9f745fc8666f8925d09
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit 0ff9e291c1181f124a4ea58ce95f09b7acb735cc)
Add fiq_debugger_arm64.c that implements the platform-specific
functions.
Change-Id: I4d8b96777bb8503a93d4eb47bbde8e018740a5bf
Signed-off-by: Colin Cross <ccross@android.com>
[AmitP: Remove unused stackframe -> sp to align with upstream commit
31e43ad3b7 ("arm64: unwind: remove sp from struct stackframe")
Also folded following android-4.9 commit changes into this patch
a33d9f9fa3 ("ANDROID: fiq_debugger: Pass task parameter to unwind_frame()")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit c9d6bc7ab0a4360f79418aa16f3cd68ac2f57a40)
IRQ mode already passes in a struct pt_regs from get_irq_regs().
FIQ mode passes in something similar but not identical to a
struct pt_regs - FIQ mode stores the spsr of the interrupted mode
in slot 17, while pt_regs expects orig_r0.
Replace the existing mixture of void *regs, unsigned *regs, and
struct pt_regs * const with const struct pt_regs *. Modify
dump_regs not to print the spsr since it won't be there in a
struct pt_regs anyways. Modify dump_allregs to highlight the
mode that was interrupted, making spsr easy to find there.
Change-Id: Ibfe1723d702306c7605fd071737d7be9ee9d8c12
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit bf32f8accce8701e896879fee463e5b07cbeb8b9)
Rename variables and functions in the global namespace to avoid
future collisions.
Change-Id: Ic23a304b0f794efc94cc6d086fddd63231d99c98
Signed-off-by: Colin Cross <ccross@android.com>
[AmitP: Folded following android-4.9 commit changes into this patch
daeea72326 ("ANDROID: fiq_debugger: Build fixes for 4.1")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit d241f1dfc9a0b7d97c7b2bce43f88b5c74a3ce44)
debug_console_write calls debug_uart_flush, which will usually wait
until the serial port fifo empties. If another thread is continuously
calling fiq_tty_write, the fifo will constantly be refilled and
debug_uart_flush might never return.
Add a spinlock that is locked in debug_console_write and fiq_tty_write
to ensure they can't run at the same time. This has an extra advantage
of preventing lines from the console and tty from being mixed together.
Also reduce the size returned by fiq_tty_write_room to keep the time
spent with the spinlock held to a reasonable value.
In addition, make sure fiq context can't loop forever by never calling
debug_uart_flush when the console is enabled.
Change-Id: I5712b01f740ca0c84f680d2032c9fa16b7656939
Signed-off-by: Colin Cross <ccross@android.com>
[AmitP: Folded following android-4.9 commit changes into this patch
b4ffddec34 ("ANDROID: ARM: fiq_debugger: fix uninitialised spin_lock.")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit a8be462329b3c4a22097bf07d3b02a1884a8db09)
kernel_restart cannot be called from interrupt context. Add support for
commands called from a work function, and implement the "reboot" command
there. Also rename the existing irq-mode command to "reset" and change
it to use machine_restart instead of kernel_restart.
Change-Id: I3c423147c01db03d89e95a5b99096ca89462079f
Signed-off-by: Colin Cross <ccross@android.com>
[AmitP: Folded following android-4.9 commit changes into this patch
3b61956a41 ("ANDROID: fiq_debugger: Fix minor bug in code")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit cb5774b50389fc588d532e0864a0c1bc0010ac2a)
Fix setting up consoles on multiple fiq debugger devices by
splitting the tty driver init into the initcall, and initializing
the single tty device during probe. Has the side effect of moving
the tty device node to /dev/ttyFIQx, where x is the platform device
id, which should normally match the serial port.
To avoid having to pass a different console=/dev/ttyFIQx for every
device, make the fiq debugger a preferred console that will be used
by default if no console was passed on the command line.
Change-Id: I6cc2670628a41e84615859bc96adba189966d647
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit aecfa53f35c667ce33b4af14d996bfe51c3e614e)
Adds polling tty ops to the fiq debugger console tty, which allows
kgdb to run against an fiq debugger console.
Add a check in do_sysrq to prevent enabling kgdb from the fiq
debugger unless a flag (writable only by root) has been set. This
should make it safe to enable KGDB on a production device.
Also add a shortcut to enable the console and kgdb together, to
allow kgdb to be enabled when the shell on the console is not
responding.
Change-Id: Ifc65239ca96c9887431a6a36b9b44a539002f544
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/common:android-4.14
commit 992dbb2a9acf1cde972157b509f6b9f01aae69d2)