Thread (111 messages) 111 messages, 5 authors, 2018-02-06

Re: [PATCH v6 06/36] nds32: Kernel booting and initialization

From: Greentime Hu <hidden>
Date: 2018-01-19 16:34:38
Also in: linux-arch, linux-serial, lkml, netdev

Hi, Arnd:

2018-01-18 18:11 GMT+08:00 Arnd Bergmann [off-list ref]:
On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu [off-list ref] wrote:

I had not looked at this patch in enough detail earlier, sorry about
that. It should be
easy enough to fix though.
quoted
+#ifdef CONFIG_VGA_CONSOLE
+struct screen_info screen_info;
+#endif
I would assume that you can't ever have a VGA console. Just drop all
the references
here and instead send a patch to the fbdev maintainer to add the dependency
at CONFIG_VGA_CONSOLE to prevent selecting it with nds32.
I found it can be built pass for now because we disable it in defconfig.
Should I send the patch in v7 series?
quoted
+
+extern void __init early_init_devtree(void *params);
+extern void __init early_trap_init(void);
similarly, these are declared in include/linux/of_fdt.h
early_trap_init is a nds32 function. I will move it to nds32.h
quoted
+void __init setup_arch(char **cmdline_p)
+{
+       early_init_devtree(__atags_pointer ?
+                          phys_to_virt(__atags_pointer) : __dtb_start);
The reference to '__atags_pointer' appears to be a leftover from pre-DT
days. Can you just remove that?
Yes, I will remove it.
quoted
+void calibrate_delay(void)
+{
+       const int *val;
+       struct device_node *cpu = NULL;
+       cpu = of_find_compatible_node(NULL, NULL, "andestech,nds32v3");
+       val = of_get_property(cpu, "clock-frequency", NULL);
+       if (!val || !*val)
+               panic("no cpu 'clock-frequency' parameter in device tree");
+       loops_per_jiffy = be32_to_cpup(val) / HZ;
+       pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
+               loops_per_jiffy / (500000 / HZ),
+               (loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
+}
This seems very odd to me: The 'clock-frequency' property in the
cpu node should refer to the actual frequency it is running at, but that
tends to be different from the bogomips as needed by the ndelay()
function. Can you explain what is going on here?
This implementation is referenced from openrisc.
https://lkml.org/lkml/2017/11/17/228



Thank you.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help