Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
On Thu, Aug 25, 2016 at 10:12:35PM +0800, Icenowy Zheng wrote: > >> But many codes will require a ttyS0 as console... So I think the > >> bluetooth should be located at ttyS1... > > > > Most of them would use /dev/console anyway. What do you have in mind? > > As a general configuration, /dev/ttyS0 will be indicated as the default > console= > value... (Otherwise more boards will fail) There's no reason to make that assumption. The console might be on another UART entirely (ttyS3, for the sake of the argument), on a different UART "class" (ttyUSB?, framebuffer console?), or not present at all. If you want to use the console, use /dev/console. I don't what's so special about the UART here. Every single device in Linux behaves that way. Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
On Thu, Aug 25, 2016 at 10:12:35PM +0800, Icenowy Zheng wrote: > >> But many codes will require a ttyS0 as console... So I think the > >> bluetooth should be located at ttyS1... > > > > Most of them would use /dev/console anyway. What do you have in mind? > > As a general configuration, /dev/ttyS0 will be indicated as the default > console= > value... (Otherwise more boards will fail) There's no reason to make that assumption. The console might be on another UART entirely (ttyS3, for the sake of the argument), on a different UART "class" (ttyUSB?, framebuffer console?), or not present at all. If you want to use the console, use /dev/console. I don't what's so special about the UART here. Every single device in Linux behaves that way. Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
HI, On 25-08-16 16:53, Icenowy Zheng wrote: 25.08.2016, 22:18, "Hans de Goede": Hi, On 25-08-16 16:12, Icenowy Zheng wrote: 25.08.2016, 16:03, "Maxime Ripard" : Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts index 78823d8..3ac22d4 100644 --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts @@ -48,6 +48,10 @@ model = "INet-D978 Rev 02"; compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; + aliases { + serial1 = + }; + >>> >>> Is there any other UART in the system? >> >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > If your board does not have r_uart pads, then the right thing to do > would be to disable it. You can then have uart1 as serial0. I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with MMC) Then you don't support it and you need to disable it. But many codes will require a ttyS0 as console... So I think the bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? As a general configuration, /dev/ttyS0 will be indicated as the default console= value... (Otherwise more boards will fail) Or maybe we can specify uart0 as serial0, and leave it as disabled? (Thus if the debug port is needed, we can easily apply a overlay with status as disabled, and status as okay) On all my A33 boards, the official boot0, u-boot all uses uart0 as debugging port. If no uart is available (and being muxed with the mmc counts as not being available) then you should not have any serial alias in the dts. In u-boot you need to use: # CONFIG_REQUIRE_SERIAL_CONSOLE is not set In the defconfig in this case, otherwise u-boot is going to be unhappy about not having a serial console. It's not the problem. Can I have no ttyS0 and just make bluetooth ttyS1? Ah, yes having a serial1 alias should do that I believe and I agree that it is probably better to not use ttyS0 for the bluetooth uart. Regards, Hans
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
HI, On 25-08-16 16:53, Icenowy Zheng wrote: 25.08.2016, 22:18, "Hans de Goede" : Hi, On 25-08-16 16:12, Icenowy Zheng wrote: 25.08.2016, 16:03, "Maxime Ripard" : Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts index 78823d8..3ac22d4 100644 --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts @@ -48,6 +48,10 @@ model = "INet-D978 Rev 02"; compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; + aliases { + serial1 = + }; + >>> >>> Is there any other UART in the system? >> >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > If your board does not have r_uart pads, then the right thing to do > would be to disable it. You can then have uart1 as serial0. I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with MMC) Then you don't support it and you need to disable it. But many codes will require a ttyS0 as console... So I think the bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? As a general configuration, /dev/ttyS0 will be indicated as the default console= value... (Otherwise more boards will fail) Or maybe we can specify uart0 as serial0, and leave it as disabled? (Thus if the debug port is needed, we can easily apply a overlay with status as disabled, and status as okay) On all my A33 boards, the official boot0, u-boot all uses uart0 as debugging port. If no uart is available (and being muxed with the mmc counts as not being available) then you should not have any serial alias in the dts. In u-boot you need to use: # CONFIG_REQUIRE_SERIAL_CONSOLE is not set In the defconfig in this case, otherwise u-boot is going to be unhappy about not having a serial console. It's not the problem. Can I have no ttyS0 and just make bluetooth ttyS1? Ah, yes having a serial1 alias should do that I believe and I agree that it is probably better to not use ttyS0 for the bluetooth uart. Regards, Hans
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On 25-08-16 16:12, Icenowy Zheng wrote: 25.08.2016, 16:03, "Maxime Ripard": Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts index 78823d8..3ac22d4 100644 --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts @@ -48,6 +48,10 @@ model = "INet-D978 Rev 02"; compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; + aliases { + serial1 = + }; + >>> >>> Is there any other UART in the system? >> >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > If your board does not have r_uart pads, then the right thing to do > would be to disable it. You can then have uart1 as serial0. I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with MMC) Then you don't support it and you need to disable it. But many codes will require a ttyS0 as console... So I think the bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? As a general configuration, /dev/ttyS0 will be indicated as the default console= value... (Otherwise more boards will fail) Or maybe we can specify uart0 as serial0, and leave it as disabled? (Thus if the debug port is needed, we can easily apply a overlay with status as disabled, and status as okay) On all my A33 boards, the official boot0, u-boot all uses uart0 as debugging port. If no uart is available (and being muxed with the mmc counts as not being available) then you should not have any serial alias in the dts. In u-boot you need to use: # CONFIG_REQUIRE_SERIAL_CONSOLE is not set In the defconfig in this case, otherwise u-boot is going to be unhappy about not having a serial console. Regards, Hans
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On 25-08-16 16:12, Icenowy Zheng wrote: 25.08.2016, 16:03, "Maxime Ripard" : Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts index 78823d8..3ac22d4 100644 --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts @@ -48,6 +48,10 @@ model = "INet-D978 Rev 02"; compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; + aliases { + serial1 = + }; + >>> >>> Is there any other UART in the system? >> >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > If your board does not have r_uart pads, then the right thing to do > would be to disable it. You can then have uart1 as serial0. I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with MMC) Then you don't support it and you need to disable it. But many codes will require a ttyS0 as console... So I think the bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? As a general configuration, /dev/ttyS0 will be indicated as the default console= value... (Otherwise more boards will fail) Or maybe we can specify uart0 as serial0, and leave it as disabled? (Thus if the debug port is needed, we can easily apply a overlay with status as disabled, and status as okay) On all my A33 boards, the official boot0, u-boot all uses uart0 as debugging port. If no uart is available (and being muxed with the mmc counts as not being available) then you should not have any serial alias in the dts. In u-boot you need to use: # CONFIG_REQUIRE_SERIAL_CONSOLE is not set In the defconfig in this case, otherwise u-boot is going to be unhappy about not having a serial console. Regards, Hans
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: > diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > index 78823d8..3ac22d4 100644 > --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > @@ -48,6 +48,10 @@ > model = "INet-D978 Rev 02"; > compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; > > + aliases { > + serial1 = > + }; > + > >>> > >>> Is there any other UART in the system? > >> > >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > > > If your board does not have r_uart pads, then the right thing to do > > would be to disable it. You can then have uart1 as serial0. > > I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with > MMC) Then you don't support it and you need to disable it. > But many codes will require a ttyS0 as console... So I think the > bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On Thu, Aug 25, 2016 at 02:57:24PM +0800, Icenowy Zheng wrote: > diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > index 78823d8..3ac22d4 100644 > --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > @@ -48,6 +48,10 @@ > model = "INet-D978 Rev 02"; > compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; > > + aliases { > + serial1 = > + }; > + > >>> > >>> Is there any other UART in the system? > >> > >> serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. > > > > If your board does not have r_uart pads, then the right thing to do > > would be to disable it. You can then have uart1 as serial0. > > I don't know it. The RX/TX is wired on PF2/PF4 on the board (UART0 muxed with > MMC) Then you don't support it and you need to disable it. > But many codes will require a ttyS0 as console... So I think the > bluetooth should be located at ttyS1... Most of them would use /dev/console anyway. What do you have in mind? Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
On Thu, Aug 25, 2016 at 7:58 AM, Icenowy Zhengwrote: > > > 25.08.2016, 03:36, "Maxime Ripard" : >> Hi, >> >> On Tue, Aug 23, 2016 at 02:44:51PM +0800, Icenowy Zheng wrote: >>> UART1 is connected to the bluetooth part of RTL8723BS WiFi/BT combo card >>> on iNet D978 Rev2 board. >>> >>> Enable the UART1 to make it possible to use the modified hciattach by >>> Realtek to drive the BT part of RTL8723BS. >>> >>> Signed-off-by: Icenowy Zheng >> >> I guess you could fold that patch into the previous one. >> >>> --- >>> arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts | 11 +++ >>> 1 file changed, 11 insertions(+) >>> >>> diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> index 78823d8..3ac22d4 100644 >>> --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> @@ -48,6 +48,10 @@ >>> model = "INet-D978 Rev 02"; >>> compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; >>> >>> + aliases { >>> + serial1 = >>> + }; >>> + >> >> Is there any other UART in the system? > > serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. If your board does not have r_uart pads, then the right thing to do would be to disable it. You can then have uart1 as serial0. AFAIK Linux requires a console, but that console can be simplefb. ChenYu >> >> The alias is not supposed to be about the controller index, but the >> index in the board, meaning that if you only have a single UART, that >> would be serial0. >> >> Thanks! >> Maxime >> >> -- >> Maxime Ripard, Free Electrons >> Embedded Linux and Kernel engineering >> http://free-electrons.com
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
On Thu, Aug 25, 2016 at 7:58 AM, Icenowy Zheng wrote: > > > 25.08.2016, 03:36, "Maxime Ripard" : >> Hi, >> >> On Tue, Aug 23, 2016 at 02:44:51PM +0800, Icenowy Zheng wrote: >>> UART1 is connected to the bluetooth part of RTL8723BS WiFi/BT combo card >>> on iNet D978 Rev2 board. >>> >>> Enable the UART1 to make it possible to use the modified hciattach by >>> Realtek to drive the BT part of RTL8723BS. >>> >>> Signed-off-by: Icenowy Zheng >> >> I guess you could fold that patch into the previous one. >> >>> --- >>> arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts | 11 +++ >>> 1 file changed, 11 insertions(+) >>> >>> diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> index 78823d8..3ac22d4 100644 >>> --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts >>> @@ -48,6 +48,10 @@ >>> model = "INet-D978 Rev 02"; >>> compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; >>> >>> + aliases { >>> + serial1 = >>> + }; >>> + >> >> Is there any other UART in the system? > > serial0 is defined in sun8i-reference-design-tablet.dtsi, as r_uart. If your board does not have r_uart pads, then the right thing to do would be to disable it. You can then have uart1 as serial0. AFAIK Linux requires a console, but that console can be simplefb. ChenYu >> >> The alias is not supposed to be about the controller index, but the >> index in the board, meaning that if you only have a single UART, that >> would be serial0. >> >> Thanks! >> Maxime >> >> -- >> Maxime Ripard, Free Electrons >> Embedded Linux and Kernel engineering >> http://free-electrons.com
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On Tue, Aug 23, 2016 at 02:44:51PM +0800, Icenowy Zheng wrote: > UART1 is connected to the bluetooth part of RTL8723BS WiFi/BT combo card > on iNet D978 Rev2 board. > > Enable the UART1 to make it possible to use the modified hciattach by > Realtek to drive the BT part of RTL8723BS. > > Signed-off-by: Icenowy ZhengI guess you could fold that patch into the previous one. > --- > arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > index 78823d8..3ac22d4 100644 > --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > @@ -48,6 +48,10 @@ > model = "INet-D978 Rev 02"; > compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; > > + aliases { > + serial1 = > + }; > + Is there any other UART in the system? The alias is not supposed to be about the controller index, but the index in the board, meaning that if you only have a single UART, that would be serial0. Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature
Re: [PATCH 2/2] ARM: dts: sun8i: enable UART1 for iNet D978 Rev2 board
Hi, On Tue, Aug 23, 2016 at 02:44:51PM +0800, Icenowy Zheng wrote: > UART1 is connected to the bluetooth part of RTL8723BS WiFi/BT combo card > on iNet D978 Rev2 board. > > Enable the UART1 to make it possible to use the modified hciattach by > Realtek to drive the BT part of RTL8723BS. > > Signed-off-by: Icenowy Zheng I guess you could fold that patch into the previous one. > --- > arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > index 78823d8..3ac22d4 100644 > --- a/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > +++ b/arch/arm/boot/dts/sun8i-a33-inet-d978-rev2.dts > @@ -48,6 +48,10 @@ > model = "INet-D978 Rev 02"; > compatible = "primux,inet-d978-rev2", "allwinner,sun8i-a33"; > > + aliases { > + serial1 = > + }; > + Is there any other UART in the system? The alias is not supposed to be about the controller index, but the index in the board, meaning that if you only have a single UART, that would be serial0. Thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com signature.asc Description: PGP signature