-# $OpenBSD: files.octeon,v 1.29 2016/03/18 05:38:10 jmatthew Exp $
+# $OpenBSD: files.octeon,v 1.30 2016/07/01 15:12:37 visa Exp $
# Standard stanzas config(8) can't run without
maxpartitions 16
major { amdcf = 19 }
file dev/cninit.c
+file dev/ofw/fdt.c
file arch/octeon/octeon/autoconf.c
file arch/octeon/octeon/bus_dma.c
file arch/octeon/octeon/conf.c
-/* $OpenBSD: octeonvar.h,v 1.28 2016/06/22 13:09:35 visa Exp $ */
+/* $OpenBSD: octeonvar.h,v 1.29 2016/07/01 15:12:37 visa Exp $ */
/* $NetBSD: maltavar.h,v 1.3 2002/03/18 10:10:16 simonb Exp $ */
/*-
uint64_t led_display_addr;
uint32_t dfaclock;
uint32_t config_flags;
+ /* The fields below are available when ver_minor >= 3. */
+ uint64_t fdt_addr;
};
struct octeon_bootmem_desc {
-/* $OpenBSD: machdep.c,v 1.73 2016/03/21 14:20:57 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.74 2016/07/01 15:12:37 visa Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
#include <machine/memconf.h>
#include <dev/cons.h>
+#include <dev/ofw/fdt.h>
#include <octeon/dev/cn30xxipdreg.h>
#include <octeon/dev/iobusvar.h>
struct boot_desc *octeon_boot_desc;
struct boot_info *octeon_boot_info;
+void *octeon_fdt;
+
char uboot_rootdev[OCTEON_ARGV_MAX];
/*
process_bootargs();
+ /*
+ * Save the FDT and let the system use it.
+ */
+ if (octeon_boot_info->ver_minor >= 3 &&
+ octeon_boot_info->fdt_addr != 0) {
+ void *fdt;
+ size_t fdt_size;
+
+ fdt = (void *)PHYS_TO_XKPHYS(octeon_boot_info->fdt_addr,
+ CCA_CACHED);
+ if (fdt_init(fdt) != 0 && (fdt_size = fdt_get_size(fdt)) != 0) {
+ octeon_fdt = (void *)pmap_steal_memory(fdt_size, NULL,
+ NULL);
+ memcpy(octeon_fdt, fdt, fdt_size);
+ fdt_init(octeon_fdt);
+ }
+ }
+
/*
* Get a console, very early but after initial mapping setup.
*/
DUMP_BOOT_INFO(led_display_addr, %#llx);
DUMP_BOOT_INFO(dfaclock, %d);
DUMP_BOOT_INFO(config_flags, %#x);
+ if (octeon_boot_info->ver_minor >= 3)
+ DUMP_BOOT_INFO(fdt_addr, %#llx);
#endif
/*