Commit graph

106 commits

Author SHA1 Message Date
Sean Cross
7321bd91ad vsprintf: Emit '\r' when printing '\n'
Since putc() doesn't automatically print '\r' when '\n' is printed,
we must manually do this conversion ourselves.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:30:59 +08:00
Sean Cross
0bfdbb314f fernly-usb-loader: Get rid of call to 'screen'
Since we have an internal terminal of sorts, remove the call to 'screen'
when not running in monitor mode.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:30:03 +08:00
Sean Cross
9aad9797e6 README: Document flsahrom protocol
The flashrom protocol is binary, for speed.  Document this protocol.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:29:04 +08:00
Sean Cross
fb9c876148 cmd-spi: Add binary mode for flashrom
In order to improve reliability, add a binary mode for interacting
with the SPI chip.  This lets us hook up flashrom.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:28:29 +08:00
Sean Cross
7fd6d1d093 bionic: Emit \r in puts()
Since serial_putc() doesn't automatically add \r to \n, add it in puts().

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:14:14 +08:00
Sean Cross
70140aa665 serial: Fix serial driver
The serial driver was having issues reading data.  This commit makes
the serial driver more robust.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:05:03 +08:00
Sean Cross
1602ba550c serial: Fix USB data receive
Due to a typo, USB receive was unreliable.  This patch corrects a typo
that was causing USB receive to fail on certain devices.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-03 15:01:01 +08:00
Jacob Rosenthal
4f74885821 README: Add information on OS X serial driver
The default USB-CDC driver that ships with OS X does not recognize the
Fernvale platform.

Link to a repo maintianed by Jacob Rosenthal that works around the problem.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:49:50 +08:00
Robert Foss
1e9fd14f3e README: Add cross compilation instructions
To make cross-compilation easy, refer users to the setup_codesourcery
repo that is maintained by Robert Foss.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:46:20 +08:00
Robert Foss
a8bd97b5d0 fernly-usb-loader: Silence a few printf warnings
This silences some printf() warnings that appear due to varying sizes
of printf arguments.
2015-02-02 17:42:46 +08:00
Sean Cross
0a5441d26e cmd-keypad: Slight formatting adjustments
Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:35:08 +08:00
Sean Cross
2b8a2a0b66 gitignore: Add fernly.log to ignored file list
Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:28:07 +08:00
Sean Cross
46d4e242ee Makefile: Use relative build path for 'make test'
Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:27:49 +08:00
Sean Cross
f7f40242ac scriptic: Correct debug output format
Replace %004x with %04x and %008x with %08x.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 17:27:48 +08:00
Sourcerer
f29a9e686d kbd: Add keypad support
This adds support for the Fernvale keypad.

Signed-off-by: Sourcerer <sourcerer@gmx.at>
2015-02-02 17:26:09 +08:00
Sean Cross
09bf775667 fernly-usb-loader: Correct stdio handle numbers
Use the macros STDIN_FILENO and STDOUT_FILENO to refer to the file
handles for stdin and stdout.  This prevents us from using the wrong handle
to write or read, which was a problem with the older code.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 16:50:03 +08:00
Sean Cross
eacfd9ff72 vsprintf: Fix <sys/string.h> include on Novena
This file does not exist.  Include <string.h> instead.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-02 16:42:32 +08:00
Mandl
eba08f0218 bionic: fix gcc build
The memset() prototype from glibc includes __THROW and __nonnull as
decorators, which are nonstandard.  Remove these for additional
compatibility with gcc.

Additionally, remove linux/types.h and linux/string.h, and replace them
with sys/types.h and sys/string.h.
2015-01-14 12:16:46 +08:00
thesourcerer8
e948d27bb0 fernly-usb-loader: Log output to fernly.log
Log output received from the Fernvale board to a logfile.

Signed-off-by: thesourcerer8 <pg@futureware.at>
2015-01-14 12:14:06 +08:00
thesourcerer8
51c7932150 Makefile: Add a "make test" target
The "make test" target allows for more convenient testing of new code.  It
uses novena-usb-hub to power-toggle the USB port on Novena, then upload the
new build of fernly.

