platform/kernel/linux-rpi.git
3 years agoWORKAROUND: security: smack: Allow ptracing even processes in onlycap set 64/240564/4 accepted/tizen/unified/20200810.123100 submit/tizen/20200810.050403
Karol Lewandowski [Fri, 7 Aug 2020 11:49:30 +0000 (13:49 +0200)]
WORKAROUND: security: smack: Allow ptracing even processes in onlycap set

Change-Id: I708d19703da0f1b83950454fda1362bec7369b5c
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoRevert "brd: remove support for BLKFLSBUF" 83/239983/2 accepted/tizen/unified/20200806.062547 submit/tizen/20200806.024854
Seung-Woo Kim [Fri, 31 Jul 2020 06:19:08 +0000 (15:19 +0900)]
Revert "brd: remove support for BLKFLSBUF"

This reverts commit ff26956875c2f05e12ecec9938411a2c7dfc767d.

To free ramdisk memory, BLKFLSBUF support is required.

Change-Id: Ib363fdcb65a21914c8baa2099e4b1ce6242428e2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoRevert "brd: remove discard support" 82/239982/2
Seung-Woo Kim [Fri, 31 Jul 2020 06:18:06 +0000 (15:18 +0900)]
Revert "brd: remove discard support"

This reverts commit f09a06a193d942a12c1a33c153388b3962222006.

To support ramdisk flush, discard is required. So, revert the commit.
Note: struct queue_limit::discard_zeroes_data flag setting is
removed and queue_flag_set_unlocked() is replaced
blk_queue_flag_set().

Change-Id: Iead94d2263ce7ab688e57de587fa77f649285b10
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoRevert "brd: remove unused brd_mutex" 81/239981/2
Seung-Woo Kim [Fri, 31 Jul 2020 06:38:14 +0000 (15:38 +0900)]
Revert "brd: remove unused brd_mutex"

This reverts commit 15f7b41f70ddcca3b555bd0fdc7c8da7466b517e.

To support brd flush to free ramdisk brd_mutex is required.

Change-Id: Ide75bcb73812c3c7e04bfe6ebaed0d6d511e01dd
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Fix CMA size to 512M 72/240072/2
Hoegeun Kwon [Mon, 3 Aug 2020 05:28:50 +0000 (14:28 +0900)]
ARM: dts: bcm2711-rpi-4-b: Fix CMA size to 512M

Increase cma size to 512 for use 4k GL on tizen platform.

When using RPI4 1GB model + 4k UHD, reclaim occurs a lot and it is slow.

Change-Id: I672b5be8df8d51a47e50eea04e445529568474ff
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoRevert "brcmfmac: move configuration of probe request IEs" 81/240081/1 accepted/tizen/unified/20200803.122231 submit/tizen/20200803.071449
Jaehoon Chung [Mon, 3 Aug 2020 05:45:35 +0000 (14:45 +0900)]
Revert "brcmfmac: move configuration of probe request IEs"

This reverts commit bd99a3013bdc00f8fc7534c657b39616792b4467.

It doesn't find any p2p-device with wpa_supplicant on Tizen.
- After reverted this, it's working fine.

Change-Id: I5fa0924e888b91fef17ac3d174ee2a2e49d5e5a6
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM64: configs: tizen_bcm2711_defconfig: Disable unused dwcotg 42/239642/2 accepted/tizen/unified/20200730.063301 submit/tizen/20200729.105144
Seung-Woo Kim [Tue, 28 Jul 2020 09:40:06 +0000 (18:40 +0900)]
ARM64: configs: tizen_bcm2711_defconfig: Disable unused dwcotg

In rpi4, usb dwc2 is used for usb peripheral port. Disable unused
dwcotg driver.

