Pine64-LTS and UART ports

Kaya Saman kayasaman at optiplex-networks.com
Mon Jul 8 15:09:41 UTC 2019


On 6/27/19 2:13 AM, Kaya Saman wrote:
>
> On 6/25/19 4:24 PM, Kaya Saman wrote:
>>
>> On 6/25/19 7:27 AM, Emmanuel Vadot wrote:
>>> On Mon, 24 Jun 2019 22:14:15 +0100
>>> Kaya Saman <kayasaman at optiplex-networks.com> wrote:
>>>
>>>> On 6/24/19 10:02 PM, Sergey Manucharian wrote:
>>>>> Excerpts from Kaya Saman's message from Mon 24-Jun-19 21:58:
>>>>> [snip]
>>>   DTS and DTSO needs to be pre-processed by cpp as they use #include
>>> directives, you can have a look at sys/tools/fdt/make_dtb.sh and
>>> make_dtbo.sh
>>>   If you modify the DTS simply running make buildkernel will compile 
>>> the
>>> new one, just make sure to put it on the FAT32 partition in
>>> dts/allwinner as we need it loaded by u-boot and it can't read ufs.
>>>
>>
>> Thanks Emmanuel!
>>
>>
>> I ran: make  -j4 buildkernel KERNCONF=PPSGENERIC
>>
>>
>> Then installed with: make installkernel KERNCONF=PPSGENERIC
>>
>>
>> The sun50i-a64-pine64.dts has the modification already suggested:
>>
>>
>> /* On Pi-2 connector */
>> &uart2 {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&uart2_pins>;
>>         status = "okay";
>> };
>>
>>
>> Running: ls -l /boot/dtb/allwinner/
>> total 140
>> -r--r--r--  1 root  wheel  19976 Jun 25 16:11 sun50i-a64-nanopi-a64.dtb
>> -r--r--r--  1 root  wheel  20528 Jun 25 16:11 sun50i-a64-olinuxino.dtb
>> -r--r--r--  1 root  wheel  20677 Jun 25 16:11 sun50i-a64-pine64-plus.dtb
>> -r--r--r--  1 root  wheel  20603 Jun 25 16:11 sun50i-a64-pine64.dtb
>> -r--r--r--  1 root  wheel  20585 Jun 25 16:11 
>> sun50i-a64-sopine-baseboard.dtb
>> -r--r--r--  1 root  wheel  23227 Jun 25 16:11 sun50i-h5-orangepi-pc2.dtb
>>
>>
>> The dtb files have been created and installed by the 'installkernel' 
>> command.
>>
>>
>> Unfortunately though nothing shows up in dmesg or /dev again outside 
>> of the standard uart0?
>>
>>
>> dmesg |grep uart
>> uart0: <16750 or compatible> mem 0x1c28000-0x1c283ff irq 23 on 
>> simplebus0
>> uart0: console (115384,n,8,1)
>>
>>
>> Is there an additional step which needs to be done to get this to work?
>>
>>
>> Regards,
>>
>>
>> Kaya
>
>
> I found the FAT32 partition that Emmanuel mentioned:
>
> " just make sure to put it on the FAT32 partition in
> dts/allwinner as we need it loaded by u-boot and it can't read ufs."
>
>
> So after copying the overlays and allwinner files to 
> /boot/msdos/dtb/overlays and /boot/msdos/dtb/allwinner I have at least 
> some error messages:
>
>
> Booting [/boot/kernel/kernel]...
> Using DTB provided by EFI at 0x47ef8000.
> Loading DTB overlays: 
> 'sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-uart2,sun50i-a64-uart4'
> /boot/dtb/overlays/sun50i-a64-sid.dtbo size=0x1fd
> /boot/dtb/overlays/sun50i-a64-ths.dtbo size=0x3e8
> /boot/dtb/overlays/sun50i-a64-timer.dtbo size=0x175
> /boot/dtb/overlays/sun50i-a64-uart2.dtbo size=0x123
> /boot/dtb/overlays/sun50i-a64-uart4.dtbo size=0x123
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-sid.dtbo'
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-ths.dtbo'
> failed to apply overlay: FDT_ERR_NOTFOUND
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-timer.dtbo'
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-uart2.dtbo'
> failed to apply overlay: FDT_ERR_NOTFOUND
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-uart4.dtbo'
> failed to apply overlay: FDT_ERR_NOTFOUND
> EHCI failed to shut down host controller.
> ---<<BOOT>>---
>
>
>
> The file list:
>
>
> ls -l  /boot/msdos/dtb/allwinner
> total 140
> -rwxr-xr-x  1 root  wheel  19976 Dec  7  2018 sun50i-a64-nanopi-a64.dtb
> -rwxr-xr-x  1 root  wheel  20528 Dec  7  2018 sun50i-a64-olinuxino.dtb
> -rwxr-xr-x  1 root  wheel  20685 Dec  7  2018 sun50i-a64-pine64-plus.dtb
> -rwxr-xr-x  1 root  wheel  20603 Jun 27 01:54 sun50i-a64-pine64.dtb
> -rwxr-xr-x  1 root  wheel  20585 Dec  7  2018 
> sun50i-a64-sopine-baseboard.dtb
> -rwxr-xr-x  1 root  wheel  23227 Dec  7  2018 sun50i-h5-orangepi-pc2.dtb
>
>
> ls -l /boot/msdos/dtb/overlays/
> total 20
> -rwxr-xr-x  1 root  wheel   509 Dec  7  2018 sun50i-a64-sid.dtbo
> -rwxr-xr-x  1 root  wheel  1000 Dec  7  2018 sun50i-a64-ths.dtbo
> -rwxr-xr-x  1 root  wheel   373 Dec  7  2018 sun50i-a64-timer.dtbo
> -rwxr-xr-x  1 root  wheel   291 Jun 27 01:50 sun50i-a64-uart2.dtbo
> -rwxr-xr-x  1 root  wheel   291 Jun 27 01:50 sun50i-a64-uart4.dtbo
>
>
>
> ls -l /boot/dtb/allwinner
> total 140
> -r--r--r--  1 root  wheel  19976 Jun 25 16:11 sun50i-a64-nanopi-a64.dtb
> -r--r--r--  1 root  wheel  20528 Jun 25 16:11 sun50i-a64-olinuxino.dtb
> -r--r--r--  1 root  wheel  20677 Jun 25 16:11 sun50i-a64-pine64-plus.dtb
> -r--r--r--  1 root  wheel  20603 Jun 25 16:11 sun50i-a64-pine64.dtb
> -r--r--r--  1 root  wheel  20585 Jun 25 16:11 
> sun50i-a64-sopine-baseboard.dtb
> -r--r--r--  1 root  wheel  23227 Jun 25 16:11 sun50i-h5-orangepi-pc2.dtb
>
>
> ls -l /boot/dtb/overlays
> total 20
> -r--r--r--  1 root  wheel   509 Jun 25 16:11 sun50i-a64-sid.dtbo
> -r--r--r--  1 root  wheel  1000 Jun 25 16:11 sun50i-a64-ths.dtbo
> -r--r--r--  1 root  wheel   373 Jun 25 16:11 sun50i-a64-timer.dtbo
> -r--r--r--  1 root  wheel   291 Jun 24 21:40 sun50i-a64-uart2.dtbo
> -r--r--r--  1 root  wheel   291 Jun 24 21:12 sun50i-a64-uart4.dtbo
>
>
> Even with uart2 and uart4 enabled in: sun50i-a64-pine64.dtb I still 
> don't see anything outside of uart0 under dmesg.
>
>
> What else could I try at this stage?
>
>
> Regards,
>
>
> Kaya
>
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"


