1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-25 21:04:34 +02:00
Commit Graph

77 Commits

Author SHA1 Message Date
Werner Almesberger
9942f62cb8 ubb-vga/regs4740.h: add some more register locations 2012-07-22 02:31:38 -03:00
Werner Almesberger
92ce05358b ubb-vga.c (usage): correct synopsis (-r is now called -m) 2011-07-04 15:09:22 -03:00
Werner Almesberger
19c04403c0 ubb-vga/web/index.html: correction - it's the response we fake, not the "busy"
"Busy" is actually another signal, on DAT0, and sent betweeen blocks.
We don't fake that one (so far), although the mechanism would be similar.
2011-05-07 17:48:30 -03:00
Werner Almesberger
88e09d003b index.html: moved author's name; file format of images we can load was incorrect
- index.html: don't boastfully start the page with my name. The footer
  will do well enough.
- index.html: the image format we can load is PPM (pixmap), not PNM
  (anymap)
2011-05-07 13:51:46 -03:00
Werner Almesberger
f1efa9ed59 ubb-vga/web/index.html: added links to #qi-hardware and the mailing list 2011-05-07 10:16:58 -03:00
Werner Almesberger
91bc5eacdd ubb-vga/web/: link to medium-size images, not full size; some rewording
- Makefile, index.html: generate Web-friendly 1024x768 images and link
  to these, instead of the full-sized monsters
- index.html: minor rewording
- index.html: corrected capitalization of "NanoNote"
2011-05-07 09:49:39 -03:00
Werner Almesberger
0937c4abec ubb-vga/web/index.html: minor wording improvement; give images more space 2011-05-07 05:17:22 -03:00
Werner Almesberger
3f054e1f90 ubb-vga/web/index.html: some changes in wording and text structure 2011-05-07 05:11:58 -03:00
Werner Almesberger
64e74ab63c ubb-vga/web/: generate a Web page describing UBB-VGA (im progress) 2011-05-07 04:46:43 -03:00
Werner Almesberger
ba1d297643 ubb-vga: new option -2 to keep on refreshing the LCD display (experimental)
"Experimental" means that it doesn't seem to work at the moment.

- regs4740.h (_LCD, LCDCTRL): added the LCD control register
- ubb-vga.c (old_lcdctrl, tame_lcd, restore_lcd): make the LCD controller
  use short bursts, to reduce the bus access latency for other users
- ubb-vga.c (keep_lcd, setup_noirq, cleanup_noirq, usage, main): new
  option -2 to keep on refreshing the LCD display
2011-05-06 20:19:38 -03:00
Werner Almesberger
f7e8fbbaea ubb-vga.c: moved timer setup and LCD disabling into noirq setup
- ubb-vga.c (ben_setup, setup_noirq): moved calls to disable_lcd and
  get_timer to setup_noirq
- ubb-vga.c (cleanup, cleanup_noirq): moved calls to release_timer
  and enable_lcd to cleanup_noirq
- ubb-vga.c (cleanup, main): "cleanup" is now empty; removed it
2011-05-06 19:36:34 -03:00
Werner Almesberger
6c3adaf08f ubb-vga/Makefile (vga-ben-back.png): also generate the PCB back side image 2011-05-04 14:13:04 -03:00
Werner Almesberger
3b4f72de1c ubb-vga: added draft of "productized" assembly
- prod-assembly-draft.fig: assembly drawing
- Makefile (vga-ben-front.png): render the PCB's front
2011-05-04 13:45:19 -03:00
Werner Almesberger
6f5a8ccf5a ubb-vga: added draft for "productized" design
- vga-ben.pro, vga-ben.sch, vga-ben.cmp, vga-ben.pro: similar to
  ubb-vga.sch, but with R and Y swapped (for better grounding), the VGA
  connector replaced by solder pads, and added pads for the shield
