tile: various console improvements

This change improves and cleans up the tile console.

- We enable HVC_IRQ support on tilegx, with the addition of a new
  Tilera hypervisor API for tilegx to allow a console IPI.  If IPI
  support is not available we fall back to the previous polling mode.

- We simplify the earlyprintk code to use CON_BOOT and eliminate some
  of the other supporting earlyprintk code.

- A new tile_console_write() primitive is used to send output to
  the console and is factored out of the hvc_tile driver.
  This lets us support a "sim_console" boot argument to allow using
  simulator hooks to send output to the "console" as a slightly
  faster alternative to emulating the hardware more directly.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Esse commit está contido em:
Chris Metcalf
2013-08-06 14:11:21 -04:00
commit bda0f5bad8
7 arquivos alterados com 186 adições e 48 exclusões

Ver arquivo

@@ -24,9 +24,8 @@
*/
#define MAXMEM_PFN PFN_DOWN(MAXMEM)
int tile_console_write(const char *buf, int count);
void early_panic(const char *fmt, ...);
void warn_early_printk(void);
void __init disable_early_printk(void);
/* Init-time routine to do tile-specific per-cpu setup. */
void setup_cpu(int boot);

Ver arquivo

@@ -318,8 +318,11 @@
/** hv_set_pte_super_shift */
#define HV_DISPATCH_SET_PTE_SUPER_SHIFT 57
/** hv_console_set_ipi */
#define HV_DISPATCH_CONSOLE_SET_IPI 63
/** One more than the largest dispatch value */
#define _HV_DISPATCH_END 58
#define _HV_DISPATCH_END 64
#ifndef __ASSEMBLER__
@@ -585,6 +588,30 @@ typedef struct
*/
int hv_get_ipi_pte(HV_Coord tile, int pl, HV_PTE* pte);
/** Configure the console interrupt.
*
* When the console client interrupt is enabled, the hypervisor will
* deliver the specified IPI to the client in the following situations:
*
* - The console has at least one character available for input.
*
* - The console can accept new characters for output, and the last call
* to hv_console_write() did not write all of the characters requested
* by the client.
*
* Note that in some system configurations, console interrupt will not
* be available; clients should be prepared for this routine to fail and
* to fall back to periodic console polling in that case.
*
* @param ipi Index of the IPI register which will receive the interrupt.
* @param event IPI event number for console interrupt. If less than 0,
* disable the console IPI interrupt.
* @param coord Tile to be targeted for console interrupt.
* @return 0 on success, otherwise, HV_EINVAL if illegal parameter,
* HV_ENOTSUP if console interrupt are not available.
*/
int hv_console_set_ipi(int ipi, int event, HV_Coord coord);
#else /* !CHIP_HAS_IPI() */
/** A set of interrupts. */