summaryrefslogtreecommitdiff
path: root/release/src/linux/linux/include/linux/hcdp_serial.h
blob: c5c11cb691eeef0b427c053f7a9caae893ae9111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 *  linux/include/linux/hcdp_serial.h
 *
 *  Copyright (C) 2002  Hewlett-Packard Co.
 *  Copyright (C) 2002  Khalid Aziz <khalid_aziz@hp.com>
 *
 *  Definitions for HCDP defined serial ports (Serial console and 
 *  debug ports)
 *
 */
#ifndef _LINUX_HCDP_SERIAL_H
#define _LINUX_HCDP_SERIAL_H

/* ACPI table signatures */
#define HCDP_SIG_LEN		4
#define HCDP_SIGNATURE		"HCDP"

/* Space ID as defined in ACPI generic address structure */
#define ACPI_MEM_SPACE		0
#define ACPI_IO_SPACE		1
#define ACPI_PCICONF_SPACE	2

/* 
 * Maximum number of HCDP devices we want to read in
 */
#define MAX_HCDP_DEVICES	6

/*
 * Default base baud rate if clock rate is 0 in HCDP table.
 */
#define DEFAULT_BAUD_BASE	115200

/* 
 * ACPI Generic Address Structure 
 */
typedef struct {
	u8  space_id;
	u8  bit_width;
	u8  bit_offset;
	u8  resv;
	u32 addrlo;
	u32 addrhi;
} acpi_gen_addr;

/* HCDP Device descriptor entry types */
#define HCDP_DEV_CONSOLE	0
#define HCDP_DEV_DEBUG		1

/* HCDP Device descriptor type */
typedef struct {
	u8	type;
	u8	bits;
	u8	parity;
	u8	stop_bits;
	u8	pci_seg;
	u8	pci_bus;
	u8	pci_dev;
	u8	pci_func;
	u64	baud;
	acpi_gen_addr	base_addr;
	u16	pci_dev_id;
	u16	pci_vendor_id;
	u32	global_int;
	u32	clock_rate;
	u8	pci_prog_intfc;
	u8	resv;
} hcdp_dev_t;

/* HCDP Table format */
typedef struct {
	u8	signature[4];
	u32	len;
	u8	rev;
	u8	chksum;
	u8	oemid[6];
	u8	oem_tabid[8];
	u32	oem_rev;
	u8	creator_id[4];
	u32	creator_rev;
	u32	num_entries;
	hcdp_dev_t	hcdp_dev[MAX_HCDP_DEVICES];
} hcdp_t;

#endif	/* _LINUX_HCDP_SERIAL_H */