Arietta G25 serial ports

This forum is for all other ARMv5 devices

Re: Arietta G25 serial ports

Postby summers » Mon Dec 21, 2020 1:51 am

That you don't see the kernel messages on the uart suggests also the driver isn't coming up. You should be using the atmel_serial driver. You can check with
Code: Select all
sudo cat /proc/iomem
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

Re: Arietta G25 serial ports

Postby jesseF » Mon Dec 21, 2020 2:48 am

I get the following:
Code: Select all
$ sudo cat /proc/iomem
00300000-00307fff : 300000.sram sram@300000
00500000-0057ffff : 500000.gadget gadget@f803c000
00600000-006fffff : 600000.ohci ohci@600000
00700000-007fffff : 700000.ehci ehci@700000
20000000-2fffffff : System RAM
  20008000-20d5afff : Kernel code
  20dae000-20e36bf3 : Kernel data
f0004000-f00040ff : f0004000.spi spi@f0004000
f0010000-f0013fff : f0010000.ssc ssc@f0010000
f8008000-f80080ff : f8008000.timer timer@f8008000
f800c000-f800c0ff : f800c000.timer timer@f800c000
f8010000-f80100ff : f8010000.i2c i2c@f8010000
f8014000-f80140ff : f8014000.i2c i2c@f8014000
f803c000-f803c3ff : 500000.gadget gadget@f803c000
f804c000-f804c0ff : f804c000.adc adc@f804c000
ffffe000-ffffe5ff : ffffe000.ecc-engine ecc-engine@ffffe000
ffffe600-ffffe7ff : ffffe000.ecc-engine ecc-engine@ffffe000
ffffec00-ffffedff : at_hdmac
ffffee00-ffffefff : at_hdmac
fffff400-fffff5ff : fffff400.gpio gpio@fffff400
fffff600-fffff7ff : fffff600.gpio gpio@fffff600
fffff800-fffff9ff : fffff800.gpio gpio@fffff800
fffffa00-fffffbff : fffffa00.gpio gpio@fffffa00
fffffe10-fffffe1f : fffffe10.shdwc shdwc@fffffe10

I don't see anything that seems to be related to the UART.
jesseF
 
Posts: 19
Joined: Mon Jun 15, 2020 3:36 am

Re: Arietta G25 serial ports

Postby summers » Mon Dec 21, 2020 9:17 am

Ah Ok - so we can see the problem now.

The driver hasn't been loaded, and actually there is no driver on the memory addresses of the uarts.

You should be able to check whats compiled in /proc/config.gz but my bet is atmel_serial isn't enabled.

This gives you two choices, either compile the kernel (well modules) yourself. Or take the kernel and modules from a working distribution, and drop them in on top of arch.

You could also ask Kevin here if he could enable atmel_serial as a module, for your board.
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

Re: Arietta G25 serial ports

Postby jesseF » Mon Dec 21, 2020 2:00 pm

not sure what's going on. I decompressed /proc/config.gz and I see this in the file:
Code: Select all
.....
#
# Non-8250 serial port support
#
# CONFIG_SERIAL_AMBA_PL010 is not set
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
CONFIG_SERIAL_ATMEL=y
CONFIG_SERIAL_ATMEL_CONSOLE=y
CONFIG_SERIAL_ATMEL_PDC=y
# CONFIG_SERIAL_ATMEL_TTYAT is not set
# CONFIG_SERIAL_MAX3100 is not set
# CONFIG_SERIAL_MAX310X is not set
# CONFIG_SERIAL_UARTLITE is not set
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SERIAL_SIFIVE is not set
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_SC16IS7XX is not set
...

so, it looks like CONFIG_SERIAL_ATMEL is set.

It seems to me that this should work out of the box as it is needed for the serial console. I'll probably file a bug report or whatever is appropriate.
jesseF
 
Posts: 19
Joined: Mon Jun 15, 2020 3:36 am

Re: Arietta G25 serial ports

Postby summers » Mon Dec 21, 2020 2:41 pm

Hmmm. Very odd, You could compare your config to https://www.acmesystems.it/download/microsd/Arietta-03aug2017/acme-arietta_defconfig - which is probably from a different kernel version.

Whats very confusing, is the device tree:
Code: Select all
compatible = "atmel,at91sam9260-usart";
I though was meant to select the atmel_serial. When I get home I'll read the source code [https://github.com/torvalds/linux/blob/master/drivers/tty/serial/atmel_serial.c]more closely (doesn't help its a huge file), and see why its not picking it up. May be able to switch on some debugging, but if the log has nothing from atmel_serial, almost sounds like its not being run at all.

So I'm confused ...
Last edited by summers on Mon Dec 21, 2020 3:08 pm, edited 1 time in total.
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

Re: Arietta G25 serial ports

