fdt: add decode helper library