Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
34 user(s) are online (25 user(s) are browsing Forums)

Members: 0
Guests: 34

more...

Support us!

Headlines

 
  Register To Post  

« 1 2 3 (4)
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@kas1e
I probably did not have to implement anything for this so it's handled by QEMU in some way that I don't know. If the VT8231 has some bits to disable PS2 ports those are likely not emulated but if you add -device usb-kbd then QEMU will direct keyboard input to that so it should work with USB as well. I don't know if the default PS2 keyboard also gets keyboard input with -device usb-kbd but could be that both keep working. Maybe on real machine also both should work but SmartFirmware has only one input source so you can either use PS2 or USB keyboard? In any case you can test with original firmware with -device usb-kbd and if that works with your version too then maybe it's OK.

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@balaton
Quote:

Maybe on real machine also both should work but SmartFirmware has only one input source so you can either use PS2 or USB keyboard?


On real pegasos2 if you have attached both usb-keyboard and ps/2 keyboard, the usb-keyboard is one which smartfirmware take as the input, and ps/2 is unusable and didn't work.

Quote:

In any case you can test with original firmware with -device usb-kbd and if that works with your version too then maybe it's OK.


With -device usb-kbd , while i can see with both my and original firmware that i do have:

/pci@80000000/usb@C,3/hub@1
/pci@80000000/usb@C,3/hub@1/keyboard@(keyboard)


But then who can say what keyboard works now when i type, ps/2 or usb one from smartfirmware in qemu?:) that why i were in hope to disable ps/2 to see if it will works.

But that anyway not so matter now, because issue was that keyboard was hardcoded to isa, so now i add "set it to isa only after there wasn't usb one found" , to act like original firmware, and then it works.

Now fighting with usb-mass sticks, because simple os4_stick.img, formatted in fat16 works for qemu now (i just go scsi route), but have issues with real sticks on real pegasos2.

Maybe i need to do passthrough for this exactly usb-sticks, so to try real ones on qemu where it all more easy to debug.


Edited by kas1e on 2026/5/3 10:23:27
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@all
Were able to add UHCI support to original OF, so now my firmware can detect usb keyabord, and can detect usb-sticks, and put them to OF as scsi/block devices, and so i can list files on them, etc.

So far all sounds good, if not one moment : i have 3 usb sticks. 2 of them , detects fine, no problem:

Phison Electronics Corp. 16gb (13FE:4300)
Kingston 256gb (0951:1666)


But one which is JetFlash 8GB (8564:1000), while surely works fine and detects fine on windows or on same pegasos2 just via amigaos4, simple fail for me to detects from within firmware: UHCI controller executes the very first address-0 SETUP packet, but the device never gives a valid USB response, so enumeration cannot even read the descriptor. Does not matter what i tried. I compared from amigaos4's usbinfo/ranger the differences: nothing which can explain it. I compare with lspci -vvv from linux : nothing can explain it. In the datasheet on VIA's VT8231 i see nothing about USB quirks or whatever ..

Maybe anyone have any clue or experience with to where a look at ?

The difference is only that i have this stick formatted FFS, and others two (working) are Fat32 and NTFS, but that just about FS, which is not matter until enumeration take place..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@kas1e
I think you should not worry about that too much. Just release the sources and let others help find it out. Rather than spending time with this one USB stick, do the missing parts of the bootstrap for which you can likely use the code from U-Boot for the Marvell Discovery development board that was once upstream and then clean up the sources to be able to put them in a repo so others can help you out with finding issues and further improve it.

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Balaton
Deal with this stick, was some small issue about wrong order initialisation. As for releasing anything: sure, but it firstly should work at all :) Currently i only deal with smartfirmware itself, to be able to boots correctly with original bootstrap , and it still acts in one or another way which need to deal with. Once it will works, i can simple release just a smartfirmware part with a python script which build a new rom from original (extracting bootstrap, combine with our smartfirmware, and create new rom). This way ppls already can use it, while i will worry about bootstrap replacement, which, IMHO, will be harder part.

Currently fighting with another strange issue : when i run original firmware, then soft reset, then i can run my own fine too till workbench boot (both uses same bootstrap from bplan). If i run my firmware after cold boot : Then once i run amigaboot.of it stops/hangs after returning to its own code. No next OF call, and no exception so far. And this can be anything : CPU/cache/MSR/exception/vector state, stack/runtime convention, timer/interrupt state, or some device/platform state original firmware leaves initialized (but only after graphics boot!). And to note that bootstrap is the same bPlan's one..