Postby summers » Mon Dec 21, 2020 2:56 pm

Ah its this that picks up the tag: https://github.com/torvalds/linux/blob/master/drivers/mfd/at91-usart.c not clear what needs to be set to include that ...

Ah - does you /proc/config.gz define
Code: Select all
MFD_AT91_USART
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

Re: Arietta G25 serial ports

Postby jesseF » Tue Dec 22, 2020 2:39 am

tried to diff with the config and, as you suspected, it wasn't too useful as there were many differences. I did find that CONFIG_MFD_AT91_USART was defined
Code: Select all
...
#
# Multifunction device drivers
#
CONFIG_MFD_CORE=y
# CONFIG_MFD_ACT8945A is not set
# CONFIG_MFD_AS3711 is not set
# CONFIG_MFD_AS3722 is not set
# CONFIG_PMIC_ADP5520 is not set
# CONFIG_MFD_AAT2870_CORE is not set
CONFIG_MFD_AT91_USART=y
# CONFIG_MFD_ATMEL_FLEXCOM is not set
CONFIG_MFD_ATMEL_HLCDC=y
CONFIG_MFD_ATMEL_SMC=y
# CONFIG_MFD_BCM590XX is not set
# CONFIG_MFD_BD9571MWV is not set
# CONFIG_MFD_AXP20X_I2C is not set
# CONFIG_MFD_MADERA is not set
# CONFIG_MFD_ASIC3 is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_DA9052_SPI is not set
# CONFIG_MFD_DA9052_I2C is not set
# CONFIG_MFD_DA9055 is not set
# CONFIG_MFD_DA9062 is not set
# CONFIG_MFD_DA9063 is not set
# CONFIG_MFD_DA9150 is not set
...


I figure it's might be easier to look at the full config so I have uploaded it here :
https://gist.githubusercontent.com/Jess ... tfile1.txt
jesseF
 
Posts: 19
Joined: Mon Jun 15, 2020 3:36 am

Re: Arietta G25 serial ports

Postby summers » Tue Dec 22, 2020 8:36 am

Yes its very strange. Everything seems in place, but for some reason the serial driver doesn't start.

Think one thing we haven't checked, can you have your script that prints of the device tree serial status, print the compatible file? All should have "atmel,at91sam9260-usart", and dbg should also have "atmel,at91sam9260-dbgu". They are in mainline kernel, so am 99% sure its what you'll have - but worth checking.

This flag should be picked up by https://github.com/torvalds/linux/blob/master/drivers/mfd/at91-usart.c
and that in turn should call up https://github.com/torvalds/linux/blob/master/drivers/tty/serial/atmel_serial.c.

So the question is why don't you have any of this in your log. Its a mystery to me ... guess we should see if we can switch on some more logging.
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

Re: Arietta G25 serial ports

Postby jesseF » Wed Dec 23, 2020 1:20 am

Here are the contents of the compatible file
Code: Select all
/proc/device-tree/ahb/apb/serial@f801c000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@f8020000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@f8024000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@f8028000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@f8040000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@f8044000 : atmel,at91sam9260-usart
/proc/device-tree/ahb/apb/serial@fffff200 : atmel,at91sam9260-dbguatmel,at91sam9260-usart

looks just like you said.

what logging should I switch on and how do I do it?
jesseF
 
Posts: 19
Joined: Mon Jun 15, 2020 3:36 am

Re: Arietta G25 serial ports

Postby summers » Wed Dec 23, 2020 9:11 am

modules when you load them, you can pass arguments at the same time - and for most drivers they take debug. Now your serial drivers are static, so can't set these arguments at loading - but there is a way of setting them when they are in the kernel already. I haven't done this in years, so will need to look it up. We'll want to enable logging/ greater verbosity in at91-usart and atmel_serial.

Now as the problem could quite easily be in how the device tree info is used to start the various parts of the kernel, so want to switch on logging there as well.

You can also get info on the current state (e.g. it doesn't say how you got to where you are) in the /sys and /proc pseudo file systems, that may give clues, e.g. the iomem files we looked at earlier showed that the memory mapped interfaces trough to the uarts hadn't been set up, hence why its probably that the serial code in the kernel isn't active.

Anyway, I'll need to look into these, even just to remind me what to dig on. On one hand I finished work for Christmas yesterday, but on the other I go down to my sister and family at lunch time today. So I'll have more free time, but have nieces and nephews to occupy. Anyway I'll have my laptop - and I try and remember to take my pocket beagle (an arm board same size give or take as your arietta).

If we can identify that the kernel is doing something wrong, then we can involve Radu Pirea - as he did the kernel side. That said, until we can say that the kernel is doing something wrong, it wouldn't really be fair to involve him.
summers
 
Posts: 923
Joined: Sat Sep 06, 2014 12:56 pm

PreviousNext

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 3 guests