/src/barebox/include/pbl.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | | /* |
3 | | * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> |
4 | | */ |
5 | | |
6 | | #ifndef __PBL_H__ |
7 | | #define __PBL_H__ |
8 | | |
9 | | #ifndef __ASSEMBLY__ |
10 | | |
11 | | #include <linux/types.h> |
12 | | #include <linux/compiler.h> |
13 | | #include <linux/sizes.h> |
14 | | #include <linux/minmax.h> |
15 | | |
16 | | /* memory barebox proper occupies once loaded in place, see images/piggy.S */ |
17 | | extern const u32 piggy_memsz; |
18 | | |
19 | | /* objcopy < binutils 2.41 keeps section headers past the last segment */ |
20 | | static inline u32 pbl_barebox_memsz(u32 uncompressed_len) |
21 | 0 | { |
22 | 0 | return max(piggy_memsz, uncompressed_len); |
23 | 0 | } Unexecuted instantiation: startup.c:pbl_barebox_memsz Unexecuted instantiation: state_variables.c:pbl_barebox_memsz Unexecuted instantiation: parser.c:pbl_barebox_memsz Unexecuted instantiation: barebox.c:pbl_barebox_memsz Unexecuted instantiation: firmware.c:pbl_barebox_memsz Unexecuted instantiation: boot.c:pbl_barebox_memsz Unexecuted instantiation: fastboot.c:pbl_barebox_memsz Unexecuted instantiation: regmap.c:pbl_barebox_memsz Unexecuted instantiation: regmap-multi.c:pbl_barebox_memsz Unexecuted instantiation: regmap-mmio.c:pbl_barebox_memsz Unexecuted instantiation: m25p80.c:pbl_barebox_memsz Unexecuted instantiation: spi.c:pbl_barebox_memsz Unexecuted instantiation: spi-mem.c:pbl_barebox_memsz Unexecuted instantiation: gpio_spi.c:pbl_barebox_memsz Unexecuted instantiation: i2c-gpio.c:pbl_barebox_memsz Unexecuted instantiation: i2c.c:pbl_barebox_memsz Unexecuted instantiation: syscon.c:pbl_barebox_memsz Unexecuted instantiation: led-gpio.c:pbl_barebox_memsz Unexecuted instantiation: at25.c:pbl_barebox_memsz Unexecuted instantiation: at24.c:pbl_barebox_memsz Unexecuted instantiation: gpiolib.c:pbl_barebox_memsz Unexecuted instantiation: of_gpio.c:pbl_barebox_memsz Unexecuted instantiation: of_net.c:pbl_barebox_memsz Unexecuted instantiation: of_firmware.c:pbl_barebox_memsz Unexecuted instantiation: syscon-reboot-mode.c:pbl_barebox_memsz Unexecuted instantiation: core.c:pbl_barebox_memsz Unexecuted instantiation: loads.c:pbl_barebox_memsz Unexecuted instantiation: bfetch.c:pbl_barebox_memsz Unexecuted instantiation: gpio.c:pbl_barebox_memsz Unexecuted instantiation: of_overlay.c:pbl_barebox_memsz Unexecuted instantiation: tftp.c:pbl_barebox_memsz Unexecuted instantiation: dhcp.c:pbl_barebox_memsz Unexecuted instantiation: ip-route-get.c:pbl_barebox_memsz Unexecuted instantiation: host.c:pbl_barebox_memsz Unexecuted instantiation: vsprintf.c:pbl_barebox_memsz Unexecuted instantiation: parameter.c:pbl_barebox_memsz Unexecuted instantiation: hexdump.c:pbl_barebox_memsz Unexecuted instantiation: lib.c:pbl_barebox_memsz Unexecuted instantiation: eth.c:pbl_barebox_memsz Unexecuted instantiation: skbuff.c:pbl_barebox_memsz Unexecuted instantiation: net.c:pbl_barebox_memsz Unexecuted instantiation: sntp.c:pbl_barebox_memsz Unexecuted instantiation: ping.c:pbl_barebox_memsz Unexecuted instantiation: dns.c:pbl_barebox_memsz Unexecuted instantiation: ifup.c:pbl_barebox_memsz Unexecuted instantiation: nfs.c:pbl_barebox_memsz Unexecuted instantiation: ff.c:pbl_barebox_memsz Unexecuted instantiation: malloc.c:pbl_barebox_memsz |
24 | | |
25 | | void pbl_barebox_uncompress(void *dest, void *compressed_start, unsigned int len); |
26 | | int pbl_dtbz_uncompress(void *dest, void *compressed_start, unsigned long len); |
27 | | |
28 | | void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize); |
29 | | int fdt_fixup_mem(void *fdt, unsigned long membase[], unsigned long memsize[], size_t num); |
30 | | |
31 | | struct fdt_device_id { |
32 | | const char *compatible; |
33 | | const void *data; |
34 | | }; |
35 | | |
36 | | const void * |
37 | | fdt_device_get_match_data(const void *fdt, const char *nodepath, |
38 | | const struct fdt_device_id ids[]); |
39 | | |
40 | | int pbl_barebox_verify(const void *compressed_start, unsigned int len, |
41 | | const void *hash, unsigned int hash_len); |
42 | | int pbl_load_fdt(const void *fdt, void *dest, int destsize); |
43 | | |
44 | | #define PBL_MALLOC_SIZE SZ_128K |
45 | | |
46 | | void *pbl_malloc(int size); |
47 | | void pbl_free(void *where); |
48 | | void pbl_malloc_init(unsigned long base, size_t size); |
49 | | |
50 | | #endif |
51 | | |
52 | | void __noreturn barebox_pbl_entry(ulong, ulong, void *); |
53 | | |
54 | | #ifdef CONFIG_PBL_CONSOLE |
55 | | #define pbl_puts puts |
56 | | #else |
57 | | #define pbl_puts puts_ll |
58 | | #endif |
59 | | |
60 | | #endif /* __PBL_H__ */ |