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

Initial CX II support #165

Merged
merged 59 commits into from
Apr 10, 2021
Merged

Initial CX II support #165

merged 59 commits into from
Apr 10, 2021

Conversation

Vogtinator
Copy link
Member

@Vogtinator Vogtinator commented Apr 30, 2019

  • Boots (a bit)
  • Needs some refactoring
  • Some parts are missing suspend/resume support
  • Flash creation dialog mostly useless
  • No USB support (neither controller nor protocol)
  • Some parts for complete CX II support are missing, see TODO.md

@EnumC
Copy link

EnumC commented Jul 24, 2019

@Vogtinator Thanks for all the work you've done! Were you able to dump boot1, boot2, manuf, os, and diag so far? If so, how did you go about doing it?

@Vogtinator
Copy link
Member Author

Were you able to dump boot1, boot2, manuf, os, and diag so far?

maybe

flashdialog.cpp Outdated Show resolved Hide resolved
@Vogtinator
Copy link
Member Author

Yay:

Screenshot_20191026_194903

@adriweb
Copy link
Member

adriweb commented Oct 26, 2019

\o/

@debrouxl
Copy link

Congratulations :)

@mosamadeeb
Copy link

Is it working fine? Why did the Travis build fail?

@mosamadeeb
Copy link

@Vogtinator I can't build this pr in qt, is there a certain commit that's causing the problem? same as what's failing travis?

@Vogtinator
Copy link
Member Author

@SutandoTsukai181 What is the error message? The error in travis is caused by a too old compiler.

@Vogtinator Vogtinator force-pushed the cxII-clean branch 2 times, most recently from 8e960b0 to ff85cb9 Compare March 14, 2020 14:38
@Vogtinator
Copy link
Member Author

Vogtinator commented Mar 15, 2020

@Vogtinator I found a linux kernel source with drivers for a LOT of Faraday IPs (there are more of them outside mach-faraday too, like FOTG210)

https://github.com/SleepyRabbit/arm-linux-3.3/tree/master/linux-3.3-fa/arch/arm/mach-faraday

None of those (except for the DMAC) are used in the CX II and FOTG210 is actually part of mainline: https://github.com/torvalds/linux/blob/master/drivers/usb/gadget/udc/fotg210.h

@Vogtinator
Copy link
Member Author

The only missing emulation parts here are nspire specific ones (like the new Aladdin PMU) and figuring out some quirks like why the On/Home button doesn't work.
Some cleanup is also necessary before this can be merged...

@zephray
Copy link

zephray commented Oct 16, 2020

Hi, sorry about the probably stupid question, but how do I install OS for CX II in the emulator?
I have a copy of boot1, boot2, manuf, as well as complete NAND dump from my CX II-T CAS (not a CX II CAS, this might cause some issue).

I first tried to use the create flash dialog, I am able to get it to create a image that contains valid manuf information, but I would have to manually install boot2 via xmodem. I have tried either my dump or the img from OS update file would work. Once that's installed, it could boot into maintenance menu, but then I wasn't able to send the OS update file over via USB. (Nothing happens when file is being drag-n-dropped there).

Then I thought probably preload OS image no longer works and the USB is not fully working, I could go with full NAND dump. I modified the code to use load_file_part() function in flash.c to pretty much convert the NAND dump (128MB) to the NAND with OOB data (132MB) that the emulator uses. This time it could boot to the os loader stage then hit a prefetch abort:

BOOT: loading complete (75 ticks), launching image.
Boot ROM Time: 0.33 seconds
Boot Loader Time: 0.75 seconds
Warning (13ef0000): Prefetch abort: address=13ef0000 status=0

I am wondering what would be the correct way to install the OS?
Thanks

@adriweb
Copy link
Member

adriweb commented Oct 16, 2020

Are you sure you have an actual full dump of your boot1/2 of the CX II? (Specifically the part with the keys, IIRC (?))

Because TI put some additional security stuff there that makes dumps not work the usual way :P
Vogtinator was able to work around those "security" measures, but for now the tools aren't public just yet.
Once it's ready, the files should work just fine as usual on Firebird.

You can come to #ndless-dev on IRC (EFNet servers) to talk more directly if needed.

@zephray
Copy link

zephray commented Oct 16, 2020

