Marek Szyprowski [Fri, 27 Apr 2018 09:22:18 +0000 (11:22 +0200)]
tizen_tm2_defconfig: enable IPIPE and disable conflicting options
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Arnaud Degroote [Fri, 23 Jan 2015 15:11:53 +0000 (16:11 +0100)]
Initial porting of xenomai on exynos4
Based on patch from kinsamanka
Signed-off-by: Arnaud Degroote <arnaud.degroote@isae-supaero.fr>
[patch taken from https://github.com/adegroote/linux.git
linux-stable-xenomai-odroid-3.18.y branch, adapted to v4.14
IPIPE changes (added IRQCHIP_PIPELINE_SAFE flags to irqchips)]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Gilles Chanteperdrix [Sun, 3 Dec 2017 16:17:19 +0000 (17:17 +0100)]
gpio: pl061: ipipe: enable pipelined interrupts
Dmitriy Cherkasov [Fri, 29 Dec 2017 04:20:33 +0000 (20:20 -0800)]
pinctrl: rockchip: enable pipelined interrupts
Dmitriy Cherkasov [Fri, 29 Dec 2017 04:20:26 +0000 (20:20 -0800)]
irqchip: brcmstb-l2: enable pipelined interrupts
Philippe Gerum [Sun, 3 Dec 2017 16:29:20 +0000 (17:29 +0100)]
irqchip: sunxi-nmi: ipipe: enable pipelined interrupts
Gilles Chanteperdrix [Sun, 3 Dec 2017 16:28:59 +0000 (17:28 +0100)]
irqchip: gic-v3: ipipe: enable pipelined interrupts
Philippe Gerum [Sun, 3 Dec 2017 16:28:44 +0000 (17:28 +0100)]
irqchip: gic: ipipe: enable pipelined interrupts
Gilles Chanteperdrix [Sun, 3 Dec 2017 16:27:45 +0000 (17:27 +0100)]
irqchip: dw-apb-ictl: ipipe: enable pipelined interrupts
Gilles Chanteperdrix [Sun, 3 Dec 2017 16:10:26 +0000 (17:10 +0100)]
gpio: mvebu: ipipe: enable pipelined interrupts
Gilles Chanteperdrix [Sun, 3 Dec 2017 15:58:33 +0000 (16:58 +0100)]
ARM: arch_timer: ipipe: enable interrupt pipelining
Philippe Gerum [Fri, 29 Dec 2017 04:20:15 +0000 (20:20 -0800)]
ARM64: ipipe: intercept exceptions
Philippe Gerum [Fri, 29 Dec 2017 04:20:08 +0000 (20:20 -0800)]
ARM64: ipipe: intercept syscalls
Dmitriy Cherkasov [Fri, 29 Dec 2017 04:19:54 +0000 (20:19 -0800)]
ARM64: ipipe: enable fpsimd sharing with head domain
Philippe Gerum [Fri, 29 Dec 2017 04:19:48 +0000 (20:19 -0800)]
ARM64: ipipe: share context switch code with the head domain
Philippe Gerum [Fri, 29 Dec 2017 04:19:42 +0000 (20:19 -0800)]
ARM64: ipipe: hard protect against preemption by head domain
Don Mahurin [Fri, 29 Dec 2017 04:19:35 +0000 (20:19 -0800)]
ARM64: ipipe: add pipeline core
Gilles Chanteperdrix [Sun, 3 Dec 2017 10:53:48 +0000 (11:53 +0100)]
pinctrl: ipipe: enable pipelined interrupts
Philippe Gerum [Sun, 3 Dec 2017 10:56:22 +0000 (11:56 +0100)]
gpio: ipipe: enable pipelined interrupts
Philippe Gerum [Sun, 3 Dec 2017 11:06:54 +0000 (12:06 +0100)]
ftrace: ipipe: enable tracing from the head domain
Philippe Gerum [Thu, 7 Dec 2017 16:04:43 +0000 (17:04 +0100)]
mm: ipipe: disable ondemand memory
Philippe Gerum [Sun, 3 Dec 2017 11:05:12 +0000 (12:05 +0100)]
sched: ipipe: enable task migration between domains
Philippe Gerum [Sun, 3 Dec 2017 11:00:22 +0000 (12:00 +0100)]
kernel: ipipe: add domain event notifications
Philippe Gerum [Thu, 7 Dec 2017 16:18:02 +0000 (17:18 +0100)]
printk: ipipe: add raw console channel
Philippe Gerum [Sun, 3 Dec 2017 10:55:42 +0000 (11:55 +0100)]
clocksource, clockevents: ipipe: enable pipelined ticks and timekeeping
Philippe Gerum [Sun, 3 Dec 2017 11:03:03 +0000 (12:03 +0100)]
printk: ipipe: defer printk() from head domain
Philippe Gerum [Thu, 9 Nov 2017 11:24:04 +0000 (12:24 +0100)]
lib: ipipe: make dump_stack() domain-aware
When dumping a stack backtrace, we neither need nor want to disable
root stage IRQs over the head stage, where CPU migration can't
happen.
Conversely, we neither need nor want to disable hard IRQs from the
head stage, so that latency won't skyrocket either.
Philippe Gerum [Sun, 3 Dec 2017 11:08:28 +0000 (12:08 +0100)]
lib, kernel: ipipe: hard protect against preemption by head domain
Philippe Gerum [Sun, 3 Dec 2017 10:57:56 +0000 (11:57 +0100)]
locking: ipipe: add pipeline-aware locks
Philippe Gerum [Sun, 3 Dec 2017 11:00:44 +0000 (12:00 +0100)]
genirq: ipipe: enable pipelined interrupt management
Philippe Gerum [Sun, 3 Dec 2017 11:11:44 +0000 (12:11 +0100)]
ipipe: add generic pipeline core
Marek Szyprowski [Thu, 26 Apr 2018 13:18:54 +0000 (15:18 +0200)]
hack: arm64: exynos5433: use only ARCH TIMER
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Thu, 19 Apr 2018 13:37:52 +0000 (15:37 +0200)]
spi: spi-s3c64xx: Decrease autosuspend timeout for FIMC-IS
This a workaround to avoid errors in SPI transfer when camera devices
are closed and shortly after re-opened.
Change-Id: I239463f6eefe56a644ec63c42daedb455cf91202
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 19 Apr 2018 12:09:33 +0000 (14:09 +0200)]
fimc-is: Remove dubious spin_(un)lock_irq() use
There should not be a need to use spin_lock_irq/spin_unlock_irq
in those critical sections. spin_unlock_irq() enables interrupts
unconditionally which can be harmful.
Change-Id: I29df4e56475a56a94762bb1585a6ba3d55c45259
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 19 Apr 2018 12:04:41 +0000 (14:04 +0200)]
fimc-is: Suppress warning generated in fimc_is_group_buffer_finish()
Due to videobuf2 queue cancel call fimc_is_group_buffer_finish() function
may be called with invalid group->id. Just return EINVAL instead of WARN_ON()
when group->id has GROUP_ID_INVALID value so as to avoid unneeded stack dumps
in kernel log while closing video device nodes.
Change-Id: I3c5d6fec997ceaf5ae28e2537cfbca9405040bb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 20 Apr 2018 10:32:08 +0000 (12:32 +0200)]
fimc-is: Release all buffers in sensor video node stop_streaming() callback
Any buffer owned by a driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.
Change-Id: Ib7f8b0b8fffe50f387827929829e3e87c0f1bf38
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 19 Apr 2018 11:58:43 +0000 (13:58 +0200)]
fimc-is: Release all buffers in fimc_is_queue_stop_streaming()
Any buffer owned by the driver should be released in videobuf2 stop_streaming()
callback. This change allows to avoid warnings from videobuf2 when closing
video device nodes.
Change-Id: Idd2f3157ab5c0326c39e8d9160514ad6102301b6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 29 Mar 2018 09:16:59 +0000 (11:16 +0200)]
arm64: configs: tizen_tm2_defconfig update camera driver
Enable camera driver.
Change-Id: I17644b593b9bd59b1055309633900240c2a30e50
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Seung-Woo Kim [Thu, 22 Mar 2018 06:36:31 +0000 (15:36 +0900)]
fimc-is: Convert bool to unsigned int to fix bool-operation
Convert bool to unsigned in to fix bool-operation warnings with gcc7.
Change-Id: I04147f628198204e2b1ecc3b3f04a63a61f62c7b
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 12 Apr 2018 15:17:25 +0000 (17:17 +0200)]
fimc-is: SPI related functions clean up
Replace explicit memset() calls with initialization to 0 at declaration time.
Change-Id: I56068b22577494c59d85e94af439234f56ed1fdd
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 12 Apr 2018 15:10:10 +0000 (17:10 +0200)]
fimc-is: Fix cs_change flags in SPI transfers
The cs_change flags need to be adjusted so SPI communications works
properly with the spi-s3c64xx driver.
Change-Id: I73ae345670e9ac79d8b8b576dc25078ece6167e7
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 9 Apr 2018 16:35:51 +0000 (18:35 +0200)]
fimc-is: Remove redundant "fimc_is_spi1" driver
Change-Id: I0e372c47298d4869e0d5041a968e8ef84429d1da
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 6 Apr 2018 10:02:31 +0000 (12:02 +0200)]
fimc-is: Remove unused SPI driver code
This patch removes empty/unused SPI related functions and unneeded
devinit/devexit attribute definitions.
Change-Id: I98055d7947c15d0c6692d8714469f48ed9aeffb0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 6 Apr 2018 14:27:05 +0000 (16:27 +0200)]
phy: exynos-mipi-video: Simplify code by using regmap_update_bits()
Change-Id: I89144594f128b73a3c0c38ab7fd2536b34ef9768
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Fix memory leak in clock operations
devm_clk_get() allocates new struct clk which will be freed only during
the driver's deinitialization which actually never happens.
Change-Id: I94c1d42f3c1b053406437b4baf6c81577b53416b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 16:08:42 +0000 (18:08 +0200)]
dts: arm64: exynos5433-tm2: Use only I2C child node for companion device
Change-Id: Id75be47aa2d4012e7acd263f9059dfce775ff8c5
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 15:04:55 +0000 (17:04 +0200)]
fimc-is: Get rid of companion platform driver
Change-Id: I2d9d6c690b867234ec8918747eec88d8593e44f1
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 14:35:44 +0000 (16:35 +0200)]
fimc-is: Use struct device * for companion device
Change-Id: I365f652a10d62b4949561b673de93774fbae77a6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 14:12:38 +0000 (16:12 +0200)]
fimc-is: Use common struct v4l2_device for the companion device
Change-Id: Ia72b932676281dd972312e89d663ab096b4dbf79
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 5 Apr 2018 13:46:28 +0000 (15:46 +0200)]
fimc-is: Use struct device rather than struct platform_device
Change-Id: Ief3d4c4356b66e900bd76dc1bdecca02420916ae
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 16 Apr 2018 13:24:55 +0000 (15:24 +0200)]
arm64: dts: exynos5433-tm2: Add camera device nodes
Change-Id: I003c2a2ddeeea63168a4ff382eea783edd808937
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 26 Mar 2018 15:58:02 +0000 (17:58 +0200)]
arm64: dts: exynos5433-tm2: Correct s2mps13 LDO23 regulator definition
Change-Id: I276496ef0223be2adc9aafefa86d790485042844
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 23 Mar 2018 16:53:48 +0000 (17:53 +0100)]
arm64: dts: exynos5433: Add FIMC-IS subsystem nodes
Change-Id: I489d4000217c1780cd7caac7469eb93345adb1fb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Tue, 3 Apr 2018 13:34:36 +0000 (15:34 +0200)]
fimc-is: Set all buffer queues as bidirectional
This prevent SYSMMU fault from FIMC-IS CPU access:
[ 42.220252] exynos-sysmmu
142d0000.sysmmu:
14180000.fimc_is: AW ACCESS PROTECTION FAULT occurred at 0x7ff98af0
[ 42.220634] ------------[ cut here ]------------
[ 42.222578] kernel BUG at drivers/iommu/exynos-iommu.c:449!
[ 42.228136] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 42.233602] Modules linked in:
[ 42.236641] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.14.24+ #154
[ 42.244105] Hardware name: Samsung TM2 board (DT)
[ 42.248790] task:
ffffff800905eb80 task.stack:
ffffff8009040000
[ 42.254699] PC is at exynos_sysmmu_irq+0x17c/0x188
[ 42.259468] LR is at exynos_sysmmu_irq+0x108/0x188
[ 42.264241] pc : [<
ffffff80084d68b4>] lr : [<
ffffff80084d6840>] pstate:
600001c5
[ 42.271620] sp :
ffffff8008003e00
[ 42.274915] x29:
ffffff8008003e00 x28:
ffffff8009031010
[ 42.280211] x27:
ffffff8009043db0 x26:
ffffff8009031000
[ 42.285506] x25:
ffffff800913c000 x24:
000000007ff98af0
[ 42.290800] x23:
ffffffc0c9c4a918 x22:
0000000000000064
[ 42.296095] x21:
ffffffc0c9c4a958 x20:
0000000000000013
[ 42.301390] x19:
ffffff8008ad87c8 x18:
0000000000000010
[ 42.306685] x17:
0000000000000000 x16:
fffffffffffffffe
[ 42.311980] x15:
ffffff8089180f9f x14:
0720072007200720
[ 42.317275] x13:
0720072007200720 x12:
0720072007200720
[ 42.322569] x11:
0720072007200720 x10:
0720072007200720
[ 42.327864] x9 :
0720072007200720 x8 :
0720072007200720
[ 42.333159] x7 :
0720072007200720 x6 :
00000000000003cb
[ 42.338454] x5 :
0000000000000000 x4 :
0000000000000000
[ 42.343748] x3 :
0000000000000001 x2 :
000000007ff98af0
[ 42.349044] x1 :
ffffff8009140c80 x0 :
00000000ffffffda
[ 42.354340] Process swapper/0 (pid: 0, stack limit = 0xffffff8009040000)
[ 42.361024] Call trace:
[ 42.363451] Exception stack(0xffffff8008003cc0 to 0xffffff8008003e00)
[ 42.369879] 3cc0:
00000000ffffffda ffffff8009140c80 000000007ff98af0 0000000000000001
[ 42.377692] 3ce0:
0000000000000000 0000000000000000 00000000000003cb 0720072007200720
[ 42.385504] 3d00:
0720072007200720 0720072007200720 0720072007200720 0720072007200720
[ 42.393317] 3d20:
0720072007200720 0720072007200720 0720072007200720 ffffff8089180f9f
[ 42.401128] 3d40:
fffffffffffffffe 0000000000000000 0000000000000010 ffffff8008ad87c8
[ 42.408940] 3d60:
0000000000000013 ffffffc0c9c4a958 0000000000000064 ffffffc0c9c4a918
[ 42.416753] 3d80:
000000007ff98af0 ffffff800913c000 ffffff8009031000 ffffff8009043db0
[ 42.424564] 3da0:
ffffff8009031010 ffffff8008003e00 ffffff80084d6840 ffffff8008003e00
[ 42.432376] 3dc0:
ffffff80084d68b4 00000000600001c5 ffffff8008ad87c8 0000000000000013
[ 42.440189] 3de0:
0000007fffffffff 0000000000000064 ffffff8008003e00 ffffff80084d68b4
[ 42.448001] [<
ffffff80084d68b4>] exynos_sysmmu_irq+0x17c/0x188
[ 42.453817] [<
ffffff80080f4b14>] __handle_irq_event_percpu+0x64/0x280
[ 42.460238] [<
ffffff80080f4d4c>] handle_irq_event_percpu+0x1c/0x58
[ 42.466400] [<
ffffff80080f4dd0>] handle_irq_event+0x48/0x78
[ 42.471956] [<
ffffff80080f8a34>] handle_fasteoi_irq+0xbc/0x1b0
[ 42.477772] [<
ffffff80080f3bac>] generic_handle_irq+0x24/0x38
[ 42.483499] [<
ffffff80080f426c>] __handle_domain_irq+0x84/0xf8
[ 42.489315] [<
ffffff80080817c8>] gic_handle_irq+0x68/0xc8
[ 42.494695] Exception stack(0xffffff8009043db0 to 0xffffff8009043ef0)
[ 42.501119] 3da0:
0000000000000000 ffffff8008e3c628
[ 42.508934] 3dc0:
ffffff8009031010 0000000000000001 00000040d657b000 0000000000005dc0
[ 42.516746] 3de0:
0000000000000008 0000000000000000 0000000000000002 ffffff8009043e70
[ 42.524558] 3e00:
0000000000000980 000000000011fa88 0000000000000000 0000000000000001
[ 42.532370] 3e20:
0000000000000000 ffffff8089180f9f fffffffffffffffe 0000000000000000
[ 42.540183] 3e40:
0000000000000010 ffffff800913c000 ffffff800913ce78 0000000000000000
[ 42.547993] 3e60:
ffffff8008e1ee50 0000000000000000 0000000000000000 ffffff800905eb80
[ 42.555806] 3e80:
00000000df6e4808 0000000000000000 0000000020f80018 ffffff8009043ef0
[ 42.563618] 3ea0:
ffffff8008085de0 ffffff8009043ef0 ffffff8008085de4 0000000060000145
[ 42.571430] 3ec0:
ffffff800903b048 ffffff8008e1ee50 ffffffffffffffff ffffff8009052000
[ 42.579241] 3ee0:
ffffff8009043ef0 ffffff8008085de4
[ 42.584100] [<
ffffff8008083130>] el1_irq+0xb0/0x124
[ 42.588962] [<
ffffff8008085de4>] arch_cpu_idle+0x34/0x1c8
[ 42.594344] [<
ffffff80080e2b1c>] do_idle+0x114/0x1e0
[ 42.599289] [<
ffffff80080e2d84>] cpu_startup_entry+0x24/0x28
[ 42.604935] [<
ffffff8008a390c8>] rest_init+0xc8/0xd8
[ 42.609883] [<
ffffff8008f80b94>] start_kernel+0x39c/0x3b0
[ 42.615264] Code:
2a1803e4 9401e0bc f94032e0 b5fffbe0 (
d4210000)
[ 42.621339] ---[ end trace
f42ebbac31eb0484 ]---
Change-Id: I2467a1646a6c6cdcb6898fd4911cb64f9f0d658e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 29 Mar 2018 13:57:30 +0000 (15:57 +0200)]
fimc-is: Drop code for old kernel versions
Change-Id: If303fd1f7546df825b6c9399791d1044ec92630a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 29 Mar 2018 13:56:06 +0000 (15:56 +0200)]
fimc: Add missing memory allocator initialization for companion video node
Change-Id: Ib8b910a54d024609a1c8e4dc675b2d61976531c0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Thu, 6 Aug 2015 13:39:42 +0000 (15:39 +0200)]
fimc-is: Enable build
Change-Id: I58682e769f517bb32d9a1a65b024a548ce20884a
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Thu, 29 Mar 2018 10:35:50 +0000 (12:35 +0200)]
fimc-is: Remove unused Kconfig entry
CONFIG_OIS_FW_UPDATE_THREAD_USE is not used anywhere in the driver code.
Change-Id: I548a1793ccd9605fec24556cfbd1be36d5856827
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Tue, 27 Mar 2018 12:43:34 +0000 (14:43 +0200)]
fimc-is: Enable required components in Kconfig by default
Change-Id: Ia2d71205a997e551724ada9009aaf88dd9500669
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Thu, 6 Aug 2015 08:03:46 +0000 (10:03 +0200)]
fimc-is: Adapt to latest changes DMA-mapping/IOMMU frameworks
This patch is a temporary workaround.
31-bit DMA mask is used to prevent overlapping with the Cortex-A5
reserved range. FIMC-IS CPU uses 0xe0000000-0xffffffff address
range for mapping peripheral devices, so those addresses must not
be used for memory buffers.
Change-Id: I74599b8037644bf7582043ac17a098d49b11193c
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Fri, 23 Mar 2018 17:14:09 +0000 (18:14 +0100)]
fimc-is: Remove redundant memory allocation error log
kzalloc() generates stack trace on errors.
Change-Id: I73a530a18a20e7e6d9aa73daec3e89357b1c1570
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Wed, 21 Mar 2018 16:53:04 +0000 (17:53 +0100)]
fimc-is: Adaptation to kthread API changes
Change-Id: I0ef434f7c5a9a18348feaa391bb6a601d107e028
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Wed, 21 Mar 2018 16:25:43 +0000 (17:25 +0100)]
fimc-is: Use ktime_get_ts() instead of do_posix_clock_monotonic_gettime
do_posix_clock_monotonic_gettime() is not available any more in kernel v4.14.
Change-Id: Ib9a5a1d1069e6ad7d593f8eddc0801f418163a16
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Wed, 21 Mar 2018 16:24:35 +0000 (17:24 +0100)]
fimc-is: Adaptation to V4L2 API changes
Change-Id: Ia944801f9bd161bb4381b679a0d0b6920bb3d35d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 21 Aug 2017 16:19:50 +0000 (18:19 +0200)]
fimc-is: Remove BUG() from fimc_is_itf_s_param()
The condition being tested for that BUG() invocation is often
recoverable, so replace BUG() with a WARN_ON() and return EINVAL.
This prevents specific user space call sequences crashing the kernel,
which should never happen.
The callers of fimc_is_itf_s_param() function will be updated in
subsequent patches if necessary, to prevent any further possible
crashes.
Change-Id: I90a08278baa0cee85a4a69fa1b278e28e5c6764a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Seung-Woo Kim [Thu, 22 Jun 2017 09:41:20 +0000 (18:41 +0900)]
fimc-is: change metadata header as uapi header
The header fimc-is-metadata.h is required from user, so it should
be a uapi header. So this patch moves the header to uapi header.
Change-Id: I5618889c806d4463da0bf0ea947bf5d1b667d5e3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Sylwester Nawrocki [Thu, 3 Mar 2016 15:27:59 +0000 (16:27 +0100)]
fimc-is: Rename "is fail" to "failed"
Change-Id: Ifd587dd48cf28d91250814499b881198cc039229
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 11 Mar 2016 15:08:37 +0000 (16:08 +0100)]
fimc-is: Add proper implementation of fimc_is_ischain_forcedown()
Change-Id: I1f9314050dd9ca52623dd1770ccef3fa8b3755d6
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 10 Mar 2016 16:46:47 +0000 (17:46 +0100)]
fimc-is: MCUCTL register definition cleanup
Lots of (mostly unused) postfix-indexed macro definitions
are now replaced with parametric definitions.
Change-Id: I86280b01681dfd25915ba7001af2e69c84369032
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 10 Mar 2016 16:24:27 +0000 (17:24 +0100)]
fimc-is: Remove unused data structure declaration
Change-Id: I8ba9ae47aab00f4dfad1724a92e4659cca91588b
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 10 Mar 2016 16:43:00 +0000 (17:43 +0100)]
fimc-is: Clear all MCUCTL register in the power up sequence
When the ISP, CAM{0,1} power domains are always on it is required
to clear MCUCTL registers in the ISP power up sequence, otherwise
the front camera is not working properly if previously the rear
camera pipeline was used. The original code relied on the MCUCTL
registers being reset to default values after the ISP power domain
switch off/on cycle.
Change-Id: I685603ab968e5eb3871dd0ed3a25a4eb694bdc75
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 4 Mar 2016 16:56:32 +0000 (17:56 +0100)]
fimc-is: Reconfigure more muxes to oscclk in the power off sequence
We don't switch off CAM1, CAM0, ISP power domain so reconfigure
more muxes to their default after reset state duriong power off
sequence.
Change-Id: I85161973d654268acd741f36210f5d8aee8c1ec9
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 29 Feb 2016 15:03:26 +0000 (16:03 +0100)]
fimc-is: Workaround for ACLK_CAM1_552_USER configuration issues
For some reason "mout_aclk_cam1_552_user" clock reconfiguration from
"oscclk" to "aclk_cam1_552" breaks the front camera operation (often
only empty buffer are dequeued). But it is required for the rear
camera. Until the root cause is found reconfigure the mux conditionally
only for the rear sensor operation.
Change-Id: If121971afa4007efc778bde452ff95e75f20dced
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 3 Mar 2016 15:30:54 +0000 (16:30 +0100)]
fimc-is: Fix compiler warning
n file included from drivers/media/platform/exynos/fimc-is/fimc-is-companion-dt.c:23:0:
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: 'struct fimc_is_core' declared inside parameter list
int fimc_is_parse_children_dt(struct device *dev, struct fimc_is_core *core);
^
drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: its scope is only this definition or declaration, which is probably not what you want
Change-Id: I8848007ce5de95574699a735c19bad195f0bd3cb
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 26 Feb 2016 16:33:50 +0000 (17:33 +0100)]
fimc-is: Add setting of vendorSpecific2[0] metadata structure field
vendorSpecific2[0] value pattern depends on the fimc-is firmware
revision. Move setting up of this field to the kernel as there is
all information required for this.
The driver will update the field accordingly only if user space
leaves it cleared.
Change-Id: Ib77d7be7081a2239a19912757392522d044d58f9
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 26 Feb 2016 16:02:46 +0000 (17:02 +0100)]
fimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clock
When CLK_MOUT_ACLK_CAM1_552_USER clock is properly defined
in clk-exynos5433.c re-parenting commented out in this patch
causes that only empty buffers can be dequeued from the scaler
for front camera. So re-parenting is disabled for now until
we can address this issue in a better way.
Change-Id: I6198a5f8945638ec0002a071d8f4865920790d00
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 6 Nov 2015 13:33:22 +0000 (14:33 +0100)]
fimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()
This prevents kernel panic caused by wrong sequences in user space.
Change-Id: I1470675c0a2a2bcecb526dbef0f93772c5da9cb4
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Tue, 24 Nov 2015 09:33:57 +0000 (10:33 +0100)]
fimc-is: Fix code issues pointed by CPPTest tool
Change-Id: I2d717c6eca79bc213e98448666cc0f88995bb00e
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Mon, 23 Nov 2015 12:55:49 +0000 (13:55 +0100)]
fimc-is: Fix possible memory leak found by static analysis
This patch fixes all issues pointed by Klocwork static analysis tool.
Change-Id: Ie0d80a2bbd514c6dac0959784623d380ea580b19
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Seung-Woo Kim [Tue, 1 Sep 2015 08:21:01 +0000 (17:21 +0900)]
fimc-is: 6d1: add sentinel element to id table
This patch adds sentinel element to id table to fix following out
of bounds access:
==================================================================
BUG: KASan: out of bounds access in i2c_device_match+0xcc/0xf0 at addr
ffffffc00120ee80
Read of size 1 by task swapper/0/1
page:
ffffffbdc0848380 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x400(reserved)
page dumped because: kasan: bad access detected
Address belongs to variable sensor_6d1_idt+0x20/0x40
CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.1.0-00839-gb91c2a6-dirty #3
Hardware name: Samsung TM2 board (DT)
Call trace:
[<
ffffffc00008bc58>] dump_backtrace+0x0/0x1d8
[<
ffffffc00008be40>] show_stack+0x10/0x20
[<
ffffffc000eee3a4>] dump_stack+0x80/0xd4
[<
ffffffc00021e4f0>] kasan_report_error+0x3e0/0x408
[<
ffffffc00021e9ec>] kasan_report+0x44/0x50
[<
ffffffc00021d8f0>] __asan_load1+0x78/0x80
[<
ffffffc000916b78>] i2c_device_match+0xc8/0xf0
[<
ffffffc0006d9d54>] __driver_attach+0x3c/0xd0
[<
ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138
[<
ffffffc0006d932c>] driver_attach+0x2c/0x40
[<
ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8
[<
ffffffc0006dab40>] driver_register+0xb0/0x1c0
[<
ffffffc000917fc0>] i2c_register_driver+0x48/0xc8
[<
ffffffc001795344>] sensor_6d1_load+0x18/0x24
[<
ffffffc000082ae4>] do_one_initcall+0xec/0x240
[<
ffffffc001755e50>] kernel_init_freeable+0x288/0x330
[<
ffffffc000eeab1c>] kernel_init+0xc/0xf0
Memory state around the buggy address:
ffffffc00120ed80: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa
ffffffc00120ee00: fa fa fa fa 00 00 06 fa fa fa fa fa 00 00 00 00
>
ffffffc00120ee80: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
^
ffffffc00120ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc00120ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Change-Id: I9db130c66d2aa884b946e946581e5dc08f8a20ca
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Seung-Woo Kim [Tue, 1 Sep 2015 07:59:03 +0000 (16:59 +0900)]
fimc-is: Fix wrong index access for dt child nodes
This patch fixes wrong index access for dt child nodes. This fixes
following use after free:
==================================================================
BUG: KASan: use after free in fimc_is_parse_children_dt+0x6c/0xe8 at addr
ffffffc08d27ffa8
Write of size 8 by task swapper/0/1
page:
ffffffbdc2b49fc0 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x0()
page dumped because: kasan: bad access detected
CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.1.0-00839-gb91c2a6-dirty #3
Hardware name: Samsung TM2 board (DT)
Call trace:
[<
ffffffc00008bc58>] dump_backtrace+0x0/0x1d8
[<
ffffffc00008be40>] show_stack+0x10/0x20
[<
ffffffc000eee3a4>] dump_stack+0x80/0xd4
[<
ffffffc00021e510>] kasan_report_error+0x400/0x408
[<
ffffffc00021e9ec>] kasan_report+0x44/0x50
[<
ffffffc00021d38c>] __asan_store8+0x94/0xb0
[<
ffffffc000991900>] fimc_is_parse_children_dt+0x68/0xe8
[<
ffffffc000959368>] fimc_is_probe+0xc0/0xed8
[<
ffffffc0006dc724>] platform_drv_probe+0x64/0xf8
[<
ffffffc0006d9ae8>] driver_probe_device+0x1f0/0x3a8
[<
ffffffc0006d9de0>] __driver_attach+0xc8/0xd0
[<
ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138
[<
ffffffc0006d932c>] driver_attach+0x2c/0x40
[<
ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8
[<
ffffffc0006dab40>] driver_register+0xb0/0x1c0
[<
ffffffc0006dc618>] __platform_driver_register+0xa8/0xb8
[<
ffffffc0017952c0>] fimc_is_driver_init+0x18/0x24
[<
ffffffc000082ae4>] do_one_initcall+0xec/0x240
[<
ffffffc001755e50>] kernel_init_freeable+0x288/0x330
[<
ffffffc000eeab1c>] kernel_init+0xc/0xf0
Memory state around the buggy address:
ffffffc08d27fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffffffc08d27ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>
ffffffc08d27ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffffffc08d280000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc08d280080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Change-Id: Id2794dfbb02c5fac923f0df15618609fe5387503
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Marek Szyprowski [Wed, 12 Aug 2015 08:29:23 +0000 (10:29 +0200)]
fimc-is: Set allow_zero_bytesused flag on videbuf2 queues
Change-Id: Ib477ca52c34de66b22e7583696ebd2a250917677
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Thu, 30 Jul 2015 04:21:48 +0000 (13:21 +0900)]
fimc-is: Get rid of struct v4l2_subdev_core_ops::init use
The init() is too limited to be used in this driver, it is deprecated
and usage of this callback should be removed anyway.
There is no device nodes for subdevs so ioctl is no exposed to user space.
Change-Id: I7ff42e1a7843826cba8cb9e652616b8c10a8c932
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Thu, 30 Jul 2015 01:55:38 +0000 (10:55 +0900)]
fimc-is: Fix/add vidioc_querycap for several video nodes
This allows us to get rid of a warning from v4l2-core.
Change-Id: I30fae593f0dcdd314d5c2cd18f02528b78e7807c
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Thu, 13 Aug 2015 12:52:20 +0000 (14:52 +0200)]
fimc-is: Fail device open when called from udev
This workaround avoids driver state change on system boot when udev checks
all video nodes.
Change-Id: I13f16b109251010f138f97943ab180c5003cf6b9
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Tue, 28 Jul 2015 05:06:58 +0000 (14:06 +0900)]
fimc-is: Workaround to ensure proper video open sequence
This a workaround to prevent system crash when video nodes are opened
in random sequence during system booting.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
fimc-is: hack video node open to require companion to be opened
Change-Id: I3b7f929c087acb32169fd6a26cee6eeb7e225497
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Mon, 27 Jul 2015 01:17:35 +0000 (10:17 +0900)]
fimc-is: Add memory barriers in place of vb2_ion_sync_for_device() calls
Change-Id: If208bd4f9f7ef2b2c488b004d552891e57577e25
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Thu, 6 Aug 2015 08:09:24 +0000 (10:09 +0200)]
fimc-is: Do not skip enabling enabled regulators
Regulators have proper on/off refcount, so use it instead of strange
is_enabled() based logic.
Change-Id: I6e23a5a6c3576d50581cb887f57a51897cdd86eb
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Thu, 23 Jul 2015 07:33:18 +0000 (09:33 +0200)]
fimc-is: temporary hack to ensure proper structure size
Change-Id: Ib87a85508a6be13ace45fcd800df867ad87115fc
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Fri, 7 Aug 2015 08:42:08 +0000 (10:42 +0200)]
fimc-is: temporary workaround for more strict vb2 buffer state tracking
Change-Id: I72897d4cbf6cf0b6bd349fe5f99ebc45b8c461f9
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Sylwester Nawrocki [Mon, 20 Jul 2015 01:53:30 +0000 (10:53 +0900)]
fimc-is: Correct error logs in fimc-is-groupmgr.c
Change-Id: I386a2b86fb6637617e02b9467020e196aaf31a15
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 20 Jul 2015 01:48:56 +0000 (10:48 +0900)]
fimc-is: Fix printk format in wq_func_general() function
Change-Id: Ia3ce3de8328ec5ab57b71bb383d274217a2a800a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Mon, 20 Jul 2015 01:46:25 +0000 (10:46 +0900)]
fimc-is: Remove unneeded variable declarations
Change-Id: Ia5392e11cade65529a91fb5d000b879c55e66738
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 17 Jul 2015 05:20:40 +0000 (14:20 +0900)]
fimc-is: Use proper type for FIMC-LITE register region pointer
Aside of dropping the pointless TO_WORD_OFFSET() macro this let's
us avoid errors on a 64-bit system where size of unsigned long is
8 bytes, as opposed to 4 bytes on 32-bit machines.
Change-Id: I572003d0f85a21724411030e322bf6da967a613a
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 17 Jul 2015 05:17:48 +0000 (14:17 +0900)]
fimc-is: Fix data type errors in debug printks
Change-Id: I7585c99ab7e8e2582da97e49688bea56ff66593f
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 17 Jul 2015 05:15:33 +0000 (14:15 +0900)]
fimc-is: Remove unused function declarations from fimc-is-hw.h
Change-Id: If173cd69b6e4ac3431740fa1b787b8894a09e5d0
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Sylwester Nawrocki [Fri, 17 Jul 2015 04:32:45 +0000 (13:32 +0900)]
fimc-is: Use proper type for CSIS register region pointer
Aside of dropping the pointless TO_WORD_OFFSET() macro this let's
us avoid errors on a 64-bit system where size of unsigned long is
8 bytes, as opposed to 4 bytes on 32-bit machines.
Change-Id: Ibba3165211b1d0a11ea34918cf8fc7033718420e
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Thu, 16 Jul 2015 08:59:37 +0000 (10:59 +0200)]
fimc-is: Fix CRC32 code for arm64
Fix getCRC() function return type.
Change-Id: I4aab3b97d3ff2b35aaa5cef10ad06bc6301292f2
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Marek Szyprowski [Mon, 13 Jul 2015 10:43:39 +0000 (12:43 +0200)]
fimc-is: Set correct paths to firmware files
fimc-is-ois: correct sd card path
fimc-is: change firmware path to /lib/firmware to avoid confusion
Change-Id: I198cdc58c1464a963a8ca23875f7c9ae38175b13
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Marek Szyprowski [Wed, 5 Aug 2015 13:38:28 +0000 (15:38 +0200)]
fimc-is: Use the same iommu address space for all fimc-is/sensors blocks
Change-Id: Ib6cfb506e13d02f91489d45f3679effaa75ddfe8
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>