[PPC] Move include/asm-ppc/arch-* to arch/ppc/*/include/mach
[barebox-mini2440.git] / include / console.h
blobe63294654958db1f9b95eda73e80b8e788ba018c
1 /*
2 * (C) Copyright 2000
3 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
24 #ifndef _CONSOLE_H_
25 #define _CONSOLE_H_
27 #include <param.h>
28 #include <list.h>
29 #include <driver.h>
31 #define CONSOLE_STDIN (1 << 0)
32 #define CONSOLE_STDOUT (1 << 1)
33 #define CONSOLE_STDERR (1 << 2)
35 struct console_device {
36 struct device_d *dev;
37 struct device_d class_dev;
39 int (*tstc)(struct console_device *cdev);
40 void (*putc)(struct console_device *cdev, char c);
41 int (*getc)(struct console_device *cdev);
42 int (*setbrg)(struct console_device *cdev, int baudrate);
43 void (*flush)(struct console_device *cdev);
45 struct list_head list;
47 unsigned char f_caps;
48 unsigned char f_active;
50 struct param_d baudrate_param;
51 char baudrate_string[8];
53 struct param_d active_param;
54 char active[4];
57 int console_register(struct console_device *cdev);
59 extern struct list_head console_list;
60 #define for_each_console(console) list_for_each_entry(console, &console_list, list)
62 #define CFG_PBSIZE (CONFIG_CBSIZE+sizeof(CONFIG_PROMPT)+16)
64 void early_console_putc(void *base, char c);
65 void early_console_init(void *base, int baudrate);
67 void early_console_start(const char *name, int baudrate);
70 * Resolve an early console name to a pointer pointing
71 * to the consoles base address, usually implemented in
72 * board setup file.
74 void *get_early_console_base(const char *name);
76 #endif