Skip to contentSkip to conversation

add support for videostrong KII Pro

RFC PATCH Superseded Mohammad Rasim 3 participants 7 messages Nov 15, 2019 – Nov 18, 2019

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover add support for videostrong KII Pro

Mohammad Rasim (2):
Add entry for BCM4335A0 UART bluetooth
Add support for Videostrong KII Pro tv box

 arch/arm64/boot/dts/amlogic/Makefile          |  1 +
 .../boot/dts/amlogic/meson-gxbb-KII-Pro.dts   | 25 +++++++++++++++++++
 drivers/bluetooth/btbcm.c                     |  1 +
 drivers/bluetooth/hci_bcm.c                   |  1 +
 4 files changed, 28 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts
Signature · 7 lines
2.23.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#1 lore raw

RFC PATCH 1/2 Add entry for BCM4335A0 UART bluetooth

---
 drivers/bluetooth/btbcm.c   | 1 +
 drivers/bluetooth/hci_bcm.c | 1 +
 2 files changed, 2 insertions(+)
drivers/bluetooth/btbcm.c +1 -0
index 2d2e6d862068..22464bf8cda3 100644
@@ -339,6 +339,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 */
 	{ }
 };
 
drivers/bluetooth/hci_bcm.c +1 -0
index 7646636f2d18..7b4bb5dbea1d 100644
@@ -1422,6 +1422,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = {
 	{ .compatible = "brcm,bcm4345c5" },
 	{ .compatible = "brcm,bcm4330-bt" },
 	{ .compatible = "brcm,bcm43438-bt" },
+	{ .compatible = "brcm,bcm4335A0" },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);
Signature · 1 line
2.23.0
#2 lore raw

Re: [RFC PATCH 1/2] Add entry for BCM4335A0 UART bluetooth

Am 15.11.19 um 17:50 schrieb Mohammad Rasim:

Quoted 1 line

Lacking a commit description. Please add a sentence.

Quoted 10 lines
---
 drivers/bluetooth/btbcm.c   | 1 +
 drivers/bluetooth/hci_bcm.c | 1 +
 2 files changed, 2 insertions(+)
drivers/bluetooth/btbcm.c +0 -0
index 2d2e6d862068..22464bf8cda3 100644

drivers/bluetooth/btbcm.c static const struct bcm_subver_table bcm_uart_subver_table[] = { · line 344

Quoted 6 lines
drivers/bluetooth/btbcm.c +1 -0
@@ -339,6 +339,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 */
 	{ }
 };

Beyond this patch: There appears to be no order in this table at all? Not alphabetically, not numerically, not by comment.

