summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/pine64-quartz64/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/pine64-quartz64/board.c')
-rw-r--r--arch/arm/boards/pine64-quartz64/board.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/boards/pine64-quartz64/board.c b/arch/arm/boards/pine64-quartz64/board.c
new file mode 100644
index 0000000000..981de90dd7
--- /dev/null
+++ b/arch/arm/boards/pine64-quartz64/board.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <common.h>
+#include <init.h>
+
+struct quartz64_model {
+ const char *name;
+ const char *shortname;
+};
+
+static int quartz64_probe(struct device_d *dev)
+{
+ const struct quartz64_model *model;
+
+ model = device_get_match_data(dev);
+
+ barebox_set_model(model->name);
+ barebox_set_hostname(model->shortname);
+
+ return 0;
+}
+
+static const struct quartz64_model quartz64a = {
+ .name = "Pine64 Quartz64 Model A",
+ .shortname = "quartz64a",
+};
+
+static const struct of_device_id quartz64_of_match[] = {
+ {
+ .compatible = "pine64,quartz64-a",
+ .data = &quartz64a,
+ },
+ { /* sentinel */ },
+};
+
+static struct driver_d quartz64_board_driver = {
+ .name = "board-quartz64",
+ .probe = quartz64_probe,
+ .of_compatible = quartz64_of_match,
+};
+coredevice_platform_driver(quartz64_board_driver);