Change-Id: I3488508db5925f28d95dc2687814f061f2430622
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Disable unused dwcotg 41/239641/1
Seung-Woo Kim [Tue, 28 Jul 2020 09:38:42 +0000 (18:38 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Disable unused dwcotg

In rpi4, usb dwc2 is used for usb peripheral port. Disable unused
dwcotg driver.

Change-Id: I89196a59929c1e5dedcf31dd81acaef3c07f2043
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agodrm/vc4: hdmi: Add pixel bvb clock control 08/239608/3
Hoegeun Kwon [Mon, 27 Jul 2020 12:37:18 +0000 (21:37 +0900)]
drm/vc4: hdmi: Add pixel bvb clock control

There is a problem that the output does not work at a resolution
exceeding FHD. To solve this, we need to adjust the bvb clock at a
resolution exceeding FHD.

Change-Id: I488cbf5c9ec90e6429833edd94f8fe7e5e57bfdf
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711: Add bvb clock for hdmi-pixel 07/239607/1
Hoegeun Kwon [Mon, 27 Jul 2020 12:36:02 +0000 (21:36 +0900)]
ARM: dts: bcm2711: Add bvb clock for hdmi-pixel

It is necessary to control the hdmi pixel bvb clock. Add bvb clock.

Change-Id: I8d8eedd31eb6b3ceabc5ef98c2312c28664f9046
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoclk: rpi: Add register to control pixel bvb clk 06/239606/1
Hoegeun Kwon [Mon, 27 Jul 2020 12:35:01 +0000 (21:35 +0900)]
clk: rpi: Add register to control pixel bvb clk

To use QHD or higher, we need to modify the pixel_bvb_clk value. So
add register to control this clock.

Change-Id: Ie6a37bba8b6872f8007ab20a370f268f3766711f
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoASoC: bcm2835: Silence clk_get() error on -EPROBE_DEFER 75/239575/1 accepted/tizen/unified/20200729.165701 submit/tizen/20200728.021629
Seung-Woo Kim [Fri, 24 Jul 2020 04:11:08 +0000 (13:11 +0900)]
ASoC: bcm2835: Silence clk_get() error on -EPROBE_DEFER

Silence clk_get() error with dev_dbg() on -EPROBE_DEFER.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[sw0312.kim: post on mainline, https://patchwork.kernel.org/patch/11687251/ and apply]

Change-Id: I770815bd80af8ee0fa856f14d5d075d9471208c7

3 years agospi: bcm2835: no dev_err() on clk_get() -EPROBE_DEFER 22/239322/2
Jim Quinlan [Mon, 16 Dec 2019 23:08:02 +0000 (18:08 -0500)]
spi: bcm2835: no dev_err() on clk_get() -EPROBE_DEFER

Use dev_dbg() on -EPROBE_DEFER and dev_err() on all
other errors.

Signed-off-by: Jim Quinlan <jquinlan@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Link: https://lore.kernel.org/r/20191216230802.45715-2-jquinlan@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[sw0312.kim: cherry-pick mainline commit f4dc4abdce4c to remove unnecessary message]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I43fda55a507e6f1371ed1fe33756d6fe823cfd2a

3 years agoARM: dts: bcm2711-rpi-4-b: add non-removable property about sd-card 90/239290/3
Jaehoon Chung [Thu, 23 Jul 2020 10:09:13 +0000 (19:09 +0900)]
ARM: dts: bcm2711-rpi-4-b: add non-removable property about sd-card

Add non-removable property about sd-card.
Tizen doesn't consider about booting to other device.
It can be assumed that SD-card is non-removable storage.
When broken-cd is enabled, it's always polling to check SD-card.
- Remove broken-cd property.

Change-Id: I269e39f708362e03f219632eba592701907b71aa
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agodrm/sched: Fix passing zero to 'PTR_ERR' warning v2 46/239246/1
Andrey Grodzovsky [Tue, 29 Oct 2019 15:03:05 +0000 (11:03 -0400)]
drm/sched:  Fix passing zero to 'PTR_ERR' warning v2

Fix a static code checker warning.

v2: Drop PTR_ERR_OR_ZERO.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
[hoegeun.kwon: backport mainline commit d7c5782acd35 drm/sched:  Fix passing zero to 'PTR_ERR' warning v2]
Change-Id: Idf3993133edb062275df2378ea69b2002667893e
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable Crypto extension configs 68/239168/2 accepted/tizen/unified/20200723.161052 submit/tizen/20200723.024017 submit/tizen/20200723.053744 submit/tizen/20200723.073657
Jaehoon Chung [Wed, 22 Jul 2020 08:16:16 +0000 (17:16 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable Crypto extension configs

Enable Crypto exntension configs.
- CONFIG_CRYPTO_SHA1_ARM_NEON
- CONFIG_CRYPTO_SHA2_ARM_CE

After enabled these configs, verity is used from "sha256-generic" to
"sha256-neon".

Change-Id: I0d8f6335e6ee678130ea1219f539148e99fc4ac6
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable FUSE_FS 65/239165/1
Seung-Woo Kim [Wed, 22 Jul 2020 08:15:09 +0000 (17:15 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable FUSE_FS

Tizen requires CONFIG_FUSE_FS for user space filesystem. Enable
the option.

Change-Id: I75e19bf429e0c551053f37a7c05d9907c9f957b6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Add cts, rts pin setting for bt uart 96/238296/1 accepted/tizen/unified/20200710.114018 submit/tizen/20200710.091035
Seung-Woo Kim [Fri, 10 Jul 2020 09:02:01 +0000 (18:02 +0900)]
ARM: dts: bcm2711-rpi-4-b: Add cts, rts pin setting for bt uart

For high speed uart on bluetooth, it needs to add cts & rts pins.
Add cts, rts pin setting for bluetooth uart.

Change-Id: Ib12ceab8edd682107c19c07d891fab5d1440e9be
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoBluetooth: hci_bcm: Drive RTS only for BCM43438
Stefan Wahren [Wed, 1 Jan 2020 14:01:34 +0000 (15:01 +0100)]
Bluetooth: hci_bcm: Drive RTS only for BCM43438

commit e601daed271e9eb1b923972a0a1af65f8c7bb77b upstream.

The commit 3347a80965b3 ("Bluetooth: hci_bcm: Fix RTS handling during
startup") is causing at least a regression for AP6256 on Orange Pi 3.
So do the RTS line handing during startup only on the necessary platform.

Fixes: 3347a80965b3 ("Bluetooth: hci_bcm: Fix RTS handling during startup")
Reported-by: Ondřej Jirman <megous@megous.com>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
3 years agoBluetooth: hci_bcm: Support pcm params in dts
Abhishek Pandit-Subedi [Tue, 26 Nov 2019 07:17:32 +0000 (08:17 +0100)]
Bluetooth: hci_bcm: Support pcm params in dts

commit eb762b94111b646b4f116ebfdbfcadbad14e12b3 upstream.

BCM chips may require configuration of PCM to operate correctly and
there is a vendor specific HCI command to do this. Add support in the
hci_bcm driver to parse this from devicetree and configure the chip.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
3 years agoBluetooth: btbcm: Support pcm configuration
Abhishek Pandit-Subedi [Tue, 26 Nov 2019 07:17:30 +0000 (08:17 +0100)]
Bluetooth: btbcm: Support pcm configuration

commit 528379902337102b0264fe5343eafb3d6c59fa45 upstream.

Add BCM vendor specific command to configure PCM parameters. The new
vendor opcode allows us to set the sco routing, the pcm interface rate,
and a few other pcm specific options (frame sync, sync mode, and clock
mode). See broadcom-bluetooth.txt in Documentation for more information
about valid values for those settings.

Here is an example trace where this opcode was used to configure
a BCM4354:

        < HCI Command: Vendor (0x3f|0x001c) plen 5
                01 02 00 01 01
        > HCI Event: Command Complete (0x0e) plen 4
        Vendor (0x3f|0x001c) ncmd 1
                Status: Success (0x00)

We can read back the values as well with ocf 0x001d to confirm the
values that were set:
        $ hcitool cmd 0x3f 0x001d
        < HCI Command: ogf 0x3f, ocf 0x001d, plen 0
        > HCI Event: 0x0e plen 9
        01 1D FC 00 01 02 00 01 01

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
3 years agoBluetooth: hci_bcm: Disallow set_baudrate for BCM4354
Abhishek Pandit-Subedi [Tue, 26 Nov 2019 07:17:29 +0000 (08:17 +0100)]
Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354

commit 5d6f391073d5c1c903ac12be72c66b96b2ae93f4 upstream.

Without updating the patchram, the BCM4354 does not support a higher
operating speed. The normal bcm_setup follows the correct order
(init_speed, patchram and then oper_speed) but the serdev driver will
set the operating speed before calling the hu->setup function. Thus,
for the BCM4354, don't set the operating speed before patchram.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
3 years agoBluetooth: btbcm: Add entry for BCM4335A0 UART bluetooth
Mohammad Rasim [Wed, 20 Nov 2019 11:02:35 +0000 (14:02 +0300)]
Bluetooth: btbcm: Add entry for BCM4335A0 UART bluetooth

commit 1199ab4c9e1d4cdfbabd70b4aadbc8e72c691f65 upstream.

This patch adds the device ID for the BCM4335A0 module
(part of the AMPAK AP6335 WIFI/Bluetooth combo)

hciconfig output:
```
hci1:   Type: Primary  Bus: UART
        BD Address: 43:35:B0:07:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:5079 acl:0 sco:0 events:567 errors:0
        TX bytes:69065 acl:0 sco:0 commands:567 errors:0
        Features: 0xbf 0xfe 0xcf 0xff 0xdf 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'alarm'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.0 (0x6)  Revision: 0x161
        LMP Version: 4.0 (0x6)  Subversion: 0x4106
        Manufacturer: Broadcom Corporation (15)
```

Signed-off-by: Mohammad Rasim <mohammad.rasim96@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
3 years agoBluetooth: hci_bcm: Add compatible string for BCM43540
Abhishek Pandit-Subedi [Fri, 25 Oct 2019 21:54:26 +0000 (14:54 -0700)]
Bluetooth: hci_bcm: Add compatible string for BCM43540

commit d462af20dbfa1b9b1a831412f32d9d6757b82459 upstream.

The BCM43540 chip is a 802.11 a/b/g/n/ac + Bluetooth 4.1 combo module.
This patch adds a compatible string match to the serdev driver for the
Bluetooth part of the chip.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
3 years agoBluetooth: hci_bcm: Fix RTS handling during startup
Stefan Wahren [Sun, 6 Oct 2019 15:28:19 +0000 (17:28 +0200)]
Bluetooth: hci_bcm: Fix RTS handling during startup

commit 3347a80965b38f096b1d6f995c00c9c9e53d4b8b upstream.

The RPi 4 uses the hardware handshake lines for CYW43455, but the chip
doesn't react to HCI requests during DT probe. The reason is the inproper
handling of the RTS line during startup. According to the startup
signaling sequence in the CYW43455 datasheet, the hosts RTS line must
be driven after BT_REG_ON and BT_HOST_WAKE.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
3 years agoRevert "ARM: dts: bcm2711-rpi-4-b: Add cts pin setting for bluetooth uart"
Seung-Woo Kim [Fri, 10 Jul 2020 07:56:20 +0000 (16:56 +0900)]
Revert "ARM: dts: bcm2711-rpi-4-b: Add cts pin setting for bluetooth uart"

This reverts commit 9e33125d91fdaf56aef72183f2481441ebbc0a78.

Now, bcm2711-rpi-4-b.dts has two uart0 nodes, and pinctrl-0
is override from the second uart0 node. So this change is
meanlingless, and it needs to be set from the second node.
So, revert this and new change will be applied.

Change-Id: Ibaa537851cf66fdd1843cf635e309d795cdbd441
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoconfigs: tizen_bcm2711: Enable memory cgroup swap controller 53/238253/2
Dongwoo Lee [Fri, 10 Jul 2020 03:53:26 +0000 (12:53 +0900)]
configs: tizen_bcm2711: Enable memory cgroup swap controller

To support resourced memory and swap module properly, this enables
CONFIG_MEMCG_SWAP.

Change-Id: I2a8836517b2aac66f03ebf9fba18e1de859c2371
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoconfigs: tizen_bcm2711: Sync up missing defconfig 52/238252/2
Dongwoo Lee [Fri, 10 Jul 2020 02:23:19 +0000 (11:23 +0900)]
configs: tizen_bcm2711: Sync up missing defconfig

This applies missing defconfig of rpi4 vendor kernel, which is
derived from commit dcf49c0dd76d ("configs: Switch to upstream thermal
sensor for RPi 4 - BCM2711_THERMAL").

Change-Id: I750ec00b69c9a318eb754437896daa6ea246a5a1
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoASoC: ac108: fix build warning about '-Wimplict-fallthrough' 21/238221/2
Jaehoon Chung [Thu, 9 Jul 2020 10:04:51 +0000 (19:04 +0900)]
ASoC: ac108: fix build warning about '-Wimplict-fallthrough'

Fix build warning about '-Wimplicit-fallthrough'.

In file included from ./include/linux/acpi.h:15,
                 from ./include/linux/i2c.h:13,
                 from sound/soc/codecs/ac108.c:21:
sound/soc/codecs/ac108.c: In function 'ac108_set_fmt':
./include/linux/device.h:1758:5: warning: this statement may fall through [-Wimplicit-fallthrough=]

Change-Id: I9f098eee46d2baa500ad2b7624cfff0ebbc81b40
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agopackaging: Change the kernel version of the spec file 75/237875/2 accepted/tizen/unified/20200709.164653 submit/tizen/20200708.060018 submit/tizen/20200709.003043
Hoegeun Kwon [Fri, 3 Jul 2020 05:27:18 +0000 (14:27 +0900)]
packaging: Change the kernel version of the spec file

Change the kernel version to 5.4.50

Change-Id: Id9272d7ce6366ee9e97fa9bc92109d510d0c089f
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agorpi4: boot: Update the firmwares for kernel v5.4.50 74/237874/2
Hoegeun Kwon [Fri, 3 Jul 2020 05:18:53 +0000 (14:18 +0900)]
rpi4: boot: Update the firmwares for kernel v5.4.50

Update the firmwares with the latest version from the vendor git repo.

The commit base is "66fc5eaac3d kernel: Bump to 5.4.50"

Change-Id: I7f4f70fefe1cc22a31539f19566c9bfed285bb52
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoRevert "cgroup: Disable cgroup "memory" by default"
Dongwoo Lee [Wed, 1 Jul 2020 09:27:33 +0000 (18:27 +0900)]
Revert "cgroup: Disable cgroup "memory" by default"

The feature is used for saving memory which is consumed by memcg-related
structure (32bytes per 4K page), but now it is no longer merged on the
latest raspberry pi kernel. So instead of enabling memory cgroup by
adding command to cmdline.txt while preserving this feature, in order to
enable memory cgroup by default, this reverts commit '35bbb61da9e2
("cgroup: Disable cgroup "memory" by default")'

Change-Id: I1830129125fb44b36bfe64f97fddf329ea795c3c
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM64: tizen_bcm2711_defconfig: Enable lz4 and zstd cryptos
Dongwoo Lee [Mon, 29 Jun 2020 09:21:05 +0000 (18:21 +0900)]
ARM64: tizen_bcm2711_defconfig: Enable lz4 and zstd cryptos

This enables lz4 and zstd crypto to enable compressor for zram

Change-Id: Id2ac2daa8e7e3e0b7526dedc53f175b83c4fb1eb
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Enable lz4 and zstd cryptos
Dongwoo Lee [Wed, 3 Jun 2020 02:07:09 +0000 (11:07 +0900)]
ARM: tizen_bcm2711_defconfig: Enable lz4 and zstd cryptos

This enables lz4 and zstd crypto to enable compressor for zram

Change-Id: I0a2f3af9e30693b6c0deebba5053b768bc1229fb
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agolib: zstd: Improve decode performance
Dongwoo Lee [Thu, 4 Jun 2020 04:54:44 +0000 (13:54 +0900)]
lib: zstd: Improve decode performance

To speed up decode performance, optimizations are brought from zstd
github repository and ported as kernel-style.

Since the low-level algorithm is preferred in linux due to
compression/decompression performance (default level 3), the
optimization for low-level is chosed as follows:

  [1] lib: zstd: Speed up single segment zstd_fast by 5%
      (https://github.com/facebook/zstd/pull/1562/commits/95624b77e477752b3c380c22be7bcf67f06c9934)
  [2] perf improvements for zstd decode
      (https://github.com/facebook/zstd/pull/1668/commits/29d1e81bbdfc21085529623e7bc5abcb3e1627ae)
  [3] updated double_fast complementary insertion
      (https://github.com/facebook/zstd/pull/1681/commits/d1327738c277643f09c972a407083ad73c8ecf7b)
  [4] Improvements in zstd decode performance
      (https://github.com/facebook/zstd/pull/1756/commits/b83059958246dfcb5b91af9c187fad8c706869a0)
  [5] Optimize decompression and fix wildcopy overread
      (https://github.com/facebook/zstd/pull/1804/commits/efd37a64eaff5a0a26ae2566fdb45dc4a0c91673)
  [6] Improve ZSTD_highbit32's codegen
      (https://github.com/facebook/zstd/commit/a07da7b0db682c170a330a8c21585be3d68275fa)
  [7] Optimize decompression speed for gcc and clang (#1892)
      (https://github.com/facebook/zstd/commit/718f00ff6fe42db7e6ba09a7f7992b3e85283f77)
  [8] Fix performance regression on aarch64 with clang
      (https://github.com/facebook/zstd/pull/1973/commits/cb2abc3dbe010113d9e00ca3b612bf61983145a2)

Change-Id: Ia2cf120879a415988dbbc2fce59a994915c8c77c
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoblock: zram: Add support for dynamic compressor switch
Dongwoo Lee [Thu, 4 Jun 2020 04:54:35 +0000 (13:54 +0900)]
block: zram: Add support for dynamic compressor switch

Orginally, the compression algorithm cannot be changed until
resetting it if zram is once initialized by setting disksize. Since
this, however, zram can have multiple compressor and switch them
dynamically.

With this, zram uses the algorithm which is fast but has low
compression ratio at first, and can change to the one that is slightly
slower but having higher ratio when the target get bothered by low
memory.

Change-Id: I3fd817e299a76284b8b28e318a4822107e6a5f6d
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agodrm/vc4: add extcon hdmi connection uevent
Seung-Woo Kim [Tue, 30 Jun 2020 05:32:02 +0000 (14:32 +0900)]
drm/vc4: add extcon hdmi connection uevent

Add extcon hdmi connection and disconnection uevent when extcon
module is enabled.

The vc4_hdmi detection is done by polling way, so extcon uevent
for connection is a bit slow after changing real hdmi cable state.

Change-Id: I962f7a39b7a3344f9793e436ef28c36b123571a8
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM64: configs: tizen_bcm2711: change BLK_DEV_RAM_SIZE to 32MB
Jaehoon Chung [Mon, 22 Jun 2020 07:03:28 +0000 (16:03 +0900)]
ARM64: configs: tizen_bcm2711: change BLK_DEV_RAM_SIZE to 32MB

Change BLK_DEV_RAM_SIZE from 12MB to 32MB.

Change-Id: Ifbdd9d5ac0ba36cb6ef65b96ac981b496573be6b
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: configs: tizen_bcm2711: change BLK_DEV_RAM_SIZE to 32MB
Jaehoon Chung [Mon, 22 Jun 2020 06:58:23 +0000 (15:58 +0900)]
ARM: configs: tizen_bcm2711: change BLK_DEV_RAM_SIZE to 32MB

Change BLK_DEV_RAM_SIZE from 12MB to 32MB.

Change-Id: I6004bc1f12cdcb3f8c4c3b86cc13c974b3880dba
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agousb: dwc_otg: Fix pointer-to-int-cast build warning
Hoegeun Kwon [Mon, 15 Jun 2020 08:30:12 +0000 (17:30 +0900)]
usb: dwc_otg: Fix pointer-to-int-cast build warning

Fix pointer to int cast build warning.
drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c:486:5: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     (int)dwc_otg_hcd->fiq_state->mphi_regs.base);

Change-Id: Ic495d320dbf41aaeeb77ed303fce8cc4cc121c67
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoscripts: mkbootimg_rpi4.sh: Fix how to check 64bit
Hoegeun Kwon [Mon, 15 Jun 2020 07:20:33 +0000 (16:20 +0900)]
scripts: mkbootimg_rpi4.sh: Fix how to check 64bit

The CONFIG_64BIT_TIME configuration is used by 32bit kernel, so it is
having problem identifying 64bit. So modify to "CONFIG_64BIT=y".

Change-Id: I0e8b3e34b3faf5f307ce9bc0fef266397ae697a7
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agotools: Add support build for arm64
Hoegeun Kwon [Wed, 10 Jun 2020 10:50:21 +0000 (19:50 +0900)]
tools: Add support build for arm64

Support kernel build for arm64

Change-Id: Id02cf2e57e4c8db134821a50aaaeed278d2407ae
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoscripts: mkbootimg_rpi4.sh: Add support make boot image for arm64
Hoegeun Kwon [Wed, 10 Jun 2020 11:04:00 +0000 (20:04 +0900)]
scripts: mkbootimg_rpi4.sh: Add support make boot image for arm64

Support make boot image for arm64.

Change-Id: I2cb18a0a383fff21c2f158473a51339b1867338a
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agousb: dwc2: gadget: do not reset during core phy init
Seung-Woo Kim [Tue, 9 Jun 2020 10:34:27 +0000 (19:34 +0900)]
usb: dwc2: gadget: do not reset during core phy init

After the commit 1e868545f2bb ("usb: dwc2: gadget: Move gadget phy
init into core phy init"), dwc2 gadget mode with f_fs enumeration
is blocked from recent host kernel. It is because, the commit adds
more usb reset for gadget case, so do not reset during core phy
init for gadget.

Change-Id: I389d56346430d5c27b775270a4cb05b608668c30
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agopackaging: add 64-bit kernel build
Seung-Woo Kim [Fri, 5 Jun 2020 10:37:35 +0000 (19:37 +0900)]
packaging: add 64-bit kernel build

Add 64-bit kernel build for rpi4.

Change-Id: Idd659915d838f6eb7bfebc5007a15d6fa142ad7a
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agorpi4: boot: Add 64-bit config.txt
Seung-Woo Kim [Fri, 5 Jun 2020 10:37:00 +0000 (19:37 +0900)]
rpi4: boot: Add 64-bit config.txt

Add 64-bit config.txt with booting u-boot.bin.

Change-Id: I14e8e76a4244106f71c6bb8e08bfeb5858cac2db
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM64: configs: tizen_bcm2711_defconfig: Enable tizen configs
Seung-Woo Kim [Fri, 5 Jun 2020 10:08:27 +0000 (19:08 +0900)]
ARM64: configs: tizen_bcm2711_defconfig: Enable tizen configs

Enable tizen configs comparing between bcm2711_defconfig and
tizen_bcm2711_defconfig from arch/arm/congifs/.

Change-Id: I8fc700809903c21e35573f9a93d171047ab17f83
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM64: configs: tizen_bcm2711_defconfig: create tizen config from rpi os config
Seung-Woo Kim [Mon, 8 Jun 2020 02:02:43 +0000 (11:02 +0900)]
ARM64: configs: tizen_bcm2711_defconfig: create tizen config from rpi os config

RPI4 has 64-bit build defconfig. Create base for tizen 64-bit rpi4
defconfig by copying from raspberry os kernel confg.

Note: copied defconfig based on commit 4bd3198f16b9 ("configs: Use the upstream cpufreq driver") of rpi-5.4.y

Change-Id: I2f774528b1ebd7edd8e126f38f4d3d4c1ad9e491
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Disable RAID6_PQ_BENCHMARK
Junghoon Kim [Mon, 20 Jan 2020 06:06:40 +0000 (15:06 +0900)]
ARM: tizen_bcm2711_defconfig: Disable RAID6_PQ_BENCHMARK

Skip the algorithm benchmarking process of RAID6. This is helpful for
systems where fast kernel startup is important. Also, The option is not
crucial for the rpi boards.

Change-Id: I68a9cc82b1320cb47442456f3f408cf7e8609c64
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Enable btrfs filesystem
Jaehoon Chung [Tue, 9 Jun 2020 11:15:33 +0000 (20:15 +0900)]
ARM: tizen_bcm2711_defconfig: Enable btrfs filesystem

Enable btrfs filesystem to use it as the rootfs mount for the RPI4 board.
- This patch is taken from tizen branch (commit 863df9285d98)

Change-Id: I0f81313e3318a4159b8646693845625313f50e30
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agodrm/vc4: Add gem_info node via debugfs
Hoegeun Kwon [Thu, 4 Jun 2020 09:04:31 +0000 (18:04 +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 common helpers for
debugfs.

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.

This patch referenced [1] and a modified debugfs interface was applied.
  [1] f7a145cb5173 drm/vc4: add gem_info node via debugfs

Change-Id: Ifbbf4c94ad1c54a682083ed7d30555d8b57164eb
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711: Remove audio-rx
Hoegeun Kwon [Wed, 20 May 2020 07:23:37 +0000 (16:23 +0900)]
ARM: dts: bcm2711: Remove audio-rx

The hdmi1 does not support rx line, remove the rx line.

Change-Id: I21df6ac42a2887ee5c60e345b267a5b905071410
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoASoC: dmaengine: Add check to dma_dev
Hoegeun Kwon [Wed, 20 May 2020 07:41:06 +0000 (16:41 +0900)]
ASoC: dmaengine: Add check to dma_dev

A segmentation fault occurs when dma_dev is null. Add error handling
for dma_dev.

Change-Id: Ie8fa0b355c92bf59b937e3a5a399f8b299f94c74
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoASoC: seeed-voicecard: Fix init and parse func
Hoegeun Kwon [Mon, 18 May 2020 07:59:35 +0000 (16:59 +0900)]
ASoC: seeed-voicecard: Fix init and parse func

When we rebase the kernel version to v5.x, the interface changed and
a build error occurred. Modify the interface for card init and parse.

This patch is already been reviewd from [1].

[1]
  "Commit: ASoC: ac108: Adds ac108 codec and machine code"
  "Change-Id: Idd1fd85a461c3f2ac03192ec49bf527601d797b7"

Change-Id: If6e460240cd750b8d56e9b7ec22be6e46162699a
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agopackaging: Add rsync build requires
Hoegeun Kwon [Thu, 14 May 2020 07:51:59 +0000 (16:51 +0900)]
packaging: Add rsync build requires

The rsync command is used at build time and needs to be added to the
build requires.

Change-Id: I6d513efbd19efbc036b2dba1182f04e69c18ef19
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agopackaging: Change the kernel version of the spec file
Hoegeun Kwon [Wed, 6 May 2020 07:52:20 +0000 (16:52 +0900)]
packaging: Change the kernel version of the spec file

Change the kernel version to 5.4.40

Change-Id: Ia3296fff4a63fc4fcfd089156859519203b03728
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agorpi4: boot: Update the firmwares for kernel v5.4.40
Hoegeun Kwon [Wed, 6 May 2020 01:54:06 +0000 (10:54 +0900)]
rpi4: boot: Update the firmwares for kernel v5.4.40

Update the firmwares with the latest version from the vendor git repo.

The commit base is "5cb5ddd076a kernel: Bump to 5.4.40"

Change-Id: Id8f4f1795f9bf0506dae2595ad42d2ca711ede55
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Fix increase default CMA to 256M
Marek Szyprowski [Fri, 24 Apr 2020 10:21:52 +0000 (12:21 +0200)]
ARM: dts: bcm2711-rpi-4-b: Fix increase default CMA to 256M

Increase cma size to 256 for use on tizen platform.

Change-Id: I78d6a8f2ac14e1a0d70cc2f8f0025ca721fc49a3
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agodrm: Fix let vc4 drm register before v3d.
Marek Szyprowski [Fri, 24 Apr 2020 10:21:34 +0000 (12:21 +0200)]
drm: Fix let vc4 drm register before v3d.

Fix to vc4 drm register before v3d drm because vc4 driver must be
registered first than v3d.

Change-Id: Ief1284ab0233e09ef8eeeaa6ce173feb66e29349
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Add support for drm vc4 and v3d
Marek Szyprowski [Fri, 24 Apr 2020 10:23:20 +0000 (12:23 +0200)]
ARM: dts: bcm2711-rpi-4-b: Add support for drm vc4 and v3d

Support for drm vc4 and v3d driver, apply vc4-kms-v3d-pi4 dt overlay.

Change-Id: Ic807bb5691d4f6f0c4e6c45926fa82313a4d5a7e
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Sync due to kernel version update
Hoegeun Kwon [Thu, 14 May 2020 05:48:03 +0000 (14:48 +0900)]
ARM: tizen_bcm2711_defconfig: Sync due to kernel version update

Sync due to kernel version update, to v5.4.y from v4.19.y.

Change-Id: Ice2aced5f29d855cf0699a3032c49e13062fd414
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoLOCAL / Revert "drm/vc4: Allocate binner bo when starting to use the V3D"
Hoegeun Kwon [Mon, 9 Dec 2019 06:25:22 +0000 (15:25 +0900)]
LOCAL / Revert "drm/vc4: Allocate binner bo when starting to use the V3D"

This reverts commit 35c8b4b2c0fed637d2b30a8ec8e5d7f4c19c8d9d.

If we use drm-vc4 and drm-v3d driver without using vc4->v3d driver,
drm-vc4 bo is not created. In this case, it is RPI4. The RPI4 uses
drm-v3d when using GL. So revert this patch until the problem is
resolved.

Change-Id: I64444811761212a2103d416a7376d4dc43e980df
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable CONFIG_CPUFREQ_DT config
Chanwoo Choi [Mon, 27 Apr 2020 01:35:06 +0000 (10:35 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable CONFIG_CPUFREQ_DT config

The cpufreq subsystem provides the generic cpufreq driver
based on device-tree, CONFIG_CPUFREQ_DT config. Enable CONFIG_CPUFREQ_DT
to support cpufreq driver instead of BCM legacy driver. By using
CONFIG_CPUFREQ_DT, be able to use the features provided by other linux kernel
framework like thermal. And control the fine-grained CPU frequency with 4 step
as following:

[Before available CPU frequencies]
600000
1500000

[After available CPU frequencies]
600000
700000
1000000
1500000

Change-Id: I3119b54d82822da9bbf0c2ddd6b2fbb17389b7cf
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoARM: configs tizen_bcm2711_defconfig: Enable CONFIG_SENSORS_RASPBERRYPI_HWMON
Chanwoo Choi [Wed, 22 Apr 2020 03:29:02 +0000 (12:29 +0900)]
ARM: configs tizen_bcm2711_defconfig: Enable CONFIG_SENSORS_RASPBERRYPI_HWMON

Enable CONFIG_SENSORS_RASPBERRYPI_HWMON in order to detect the under-voltage
situation. The hwmon voltage sensor check the voltage with 2 second period.

Change-Id: If0a8bb2aef5ac14a075af97592cb570bbab2f1df
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Enable CLK_RASPBERRYPI
Hoegeun Kwon [Thu, 2 Apr 2020 09:56:01 +0000 (18:56 +0900)]
ARM: tizen_bcm2711_defconfig: Enable CLK_RASPBERRYPI

The v3d clk part has been moved from clk-bcm2835 to clk-raspberrypi.
So we need to turn on CLK_RASPBERRYPI defconfig.

Change-Id: Iba6138f09c7ea2aca2c27f71829943355c0ac9f6
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agopackaging: Change the kernel version of the spec file
Junghoon Kim [Thu, 2 Apr 2020 05:49:13 +0000 (14:49 +0900)]
packaging: Change the kernel version of the spec file

Change the kernel version to 4.19.113.

Change-Id: I43bc5f71beeb5603db2baa7a58f2811fe4b4a177
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoconfigs: tizen_bcm2711_defconfig: Enable REGULATOR_FIXED_VOLTAGE option
Junghoon Kim [Thu, 2 Apr 2020 04:56:26 +0000 (13:56 +0900)]
configs: tizen_bcm2711_defconfig: Enable REGULATOR_FIXED_VOLTAGE option

Later revisions of the Raspberry Pi 4B have a separate control over the
SD card power and the related dts file declares it. To support this in
Tizen, enable a fixed voltage regulator option.

Change-Id: I446c0494b761b9ca70535b5713f4f4b431719cb1
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agorpi4: boot: Update the firmware with the latest version
Junghoon Kim [Thu, 2 Apr 2020 04:48:35 +0000 (13:48 +0900)]
rpi4: boot: Update the firmware with the latest version

Update the firmware with the latest version from the vendor git repo.
The firmware base matches the kernel version 4.19.113. The base commit
of vendor firmware is c2c6ce8d.

Change-Id: I6cf755ff35ece740384e6bfd2125bf53b63e82af
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: add a brcmf wifi node
Jaehoon Chung [Fri, 27 Mar 2020 09:15:53 +0000 (18:15 +0900)]
ARM: dts: bcm2711-rpi-4-b: add a brcmf wifi node

Add brcmf wifi node to use a below property.
- brcm,featuer-disable

"0x2000" is a bit to disable "sup_wpa" feature.
Tizen doesn't need to use this feature. So disable it by default.

Change-Id: I1ff34f88bbf9d8ac4aad54b6bd68eb4065757138
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agobrcmfamc: add the feature-disable property
Jaehoon Chung [Fri, 27 Mar 2020 09:07:28 +0000 (18:07 +0900)]
brcmfamc: add the feature-disable property

Add the feature-disable property.
It will be parsed when brcmfmac is probed.
If someone want to disable some features by default, it's possible to
use this property.

Change-Id: Id9062624d5bc87055295209a329a817103fd11f5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agopackaging: Remove bootcode.bin from the boot image
Junghoon Kim [Fri, 27 Mar 2020 06:49:54 +0000 (15:49 +0900)]
packaging: Remove bootcode.bin from the boot image

The RPI4 has an SPI-attached EEPROM, which contains code to boot up the
system and replaces bootcode.bin previously found in the boot partition
of the SD card. So, remove the unnecessary bootcode.bin from the rpi4
boot image.

Change-Id: I3a7a783ccdbf81e367eb8cbbd2ce49c248976385
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711: disable BCM2835_SDHOST
Jaehoon Chung [Tue, 24 Mar 2020 03:16:40 +0000 (12:16 +0900)]
ARM: configs: tizen_bcm2711: disable BCM2835_SDHOST

Disable BCM2835_SDHOST. It doesn't use anywhere.
To prevent confusion which mmc driver is used, disabled BCM2835_SDHOST.

Change-Id: I3c56c8290b6d52135a2cdecfdc45cbc4d4cb7639
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscripts: Make the kernel build and image creation in one step
Junghoon Kim [Thu, 12 Mar 2020 03:28:26 +0000 (12:28 +0900)]
scripts: Make the kernel build and image creation in one step

Add the image creation to the build script, in order to process two
separate steps at once. This makes it easier to test the built kernel
with the related kernel modules together on the rpi4 target.

Change-Id: I1ac78f109a35dff038855a16c62830a2cb083337
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agousb: dwc2: gadget: Expand buffer size of control endpoint
Dongwoo Lee [Fri, 6 Mar 2020 05:04:13 +0000 (14:04 +0900)]
usb: dwc2: gadget: Expand buffer size of control endpoint

We found the case that buffer of control endpoint, which was allocated
with 8 bytes previously, is corrupted when the host races for setting
up interfaces. Even worse, it overwrites memory for other structure
such as usb_request for control endpoint and it causes kernel panic.
Especially in Tizen, it often happens when the target is configured as
multi-functional device: sdb + mtp.

In our emprical examination the buffer can be corrupted upto size of
456 bytes. With this result, the size of buffer will be enlarged to
512 bytes to prevent kernel panic even if it happens.

Change-Id: I20eb1283f3c82e09453960b72787175f734e7ec4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agousb: dwc2: Defer forcing peripheral mode
Dongwoo Lee [Wed, 26 Feb 2020 10:39:04 +0000 (19:39 +0900)]
usb: dwc2: Defer forcing peripheral mode

dwc2 forces the mode as following dr_mode when it is finally
determined. In the case of peripheral mode, however, this causes the
notification to host without any preparation about gadget driver.
In host, hcd requests device descriptor for enumeration, but it does
never get response. See log below:

 usb 2-2: new high-speed USB device number 6 using xhci_hcd
 usb 2-2: device descriptor read/64, error -110
 usb 2-2: device descriptor read/64, error -110
 usb 2-2: new high-speed USB device number 7 using xhci_hcd
 usb 2-2: device descriptor read/64, error -110
 usb 2-2: device descriptor read/64, error -110
 usb usb2-port2: attempt power cycle
 usb 2-2: new high-speed USB device number 8 using xhci_hcd
 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
 usb 2-2: device not accepting address 8, error -62
 usb 2-2: new high-speed USB device number 9 using xhci_hcd
 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
 xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
 usb 2-2: device not accepting address 9, error -62
 usb usb2-port2: unable to enumerate USB device

Even worse, all ports on host can get disabled at least xhci case in
this situation. To prevent this, forcing peripheral mode will be
defered until the gadget driver is prepared.

Change-Id: Ifa0ffe7f28f32fd595c6c2ca54918667b34b95fb
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM: configs: tizen_bcm2711_boot_defconfig: config for RPi4 bootloader
Łukasz Stelmach [Wed, 26 Feb 2020 12:00:08 +0000 (13:00 +0100)]
ARM: configs: tizen_bcm2711_boot_defconfig: config for RPi4 bootloader

Change-Id: I11b7d169060ae86066a9853d02549440a5c8ae80
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
3 years agousb: gadget: f_fs: Give chance to retry malloc for large size buffer
Dongwoo Lee [Fri, 26 Oct 2018 01:41:41 +0000 (10:41 +0900)]
usb: gadget: f_fs: Give chance to retry malloc for large size buffer

The f_fs daemons usually use large size buffer for increasing transfer
performance, but it can cause memory allocation failure in case of
that buddy space is fragmented. Since this, instead of just returning
error in this case, give the chance to retry to allocate memory with
a half length in order to prevent daemon crash due to failure of
buffer allocation.

Change-Id: I2171932b8cb565102d63eb82c114987b85d26ed9
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agousb: dwc2: gadget: set the quirk_ep_out_alinged_size as true
Jaehoon Chung [Mon, 22 Oct 2018 04:44:11 +0000 (13:44 +0900)]
usb: dwc2: gadget: set the quirk_ep_out_alinged_size as true

Set the quirk_ep_out_aligned_size as true.
This patch is fixed about occurring kernel panic after failed memory
allocation.

Change-Id: Iafb6ccaa6f7d7dac4eb0593291166ab13cd8256d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[dwoo08.lee: bring commit from linux-artik7 of public tizen repository]
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Set extcon state for dwc2 cable as always true
Dongwoo Lee [Tue, 18 Feb 2020 05:23:00 +0000 (14:23 +0900)]
ARM: dts: bcm2711-rpi-4-b: Set extcon state for dwc2 cable as always true

Since this, extcon state for dwc2 udc becomes always 'USB=1'.

Change-Id: Ic76b6fbab2068861c374162461382ca223798d3d
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable extcon feature
Dongwoo Lee [Tue, 18 Feb 2020 08:11:43 +0000 (17:11 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable extcon feature

To support external connection notification, enable extcon feature.

Change-Id: I178f414b85a054d73ff9fda6346fce9c36c5e6df
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agousb: dwc2: gadget: Set extcon state for usb cable as always true
Dongwoo Lee [Tue, 18 Feb 2020 04:36:40 +0000 (13:36 +0900)]
usb: dwc2: gadget: Set extcon state for usb cable as always true

To inform to userspace as enable usb features always, set extcon
state for usb cable as connected permanently. To enable this, add
"g-extcon-always-on" property on dt.

Change-Id: I5bcc1b7560278dab8bde6fc80549bc145179574c
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Disable CONFIG_CFG80211_CRDA_SUPPORT
Chanwoo Choi [Fri, 14 Feb 2020 07:15:38 +0000 (16:15 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Disable CONFIG_CFG80211_CRDA_SUPPORT

If CONFIG_CFG80211_CRDA_SUPPORT is enabled, kernel has been sending
the uevent until setting the regulatory domain from userspace.
But RPI4 doesn't use CRDA (Central Regulatory Domain Agent)
for wireless device. In result, CONFIG_CFG80211_CRDA_SUPPORT makes
the unneeded uevent. So that disable CONFIG_CFG80211_CRDA_SUPPORT
for removing the unuseful uevent.

Change-Id: I3ea8369ba97c9804a99bdf27f008ba4664469286
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Use schedutil as default governor
Chanwoo Choi [Thu, 6 Feb 2020 02:03:57 +0000 (11:03 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Use schedutil as default governor

In order to improve the CPU performance, use schedutil cpufreq governor
as the default governor instead of powersave governor.

RPI4 supports only two CPU frequencies of 600MHz and 1500MHz.
After changed the default governor, can check the usage information
of two frequencies by schedutil governor.

[Example]
$ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
600000 4347
1500000 2146

Change-Id: Id2e82dbbefbd4753bc6a0689d089427ee03ece97
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Add support backlight
Hoegeun Kwon [Thu, 6 Feb 2020 05:28:11 +0000 (14:28 +0900)]
ARM: dts: bcm2711-rpi-4-b: Add support backlight

Add DTs to support the official RPI touchscreen backlight.

Change-Id: I8bc242124575dc4c57b0d71e68415fd3485799a0
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agopackaging: Add kernel-headers package
Seung-Woo Kim [Thu, 6 Feb 2020 01:36:50 +0000 (10:36 +0900)]
packaging: Add kernel-headers package

For device related developement, user needs device kernel headers
package. Add kernel-headers package for rpi4.

Change-Id: I7970e02f2b10cae31e1d8899f460fc15a8bdf496
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Disable RAID6_PQ_BENCHMARK
Junghoon Kim [Mon, 20 Jan 2020 06:06:40 +0000 (15:06 +0900)]
ARM: tizen_bcm2711_defconfig: Disable RAID6_PQ_BENCHMARK

Skip the algorithm benchmarking process of RAID6. This is helpful for
systems where fast kernel startup is important. Also, The option is not
crucial for the rpi boards.

Change-Id: I68a9cc82b1320cb47442456f3f408cf7e8609c64
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable missing NETFILTER options for nether
Seung-Woo Kim [Mon, 6 Jan 2020 08:10:27 +0000 (17:10 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable missing NETFILTER options for nether

To properly support nether rules, netfilter options are required
including udplite, raw, mangle and others. Enable the missing
NETFILTER options for nether.

Ref: nether rule in https://git.tizen.org/cgit/platform/core/security/nether/tree/conf/nether.rules?h=tizen

Change-Id: I99eaa86a00b5cc79ba07b88988a81a6b37b2f663
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable USB SERIAL drivers for modem
Seung-Woo Kim [Mon, 6 Jan 2020 01:39:15 +0000 (10:39 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable USB SERIAL drivers for modem

To support usb modem dongle and related devices, enable USB SERIAL
drivers and ppp network interface to support the modem.

Change-Id: I755504aabd4fbcb2d6de5ec71274209c8f092ed2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: tizen_bcm2711_defconfig: Make USB configfs as built-in
Dongwoo Lee [Wed, 18 Dec 2019 03:59:21 +0000 (12:59 +0900)]
ARM: tizen_bcm2711_defconfig: Make USB configfs as built-in

To utilize USB-C port as USB peripheral mode, this patch enables
configfs and related functions including f_fs, f_acm, and f_rndis.

Change-Id: Ib60e4566470bbbfd2ef95a7f19cbc6e280bfff3e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable tethering config options
Seung-Woo Kim [Fri, 20 Dec 2019 06:30:13 +0000 (15:30 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable tethering config options

In Tizen 6.0, network framework supports tethering from ethernet
to wifi. Enable required config options for tethering.

Ref: section 6-3 of https://git.tizen.org/cgit/platform/kernel/tizen-kernel-configs/tree/tizen/tizen_defconfig?h=tizen

Change-Id: I162d6eb89ce8d25d85659c7a2e632dbfe0909dc6
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable NETFILTER_XT_MATCH_LIMIT
Seung-Woo Kim [Fri, 20 Dec 2019 07:13:36 +0000 (16:13 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable NETFILTER_XT_MATCH_LIMIT

From Tizen network security, NETFILTER_XT_MATCH_LIMIT is used for
ipv6. So enable NETFILTER_XT_MATCH_LIMIT config option.

Change-Id: Ife75ee0a766c64fb38a0e261f41a45678ab49bd4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: configs: tizen_bcm2711_defconfig: Enable HID_MULTITOUCH
Seung-Woo Kim [Fri, 20 Dec 2019 07:08:28 +0000 (16:08 +0900)]
ARM: configs: tizen_bcm2711_defconfig: Enable HID_MULTITOUCH

To support usb multi-touch device, enable CONFIG_HID_MULTITOUCH.

Change-Id: Icafd08ffa00f7c399f7fe4040551c83184c50a75
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
3 years agoARM: config: tizen_bcm2711: Enable config relevant to DM-verity
Jaehoon Chung [Wed, 18 Dec 2019 23:42:11 +0000 (08:42 +0900)]
ARM: config: tizen_bcm2711: Enable config relevant to DM-verity

Enable config relevant to DM-verity by default.
It doesn't affect anything until control dm-verity on System side.

Change-Id: Ia1121b170c12748ed09797188c8bb166a6efec2c
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoscripts: mkbootimg_rpi4.sh: Create boot tarball for the lthor flashing
Junghoon Kim [Mon, 9 Dec 2019 07:22:54 +0000 (16:22 +0900)]
scripts: mkbootimg_rpi4.sh: Create boot tarball for the lthor flashing

This patch is to create boot tarball for the lthor flashing. With this,
we can easily test the rpi4 kernel in the local environment.

Change-Id: I33413d641a18122612d23f3f110b7eed0997c2ea
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agostaging: android: logger: Replace current_kernel_time() interface
Junghoon Kim [Wed, 4 Dec 2019 01:44:36 +0000 (10:44 +0900)]
staging: android: logger: Replace current_kernel_time() interface

The current_kernel_time() interface is deprecated. It can be replaced by
getnstimeofday() function.

Change-Id: Ib614ac1eac803ae9922ae7dfdd8e854e9ad28670
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
3 years agoscripts: mkbootimg_rpi4.sh: Remove cmdline.txt
Hoegeun Kwon [Mon, 2 Dec 2019 00:50:36 +0000 (09:50 +0900)]
scripts: mkbootimg_rpi4.sh: Remove cmdline.txt

The cmdline.txt file is unnecessary so remove it in the script also
delete real file.

Change-Id: Ia02af211e9e46df1de413c3c9724cc54d82fcd10
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoscripts: mkbootimg_rpi4.sh: Add u-boot-rpi4 package to boot image
Hoegeun Kwon [Mon, 2 Dec 2019 00:46:43 +0000 (09:46 +0900)]
scripts: mkbootimg_rpi4.sh: Add u-boot-rpi4 package to boot image

Add u-boot-rpi4 package to boot.img for u-boot boot

Change-Id: Iba486d729b5aa6c8a570db2b0854c922b5b909f6
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Add support for touchscreen touch
Hoegeun Kwon [Wed, 27 Nov 2019 07:41:21 +0000 (16:41 +0900)]
ARM: dts: bcm2711-rpi-4-b: Add support for touchscreen touch

Add dts to support the official RPI touchscreen LCD.

Change-Id: I78baf521954a3929dd17f29bac9a2a34c66e71ff
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
3 years agoARM: dts: bcm2711-rpi-4-b: Add cts pin setting for bluetooth uart
Jaehoon Chung [Tue, 26 Nov 2019 08:06:28 +0000 (17:06 +0900)]
ARM: dts: bcm2711-rpi-4-b: Add cts pin setting for bluetooth uart

This patch is referred to bcm2710-rpi-3-b-plus.dts.

The below is its commit-msg:
There is missing cts pin for uart0 used by bluetooth. Add the cts pin
setting as like bcm2837-rpi-3-b-plus.

Change-Id: I3e206b00145c24ddc86ad9dc57bef6f683622285
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agorpi4: boot: Enable u-boot booting
Hoegeun Kwon [Fri, 8 Nov 2019 01:53:40 +0000 (10:53 +0900)]
rpi4: boot: Enable u-boot booting

Use u-boot for booting, enable u-boot.

Change-Id: I0c82be9e06b3d74a091f730ee3339a50582debe8
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>