4 * Coreboot table access through open firmware.
6 * Copyright 2017 Google Inc.
8 * 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
10 * the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include <linux/device.h>
20 #include <linux/module.h>
21 #include <linux/of_address.h>
22 #include <linux/platform_device.h>
24 #include "coreboot_table.h"
26 static int coreboot_table_of_probe(struct platform_device
*pdev
)
28 struct device_node
*fw_dn
= pdev
->dev
.of_node
;
31 ptr
= of_iomap(fw_dn
, 0);
35 return coreboot_table_init(&pdev
->dev
, ptr
);
38 static int coreboot_table_of_remove(struct platform_device
*pdev
)
40 return coreboot_table_exit();
43 static const struct of_device_id coreboot_of_match
[] = {
44 { .compatible
= "coreboot" },
47 MODULE_DEVICE_TABLE(of
, coreboot_of_match
);
49 static struct platform_driver coreboot_table_of_driver
= {
50 .probe
= coreboot_table_of_probe
,
51 .remove
= coreboot_table_of_remove
,
53 .name
= "coreboot_table_of",
54 .of_match_table
= coreboot_of_match
,
57 module_platform_driver(coreboot_table_of_driver
);
59 MODULE_AUTHOR("Google, Inc.");
60 MODULE_LICENSE("GPL");