Project

General

Profile

Actions

Feature #76

open

Merge down to trunk

Added by foft over 5 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Start date:
10/05/2018
Due date:
% Done:

0%

Estimated time:

Description

Several requests to get some of these features back up and running on the mist.

Actions #1

Updated by foft over 5 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by foft over 5 years ago

  • Subject changed from MIST backport to Merge down to trunk
Actions #3

Updated by foft over 5 years ago

  • Priority changed from Normal to High

Keen to get this work back on the mainline.

Actions #4

Updated by foft over 5 years ago

This will probably break many (other platform) core builds on trunk in the short term...

Actions #5

Updated by foft over 5 years ago

  • Status changed from New to In Progress

Made an svn copy of existing trunk (branches/releases/trunk_20181013_premerge)
Also made a backup of lots of random local stuff on my trunk checkout!
Going to merge down the entire eclaireXL branch and start working on trunk.
This will break a lot, since there are a lot of specific eclaire firmware features for instance.

Actions #6

Updated by foft over 5 years ago

Easy part done, merged down.

For now I branched firmware into firmware_eclairexl and firmware_legacy (for other platforms).
However common is probably incompatible with the other core builds to some degree... Probably nothing too major.

Actions #7

Updated by foft about 5 years ago

György spurred me on by fixing the mist for 5200.

I've merged his changes.

I've also made a start at getting other cores building. So far mcc216 builds. Firmware is going to need merging to make these work though, but having them build is a good step...

Actions #8

Updated by foft about 5 years ago

Allowed targets without usb to build. The code expected the 48MHz clock to generate the 1MHz tick, which needed to be more accurate for atx support.

Actions #9

Updated by foft about 5 years ago

Got the legacy firmware to work against the new hardware. At least the mcc216 is working in a8 mode...

Unfortunately need to save a few hundred bytes to fit atx support.

Actions #10

Updated by foft about 5 years ago

Trying to program 5200 ntsc... getting there, but not quite!

Actions #11

Updated by foft about 5 years ago

5200 ntsc is working on mcc.
Trying to merge the two firmwares...

So menu structure is different, flash support and pll support. Commenting those and it builds, except its too large for some targets (>32k).

Probably need to write a simple generic menu thing and use it instead of this massive hack.

Actions #12

Updated by foft about 5 years ago

Trying to get the 40k eclaire rom working 'as is' on the mcc now.
All building ... but ...its erasing my sd card! Hmmm, what is going on here...

Actions #13

Updated by foft about 5 years ago

Now trying to get Chameleon 1 back up and running ... before moving onto Chameleon 2. So far got the Atari screen but sio seems broken for some reason.

Actions #14

Updated by foft about 5 years ago

sio on chameleon was just a missed new pin (io clock).
Done most of chameleon2 wiring with the new helpers... Just a few things remain then I can try it:
  • 8MHz->50MHz in plls
  • Assign pins in qsf
  • Solder on jtag
  • Change device to cyclone 10 in qsf
  • Cross fingers!
Actions #15

Updated by foft about 5 years ago

Getting closer!
  • 8MHz->50MHz in plls
  • DONE:Assign pins in qsf
  • Solder on jtag
  • DONE:Change device to cyclone 10
  • Install cyclone 10 support to quartus
  • Cross fingers!
Actions #16

Updated by foft about 5 years ago

Enough for today!

  • 8MHz->50MHz in plls
  • DONE:Assign pins in qsf
  • Solder on jtag
  • DONE:Change device to cyclone 10
  • DONE:Install cyclone 10 support to quartus
  • Upgrade all ip to cyclone 10
  • Cross fingers!
Actions #17

Updated by foft about 5 years ago

Continuing chameleon bring up on #78

Actions #18

Updated by foft almost 5 years ago

I think chameleon 1 and chameleon 2 are good. firmware_eclaire is running on them and also on the eclaire.

Heading back to some other targets soon.

Actions #19

Updated by foft almost 5 years ago

Building the mcc216 with this latest firmware + plumbing changes. Realized the scandoubler will not fit in the memory at the same time as this larger firmware, arg!

Actions #20

Updated by foft almost 5 years ago

freezer 1024 1
antic 1536 1
scandoubler1 14600 2
scandoubler2 14600 2
zpu rom 327680 40
zpu ram 16384 2
" 16384 2
" 16384 2
" 16384 2
sio fifo rx 3840 1
sio fifo tx 2048 1
usb fifo rx 512 1
usb fifo tx 512 1

total ... 58. Perhaps I can specify the fifo to use logic elements instead. Or back to shrinking that zpu rom... Really should be able to get it into 32k!

Actions #21

Updated by foft almost 5 years ago

Tried building with riscv and the firmware size dropped from 37KB to <32KB. Which is great! So might need to reactivate the zpu->riscv plan...

Actions #22

Updated by foft almost 5 years ago

That was with 64-bit riscv, switched to the 32-bit version and its bigger: 39512

Actions #23

Updated by foft almost 5 years ago

-flto gets me to 33244

Actions #24

Updated by foft almost 5 years ago

Experimenting with replacing the menu with a simple structure/code approach, should cut code size somewhat.

Actions #25

Updated by foft almost 5 years ago

Haha, working and much neater, but 300 bytes more

Actions #26

