| // SPDX-License-Identifier: GPL-2.0+ |
| #include <linux/kernel.h> |
| static const struct board_model board_models[] = { |
| { 230, 270, "rockchip/rk3566-radxa-zero-3w.dtb" }, |
| { 400, 450, "rockchip/rk3566-radxa-zero-3e.dtb" }, |
| static const struct board_model *get_board_model(void) |
| ret = adc_channel_single_shot("saradc@fe720000", HW_ID_CHANNEL, &val); |
| for (i = 0; i < ARRAY_SIZE(board_models); i++) { |
| unsigned int min = board_models[i].low; |
| unsigned int max = board_models[i].high; |
| if (min <= val && val <= max) |
| int rk_board_late_init(void) |
| const struct board_model *model = get_board_model(); |
| env_set("fdtfile", model->fdtfile); |
| int board_fit_config_name_match(const char *name) |
| const struct board_model *model = get_board_model(); |
| if (model && !strcmp(name, model->fdtfile)) |