Im trying to get support for the USG3P going but im struggling to understand the concept of the device tree loading.
As far as i know the u-boot environment should have the device tree set, but thats not the case for the Edge Router Lite thats already supported by LEDE (i cant verify that)
In the following thread some people posted their u-boot env output
No FDT stuff or DTB referenced.
I digged into the official gpl archives and found the following code in arch/mips/cavium-octeon/setup.c
arch/mips/cavium-octeon/setup.c
void __init device_tree_init(void)
{
int dt_size;
struct boot_param_header *fdt;
bool do_prune;
bool do_set_mac = false;
if (octeon_bootinfo->minor_version >= 3 && octeon_bootinfo->fdt_addr) {
fdt = phys_to_virt(octeon_bootinfo->fdt_addr);
pr_info("Using passed Device Tree <%p>.\n", fdt);
if (fdt_check_header(fdt))
panic("Corrupt Device Tree passed to kernel.");
dt_size = be32_to_cpu(fdt->totalsize);
do_prune = false;
} else if (OCTEON_IS_MODEL(OCTEON_CN68XX)) {
fdt = (struct boot_param_header *)&__dtb_octeon_68xx_begin;
dt_size = &__dtb_octeon_68xx_end - &__dtb_octeon_68xx_begin;
do_prune = true;
} else if (octeon_bootinfo->board_type == CVMX_BOARD_TYPE_UBNT_E100) {
switch (octeon_bootinfo->board_rev_major) {
case 1:
fdt = (struct boot_param_header *)
&__dtb_ubnt_e101_begin;
dt_size = &__dtb_ubnt_e101_end
- &__dtb_ubnt_e101_begin;
break;
default:
fdt = (struct boot_param_header *)
&__dtb_ubnt_e100_begin;
dt_size = &__dtb_ubnt_e100_end
- &__dtb_ubnt_e100_begin;
break;
}
do_prune = false;
do_set_mac = true;
} else if (octeon_bootinfo->board_type == CVMX_BOARD_TYPE_UBNT_E120) {
fdt = (struct boot_param_header *)
&__dtb_ubnt_e100_begin;
dt_size = &__dtb_ubnt_e100_end
- &__dtb_ubnt_e100_begin;
do_prune = false;
do_set_mac = true;
} else {
fdt = (struct boot_param_header *)&__dtb_octeon_3xxx_begin;
dt_size = &__dtb_octeon_3xxx_end - &__dtb_octeon_3xxx_begin;
do_prune = true;
}
/* Copy the default tree from init memory. */
initial_boot_params = early_init_dt_alloc_memory_arch(dt_size, 8);
if (initial_boot_params == NULL)
panic("Could not allocate initial_boot_params\n");
memcpy(initial_boot_params, fdt, dt_size);
if (do_prune) {
octeon_prune_device_tree();
pr_info("Using internal Device Tree.\n");
}
if (do_set_mac)
ubnt_dt_set_mac();
unflatten_device_tree();
}
Doesnt that indicate that the device tree needs to be loaded manually ?
This code is entirely missing from OpenWRT and Lede and so i wonder how the Edgerouter Lite is supposed to work ?
Can someone clear up my confusion?
Kind regards
MartB