Received: by 10.223.176.46 with SMTP id f43csp1230687wra; Fri, 19 Jan 2018 08:37:30 -0800 (PST) X-Google-Smtp-Source: ACJfBosXHiyLyITsSgLjGQAWhfn7PFKvhoV91TjeUVnrK1qndOoXv0zdYUXWwuizODpyX2sl8VX8 X-Received: by 10.101.96.132 with SMTP id t4mr8955606pgu.58.1516379850244; Fri, 19 Jan 2018 08:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516379850; cv=none; d=google.com; s=arc-20160816; b=rCNPTquqh+YM4kuQo7WEZQDdLQZzZN5q9iTIio/2eo9p+6kws/C+k2rvz7y/ieA9+f 6iYNSrYGYeUWfmwp7Qmvn4f495nw+r304zG/zaU+dUKm9OxHRsDUbVRp55h6R0xgtEGU rGCJdE35FLztVQFNJkXS/sG8Cz+RazpTvTGU7c6YBbVoIKIGOlXFG1VCUzlJq30ppMcr IW2dX5SjGzdxdQ+GftJn3xIbOY1xB9x4SXBFdKpYqAVkkFB5kkzRUm16VLMLadfMr6Pj 0LU+mZIHAhqG7Wf4SQYILsDMecomMJnJPKPPdJgJU/DRiosXT0lmk3S2LUSeb1sODmwV T+9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=MKncEH/nOYv6ViS3x8XEnsfGHt7SxXsZH3XSlLv9epk=; b=td/dJITTkD8Lcig+GXxROvp/dq8ChsHFQSOlBnPAlUYQ2GAhN8e5wsC57g/ibScmgV xTTzShw2zTbfDLYb6yGnQvSu44NzygvkqtLpZX6qePAB4J5kVRsi15IXmDe3f6yQz74j zHshZx1oiyM3oFt536c7Y19gRYw/oHOmjIi8y17SsbqjSGpbNxl6GkzvkQWNwyfDFGyf VkCmvwrW+sleu1Ff17v7LoEf1xP6L5KjSLuMYD6SytRNx3JKCWHMMv2kktN+7iXOyb2Y ZxCMIFroFVz7cUX0AjUdaGQ0/PhMhiDE958Chtps7YutF3uykQrhc1g+kAv/ZvTXsfo5 IqiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=as+m1yQ/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si8526561pgu.783.2018.01.19.08.37.15; Fri, 19 Jan 2018 08:37:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=as+m1yQ/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756107AbeASQf3 (ORCPT + 99 others); Fri, 19 Jan 2018 11:35:29 -0500 Received: from mail-vk0-f67.google.com ([209.85.213.67]:44729 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755775AbeASQfT (ORCPT ); Fri, 19 Jan 2018 11:35:19 -0500 Received: by mail-vk0-f67.google.com with SMTP id q62so1269938vkb.11; Fri, 19 Jan 2018 08:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MKncEH/nOYv6ViS3x8XEnsfGHt7SxXsZH3XSlLv9epk=; b=as+m1yQ/XYICeoTKayu7kziXBwRi6GCnSUkzPn4xcDJUDEw+vMCPg53OLOrCdpquQT XDIb/bfk87g6yGXiO47rciV+vZnA5CdPFHrWI6KVvMKW0sB456emoj82vqlEONxVMKp+ Z1HXT0eEbDlAnP4GskycjwWtOwhbP/XQfCXCqSVdhh24UGfPOab1NOuE4v8Gxdiy4EUZ dkC/6rUeH3ACyKIVHiUTIOugOyacQ/go13rNKxlGB2AEXbmRjQGn+Q1CfamekWOzgJlr JJtatFfxeTwLEy5//zaITzkA0h676jgSmGe8ZXPQeh1q6VyFpomp0btIvMo97xKv74zX BDhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MKncEH/nOYv6ViS3x8XEnsfGHt7SxXsZH3XSlLv9epk=; b=MAdSHwGL5J1dq+VCSZkMGPA+vy48oVklsBr6iSDLy9Qir1ZxrVdXmt1SrcYIjEB9bi Ow1izgfROFOIrMiW2+8kaJy8UQFw0Uiymrb+2aY+ogBSVPDKAjKK/4cD9kWckvdw0lu7 A3qOWHxH2AtNJdLP6ni9CC+tOboo8Cfdzyxp6ZqwRJaWFLRUDsIL0E4WGpo6/IoNLmWD xNGQBQaHDTkCBLFf30oYx0b6piiAURXpCaPDvNmAk+FWHl74b668UCWCs9HXgNsu11iV dFmXuoRHWFE4/fFb2D2O/alaIuO8tfvLLvpuEbvNBruU7Jqorx0uUnij7aS+h3/01/53 a33A== X-Gm-Message-State: AKwxytcrxLHlE7Dt+cXuJxTZuxZyAswM9UusCd3ZizfnzhJugXKf0BLM 7DyreeraEl6ekDWFVXmzpb0EQmRxu/kkufWWfA0= X-Received: by 10.31.92.202 with SMTP id q193mr7433606vkb.192.1516379718511; Fri, 19 Jan 2018 08:35:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.42.194 with HTTP; Fri, 19 Jan 2018 08:34:38 -0800 (PST) In-Reply-To: References: <5930d2df872116555cc553284b6c111dce29e298.1515766253.git.green.hu@gmail.com> From: Greentime Hu Date: Sat, 20 Jan 2018 00:34:38 +0800 Message-ID: Subject: Re: [PATCH v6 06/36] nds32: Kernel booting and initialization To: Arnd Bergmann Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Vincent Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Arnd: 2018-01-18 18:11 GMT+08:00 Arnd Bergmann : > On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: > > I had not looked at this patch in enough detail earlier, sorry about > that. It should be > easy enough to fix though. > >> +#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? >> + >> +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 >> +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. >> +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.