Updated by foft almost 5 years ago

Probably split into too many functions, adding function call overhead...

Anyway should probably target some of these big items:
nm --print-size --size-sort --radix=d ECLAIREXL.elf | less

0007457 00000527 T tfp_format
00012850 00000571 T flash_rpd
00003149 00000617 t follow_path
00003760 00000627 T pf_mount
00032220 00000633 T usb_dispatchPktWithData
00018367 00000656 T handleRead
00009291 00000685 T display_menu
00005062 00000720 T pf_readdir
00033905 00000769 T usb_poll
00016633 00000915 T set_drive_status
00006091 00001083 T file_selector
00019667 00001179 T loadAtxSector
00029689 00001464 T parse_report_descriptor
00058972 00001568 B devices
00021992 00001880 t usb_hid_parse_conf
00023478 00003296 t usb_hid_init
00026289 00004307 t usb_hid_poll

Actions #27

Updated by foft almost 5 years ago

Need to save 6k. Lots of complexity in the USB, largely for supporting the custom mcc joysticks. I could comment them but its mostly for the MCC that I have memory issues so I want to support the official joypads!

Idea: Really USB pollling is simple, send an in request then a byte stream is returned with some bits set/unset (buttons) and signed/unsigned values (axes). Could store a file with a mapping in per vid/iid and have simple code to apply. So we simplify structure and use files for custom devices.

Actions #28

Updated by foft almost 5 years ago

Perhaps I could even write byte stream to a hardware buffer and have regs for axis offset, axis type (signed/unsigned), button offset. Then poll becomes just sending an in request and writing to this hardware buffer. init becomes initializing these regs from a vid named file (optional) or decoding HID.

Actions #29

Updated by foft almost 5 years ago

Perhaps a state machine to do the in request too, then I do not even need to call poll.

Actions #30

Updated by foft almost 5 years ago

Saved some memory in USB and also saved some memory by disabling flash. Now fits in 36K on MCC, with a little space. Will do for this board, can save the things I thought of above for later!

Actions #31

Updated by foft almost 5 years ago

mcc_5200 seems fine (minimal changes here). Next up mcctv... Tried to merge diff and quite a lot of failed hunks, will have to do manually.

Actions #32

Updated by foft almost 5 years ago

mcctv 800xl and 5200 working

Actions #33

Updated by foft almost 5 years ago

mist 800xl is working. Skipping mist 5200 since it has been converted into a zpu-free core by György

Actions #34

Updated by foft almost 5 years ago

That is really the main existing boards that worked well. Might do a release build with this state.

After which these remain...
  1. papilio duo - simple port. Since its xilinx will need to fix the fifo (using Intel IP...)
  2. fpgaarcade - never did a decent port but am keen to wire it up properly
  3. de1 - will probably limit to: pure de1, de1 with 'standard' joystick ports and skip my breakout boards. I imagine anyone who has them not has the real deal (i.e. eclaireXL).
  4. sockit - keen to try the ddr3 ram and also the hps->fpga pin rererouting stuff.
  5. aeon lite - if my soldering still works!
Actions #36

Updated by foft almost 5 years ago

Trying to get pll switching working on other boards (different ip than on cyclone v)...

Actions #37

Updated by foft almost 5 years ago

So near and yet so far... Re-configures and still have ready screen at slightly different frequency. But ZPU and 6502 seem to have locked solid. Not sure why, I'm freezing the clock and holding reset high. Must be some kind of glitch I guess.

Actions #38

Updated by foft almost 5 years ago

Freezing/restarting all the clocks with my state machine works just fine. I wonder if the reconfig somehow destroys the phase relationship between the clocks or something.

Plan:
i) Create another high frequency clock with the USB PLL (not reconfigured)
ii) Delete the non-pll stuff to make space
iii) Add a signal tap logic analyzer to look at the clocks
iv) Profit!

Actions #39

Updated by foft almost 5 years ago

Results are in, think its sync between the clocks

Actions #40

Updated by foft almost 5 years ago

OK, don't think it was that.

Wrote a much better state machine, configure pll 1 while pll 2 is in reset, wait for it to no longer be busy, wait for it to sync, wait a bit longer for luck, then onto the same for pll 2. Didn't work...

Then messed around a lot and got something working. I do not actually need to reconfigure pll2 (downstream pll) and just re-configuring upstream while resetting downstream works!! I do not understand it but am happy to have a solution.

Trying to wire it up to pal signal so I can switch back and forth.

Actions #41

Updated by foft almost 5 years ago

reset to put back original settings does not crash, but does not put back settings!

Actions #42

Updated by foft almost 5 years ago

PAL/NTSC switching canned test is working on mcctv:-)

Actions #43

Updated by foft almost 5 years ago

Wired up svideo_gtia while I'm at it (i.e. direct palette to svideo, rather than via rgb), looks a bit better... Was mostly since the ntsc palette was not correctly supported.

Actions #44

Updated by foft almost 5 years ago

Last thing to finish up this mcctv version is to make profiles work on the sdcard I guess, one for another day.

Actions #45

Updated by foft over 4 years ago

I added sd card profiles a while back

Actions #46

Updated by foft over 2 years ago

  • Status changed from In Progress to Resolved

Been back on trunk for years now, should close this!

Actions

Also available in: Atom PDF