Received: by 10.223.185.116 with SMTP id b49csp3724430wrg; Tue, 6 Mar 2018 04:03:03 -0800 (PST) X-Google-Smtp-Source: AG47ELtKqnzha9aW35JLyVTjvtLIs30fRM//oxyfZGXfp2C+Te8Q2ZIim5h0lDegJZTCLu56Ll63 X-Received: by 10.98.166.85 with SMTP id t82mr18542438pfe.237.1520337782957; Tue, 06 Mar 2018 04:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520337782; cv=none; d=google.com; s=arc-20160816; b=dzDZxusj5gC/2wZOhnlj18nPi7MxnthZxUik4ZeyAtFqUB7DTtHFy+3tUAQsTKCB6M scXuSSTtLsgEhvEF5vnrAZ63Segg7XQwexNTH8ohsHT0EAZoaI4/CjFgV6sUFgXXI35K GeU37wkeLVdFdMYuKbS7zeWCAzufKlNF3eaJZ9sdSVAxwF/ZegVOFxYFtpW7FN2oaier RygNc9F7w4PzvTDsG+ha+fyw3deVaiJ6mA2WkbBgFnfWo7kp41QHFytNpSgtAoTTrw/X SbbVVErAEkUX+9tY5PaUTfSAic8fVjHX/+1JlVhELBjwaBRcu3+9er2kLIPelxCw7aS4 Qe8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=nnQNd2zARH5mPL3zZGagxnm2RUlkVLstyZLYqwH9I7A=; b=dL2uFQVuSXHWRrgtoEG/+7VLmuBE5FJSQ84HipWR+OsmFwNkfNBfkh/M9K0ae1xCHy XzJlZAmqd8mTY0DVbdxkKWsc107CAiUfdYtvqtTB3QiZkF9UsO6PGZ1OmrcRzmZNSEDX 9CtVooH3CZXDjctKDfRobCgoybxwHrT5DkToYDKs7ZQwl+y9Y4ffy04otGQS9xNb6Blw 81buM3NebJxL9zuM4foVTCVb4KwkSEkSisRLQLKeFViGpyuO+3mg5E1kqVyj6Y4G0bFM llJSh+YfjVzo8FQzX2+cOkyF65E7tzakWAWrEb3HasWZ9mcVj09kbNHsqDOcT6ofnbcb Qnxw== ARC-Authentication-Results: i=1; mx.google.com; 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 l5-v6si11388273pls.438.2018.03.06.04.02.48; Tue, 06 Mar 2018 04:03:02 -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; 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 S1753633AbeCFMAg (ORCPT + 99 others); Tue, 6 Mar 2018 07:00:36 -0500 Received: from mail.bootlin.com ([62.4.15.54]:59863 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753520AbeCFMAf (ORCPT ); Tue, 6 Mar 2018 07:00:35 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id A3BE6207A3; Tue, 6 Mar 2018 13:00:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 4CA33203A0; Tue, 6 Mar 2018 13:00:22 +0100 (CET) Date: Tue, 6 Mar 2018 13:00:23 +0100 From: Alexandre Belloni To: James Hogan Cc: Ralf Baechle , Allan Nielsen , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Paul Burton Subject: Re: [PATCH v4 5/6] MIPS: generic: Add support for Microsemi Ocelot Message-ID: <20180306120023.GS3035@piout.net> References: <20180302224811.26840-1-alexandre.belloni@bootlin.com> <20180302224811.26840-6-alexandre.belloni@bootlin.com> <20180303002528.GE4197@saruman> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180303002528.GE4197@saruman> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/2018 at 00:25:29 +0000, James Hogan wrote: > Similarly if the platform is little endian only, you could also add: > # require CONFIG_CPU_LITTLE_ENDIAN=y > It supports big endian. > > + > > +CONFIG_LEGACY_BOARD_OCELOT=y > > + > > +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y > > Hmm, can this break any other generic platforms that already make the > DTB command line override the arcs_cmdline? Paul? > > I.e. In arch_mem_init() the condition of copying arcs_cmdline to > boot_command_line would switch from !boot_command_line[0] to > arcs_cmdline[0]. I suppose arcs_cmdline[] may not have been written in > those cases. If its safe then it should probably be a standard thing > selected by MIPS_GENERIC instead of a board specific thing. > Actually, this is not needed so I'm removing it. > > +CONFIG_MAGIC_SYSRQ=y > > Perhaps its worth adding this to the base generic_defconfig if its > useful to have. > Our test automation tool is using it to reboot the platform but I don't know if this is useful for anybody else. > > +static __init bool ocelot_detect(void) > > +{ > > + u32 rev; > > + > > + rev = __raw_readl((void *)DEVCPU_GCB_CHIP_REGS_CHIP_ID); > > Isn't that an address in the user segment, i.e. TLB mapped virtual > memory? Does the bootloader set up a wired mapping for it or something? > > The address looks similar to UART_UART which is given to ioremap so must > be a physical address. Perhaps the mapping you're using is 1:1 > virtual:physical address? > > If its using a TLB mapping, then: > 1) That isn't safe this early to run on other platforms, as it'll give a > TLB refill exception. It should be quite possible to detect such a > mapping to make it safer though. > 2) If yamon initialises the TLB to a known state, then that may well be > a hacky but workable way to distinguish yamon (sead3) from redboot > (mscc) in future. > Yes, this is an identity mapping that is installed by redboot because all the peripherals are in the user segment. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com