drivers/bluetooth/hci_bcm.c static const struct of_device_id bcm_bluetooth_of_match[] = { · line 1425

Quoted 10 lines
drivers/bluetooth/hci_bcm.c +1 -0
index 7646636f2d18..7b4bb5dbea1d 100644
@@ -1422,6 +1422,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = {
 	{ .compatible = "brcm,bcm4345c5" },
 	{ .compatible = "brcm,bcm4330-bt" },
 	{ .compatible = "brcm,bcm43438-bt" },
+	{ .compatible = "brcm,bcm4335A0" },

You can't use compatible strings without defining the binding first. Why do you need it? If you do, use lowercase names.

drivers/bluetooth/hci_bcm.c static const struct of_device_id bcm_bluetooth_of_match[] = { · line 1428

Quoted 3 lines
drivers/bluetooth/hci_bcm.c +0 -0
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#3 lore raw

Re: [RFC PATCH 1/2] Add entry for BCM4335A0 UART bluetooth

Quoted 26 lines · Andreas Färber

Am 15.11.19 um 17:50 schrieb Mohammad Rasim:

Quoted 1 line

Lacking a commit description. Please add a sentence.

Quoted 10 lines
---
 drivers/bluetooth/btbcm.c   | 1 +
 drivers/bluetooth/hci_bcm.c | 1 +
 2 files changed, 2 insertions(+)
drivers/bluetooth/btbcm.c +0 -0
index 2d2e6d862068..22464bf8cda3 100644

drivers/bluetooth/btbcm.c static const struct bcm_subver_table bcm_uart_subver_table[] = { · line 344

Quoted 6 lines
drivers/bluetooth/btbcm.c +1 -0
@@ -339,6 +339,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 */
 	{ }
 };

Beyond this patch: There appears to be no order in this table at all? Not alphabetically, not numerically, not by comment.

Quoted 1 line
Quoted 13 lines

drivers/bluetooth/hci_bcm.c static const struct of_device_id bcm_bluetooth_of_match[] = { · line 1425

Quoted 9 lines
drivers/bluetooth/hci_bcm.c +1 -0
index 7646636f2d18..7b4bb5dbea1d 100644
@@ -1422,6 +1422,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = {
 	{ .compatible = "brcm,bcm4345c5" },
 	{ .compatible = "brcm,bcm4330-bt" },
 	{ .compatible = "brcm,bcm43438-bt" },
+	{ .compatible = "brcm,bcm4335A0" },

You can't use compatible strings without defining the binding first. Why do you need it? If you do, use lowercase names.

I don't really need it per se, I can use any compatible (i've used bcm43438-bt before) but I thought I'd add a compatible so that the device dts can describe the exact model of the module, if that is ok I will update the broadcom-bluetooth.txt binding in the next version

Quoted 12 lines

drivers/bluetooth/hci_bcm.c static const struct of_device_id bcm_bluetooth_of_match[] = { · line 1428

Quoted 3 lines
drivers/bluetooth/hci_bcm.c +0 -0
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#4 lore raw

RFC PATCH 2/2 Add support for Videostrong KII Pro tv box

In reply to Mohammad Rasim

This patch adds support for the Videostrong KII Pro tv box which is based on the gxbb-p201 reference design

---
 arch/arm64/boot/dts/amlogic/Makefile          |  1 +
 .../boot/dts/amlogic/meson-gxbb-KII-Pro.dts   | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts
arch/arm64/boot/dts/amlogic/Makefile +1 -0
index 84afecba9ec0..1d72e93691f2 100644
@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-odroidc2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-p200.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-p201.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-KII-Pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-meta.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-telos.dtb
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +25 -0
new file mode 100644
index 000000000000..e79d75bfa8dd
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ */
+
+/dts-v1/;
+
+#include "meson-gxbb-p201.dts"
+
+/ {
+	compatible = "Videostrong,KII-Pro","amlogic,p201", "amlogic,s905", "amlogic,meson-gxbb";
+	model = "Videostrong KII Pro";
+
+
+};
+
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+	bluetooth {
+		compatible = "brcm,bcm4335A0";
+		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+	};
+};
Signature · 1 line
2.23.0
#5 lore raw

Re: [RFC PATCH 2/2] Add support for Videostrong KII Pro tv box

Am 15.11.19 um 17:50 schrieb Mohammad Rasim:

Quoted 14 lines

This patch adds support for the Videostrong KII Pro tv box which is based on the gxbb-p201 reference design

---
 arch/arm64/boot/dts/amlogic/Makefile          |  1 +
 .../boot/dts/amlogic/meson-gxbb-KII-Pro.dts   | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts
arch/arm64/boot/dts/amlogic/Makefile +0 -0
index 84afecba9ec0..1d72e93691f2 100644

arch/arm64/boot/dts/amlogic/Makefile dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb · line 14

Quoted 4 lines
arch/arm64/boot/dts/amlogic/Makefile +1 -0
@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-nexbox-a95x.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-odroidc2.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-p200.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-p201.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-KII-Pro.dtb

Lowercase: -kii-pro.dtb
And please sort alphabetically.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 3

Quoted 12 lines
arch/arm64/boot/dts/amlogic/Makefile +0 -0
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-meta.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxbb-vega-s95-telos.dtb
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +3 -0
new file mode 100644
index 000000000000..e79d75bfa8dd
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ */

What is this? :) You may want to add a copyright here.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 7

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +4 -0
+
+/dts-v1/;
+
+#include "meson-gxbb-p201.dts"

This is rather unusual, normally you would include the SoC's .dtsi, not another board.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 10

Quoted 3 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +3 -0
+
+/ {
+	compatible = "Videostrong,KII-Pro","amlogic,p201", "amlogic,s905", "amlogic,meson-gxbb";

This is not a valid vendor prefix (undefined, should be lowercase), same for the compatible string, which should be lowercase as all others.

Please run ./scripts/checkpatch.pl, which would warn you of such issues.

Also a space missing after comma.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 11

Quoted 1 line
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +1 -0
+	model = "Videostrong KII Pro";

Here you can spell it the original way, like you did.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 20

Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +9 -0
+
+
+};
+
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;

Leave an empty line here for spacing.

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 25

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +5 -0
+	bluetooth {
+		compatible = "brcm,bcm4335A0";
+		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+	};
+};

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#6 lore raw

Re: [RFC PATCH 2/2] Add support for Videostrong KII Pro tv box

Hi Mohammad,

On Sat, Nov 16, 2019 at 10:53 AM Andreas Färber <[email protected]> wrote:
[...]

Quoted 7 lines

arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts line 7

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-KII-Pro.dts new file +4 -0
+
+/dts-v1/;
+
+#include "meson-gxbb-p201.dts"

This is rather unusual, normally you would include the SoC's .dtsi, not another board.

you may even get another benefit from this:
we don't know the Ethernet PHY setup on the P201 board (because nobody has an actual P201 board) so we don't use interrupts etc.

however, since you do have a access to your KII Pro you can do better than P201 and define the Ethernet bits similar to Odroid-C2 for
example: [0]
if you board doesn't use a Realtek RTL8211F PHY then please also update the comment in the Ethmac node
testing the PHY interrupt (which means less polling -> your CPU has more time to do other things) is easy:
* cat /proc/interrupts
* unplug and re-plug the Ethernet cable
* cat /proc/interrupts again and check the Ethernet PHY interrupt (should be +2 compared to the first invocation)

Martin

[0] https://github.com/torvalds/linux/blob/f9717178b9be9477877d4c3776c61ff56d854ddf/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts#L122