]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/qe/fdt.c
2 * Copyright 2008 Freescale Semiconductor, Inc.
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * SPDX-License-Identifier: GPL-2.0+
12 #include <fdt_support.h>
16 DECLARE_GLOBAL_DATA_PTR
;
19 * If a QE firmware has been uploaded, then add the 'firmware' node under
22 void fdt_fixup_qe_firmware(void *blob
)
24 struct qe_firmware_info
*qe_fw_info
;
27 qe_fw_info
= qe_get_firmware_info();
31 node
= fdt_path_offset(blob
, "/qe");
35 /* We assume the node doesn't exist yet */
36 node
= fdt_add_subnode(blob
, node
, "firmware");
40 ret
= fdt_setprop(blob
, node
, "extended-modes",
41 &qe_fw_info
->extended_modes
, sizeof(u64
));
45 ret
= fdt_setprop_string(blob
, node
, "id", qe_fw_info
->id
);
49 ret
= fdt_setprop(blob
, node
, "virtual-traps", qe_fw_info
->vtraps
,
50 sizeof(qe_fw_info
->vtraps
));
57 fdt_del_node(blob
, node
);
60 void ft_qe_setup(void *blob
)
62 do_fixup_by_prop_u32(blob
, "device_type", "qe", 4,
63 "bus-frequency", gd
->arch
.qe_clk
, 1);
64 do_fixup_by_prop_u32(blob
, "device_type", "qe", 4,
65 "brg-frequency", gd
->arch
.brg_clk
, 1);
66 do_fixup_by_compat_u32(blob
, "fsl,qe",
67 "clock-frequency", gd
->arch
.qe_clk
, 1);
68 do_fixup_by_compat_u32(blob
, "fsl,qe",
69 "bus-frequency", gd
->arch
.qe_clk
, 1);
70 do_fixup_by_compat_u32(blob
, "fsl,qe",
71 "brg-frequency", gd
->arch
.brg_clk
, 1);
72 do_fixup_by_compat_u32(blob
, "fsl,qe-gtm",
73 "clock-frequency", gd
->arch
.qe_clk
/ 2, 1);
74 fdt_fixup_qe_firmware(blob
);