- Makefile (schp, brd): new targets for editing vga-ben
2011-05-04 12:46:34 -03:00
Werner Almesberger
01d33e28a7 ubb-vga.c (delay): try to compensate for APB jitter (experimental)
First, we extend all deadlines a litte to make sure we never have to
wait negative time. Second, we get the timer value at the end of the
wait and CPU-loop for the difference between the actual value and the
ideal (extended) value.
2011-05-03 12:09:24 -03:00
Werner Almesberger
72235b9212 ubb-vga/README: first 640x480 success with the 206NW; housekeeping
- README: added Samsung 206NW results for "640x480/61"
- README: fixed typo in W2243L "800x600/56" entry
2011-05-03 12:09:11 -03:00
Werner Almesberger
5817669968 ubb-vga: try to clock MSC faster than the MMC bus; new video mode "640x480/61"
- ubb-vga.c (mode_db): added new mode "640x480/61"
- ubb-vga.c (setup, line): MSC_CLKRT is reset when the MSC resets. Moved
  it from "setup" to "line".
- ubb-vga.c (clkrt, setup, line): pick the highest available MSC clock
  and adjust the bus clock divider accordingly
- ubb-vga.c (main): added commented-out clock debugging output
- README: added XEN-1510T result for "640x480/61"
2011-05-03 10:19:16 -03:00
Werner Almesberger
887012a58a ubb-vga/README: added results for Samsung LN32R71B TV 2011-05-02 20:45:44 -03:00
Werner Almesberger
77adf43551 ubb-vga/README: moved old content away and added new compatibility test results
- README.old: moved old content here
- README: updated and extended compatibility chart
2011-05-02 20:06:46 -03:00
Werner Almesberger
3686153943 ubb-vga: housekeeping
- ubb-vga.c: added "friendly" 640x480 mode based on
  http://faculty.lasierra.edu/~ehwang/public/mypublications/VGA Monitor Controller.pdf
- README: added regressions and a new challenge
2011-05-02 07:10:52 -03:00
Werner Almesberger
6d8c8dd951 ubb-vga: use a free-running counter instead of resetting it for each line
Two benefits:
1) We don't accumulate errors from the delay between the timer reset and
   the deadline preceding it
2) In the future, we may use WAIT to wait for timer expiration, which
   should cause less bus activity and is should also reduce jitter

- regs4740.h (TFR. TFSR, TFCR, TDHR): added more timer registers
- ubb-vga.c (until): renamed to "delay" and changed to measure relative
  to the last deadline
- ubb-vga.c (line, hdelay, frame): replaced "until" with "delay"
- ubb-vga.c (hdelay, frame, session): reset the timer only once, at
  the beginning of the session
- ubb-vga.c (frame): we didn't wait for the horizontal back porch of
  the last image line
2011-05-02 06:11:29 -03:00
Werner Almesberger
a3cea3573c ubb-vga: send a line's last DMA transfer also if only partially filled
This caused 800x600 images to be cut off, because the line length is
not a multiple of 64 bytes.

- ubb-vga.c (session): make the allocation a multiple of the DMA
  transfer size
- ubb-vga.c (line): round number of transfers up instead of down
- ubb-vga.c (mode_db): line duration of 800x600/54 was a bit to short
2011-05-02 05:25:15 -03:00
Werner Almesberger
3ea6b9852e ubb-vga: make lines end in black (and not in overscan)
- ubb-vga.c (line): send a 0 word at the end of the line, to avoid
  overscan (we use PIO to synchronize with CPU timing)
- ubb-vga.c (mode_db): updated line length of 640x480 resolutions for
  correct termination
2011-05-02 05:16:19 -03:00
Werner Almesberger
0dbf29e599 physmem.c: improved correctness and efficiency of alignment
- physmem.c (align_brk): don't waste memory if already aligned
- physmem.c (ALIGN, calloc_phys_vec): align by DMA transfer size
- physmem.c (calloc_phys_vec): make sure allocations don't straddle
  page boundaries
