blob: 3c2bff0b7ef396c5afdec19b78c830921df1e631 [file] [log] [blame]
David Brazdil17e76652020-01-29 14:44:19 +00001/*
2 * Copyright 2020 The Hafnium Authors.
3 *
Andrew Walbrane959ec12020-06-17 15:01:09 +01004 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
David Brazdil17e76652020-01-29 14:44:19 +00007 */
8
David Brazdilb856be62020-03-25 10:14:55 +00009#include "hf/check.h"
10
David Brazdil17e76652020-01-29 14:44:19 +000011#include "test/hftest.h"
12
David Brazdilb856be62020-03-25 10:14:55 +000013bool hftest_ctrl_start(const struct fdt *fdt, struct memiter *cmd)
David Brazdil17e76652020-01-29 14:44:19 +000014{
15 struct fdt_node n;
David Brazdilb856be62020-03-25 10:14:55 +000016 struct memiter bootargs;
David Brazdil17e76652020-01-29 14:44:19 +000017
David Brazdilb856be62020-03-25 10:14:55 +000018 if (!fdt_find_node(fdt, "/chosen", &n)) {
19 HFTEST_LOG("Could not find '/chosen' node.");
David Brazdil17e76652020-01-29 14:44:19 +000020 return false;
21 }
22
David Brazdilb856be62020-03-25 10:14:55 +000023 if (!fdt_read_property(&n, "bootargs", &bootargs)) {
David Brazdil17e76652020-01-29 14:44:19 +000024 HFTEST_LOG("Unable to read bootargs.");
25 return false;
26 }
27
28 /* Remove null terminator. */
David Brazdilb856be62020-03-25 10:14:55 +000029 CHECK(memiter_restrict(&bootargs, 1));
30 *cmd = bootargs;
David Brazdil17e76652020-01-29 14:44:19 +000031 return true;
32}
33
34void hftest_ctrl_finish(void)
35{
36 /* Nothing to do. */
37}
Olivier Deprezea0e0192022-06-03 08:47:52 +020038
39void hftest_ctrl_reboot(void)
40{
41 /* Nothing to do. */
42}