LdB
Posts: 912
Joined: Wed Dec 07, 2016 2:29 pm

Uart output on different Pi models

Tue Aug 14, 2018 7:46 pm

I have one last annoyance with my Xinu release that for different models the GPIO 14&15 uart output alternates between the miniuart and the pl011 for the kernel output. I reworked the drivers with an autodetect so you don't have to reconfigure xinu compiling just to plug the binary on a different Pi.

The official documentation says (https://www.raspberrypi.org/documentati ... on/uart.md)
By default, on Raspberry Pis equipped with the wireless/Bluetooth module (Raspberry Pi 3 and Raspberry Pi Zero W), the PL011 UART is connected to the BT module, while the mini UART is used for Linux console output. On all other models the PL011 is used for the Linux console output.
However that is not true as I have a Pi1 that the console output is on the mini-uart, not the PL011.

Does anyone know of a table from the mailbox board version I can work out which it is on or some other auto detect?

boochow
Posts: 3
Joined: Thu Feb 08, 2018 2:42 pm
Contact: Website Twitter

Re: Uart output on different Pi models

Fri Aug 17, 2018 3:00 pm

Hi,

U-boot has get_board_rev() function which may help you.

http://git.denx.de/?p=u-boot.git;a=blob ... /rpi/rpi.c

LdB
Posts: 912
Joined: Wed Dec 07, 2016 2:29 pm

Re: Uart output on different Pi models

Fri Aug 17, 2018 4:40 pm

That helps a lot as it shows there is two rev_schemes and how you detect it which was the bit that was confusing me .. much appreciated.

LdB
Posts: 912
Joined: Wed Dec 07, 2016 2:29 pm

Re: Uart output on different Pi models

Wed Aug 22, 2018 5:28 pm

Okay I have the following detail on the 32bit Model ID from the Pi mailbox

xxxx xxxx SRRR MMMM PPPP TTTT TTTT VVVV

x unused
S scheme (0=old, 1=new)
R RAM (0=256, 1=512, 2=1024)
M manufacturer (0='SONY',1='EGOMAN',2='EMBEST',3='UNKNOWN',4='EMBEST')
P processor (0=2835, 1=2836)
T type (0='A', 1='B', 2='A+', 3='B+', 4='Pi 2 B', 5='Alpha', 6='Compute Module')
V revision (0-15)

I am interested in the types T I am missing a couple .. anyone know 7, 0xA, 0xB

Code: Select all

          enum {	MODEL_1A	= 0, 
			MODEL_1B	= 1, 
			MODEL_1A_PLUS	= 2, 
                        MODEL_1B_PLUS	= 3, 
			MODEL_2B	= 4, 
			MODEL_ALPHA	= 5,
			MODEL_CM	= 6,  // Compute Module
			MODEL_PI3	= 8,
			MODEL_PI_ZERO	= 9,
			MODEL_PI_ZEROW	= 0xC,
			MODEL_PI3B_PLUS = 0xD,
		} model;

StevoD
Posts: 20
Joined: Tue Aug 29, 2017 11:37 am

Re: Uart output on different Pi models

Thu Aug 23, 2018 11:06 am

You should RTFM more often instead of giving bad advice.

This is documented by RPF here https://www.raspberrypi.org/documentati ... /README.md

For the original question, which UART is used is just a firmware default, use the function select registers to set whatever you choose, problem solved!

LdB
Posts: 912
Joined: Wed Dec 07, 2016 2:29 pm

Re: Uart output on different Pi models

Thu Aug 23, 2018 12:32 pm

I don't know why the agro but thanks for the answer that fills in the last gap by looks 7 & B don't exist.

The code is part of a console only system that can get dumped on any model of Pi.
I have no idea what model I have and I can't type or enter anything to change the settings if I don't get the right port as I will be talking to some random hardware or into air. Real O/S's detect things and do the setup for you which is what Raspbian etc do.

Currently on XINU you have to rebuild the driver setup (the conf.c and conf.h) for each model as the serial port and ethernet vary between models. All I am doing is removing that requirement so that there is one build for all Pi models and it sorts out the hardware for me with code in platform.c

That was the point to the whole question, I need to be able to pick off the model at boot and I didn't think it was controversial :-).

Return to “Bare metal, Assembly language”