- physmem.c (xlat_one): print "unsigned long" with %lx, not %x
2011-05-02 04:43:18 -03:00
Werner Almesberger
893884c91f ubb-vga/README: added to do list 2011-05-01 23:32:24 -03:00
Werner Almesberger
319d8a044b tstimg.c (tstimg): adjust size and position of parameters according to yres 2011-05-01 23:19:57 -03:00
Werner Almesberger
4450a30456 ubb-vga.c (list_modes, usage, main): new option -l to list available modes 2011-05-01 23:12:38 -03:00
Werner Almesberger
b184fbbe74 ubb-vga.c (mode_db): cleanup and added approximations of standard modes 2011-05-01 23:00:35 -03:00
Werner Almesberger
9412c9debe ubb-vga: test image now shows detailed horizontal and vertical timing
- ubb-vga.c (CYCLES), ubb-vga.h: corrected conversion and moved to
  ubb-vga.h
- tstimg.c (printc): added characters '=' and '+'
- tstimg.c (tstimg): print detailed horizontal and vertical timing
2011-05-01 21:50:20 -03:00
Werner Almesberger
4b59dbf062 ubb-vga: express mode data in more common units and remove hard-coded constants
- ubb-vga.h (struct mode), ubb-vga.c (mode_db): replaced hsync_end with
  its constituends hsync_cycles and hback_cycles
- ubb-vga.h (struct mode), ubb-vga.c (mode_db): added vsync_lines,
  vfront_lines, and vback_lines
- ubb-vga.h (struct mode): changed "line_cycles" from "int" to
  "uint16_t"
- ubb-vga.c (line): don't hard-code horizontal back porch
- ubb-vga.c (line): don't hard-code sum of horizontal back porch and
  hsync
- ubb-vga.c (hdelay): don't hard-code hsync
- ubb-vga.c (frame): don't hard-code vsync and the vertical porches
- ubb-vga.c (frame): don't hard-code hsync and horizontal back porch
2011-05-01 20:59:38 -03:00
Werner Almesberger
aa2fc7101d ubb-vga.c (mode_db): added 1024x768, 53 Hz mode (56 MHz pixel clock) 2011-05-01 18:55:29 -03:00
Werner Almesberger
606dd63492 tstimc.c (tstimg): frame rate calculation didn't include the vsync pulse 2011-05-01 18:54:44 -03:00
Werner Almesberger
934a89bfa5 ubb-vga: added quick and dirty run-until-keypress mode
- ubb-vga.c (KEY_MASK): KEYINx lines on port D
- ubb-vga.c (session): run until keypress if the number of frames is
  zero
- ubb-vga.c (main): set frames to zero if omitted
2011-05-01 16:41:32 -03:00
Werner Almesberger
30079397f5 tstimg.c (tstimg): display timing parameters 2011-05-01 15:23:19 -03:00
Werner Almesberger
eabd0b53f6 ubb-vga: make mode information global
- ubb-vga.c (mode), ubb-vga.h: made global
2011-05-01 15:17:30 -03:00
Werner Almesberger
f7eb220401 ubb-vga: gently prepare the code for sharing mode information
This is tricky: if we just make "mode" global, the whole timing may
fall apart, with the DMA locking up. So let's take small bisectable
steps to get there ...

- ubb-vga.c (struct mode), ubb-vga.h: moved mode entry declaration to
  ubb-vga.h
- ubb-vga.c (mode_db): moved up
2011-05-01 15:17:01 -03:00
Werner Almesberger
90b087cea0 ubb-vga.c (struct mode, mode_db): removed no longer used field "line_words" 2011-05-01 14:47:16 -03:00
Werner Almesberger
7d16a0682d tstimg.c: completed the alphabet
- tstimg.c (printc): added diagonal to '0' (zero) to distinguish it from
  'O' (oh)
- tstimg.c (printc): added "nose" to '1' to better distinguish it from
  'I'
- tstimg.c (printc): completed the alphabet
- tstimg.c (printc): added '.' character
2011-05-01 14:29:11 -03:00
Werner Almesberger
9fb5c6f3f4 ubb-vga.c: moved some DMA settings from per-line to per-session setup
- ubb-vga.c (setup_noirq, line): moved DMA channel command setting to
  per-session setup
- ubb-vga.c (setup_noirq, line): moved DMA request type setting to
  per-session setup
