2 * Copyright 2008 Freescale Semiconductor, Inc.
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 #include <fdt_support.h>
31 DECLARE_GLOBAL_DATA_PTR;
34 * If a QE firmware has been uploaded, then add the 'firmware' node under
37 void fdt_fixup_qe_firmware(void *blob)
39 struct qe_firmware_info *qe_fw_info;
42 qe_fw_info = qe_get_firmware_info();
46 node = fdt_path_offset(blob, "/qe");
50 /* We assume the node doesn't exist yet */
51 node = fdt_add_subnode(blob, node, "firmware");
55 ret = fdt_setprop(blob, node, "extended-modes",
56 &qe_fw_info->extended_modes, sizeof(u64));
60 ret = fdt_setprop_string(blob, node, "id", qe_fw_info->id);
64 ret = fdt_setprop(blob, node, "virtual-traps", qe_fw_info->vtraps,
65 sizeof(qe_fw_info->vtraps));
72 fdt_del_node(blob, node);
75 void ft_qe_setup(void *blob)
77 do_fixup_by_prop_u32(blob, "device_type", "qe", 4,
78 "bus-frequency", gd->qe_clk, 1);
79 do_fixup_by_prop_u32(blob, "device_type", "qe", 4,
80 "brg-frequency", gd->brg_clk, 1);
81 do_fixup_by_compat_u32(blob, "fsl,qe",
82 "clock-frequency", gd->qe_clk, 1);
83 do_fixup_by_compat_u32(blob, "fsl,qe",
84 "bus-frequency", gd->qe_clk, 1);
85 do_fixup_by_compat_u32(blob, "fsl,qe",
86 "brg-frequency", gd->brg_clk, 1);
87 do_fixup_by_compat_u32(blob, "fsl,qe-gtm",
88 "clock-frequency", gd->qe_clk / 2, 1);
89 fdt_fixup_qe_firmware(blob);