From 66bac57d67baf023707dd73dad53ecd09107046e Mon Sep 17 00:00:00 2001 From: Dongwoo Lee Date: Fri, 10 Jul 2020 11:23:19 +0900 Subject: [PATCH 01/16] 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 --- arch/arm/configs/tizen_bcm2711_defconfig | 2 +- arch/arm64/configs/tizen_bcm2711_defconfig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/tizen_bcm2711_defconfig b/arch/arm/configs/tizen_bcm2711_defconfig index 1196a00..f1ba746 100644 --- a/arch/arm/configs/tizen_bcm2711_defconfig +++ b/arch/arm/configs/tizen_bcm2711_defconfig @@ -302,8 +302,8 @@ CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y CONFIG_SENSORS_RASPBERRYPI_HWMON=y CONFIG_THERMAL=y +CONFIG_BCM2711_THERMAL=y CONFIG_BCM2835_THERMAL=y -CONFIG_BRCMSTB_THERMAL=y CONFIG_WATCHDOG=y CONFIG_GPIO_WATCHDOG=m CONFIG_BCM2835_WDT=y diff --git a/arch/arm64/configs/tizen_bcm2711_defconfig b/arch/arm64/configs/tizen_bcm2711_defconfig index c36f499..b29301f 100644 --- a/arch/arm64/configs/tizen_bcm2711_defconfig +++ b/arch/arm64/configs/tizen_bcm2711_defconfig @@ -290,13 +290,14 @@ CONFIG_GPIO_BCM_VIRT=y CONFIG_GPIO_STMPE=y CONFIG_POWER_RESET_GPIO=y CONFIG_THERMAL=y +CONFIG_BCM2711_THERMAL=y CONFIG_BCM2835_THERMAL=y -CONFIG_BRCMSTB_THERMAL=y CONFIG_WATCHDOG=y CONFIG_GPIO_WATCHDOG=m CONFIG_BCM2835_WDT=y CONFIG_MFD_STMPE=y CONFIG_STMPE_SPI=y +CONFIG_MFD_SYSCON=y CONFIG_MFD_WL1273_CORE=m CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y -- 2.7.4 From 694c1e32ba2c49f4250aab6dced08ba56ab2992d Mon Sep 17 00:00:00 2001 From: Dongwoo Lee Date: Fri, 10 Jul 2020 12:53:26 +0900 Subject: [PATCH 02/16] 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 --- arch/arm/configs/tizen_bcm2711_defconfig | 1 + arch/arm64/configs/tizen_bcm2711_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/tizen_bcm2711_defconfig b/arch/arm/configs/tizen_bcm2711_defconfig index f1ba746..679d619 100644 --- a/arch/arm/configs/tizen_bcm2711_defconfig +++ b/arch/arm/configs/tizen_bcm2711_defconfig @@ -14,6 +14,7 @@ CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y CONFIG_BLK_CGROUP=y CONFIG_CGROUP_FREEZER=y CONFIG_CPUSETS=y diff --git a/arch/arm64/configs/tizen_bcm2711_defconfig b/arch/arm64/configs/tizen_bcm2711_defconfig index b29301f..1f4c5c1 100644 --- a/arch/arm64/configs/tizen_bcm2711_defconfig +++ b/arch/arm64/configs/tizen_bcm2711_defconfig @@ -14,6 +14,7 @@ CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y CONFIG_MEMCG=y +CONFIG_MEMCG_SWAP=y CONFIG_BLK_CGROUP=y CONFIG_CGROUP_FREEZER=y CONFIG_CPUSETS=y -- 2.7.4 From 516b62429927c91e883e9505133015196f5f41ad Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Jul 2020 16:56:20 +0900 Subject: [PATCH 03/16] 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 --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index 03870c3..e806aca 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -163,7 +163,7 @@ /* uart0 communicates with the BT module */ &uart0 { pinctrl-names = "default"; - pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_pins &bt_pins>; + pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>; uart-has-rtscts; status = "okay"; -- 2.7.4 From 8807148678f136ad66f64c8ee5099a1f81fa5a72 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 6 Oct 2019 17:28:19 +0200 Subject: [PATCH 04/16] 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 Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_bcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 94ed734..f204ae6 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -448,9 +448,11 @@ static int bcm_open(struct hci_uart *hu) out: if (bcm->dev) { + hci_uart_set_flow_control(hu, true); hu->init_speed = bcm->dev->init_speed; hu->oper_speed = bcm->dev->oper_speed; err = bcm_gpio_set_power(bcm->dev, true); + hci_uart_set_flow_control(hu, false); if (err) goto err_unset_hu; } -- 2.7.4 From 47d916938a7184ae00cc279b25422795c47d9893 Mon Sep 17 00:00:00 2001 From: Abhishek Pandit-Subedi Date: Fri, 25 Oct 2019 14:54:26 -0700 Subject: [PATCH 05/16] 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 Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_bcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index f204ae6..3194389 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1427,6 +1427,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm4345c5" }, { .compatible = "brcm,bcm4330-bt" }, { .compatible = "brcm,bcm43438-bt" }, + { .compatible = "brcm,bcm43540-bt" }, { }, }; MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match); -- 2.7.4 From 2ca2595bc08d89542fe3dc49c0fa6526017976f7 Mon Sep 17 00:00:00 2001 From: Mohammad Rasim Date: Wed, 20 Nov 2019 14:02:35 +0300 Subject: [PATCH 06/16] 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 Signed-off-by: Marcel Holtmann --- drivers/bluetooth/btbcm.c | 1 + drivers/bluetooth/hci_bcm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index dd29d68..15b7caf 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -340,6 +340,7 @@ static const struct bcm_subver_table bcm_uart_subver_table[] = { { 0x220e, "BCM20702A1" }, /* 001.002.014 */ { 0x4217, "BCM4329B1" }, /* 002.002.023 */ { 0x6106, "BCM4359C0" }, /* 003.001.006 */ + { 0x4106, "BCM4335A0" }, /* 002.001.006 */ { } }; diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 3194389..d5b6467b0 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1428,6 +1428,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm4330-bt" }, { .compatible = "brcm,bcm43438-bt" }, { .compatible = "brcm,bcm43540-bt" }, + { .compatible = "brcm,bcm4335a0" }, { }, }; MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match); -- 2.7.4 From 07bd7ab686f5032f237e1504126a95789826af7b Mon Sep 17 00:00:00 2001 From: Abhishek Pandit-Subedi Date: Tue, 26 Nov 2019 08:17:29 +0100 Subject: [PATCH 07/16] 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 Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- drivers/bluetooth/hci_bcm.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index d5b6467b0..84a32c5 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -48,6 +48,14 @@ #define BCM_NUM_SUPPLIES 2 /** + * struct bcm_device_data - device specific data + * @no_early_set_baudrate: Disallow set baudrate before driver setup() + */ +struct bcm_device_data { + bool no_early_set_baudrate; +}; + +/** * struct bcm_device - device driver resources * @serdev_hu: HCI UART controller struct * @list: bcm_device_list node @@ -79,6 +87,7 @@ * @hu: pointer to HCI UART controller struct, * used to disable flow control during runtime suspend and system sleep * @is_suspended: whether flow control is currently disabled + * @no_early_set_baudrate: don't set_baudrate before setup() */ struct bcm_device { /* Must be the first member, hci_serdev.c expects this. */ @@ -113,6 +122,7 @@ struct bcm_device { struct hci_uart *hu; bool is_suspended; #endif + bool no_early_set_baudrate; }; /* generic bcm uart resources */ @@ -450,7 +460,13 @@ out: if (bcm->dev) { hci_uart_set_flow_control(hu, true); hu->init_speed = bcm->dev->init_speed; - hu->oper_speed = bcm->dev->oper_speed; + + /* If oper_speed is set, ldisc/serdev will set the baudrate + * before calling setup() + */ + if (!bcm->dev->no_early_set_baudrate) + hu->oper_speed = bcm->dev->oper_speed; + err = bcm_gpio_set_power(bcm->dev, true); hci_uart_set_flow_control(hu, false); if (err) @@ -568,6 +584,8 @@ static int bcm_setup(struct hci_uart *hu) /* Operational speed if any */ if (hu->oper_speed) speed = hu->oper_speed; + else if (bcm->dev && bcm->dev->oper_speed) + speed = bcm->dev->oper_speed; else if (hu->proto->oper_speed) speed = hu->proto->oper_speed; else @@ -1377,6 +1395,7 @@ static struct platform_driver bcm_driver = { static int bcm_serdev_probe(struct serdev_device *serdev) { struct bcm_device *bcmdev; + const struct bcm_device_data *data; int err; bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); @@ -1411,6 +1430,10 @@ static int bcm_serdev_probe(struct serdev_device *serdev) if (err) dev_err(&serdev->dev, "Failed to power down\n"); + data = device_get_match_data(bcmdev->dev); + if (data) + bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; + return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto); } @@ -1422,12 +1445,16 @@ static void bcm_serdev_remove(struct serdev_device *serdev) } #ifdef CONFIG_OF +static struct bcm_device_data bcm4354_device_data = { + .no_early_set_baudrate = true, +}; + static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm20702a1" }, { .compatible = "brcm,bcm4345c5" }, { .compatible = "brcm,bcm4330-bt" }, { .compatible = "brcm,bcm43438-bt" }, - { .compatible = "brcm,bcm43540-bt" }, + { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data }, { .compatible = "brcm,bcm4335a0" }, { }, }; -- 2.7.4 From ee02e9fc57a1b624f59d18cdf7ef9e729c479789 Mon Sep 17 00:00:00 2001 From: Abhishek Pandit-Subedi Date: Tue, 26 Nov 2019 08:17:30 +0100 Subject: [PATCH 08/16] 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 Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- drivers/bluetooth/btbcm.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/bluetooth/btbcm.h | 16 ++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 15b7caf..5b0f8a0 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -105,6 +105,52 @@ int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) } EXPORT_SYMBOL_GPL(btbcm_set_bdaddr); +int btbcm_read_pcm_int_params(struct hci_dev *hdev, + struct bcm_set_pcm_int_params *params) +{ + struct sk_buff *skb; + int err = 0; + + skb = __hci_cmd_sync(hdev, 0xfc1d, 0, NULL, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "BCM: Read PCM int params failed (%d)", err); + return err; + } + + if (skb->len != 6 || skb->data[0]) { + bt_dev_err(hdev, "BCM: Read PCM int params length mismatch"); + kfree_skb(skb); + return -EIO; + } + + if (params) + memcpy(params, skb->data + 1, 5); + + kfree_skb(skb); + + return 0; +} +EXPORT_SYMBOL_GPL(btbcm_read_pcm_int_params); + +int btbcm_write_pcm_int_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *params) +{ + struct sk_buff *skb; + int err; + + skb = __hci_cmd_sync(hdev, 0xfc1c, 5, params, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "BCM: Write PCM int params failed (%d)", err); + return err; + } + kfree_skb(skb); + + return 0; +} +EXPORT_SYMBOL_GPL(btbcm_write_pcm_int_params); + int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) { const struct hci_command_hdr *cmd; diff --git a/drivers/bluetooth/btbcm.h b/drivers/bluetooth/btbcm.h index d204be8..3c7dd07 100644 --- a/drivers/bluetooth/btbcm.h +++ b/drivers/bluetooth/btbcm.h @@ -54,6 +54,10 @@ struct bcm_set_pcm_format_params { int btbcm_check_bdaddr(struct hci_dev *hdev); int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw); +int btbcm_read_pcm_int_params(struct hci_dev *hdev, + struct bcm_set_pcm_int_params *params); +int btbcm_write_pcm_int_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *params); int btbcm_setup_patchram(struct hci_dev *hdev); int btbcm_setup_apple(struct hci_dev *hdev); @@ -74,6 +78,18 @@ static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) return -EOPNOTSUPP; } +int btbcm_read_pcm_int_params(struct hci_dev *hdev, + struct bcm_set_pcm_int_params *params) +{ + return -EOPNOTSUPP; +} + +int btbcm_write_pcm_int_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *params) +{ + return -EOPNOTSUPP; +} + static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) { return -EOPNOTSUPP; -- 2.7.4 From 6fb4edf5fa05aac1baf03d285da34de217ce3069 Mon Sep 17 00:00:00 2001 From: Abhishek Pandit-Subedi Date: Tue, 26 Nov 2019 08:17:32 +0100 Subject: [PATCH 09/16] 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 Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- drivers/bluetooth/hci_bcm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 84a32c5..4f21b60 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -123,6 +123,7 @@ struct bcm_device { bool is_suspended; #endif bool no_early_set_baudrate; + u8 pcm_int_params[5]; }; /* generic bcm uart resources */ @@ -597,6 +598,16 @@ static int bcm_setup(struct hci_uart *hu) host_set_baudrate(hu, speed); } + /* PCM parameters if provided */ + if (bcm->dev && bcm->dev->pcm_int_params[0] != 0xff) { + struct bcm_set_pcm_int_params params; + + btbcm_read_pcm_int_params(hu->hdev, ¶ms); + + memcpy(¶ms, bcm->dev->pcm_int_params, 5); + btbcm_write_pcm_int_params(hu->hdev, ¶ms); + } + finalize: release_firmware(fw); @@ -1134,6 +1145,8 @@ static int bcm_acpi_probe(struct bcm_device *dev) static int bcm_of_probe(struct bcm_device *bdev) { device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); + device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", + bdev->pcm_int_params, 5); return 0; } @@ -1149,6 +1162,9 @@ static int bcm_probe(struct platform_device *pdev) dev->dev = &pdev->dev; dev->irq = platform_get_irq(pdev, 0); + /* Initialize routing field to an unused value */ + dev->pcm_int_params[0] = 0xff; + if (has_acpi_companion(&pdev->dev)) { ret = bcm_acpi_probe(dev); if (ret) @@ -1409,6 +1425,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev) bcmdev->serdev_hu.serdev = serdev; serdev_device_set_drvdata(serdev, bcmdev); + /* Initialize routing field to an unused value */ + bcmdev->pcm_int_params[0] = 0xff; + if (has_acpi_companion(&serdev->dev)) err = bcm_acpi_probe(bcmdev); else -- 2.7.4 From 7068c047c91015620466b98d8333d79c2befe070 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Wed, 1 Jan 2020 15:01:34 +0100 Subject: [PATCH 10/16] Bluetooth: hci_bcm: Drive RTS only for BCM43438 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Stefan Wahren Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_bcm.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 4f21b60..de05b14 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -53,6 +53,7 @@ */ struct bcm_device_data { bool no_early_set_baudrate; + bool drive_rts_on_open; }; /** @@ -123,6 +124,7 @@ struct bcm_device { bool is_suspended; #endif bool no_early_set_baudrate; + bool drive_rts_on_open; u8 pcm_int_params[5]; }; @@ -459,7 +461,9 @@ static int bcm_open(struct hci_uart *hu) out: if (bcm->dev) { - hci_uart_set_flow_control(hu, true); + if (bcm->dev->drive_rts_on_open) + hci_uart_set_flow_control(hu, true); + hu->init_speed = bcm->dev->init_speed; /* If oper_speed is set, ldisc/serdev will set the baudrate @@ -469,7 +473,10 @@ out: hu->oper_speed = bcm->dev->oper_speed; err = bcm_gpio_set_power(bcm->dev, true); - hci_uart_set_flow_control(hu, false); + + if (bcm->dev->drive_rts_on_open) + hci_uart_set_flow_control(hu, false); + if (err) goto err_unset_hu; } @@ -1450,8 +1457,10 @@ static int bcm_serdev_probe(struct serdev_device *serdev) dev_err(&serdev->dev, "Failed to power down\n"); data = device_get_match_data(bcmdev->dev); - if (data) + if (data) { bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; + bcmdev->drive_rts_on_open = data->drive_rts_on_open; + } return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto); } @@ -1468,11 +1477,15 @@ static struct bcm_device_data bcm4354_device_data = { .no_early_set_baudrate = true, }; +static struct bcm_device_data bcm43438_device_data = { + .drive_rts_on_open = true, +}; + static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm20702a1" }, { .compatible = "brcm,bcm4345c5" }, { .compatible = "brcm,bcm4330-bt" }, - { .compatible = "brcm,bcm43438-bt" }, + { .compatible = "brcm,bcm43438-bt", .data = &bcm43438_device_data }, { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data }, { .compatible = "brcm,bcm4335a0" }, { }, -- 2.7.4 From f1bcdb25f262bdf2428bb42c9fa1c5a41021559d Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Jul 2020 18:02:01 +0900 Subject: [PATCH 11/16] 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 --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index e806aca..043eda0 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -303,7 +303,7 @@ }; &uart0 { - pinctrl-0 = <&uart0_pins &bt_pins>; + pinctrl-0 = <&uart0_pins &bt_pins &uart0_ctsrts_gpio30>; status = "okay"; }; -- 2.7.4 From 3b742d8107d6cc3308d5704f111f39a201e4f387 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 22 Jul 2020 17:15:09 +0900 Subject: [PATCH 12/16] 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 --- arch/arm/configs/tizen_bcm2711_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/tizen_bcm2711_defconfig b/arch/arm/configs/tizen_bcm2711_defconfig index 679d619..aa2d982 100644 --- a/arch/arm/configs/tizen_bcm2711_defconfig +++ b/arch/arm/configs/tizen_bcm2711_defconfig @@ -438,6 +438,7 @@ CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_F2FS_FS=y CONFIG_FANOTIFY=y CONFIG_AUTOFS4_FS=y +CONFIG_FUSE_FS=y CONFIG_FSCACHE=y CONFIG_FSCACHE_STATS=y CONFIG_FSCACHE_HISTOGRAM=y -- 2.7.4 From a9f8f393b616940faf190f0402f15814d53a6471 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 22 Jul 2020 17:16:16 +0900 Subject: [PATCH 13/16] 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 --- arch/arm/configs/tizen_bcm2711_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/tizen_bcm2711_defconfig b/arch/arm/configs/tizen_bcm2711_defconfig index aa2d982..9b21d75 100644 --- a/arch/arm/configs/tizen_bcm2711_defconfig +++ b/arch/arm/configs/tizen_bcm2711_defconfig @@ -58,6 +58,8 @@ CONFIG_KERNEL_MODE_NEON=y CONFIG_PM=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_ARM_CRYPTO=y +CONFIG_CRYPTO_SHA1_ARM_NEON=y +CONFIG_CRYPTO_SHA2_ARM_CE=y CONFIG_CRYPTO_AES_ARM_BS=y CONFIG_KPROBES=y CONFIG_JUMP_LABEL=y -- 2.7.4 From b2200f9e2b97c575ec73c2dd813e53a210cb8f07 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 29 Oct 2019 11:03:05 -0400 Subject: [PATCH 14/16] drm/sched: Fix passing zero to 'PTR_ERR' warning v2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix a static code checker warning. v2: Drop PTR_ERR_OR_ZERO. Signed-off-by: Andrey Grodzovsky Reviewed-by: Emily Deng Reviewed-by: Christian König Signed-off-by: Alex Deucher [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 Signed-off-by: Hoegeun Kwon --- drivers/gpu/drm/scheduler/sched_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index dfb29e6..30c5ddd 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -496,8 +496,10 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched) fence = sched->ops->run_job(s_job); if (IS_ERR_OR_NULL(fence)) { + if (IS_ERR(fence)) + dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); + s_job->s_fence->parent = NULL; - dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); } else { s_job->s_fence->parent = fence; } @@ -748,8 +750,9 @@ static int drm_sched_main(void *param) r); dma_fence_put(fence); } else { + if (IS_ERR(fence)) + dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); - dma_fence_set_error(&s_fence->finished, PTR_ERR(fence)); drm_sched_process_job(NULL, &sched_job->cb); } -- 2.7.4 From 947484396a7b693e9d1d9da08b7d908147032e18 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 23 Jul 2020 19:09:13 +0900 Subject: [PATCH 15/16] 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 --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index 043eda0..3edc927 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -281,7 +281,6 @@ clocks = <&clocks BCM2711_CLOCK_EMMC2>; reg = <0x0 0x7e340000 0x100>; vqmmc-supply = <&sd_io_1v8_reg>; - broken-cd; }; }; @@ -592,6 +591,7 @@ &emmc2 { vmmc-supply = <&sd_vcc_reg>; + non-removable; }; &phy1 { -- 2.7.4 From 7910ee05e9639da886002cfc93a5513c3b568db8 Mon Sep 17 00:00:00 2001 From: Jim Quinlan Date: Mon, 16 Dec 2019 18:08:02 -0500 Subject: [PATCH 16/16] 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 Reviewed-by: Florian Fainelli Reviewed-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20191216230802.45715-2-jquinlan@broadcom.com Signed-off-by: Mark Brown [sw0312.kim: cherry-pick mainline commit f4dc4abdce4c to remove unnecessary message] Signed-off-by: Seung-Woo Kim Change-Id: I43fda55a507e6f1371ed1fe33756d6fe823cfd2a --- drivers/spi/spi-bcm2835.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 6899558..6afb653 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1309,7 +1309,10 @@ static int bcm2835_spi_probe(struct platform_device *pdev) bs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(bs->clk)) { err = PTR_ERR(bs->clk); - dev_err(&pdev->dev, "could not get clk: %d\n", err); + if (err == -EPROBE_DEFER) + dev_dbg(&pdev->dev, "could not get clk: %d\n", err); + else + dev_err(&pdev->dev, "could not get clk: %d\n", err); goto out_controller_put; } -- 2.7.4