summaryrefslogtreecommitdiff
path: root/drivers/serial/serial-uclass.c
Commit message (Collapse)AuthorAgeLines
* fdt: remove fdtdec_get_alias_node() functionMasahiro Yamada2014-11-27-1/+1
| | | | | | | | | | The fdt_path_offset() checks an alias too. fdtdec_get_alias_node(blob, "foo") is equivalent to fdt_path_offset(blob, "foo"). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2014-11-24-3/+74
|\ | | | | | | | | | | | | Conflicts: drivers/serial/serial-uclass.c Signed-off-by: Tom Rini <trini@ti.com>
| * dm: Allow stdio registration to be droppedSimon Glass2014-11-21-3/+7
| | | | | | | | | | | | | | | | | | Provide a CONFIG_DM_STDIO option to enable registering a serial device with the stdio library. This is seldom useful in SPL, so disable it by default when building for SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
| * dm: serial: Support changing the baud rateSimon Glass2014-11-21-0/+67
| | | | | | | | | | | | | | Implement this feature in the uclass so that the baudrate can be changed with 'setenv baudrate <rate>'. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: serial: Move current serial port pointer to global_dataSimon Glass2014-11-21-16/+19
|/ | | | | | | | | | | In general we can't store things in the data section until we have inited SDRAM. Some platforms allow this (e.g. those with SPL) but some don't. Move the pointer to global_data so that it will work on all platforms. Without this fix the serial port will not work prior to relocation with driver model on some platforms. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: consolidate common code moreMasahiro Yamada2014-10-23-38/+41
| | | | | | | | | | | Commit b8893327e9d2 (dm: serial: Put common code into separate functions) consolidated getc() and putc(). This commit does more puts() and tsts(). Also rename locally used functions to _serial_*() for clarification because we have similar functions names here are there in this file. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: serial: remove unnecessary castingMasahiro Yamada2014-10-23-6/+2
| | | | | | | | The type (void *) can be directly passed to a function that takes a specific pointer type. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: serial: fix console putcMasahiro Yamada2014-10-23-3/+3
| | | | | | | | | | Commit b8893327e9d2 (dm: serial: Put common code into separate functions) consolidated getc() correctly, but introduced another bug to putc(); serial_stub_putc() passes sdev->priv to serial_putc_dev(), but serial_putc_dev() uses cur_dev instead of the given argument. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: serial: Support CONFIG_CONS_INDEX if availableSimon Glass2014-10-23-1/+10
| | | | | | | | Try to use this option to select the correct uart for the console. This mimics the behaviour of drivers/serial.c. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: serial: Reset the watchdog while waiting in getc()Simon Glass2014-10-23-0/+5
| | | | | | | | | | | | | We have moved the busy-wait loop out of drivers and into the uclass. This means that we must reset the watchdog when busy-waiting. Note: some drivers may still have a busy-wait even with driver model, as a transition mechanism. Driver model will tolerate this, and is can be cleaned up when all users of the driver use driver model. An example is ns16550. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: serial: Put common code into separate functionsSimon Glass2014-10-22-15/+17
| | | | | | | Avoid duplicating the code which deals with getc() and putc(). It is fairly simple, but may expand later. Signed-off-by: Simon Glass <sjg@chromium.org>
* serial-uclass: Fix compilation errorHans de Goede2014-10-10-1/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* stdio: Add force parameter to stdio_deregisterHans de Goede2014-10-06-1/+1
| | | | | | | In some cases we really want to move forward with a deregister, add a force parameter to allow this, and replace the dev with a nulldev in this case. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* dm: serial: Don't require device tree to configure a consoleSimon Glass2014-09-23-1/+2
| | | | | | Allow serial_find_console_or_panic() to work without a device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a uclass for serial devicesSimon Glass2014-09-10-0/+213
Serial devices support simple byte input/output and a few operations to find out whether data is available. Add a basic uclass for serial devices to be used by drivers that are converted to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>