[Top] [All Lists]

Re: [PATCH] Enable AT_PLATFORM for Loongson 2F CPU

To: David Daney <>
Subject: Re: [PATCH] Enable AT_PLATFORM for Loongson 2F CPU
From: Robert Millan <>
Date: Mon, 8 Nov 2010 23:27:40 +0100
Cc: Aurelien Jarno <>, Ralf Baechle <>,
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=ZTb9WojDWbYsd/XAjh8i+u3HyvrzA9UuXFiKGnUjPmA=; b=cb/bUFncvczQ1Pd4iHqlp8uhcvJ//GNmM/uOrIe6mlI6B66a/mwQ+0XKImNj+zx541 UZvlNusmyVMblTBI4xfUYLwSr9l/xXzOJzKmVcs6WvqEhNhntw6808/F7uW+Koi6qXpE BK+B0wxDEzgmRYuY2mxTKwyVnz5w07fFfgC6Y=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=gmenFC7vTO9N8WvtoyZBW28+9AxXFkWyisGQ6RbHHE9EELyqihwwBxGTV8sEfD9w7b q5drXKe1GuVteomGy56qpf3xZAzSFZVFsYD+iDInQvuJeLbbZfP7ItUx1RBW/XBqbnGF sXuIGVBAl8kZ7903Xe2P4ryGwFFdk2sTLyRNU=
In-reply-to: <>
Original-recipient: rfc822;
References: <1289133059.1547.0@thorin> <>
2010/11/8 David Daney <>:
> I seems weird to me that you cannot get this information from the PRId
> register.  Perhaps the documentation is defective.

Yes, I agree it's really shortsighted of them, but I don't
see any way around it.

> The Chinese version of the Loongson2E user guide seems to say something
> about the two lower nibbles of the PRId, but being a non-chinese reader, I
> have no idea if it would be relevant.
> I would think that the low order bits of the register can reliably
> differentiate these two parts.

There are English versions for both 2E and 2F.  See page 66
of the Loongson 2F document:

The revision number can distinguish some chip revisions, however there
is no guarantee
that changes to the chip will necessarily be reflected in the PRId
register, or that changes to
the revision number necessarily reflect real chip changes. For this
reason, software should
not rely on the revision number in the PRId register to characterize the chip.

Page 72 of the Loongson 2E document
( has the
same text.

In both documents, the lower byte is defined as "Revision number",
and its value is 0x02 (for both 2E and 2F).

If you'd rather not assume the docs are correct, I can test if
my Yeeloong (Loongson 2F) has 0x02, but then in case it's
something higher, would you be willing to assume:

  rev <= 0x02  -->  2E
  rev > 0x02  --> 2F

or similar logic?  This seems risky if we take into account
that there's no guarantee from the vendor.

Robert Millan

<Prev in Thread] Current Thread [Next in Thread>