Edit: issue was about missing fp exception vector together with missing msr's fp bit set, causing silent hang in allocator. Fixed this one and now need to understand how properly hands off usb stack to OS..


Edited by kas1e on 2026/5/5 9:31:10
Edited by kas1e on 2026/5/6 11:15:02
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
fixed.


Edited by kas1e on 2026/5/8 7:57:58
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@All
Good progress: USB issues gone , it was one of the VT config registers.

Also added UDMA for ATA (be it pure IDE , or sata disk via IDE2SATA adapter) together with LBA48 (originaly it was just 28) + batching for PIO if UDMA not supported on some drive, which in result mean that: originally my kickstart modules loads up for 21s (i just have debug version of modules, both radeonrx/hd ones, kernel , etc). Now, if UDMA driver detected : 3s (!). IF UDMA not detected, fallback to PIO, but improved one, which instead of 21s gives 8s, which is good too.

Also added SFS2 support of all flavors : original firmware simple list only morphos SFS version, in my one now any SFS/SFS2 can be listed/booted from. Together with that added read/listing/booting from FAT16/32 with VFAT, NTFS (!) , Linuxes (LNX, EXT2/3) and improve FFS to have support of latest ones.

Some bits were fixed in original smartfirmware like "ls" on relative block-device (before you can't "ls disk@0,0" when you in /pci@80000000/ide@c,1 for example). And fixed when you CD to any device , and do "cd non_present_anything" instead of fallback to the root it keep stays on same place.


Everything done of course on REAL pegasos2, where i upload just SmartFirmware over IKARUS (so original BPlan's bootstrap still in use).


Now, what i else want to do is:

- USB booting from massstorage
- CD-USB booting
- Booting from SATA PCI directly
- Booting from USB stick from PCI USB card directly.
- Make the GFX card in PCI bridges be visibly in firmware and usable.
- Improve a bit network support (to have sane ping return, not like now, and to not died on network after one network operation as it was with original)

Once that done, clean the debug, and first release with proper scripts so one can use it on original peg2 via uploading only SF part via Ikarus, or one can use full rom which will be done by script which will take original pegasos2.rom, extract bootstrap from and build a ready rom for you, so to play with QEMU.

Then, it will time to somehow think how better to prepare reflashing work (at first with original bootstrap) , so to have basics works. Because flash on pegasos is TSOP32, which you can't easyly solder-resolder many times, so this need to be thinks of how to do it all correctly ..

But if anyone want to play with it right now , i can put it now too, just ask.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@kas1e
Quote:
But if anyone want to play with it right now , i can put it now too, just ask.

I sent you a private message.
Thanks

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@smarkusg
Answered :)

@all
Was another 2 hardworking days : imroved UHCI, so USB booting works from pure VIA's ports of pegasos2 + does not matter on what port you attach keyboard/mouse it works in any now.

Then played with 2 new PCI USB cards : one is NEC based, another one is VIA based. The NEC one have ability to work as EHCI, and as companion OHCI, and VIA one same can work as EHCI and as companion an UHCI.

So, starting from NEC one, and default SmartFirmware's OHCI was very dumb, and detect nothing properly, so starting writing new one, and meet with all sort of possible usb issues about everything, until realized that i better take the proved to works one from latest UBoot and integrate it to smartfirmware. Then while OHCI start to works, i can detect sticks attached to it , but it still acts a bit strage, need to do some more debugging.

Also while was at it , borrowed from Uboot more harder EHCI driver, so now SmartFirmware have all 3 : OHCI, UHCI and EHCI. While really necessary is the UHCI one (as pegasos's VIA's usb is UHCI) , still have OHCI and EHCI can find it use by some one.

Next stage : PCI SATA. Once i will be able to boot from, it will means no more needs of anything connected to IDE ports anymore, even through IDE2SATA adapters..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Just popping in
Just popping in


See User information
You have archived great steps forward, congrats!!

I looked on GitHub inside generic smartfirmware code and it's really an hell..

Do you have a repo with your latest injected code?
Do you think will be possibile a native code compilation under GCC8 on OS4?
Do you think your firmware will be compatible with all board revs?

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@flash
Quote:

I looked on GitHub inside generic smartfirmware code and it's really an hell..


Everything hell until you didn't dig in :)


Quote:

Do you have a repo with your latest injected code?


Nope, it just make no sense to update repo only to show to others few ppls what were changed and where. Working locally is much faster. But once i will have something ready, i will put it to repo of course, so it will be for everyone.


Quote:

Do you think will be possibile a native code compilation under GCC8 on OS4?


Why not, but i do all on cross compiler: fast, easy, no specific bugs to os4 version of make/cmake/diffs/rg/grep/bash/pythong/etc.

Quote:

Do you think your firmware will be compatible with all board revs?


That the harder question, because i do test it on my own peg2 G4, so it should works of course on everything else, especially in sense that i currently only replace SmartFirmware, while bootsrap is original bPlan's one.

That need to be safe-tested after something ready.


@All
Borrowed from UBOOT driver for sii3512, adapted to smartfirmware, and now i can boot, see the drives attached to it and BOOT FROM ! YEAHOO !!

Last hardcore things is to made bridge working now, so i will see firmware on radeonhd/rx, and then it kind of it, cleanup, etc,etc.

Just for some nerd fancy checking if anyone in interest, that the one of the working session i have now with attaching to the PCI USB Nec based card usb CD-ROM, a USB Stick and a Mouse. Also, Si512 with attached 1 SSD, then one stick attached to the VIA's port (so uhci) , and one hdd attached to ide2sata atapter and a keyboard connected to the Via's usb port too. And all whole mess works and output from firmware initialisation are:

cpu0PowerPC,74x7 CPUClock 999 Mhz BUSClock 133 Mhz (Version 0x8002,0x0101)
pcidevcls=0x60000 v=0x11AB d=0x6460 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x60000...
pcidevbuiltin err=-3439
pcidev
cls=0xC0010 v=0x1106 d=0x3044 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0010...
pcidevbuiltin err=-3439
pcidev
cls=0x10400 v=0x1095 d=0x3512 rom...
pcidevprefer builtin for SiI3512
SiI3512
BAR5=0x80100000 size=0x200
Cache line not set
using SiI3512 FIFO default
SATA#0 SStatus=00000000
SATA#0 port is not present
SATA#1 SStatus=00000113
SATA#1 port is present
port=1 dev=0
Specific config
C837
lba
=0xA00000014
SiI3512
skip ATA probe port0 state=0
channel 1 unit 0 
:   ata KINGSTON SKC6001024G                     S4I00106
pcidev
cls=0xC0320 v=0x1033 d=0xE0 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0320...
EHCIinstall 0:6.2 id=1033:00E0 class=0C0320 rev=04
pcidev
builtin err=0
pcidev
cls=0xC0310 v=0x1033 d=0x35 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0310...
pcidevbuiltin err=0
pcidev
cls=0xC0310 v=0x1033 d=0x35 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0310...
pcidevbuiltin err=0
USB
/EHCIport1 addr1 device vid=346D pid=5678 class=00.00.00
USB
/EHCIport1 addr1 if0 scsi class=08.06.50
0
VendorCo ProductCode      2.00 SCSI-4
USB
/EHCIport4 addr2 device vid=1C6B pid=A223 class=00.00.00
USB
/EHCIport4 addr2 if0 cdrom class=08.02.50
0
ASUS     SDRW-08D2S-U     BA01 SCSI-0
USB
/OHCIport2 addr1 device vid=09DA pid=F6E3 class=00.00.00
USB
/OHCIport2 addr1 if0 keyboard class=03.01.01
USB
/OHCIport2 addr1 if1 mouse class=03.01.02
USB
/OHCIport2 addr1 if2 input class=03.00.00
pcidev
cls=0xC0300 v=0x1106 d=0x3038 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0300...
pcidevbuiltin err=0
pcidev
cls=0xC0300 v=0x1106 d=0x3038 rom...
pcidevrom err=-3440
pcidev
builtin cls=0xC0300...
pcidevbuiltin err=0
pcidev
cls=0x60100 v=0x1106 d=0x8231 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x60100...
pcidevbuiltin err=0
pcidev
cls=0x1018F v=0x1106 d=0x571 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x1018F...
channel 0 unit 0 :   ata KINGSTON SA400S37240G                    SBFK61K1
pcidev
builtin err=0
pcidev
cls=0x68000 v=0x1106 d=0x8235 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x68000...
pcidevbuiltin err=-3439
pcidev
cls=0x40100 v=0x1106 d=0x3058 rom...
pcidevbuiltin cls=0x40100...
pcidevbuiltin err=-3439
pcidev
cls=0x78000 v=0x1106 d=0x3068 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x78000...
pcidevbuiltin err=-3439
USB
/UHCIport2 addr1 device vid=046D pid=C31C class=00.00.00
USB
/UHCIport2 addr1 if0 keyboard class=03.01.01
USB
/UHCIport2 addr1 if1 input class=03.00.00
USB
/UHCIport1 addr1 device vid=0951 pid=1666 class=00.00.00
USB
/UHCIport1 addr1 if0 scsi class=08.06.50
0
Kingston DataTraveler 3.0 |  | SCSI-6
pcidev
cls=0x20000 v=0x1106 d=0x3065 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x20000...
pcidevbuiltin err=-3439
pcidev
cls=0x60000 v=0x11AB d=0x6460 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x60000...
pcidevbuiltin err=-3439
pcidev
cls=0x30000 v=0x1002 d=0x5960 rom...
pcidevrom err=0
pcidev
cls=0x38000 v=0x1002 d=0x5940 rom...
pcidevrom err=-3440
pcidev
builtin cls=0x38000...
pcidevbuiltin err=0


You also can see there that PCI USB Nec card have Ehci + Ohci support, so, firmware checks if there Ehci devices attached, if yes, enumerate, if not , checked by Ohci and only then give up.

"show-devs" is even more fancy

ok show-devs
/ (chrp)
/
openprom
/openprom/client-services
/aliases
/options
/packages
/packages/terminal-emulator
/packages/deblocker
/packages/disk-label
/packages/obp-tftp
/chosen
/memory@(memory)
/
cpus
/cpus/PowerPC,74x7 (cpu)
/
cpus/PowerPC,74x7/l2-cache (l2-cache)
/
cpus/PowerPC,74x7/l3-cache (l3-cache)
/
rtas
/failsafe (serial)
/
ethernet
/ethernet/port1 (network)
/
pci@80000000 (pci)
/
pci@80000000/host@0
/pci@80000000/firewire@1
/pci@80000000/raid@(block)
/
pci@80000000/raid@5/disk@1,(block)
/
pci@80000000/usb@6,(usb)
/
pci@80000000/usb@6,2/scsi@(scsi)
/
pci@80000000/usb@6,2/scsi@1/disk@0,(block)
/
pci@80000000/usb@6,2/cdrom@(scsi)
/
pci@80000000/usb@6,2/cdrom@4/cd@0,(block)
/
pci@80000000/usb@(usb)
/
pci@80000000/usb@6/device@2
/pci@80000000/usb@6/device@2/keyboard@(keyboard)
/
pci@80000000/usb@6/device@2/mouse@1
/pci@80000000/usb@6/device@2/input@2
/pci@80000000/usb@6,(usb)
/
pci@80000000/usb@C,(usb)
/
pci@80000000/usb@C,2/device@2
/pci@80000000/usb@C,2/device@2/keyboard@(keyboard)
/
pci@80000000/usb@C,2/device@2/input@1
/pci@80000000/usb@C,(usb)
/
pci@80000000/usb@C,3/scsi@(scsi)
/
pci@80000000/usb@C,3/scsi@1/disk@0,(block)
/
pci@80000000/isa@(isa)
/
pci@80000000/isa@C/serial@i2F8 (serial)
/
pci@80000000/isa@C/8042@i60 ()
/
pci@80000000/isa@C/keyboard@i60 (keyboard)
/
pci@80000000/isa@C/rtc@i70 (rtc)
/
pci@80000000/isa@C/timer@i40 (timer)
/
pci@80000000/isa@C/fdc@i3F0 (fdc)
/
pci@80000000/isa@C/lpt@i3BC (lpt)
/
pci@80000000/ide@C,(spi)
/
pci@80000000/ide@C,1/disk@0,(block)
/
pci@80000000/other@C,4
/pci@80000000/sound@C,5
/pci@80000000/pci1106,3068@C,6
/pci@80000000/ethernet@D
/pci@C0000000 (pci)
/
pci@C0000000/host@0
/pci@C0000000/display@8
/pci@C0000000/display@8,(display)
/
bootconsole (display)


Edited by kas1e on 2026/5/11 19:15:22
Edited by kas1e on 2026/5/11 19:18:01
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 2 3 (4)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project