1273927Sandrew/*-
2273927Sandrew * Copyright (c) 2014 Andrew Turner <andrew@FreeBSD.org>
3273927Sandrew * All rights reserved.
4273927Sandrew *
5273927Sandrew * Redistribution and use in source and binary forms, with or without
6273927Sandrew * modification, are permitted provided that the following conditions
7273927Sandrew * are met:
8273927Sandrew * 1. Redistributions of source code must retain the above copyright
9273927Sandrew *    notice, this list of conditions and the following disclaimer.
10273927Sandrew * 2. Redistributions in binary form must reproduce the above copyright
11273927Sandrew *    notice, this list of conditions and the following disclaimer in the
12273927Sandrew *    documentation and/or other materials provided with the distribution.
13273927Sandrew *
14273927Sandrew * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15273927Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16273927Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17273927Sandrew * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18273927Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19273927Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20273927Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21273927Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22273927Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23273927Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24273927Sandrew * SUCH DAMAGE.
25273927Sandrew *
26273927Sandrew * $FreeBSD: releng/11.0/sys/boot/fdt/fdt_platform.h 298821 2016-04-29 22:42:59Z gonzo $
27273927Sandrew */
28273927Sandrew
29273927Sandrew#ifndef FDT_PLATFORM_H
30273927Sandrew#define FDT_PLATFORM_H
31273927Sandrew
32273934Sandrewstruct fdt_header;
33273927Sandrew
34273934Sandrewstruct fdt_mem_region {
35273934Sandrew	unsigned long	start;
36273934Sandrew	unsigned long	size;
37273934Sandrew};
38273934Sandrew
39273934Sandrew#define	TMP_MAX_ETH	8
40273934Sandrew
41273934Sandrewint fdt_copy(vm_offset_t);
42273934Sandrewvoid fdt_fixup_cpubusfreqs(unsigned long, unsigned long);
43273934Sandrewvoid fdt_fixup_ethernet(const char *, char *, int);
44273934Sandrewvoid fdt_fixup_memory(struct fdt_mem_region *, size_t);
45273934Sandrewvoid fdt_fixup_stdout(const char *);
46298821Sgonzovoid fdt_apply_overlays(void);
47273934Sandrewint fdt_load_dtb_addr(struct fdt_header *);
48273934Sandrewint fdt_load_dtb_file(const char *);
49298821Sgonzoint fdt_load_dtb_overlays(const char *);
50273934Sandrewint fdt_setup_fdtp(void);
51273934Sandrew
52273934Sandrew/* The platform library needs to implement these functions */
53273934Sandrewint fdt_platform_load_dtb(void);
54273934Sandrewvoid fdt_platform_fixups(void);
55273934Sandrew
56273927Sandrew#endif /* FDT_PLATFORM_H */
57