Lines Matching +full:- +full:- +full:disable +full:- +full:fdt
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2007-2011 Freescale Semiconductor, Inc.
49 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); in ft_fixup_cpu()
50 while (off != -FDT_ERR_NOTFOUND) { in ft_fixup_cpu()
68 enable_method = "fsl,brr-holdoff"; in ft_fixup_cpu()
71 enable_method = "fsl,eebpcr-holdoff"; in ft_fixup_cpu()
74 /* Cores out of reset and in a spin-loop */ in ft_fixup_cpu()
75 enable_method = "spin-table"; in ft_fixup_cpu()
77 fdt_setprop(blob, off, "cpu-release-addr", in ft_fixup_cpu()
81 fdt_setprop_string(blob, off, "enable-method", in ft_fixup_cpu()
164 u32 cfg0 = in_be32(&cpc->cpccfg0); in ft_fixup_l3cache()
171 fdt_setprop(blob, off, "cache-unified", NULL, 0); in ft_fixup_l3cache()
172 fdt_setprop_cell(blob, off, "cache-block-size", line_size); in ft_fixup_l3cache()
173 fdt_setprop_cell(blob, off, "cache-size", size); in ft_fixup_l3cache()
174 fdt_setprop_cell(blob, off, "cache-sets", num_sets); in ft_fixup_l3cache()
175 fdt_setprop_cell(blob, off, "cache-level", 3); in ft_fixup_l3cache()
177 fdt_setprop_cell(blob, off, "cache-stash-id", 1); in ft_fixup_l3cache()
195 if (isdigit(cpu->name[0])) { in ft_fixup_l2cache_compatible()
196 /* MPCxxxx, where xxxx == 4-digit number */ in ft_fixup_l2cache_compatible()
197 len = sprintf(buf, "fsl,mpc%s-l2-cache-controller", in ft_fixup_l2cache_compatible()
198 cpu->name) + 1; in ft_fixup_l2cache_compatible()
200 /* Pxxxx or Txxxx, where xxxx == 4-digit number */ in ft_fixup_l2cache_compatible()
201 len = sprintf(buf, "fsl,%c%s-l2-cache-controller", in ft_fixup_l2cache_compatible()
202 tolower(cpu->name[0]), cpu->name + 1) + 1; in ft_fixup_l2cache_compatible()
222 volatile u32 l2siz_field = (l2cache->l2ctl >> 28) & 0x3; in l2cache_size()
260 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); in ft_fixup_l2cache()
266 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0); in ft_fixup_l2cache()
269 debug("no next-level-cache property\n"); in ft_fixup_l2cache()
280 fdt_setprop(blob, off, "cache-unified", NULL, 0); in ft_fixup_l2cache()
281 fdt_setprop_cell(blob, off, "cache-block-size", line_size); in ft_fixup_l2cache()
282 fdt_setprop_cell(blob, off, "cache-size", size); in ft_fixup_l2cache()
283 fdt_setprop_cell(blob, off, "cache-sets", num_sets); in ft_fixup_l2cache()
284 fdt_setprop_cell(blob, off, "cache-level", 2); in ft_fixup_l2cache()
292 int off, l2_off, l3_off = -1; in ft_fixup_l2cache()
299 u32 l2cfg0 = in_be32(&l2cache->l2cfg0); in ft_fixup_l2cache()
313 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); in ft_fixup_l2cache()
315 while (off != -FDT_ERR_NOTFOUND) { in ft_fixup_l2cache()
316 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0); in ft_fixup_l2cache()
319 debug("no next-level-cache property\n"); in ft_fixup_l2cache()
335 fdt_setprop_cell(blob, l2_off, "cache-stash-id", in ft_fixup_l2cache()
340 fdt_setprop_cell(blob, l2_off, "cache-stash-id", in ft_fixup_l2cache()
346 fdt_setprop(blob, l2_off, "cache-unified", NULL, 0); in ft_fixup_l2cache()
347 fdt_setprop_cell(blob, l2_off, "cache-block-size", in ft_fixup_l2cache()
349 fdt_setprop_cell(blob, l2_off, "cache-size", size); in ft_fixup_l2cache()
350 fdt_setprop_cell(blob, l2_off, "cache-sets", num_sets); in ft_fixup_l2cache()
351 fdt_setprop_cell(blob, l2_off, "cache-level", 2); in ft_fixup_l2cache()
356 ph = (u32 *)fdt_getprop(blob, l2_off, "next-level-cache", 0); in ft_fixup_l2cache()
359 debug("no next-level-cache property\n"); in ft_fixup_l2cache()
385 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); in ft_fixup_cache()
387 while (off != -FDT_ERR_NOTFOUND) { in ft_fixup_cache()
393 /* d-side config */ in ft_fixup_cache()
399 fdt_setprop_cell(blob, off, "d-cache-block-size", dline_size); in ft_fixup_cache()
400 fdt_setprop_cell(blob, off, "d-cache-size", dsize); in ft_fixup_cache()
401 fdt_setprop_cell(blob, off, "d-cache-sets", dnum_sets); in ft_fixup_cache()
407 fdt_setprop_cell(blob, off, "cache-stash-id", in ft_fixup_cache()
412 /* i-side config */ in ft_fixup_cache()
418 fdt_setprop_cell(blob, off, "i-cache-block-size", iline_size); in ft_fixup_cache()
419 fdt_setprop_cell(blob, off, "i-cache-size", isize); in ft_fixup_cache()
420 fdt_setprop_cell(blob, off, "i-cache-sets", inum_sets); in ft_fixup_cache()
430 void fdt_add_enet_stashing(void *fdt) in fdt_add_enet_stashing() argument
432 do_fixup_by_compat(fdt, "gianfar", "bd-stash", NULL, 0, 1); in fdt_add_enet_stashing()
434 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-len", 96, 1); in fdt_add_enet_stashing()
436 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-idx", 0, 1); in fdt_add_enet_stashing()
437 do_fixup_by_compat(fdt, "fsl,etsec2", "bd-stash", NULL, 0, 1); in fdt_add_enet_stashing()
438 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-len", 96, 1); in fdt_add_enet_stashing()
439 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-idx", 0, 1); in fdt_add_enet_stashing()
451 off = fdt_setprop_cell(blob, off, "clock-frequency", freq); in ft_fixup_clks()
453 printf("WARNING enable to set clock-frequency " in ft_fixup_clks()
476 "clock-frequency", sysinfo.freq_qman, 1); in ft_fixup_dpaa_clks()
481 "clock-frequency", sysinfo.freq_pme, 1); in ft_fixup_dpaa_clks()
497 "fsl,qe-num-snums", 46, 1); in ft_fixup_qe_snum()
500 "fsl,qe-num-snums", 76, 1); in ft_fixup_qe_snum()
506 static void fdt_fixup_usb(void *fdt) in fdt_fixup_usb() argument
509 u32 rcwsr11 = in_be32(&gur->rcwsr[11]); in fdt_fixup_usb()
512 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-mph"); in fdt_fixup_usb()
515 fdt_status_disabled(fdt, off); in fdt_fixup_usb()
517 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-dr"); in fdt_fixup_usb()
520 fdt_status_disabled(fdt, off); in fdt_fixup_usb()
536 u32 srds_prtcl_s2 = in_be32(&gur->rcwsr[4]) &
545 u32 srds_prtcl_s4 = in_be32(&gur->rcwsr[4]) &
555 nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,elo3-dma",
560 printf("WARNING: unable to disable dma3\n");
576 /* The l2switch node from device-tree has
577 * compatible string "vitesse-9953" */
578 node = fdt_node_offset_by_compatible(blob, -1, "vitesse-9953");
579 if (node == -FDT_ERR_NOTFOUND)
590 fdt_setprop(blob, node, "local-mac-address", l2swaddr,
604 /* delete crypto node if not on an E-processor */
612 fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms));
622 "timebase-frequency", get_tbclk() / CONFIG_FSL_TBCLK_EXTRA_DIV,
625 "bus-frequency", bd->bi_busfreq, 1);
627 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
628 while (off != -FDT_ERR_NOTFOUND) {
631 fdt_setprop(blob, off, "clock-frequency", &val, 4);
636 "bus-frequency", bd->bi_busfreq, 1);
649 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
653 do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart",
654 "current-speed", gd->baudrate, 1);
656 do_fixup_by_compat_u32(blob, "fsl,cpm2-brg",
657 "clock-frequency", bd->bi_brgfreq, 1);
661 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-1.0",
662 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);
663 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-2.0",
664 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);
666 "clock-frequency", get_bus_freq(0)/2, 1);
669 "clock-frequency", get_bus_freq(0), 1);
672 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
675 ft_fixup_cpu(blob, (u64)bd->bi_memstart + (u64)bd->bi_memsize);
688 fdt_portal(blob, "fsl,bman-portal", "bman-portals",
695 fdt_portal(blob, "fsl,qman-portal", "qman-portals",
707 * system-clock = CCB clock/2
708 * Here gd->bus_clk = CCB clock
712 do_fixup_by_compat_u32(blob, "fsl,gianfar-ptp-timer",
713 "timer-frequency", gd->bus_clk/2, 1);
716 * clock-freq should change to clock-frequency and
717 * flexcan-v1.0 should change to p1010-flexcan respectively
720 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0",
721 "clock_freq", gd->bus_clk/2, 1);
723 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0",
724 "clock-frequency", gd->bus_clk/2, 1);
726 do_fixup_by_compat_u32(blob, "fsl,p1010-flexcan",
727 "clock-frequency", gd->bus_clk/2, 1);
745 (CONFIG_SYS_CCSRBAR_PHYS + ((x) - CONFIG_SYS_CCSRBAR))
749 printf("Warning: U-Boot configured %s at address %llx,\n"
761 * that with the physical address of the first ns16550-compatible node
766 int ft_verify_fdt(void *fdt) argument
773 off = fdt_node_offset_by_prop_value(fdt, -1, "device_type", "soc", 4);
779 naddr = fdt_address_cells(fdt, off);
780 prop = fdt_getprop(fdt, off, "ranges", &size);
781 addr = fdt_translate_address(fdt, off, prop + naddr);
798 * Check some nodes via aliases. We assume that U-Boot and the device
800 * U-Boot is the same as "serial0" in the device tree.
802 aliases = fdt_path_offset(fdt, "/aliases");
805 if (!fdt_verify_alias_address(fdt, aliases, "serial0",
811 if (!fdt_verify_alias_address(fdt, aliases, "serial1",
827 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,elbc");
829 const fdt32_t *reg = fdt_getprop(fdt, off, "reg", NULL);
833 addr = fdt_translate_address(fdt, off, reg);