Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable EE UART #68

Open
bignaux opened this issue Mar 30, 2022 · 7 comments
Open

Enable EE UART #68

bignaux opened this issue Mar 30, 2022 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bignaux
Copy link

bignaux commented Mar 30, 2022

Be able to debug via a real serial link is vital. We need to port the old driver :
https://github.com/rickgaiser/linux/blob/75027f334badf119f707e3b037c7df3698702ad5/drivers/tty/serial/ps2_uart.c
and eventually add support to get early printk, in :
https://github.com/frno7/linux/blob/ps2-main/arch/mips/boot/compressed/dbg.c
The video driver will never give us the ability to have a console. besides the fact that it requires a high resolution screen.

@frno7
Copy link
Owner

frno7 commented Mar 30, 2022

Yes, a serial console can be helpful if one has soldered its pins. I suppose it’s a fairly straight-forward, although I’m unable to test it myself.

@frno7 frno7 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 30, 2022
@AKuHAK
Copy link

AKuHAK commented Apr 3, 2022

Yes, a serial console can be helpful if one has soldered its pins. I suppose it’s a fairly straight-forward, although I’m unable to test it myself.

You can test serial output in PCSX2. The emulator will handle sio_ prints correctly. Is there an easy way to switch from GS console to EE UART console? I have SCPH-70003 with EE UART, so I can test it also on a real console, but currently, PCSX2 doesn't output anything on serial.

Also, currently, the GS debug console is hardcoded to some values:

/*
* csr 0x551c6004
* dispfb1 0x13c00
* dispfb2 0x13c00
* display1 0x43777f000280f8
* display2 0x7ff77f004600f8
* extbuf 0x0
* extdata 0x0
* extwrite 0x0
* id 0x55
* imr 0x0
* pmode 0x5
* revision 0x1c
* siglblid 0x0
* smode1 0x13422004b1
* smode2 0x0
* srfsh 0x2
* synch1 0x2c4d0160509d7
* synch2 0x240300
* syncv 0xb0e00002400004
* syscnt 0x0
*/

Can you comment on how to calculate these values? If I want to switch from 1920x1080 to some low res mode?

@frno7
Copy link
Owner

frno7 commented Apr 9, 2022

You can test serial output in PCSX2. The emulator will handle sio_ prints correctly.

Good to know, thanks!

Is there an easy way to switch from GS console to EE UART console? I have SCPH-70003 with EE UART, so I can test it also on a real console, but currently, PCSX2 doesn't output anything on serial.

Well, the UART isn’t implemented yet. This issue is about doing it. I think it’s a reasonable good first issue for a newcomer trying out kernel programming. :-)

Also, currently, the GS debug console is hardcoded to some values:

/*
* csr 0x551c6004
* dispfb1 0x13c00
* dispfb2 0x13c00
* display1 0x43777f000280f8
* display2 0x7ff77f004600f8
* extbuf 0x0
* extdata 0x0
* extwrite 0x0
* id 0x55
* imr 0x0
* pmode 0x5
* revision 0x1c
* siglblid 0x0
* smode1 0x13422004b1
* smode2 0x0
* srfsh 0x2
* synch1 0x2c4d0160509d7
* synch2 0x240300
* syncv 0xb0e00002400004
* syscnt 0x0
*/

Can you comment on how to calculate these values? If I want to switch from 1920x1080 to some low res mode?

Sure, I set an appropriate video mode using the fbset command, or /sys/class/graphics/fb0/mode, and read the registers explained in the wiki article about examining and manipulating Graphics Synthesizer registers. At the time the values were probably printed in hexadecimal, and thereby easier to copy-paste for this particular case. Nowadays they are symbolic.

I thought this GS console would never be merged, but Maciej W. Rozycki suggested it might be, in the post [PATCH 094/120] MIPS: PS2: FB: Frame buffer driver for the PlayStation 2.

My responses are slow due to travelling.

@frno7
Copy link
Owner

frno7 commented Apr 13, 2022

@AKuHAK, see also issue #9 for some ideas on how to improve early printk using the Graphics Synthesizer. More specifically its first item listed, for your case. :-)

@frno7
Copy link
Owner

frno7 commented Apr 13, 2022

Can you comment on how to calculate these values? If I want to switch from 1920x1080 to some low res mode?

@AKuHAK, I could mention that when examining GS registers their values are impossible to read from the GS hardware itself, as these are write-only by hardware design. To solve this, the Linux kernel maintains a set of software shadow-registers that are readable by sysfs in the /sys/devices/platform/gs/registers/ directory. These GS shadow-registers are updated by the kernel whenever the hardware registers are updated, giving the illusion GS registers are freely both readable and writable.

@AKuHAK
Copy link

AKuHAK commented Jun 16, 2023

For the records here low level EE SIO description in u-boot project:
jur/ps2-u-boot@jur:ps2-u-boot:22a240c32c1340183fce12867ae5f8736b92a638...master#diff-03eceba5b4bd071d7366a84ab693ee313d9da7f6fe564308aaedf851dee89875R24
also has low level IDE specs

@frno7
Copy link
Owner

frno7 commented Jun 26, 2023

@AKuHAK, thanks! I believe the IDE is a standard parallel ATA interface, although I’m unsure about its exact variant. The main complication is its DMA, needing bounce buffers, detailed in issue #18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants