diff mbox series

soc: amlogic: meson-gx-socinfo: Fix S905X3 ID

Message ID 20200604044808.30995-1-christianshewitt@gmail.com (mailing list archive)
State Superseded
Headers show
Series soc: amlogic: meson-gx-socinfo: Fix S905X3 ID | expand

Commit Message

Christian Hewitt June 4, 2020, 4:48 a.m. UTC
The current value is taken from Amlogic's 4.9 bsp kernel which appears
to use the wrong ID. For comparison, here's before/after:

[    0.152237] soc soc0: Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2) Detected
[    0.152463] soc soc0: Amlogic Meson SM1 (S905X3) Revision 2b:c (10:2) Detected

Fixes c9cc9bec36d0 ("soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs")
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 drivers/soc/amlogic/meson-gx-socinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neil Armstrong June 8, 2020, 8:58 a.m. UTC | #1
Hi,

On 04/06/2020 06:48, Christian Hewitt wrote:
> The current value is taken from Amlogic's 4.9 bsp kernel which appears
> to use the wrong ID. For comparison, here's before/after:
> 
> [    0.152237] soc soc0: Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2) Detected
> [    0.152463] soc soc0: Amlogic Meson SM1 (S905X3) Revision 2b:c (10:2) Detected

For SM1 we have weird values, here are the one we gen on KernelCI:
SEI610 (S905D3):
Amlogic Meson SM1 (Unknown) Revision 2b:c (50:2)

VIM3L (S905D3)
Amlogic Meson SM1 (Unknown) Revision 2b:c (4:2)

And you report now:
Odroid-C4 (S905X4)
Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2)

And at the time you reported:
VIM3L (S905D3)
Amlogic Meson SM1 (S905D3) Revision 2b:c (b0:2)

So I'm quite lost here....

Neil

> 
> Fixes c9cc9bec36d0 ("soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 IDs")
> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>  drivers/soc/amlogic/meson-gx-socinfo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c
> index 01fc0d20a70d..c38a1e4db28b 100644
> --- a/drivers/soc/amlogic/meson-gx-socinfo.c
> +++ b/drivers/soc/amlogic/meson-gx-socinfo.c
> @@ -68,7 +68,7 @@ static const struct meson_gx_package_id {
>  	{ "S905X2", 0x28, 0x40, 0xf0 },
>  	{ "S922X", 0x29, 0x40, 0xf0 },
>  	{ "A311D", 0x29, 0x10, 0xf0 },
> -	{ "S905X3", 0x2b, 0x5, 0xf },
> +	{ "S905X3", 0x2b, 0x10, 0xf0 },
>  	{ "S905D3", 0x2b, 0xb0, 0xf0 },
>  	{ "A113L", 0x2c, 0x0, 0xf8 },
>  };
>
Christian Hewitt June 8, 2020, 11:32 a.m. UTC | #2
> On 8 Jun 2020, at 12:58 pm, Neil Armstrong <narmstrong@baylibre.com> wrote:
> 
>> The current value is taken from Amlogic's 4.9 bsp kernel which appears
>> to use the wrong ID. For comparison, here's before/after:
>> 
>> [    0.152237] soc soc0: Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2) Detected
>> [    0.152463] soc soc0: Amlogic Meson SM1 (S905X3) Revision 2b:c (10:2) Detected
> 
> For SM1 we have weird values, here are the one we gen on KernelCI:
> SEI610 (S905D3):
> Amlogic Meson SM1 (Unknown) Revision 2b:c (50:2)
> 
> VIM3L (S905D3)
> Amlogic Meson SM1 (Unknown) Revision 2b:c (4:2)
> 
> And you report now:
> Odroid-C4 (S905X4)
> Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2)
> 
> And at the time you reported:
> VIM3L (S905D3)
> Amlogic Meson SM1 (S905D3) Revision 2b:c (b0:2)
> 
> So I'm quite lost here….

In [1] you added the SM1 SoC ID and S905X3 ID { "S905X3", 0x2b, 0x5, 0xf }
which matches the BSP kernel source.

In [2] I added a second S905X3 ID { "S905X3", 0x2b, 0xb0, 0xf2 } for VIM3L, but
this was a mistake (the chip is S905D3) so [3] corrected it to { "S905D3", 0x2b,
0xb0, 0xf0 } which matches my VIM3L board. If the VIM3L’s in KernelCI now show
"2b:c (4:2)” it looks there has been a package change (silicon fixes?) and we
need to add another S905D3 package ID.

In the last week I helped three different users install LE on S905X3 Android
box devices, all of which declare "2b:c (10:2)” as the SoC ID, which matches
the only S905X3 device I own (Odroid C4). So I assumed the BSP is wrong and
sent this fix patch.

If SEI610 is S905X3 (implied by the original SM1 submission from you) KernelCI
output shows the current ID is wrong (‘Unknown’) so we probably need to fix it
with { "S905X3", 0x2b, 0x50, 0xf0 } then add new S905D3 (VIM3L) and S905X3 (as
per this patch) IDs.

If SEI610 is S905D3 (as stated in this thread) the fix in this patch is still
correct, but we also need to send a second patch to add two new S905D3 package
IDs (SEI610 + VIM3L).

I’ll ping you off-list to discuss.

Christian

[1] c9cc9bec36d0 ("soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 ID”)
[2] 1d7c541b8a5b ("soc: amlogic: meson-gx-socinfo: Add S905X3 ID for VIM3L”)
[3] fdfc6997bd08 ("soc: amlogic: meson-gx-socinfo: Fix S905D3 ID for VIM3L”)
Neil Armstrong June 8, 2020, 12:45 p.m. UTC | #3
On 08/06/2020 13:32, Christian Hewitt wrote:
> 
>> On 8 Jun 2020, at 12:58 pm, Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>>> The current value is taken from Amlogic's 4.9 bsp kernel which appears
>>> to use the wrong ID. For comparison, here's before/after:
>>>
>>> [    0.152237] soc soc0: Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2) Detected
>>> [    0.152463] soc soc0: Amlogic Meson SM1 (S905X3) Revision 2b:c (10:2) Detected
>>
>> For SM1 we have weird values, here are the one we gen on KernelCI:
>> SEI610 (S905D3):
>> Amlogic Meson SM1 (Unknown) Revision 2b:c (50:2)
>>
>> VIM3L (S905D3)
>> Amlogic Meson SM1 (Unknown) Revision 2b:c (4:2)
>>
>> And you report now:
>> Odroid-C4 (S905X4)
>> Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2)
>>
>> And at the time you reported:
>> VIM3L (S905D3)
>> Amlogic Meson SM1 (S905D3) Revision 2b:c (b0:2)
>>
>> So I'm quite lost here….
> 
> In [1] you added the SM1 SoC ID and S905X3 ID { "S905X3", 0x2b, 0x5, 0xf }
> which matches the BSP kernel source.
> 
> In [2] I added a second S905X3 ID { "S905X3", 0x2b, 0xb0, 0xf2 } for VIM3L, but
> this was a mistake (the chip is S905D3) so [3] corrected it to { "S905D3", 0x2b,
> 0xb0, 0xf0 } which matches my VIM3L board. If the VIM3L’s in KernelCI now show
> "2b:c (4:2)” it looks there has been a package change (silicon fixes?) and we
> need to add another S905D3 package ID.
> 
> In the last week I helped three different users install LE on S905X3 Android
> box devices, all of which declare "2b:c (10:2)” as the SoC ID, which matches
> the only S905X3 device I own (Odroid C4). So I assumed the BSP is wrong and
> sent this fix patch.
> 
> If SEI610 is S905X3 (implied by the original SM1 submission from you) KernelCI
> output shows the current ID is wrong (‘Unknown’) so we probably need to fix it
> with { "S905X3", 0x2b, 0x50, 0xf0 } then add new S905D3 (VIM3L) and S905X3 (as
> per this patch) IDs.
> 
> If SEI610 is S905D3 (as stated in this thread) the fix in this patch is still
> correct, but we also need to send a second patch to add two new S905D3 package
> IDs (SEI610 + VIM3L).
> 
> I’ll ping you off-list to discuss.

OK, we have 5 different values :
S905X3	05	0000 0101	(first SEI610 support, early samples)
S905X3	10	0001 0000	(recent S905X3 android boxes, inc Odroid-C4)
S905X3  50	0101 0000	(SEI610 kernelci report, new SEI610 revision)

S905D3  04	0000 0100	(VIM3L in kernelci)
S905D3  b0	1011 0000	(VIM3L)

Seems the early S905X3/S905D3 samples used the low 4 bits to setup the revision.
And the mass-production ones uses the higher 4 bits.

So we can detect all these with the following bits & mask:
	/* Early SM1 Samples */
        { "S905X3", 0x2b, 0x5  0xf5 },
        { "S905D3", 0x2b, 0x4  0xf5 },
	/* Mass production SM1 */
        { "S905X3", 0x2b, 0x10, 0x3f },
        { "S905D3", 0x2b, 0x30  0x3f },

Neil

> 
> Christian
> 
> [1] c9cc9bec36d0 ("soc: amlogic: meson-gx-socinfo: Add SM1 and S905X3 ID”)
> [2] 1d7c541b8a5b ("soc: amlogic: meson-gx-socinfo: Add S905X3 ID for VIM3L”)
> [3] fdfc6997bd08 ("soc: amlogic: meson-gx-socinfo: Fix S905D3 ID for VIM3L”)
> 
>
diff mbox series

Patch

diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c
index 01fc0d20a70d..c38a1e4db28b 100644
--- a/drivers/soc/amlogic/meson-gx-socinfo.c
+++ b/drivers/soc/amlogic/meson-gx-socinfo.c
@@ -68,7 +68,7 @@  static const struct meson_gx_package_id {
 	{ "S905X2", 0x28, 0x40, 0xf0 },
 	{ "S922X", 0x29, 0x40, 0xf0 },
 	{ "A311D", 0x29, 0x10, 0xf0 },
-	{ "S905X3", 0x2b, 0x5, 0xf },
+	{ "S905X3", 0x2b, 0x10, 0xf0 },
 	{ "S905D3", 0x2b, 0xb0, 0xf0 },
 	{ "A113L", 0x2c, 0x0, 0xf8 },
 };