I don't know, that's why I am asking. If that's the case then I am pretty much sure my dumps are not complete/ correct.

@Vogtinator
Copy link
Member Author

Yeah, that's the usual symptom of an incomplete bootrom dump. The OS doesn't get decrypted, so it executes all zeros, eventually running off past the end of RAM.

@youssef112358
Copy link

i appreciate all the work you do guys and i wish i could help, but i just begun learning programming so i wont be able to help anytime soon that why i don't really understand evrything you say but i just wanted to ask if i can emulate the cx ii using firebird on android or is not not ready yet ? i now the question is a bit stupid but i'm very new to this "world" and i hope i didn't bother you with my question
and thanks a hole lot for all the amazing work you do

@Vogtinator
Copy link
Member Author

i just wanted to ask if i can emulate the cx ii using firebird on android or is not not ready yet ?

The main missing part for that is a new dumping program, which is WIP. On top of that, there are some bugs and unimplemented features, but those aren't that common.

@youssef112358
Copy link

youssef112358 commented Nov 1, 2020

i just wanted to ask if i can emulate the cx ii using firebird on android or is not not ready yet ?

The main missing part for that is a new dumping program, which is WIP. On top of that, there are some bugs and unimplemented features, but those aren't that common.

ok thanks a hole lot for all the work you do and your time,i really appreciate it and i hope you find all the help you need for your work to pay off

Works mostly, but the cursor jumps around sometimes.

TODO:
- Implement reset, suspend, resume
- Refactor synaptics touchpad to use the proper I2C abstraction
- Simplify touchpad_captivate_read
Always return that something moved/changed, even when there's no contact.
That way it actually resets the reference for relative motion.
Reverts last commit, as returning 1<<3 unconditionally broke the power saving
mode. The cursor jumping doesn't happen anymore for some reason.
Avoids an endless loop of SET_CONFIGURATION events.

Additionally, fix usb_cx2_bus_reset_off not getting called as the OS resets
the host controller on connect, which in turn resulted in usblink_reset.
It's not entirely clear why this is necessary, but it helps both on HW and
with emulation. Most importantly, this fixes a delay on reconnection as only
the second attempt of requesting an address succeeds.
Implement all FDMAs and merge sending and receiving into one function.
On real hardware, that's what the values during runtime are.
Previously, it would clear the divider in 0x020 and thus run at twice the
speed.
UI parts missing so far. There's no mechanism for preloading the OS AFAICT,
so default to booting the installer.
The OS uses those when sending files to the host.
This avoids weird behaviour after resetting when there was garbage data.
usblink calls the correct functions depending on emulate_cx2 now.
- Makes more sense
- Also avoid warnings due to unused arguments
The values are probably the PWM pulse width and period.
Otherwise it errors when it doesn't need to, for instance when the CX II OS
enters deep sleep.
…ep sleep

With this, it enters deep sleep successfully, but the sleep itself isn't really
implemented. Waking it up manually by jumping to 0 returns it to the home
screen, but the clock values are wrong and the watchdog triggers.
It's actually wrong here, only mmio_* needs it.
Just remember written values. This fixes the CX II bootrom bootlooping when
PTT is enabled.
@Vogtinator Vogtinator merged commit 05cb7b0 into nspire-emus:master Apr 10, 2021
@Vogtinator Vogtinator deleted the cxII-clean branch April 10, 2021 12:10
@jake01756
Copy link

jake01756 commented Apr 17, 2021

The flash creation dialog for CX II is incomplete and doesn't have the right labels yet

Not only is it incomplete, the file picker on macOS doesn't let me pick an extension that ends in filename.img.tns

@sussycatgirl
Copy link

i just wanted to ask if i can emulate the cx ii using firebird on android or is not not ready yet ?

The main missing part for that is a new dumping program, which is WIP. On top of that, there are some bugs and unimplemented features, but those aren't that common.

Heya, sorry to bump this old thread but are there any updates on this?

@Vogtinator
Copy link
Member Author

CX II support in firebird is pretty much complete, but a new dumping program is still not available unfortunately.

@ddsmith7792
Copy link

Sorry to revive an old and dead thread but has there been any developments?

@Vogtinator
Copy link
Member Author

Still the same as #165 (comment)

@MinePossu
Copy link

Pardon me, but what is the eta for the dumper program?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.