platform/kernel/linux-rpi3.git
7 years agoRevert "ARM: dts: Disable pixelvalve0/1 nodes as workaround" 66/144666/5 accepted/tizen/4.0/unified/20170908.222207 accepted/tizen/unified/20170908.220611 submit/tizen/20170908.045238 submit/tizen_4.0/20170908.045250
KwangCheol Lee [Thu, 17 Aug 2017 10:05:36 +0000 (19:05 +0900)]
Revert "ARM: dts: Disable pixelvalve0/1 nodes as workaround"

This reverts commit 1fdbcec8240fff33b28d3402cb07b851e7ec841e.
Enable pixelvalve0/1 nodes to support the official RPI touchscreen LCD.

Change-Id: I86b4c78dd4ada0ec9328ac8b797c95c48b9b7c6e
Signed-off-by: KwangCheol Lee <kclee@dignsys.com>
7 years agoARM64: dts: bcm2710-rpi-3-b: add DT support for DRM relevant devices 57/142757/8
KwangCheol Lee [Mon, 7 Aug 2017 07:33:36 +0000 (16:33 +0900)]
ARM64: dts: bcm2710-rpi-3-b: add DT support for DRM relevant devices

Add DTs to support the official RPI touchscreen LCD.

Change-Id: Ibf3b17bfe5d1f0bbe55f941018a489899e8ea9ef
Signed-off-by: KwangCheol Lee <kclee@dignsys.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable the RPI touchscreen LCD 56/142756/5
KwangCheol Lee [Mon, 7 Aug 2017 07:31:00 +0000 (16:31 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable the RPI touchscreen LCD

Enable following configurations for the official RPI touchscreen LCD.
+ TOUCHSCREEN_RPI_FT5406
+ I2C_GPIO
+ DRM_PANEL_RASPBERRYPI_TOUCHSCREEN
+ BACKLIGHT_RPI

Change-Id: I4c11ef34ea87ddeb120a5bc685905dffb5a8654c
Signed-off-by: KwangCheol Lee <kclee@dignsys.com>
7 years agoARM: dts: bcm2710-rpi-3-b: enable spi0 device node 70/147570/1 accepted/tizen/4.0/unified/20170906.143304 accepted/tizen/unified/20170906.060742 submit/tizen/20170905.080002 submit/tizen_4.0/20170905.075958
Inki Dae [Tue, 5 Sep 2017 03:09:36 +0000 (12:09 +0900)]
ARM: dts: bcm2710-rpi-3-b: enable spi0 device node

Enable spi0 device node.

This patch is required to create spidev node which is used
by user space to control spi.

Change-Id: I8dec8288f6b35f628b178e0056d664b96f18ac4b
Signed-off-by: Inki Dae <inki.dae@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable SQUASHFS 59/146659/1 accepted/tizen/4.0/unified/20170830.134212 accepted/tizen/unified/20170830.161408 submit/tizen/20170830.084925 submit/tizen_4.0/20170830.085228
Seung-Woo Kim [Wed, 30 Aug 2017 02:59:40 +0000 (11:59 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable SQUASHFS

To support compressed readonly image from Tizen, squashfs will be
used. Enable SQUASHFS and realted configuration. For better
performance, also SQUASHFS_DECOMP_MULTI_PERCPU and
SQUASHFS_4K_DEVBLK_SIZE options are set.

Change-Id: I8d7fb37f8b2bbe102fedc6c9d7d9c4c242d6ec32
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable SMACK_NETFILTER 51/146651/1
Seung-Woo Kim [Tue, 29 Aug 2017 05:56:16 +0000 (14:56 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable SMACK_NETFILTER

On Tizen, nether service is failed because security smack netfilter
related configs are not enabled. So, enable related configs
including CONFIG_NETWORK_SECMARK, and CONFIG_SECURITY_SMACK_NETFILTER
and others.

Change-Id: Ia886ba9d5dd9bc559633acf3066818e57551f8f4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM: dts: bcm2710-rpi-3-b : Change audio node status as "okay" 62/145562/3 submit/tizen/20170828.224421
Lee Hackseung [Thu, 10 Aug 2017 06:48:39 +0000 (15:48 +0900)]
ARM: dts: bcm2710-rpi-3-b : Change audio node status as "okay"

Start.elf uses dt overlay concept, so each node status can be
overlayed with dtparam=audio=on in config.txt but u-boot does not.
So, change status of on-board audio dt node as "okay" because dt
overlay concept on u-boot requires too huge effort.

Fixing dts file from arm will also change arm64 because arm64 dts
includes arm dts.

Change-Id: I73b3c807968c031ba046f44e937c6828ee7f0119
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
[jcsing.lee@samsung.com: modify commit message more clearly]
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
7 years agoarm64: bcmrpi3_defconfig: Enable features related to bcm sound 61/145561/5
Lee Hackseung [Thu, 10 Aug 2017 05:50:09 +0000 (14:50 +0900)]
arm64: bcmrpi3_defconfig: Enable features related to bcm sound

Enable SND_BCM2835 that has essential functionalities to
play and capture sounds and enable configurations related to PWM
because earjack works through PWM devices.

Change-Id: I04f7ea23b9bdd447a7f8084d8ce5c6f73ebd9992
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
[jcsing.lee@samsung.com: modify commit message more clearly]
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
7 years agobcm2835: Change BCM2708_VCHIQ to BCM2835_VCHIQ 04/146304/3
Jaechul Lee [Mon, 28 Aug 2017 02:30:11 +0000 (11:30 +0900)]
bcm2835: Change BCM2708_VCHIQ to BCM2835_VCHIQ

RPI3 has been working without BCM2708_VCHIQ since a commit 60acf832db94
("staging: vc04_services: use bcm2835 consequently") from 4.10.y was
merged. I change all BCM2708_VCHIQ to BCM2835_VCHIQ.

Change-Id: Id1c469a489d54afbe863f46962d3459afb4481f4
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
7 years agopackaging: Disable UBSan build 92/146292/1 accepted/tizen/unified/20170828.164526 submit/tizen/20170828.023313
Denis Khalikov [Fri, 25 Aug 2017 13:11:14 +0000 (16:11 +0300)]
packaging: Disable UBSan build

UBSan build on kernel will cause build error because kernel has its own
sanitizer build options. So, dislable UBSan build from packaging spec.

Change-Id: Ife910a1e666c6fcafb7ef7bfcc072d88d8549d77
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable android logger 95/145695/2
Karol Lewandowski [Wed, 12 Jul 2017 09:54:23 +0000 (11:54 +0200)]
ARM64: tizen_bcmrpi3_defconfig: enable android logger

To support logger driver backend from Tizen dlog framework, enable
android logger.

Change-Id: I24960463efc40637858c0873ac7400fa0e806650
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agostaging: logger: fix build error due to removed ki_nbytes 93/145693/1
Inki Dae [Mon, 4 Jul 2016 08:28:46 +0000 (17:28 +0900)]
staging: logger: fix build error due to removed ki_nbytes

This patch fixes build error. Logger driver was removed
from mainline kernel and after that there was some changes and
one of them is that ki_nbytes member was removed from kiocb structure.
66ee59a fs: remove ki_nbytes

This patch makes count member of iov_iter structure to be used instead.

Change-Id: I11e9ebdac7dd86c02fd692a67562a23e5c685f69
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agoRevert "staging: Remove logger and alarm-dev from android Makefile" 92/145692/1
Karol Lewandowski [Mon, 3 Jul 2017 12:01:57 +0000 (14:01 +0200)]
Revert "staging: Remove logger and alarm-dev from android Makefile"

This reverts commit 71e365ed0ca893cae8d72cbd4b476a9589003098.

Change-Id: I190dabd2626ca7cb51d00d9fe186d15da21ae405
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agoRevert "staging: Remove the Android logger driver" 91/145691/1
Karol Lewandowski [Mon, 3 Jul 2017 12:00:55 +0000 (14:00 +0200)]
Revert "staging: Remove the Android logger driver"

This reverts commit a0a23bbce7818c90c3d3370af966fefce07a8c9b.

rpi3 is going to be used for various profiles - among these
there will be IoT and Headless, which still depend on legacy
android logger driver for application logging.

This commit reverts removal of the driver.

Change-Id: I61ab9e87c5bcbf318aa35ec2f92a470b54a98be1
Requested-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: update the defconfig for synchronization 85/145285/1
Jaehoon Chung [Tue, 22 Aug 2017 03:00:20 +0000 (12:00 +0900)]
ARM64: tizen_bcmrpi3_defconfig: update the defconfig for synchronization

It updates the defconfig for synchronization.

Change-Id: I2f1b2aa7cdcc82c0df0407cde155569884181471
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoARM64/SND_BCM2835: Port it to arm64.
Michael Zoran [Fri, 13 Jan 2017 03:05:46 +0000 (19:05 -0800)]
ARM64/SND_BCM2835: Port it to arm64.

In the messages sent to VCHIQ, SND_BCM2835 passes a callback
and a context into two 32 bit pointers.  Since this
message is interpreted by the firmware, it can't be easily
changed.  Luckily only one of these fields is actual used,
so on ARM64 only use one of the fields to store the upper
half of the 64 bit callback pointer.

The Kconfig is also changed to allow ARM audio to work for ARM64
as well.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
7 years agovchiq_arm: Tweak the logging output
Phil Elwell [Mon, 7 Mar 2016 15:05:11 +0000 (15:05 +0000)]
vchiq_arm: Tweak the logging output

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 years agoARM64: Fix bad cast in vc04_services
Michael Zoran [Fri, 13 Jan 2017 02:56:54 +0000 (18:56 -0800)]
ARM64: Fix bad cast in vc04_services

The function vchiq_copy_from_user contains a non-portable
cast to uint32_t.  Convert this to a cast to unsigned long
which is portable.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
7 years agovchiq_arm: Avoid use of mutex in add_completion
Phil Elwell [Mon, 20 Jun 2016 12:51:44 +0000 (13:51 +0100)]
vchiq_arm: Avoid use of mutex in add_completion

Claiming the completion_mutex within add_completion did prevent some
messages appearing twice, but provokes a deadlock caused by vcsm using
vchiq within a page fault handler.

Revert the use of completion_mutex, and instead fix the original
problem using more memory barriers.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 years agovchiq_arm: Access the dequeue_pending flag locked
Phil Elwell [Wed, 23 Mar 2016 14:16:25 +0000 (14:16 +0000)]
vchiq_arm: Access the dequeue_pending flag locked

Reading through this code looking for another problem (now found in userland)
the use of dequeue_pending outside a lock didn't seem safe.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 years agoRevert "staging: vc04_services: remove vchiq_copy_from_user"
popcornmix [Tue, 27 Dec 2016 22:13:42 +0000 (22:13 +0000)]
Revert "staging: vc04_services: remove vchiq_copy_from_user"

This reverts commit 49bec49fd7f273ec114e2e533c1bb8f21a654aaf.

7 years agostaging: vc04_services: add HAS_DMA dependancy
Greg Kroah-Hartman [Thu, 17 Nov 2016 08:39:59 +0000 (09:39 +0100)]
staging: vc04_services: add HAS_DMA dependancy

We need DMA for this, otherwise the build breaks, so fix this up.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Lee Jones <lee@kernel.org>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: clarify firmware dependency
Arnd Bergmann [Wed, 16 Nov 2016 15:39:06 +0000 (16:39 +0100)]
staging: vc04_services: clarify firmware dependency

The raspberrypi-firmware driver may be built as a loadable module,
which causes a link-time failure if the vc04_services driver is
built-in during compile-testing:

drivers/staging/vc04_services/vchiq.o: In function `vchiq_probe':
vchiq_connected.c:(.text.vchiq_probe+0x2c): undefined reference to `rpi_firmware_get'
drivers/staging/vc04_services/vchiq.o: In function `vchiq_platform_init':
vchiq_connected.c:(.text.vchiq_platform_init+0x1f0): undefined reference to `rpi_firmware_property'

This extends the dependency list to ensure the firmware is either
reachable, or completely disabled in case of compile-testing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: remove duplicate mutex_lock_interruptible
Arnd Bergmann [Wed, 16 Nov 2016 15:39:05 +0000 (16:39 +0100)]
staging: vc04_services: remove duplicate mutex_lock_interruptible

The driver tries to redefine mutex_lock_interruptible as an open-coded
mutex_lock_killable, but that definition clashes with the normal
mutex_lock_interruptible definition when CONFIG_DEBUG_LOCK_ALLOC
is set:

staging/vc04_services/interface/vchiq_arm/vchiq_killable.h:67:0: error: "mutex_lock_interruptible" redefined [-Werror]
 #define mutex_lock_interruptible mutex_lock_interruptible_killable
include/linux/mutex.h:161:0: note: this is the location of the previous definition

This simply removes the private implementation and uses the
normal mutex_lock_killable directly.

We could do the same for the down_interruptible_killable here, but
it's better to just remove the semaphores entirely from the driver,
which also takes care of that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix ifnullfree.cocci warnings
kbuild test robot [Fri, 11 Nov 2016 15:31:46 +0000 (23:31 +0800)]
staging: vc04_services: fix ifnullfree.cocci warnings

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c:65:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix array_size.cocci warnings
kbuild test robot [Fri, 11 Nov 2016 08:10:20 +0000 (16:10 +0800)]
staging: vc04_services: fix array_size.cocci warnings

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:193:39-40: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix returnvar.cocci warnings
kbuild test robot [Fri, 11 Nov 2016 08:10:20 +0000 (16:10 +0800)]
staging: vc04_services: fix returnvar.cocci warnings

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1788:16-22: Unneeded variable: "status". Return "VCHIQ_SUCCESS" on line 1824

 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix setup_timer.cocci warnings
kbuild test robot [Fri, 11 Nov 2016 08:10:20 +0000 (16:10 +0800)]
staging: vc04_services: fix setup_timer.cocci warnings

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1817:2-12: Use setup_timer function for function on line 1818.

 Use setup_timer function instead of initializing timer with the function
 and data fields
Generated by: scripts/coccinelle/api/setup_timer.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: add CONFIG_COMPILE_TEST ability
Greg Kroah-Hartman [Mon, 10 Oct 2016 10:05:14 +0000 (12:05 +0200)]
staging: vc04_services: add CONFIG_COMPILE_TEST ability

It would be nice to be able to build this code on other platforms other
than only the RPi, so add some empty macros to allow this to happen, and
turn off BROKEN as the code can now build properly thanks to Michael's
work.

Change-Id: I0a2a13332f5da2fd4072258e5c35ee99956f0b88
Cc: Michael Zoran <mzoran@crowfest.net>
Cc: Daniel Stone <daniels@collabora.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: popcornmix <popcornmix@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: add vchiq_pagelist_info structure
Michael Zoran [Mon, 7 Nov 2016 14:06:03 +0000 (06:06 -0800)]
staging: vc04_services: add vchiq_pagelist_info structure

The current dma_map_sg based implementation for bulk messages
computes many offsets into a single allocation multiple times in
both the create and free code paths.  This is inefficient,
error prone and in fact still has a few lingering issues
with arm64.

This change replaces a small portion of that inplementation with
new code that uses a new struct vchiq_pagelist_info to store the
needed information rather then complex offset calculations.

This improved implementation should be more efficient and easier
to understand and maintain.

Tests Run(Both Pass):
vchiq_test -p 1
vchiq_test -f 10

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix up some printk warnings
Greg Kroah-Hartman [Mon, 7 Nov 2016 10:18:42 +0000 (11:18 +0100)]
staging: vc04_services: fix up some printk warnings

Some more printk warnings snuck in recently, no one seems to be building
this on 64bit machines...

Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Lee Jones <lee@kernel.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Michael Zoran <mzoran@crowfest.net>
Cc: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: change order during module probe
Stefan Wahren [Mon, 31 Oct 2016 14:39:33 +0000 (14:39 +0000)]
staging: vchiq_arm: change order during module probe

The current order during module probe is prone to race conditions:

* debugfs entries, sysfs entries, platform code

So fix this by swapping the steps debugfs entries and platform code.
As a benefit this saves us a clean up step in the error path.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: remove debugfs entries on module unload
Stefan Wahren [Mon, 31 Oct 2016 14:39:32 +0000 (14:39 +0000)]
staging: vchiq_arm: remove debugfs entries on module unload

This removes the debugfs entries on module unload and fix one
of the many kernel oops after loading the module again.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: handle error case of get_user_pages
Stefan Wahren [Mon, 31 Oct 2016 14:39:31 +0000 (14:39 +0000)]
staging: vchiq_arm: handle error case of get_user_pages

It's possible that get_user_pages() could fail. So evaluate its
return code and handle this error case properly.

This issue has been found by Cppcheck.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: remove hardcoded buffer length
Stefan Wahren [Mon, 31 Oct 2016 14:39:30 +0000 (14:39 +0000)]
staging: vchiq_arm: remove hardcoded buffer length

We better use sizeof instead of hardcoding buffer length multiple
times. This make it easier to increase the buffer in the future.
In order to keep below 80 chars limit make the variable name shorter.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: add missing of_node_put
Stefan Wahren [Mon, 31 Oct 2016 14:39:29 +0000 (14:39 +0000)]
staging: vchiq_arm: add missing of_node_put

After device_node usage the refcount must be decremented with
of_node_put().

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_core: fix format strings in vchiq_dump_service_state
Stefan Wahren [Mon, 31 Oct 2016 14:39:28 +0000 (14:39 +0000)]
staging: vchiq_core: fix format strings in vchiq_dump_service_state

The member localport and remoteport are unsigned. So fix the format
string accordingly.

The issue has been found by Cppcheck.

Signed-off-by: Stefam Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_core: fix service dereference in unlock_service
Stefan Wahren [Mon, 31 Oct 2016 14:39:27 +0000 (14:39 +0000)]
staging: vchiq_core: fix service dereference in unlock_service

The service state is dereferenced before BUG_ON and outside of the
spin lock. So in order to avoid possible NULL pointer dereferences or
races move the whole scope at a safer place.

This issue has been found by Cppcheck.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: parse_rx_slots() - Fix compiler warning
Michael Zoran [Tue, 1 Nov 2016 15:21:14 +0000 (08:21 -0700)]
staging: vc04_services: parse_rx_slots() - Fix compiler warning

vc04_services contains a debug logging mechanism.  The log is
maintained in a shared memory area between the kernel and the
firmware.  Changing the sizes of the data in this area would
require a firmware change which is distributed independently
from the kernel binary.

One of the items logged is the address of received messages.
This address is a pointer, but the debugging slot used to store
the information is a 32 bit integer.

Luckily, this value is never interpreted by anything other
then debug tools and it is expected that a human debugging
the kernel interpret it.

This change adds a cast to long before the original cast
to int to silence the warning.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: remove vchiq_copy_from_user
Michael Zoran [Sun, 30 Oct 2016 12:55:07 +0000 (05:55 -0700)]
staging: vc04_services: remove vchiq_copy_from_user

The vchiq_copy_from_user function is not portable
and is consider "bad practice."  Replace this function
with a callback based mechanism that is passed downward
on the stack.  When it is actually time to copy the data,
the callback is called to copy the data into the message.

This callback is provided internally for userland calls
through ioctls on the device.

NOTE: Internal clients will need to be modified to work
with the new internal API.

Test Run:
vchiq_test -p 1
vchiq_test -f 10

Both tests pass.

Internal API Changes:

Change vchi_msg_queue to:
int32_t
vchi_msg_queue(VCHI_SERVICE_HANDLE_T handle,
       ssize_t (*copy_callback)(void *context, void *dest,
        size_t offset, size_t maxsize),
       void *context,
       uint32_t data_size );

Remove:
vchi_msg_queuev_ex
vchi_msg_queuev

These functions were not implemented anyway so no need to fix them. It's
easier to just remove them.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: setup DMA and coherent mask
Michael Zoran [Mon, 31 Oct 2016 21:02:03 +0000 (14:02 -0700)]
staging: vc04_services: setup DMA and coherent mask

VCHI messages between the CPU and firmware use 32-bit
bus addresses. Explicitly set the DMA mask and coherent
on all platforms.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: call sg_init_table to init scatterlist
Michael Zoran [Fri, 28 Oct 2016 17:58:13 +0000 (10:58 -0700)]
staging: vc04_services: call sg_init_table to init scatterlist

Call the sg_init_table function to correctly initialze
the DMA scatterlist.  This function is required to completely
initialize the list and is mandatory if DMA debugging is
enabled in the build configuration.

One of the purposes of sg_init_table is to set
the magic "cookie" on each list element and ensure
the chain end is marked.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: use bcm2835 consequently
Stefan Wahren [Wed, 26 Oct 2016 18:34:21 +0000 (18:34 +0000)]
staging: vc04_services: use bcm2835 consequently

The naming bcm2708 is used only in the vendor kernel, so better
replace it with bcm2835 which is used in mainline in order
to avoid any confusion.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix CamelCase
Stefan Wahren [Wed, 26 Oct 2016 18:34:20 +0000 (18:34 +0000)]
staging: vc04_services: fix CamelCase

This fixes the CamelCase of some variables.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_shim: avoid code duplication
Stefan Wahren [Wed, 26 Oct 2016 18:34:19 +0000 (18:34 +0000)]
staging: vchiq_shim: avoid code duplication

Rearrange the polling loops in order to avoid code duplication. Btw we fix
the style of the comments.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: Make DT firmware node mandatory
Stefan Wahren [Wed, 26 Oct 2016 18:34:18 +0000 (18:34 +0000)]
staging: vchiq_arm: Make DT firmware node mandatory

In Linux Mainline there wasn't a chance to boot the RPi without DT.
So we can make the firmware node mandatory.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vchiq_arm: add MODULE_DESCRIPTION
Stefan Wahren [Wed, 26 Oct 2016 18:34:17 +0000 (18:34 +0000)]
staging: vchiq_arm: add MODULE_DESCRIPTION

This patch adds the missing module description for the driver.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Replace dmac_map_area with dmac_map_sg
Michael Zoran [Wed, 26 Oct 2016 02:23:27 +0000 (19:23 -0700)]
staging: vc04_services: Replace dmac_map_area with dmac_map_sg

The original arm implementation uses dmac_map_area which is not
portable.  Replace it with an architecture neutral version
which uses dma_map_sg.

As you can see that for larger page sizes, the dma_map_sg
implementation is faster then the original unportable dma_map_area
implementation.

Test                       dmac_map_area   dma_map_page dma_map_sg
vchiq_test -b 4 10000      51us/iter       76us/iter    76us
vchiq_test -b 8 10000      70us/iter       82us/iter    91us
vchiq_test -b 16 10000     94us/iter       118us/iter   121us
vchiq_test -b 32 10000     146us/iter      173us/iter   187us
vchiq_test -b 64 10000     263us/iter      328us/iter   299us
vchiq_test -b 128 10000    529us/iter      631us/iter   595us
vchiq_test -b 256 10000    2285us/iter     2275us/iter  2001us
vchiq_test -b 512 10000    4372us/iter     4616us/iter  4123us

For message sizes >= 64KB, dma_map_sg is faster then dma_map_page.

For message size >= 256KB, the dma_map_sg is the fastest
implementation.

"Normal" messages sizes should be about 1MB which is beyond
the length that this change shows a speed increase.

This is v2 of the patch which includes extra WARN_ONs and
incorporates feedback from Eric Anholt <eric@anholt.net>.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2708_vchiq: fix return value check in vchiq_init_state()
Wei Yongjun [Mon, 17 Oct 2016 15:05:36 +0000 (15:05 +0000)]
staging: bcm2708_vchiq: fix return value check in vchiq_init_state()

In case of error, the function kthread_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2708_vchiq: fix return value check in vchiq_platform_conn_state_changed()
Wei Yongjun [Mon, 17 Oct 2016 15:06:07 +0000 (15:06 +0000)]
staging: bcm2708_vchiq: fix return value check in vchiq_platform_conn_state_changed()

In case of error, the function kthread_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2708_vchiq: remove .owner field for driver
Wei Yongjun [Mon, 17 Oct 2016 15:08:14 +0000 (15:08 +0000)]
staging: bcm2708_vchiq: remove .owner field for driver

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/vchi: Add a TODO file of things I know we need to deal with.
Eric Anholt [Mon, 17 Oct 2016 19:44:05 +0000 (12:44 -0700)]
staging/vchi: Add a TODO file of things I know we need to deal with.

I've left out the downstream HDMI audio driver from the "to be
imported" section, as we'll want to handle it natively in vc4.  The
downstream kernel will likely continue to use that driver for a while
due to using the interim "vc4 firmware KMS" mode while vc4 gets its
featureset (such as HDMI audio!) completed.

I've also left out VC-CMA, which appears to be about having Linux
manage a CMA area that the firmware gets to make allocations out of.
I'm not clear on if this is useful (the firmware's need for memory
drops massively with vc4 present, and may drop even more depending on
how we resolve dmabuf handling for camera and video decode)

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Add casts to remove warnings in vchiq_core.c
Michael Zoran [Wed, 19 Oct 2016 22:58:54 +0000 (15:58 -0700)]
staging: vc04_services: Add casts to remove warnings in vchiq_core.c

When compiling vchiq_core.c for 64 bit, the compiler
emits a few warnings that are not actual issues. This
change adds a few casts to remove the extra unnecessary
warnings.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Handle conversion from VCHIQ_SERVICE_HANDLE_T to VCHI_SERVICE...
Michael Zoran [Wed, 19 Oct 2016 22:58:48 +0000 (15:58 -0700)]
staging: vc04_services: Handle conversion from VCHIQ_SERVICE_HANDLE_T to VCHI_SERVICE_HANDLE_T

A VCHIQ_SERVICE_HANDLE_T which is an int is stuffed into a
VCHI_SERVICE_HANDLE_T which is a pointer, passed around, then
converted back to a VCHIQ_SERVICE_HANDLE_T. Since the data is
always actually a VCHIQ_SERVICE_HANDLE_T(int), never actually a
pointer, it is safe to simply cast the two back in forth.

Note that pointers are never stuffed into an int.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Convert pointers in shared state to offsets
Michael Zoran [Wed, 19 Oct 2016 22:58:34 +0000 (15:58 -0700)]
staging: vc04_services: Convert pointers in shared state to offsets

The arm processor core and the GPU have a shared data structure.
This structure contains pointers to base linux kernel objects such as
events.  The size of the pointer changes between 32 bit and 64 bit,
so it is necessary to convert these pointers to offsets from the
beginning of the state structure.

Luckly, the GPU does not interpret these pointers/offsets,
but this change is necessary to keep the structure the same since
the GPU code is outside the scope of the linux kernel
and can't be easily changed.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Change fields of page list structure to fixed length
Michael Zoran [Wed, 19 Oct 2016 22:58:27 +0000 (15:58 -0700)]
staging: vc04_services: Change fields of page list structure to fixed length

The arm processor core and the GPU have shared data structures.
One of these structures is a list of pages of data for messages.
This structure can not change since it is dependent on the GPU
firmware which is external to the kernel.  Convert the fields
of this structure to fixed length fields.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Convert dsb() to dsb(sy)
Michael Zoran [Wed, 19 Oct 2016 22:58:09 +0000 (15:58 -0700)]
staging: vc04_services: Convert dsb() to dsb(sy)

The dsb() macro for 32 arm compiles to dsb(sy) in the binary file.
This macro is no longer supported on arm64, so instead use dsb(sy)
which is completely binary compatible.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: don't print pointers directly
Greg Kroah-Hartman [Mon, 10 Oct 2016 12:23:49 +0000 (14:23 +0200)]
staging: vc04_services: don't print pointers directly

kernel pointers should be printed with %pK and are not unsigned int big
on all architectures.  So fix this up to get rid of a bunch of warning
messages.

Note, there are other assumptions in this code that a pointer fits into
an int that need to be fixed up later.

Cc: Daniel Stone <daniels@collabora.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: popcornmix <popcornmix@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix dmac_map/unmap_area prototypes
Greg Kroah-Hartman [Mon, 10 Oct 2016 10:03:17 +0000 (12:03 +0200)]
staging: vc04_services: fix dmac_map/unmap_area prototypes

You don't define a function prototype on one line as a #define, and then
the next declare it as an external C function, without expecting a C
compiler to complain loudly.

So fix up this mess.

Cc: Daniel Stone <daniels@collabora.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: popcornmix <popcornmix@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: fix debugfs write functions
Greg Kroah-Hartman [Mon, 10 Oct 2016 10:01:41 +0000 (12:01 +0200)]
staging: vc04_services: fix debugfs write functions

write functions need to return ssize_t, not int, so fix the functions up
for the correct prototype.

Cc: Daniel Stone <daniels@collabora.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: popcornmix <popcornmix@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: vc04_services: vchiq_arm: Remove unused function remote_event_destroy
Bhumika Goyal [Thu, 6 Oct 2016 18:10:01 +0000 (23:40 +0530)]
Staging: vc04_services: vchiq_arm: Remove unused function remote_event_destroy

Remove function remote_event_destroy as it is not used anywhere in the
kernel. Function detected using Coccinelle but changes done by hand.
Script:

@initialize:python@
@@
def display(name,p):
        print(name,p[0].file)

@r1@
identifier func;
type T;
position p;
@@
static T func@p(...)
{
...
}

@r@
identifier r1.func;
@@
func

@script:python depends on !r@
func << r1.func;
p << r1.p;
@@
display(func,p)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoRevert "vchiq_arm: Access the dequeue_pending flag locked"
Lee Hackseung [Thu, 10 Aug 2017 04:45:07 +0000 (13:45 +0900)]
Revert "vchiq_arm: Access the dequeue_pending flag locked"

This reverts commit f4c962d8d94cacec0049f8167ca7b59b0909f7ad.

7 years agoRevert "vchiq_arm: Tweak the logging output"
Lee Hackseung [Thu, 10 Aug 2017 04:44:55 +0000 (13:44 +0900)]
Revert "vchiq_arm: Tweak the logging output"

This reverts commit 16bb6574646104789a1ed844ffad670e2c336084.

7 years agoRevert "vchiq_arm: Avoid use of mutex in add_completion"
Lee Hackseung [Thu, 10 Aug 2017 04:44:44 +0000 (13:44 +0900)]
Revert "vchiq_arm: Avoid use of mutex in add_completion"

This reverts commit 3d17f0eb02770a2d3a0a73d3ea63b75b7b5e876c.

7 years agoARM64: tizen_bcmrpi3_defconfig: enable BLUETOOTH 48/137948/2
Lee Hackseung [Mon, 10 Jul 2017 10:36:22 +0000 (19:36 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable BLUETOOTH

Activate Bluetooth related settings.

Change-Id: I6c9496341698aadc66934ab93a3b54d2f82894ad
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable UVC 45/143745/3
Lee Hackseung [Fri, 11 Aug 2017 06:17:38 +0000 (15:17 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable UVC

Activate all settings related to UVC(USB Video Class)

Change-Id: I6d5d3d388d06fc4b5ae9510db63f4398f8fe84fe
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
7 years agopackaging: Add kernel devel package 33/142333/5 accepted/tizen/4.0/unified/20170829.020208 accepted/tizen/unified/20170811.071714 submit/tizen/20170811.021835 submit/tizen_4.0/20170828.100004
Alexander Aksenov [Thu, 27 Jul 2017 12:53:34 +0000 (15:53 +0300)]
packaging: Add kernel devel package

Kernel devel is used now to build out-of-tree kernel modules

Change-Id: I753edba92042561b50dc6c645f23659a65568976
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable USB audio driver 42/138942/3 accepted/tizen/4.0/unified/20170816.012532 accepted/tizen/unified/20170801.200004 submit/tizen/20170801.050436 submit/tizen_4.0/20170811.094300
Jaechul Lee [Fri, 28 Jul 2017 07:48:32 +0000 (16:48 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable USB audio driver

Activate ALSA USB related settings.

Change-Id: I03d6c9cd9eb6e55667f7bd92717b6beeb304aa1b
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
[jcsing.lee: adjust commit message]
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
7 years agopackaging: Update kernel version to v4.9.39
Joonyoung Shim [Fri, 28 Jul 2017 07:00:22 +0000 (16:00 +0900)]
packaging: Update kernel version to v4.9.39

Update kernel version to v4.9.39 from spec file.

Change-Id: I6fc3b4a10a4fb9d1c644f53df6195a2796636064
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable GPIO_BCM_EXP
Joonyoung Shim [Wed, 26 Jul 2017 05:27:19 +0000 (14:27 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable GPIO_BCM_EXP

VC4 DRM hdmi uses HPD gpio controlled by Broadcom expander GPIO driver,
so enable GPIO_BCM_EXP config.

Change-Id: I1457a0d2d9d071363eb2f43225a308eeeaaa3353
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable INPUT_EVDEV
Andi Shyti [Tue, 25 Jul 2017 01:55:38 +0000 (10:55 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable INPUT_EVDEV

Tizen needs the dev/input/eventX to interface for with the mouse,
INPUT_EVDEV enables it.

Change-Id: I3a9566a10b8764fe5af21fc6b1361cf9e8040a23
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agorpi3: config: change the 'kernel' parameter from Image to u-boot.bin
Jaehoon Chung [Wed, 12 Jul 2017 04:22:47 +0000 (13:22 +0900)]
rpi3: config: change the 'kernel' parameter from Image to u-boot.bin

It needs to use the u-boot for supporting ramdisk booting.
Current release image is including the u-boot.bin that modified the ramdisk
booting sequence.

Change the kernel parameter from "Image" to "u-boot.bin" in config.txt.

Change-Id: Icc4ddce7e9f9befba59240d02ddd9af111c92a40
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agorpi3: config: Enable SPI interface
Hyeongsik Min [Tue, 11 Jul 2017 11:55:13 +0000 (20:55 +0900)]
rpi3: config: Enable SPI interface

Uncomment spi=on in config.txt file to enable SPI interface.

Change-Id: I595628838fe9d769b243948e7118d36f4647e490
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable SPI_BCM2835
Hyeongsik Min [Tue, 11 Jul 2017 11:24:27 +0000 (20:24 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable SPI_BCM2835

Enables support of BCM2835 SPI driver needed by peripheral-io.

Change-Id: Ibf2aaca64462e4046ba155d11783f19f912ef8c3
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agotee: add ARM_SMCCC dependency
Arnd Bergmann [Wed, 10 May 2017 19:05:16 +0000 (21:05 +0200)]
tee: add ARM_SMCCC dependency

For the moment, the tee subsystem only makes sense in combination with
the op-tee driver that depends on ARM_SMCCC, so let's hide the subsystem
from users that can't select that.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[egukim: Backported from mainline kernel v4.12]
Signed-off-by: Eunggu Kim <egukim@dignsys.com>
Change-Id: I1eaf9f24ff79dd9532632500f47cdbfa9918546e

7 years agoDocumentation: tee subsystem and op-tee driver
Jens Wiklander [Mon, 1 Jun 2015 14:15:25 +0000 (16:15 +0200)]
Documentation: tee subsystem and op-tee driver

Acked-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[egukim: Backported from mainline kernel v4.12]
Signed-off-by: Eunggu Kim <egukim@dignsys.com>
Change-Id: I87bca17d44a0641350939131feef831d6825e05d

7 years agotee: add OP-TEE driver
Jens Wiklander [Tue, 14 Apr 2015 12:33:20 +0000 (14:33 +0200)]
tee: add OP-TEE driver

Adds a OP-TEE driver which also can be compiled as a loadable module.

* Targets ARM and ARM64
* Supports using reserved memory from OP-TEE as shared memory
* Probes OP-TEE version using SMCs
* Accepts requests on privileged and unprivileged device
* Uses OPTEE message protocol version 2 to communicate with secure world

Acked-by: Andreas Dannenberg <dannenberg@ti.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Tested-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> (RCAR H3)
Tested-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[egukim: Backported from mainline kernel v4.12]
Signed-off-by: Eunggu Kim <egukim@dignsys.com>
Change-Id: I51850d0ecd9279df51935f33e58db948d367e4e3

7 years agotee: generic TEE subsystem
Jens Wiklander [Wed, 11 Mar 2015 13:39:39 +0000 (14:39 +0100)]
tee: generic TEE subsystem

Initial patch for generic TEE subsystem.
This subsystem provides:
* Registration/un-registration of TEE drivers.
* Shared memory between normal world and secure world.
* Ioctl interface for interaction with user space.
* Sysfs implementation_id of TEE driver

A TEE (Trusted Execution Environment) driver is a driver that interfaces
with a trusted OS running in some secure environment, for example,
TrustZone on ARM cpus, or a separate secure co-processor etc.

The TEE subsystem can serve a TEE driver for a Global Platform compliant
TEE, but it's not limited to only Global Platform TEEs.

This patch builds on other similar implementations trying to solve
the same problem:
* "optee_linuxdriver" by among others
  Jean-michel DELORME<jean-michel.delorme@st.com> and
  Emmanuel MICHEL <emmanuel.michel@st.com>
* "Generic TrustZone Driver" by Javier González <javier@javigon.com>

Acked-by: Andreas Dannenberg <dannenberg@ti.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
Tested-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> (RCAR H3)
Tested-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[egukim: Backported from mainline kernel v4.12]
Signed-off-by: Eunggu Kim <egukim@dignsys.com>
Change-Id: Ic18be90e466ff3678d117a0d87506fe6a0904dd0

7 years agodt/bindings: add bindings for optee
Jens Wiklander [Thu, 21 May 2015 05:47:09 +0000 (07:47 +0200)]
dt/bindings: add bindings for optee

Introduces linaro prefix and adds bindings for ARM TrustZone based OP-TEE
implementation.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
[egukim: Backported from mainline kernel v4.12]
Signed-off-by: Eunggu Kim <egukim@dignsys.com>
Change-Id: I763101f751006b388adbe060a20311edb228dfb4

7 years agoARM64: tizen_bcmrpi3_defconfig: increase the ramdisk size to 12MB
Jaehoon Chung [Tue, 27 Jun 2017 06:54:26 +0000 (15:54 +0900)]
ARM64: tizen_bcmrpi3_defconfig: increase the ramdisk size to 12MB

The size of Ramdisk-recovery should be 12MB.

Change-Id: I474a32f8fb1233d36b837806dde54e376a0cafdd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agopackaging: Turn off building with ASan
Gonzha Dmitriy Evgenevich [Wed, 24 May 2017 10:51:05 +0000 (13:51 +0300)]
packaging: Turn off building with ASan

Turn off ASan for ASan sanitized firmware build

Change-Id: If786306821ff22e994efaba2b00dcabcc5eb8426
Signed-off-by: Gonzha Dmitriy Evgenevich <d.gonzha@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defcofig: enable audit subsystem
Karol Lewandowski [Thu, 1 Jun 2017 12:17:37 +0000 (14:17 +0200)]
ARM64: tizen_bcmrpi3_defcofig: enable audit subsystem

Syscall auditing is going to be used by fault detection service - faultd.

Change-Id: Ifc6853e12fcc90497bd8a222eecb44fdd09f57ba
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defcofig: enable the configs relevant to bridge
Jaehoon Chung [Mon, 22 May 2017 23:53:49 +0000 (08:53 +0900)]
ARM64: tizen_bcmrpi3_defcofig: enable the configs relevant to bridge

Enable the configs relevant to BRIDGE and STP.

Change-Id: Iabb67ec49d176ff5fe6083dfc4a48ed40d683d1a
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable the MAC80211 and RT2X00 configs
Jaehoon Chung [Fri, 19 May 2017 03:37:59 +0000 (12:37 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable the MAC80211 and RT2X00 configs

To use Ralink driver, enable the configurations relevant to it.

Change-Id: I5122405b297caf1f6f1e56d02a524d504671d910
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: Enable USB_SERIAL configurations
Jaehoon Chung [Wed, 17 May 2017 05:41:08 +0000 (14:41 +0900)]
ARM64: tizen_bcmrpi3_defconfig: Enable USB_SERIAL configurations

Enable USB_SERIAL configurations.
(CONFIG_SERIAL, CONFIG_SERIAL_GENERIC, CONFIG_SERIAL_CP210X)

Change-Id: Icead3fc34b2e37889a1dd407c24aff1444a5ab20
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agodrm/vc4: add gem_info node via debugfs
Joonyoung Shim [Thu, 23 Mar 2017 06:11:01 +0000 (15:11 +0900)]
drm/vc4: add gem_info node via debugfs

The memps requires gem_info with gem_names to analyze graphics
shared memory, so this patch adds gem_info node via debugfs
interface.

Let's save pid/tgid in private file data only once when gem object is
created or prime_fd is imported and use them on gem_info. This is to
solve the wrong pid problem of gem_info created as different processes
share fd of drm device node.

Change-Id: Iaac2ccd63e124dd11a894f0e88ddbb533750f3d4
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: increase CMA size to 256MiB
Joonyoung Shim [Wed, 29 Mar 2017 01:54:52 +0000 (10:54 +0900)]
ARM64: tizen_bcmrpi3_defconfig: increase CMA size to 256MiB

CMA size 64MiB is insufficient in tizen platform.

Change-Id: I83fa78d12af93361a87f0819b7b7abcd5b23fb2e
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: enable I2C_CHARDEV
Andi Shyti [Fri, 31 Mar 2017 06:23:47 +0000 (15:23 +0900)]
ARM64: tizen_bcmrpi3_defconfig: enable I2C_CHARDEV

The I2C_CHARDEV flag enables the compilation of the i2c-dev
driver which generates a character device of the type /dev/i2c-X
where userspace programs can access to the i2c devices without
the support of any device drivers.

Change-Id: I661d8590bc219c6500bb5fca89df0436aa0efdca
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoARM64: dts: bcm2710-rpi-3-b: enable i2c1
Andi Shyti [Fri, 31 Mar 2017 06:20:27 +0000 (15:20 +0900)]
ARM64: dts: bcm2710-rpi-3-b: enable i2c1

i2c bus number 1 is mapped in the Raspberry Pi gpio array for
connecting through i2c external devices.

Change-Id: Ia8f72952f4aed1d737ab75c239ead25bb97d2e3c
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: increase the ramdisk size to 8MB
Jaehoon Chung [Mon, 27 Mar 2017 07:54:15 +0000 (16:54 +0900)]
ARM64: tizen_bcmrpi3_defconfig: increase the ramdisk size to 8MB

Increase the ramdisk size from 4MB to 8MB.
Tizen ramdisk size should be under 8MB.

Change-Id: I0f3b4f7565e562020616bd3eb15714c0565f951b
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoARM: dts: Disable pixelvalve0/1 nodes as workaround
Hoegeun Kwon [Wed, 8 Mar 2017 06:55:32 +0000 (15:55 +0900)]
ARM: dts: Disable pixelvalve0/1 nodes as workaround

Disable the pixelvalve0/1 nodes due to a problem that calls
drmWaitVBlank using only the crtc index 0 on the platform.

Until platform considers crtc index when calls drmWaitVBlank, this will
make that HDMI using pixelvalve2 is crtc index 0 as workaround.

Change-Id: I6142ed88c683fbe8d22144622e100693888146e5
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
7 years agodrm: vc4: adapt to new behaviour of drm_crtc.c
Andrzej Pietrasiewicz [Wed, 1 Feb 2017 09:35:08 +0000 (10:35 +0100)]
drm: vc4: adapt to new behaviour of drm_crtc.c

When drm_crtc_init_with_planes() was orignally added
(in drm_crtc.c, e13161af80c185ecd8dc4641d0f5df58f9e3e0af
drm: Add drm_crtc_init_with_planes() (v2)), it only checked for "primary"
being non-null. If that was the case, it modified primary->possible_crtcs.

Then, when support for cursor planes was added
(fc1d3e44ef7c1db93384150fdbf8948dcf949f15 drm: Allow drivers to register
cursor planes with crtc), the same behaviour was implemented for cursor
planes.

vc4_plane_init() since its inception has passed 0xff as "possible_crtcs"
parameter to drm_universal_plane_init(). With a change in drm_crtc.c
(7abc7d47510c75dd984380ebf819616e574c9604 drm: don't override
possible_crtcs for primary/cursor planes) passing 0xff results in primary's
possible_crtcs set to 0xff (cursor was updated manually by vc4_crtc.c).
Consequently, it would be allowed to use the primary plane from CRTC 1 (for
example) on CRTC 0, which would result in the overlay and cursors being
buried.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/1485941708-27892-1-git-send-email-andrzej.p@samsung.com
Fixes: 7abc7d47510c ("drm: don't override possible_crtcs for primary/cursor planes")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I49ba9005f06884dd99732ca8e8b405067304cd15

7 years agopackaging: Added '.gbs.conf' for partial build
Jaechul Lee [Mon, 30 Jan 2017 23:58:22 +0000 (08:58 +0900)]
packaging: Added '.gbs.conf' for partial build

Added gbs configuration file for enhanced building.
it makes gbs build faster than before.

https://source.tizen.org/documentation/reference/git-build-system/maintenance-models-supported-gbs

Change-Id: I79d57aa5eb49d0fbfa9a3744ec2acb032a274e5e
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoscripts: mkbootimg_rpi3.sh: Add ARM64 kernel/dtb binary to boot.img
Joonyoung Shim [Thu, 9 Feb 2017 06:40:12 +0000 (15:40 +0900)]
scripts: mkbootimg_rpi3.sh: Add ARM64 kernel/dtb binary to boot.img

Change-Id: I7a03c11ef155dd3ad5fc935511ae764ef699c145
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: rpi3: config: enable configurations relevant to WiFi
Jaehoon Chung [Tue, 7 Feb 2017 07:50:54 +0000 (16:50 +0900)]
ARM64: rpi3: config: enable configurations relevant to WiFi

Enable configurations relevant to WiFi.
These configurations are basic configs for using Network.
If needs to enable more configuration, it should be enabled in future.

To use WiFi, enable the brcmfmac driver as modules.
(Needs to install modules in target.)

Change-Id: Ia9961018f6736e3bc709c0d760f0d2d02994c7c8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
7 years agoSmack: ignore private inode for file functions
Seung-Woo Kim [Mon, 12 Dec 2016 08:35:26 +0000 (17:35 +0900)]
Smack: ignore private inode for file functions

The access to fd from anon_inode is always failed because there is
no set xattr operations. So this patch fixes to ignore private
inode including anon_inode for file functions.

It was only ignored for smack_file_receive() to share dma-buf fd,
but dma-buf has other functions like ioctl and mmap.

Reference: https://lkml.org/lkml/2015/4/17/16

Change-Id: I9b0bef5b84bfd6194847abc60ae8fff293c57984
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoSmack: fix d_instantiate logic for sockfs and pipefs
Rafal Krypa [Fri, 9 Dec 2016 13:03:04 +0000 (14:03 +0100)]
Smack: fix d_instantiate logic for sockfs and pipefs

Since 4b936885a (v2.6.32) all inodes on sockfs and pipefs are disconnected.
It caused filesystem specific code in smack_d_instantiate to be skipped,
because all inodes on those pseudo filesystems were treated as root inodes.
As a result all sockfs inodes had the Smack label set to floor.

In most cases access checks for sockets use socket_smack data so the inode
label is not important. But there are special cases that were broken.
One example would be calling fcntl with F_SETOWN command on a socket fd.

Now smack_d_instantiate expects all pipefs and sockfs inodes to be
disconnected and has the logic in appropriate place.

Change-Id: Ia2af7e308d7ccd7c40c1ccf9491c50365957dda0
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoSmack: Assign smack_known_web label for kernel thread's
jooseong lee [Thu, 3 Nov 2016 10:54:39 +0000 (11:54 +0100)]
Smack: Assign smack_known_web label for kernel thread's

Assign smack_known_web label for kernel thread's socket

Creating struct sock by sk_alloc function in various kernel subsystems
like bluetooth doesn't call smack_socket_post_create(). In such case,
received sock label is the floor('_') label and makes access deny.

Change-Id: Ic786f43e30f702b72f02a44f1e2e6db3205a0dd7
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: Disable FB_BCM2708
Joonyoung Shim [Tue, 7 Feb 2017 05:01:04 +0000 (14:01 +0900)]
ARM64: tizen_bcmrpi3_defconfig: Disable FB_BCM2708

Disable FB driver because of using DRM driver.

Change-Id: I3bfb899c1e0c71a235952934ecaf749a1d90dd85
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM64: tizen_bcmrpi3_defconfig: Increase CMA size to 64MiB
Joonyoung Shim [Mon, 6 Feb 2017 06:55:03 +0000 (15:55 +0900)]
ARM64: tizen_bcmrpi3_defconfig: Increase CMA size to 64MiB

Change-Id: I2f9fa5be256d1eda5fb3f8c70e4116c93df60abe
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>