Bump..... anyone?


After some digging I found out that the SoPine and Pine-LTS share the 
same image as the memory type is the same on both boards.


I attempted to add uart2 and uart4 into the 
sun50i-a64-baseboard-sopine.dtb file however, after recompiling and 
reinstalling the kernel again nothing worked...


Currently I'm looking at the ofwdump command:


ofwdump -a gives:


     Node 0x1f34: pinctrl at 1c20800
       Node 0x2014: i2c0_pins
       Node 0x2050: i2c1_pins
       Node 0x208c: mmc0-pins
       Node 0x2104: mmc1-pins
       Node 0x216c: mmc2-pins
       Node 0x2200: mmc2-ds-pin
       Node 0x2254: pwm_pin
       Node 0x2298: rmii_pins
       Node 0x2310: rgmii_pins
       Node 0x23b0: spdif
       Node 0x23f4: spi0
       Node 0x2444: spi1
       Node 0x2494: uart0-pb-pins
       Node 0x24e4: uart1_pins
       Node 0x2520: uart1_rts_cts_pins
       Node 0x2564: uart2-pins
       Node 0x25a0: uart3-pins
       Node 0x25dc: uart4-pins
       Node 0x2618: uart4-rts-cts-pins


Digging deeper; it seems that the uart0 port has a phandle:


# ofwdump -p /soc/pinctrl at 1c20800/uart0-pb-pins
Node 0x2494: uart0-pb-pins
   pins:
     50 42 38 00 50 42 39 00
   function:
     75 61 72 74 30 00
     'uart0'
   phandle:
     00 00 00 1a


while the uart2 port does not -

ofwdump -p /soc/pinctrl at 1c20800/uart2-pins
Node 0x2564: uart2-pins
   pins:
     50 42 30 00 50 42 31 00
   function:
     75 61 72 74 32 00
     'uart2'


Looking at the SoPine dts file - cat sun50i-a64-sopine-baseboard.dts I 
added entries for the uart2 and uart4 interfaces.


&uart0 {
     pinctrl-names = "default";
     pinctrl-0 = <&uart0_pins_a>;
     status = "okay";
};

&uart2 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart2_pins>;
         status = "okay";
};

&uart4 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart4_pins>;
         status = "okay";
};


What could I try from here?


Would building and running fbsd version 13 make a difference to get the 
uart ports activated?


I'm really lost :-(


Regards,


Kaya



More information about the freebsd-arm mailing list