Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion components/drivers/ofw/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,6 @@ const char *rt_ofw_get_prop_fuzzy_name(const struct rt_ofw_node *np, const char
return propname;
}


struct rt_ofw_prop *rt_ofw_get_prop(const struct rt_ofw_node *np, const char *name, rt_ssize_t *out_length)
{
struct rt_ofw_prop *prop = RT_NULL;
Expand Down
8 changes: 8 additions & 0 deletions components/drivers/ofw/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,11 @@ rt_err_t rt_fdt_scan_chosen_stdout(void)

if (*options)
{
int type_len_no_option;

type_len = strchrnul(options, ',') - options;
type_len_no_option = strchrnul(options, ' ') - options;
type_len = rt_min(type_len, type_len_no_option);
}
}

Expand Down Expand Up @@ -795,6 +799,10 @@ rt_err_t rt_fdt_scan_chosen_stdout(void)
LOG_I("Earlycon: %s at MMIO/PIO %p (options '%s')",
con_type, fdt_earlycon.mmio, fdt_earlycon.options);
}
else if (con_type)
{
LOG_I("Earlycon: %s (options '%s')", con_type, fdt_earlycon.options);
}

return err;
}
Expand Down
1 change: 0 additions & 1 deletion components/drivers/ofw/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ rt_err_t rt_ofw_get_address(struct rt_ofw_node *np, int index, rt_uint64_t *out_

static rt_err_t ofw_get_address_by_name(struct rt_ofw_node *np, const char *name,
rt_uint64_t *out_address, rt_uint64_t *out_size)

{
int index = 0;
rt_err_t err = -RT_EEMPTY;
Expand Down
10 changes: 9 additions & 1 deletion components/drivers/ofw/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <drivers/ofw.h>
#include <drivers/ofw_io.h>
#include <drivers/ofw_irq.h>
#include <drivers/platform.h>

#define DBG_TAG "rtdm.ofw"
#define DBG_LVL DBG_INFO
Expand Down Expand Up @@ -525,8 +526,15 @@ struct rt_ofw_node *rt_ofw_find_irq_parent(struct rt_ofw_node *np, int *out_inte
static int ofw_map_irq(struct rt_ofw_cell_args *irq_args)
{
int irq;
struct rt_pic *pic;
struct rt_ofw_node *ic_np = irq_args->data;
struct rt_pic *pic = rt_pic_dynamic_cast(rt_ofw_data(ic_np));

if (!rt_ofw_data(ic_np))
{
rt_platform_ofw_request(ic_np);
}

pic = rt_pic_dynamic_cast(rt_ofw_data(ic_np));

/* args.data is "interrupt-controller" */
if (pic)
Expand Down
21 changes: 20 additions & 1 deletion components/drivers/ofw/ofw.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,26 @@ rt_err_t rt_ofw_console_setup(void)

if (err == -RT_ENOSYS && !rt_ofw_prop_read_string(ofw_node_chosen, "stdout-path", &stdout_path))
{
struct rt_ofw_node *stdout_np = rt_ofw_find_node_by_path(stdout_path);
struct rt_ofw_node *stdout_np;

if (*stdout_path != '/' && ofw_node_aliases)
{
int alias_len;
struct rt_ofw_prop *prop;

alias_len = strchrnul(stdout_path, ':') - stdout_path;

rt_ofw_foreach_prop(ofw_node_aliases, prop)
{
if (!rt_strncmp(prop->name, stdout_path, alias_len))
{
stdout_path = prop->value;
break;
}
}
}

stdout_np = rt_ofw_find_node_by_path(stdout_path);

if (stdout_np && (ofw_name = ofw_console_serial_find(con_name, stdout_np)))
{
Expand Down
2 changes: 2 additions & 0 deletions components/drivers/ofw/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ int fdt_io_addr_cells(void *fdt, int nodeoffset)
if (cells_tmp)
{
cells = fdt32_to_cpu(*cells_tmp);
break;
}
}

Expand All @@ -116,6 +117,7 @@ int fdt_io_size_cells(void *fdt, int nodeoffset)
if (cells_tmp)
{
cells = fdt32_to_cpu(*cells_tmp);
break;
}
}

Expand Down
Loading