RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
ofw_fdt.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2022, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2022-08-25 GuEe-GUI first version
9 */
10
11#ifndef __OFW_FDT_H__
12#define __OFW_FDT_H__
13
14#include <mm_page.h>
15#include <drivers/ofw.h>
16
18{
19 union { rt_ubase_t mmio, port; };
20 union { rt_ubase_t size, width; };
21
22 void *fdt;
23 char options[32];
25
26 void *data;
27 void (*console_putc)(void *data, char c);
28
29#define FDT_EARLYCON_KICK_UPDATE 0
30#define FDT_EARLYCON_KICK_COMPLETED 1
31 void (*console_kick)(struct rt_fdt_earlycon *earlycon, int why);
32
33 long msg_idx;
34 char msg[RT_FDT_EARLYCON_MSG_SIZE * 1024];
35};
36
38{
39 char *name;
40 char *type;
42 rt_err_t (*setup)(struct rt_fdt_earlycon *earlycon, const char *options);
43};
44
45#define RT_FDT_EARLYCON_EXPORT(_name, _type, _compatible, _setup) \
46static const struct rt_fdt_earlycon_id __rt_fdt_##_name##_earlycon \
47rt_used RT_OFW_SYMBOL(earlycon, _) = \
48{ \
49 .name = #_name, \
50 .type = _type, \
51 .compatible = _compatible, \
52 .setup = _setup, \
53}
54
55const char *rt_fdt_node_name(const char *full_name);
56rt_uint64_t rt_fdt_read_number(const fdt32_t *cell, int size);
57rt_uint64_t rt_fdt_next_cell(const fdt32_t **cellptr, int size);
60
61rt_err_t rt_fdt_commit_memregion_early(rt_region_t *region, rt_bool_t is_reserved);
62rt_err_t rt_fdt_commit_memregion_request(rt_region_t **out_region, rt_size_t *out_nr, rt_bool_t is_reserved);
63
70void rt_fdt_earlycon_output(const char *str);
73rt_err_t rt_fdt_bootargs_select(const char *key, int index, const char **out_result);
75
77
78#endif /* __OFW_FDT_H__ */
rt_uint64_t rt_fdt_translate_address(void *fdt, int nodeoffset, rt_uint64_t address)
rt_err_t rt_fdt_model_dump(void)
rt_uint64_t rt_fdt_read_number(const fdt32_t *cell, int size)
rt_err_t rt_fdt_scan_root(void)
void rt_fdt_earlycon_kick(int why)
void rt_fdt_earlycon_output(const char *str)
rt_err_t rt_fdt_commit_memregion_request(rt_region_t **out_region, rt_size_t *out_nr, rt_bool_t is_reserved)
rt_err_t rt_fdt_scan_initrd(rt_uint64_t *ranges)
const char * rt_fdt_node_name(const char *full_name)
rt_bool_t rt_fdt_device_is_available(void *fdt, int nodeoffset)
rt_err_t rt_fdt_boot_dump(void)
rt_err_t rt_fdt_prefetch(void *fdt)
rt_err_t rt_fdt_scan_chosen_stdout(void)
struct rt_ofw_node * rt_fdt_unflatten_single(void *fdt)
rt_err_t rt_fdt_bootargs_select(const char *key, int index, const char **out_result)
rt_err_t rt_fdt_scan_memory(void)
rt_uint64_t rt_fdt_next_cell(const fdt32_t **cellptr, int size)
rt_err_t rt_fdt_commit_memregion_early(rt_region_t *region, rt_bool_t is_reserved)
rt_err_t rt_fdt_unflatten(void)
int rt_bool_t
rt_base_t rt_err_t
rt_ubase_t rt_size_t
rt_uint32_t rt_ubase_t
unsigned long long rt_uint64_t
rt_err_t(* setup)(struct rt_fdt_earlycon *earlycon, const char *options)
rt_ubase_t port
void(* console_kick)(struct rt_fdt_earlycon *earlycon, int why)
void(* console_putc)(void *data, char c)
rt_ubase_t mmio
rt_ubase_t size
char msg[RT_FDT_EARLYCON_MSG_SIZE *1024]
rt_ubase_t width