- ubb-vga.c (line): added commend that the target address needs to be
  set for each transfer, even if it doesn't change
2011-05-01 13:54:54 -03:00
Werner Almesberger
b273f27c07 ubb-vga.c: DMA was set to transfer twice the amount needed, oops
- ubb-vga.c (line): removed unnecessary DMA channel reset
- ubb-vga.c (line): number of words is pixels/64, not pixels/32
2011-05-01 13:22:08 -03:00
Werner Almesberger
a8a0cfa22f ubb-vga.c: added (fragile) DMA support (locks up on anything but 800x600)
Note that DMA is very sensitive to the video timing. At the moment,
only 800x600 mode works without locking up the DMA controller.

- ubb-vga.c (DMA, setup_noirq, cleanup_noirq, line): replaced MMC PIO
  with DMA
- ubb-vga.c (frame): pass physical addresses to "line"
- ubb-vga.c (frame): detect if the DMA controller is stuck
2011-05-01 12:22:23 -03:00
Werner Almesberger
64f3047144 ubb-vga.c: cleaned up setup process and prepared for DMA
- ubb-vga.c (setup): made "static"
- ubb-vga.c (setup_noirq, cleanup_noirq, session): added functions for
  setup tasks to perform with interrupts off
2011-04-29 22:48:01 -03:00
Werner Almesberger
8d803dda4c ubb-vga.c: housekeeping
- ubb-vga.c (ben_setup): use REG_WINDOW instead of calculating the
  window size
- ubb-vga.c (PAGE_SIZS): we no longer need it - removed
- ubb-vga.c (line): shift bus width setting in MSC_CMDAT by the field
  position, not the bit position
- ubb-vga.c (line): moved comment detailing the search for the
  adjustment value to the mode database, so that we don't clutter
  this function
2011-04-29 22:22:51 -03:00
Werner Almesberger
1a7b5015f1 regs4740.h: added DMAC registers; added virt to phys translation; cleanup
- regs4740.h (REG_PADDR): translate a register access to the
  corresponding physical address
- regs4740.h (REG_WINDOW): added register window size
- regs4740.h (CGU, INT, TCU, GPIO, MSC): prefix register group macros
  with an underscore, to avoid name collision with DMAC
- regs4740.h: added DMAC registers
- regs4740.h (MSC_NOP): should be MSC_NOB
2011-04-29 22:09:42 -03:00
Werner Almesberger
6cd21404cd physmem.c: added virtual to physical translation
- physmem.c (calloc_phys_vec): malloc the vector instead of sbrk'ing it
- ubb-vga.h (xlat_virt), physmem.c (xlat_one, xlat_virt): translate a
  vector of virtual addresses to physical addresses
2011-04-29 21:15:27 -03:00
Werner Almesberger
3a8e062c48 renamed ubb-vga.c to ubb-vga-old.c, ubb-vga2.c to ubb-vga.c; updated Makefile 2011-04-29 14:03:07 -03:00
Werner Almesberger
debe9cc351 physmem.c: align memory to word and page size
- physmem.c (align_sbrk): align the end of the data segment
- physmem.c (calloc_phys_vec): align the line pointer vector to a machine
  word, just in case
- physmem.c (calloc_phys_vec): crudely align the line buffers within
  pages, to avoid page-crossing within a line (yes, this does reduce
  noise)
2011-04-29 14:01:17 -03:00
Werner Almesberger
2cee702ff4 tstimg.c (grill): avoid fencepost errors (pixel at xres/yres) 2011-04-29 14:01:16 -03:00
Werner Almesberger
f608e561a2 ubb-vga2.c (main): fixed check for unknown resolution and call it "mode" 2011-04-29 14:00:58 -03:00
Werner Almesberger
a63579e119 ubb-vga2.c (line, frame): start line timer outside the "line" function
The indirection introduced with the non-contiguous frame buffer caused
significant horizontal distortions. We can compensate for them by
starting the timer before loading the line pointer and calling "line".
2011-04-29 13:28:22 -03:00