Signed-off-by: thesourcerer8 <pg@futureware.at>
2015-01-14 12:12:50 +08:00
Sean Cross
ae59347cd1 serial: Add \r when \n is printed
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:53:16 +08:00
Sean Cross
78d5cff679 main: Use serial_putc() for one-character prints
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:53:05 +08:00
Sean Cross
9ceaffea5d bionic: Use serial functions for puts() / putchar()
gcc will automatically use these functions for certain operations.  Don't
punt and use printf(), instead call serial_putc and serial_puts.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:52:48 +08:00
Sean Cross
5fc9fa9830 spi: use memcpy() and not _memcpy()
We renamed it to match the standard name.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:14:55 +08:00
Sean Cross
b4232c3641 serial: Disable optimization to fix code
Building with -O2 or -Os causes serial to not work.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:14:11 +08:00
Sean Cross
8fe8d061f4 bionic: Rename _memcpy() to memcpy()
We properly replicate the standard function prototype, so use the real name.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:13:05 +08:00
Sean Cross
efef6b1e14 Makefile: Remove loader, fix objcopy
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:21:18 +08:00
Sean Cross
e8a34a9996 main: Fix build warning on serial_get_char()
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:19:28 +08:00
Sean Cross
2cad716460 vsprintf: Fix build warning for %t
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:18:39 +08:00
Sean Cross
54bf2397ec fernly: Remove serial loader
Everything is done via USB now, so it is no longer needed.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:17:06 +08:00
Sean Cross
bf5535da01 cmd-spi: Add spi_raw command
These commands are needed to get flashrom support.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:15:57 +08:00
Sean Cross
0b22ad3555 bionic: Fix toupper() command
It had its logic inverted.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:15:35 +08:00
Sean Cross
57ee15485b bionic: Fix build with gcc
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 12:31:13 +08:00
Sean Cross
912952ef9b mkenv: Move away from clang
It was nice, but it isn't as good at cross-compiling yet.  Plus, by sticking
with gcc, we have one compiler throughout the entire system.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 12:29:06 +08:00
Sean Cross
4f7c0e8b14 Makefile: Add _lshrdi3.S
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 12:28:52 +08:00
Sean Cross
5abb3dbfdc README: Make instructions clearer
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 12:28:25 +08:00
Sean Cross
478a3abf1e Merge branch 'master' of https://github.com/projectgus/fernly 2014-12-30 12:10:25 +08:00
Sean Cross
62c79bf5c0 fernly: Add USB loader
Add the fernly usb loader, imported from NuttX.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-29 09:26:22 +08:00
Angus Gratton
d79ed33fbf README - memory map table now renders in github flavored markdown 2014-12-20 15:00:12 +11:00
Sean Cross
95fea803e1 main: Print register list after initing serial
The serial is in an unknown state at the start, so print the
register list after init.

This will cause some registers to get clobbered.  If we really need
to know the state of the registers early on, we should copy them
to RAM before our init code runs.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-02 13:44:52 +08:00
Sean Cross
a15a05f074 serial: Fix up host timing
The USB device was triggering bugs in the Linux USB stack.  Possibly
a queueing issue, I'm not sure.  The end result was corruption in audio
playback, probably due to DMA timing issues.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-02 13:44:24 +08:00
Sean Cross
efd039aab1 main: Initialize LCD on boot
Now that we have LCD working, we can initialize the LCD when the board boots.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:44:13 +08:00
Sean Cross
682a309193 cmd-lcd: Remove "lcd setup" command
This function no longer exists.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:43:51 +08:00
Sean Cross
c2d17ffef2 lcd: get rid of lcd_setup()
Combine init and setup into one function, and call it lcd_init().

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:43:42 +08:00
Sean Cross
58d7c3b17a vsprintf: expose strtoul function
This function is a wrapper around simple_strtoul, and allows us to expose
it, replacing the one in bionic.c.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:33:36 +08:00
Sean Cross
2e3dfee040 magic: Force the use of gcc for scriptic
Scriptic uses some directives that aren't available in clang, so assemble
scripts using gcc.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:33:20 +08:00
Sean Cross
a7ff5acb5d lcd: improve DMA support
Rather than completely rewriting everything on each runthrough, we
now only refill the command buffer before toggling the RUN bit.

This will improve performance by eliminating excessive register writes.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:30:33 +08:00
Sean Cross
f5434fe897 cmd-lcd: Refactor lcd command, get PIO/DMA working
This major refactor of the "lcd" command gets two different PIO test
commands working (tpp1 and tpp2), along with a test command for dma
(tpd) that, when called multiple times, will step through a framebuffer
pattern and blast it out to the screen.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:28:42 +08:00
Sean Cross
b8a7aedbd7 lcd: Add basic LCD library
This supports setting up the LCD, and then starting a transfer.

Interrupts are required to have self-refresh working.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 17:10:00 +08:00
Sean Cross
fe826f6e1d emi: Remove infinite loop waiting on calibration
We used to while(1) wait for EMI to calibrate, but sometimes EMI never
returns from calibration.  Break if it hasn't finished after 256 tries.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 13:13:38 +08:00