Received: by 10.223.148.5 with SMTP id 5csp7251783wrq; Thu, 18 Jan 2018 03:03:11 -0800 (PST) X-Google-Smtp-Source: ACJfBotEsgvAJRujyEMKAD8WrE7ARv+4NJbuja0Jef+wQ0MkgmmXiZo24FmTcjyrfokY+f9zxC0i X-Received: by 10.101.98.85 with SMTP id q21mr6578314pgv.298.1516273391489; Thu, 18 Jan 2018 03:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516273391; cv=none; d=google.com; s=arc-20160816; b=iO2Mpjmk34L8iN14DNcKfvcWnvYRG6arPtZ//AwaJz1DwqVrAw1+6fwX8Wy380Davb PFB0XnpKnPNJG0NqtqRvVm6fh6s0X9w1sOFUXyhQWVLGN5V+srW2bo+9yL2HZZfJsYDu FhfJQu0TQxiHJVqP0pAssH7g/onn3hkHz3LX5aKAucuQ5yvigMB7Xibj63VFpdqT5zVj gqnQbTRq/uezvAs4IW0g53I4X+5U0GwmSR4eqE5sSg3UZIsdMkB1+jYoVRaKgbDth+aL n2GYQxUw3K5Yfnnw0XzA+yX/vrJJCzCXshlUYkLZKYIRER4wqH2MwAhzc7Jp2h7DLL4j GbiQ== 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=1Qptpi5ZXCWWhGabaVYnRUPSo5aols17T9smE2d6tTA=; b=s+NriEXqYubaBSBLZ3aKKyUd6GD449LkA4g7+1uTRNX4wYShET2iyOvJXIRMbdv2gC meTjbU/TQxKPWF25/LdisE3AmsDKGCY34SVK5VBm0bOHkk7ll6SCogM3iwzcCQlMTm4r iZAU7YSJ5HUnAQVAYvi18Tkoy1V4zglGHGZ7QFJ+kc7K9pYV23Ey3WVANqIOoxGINZym 8GIA6xGtMBy8CtYRksQIJOLVVinbmGK8ghnwnVCDTfHI7xdSlaWq5SkTtTHmmIlKVdEF PHAy6GYljoU3og8IssSTK5AF76Ss9TyFukXb0yRW/gsbOh6rURt8iqctl9C50AVRdDtm 1rsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MRmvi40S; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si7066617plo.820.2018.01.18.03.02.57; Thu, 18 Jan 2018 03:03:11 -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=fail header.i=@gmail.com header.s=20161025 header.b=MRmvi40S; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755618AbeARKLV (ORCPT + 99 others); Thu, 18 Jan 2018 05:11:21 -0500 Received: from mail-oi0-f65.google.com ([209.85.218.65]:44588 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755368AbeARKLP (ORCPT ); Thu, 18 Jan 2018 05:11:15 -0500 Received: by mail-oi0-f65.google.com with SMTP id g128so15280478oib.11; Thu, 18 Jan 2018 02:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1Qptpi5ZXCWWhGabaVYnRUPSo5aols17T9smE2d6tTA=; b=MRmvi40SP1+gMq1v+HeFwm3qLKnZ6JyY7UQItMjaUh+Q0vcUDmXYwpS5Yg5L//kZjz +1HXnd4+H3cl1BY+Uo/4yepKHloNF+7YxTovqHPU/Q79Sg3q8gNdj0wq57/1YcPALOl3 yehDbLx8grMj1qHOHo+aCaPQBfkwaWGWilvYKMrjU6K1DY34nnzuBPEx0sNDnnD+eC51 RbryPQ9rBcc8NuHuS0YYuUgP6rE610yooq4rQhafBU/YvUrIVaOC6sQha8MC7tdxjOCy NnipnkD+ixCMD8iYrk2pTKxIziSibQBVHmMuzykQOFI5johkSLOHQz3poxsM781WtBo6 e6zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=1Qptpi5ZXCWWhGabaVYnRUPSo5aols17T9smE2d6tTA=; b=MseePKLV+8jy9kmIi+l7LS0L+3o92ZGMgKuNh9MwMnKAUyD050afGk0Z6KXHYmgvqN HTLGN1N9LDk6iKXEZg1tYqmEwmDdmj2eNPifkkZbqyvJaKSY3N5iiANTqC5L9JL8WYPl JIJFLHdTVU+3Q1sylFwSBxn9qiSnjNmOMJ7d/LJx6UUVZdHiDDlqzvrHOIfiZ99DEUHj r92OyHzs8M/mV8FfPiL8I/pbwiRHUsxsSeuoO8rk/GQmJQrPABEQu7GZBaepEpAVw6Sn 3yXMplaxrfQ2MwsMOfqh1/mofLCC1Z5HzqnmURhyRHzyOC+igxAk1Y52rznmhQMLSMPD UBNg== X-Gm-Message-State: AKwxyteLgqsSMDaoeC3D1uw8UBNav/uWGpSVJALpyKPMqogUyd73pAQ3 tEFUPWIw1wTOgXfUZZYd9CO28u5g+WNVV/WmmII= X-Received: by 10.202.86.22 with SMTP id k22mr2400492oib.283.1516270274302; Thu, 18 Jan 2018 02:11:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.17.89 with HTTP; Thu, 18 Jan 2018 02:11:13 -0800 (PST) In-Reply-To: <5930d2df872116555cc553284b6c111dce29e298.1515766253.git.green.hu@gmail.com> References: <5930d2df872116555cc553284b6c111dce29e298.1515766253.git.green.hu@gmail.com> From: Arnd Bergmann Date: Thu, 18 Jan 2018 11:11:13 +0100 X-Google-Sender-Auth: tUaMF_jsH_vwH9kOszd2JlZzY6k Message-ID: Subject: Re: [PATCH v6 06/36] nds32: Kernel booting and initialization To: Greentime Hu 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 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. > +extern struct mm_struct init_mm; init_mm is declared in linux/mm_types.h, so you should need another declaration. In general, you should never put 'extern' declarations in to .c files anyway. > + > +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 > +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? > +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? Arnd