aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/google/coreboot_table.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 19:20:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-05 19:20:22 -0400
commitabf7dba7c4f77d781f6df50fefb19a64c5dc331f (patch)
tree38648731b502d5aec508f3b33f6616190e598eb6 /drivers/firmware/google/coreboot_table.h
parent07c4dd3435aa387d3b58f4e941dc516513f14507 (diff)
parentb23220fe054e92f616b82450fae8cd3ab176cc60 (diff)
Merge tag 'char-misc-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the "big" char and misc driver patches for 4.18-rc1. It's not a lot of stuff here, but there are some highlights: - coreboot driver updates - soundwire driver updates - android binder updates - fpga big sync, mostly documentation - lots of minor driver updates All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (81 commits) vmw_balloon: fixing double free when batching mode is off MAINTAINERS: Add driver-api/fpga path fpga: clarify that unregister functions also free documentation: fpga: move fpga-region.txt to driver-api documentation: fpga: add bridge document to driver-api documentation: fpga: move fpga-mgr.txt to driver-api Documentation: fpga: move fpga overview to driver-api fpga: region: kernel-doc fixes fpga: bridge: kernel-doc fixes fpga: mgr: kernel-doc fixes fpga: use SPDX fpga: region: change api, add fpga_region_create/free fpga: bridge: change api, don't use drvdata fpga: manager: change api, don't use drvdata fpga: region: don't use drvdata in common fpga code Drivers: hv: vmbus: Removed an unnecessary cast from void * ver_linux: Drop redundant calls to system() to test if file is readable ver_linux: Move stderr redirection from function parameter to function body misc: IBM Virtual Management Channel Driver (VMC) rpmsg: Correct support for MODULE_DEVICE_TABLE() ...
Diffstat (limited to 'drivers/firmware/google/coreboot_table.h')
-rw-r--r--drivers/firmware/google/coreboot_table.h72
1 files changed, 61 insertions, 11 deletions
diff --git a/drivers/firmware/google/coreboot_table.h b/drivers/firmware/google/coreboot_table.h
index 6eff1ae0c5d3..8ad95a94481b 100644
--- a/drivers/firmware/google/coreboot_table.h
+++ b/drivers/firmware/google/coreboot_table.h
@@ -3,7 +3,9 @@
3 * 3 *
4 * Internal header for coreboot table access. 4 * Internal header for coreboot table access.
5 * 5 *
6 * Copyright 2014 Gerd Hoffmann <kraxel@redhat.com>
6 * Copyright 2017 Google Inc. 7 * Copyright 2017 Google Inc.
8 * Copyright 2017 Samuel Holland <samuel@sholland.org>
7 * 9 *
8 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License v2.0 as published by 11 * it under the terms of the GNU General Public License v2.0 as published by
@@ -20,14 +22,6 @@
20 22
21#include <linux/io.h> 23#include <linux/io.h>
22 24
23/* List of coreboot entry structures that is used */
24struct lb_cbmem_ref {
25 uint32_t tag;
26 uint32_t size;
27
28 uint64_t cbmem_addr;
29};
30
31/* Coreboot table header structure */ 25/* Coreboot table header structure */
32struct coreboot_table_header { 26struct coreboot_table_header {
33 char signature[4]; 27 char signature[4];
@@ -38,11 +32,67 @@ struct coreboot_table_header {
38 u32 table_entries; 32 u32 table_entries;
39}; 33};
40 34
41/* Retrieve coreboot table entry with tag *tag* and copy it to data */ 35/* List of coreboot entry structures that is used */
42int coreboot_table_find(int tag, void *data, size_t data_size); 36/* Generic */
37struct coreboot_table_entry {
38 u32 tag;
39 u32 size;
40};
41
42/* Points to a CBMEM entry */
43struct lb_cbmem_ref {
44 u32 tag;
45 u32 size;
46
47 u64 cbmem_addr;
48};
49
50/* Describes framebuffer setup by coreboot */
51struct lb_framebuffer {
52 u32 tag;
53 u32 size;
54
55 u64 physical_address;
56 u32 x_resolution;
57 u32 y_resolution;
58 u32 bytes_per_line;
59 u8 bits_per_pixel;
60 u8 red_mask_pos;
61 u8 red_mask_size;
62 u8 green_mask_pos;
63 u8 green_mask_size;
64 u8 blue_mask_pos;
65 u8 blue_mask_size;
66 u8 reserved_mask_pos;
67 u8 reserved_mask_size;
68};
69
70/* A device, additionally with information from coreboot. */
71struct coreboot_device {
72 struct device dev;
73 union {
74 struct coreboot_table_entry entry;
75 struct lb_cbmem_ref cbmem_ref;
76 struct lb_framebuffer framebuffer;
77 };
78};
79
80/* A driver for handling devices described in coreboot tables. */
81struct coreboot_driver {
82 int (*probe)(struct coreboot_device *);
83 int (*remove)(struct coreboot_device *);
84 struct device_driver drv;
85 u32 tag;
86};
87
88/* Register a driver that uses the data from a coreboot table. */
89int coreboot_driver_register(struct coreboot_driver *driver);
90
91/* Unregister a driver that uses the data from a coreboot table. */
92void coreboot_driver_unregister(struct coreboot_driver *driver);
43 93
44/* Initialize coreboot table module given a pointer to iomem */ 94/* Initialize coreboot table module given a pointer to iomem */
45int coreboot_table_init(void __iomem *ptr); 95int coreboot_table_init(struct device *dev, void __iomem *ptr);
46 96
47/* Cleanup coreboot table module */ 97/* Cleanup coreboot table module */
48int coreboot_table_exit(void); 98int coreboot_table_exit(void);