// SPDX-License-Identifier: GPL-2.0 /* * KUnit test for the FPGA Region * * Copyright (C) 2023 Red Hat, Inc. * * Author: Marco Pagani <marpagan@redhat.com>
*/
/* * Fake FPGA manager that implements only the write op to count the number * of programming cycles. The internals of the programming sequence are * tested in the Manager suite since they are outside the responsibility * of the Region.
*/ staticconststruct fpga_manager_ops fake_mgr_ops = {
.write = op_write,
};
if (!stats->enable && enable)
stats->cycles_count++;
stats->enable = enable;
return 0;
}
/* * Fake FPGA bridge that implements only enable_set op to count the number * of activation cycles.
*/ staticconststruct fpga_bridge_ops fake_bridge_ops = {
.enable_set = op_enable_set,
};
region = fpga_region_class_find(NULL, ctx->region_dev, fake_region_match);
KUNIT_EXPECT_PTR_EQ(test, region, ctx->region);
put_device(®ion->dev);
}
/* * FPGA Region programming test. The Region must call get_bridges() to get * and control the bridges, and then the Manager for the actual programming.
*/ staticvoid fpga_region_test_program_fpga(struct kunit *test)
{ struct test_ctx *ctx = test->priv; struct fpga_image_info *img_info; char img_buf[4]; int ret;
/* * The configuration used in this test suite uses a single bridge to * limit the code under test to a single unit. The functions used by the * Region for getting and controlling bridges are tested (with a list of * multiple bridges) in the Bridge suite.
*/ staticint fpga_region_test_init(struct kunit *test)
{ struct test_ctx *ctx; struct fpga_region_info region_info = { 0 }; int ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.